https://bugs.winehq.org/show_bug.cgi?id=40225
Bug ID: 40225 Summary: NtQuerySection returns wrong size Product: Wine Version: 1.9.3 Hardware: x86 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: ntdll Assignee: wine-bugs@winehq.org Reporter: mail@georg.so Distribution: ---
Created attachment 53743 --> https://bugs.winehq.org/attachment.cgi?id=53743 NtQuerySection test case via boost interprocess
When using NtQuerySection to get the file size of a file mapping the wine result deviates from the native one.
With wine, it seems that the size is rounded up to the next page. On native windows, the real file size is returned.
How to reproduce (e.g. with a mingw cross compile environment):
mkdir build cd build mingw64-cmake .. mingw64-make wine64 main
Actual behavior:
fixme:winediag:start_process Wine Staging 1.9.3 is a testing version containing experimental patches. fixme:winediag:start_process Please mention your exact version when filing bug reports on winehq.org. region.get_size() == 4096 sizeof(inp)-1 == 5 Assertion failed!
Program: Z:\home\gms\program\libixxxutil\build-case-win-rel\main.exe File: /home/gms/program/libixxxutil/test/mapped_size_case/main.cc, Line 28
Expression: region.get_size() == sizeof(inp)-1
abnormal program termination
Expected behavior (as e.g. on Windows 7):
No output and success exit code.
How reproducible: always
The test program uses Boost Interprocess functions for creating that mapping and getting the size.
See also:
cf. http://www.boost.org/doc/libs/1_60_0/doc/html/boost/interprocess/mapped_regi...
The OS could allocate more pages than size/page_size(), but get_address() will always return the address passed in this function (if not null) and get_size() will return the specified size.
http://stackoverflow.com/a/26983182/427158 -> NtQuerySection