Bugs item #3597965, was opened at 2012-12-20 16:31
Message generated for change (Comment added) made by mhammond
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=551954&aid=3597965&group_id=78018
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: com
Group: None
>Status: Closed
>Resolution: Fixed
Priority: 5
Private: No
Submitted By: Kevin Smyth ()
Assigned to: Nobody/Anonymous (nobody)
Summary: pythoncomloader.dll and undefined LoadLibraryEx behavior
Initial Comment:
MSDN's documentation for LoadLibraryEx states "The behavior is undefined when LOAD_WITH_ALTERED_SEARCH_PATHflag is set, and lpFileName specifiies a relative path."
com/win32com/src/PythonCOMLoader.cpp: HMODULE hpycom = LoadLibraryEx(DLL_DELEGATE, NULL, LOAD_WITH_ALTERED_SEARCH_PATH);
setup.py: ccargs.append('/DDLL_DELEGATE=\\"pythoncom%s.dll\\"' % (suffix,))
An absolute path should be used instead.
----------------------------------------------------------------------
>Comment By: Mark Hammond (mhammond)
Date: 2012-12-26 21:38
Message:
Awesome, thanks! Checked in as rev 4295:860ef545eb60
----------------------------------------------------------------------
Comment By: Kevin Smyth ()
Date: 2012-12-21 09:26
Message:
Yes, a global HINSTANCE works fine. Patch attached.
(Please disregard previous patch, it neglects to actaully assign hpycom. I
didn't have a VS2008 compiler to test with)
The current patch fixes my issue with loading out of a virtual env.
----------------------------------------------------------------------
Comment By: Mark Hammond (mhammond)
Date: 2012-12-20 18:01
Message:
oops - I was too quick in my scan of the patch. It can't be passed as a
param, but having it as a global is probably still fine IMO.
----------------------------------------------------------------------
Comment By: Mark Hammond (mhammond)
Date: 2012-12-20 16:40
Message:
Thanks for the patch! It seems to be that instead of referencing
__ImageBase we could just pass the HINSTANCE from DllMain as a param - is
there any reason that would not work?
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=551954&aid=3597965&group_id=78018
|