Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change the way we load level zero DLL on windows. #636

Merged
merged 1 commit into from
Oct 26, 2021

Conversation

diptorupd
Copy link
Contributor

Use LoadLibraryExA instead of LoadLibraryA to mitigate a possible DLL injection issue when we load the Level zero DLL on windows.

@@ -55,7 +55,8 @@ class DynamicLibHelper final
#ifdef __linux__
_handle = dlopen(libName, flag);
#elif defined(_WIN32) || defined(_WIN64)
_handle = LoadLibraryA(libName);
_handle =
LoadLibraryExA(libName, nullptr, LOAD_LIBRARY_SEARCH_SYSTEM32);
Copy link
Collaborator

@oleksandr-pavlyk oleksandr-pavlyk Oct 25, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should Windows include "libloaderapi.h" instead of "windows.h" ?

https://docs.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-loadlibraryexa

@coveralls
Copy link
Collaborator

coveralls commented Oct 25, 2021

Coverage Status

Coverage remained the same at 74.511% when pulling d43b799 on diptorupd:fix/dll_load into da13887 on IntelPython:master.

@oleksandr-pavlyk
Copy link
Collaborator

Can you rebase your changes on top of the current master, rather than release/0.10 ?

@diptorupd diptorupd force-pushed the fix/dll_load branch 2 times, most recently from 53f0042 to f9e2935 Compare October 25, 2021 21:04
Copy link
Collaborator

@oleksandr-pavlyk oleksandr-pavlyk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#638 runs the workflows and windows passes.

@diptorupd
Copy link
Contributor Author

Merging after testing locally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants