mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 18:52:57 +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:
parent
fcb309055e
commit
75ff9ef0c0
1 changed files with 3 additions and 0 deletions
|
@ -683,6 +683,7 @@ NtAllocateVirtualMemory(IN HANDLE ProcessHandle,
|
||||||
{
|
{
|
||||||
/* Fail without it */
|
/* Fail without it */
|
||||||
DPRINT1("Privilege not held for MEM_LARGE_PAGES\n");
|
DPRINT1("Privilege not held for MEM_LARGE_PAGES\n");
|
||||||
|
if (Attached) KeUnstackDetachProcess(&ApcState);
|
||||||
if (ProcessHandle != NtCurrentProcess()) ObDereferenceObject(Process);
|
if (ProcessHandle != NtCurrentProcess()) ObDereferenceObject(Process);
|
||||||
return STATUS_PRIVILEGE_NOT_HELD;
|
return STATUS_PRIVILEGE_NOT_HELD;
|
||||||
}
|
}
|
||||||
|
@ -701,6 +702,8 @@ NtAllocateVirtualMemory(IN HANDLE ProcessHandle,
|
||||||
(Protect & (PAGE_WRITECOPY | PAGE_EXECUTE_WRITECOPY)))
|
(Protect & (PAGE_WRITECOPY | PAGE_EXECUTE_WRITECOPY)))
|
||||||
{
|
{
|
||||||
DPRINT1("Copy on write is not supported by VirtualAlloc\n");
|
DPRINT1("Copy on write is not supported by VirtualAlloc\n");
|
||||||
|
if (Attached) KeUnstackDetachProcess(&ApcState);
|
||||||
|
if (ProcessHandle != NtCurrentProcess()) ObDereferenceObject(Process);
|
||||||
return STATUS_INVALID_PAGE_PROTECTION;
|
return STATUS_INVALID_PAGE_PROTECTION;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue