mirror of
https://github.com/reactos/reactos.git
synced 2024-10-04 08:25:53 +00:00
- Pass correct allocation flags to ZwAllocateVirtualMemory.
- Don't provide region size when freeing virtual memory (spotted by Evgeniy Boltik, confirmed by MSDN). svn path=/trunk/; revision=40268
This commit is contained in:
parent
a5d8c32124
commit
b5ceb7733a
|
@ -79,7 +79,7 @@ EngAllocUserMem(SIZE_T cj, ULONG Tag)
|
|||
SIZE_T MemSize = sizeof(USERMEMHEADER) + cj;
|
||||
PUSERMEMHEADER Header;
|
||||
|
||||
Status = ZwAllocateVirtualMemory(NtCurrentProcess(), &NewMem, 0, &MemSize, MEM_COMMIT, PAGE_READWRITE);
|
||||
Status = ZwAllocateVirtualMemory(NtCurrentProcess(), &NewMem, 0, &MemSize, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE);
|
||||
|
||||
if (! NT_SUCCESS(Status))
|
||||
{
|
||||
|
@ -100,7 +100,7 @@ VOID APIENTRY
|
|||
EngFreeUserMem(PVOID pv)
|
||||
{
|
||||
PUSERMEMHEADER Header = ((PUSERMEMHEADER) pv) - 1;
|
||||
SIZE_T MemSize = sizeof(USERMEMHEADER) + Header->MemSize;
|
||||
SIZE_T MemSize = 0;
|
||||
|
||||
ZwFreeVirtualMemory(NtCurrentProcess(), (PVOID *) &Header, &MemSize, MEM_RELEASE);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue