Commit 4ecc9788 authored by André Hentschel's avatar André Hentschel Committed by Alexandre Julliard

ntdll: Adjust NtAreMappedFilesTheSame to win8 behaviour.

parent a890d0f0
......@@ -1053,10 +1053,12 @@ static void test_NtAreMappedFilesTheSame(void)
CloseHandle( file2 );
status = pNtAreMappedFilesTheSame( ptr, ptr );
ok( status == STATUS_NOT_SAME_DEVICE, "NtAreMappedFilesTheSame returned %x\n", status );
ok( status == STATUS_SUCCESS || broken(status == STATUS_NOT_SAME_DEVICE),
"NtAreMappedFilesTheSame returned %x\n", status );
status = pNtAreMappedFilesTheSame( ptr, (char *)ptr + 30 );
ok( status == STATUS_NOT_SAME_DEVICE, "NtAreMappedFilesTheSame returned %x\n", status );
ok( status == STATUS_SUCCESS || broken(status == STATUS_NOT_SAME_DEVICE),
"NtAreMappedFilesTheSame returned %x\n", status );
status = pNtAreMappedFilesTheSame( ptr, GetModuleHandleA("kernel32.dll") );
ok( status == STATUS_NOT_SAME_DEVICE, "NtAreMappedFilesTheSame returned %x\n", status );
......
......@@ -2963,10 +2963,10 @@ NTSTATUS WINAPI NtAreMappedFilesTheSame(PVOID addr1, PVOID addr2)
status = STATUS_INVALID_ADDRESS;
else if ((view1->protect & VPROT_VALLOC) || (view2->protect & VPROT_VALLOC))
status = STATUS_CONFLICTING_ADDRESSES;
else if (!(view1->protect & VPROT_IMAGE) || !(view2->protect & VPROT_IMAGE))
status = STATUS_NOT_SAME_DEVICE;
else if (view1 == view2)
status = STATUS_SUCCESS;
else if (!(view1->protect & VPROT_IMAGE) || !(view2->protect & VPROT_IMAGE))
status = STATUS_NOT_SAME_DEVICE;
else if (!stat_mapping_file( view1, &st1 ) && !stat_mapping_file( view2, &st2 ) &&
st1.st_dev == st2.st_dev && st1.st_ino == st2.st_ino)
status = STATUS_SUCCESS;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment