Eryk Sun <eryk...@gmail.com> added the comment:

> The APIs are the same, so you can (should) LoadLibrary the one 
> that you want.

The issue is that python3.dll doesn't depend on python3x.dll in the normal way. 
For example, LoadLibraryExW("path/to/python3.dll", NULL, 
LOAD_WITH_ALTERED_SEARCH_PATH) doesn't automatically load "python38.dll". But 
the forwarded functions depend on "python38.dll", e.g. "Py_Main (forwarded to 
python38.Py_Main)". The loader doesn't try to load "python38.dll" until the 
application tries to resolve a forwarded function such as "Py_Main", which in 
the LoadLibraryExW case is the time that GetProcAddress(hpython3, "Py_Main") is 
called. 

It turns out, when I tested this in 2017, that the loader in Windows 7 doesn't 
remember the activation context from loading "python3.dll" and thus will fail 
to find "python38.dll", which in turn makes the GetProcAddress() call fail. In 
contrast, the loader in Windows 10 knows to search for "python38.dll" in the 
directory of "python3.dll".

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://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