qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Implement SSH commands in QEMU GA for Windows


From: Marc-André Lureau
Subject: Re: [PATCH] Implement SSH commands in QEMU GA for Windows
Date: Wed, 20 Mar 2024 15:20:56 +0400

Hi

On Wed, Mar 20, 2024 at 12:39 AM <aidan_leuck@selinc.com> wrote:
> +// Converts from a standard string to a Windows wide string.
> +// it is a 16-bit wide character used to store Unicode encoded as UTF-16LE/
> +// some Windows API functions require this format of the string as opposed 
> to just
> +// the normal c char*. This function attempts to convert a standard string to
> +// a wide string if it is possible. Some multibyte characters are not 
> supported
> +// so it could throw an error.
> +// Read more here:
> +// 
> https://learn.microsoft.com/en-us/cpp/cpp/char-wchar-t-char16-t-char32-t?view=msvc-170
> +// parameters:
> +// string - String to convert to a wchar.
> +// errp - Error pointer that will set errors if they are converted
> +// returns - The converted string or NULL if an error occurs.
> +static wchar_t *string_to_wide(const char *string, Error **errp)
> +{

There is g_utf8_to_utf16() which can be cast to wchar_t, iirc, that's
how glib converts string for w32 api



-- 
Marc-André Lureau



reply via email to

[Prev in Thread] Current Thread [Next in Thread]