This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Elli Pirelli
Recipients Elli Pirelli, eryksun, paul.moore, steve.dower, tim.golden, zach.ware
Date 2017-01-31.22:36:41
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1485902201.69.0.980422904545.issue29399@psf.upfronthosting.co.za>
In-reply-to
Content
It does not work on Windows 7 Pro x64.

And i am not the only one. The maintainer of the "python-embedded-launcher" also encountered the issue (see discussion here: https://github.com/zsquareplusc/python-embedded-launcher/issues/3)

Are you sure it really works on Windows 10? Perhaps you have the python3?.dll in the standard DLL search path already, making you mistakenly believe that it works properly? I would suggest to use a tool like SysInternal's Process Monitor to see and verify where the python3?.dll is really being loaded from.


The issue is not with incorrectly using LoadLibraryEx, SetDllDirectory and AddDllDirectory. The problem can be reduced to the python3.dll not having a dependcy on python3?.dll.

I did verify this with a little project, emulating how python3.dll uses export forwarders. I made a DLL (real.dll) with a dummy function Func  and another DLL (forwarder.dll) containing just an export forwarder Func=real.Func. 

As described, as long as forwarder.dll does not contain a import dependency on real.dll, loading forwarder.dll and doing GetProcAddress("Func") will fail, if real.dll is not in the standard DLL search path.

As soon as forwarder.dll includes a dependency to real.dll, the export forwarder can be resolved by GetProcAddress("Func") properly.

If i were using LoadLibraryEx/SetDllDirectory/AddDllDirectory incorrectly, attempting to load the forwarder.dll with the dependency on real.dll would just fail -- which it doesn't.

Unfortunately, the whole business with export forwarders is very poorly documented. It could perhaps be that MS did change something in Win8/2K12 or Win10 to fix this issue. Since i currently don't have access to either of these OS, i myself cannot confirm whether the problem would also occur or not on Win 10...
History
Date User Action Args
2017-01-31 22:36:41Elli Pirellisetrecipients: + Elli Pirelli, paul.moore, tim.golden, zach.ware, eryksun, steve.dower
2017-01-31 22:36:41Elli Pirellisetmessageid: <1485902201.69.0.980422904545.issue29399@psf.upfronthosting.co.za>
2017-01-31 22:36:41Elli Pirellilinkissue29399 messages
2017-01-31 22:36:41Elli Pirellicreate