@@ -185,28 +185,19 @@ dl_funcptr _PyImport_GetDynLoadWindows(const char *shortname,
185
185
186
186
{
187
187
HINSTANCE hDLL = NULL ;
188
- wchar_t pathbuf [260 ];
189
188
unsigned int old_mode ;
190
189
ULONG_PTR cookie = 0 ;
191
- /* We use LoadLibraryEx so Windows looks for dependent DLLs
192
- in directory of pathname first. However, Windows95
193
- can sometimes not work correctly unless the absolute
194
- path is used. If GetFullPathName() fails, the LoadLibrary
195
- will certainly fail too, so use its error code */
196
-
190
+
197
191
/* Don't display a message box when Python can't load a DLL */
198
192
old_mode = SetErrorMode (SEM_FAILCRITICALERRORS );
199
193
200
- if (GetFullPathNameW (PyUnicode_AS_UNICODE (pathname ),
201
- sizeof (pathbuf ) / sizeof (pathbuf [0 ]),
202
- pathbuf ,
203
- NULL )) {
204
- ULONG_PTR cookie = _Py_ActivateActCtx ();
205
- /* XXX This call doesn't exist in Windows CE */
206
- hDLL = LoadLibraryExW (PyUnicode_AS_UNICODE (pathname ), NULL ,
207
- LOAD_WITH_ALTERED_SEARCH_PATH );
208
- _Py_DeactivateActCtx (cookie );
209
- }
194
+ cookie = _Py_ActivateActCtx ();
195
+ /* We use LoadLibraryEx so Windows looks for dependent DLLs
196
+ in directory of pathname first. */
197
+ /* XXX This call doesn't exist in Windows CE */
198
+ hDLL = LoadLibraryExW (PyUnicode_AS_UNICODE (pathname ), NULL ,
199
+ LOAD_WITH_ALTERED_SEARCH_PATH );
200
+ _Py_DeactivateActCtx (cookie );
210
201
211
202
/* restore old error mode settings */
212
203
SetErrorMode (old_mode );
0 commit comments