diff --git a/meshcore/KVM/Windows/input.c b/meshcore/KVM/Windows/input.c index 3feec36..4ac8ec1 100644 --- a/meshcore/KVM/Windows/input.c +++ b/meshcore/KVM/Windows/input.c @@ -480,7 +480,7 @@ int TouchInit() { _InitializeTouchInjection init = NULL; if (g_TouchLoadLibraryState > 0) return g_TouchLoadLibraryState; - g_TouchLoadLibrary = LoadLibrary(TEXT("User32.dll")); + g_TouchLoadLibrary = LoadLibraryExA((LPCSTR)"User32.dll", NULL, LOAD_LIBRARY_SEARCH_SYSTEM32); if (g_TouchLoadLibrary == NULL) { g_TouchLoadLibraryState = 2; return 2; } init = (_InitializeTouchInjection)GetProcAddress(g_TouchLoadLibrary, "InitializeTouchInjection"); g_TouchInjectionCall = (_InjectTouchInput)GetProcAddress(g_TouchLoadLibrary, "InjectTouchInput"); diff --git a/meshcore/KVM/Windows/kvm.c b/meshcore/KVM/Windows/kvm.c index 468e375..4987fa2 100644 --- a/meshcore/KVM/Windows/kvm.c +++ b/meshcore/KVM/Windows/kvm.c @@ -210,7 +210,7 @@ DWORD WINAPI kvm_ctrlaltdel(LPVOID Param) typedef VOID (WINAPI *SendSas)(BOOL asUser); SendSas sas; HMODULE sm = NULL; - if ((sm = LoadLibrary("sas.dll")) != NULL) + if ((sm = LoadLibraryExA((LPCSTR)"sas.dll", NULL, LOAD_LIBRARY_SEARCH_SYSTEM32)) != NULL) { sas = (SendSas)GetProcAddress(sm, "SendSAS"); kvm_setupSasPermissions(); diff --git a/microscript/ILibDuktape_ScriptContainer.c b/microscript/ILibDuktape_ScriptContainer.c index 035803f..c28b95f 100644 --- a/microscript/ILibDuktape_ScriptContainer.c +++ b/microscript/ILibDuktape_ScriptContainer.c @@ -1573,7 +1573,7 @@ duk_ret_t ILibDuktape_ScriptContainer_OS_arch(duk_context *ctx) } else { - HMODULE hm = LoadLibraryA("Kernel32.dll"); + HMODULE hm = LoadLibraryExA("Kernel32.dll", NULL, LOAD_LIBRARY_SEARCH_SYSTEM32); void *func = (void*)GetProcAddress(hm, "IsWow64Process"); BOOL isWow = FALSE; diff --git a/microstack/ILibCrypto.c b/microstack/ILibCrypto.c index 2bd94e4..e4c1fcc 100644 --- a/microstack/ILibCrypto.c +++ b/microstack/ILibCrypto.c @@ -464,7 +464,7 @@ void __fastcall util_openssl_init() // Add more random seeding in Windows (This is probably useful since OpenSSL in Windows has weaker seeding) #if defined(WIN32) && !defined(_MINCORE) //RAND_screen(); // On Windows, add more random seeding using a screen dump (this is very expensive). - if ((g_hAdvLib = LoadLibrary(TEXT("ADVAPI32.DLL"))) != 0) g_CryptGenRandomPtr = (BOOLEAN(APIENTRY *)(void*, ULONG))GetProcAddress(g_hAdvLib, "SystemFunction036"); + if ((g_hAdvLib = LoadLibraryExA((LPCSTR)"ADVAPI32.DLL", NULL, LOAD_LIBRARY_SEARCH_SYSTEM32)) != 0) g_CryptGenRandomPtr = (BOOLEAN(APIENTRY *)(void*, ULONG))GetProcAddress(g_hAdvLib, "SystemFunction036"); if (g_CryptGenRandomPtr != 0 && g_CryptGenRandomPtr(tbuf, 64) != 0) RAND_add(tbuf, 64, 64); // Use this high quality random as added seeding if (g_hAdvLib != NULL) FreeLibrary(g_hAdvLib); #endif diff --git a/microstack/ILibParsers.c b/microstack/ILibParsers.c index be6f3bb..117a67b 100644 --- a/microstack/ILibParsers.c +++ b/microstack/ILibParsers.c @@ -9149,7 +9149,7 @@ long long ILibGetUptime() // Windows 7 & Vista if (ILibGetUptimeFirst) { - HMODULE hlib = LoadLibrary(TEXT("KERNEL32.DLL")); + HMODULE hlib = LoadLibraryExA((LPCSTR)"KERNEL32.DLL", NULL, LOAD_LIBRARY_SEARCH_SYSTEM32); if (hlib == NULL) return 0; pILibGetUptimeGetTickCount64 = (ULONGLONG(*)())GetProcAddress(hlib, "GetTickCount64"); ILibGetUptimeFirst = 0;