Author mhammond
Recipients christian.heimes, craigh, ggenellina, johnshue, loewis, mhammond
Date 2009-01-02.09:15:29
SpamBayes Score 1.6522e-08
Marked as misclassified No
Message-id <1230887732.44.0.476933589746.issue4566@psf.upfronthosting.co.za>
In-reply-to
Content
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)
History
Date User Action Args
2009-01-02 09:15:32mhammondsetrecipients: + mhammond, loewis, ggenellina, christian.heimes, craigh, johnshue
2009-01-02 09:15:32mhammondsetmessageid: <1230887732.44.0.476933589746.issue4566@psf.upfronthosting.co.za>
2009-01-02 09:15:31mhammondlinkissue4566 messages
2009-01-02 09:15:29mhammondcreate