server: Only the first mapping needs to be an image in NtAreMappedFilesTheSame().
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=37488 Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
384c042fea
commit
734e3a91ac
|
@ -1357,6 +1357,9 @@ static void test_NtAreMappedFilesTheSame(void)
|
|||
ok( ptr != NULL, "MapViewOfFile FILE_MAP_READ error %u\n", GetLastError() );
|
||||
status = pNtAreMappedFilesTheSame( ptr, GetModuleHandleA("kernel32.dll") );
|
||||
ok( status == STATUS_NOT_SAME_DEVICE, "NtAreMappedFilesTheSame returned %x\n", status );
|
||||
status = pNtAreMappedFilesTheSame( GetModuleHandleA("kernel32.dll"), ptr );
|
||||
todo_wine
|
||||
ok( status == STATUS_SUCCESS, "NtAreMappedFilesTheSame returned %x\n", status );
|
||||
UnmapViewOfFile( ptr );
|
||||
CloseHandle( mapping );
|
||||
|
||||
|
@ -1366,6 +1369,8 @@ static void test_NtAreMappedFilesTheSame(void)
|
|||
ok( ptr != NULL, "MapViewOfFile FILE_MAP_READ error %u\n", GetLastError() );
|
||||
status = pNtAreMappedFilesTheSame( ptr, GetModuleHandleA("kernel32.dll") );
|
||||
ok( status == STATUS_SUCCESS, "NtAreMappedFilesTheSame returned %x\n", status );
|
||||
status = pNtAreMappedFilesTheSame( GetModuleHandleA("kernel32.dll"), ptr );
|
||||
ok( status == STATUS_SUCCESS, "NtAreMappedFilesTheSame returned %x\n", status );
|
||||
|
||||
file2 = CreateFileA( path, GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, 0 );
|
||||
ok( file2 != INVALID_HANDLE_VALUE, "CreateFile error %u\n", GetLastError() );
|
||||
|
@ -1375,6 +1380,8 @@ static void test_NtAreMappedFilesTheSame(void)
|
|||
ok( ptr2 != NULL, "MapViewOfFile FILE_MAP_READ error %u\n", GetLastError() );
|
||||
status = pNtAreMappedFilesTheSame( ptr, ptr2 );
|
||||
ok( status == STATUS_SUCCESS, "NtAreMappedFilesTheSame returned %x\n", status );
|
||||
status = pNtAreMappedFilesTheSame( ptr2, ptr );
|
||||
ok( status == STATUS_SUCCESS, "NtAreMappedFilesTheSame returned %x\n", status );
|
||||
UnmapViewOfFile( ptr2 );
|
||||
CloseHandle( map2 );
|
||||
CloseHandle( file2 );
|
||||
|
|
|
@ -1268,9 +1268,7 @@ DECL_HANDLER(is_same_mapping)
|
|||
struct memory_view *view2 = find_mapped_view( current->process, req->base2 );
|
||||
|
||||
if (!view1 || !view2) return;
|
||||
if (!view1->fd || !view2->fd ||
|
||||
!(view1->flags & SEC_IMAGE) || !(view2->flags & SEC_IMAGE) ||
|
||||
!is_same_file_fd( view1->fd, view2->fd ))
|
||||
if (!view1->fd || !view2->fd || !(view1->flags & SEC_IMAGE) || !is_same_file_fd( view1->fd, view2->fd ))
|
||||
set_error( STATUS_NOT_SAME_DEVICE );
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue