Elli Pirelli added the comment:

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...

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue29399>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to