mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-02 12:23:31 +00:00
[NTOSKRNL]
- Fix 2 broken failure cases (forgot to detach from process and/or forgot to dereference process) svn path=/trunk/; revision=54389
This commit is contained in:
@@ -683,6 +683,7 @@ NtAllocateVirtualMemory(IN HANDLE ProcessHandle,
|
||||
{
|
||||
/* Fail without it */
|
||||
DPRINT1("Privilege not held for MEM_LARGE_PAGES\n");
|
||||
if (Attached) KeUnstackDetachProcess(&ApcState);
|
||||
if (ProcessHandle != NtCurrentProcess()) ObDereferenceObject(Process);
|
||||
return STATUS_PRIVILEGE_NOT_HELD;
|
||||
}
|
||||
@@ -701,6 +702,8 @@ NtAllocateVirtualMemory(IN HANDLE ProcessHandle,
|
||||
(Protect & (PAGE_WRITECOPY | PAGE_EXECUTE_WRITECOPY)))
|
||||
{
|
||||
DPRINT1("Copy on write is not supported by VirtualAlloc\n");
|
||||
if (Attached) KeUnstackDetachProcess(&ApcState);
|
||||
if (ProcessHandle != NtCurrentProcess()) ObDereferenceObject(Process);
|
||||
return STATUS_INVALID_PAGE_PROTECTION;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user