https://bugs.winehq.org/show_bug.cgi?id=49626
Bug ID: 49626 Summary: ntdll can be loaded multiple times into the same process Product: Wine Version: 5.13 Hardware: x86 OS: Linux Status: NEW Severity: normal Priority: P2 Component: ntdll Assignee: wine-bugs@winehq.org Reporter: madewokherd@gmail.com Distribution: ---
The simplest way I've found to reproduce this is to install Python for windows and run: wine python -c 'print(__import__("ctypes").windll.kernel32.LoadLibraryW(r"c:\ntdll.dll"))'
This should show 0, indicating failure, but on Wine it returns a real module handle, different from the ntdll originally loaded in the process.
Worse, the new ntdll isn't initialized properly by ntdll.so, so its functions don't work.
This affects wine-mono, which tries to load ntdll from the application path first, apparently expecting that to fail. Anything using an ntdll p/invoke, such as enumerating files, won't work. This causes the run-tests.exe wrapper (from https://github.com/madewokherd/wine-mono/releases) to crash.