ntdll: Adjust NtAreMappedFilesTheSame to win8 behaviour.

This commit is contained in:
André Hentschel 2013-11-12 21:39:06 +01:00 committed by Alexandre Julliard
parent a890d0f030
commit 4ecc9788bd
2 changed files with 6 additions and 4 deletions

View File

@ -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 );

View File

@ -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;