consistently use TEXT() macro with LoadLibrary() and GetModuleHandle()

cf. bug #5435.
This commit is contained in:
Ozkan Sezer 2021-01-04 01:23:50 +03:00
parent 91a831e2d0
commit 01a2f27679
12 changed files with 15 additions and 15 deletions

View file

@ -215,7 +215,7 @@ SDL_CreateCond(void)
/* Link statically on this platform */
impl = &SDL_cond_impl_srw;
#else
HMODULE kernel32 = GetModuleHandleW(L"kernel32.dll");
HMODULE kernel32 = GetModuleHandle(TEXT("kernel32.dll"));
if (kernel32) {
pWakeConditionVariable = (pfnWakeConditionVariable) GetProcAddress(kernel32, "WakeConditionVariable");
pWakeAllConditionVariable = (pfnWakeAllConditionVariable) GetProcAddress(kernel32, "WakeAllConditionVariable");

View file

@ -275,7 +275,7 @@ SDL_CreateMutex(void)
impl = &SDL_mutex_impl_srw;
#else
/* Try faster implementation for Windows 7 and newer */
HMODULE kernel32 = GetModuleHandleW(L"kernel32.dll");
HMODULE kernel32 = GetModuleHandle(TEXT("kernel32.dll"));
if (kernel32) {
/* Requires Vista: */
pReleaseSRWLockExclusive = (pfnReleaseSRWLockExclusive) GetProcAddress(kernel32, "ReleaseSRWLockExclusive");

View file

@ -415,7 +415,7 @@ SDL_CreateSemaphore(Uint32 initial_value)
* Microsoft our specific use case is legal and correct:
* https://github.com/microsoft/STL/pull/593#issuecomment-655799859
*/
HMODULE synch120 = GetModuleHandleW(L"api-ms-win-core-synch-l1-2-0.dll");
HMODULE synch120 = GetModuleHandle(TEXT("api-ms-win-core-synch-l1-2-0.dll"));
if (synch120) {
/* Try to load required functions provided by Win 8 or newer */
pWaitOnAddress = (pfnWaitOnAddress) GetProcAddress(synch120, "WaitOnAddress");

View file

@ -163,7 +163,7 @@ SDL_SYS_SetupThread(const char *name)
static HMODULE kernel32 = 0;
if (!kernel32) {
kernel32 = GetModuleHandleW(L"kernel32.dll");
kernel32 = GetModuleHandle(TEXT("kernel32.dll"));
if (kernel32) {
pSetThreadDescription = (pfnSetThreadDescription) GetProcAddress(kernel32, "SetThreadDescription");
}