Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
bpo-39401: Avoid unsafe DLL load on Windows 7 and earlier
  • Loading branch information
zooba committed Jan 28, 2020
commit 5ed9ebc53b10efdebfdb633020e3e0e2af2d9a25
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Avoid unsafe DLL load at startup on Windows 7 and earlier.
6 changes: 4 additions & 2 deletions PC/getpathp.c
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,8 @@ static void
join(wchar_t *buffer, const wchar_t *stuff)
{
if (_PathCchCombineEx_Initialized == 0) {
HMODULE pathapi = LoadLibraryW(L"api-ms-win-core-path-l1-1-0.dll");
HMODULE pathapi = LoadLibraryExW(L"api-ms-win-core-path-l1-1-0.dll", NULL,
LOAD_LIBRARY_SEARCH_SYSTEM32);
if (pathapi) {
_PathCchCombineEx = (PPathCchCombineEx)GetProcAddress(pathapi, "PathCchCombineEx");
}
Expand Down Expand Up @@ -288,7 +289,8 @@ canonicalize(wchar_t *buffer, const wchar_t *path)
}

if (_PathCchCanonicalizeEx_Initialized == 0) {
HMODULE pathapi = LoadLibraryW(L"api-ms-win-core-path-l1-1-0.dll");
HMODULE pathapi = LoadLibraryExW(L"api-ms-win-core-path-l1-1-0.dll", NULL,
LOAD_LIBRARY_SEARCH_SYSTEM32);
if (pathapi) {
_PathCchCanonicalizeEx = (PPathCchCanonicalizeEx)GetProcAddress(pathapi, "PathCchCanonicalizeEx");
}
Expand Down