Dmitry Timoshkov : kernel32: Add a test for rw mapping of a read-only section.

Alexandre Julliard julliard at winehq.org
Wed Sep 19 08:16:29 CDT 2007


Module: wine
Branch: master
Commit: c6b7f7ccbe4ccb256b378fa632bcb263f39fc4ce
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=c6b7f7ccbe4ccb256b378fa632bcb263f39fc4ce

Author: Dmitry Timoshkov <dmitry at codeweavers.com>
Date:   Wed Sep 19 20:01:22 2007 +0900

kernel32: Add a test for rw mapping of a read-only section.

---

 dlls/kernel32/tests/virtual.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/dlls/kernel32/tests/virtual.c b/dlls/kernel32/tests/virtual.c
index 7727c65..5bfa3e9 100644
--- a/dlls/kernel32/tests/virtual.c
+++ b/dlls/kernel32/tests/virtual.c
@@ -416,6 +416,17 @@ static void test_MapViewOfFile(void)
 
     CloseHandle( file );
     DeleteFileA( testfile );
+
+    file = CreateFileMapping( INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, 4096, "Global\\Foo");
+    ok( file != 0, "CreateFileMapping PAGE_READWRITE failed\n" );
+
+    mapping = OpenFileMapping( FILE_MAP_READ, FALSE, "Global\\Foo" );
+    ok( mapping != 0, "OpenFileMapping FILE_MAP_READ failed\n" );
+    ptr = MapViewOfFile( mapping, FILE_MAP_WRITE, 0, 0, 0 );
+todo_wine ok( !ptr, "MapViewOfFile FILE_MAP_WRITE should fail\n" );
+    CloseHandle( mapping );
+
+    CloseHandle( file );
 }
 
 static DWORD (WINAPI *pNtMapViewOfSection)( HANDLE handle, HANDLE process, PVOID *addr_ptr,




More information about the wine-cvs mailing list