mirror of
https://github.com/reactos/reactos.git
synced 2025-05-23 19:14:48 +00:00
[KMTESTS]
- Test what happens to the 'base' of memory allocated with ZwAllocateVirtualMemory - Fix some tests according to w2k3sp2 behaviour. Thanks Amine for testing ;-) svn path=/trunk/; revision=64028
This commit is contained in:
parent
a3991f48f7
commit
9aff965362
1 changed files with 7 additions and 2 deletions
|
@ -31,8 +31,13 @@ typedef struct _TEST_CONTEXT
|
|||
|
||||
#define ALLOC_MEMORY_WITH_FREE(ProcessHandle, BaseAddress, ZeroBits, RegionSize, AllocationType, Protect, RetStatus, FreeStatus) \
|
||||
do { \
|
||||
PVOID __BaseSave = BaseAddress; \
|
||||
Status = ZwAllocateVirtualMemory(ProcessHandle, &BaseAddress, ZeroBits, &RegionSize, AllocationType, Protect); \
|
||||
ok_eq_hex(Status, RetStatus); \
|
||||
if (__BaseSave != NULL) \
|
||||
ok_eq_pointer(BaseAddress, __BaseSave); \
|
||||
else if (!NT_SUCCESS(Status)) \
|
||||
ok_eq_pointer(BaseAddress, NULL); \
|
||||
RegionSize = 0; \
|
||||
Status = ZwFreeVirtualMemory(ProcessHandle, &BaseAddress, &RegionSize, MEM_RELEASE); \
|
||||
if (FreeStatus != IGNORE) ok_eq_hex(Status, FreeStatus); \
|
||||
|
@ -104,7 +109,7 @@ SimpleErrorChecks(VOID)
|
|||
|
||||
//BASE ADDRESS TESTS
|
||||
Base = (PVOID)0x00567A20;
|
||||
ALLOC_MEMORY_WITH_FREE(NtCurrentProcess(), Base, 0, RegionSize, (MEM_COMMIT | MEM_RESERVE), PAGE_READWRITE, STATUS_CONFLICTING_ADDRESSES, STATUS_FREE_VM_NOT_AT_BASE);
|
||||
ALLOC_MEMORY_WITH_FREE(NtCurrentProcess(), Base, 0, RegionSize, (MEM_COMMIT | MEM_RESERVE), PAGE_READWRITE, STATUS_CONFLICTING_ADDRESSES, STATUS_UNABLE_TO_DELETE_SECTION);
|
||||
|
||||
Base = (PVOID) 0x60000000;
|
||||
ALLOC_MEMORY_WITH_FREE(NtCurrentProcess(), Base, 0, RegionSize, (MEM_COMMIT | MEM_RESERVE), PAGE_READWRITE, STATUS_SUCCESS, STATUS_SUCCESS);
|
||||
|
@ -501,7 +506,7 @@ START_TEST(ZwAllocateVirtualMemory)
|
|||
|
||||
Status = STATUS_SUCCESS;
|
||||
Status = StressTesting(MEM_COMMIT);
|
||||
ok_eq_hex(Status, STATUS_COMMITMENT_LIMIT);
|
||||
ok_eq_hex(Status, STATUS_NO_MEMORY);
|
||||
|
||||
SystemProcessTest();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue