And here goes another test for two unsupported flags.
authorAlex Ionescu <aionescu@gmail.com>
Sun, 7 Aug 2005 07:30:46 +0000 (07:30 +0000)
committerAlex Ionescu <aionescu@gmail.com>
Sun, 7 Aug 2005 07:30:46 +0000 (07:30 +0000)
svn path=/trunk/; revision=17141

reactos/ntoskrnl/mm/anonmem.c

index 93bae50..9296d83 100644 (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,