[PATCH 0/2] MR269: ntdll: Respect zero_bits when mapping a builtin or native PE file.

Brendan Shanks (@bshanks) wine at gitlab.winehq.org
Fri Jun 17 14:37:00 CDT 2022


Without the changes, the test passes or fails based on the binutils version being used. v2.35 (used on the Debian 11 testbot) gives 64-bit DLLs an image base under 4GB, and the test always passes. On a system with binutils 2.37 or later, 64-bit DLLs are based above 4GBs, and the test will fail.


The map_view() change fixes native DLLs, and virtual_map_section() for
builtin DLLs. I wasn't sure how to test a native DLL.

This showed up under Wow64 when running the 64-bit Notepad++ installer
(a 32-bit EXE), which runs 32-bit regsvr32 to register a 64-bit DLL.
regsvr32 calls LoadLibraryExW() with LOAD_LIBRARY_AS_IMAGE_RESOURCE,
which was returning a truncated pointer to the DLLs base address.
Accessing this then crashed.

-- 
https://gitlab.winehq.org/wine/wine/-/merge_requests/269



More information about the wine-devel mailing list