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
|
From 8dfd5804447a1f35c15e650737fee3694bc71f26 Mon Sep 17 00:00:00 2001
From: Florian Reibold <florian.reibold@intel.com>
Date: Mon, 6 Feb 2023 17:29:44 +0100
Subject: [PATCH] fix LoadLibraryA
---
src/null_platform.h | 2 +-
src/wgl_context.c | 2 +-
src/win32_init.c | 12 ++++++------
src/win32_platform.h | 2 +-
4 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/src/null_platform.h b/src/null_platform.h
index 708975d1..d916b922 100644
--- a/src/null_platform.h
+++ b/src/null_platform.h
@@ -43,7 +43,7 @@
#include "null_joystick.h"
#if defined(_GLFW_WIN32)
- #define _glfw_dlopen(name) LoadLibraryA(name)
+ #define _glfw_dlopen(name) LoadLibraryExA(name,NULL,LOAD_LIBRARY_SEARCH_SYSTEM32)
#define _glfw_dlclose(handle) FreeLibrary((HMODULE) handle)
#define _glfw_dlsym(handle, name) GetProcAddress((HMODULE) handle, name)
#else
diff --git a/src/wgl_context.c b/src/wgl_context.c
index 72ad11de..5c42fa81 100644
--- a/src/wgl_context.c
+++ b/src/wgl_context.c
@@ -416,7 +416,7 @@ GLFWbool _glfwInitWGL(void)
if (_glfw.wgl.instance)
return GLFW_TRUE;
- _glfw.wgl.instance = LoadLibraryA("opengl32.dll");
+ _glfw.wgl.instance = LoadLibraryExA("opengl32.dll",NULL,LOAD_LIBRARY_SEARCH_SYSTEM32);
if (!_glfw.wgl.instance)
{
_glfwInputErrorWin32(GLFW_PLATFORM_ERROR,
diff --git a/src/win32_init.c b/src/win32_init.c
index 885f32fa..5e698cc2 100644
--- a/src/win32_init.c
+++ b/src/win32_init.c
@@ -82,7 +82,7 @@ static GLFWbool loadLibraries(void)
return GLFW_FALSE;
}
- _glfw.win32.user32.instance = LoadLibraryA("user32.dll");
+ _glfw.win32.user32.instance = LoadLibraryExA("user32.dll",NULL,LOAD_LIBRARY_SEARCH_SYSTEM32);
if (!_glfw.win32.user32.instance)
{
_glfwInputErrorWin32(GLFW_PLATFORM_ERROR,
@@ -105,7 +105,7 @@ static GLFWbool loadLibraries(void)
_glfw.win32.user32.GetSystemMetricsForDpi_ = (PFN_GetSystemMetricsForDpi)
GetProcAddress(_glfw.win32.user32.instance, "GetSystemMetricsForDpi");
- _glfw.win32.dinput8.instance = LoadLibraryA("dinput8.dll");
+ _glfw.win32.dinput8.instance = LoadLibraryExA("dinput8.dll",NULL,LOAD_LIBRARY_SEARCH_SYSTEM32);
if (_glfw.win32.dinput8.instance)
{
_glfw.win32.dinput8.Create = (PFN_DirectInput8Create)
@@ -126,7 +126,7 @@ static GLFWbool loadLibraries(void)
for (i = 0; names[i]; i++)
{
- _glfw.win32.xinput.instance = LoadLibraryA(names[i]);
+ _glfw.win32.xinput.instance = LoadLibraryExA(names[i],NULL,LOAD_LIBRARY_SEARCH_SYSTEM32);
if (_glfw.win32.xinput.instance)
{
_glfw.win32.xinput.GetCapabilities = (PFN_XInputGetCapabilities)
@@ -139,7 +139,7 @@ static GLFWbool loadLibraries(void)
}
}
- _glfw.win32.dwmapi.instance = LoadLibraryA("dwmapi.dll");
+ _glfw.win32.dwmapi.instance = LoadLibraryExA("dwmapi.dll",NULL,LOAD_LIBRARY_SEARCH_SYSTEM32);
if (_glfw.win32.dwmapi.instance)
{
_glfw.win32.dwmapi.IsCompositionEnabled = (PFN_DwmIsCompositionEnabled)
@@ -152,7 +152,7 @@ static GLFWbool loadLibraries(void)
GetProcAddress(_glfw.win32.dwmapi.instance, "DwmGetColorizationColor");
}
- _glfw.win32.shcore.instance = LoadLibraryA("shcore.dll");
+ _glfw.win32.shcore.instance = LoadLibraryExA("shcore.dll",NULL,LOAD_LIBRARY_SEARCH_SYSTEM32);
if (_glfw.win32.shcore.instance)
{
_glfw.win32.shcore.SetProcessDpiAwareness_ = (PFN_SetProcessDpiAwareness)
@@ -161,7 +161,7 @@ static GLFWbool loadLibraries(void)
GetProcAddress(_glfw.win32.shcore.instance, "GetDpiForMonitor");
}
- _glfw.win32.ntdll.instance = LoadLibraryA("ntdll.dll");
+ _glfw.win32.ntdll.instance = LoadLibraryExA("ntdll.dll",NULL,LOAD_LIBRARY_SEARCH_SYSTEM32);
if (_glfw.win32.ntdll.instance)
{
_glfw.win32.ntdll.RtlVerifyVersionInfo_ = (PFN_RtlVerifyVersionInfo)
diff --git a/src/win32_platform.h b/src/win32_platform.h
index bf703d7e..55b8425b 100644
--- a/src/win32_platform.h
+++ b/src/win32_platform.h
@@ -289,7 +289,7 @@ typedef VkBool32 (APIENTRY *PFN_vkGetPhysicalDeviceWin32PresentationSupportKHR)(
#define _GLFW_WNDCLASSNAME L"GLFW30"
#endif
-#define _glfw_dlopen(name) LoadLibraryA(name)
+#define _glfw_dlopen(name) LoadLibraryExA(name,NULL,LOAD_LIBRARY_SEARCH_SYSTEM32)
#define _glfw_dlclose(handle) FreeLibrary((HMODULE) handle)
#define _glfw_dlsym(handle, name) GetProcAddress((HMODULE) handle, name)
--
2.38.1.windows.1
|