And here goes another test for two unsupported flags.

svn path=/trunk/; revision=17141
This commit is contained in:
Alex Ionescu 2005-08-07 07:30:46 +00:00
parent 17f39f0290
commit c3a96b7538

View file

@ -646,6 +646,18 @@ NtAllocateVirtualMemory(IN HANDLE ProcessHandle,
return STATUS_INVALID_PARAMETER_4;
}
/*
* Copy on Write is reserved for system use. This case is a certain failure
* but there may be other cases...needs more testing
*/
if ((!BaseAddress || (AllocationType & MEM_RESERVE)) &&
((Protect & PAGE_WRITECOPY) || (Protect & PAGE_EXECUTE_WRITECOPY)))
{
DPRINT1("Copy on write is not supported by VirtualAlloc\n");
return STATUS_INVALID_PAGE_PROTECTION;
}
Status = ObReferenceObjectByHandle(ProcessHandle,
PROCESS_VM_OPERATION,
NULL,