diff options
author | Brian Curtin <brian@python.org> | 2012-05-13 16:19:23 (GMT) |
---|---|---|
committer | Brian Curtin <brian@python.org> | 2012-05-13 16:19:23 (GMT) |
commit | 401f9f3d32dcebf5ead8079d46a83fe7c7631581 (patch) | |
tree | 899600f4dad86565fd3585499e2332d2a3599d42 /Python/dynload_win.c | |
parent | 708d88c33441b29760b9246d61844eb59c1d0f3a (diff) | |
download | cpython-401f9f3d32dcebf5ead8079d46a83fe7c7631581.zip cpython-401f9f3d32dcebf5ead8079d46a83fe7c7631581.tar.gz cpython-401f9f3d32dcebf5ead8079d46a83fe7c7631581.tar.bz2 |
Fix #13210. Port the Windows build from VS2008 to VS2010.
Diffstat (limited to 'Python/dynload_win.c')
-rw-r--r-- | Python/dynload_win.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Python/dynload_win.c b/Python/dynload_win.c index 9c48a2d..25b6680 100644 --- a/Python/dynload_win.c +++ b/Python/dynload_win.c @@ -12,8 +12,10 @@ #include <windows.h> // "activation context" magic - see dl_nt.c... +#if HAVE_SXS extern ULONG_PTR _Py_ActivateActCtx(); void _Py_DeactivateActCtx(ULONG_PTR cookie); +#endif const char *_PyImport_DynLoadFiletab[] = { #ifdef _DEBUG @@ -191,18 +193,24 @@ dl_funcptr _PyImport_GetDynLoadWindows(const char *shortname, { HINSTANCE hDLL = NULL; unsigned int old_mode; +#if HAVE_SXS ULONG_PTR cookie = 0; +#endif /* Don't display a message box when Python can't load a DLL */ old_mode = SetErrorMode(SEM_FAILCRITICALERRORS); +#if HAVE_SXS cookie = _Py_ActivateActCtx(); +#endif /* 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(wpathname, NULL, LOAD_WITH_ALTERED_SEARCH_PATH); +#if HAVE_SXS _Py_DeactivateActCtx(cookie); +#endif /* restore old error mode settings */ SetErrorMode(old_mode); |