Skip to content

Commit 7e6850c

Browse files
committed
On Win32, use
LoadLibraryEx(pathname, NULL, LOAD_WITH_ALTERED_SEARCH_PATH) to search dependent DLLs in the directory of the pathname.
1 parent 73de68c commit 7e6850c

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

β€ŽPython/importdl.cβ€Ž

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,10 @@ _PyImport_LoadDynamicModule(name, pathname, fp)
493493
sprintf(p, ".\\%-.255s", pathname);
494494
pathname = pathbuf;
495495
}
496-
hDLL = LoadLibrary(pathname);
496+
/* Look for dependent DLLs in directory of pathname first */
497+
/* XXX This call doesn't exist in Windows CE */
498+
hDLL = LoadLibraryEx(pathname, NULL,
499+
LOAD_WITH_ALTERED_SEARCH_PATH);
497500
if (hDLL==NULL){
498501
char errBuf[256];
499502
unsigned int errorCode;

0 commit comments

Comments
 (0)