On Windows it seems sending to port 0 does nothing and does not error.
Presently sendmsg errors with EINVAL.
This works around it, by checking if it's port 0 then skipping the data.
--
v16: ntdll: Do not send data to port 0.
https://gitlab.winehq.org/wine/wine/-/merge_requests/2100
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.
--
v2: ntdll: Respect zero_bits/limit when mapping a PE file.
ntdll/tests: Test NtMapViewOfSection with a 64-bit DLL and zero_bits > 31.
https://gitlab.winehq.org/wine/wine/-/merge_requests/269