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

> I also don't actually see gdi32 being transitively loaded as
> claimed in the Twitter thread, even back to 3.8. So presumably
> there's something else going on to cause that issue.

Since Windows XP, shlwapi.dll has increasingly made use of delay loading, but 
up to Windows 8.1 it was still immediately loading user32.dll and gdi32.dll. In 
Windows 10, shlwapi.dll finally made them delay loaded dependencies. Also, in 
Windows 10, PathIsRelativeW is forwarded to the implementation in 
kernelbase.dll, not that it matters from the end user's perspective since it's 
not in an API set.

Regarding user32.dll, there's still an issue with ssl, hashlib, winsound, and 
ctypes not delay loading it, or DLLs that directly depend on it such as 
ole32.dll and oleaut32.dll. In most use cases these DLLs would never be loaded. 

When user32.dll loads, the process and the loading thread are converted to GUI 
versions, i.e. they're extended in the kernel with the window manager's 
Win32Process and Win32Thread structures, and the process connects to a window 
station and desktop (e.g. r"WinSta0\Default"). One concern with converting to a 
GUI process is that the system doesn't send CTRL_LOGOFF_EVENT and 
CTRL_SHUTDOWN_EVENT console events to GUI processes. Thus a console script 
can't handle those events with a simple ctypes-based handler as long as 
importing ctypes always loads user32.dll.

----------

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

Reply via email to