Remove SetDllDirectory as it caused crashes
authorCharles Giessen <charles@lunarg.com>
Tue, 16 Jul 2024 19:10:06 +0000 (14:10 -0500)
committerCharles Giessen <46324611+charles-lunarg@users.noreply.github.com>
Tue, 16 Jul 2024 19:26:00 +0000 (14:26 -0500)
The removal of the current directory from windows Dll searching then using
the default search paths caused a crash in a shipping application. This
requires removal of the offending calls while a better solution for making
LoadLibrary not use the current directory is developed.

loader/loader_windows.c

index 74a9d7230509a128857b68baf853e92f58456875..7bc66cdf7f1feadc1ab61680accf72da9f2a615d 100644 (file)
@@ -77,11 +77,9 @@ void windows_initialization(void) {
         loader_log(NULL, VULKAN_LOADER_INFO_BIT, 0, "Using Vulkan Loader %s", dll_location);
     }
 
-    SetDllDirectory("");  // Remove current directory from default DLL search order
     // This is needed to ensure that newer APIs are available right away
     // and not after the first call that has been statically linked
     LoadLibrary("gdi32.dll");
-    SetDllDirectory(NULL);  // Restores the default search order
 
     wchar_t systemPath[MAX_PATH] = L"";
     GetSystemDirectoryW(systemPath, MAX_PATH);