diff --git a/src/locale/windows/SDL_syslocale.c b/src/locale/windows/SDL_syslocale.c index 1252046cf..d4159bb17 100644 --- a/src/locale/windows/SDL_syslocale.c +++ b/src/locale/windows/SDL_syslocale.c @@ -23,9 +23,9 @@ #include "../../core/windows/SDL_windows.h" #include "../SDL_syslocale.h" -typedef BOOL (WINAPI *pfnGetUserPreferredUILanguages)(DWORD,PULONG,/*PZZWSTR*/WCHAR*,PULONG); +typedef BOOL (WINAPI *pfnGetUserPreferredUILanguages)(DWORD,PULONG,WCHAR*,PULONG); #ifndef MUI_LANGUAGE_NAME -#define MUI_LANGUAGE_NAME 0x8 +#define MUI_LANGUAGE_NAME 0x8 #endif static pfnGetUserPreferredUILanguages pGetUserPreferredUILanguages = NULL; @@ -39,11 +39,11 @@ SDL_SYS_GetPreferredLocales_winxp(char *buf, size_t buflen) char lang[16]; char country[16]; - const int langrc = GetLocaleInfoA(LOCALE_USER_DEFAULT, + const int langrc = GetLocaleInfoA(LOCALE_USER_DEFAULT, LOCALE_SISO639LANGNAME, lang, sizeof (lang)); - const int ctryrc = GetLocaleInfoA(LOCALE_USER_DEFAULT, + const int ctryrc = GetLocaleInfoA(LOCALE_USER_DEFAULT, LOCALE_SISO3166CTRYNAME, country, sizeof (country)); @@ -100,7 +100,7 @@ void SDL_SYS_GetPreferredLocales(char *buf, size_t buflen) { if (!kernel32) { - kernel32 = LoadLibraryW(L"kernel32.dll"); + kernel32 = GetModuleHandleW(L"kernel32.dll"); if (kernel32) { pGetUserPreferredUILanguages = (pfnGetUserPreferredUILanguages) GetProcAddress(kernel32, "GetUserPreferredUILanguages"); } diff --git a/src/thread/windows/SDL_systhread.c b/src/thread/windows/SDL_systhread.c index 7e3269b2b..637129b27 100644 --- a/src/thread/windows/SDL_systhread.c +++ b/src/thread/windows/SDL_systhread.c @@ -163,7 +163,7 @@ SDL_SYS_SetupThread(const char *name) static HMODULE kernel32 = 0; if (!kernel32) { - kernel32 = LoadLibraryW(L"kernel32.dll"); + kernel32 = GetModuleHandleW(L"kernel32.dll"); if (kernel32) { pSetThreadDescription = (pfnSetThreadDescription) GetProcAddress(kernel32, "SetThreadDescription"); }