From 117eb7ecf8b87432532c9aea1b7273bc08e1166d Mon Sep 17 00:00:00 2001 From: Jesse Archer Date: Thu, 26 Jun 2025 03:29:02 -0700 Subject: [PATCH] Use LoadLibraryExA instead of LoadLibraryA Slangpy uses AddDllDirectory to specify locations of Slang DLL files. LoadLibraryA ignores this so instead use LoadLibraryExA. --- source/core/slang-platform.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/core/slang-platform.cpp b/source/core/slang-platform.cpp index 51f6b97c758..2c2bdd25e7e 100644 --- a/source/core/slang-platform.cpp +++ b/source/core/slang-platform.cpp @@ -119,8 +119,8 @@ SLANG_COMPILE_TIME_ASSERT(E_OUTOFMEMORY == SLANG_E_OUT_OF_MEMORY); return SLANG_OK; } - // https://docs.microsoft.com/en-us/windows/desktop/api/libloaderapi/nf-libloaderapi-loadlibrarya - const HMODULE h = LoadLibraryA(platformFileName); + // https://learn.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-loadlibraryexa + const HMODULE h = LoadLibraryExA(platformFileName, nullptr, LOAD_LIBRARY_SEARCH_DEFAULT_DIRS); if (!h) { const DWORD lastError = GetLastError();