Commit 3e3ca7dd authored by Paul Gofman's avatar Paul Gofman Committed by Alexandre Julliard

ntdll: Validate flags in NtUnmapViewOfSectionEx().

parent 4806b1c2
......@@ -242,9 +242,9 @@ static void test_VirtualAlloc2(void)
ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "Got ret %d, error %lu.\n", ret, GetLastError());
ret = pUnmapViewOfFile2(GetCurrentProcess(), view1, MEM_RELEASE | MEM_PRESERVE_PLACEHOLDER);
todo_wine ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "Got ret %d, error %lu.\n", ret, GetLastError());
ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "Got ret %d, error %lu.\n", ret, GetLastError());
ret = pUnmapViewOfFile2(GetCurrentProcess(), view1, MEM_PRESERVE_PLACEHOLDER);
todo_wine ok(ret, "Got error %lu.\n", GetLastError());
ok(ret, "Got error %lu.\n", GetLastError());
memset(&info, 0, sizeof(info));
VirtualQuery(placeholder1, &info, sizeof(info));
......
......@@ -5298,7 +5298,14 @@ NTSTATUS WINAPI NtUnmapViewOfSection( HANDLE process, PVOID addr )
*/
NTSTATUS WINAPI NtUnmapViewOfSectionEx( HANDLE process, PVOID addr, ULONG flags )
{
if (flags) FIXME("Ignoring flags %#x.\n", (int)flags);
static const ULONG type_mask = MEM_UNMAP_WITH_TRANSIENT_BOOST | MEM_PRESERVE_PLACEHOLDER;
if (flags & ~type_mask)
{
WARN( "Unsupported flags %#x.\n", (int)flags );
return STATUS_INVALID_PARAMETER;
}
if (flags) FIXME( "Ignoring flags %#x.\n", (int)flags );
return unmap_view_of_section( process, addr );
}
......
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