Mark Hammond <mhamm...@users.sourceforge.net> added the comment: I've hacked together something that fixes the problem. I'm working on making it a real patch, but the basis is:
* In DllMain (dl_nt.c), we call: case DLL_PROCESS_ATTACH: GetCurrentActCtx(&PyWin_DLLhActivationContext); AddRefActCtx(PyWin_DLLhActivationContext); case DLL_PROCESS_DETACH: ReleaseActCtx(PyWin_DLLhActivationContext); (where PyWin_DLLhActivationContext is a module level HANDLE global) * The LoadLibraryEx (in dynload_win.c) changes to: ActivateActCtx(PyWin_DLLhActivationContext, &cookie); /* XXX This call doesn't exist in Windows CE */ hDLL = LoadLibraryEx(... as currently ...); DeactivateActCtx(0, cookie); This makes the "import socket" test case work for me. I'm not sure what the impact will be should the .pyd file reference other assemblies. Also, the calls above all need to move to function pointer calls as the functions only exist on Vista and later (hence the slight delay in making a real patch) _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue4566> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com