diff options
author | Brian Curtin <brian@python.org> | 2011-06-09 22:55:54 (GMT) |
---|---|---|
committer | Brian Curtin <brian@python.org> | 2011-06-09 22:55:54 (GMT) |
commit | 589f89e2ad08a6cae34d90b227d3ffcfe1c06216 (patch) | |
tree | e1973eff8188afdf19122c58d3ad9797a92f5f1d /Python/dynload_win.c | |
parent | 51fcb811e3169661d2995b1e6de6d1b46a7284c3 (diff) | |
download | cpython-589f89e2ad08a6cae34d90b227d3ffcfe1c06216.zip cpython-589f89e2ad08a6cae34d90b227d3ffcfe1c06216.tar.gz cpython-589f89e2ad08a6cae34d90b227d3ffcfe1c06216.tar.bz2 |
Removed a Windows 9x trick used before LoadLibraryExW.
Windows 9x has long been unsupported and the result of GetFullPathName
was not even being used in the first place.
Diffstat (limited to 'Python/dynload_win.c')
-rw-r--r-- | Python/dynload_win.c | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/Python/dynload_win.c b/Python/dynload_win.c index 9869f6a..932a637 100644 --- a/Python/dynload_win.c +++ b/Python/dynload_win.c @@ -185,28 +185,19 @@ dl_funcptr _PyImport_GetDynLoadWindows(const char *shortname, { HINSTANCE hDLL = NULL; - wchar_t pathbuf[260]; unsigned int old_mode; ULONG_PTR cookie = 0; - /* We use LoadLibraryEx so Windows looks for dependent DLLs - in directory of pathname first. However, Windows95 - can sometimes not work correctly unless the absolute - path is used. If GetFullPathName() fails, the LoadLibrary - will certainly fail too, so use its error code */ - + /* Don't display a message box when Python can't load a DLL */ old_mode = SetErrorMode(SEM_FAILCRITICALERRORS); - if (GetFullPathNameW(PyUnicode_AS_UNICODE(pathname), - sizeof(pathbuf) / sizeof(pathbuf[0]), - pathbuf, - NULL)) { - ULONG_PTR cookie = _Py_ActivateActCtx(); - /* XXX This call doesn't exist in Windows CE */ - hDLL = LoadLibraryExW(PyUnicode_AS_UNICODE(pathname), NULL, - LOAD_WITH_ALTERED_SEARCH_PATH); - _Py_DeactivateActCtx(cookie); - } + cookie = _Py_ActivateActCtx(); + /* We use LoadLibraryEx so Windows looks for dependent DLLs + in directory of pathname first. */ + /* XXX This call doesn't exist in Windows CE */ + hDLL = LoadLibraryExW(PyUnicode_AS_UNICODE(pathname), NULL, + LOAD_WITH_ALTERED_SEARCH_PATH); + _Py_DeactivateActCtx(cookie); /* restore old error mode settings */ SetErrorMode(old_mode); |