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 88
99#include < CL/sycl/detail/defines.hpp>
1010
11+ #include < cassert>
1112#include < string>
1213#include < windows.h>
1314#include < winreg.h>
@@ -26,8 +27,15 @@ void *loadOsLibrary(const std::string &PluginPath) {
2627 // NOTE: we restore the old mode to not affect user app behavior.
2728 //
2829 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+ }
2934 auto Result = (void *)LoadLibraryA (PluginPath.c_str ());
3035 (void )SetErrorMode (SavedMode);
36+ if (!SetDllDirectoryA (nullptr )) {
37+ assert (false && " Failed to restore DLL search path" );
38+ }
3139
3240 return Result;
3341}
You can’t perform that action at this time.
0 commit comments