File tree Expand file tree Collapse file tree 1 file changed +15
-6
lines changed Expand file tree Collapse file tree 1 file changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -2909,17 +2909,26 @@ procedure TPythonInputOutput.UpdateCurrentThreadLine;
29092909(* ******************************************************)
29102910
29112911procedure TDynamicDll.DoOpenDll (const aDllName : string);
2912+ { $IFDEF MSWINDOWS}
2913+ const
2914+ LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR = $00000100 ;
2915+ LOAD_LIBRARY_DEFAULT_DIRS = $00001000 ;
2916+ Var
2917+ ExceptMask: TFPUExceptionMask;
2918+ { $ENDIF}
29122919begin
29132920 if not IsHandleValid then
29142921 begin
29152922 FDllName := aDllName;
29162923 { $IFDEF MSWINDOWS}
2917- FDLLHandle := SafeLoadLibrary(
2918- { $IFDEF FPC}
2919- PAnsiChar(AnsiString(GetDllPath+DllName))
2920- { $ELSE}
2921- GetDllPath+DllName
2922- { $ENDIF} );
2924+ ExceptMask := GetExceptionMask;
2925+ try
2926+ FDLLHandle := LoadLibraryExA(
2927+ PAnsiChar(AnsiString(GetDllPath+DllName)), 0 ,
2928+ LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR or LOAD_LIBRARY_DEFAULT_DIRS);
2929+ finally
2930+ SetExceptionMask(ExceptMask);
2931+ end ;
29232932 { $ELSE}
29242933 // Linux: need here RTLD_GLOBAL, so Python can do "import ctypes"
29252934 FDLLHandle := THandle(dlopen(PAnsiChar(AnsiString(GetDllPath+DllName)),
You can’t perform that action at this time.
0 commit comments