mirror of
https://github.com/reactos/reactos.git
synced 2024-09-30 14:37:45 +00:00
[NTDLL_APITEST]
- NtAllocateVirtualMemory: fix handling of an error condition; check that newly-committed memory is zeroed svn path=/trunk/; revision=54748
This commit is contained in:
parent
835bf4292b
commit
42942c9fbe
|
@ -60,11 +60,13 @@ Allocate(
|
|||
Status = NtAllocateVirtualMemory(NtCurrentProcess(), &FirstPageStart, 0, &Size, MEM_COMMIT, PAGE_READWRITE);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
Size = 0;
|
||||
AllocationSize = 0;
|
||||
Status = NtFreeVirtualMemory(NtCurrentProcess(), &AllocationStart, &AllocationSize, MEM_RELEASE);
|
||||
ASSERT(Status == STATUS_SUCCESS);
|
||||
return NULL;
|
||||
}
|
||||
ASSERT(Size % sizeof(ULONG) == 0);
|
||||
ASSERT(RtlCompareMemoryUlong(FirstPageStart, Size, 0) == Size);
|
||||
|
||||
UserBuffer = AllocationStart;
|
||||
UserBuffer += AllocationSize - PAGE_SIZE - DataSize;
|
||||
|
|
Loading…
Reference in a new issue