File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change 8
8
9
9
#include < CL/sycl/detail/defines.hpp>
10
10
11
+ #include < cassert>
11
12
#include < string>
12
13
#include < windows.h>
13
14
#include < winreg.h>
@@ -26,8 +27,15 @@ void *loadOsLibrary(const std::string &PluginPath) {
26
27
// NOTE: we restore the old mode to not affect user app behavior.
27
28
//
28
29
UINT SavedMode = SetErrorMode (SEM_FAILCRITICALERRORS);
30
+ // Exclude current directory from DLL search path
31
+ if (!SetDllDirectoryA (" " )) {
32
+ assert (false && " Failed to update DLL search path" );
33
+ }
29
34
auto Result = (void *)LoadLibraryA (PluginPath.c_str ());
30
35
(void )SetErrorMode (SavedMode);
36
+ if (!SetDllDirectoryA (nullptr )) {
37
+ assert (false && " Failed to restore DLL search path" );
38
+ }
31
39
32
40
return Result;
33
41
}
You can’t perform that action at this time.
0 commit comments