mirror of
https://github.com/reactos/wine.git
synced 2025-02-04 02:56:31 +00:00
ntdll: NtMapViewOfSection should fail if both addr_ptr and zero_bits is set.
This commit is contained in:
parent
0a12011ab6
commit
7a8470ea94
@ -1093,25 +1093,25 @@ static void test_NtMapViewOfSection(void)
|
||||
size = 0;
|
||||
offset.QuadPart = 0;
|
||||
status = pNtMapViewOfSection( mapping, hProcess, &ptr2, 12, 0, &offset, &size, 1, 0, PAGE_READWRITE );
|
||||
todo_wine
|
||||
ok( status == STATUS_INVALID_PARAMETER_4, "NtMapViewOfSection returned %x\n", status );
|
||||
if (status == STATUS_SUCCESS)
|
||||
{
|
||||
status = pNtUnmapViewOfSection( hProcess, ptr2 );
|
||||
ok( !status, "NtUnmapViewOfSection failed status %x\n", status );
|
||||
}
|
||||
|
||||
ptr2 = (char *)ptr + 0x1000;
|
||||
size = 0;
|
||||
offset.QuadPart = 0;
|
||||
status = pNtMapViewOfSection( mapping, hProcess, &ptr2, 16, 0, &offset, &size, 1, 0, PAGE_READWRITE );
|
||||
todo_wine
|
||||
ok( status == STATUS_INVALID_PARAMETER_4, "NtMapViewOfSection returned %x\n", status );
|
||||
if (status == STATUS_SUCCESS)
|
||||
{
|
||||
status = pNtUnmapViewOfSection( hProcess, ptr2 );
|
||||
ok( !status, "NtUnmapViewOfSection failed status %x\n", status );
|
||||
}
|
||||
|
||||
ptr2 = (char *)ptr + 0x1001;
|
||||
size = 0;
|
||||
offset.QuadPart = 0;
|
||||
status = pNtMapViewOfSection( mapping, hProcess, &ptr2, 16, 0, &offset, &size, 1, 0, PAGE_READWRITE );
|
||||
ok( status == STATUS_INVALID_PARAMETER_4, "NtMapViewOfSection returned %x\n", status );
|
||||
|
||||
ptr2 = (char *)ptr + 0x1000;
|
||||
size = 0;
|
||||
offset.QuadPart = 1;
|
||||
status = pNtMapViewOfSection( mapping, hProcess, &ptr2, 16, 0, &offset, &size, 1, 0, PAGE_READWRITE );
|
||||
ok( status == STATUS_INVALID_PARAMETER_4, "NtMapViewOfSection returned %x\n", status );
|
||||
|
||||
if (sizeof(void *) == sizeof(int) && (!pIsWow64Process ||
|
||||
!pIsWow64Process( GetCurrentProcess(), &is_wow64 ) || !is_wow64))
|
||||
|
@ -2601,6 +2601,9 @@ NTSTATUS WINAPI NtMapViewOfSection( HANDLE handle, HANDLE process, PVOID *addr_p
|
||||
|
||||
/* Check parameters */
|
||||
|
||||
if (*addr_ptr && zero_bits)
|
||||
return STATUS_INVALID_PARAMETER_4;
|
||||
|
||||
if ((offset.u.LowPart & mask) || (*addr_ptr && ((UINT_PTR)*addr_ptr & mask)))
|
||||
return STATUS_MAPPED_ALIGNMENT;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user