use WIN_StringToUTF8W instead of WIN_StringToUTF8 where needed (#2) cf. bug #5435. - SDL_wasapi_win32.c (GetWasapiDeviceName): pwszVal is WCHAR* - windows/SDL_sysfilesystem.c (SDL_GetBasePath, SDL_GetPrefPath) - windows/SDL_sysurl.c (SDL_SYS_OpenURL): wurl is WCHAR* - SDL_windowssensor.c (ConnectSensor): bstr_name is WCHAR* - windows/SDL_systhread.c (SDL_SYS_SetupThread): strw is WCHAR*
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113
diff --git a/src/audio/wasapi/SDL_wasapi_win32.c b/src/audio/wasapi/SDL_wasapi_win32.c
index 48fb66d..23b48ac 100644
--- a/src/audio/wasapi/SDL_wasapi_win32.c
+++ b/src/audio/wasapi/SDL_wasapi_win32.c
@@ -79,7 +79,7 @@ GetWasapiDeviceName(IMMDevice *device)
PROPVARIANT var;
PropVariantInit(&var);
if (SUCCEEDED(IPropertyStore_GetValue(props, &SDL_PKEY_Device_FriendlyName, &var))) {
- utf8dev = WIN_StringToUTF8(var.pwszVal);
+ utf8dev = WIN_StringToUTF8W(var.pwszVal);
}
PropVariantClear(&var);
IPropertyStore_Release(props);
diff --git a/src/filesystem/windows/SDL_sysfilesystem.c b/src/filesystem/windows/SDL_sysfilesystem.c
index d57a6df..a1e2874 100644
--- a/src/filesystem/windows/SDL_sysfilesystem.c
+++ b/src/filesystem/windows/SDL_sysfilesystem.c
@@ -93,7 +93,7 @@ SDL_GetBasePath(void)
SDL_assert(i > 0); /* Should have been an absolute path. */
path[i+1] = '\0'; /* chop off filename. */
- retval = WIN_StringToUTF8(path);
+ retval = WIN_StringToUTF8W(path);
SDL_free(path);
return retval;
@@ -130,13 +130,13 @@ SDL_GetPrefPath(const char *org, const char *app)
return NULL;
}
- worg = WIN_UTF8ToString(org);
+ worg = WIN_UTF8ToStringW(org);
if (worg == NULL) {
SDL_OutOfMemory();
return NULL;
}
- wapp = WIN_UTF8ToString(app);
+ wapp = WIN_UTF8ToStringW(app);
if (wapp == NULL) {
SDL_free(worg);
SDL_OutOfMemory();
@@ -181,7 +181,7 @@ SDL_GetPrefPath(const char *org, const char *app)
lstrcatW(path, L"\\");
- retval = WIN_StringToUTF8(path);
+ retval = WIN_StringToUTF8W(path);
return retval;
}
diff --git a/src/misc/windows/SDL_sysurl.c b/src/misc/windows/SDL_sysurl.c
index 4bc340c..3d42692 100644
--- a/src/misc/windows/SDL_sysurl.c
+++ b/src/misc/windows/SDL_sysurl.c
@@ -37,7 +37,7 @@ SDL_SYS_OpenURL(const char *url)
return WIN_SetErrorFromHRESULT("CoInitialize failed", hr);
}
- wurl = WIN_UTF8ToString(url);
+ wurl = WIN_UTF8ToStringW(url);
if (wurl == NULL) {
WIN_CoUninitialize();
return SDL_OutOfMemory();
diff --git a/src/misc/winrt/SDL_sysurl.cpp b/src/misc/winrt/SDL_sysurl.cpp
index 063592b..1fdb14d 100644
--- a/src/misc/winrt/SDL_sysurl.cpp
+++ b/src/misc/winrt/SDL_sysurl.cpp
@@ -18,8 +18,7 @@
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
-
-#include <Windows.h>
+#include <windows.h>
#include "../../core/windows/SDL_windows.h"
#include "../SDL_sysurl.h"
@@ -27,7 +26,7 @@
int
SDL_SYS_OpenURL(const char *url)
{
- WCHAR *wurl = WIN_UTF8ToString(url);
+ WCHAR *wurl = WIN_UTF8ToStringW(url);
if (!wurl) {
return SDL_OutOfMemory();
}
diff --git a/src/sensor/windows/SDL_windowssensor.c b/src/sensor/windows/SDL_windowssensor.c
index 30f38a4..140a8fe 100644
--- a/src/sensor/windows/SDL_windowssensor.c
+++ b/src/sensor/windows/SDL_windowssensor.c
@@ -279,7 +279,7 @@ static int ConnectSensor(ISensor *sensor)
hr = ISensor_GetFriendlyName(sensor, &bstr_name);
if (SUCCEEDED(hr) && bstr_name) {
- name = WIN_StringToUTF8(bstr_name);
+ name = WIN_StringToUTF8W(bstr_name);
} else {
name = SDL_strdup("Unknown Sensor");
}
diff --git a/src/thread/windows/SDL_systhread.c b/src/thread/windows/SDL_systhread.c
index ea6b489..35ea0ca 100644
--- a/src/thread/windows/SDL_systhread.c
+++ b/src/thread/windows/SDL_systhread.c
@@ -170,7 +170,7 @@ SDL_SYS_SetupThread(const char *name)
}
if (pSetThreadDescription != NULL) {
- WCHAR *strw = WIN_UTF8ToString(name);
+ WCHAR *strw = WIN_UTF8ToStringW(name);
if (strw) {
pSetThreadDescription(GetCurrentThread(), strw);
SDL_free(strw);