http://bugs.winehq.org/show_bug.cgi?id=9714
Summary: MapViewOfFile with write permissions should not succeed on a read-only file mapping Product: Wine Version: 0.9.38. Platform: Other OS/Version: Linux Status: UNCONFIRMED Severity: minor Priority: P2 Component: wine-kernel AssignedTo: wine-bugs@winehq.org ReportedBy: silverblade_uk@hotmail.com
I had duplicated some code in one of my programs and accidentally forgot to change the "desired access" for the MapViewOfFile call, despite having changed this in the OpenFileMapping call.
The code below *incorrectly* succeeds on WINE but fails on Windows XP.
=== EXAMPLE ===
HANDLE h; void* m;
h = OpenFileMapping(FILE_MAP_READ, FALSE, "Global\Foo"); m = MapViewOfFile(h, FILE_MAP_WRITE, 0, 0, 0);
=== END EXAMPLE ===
Basically I was opening the mapped file READ-ONLY, but was then trying to create a writable mapping to it.