mirror of
https://github.com/reactos/reactos.git
synced 2025-01-05 22:12:46 +00:00
[KMTESTS:MM]
- Show that NtMapViewOfSection validates section and process handles before checking base address alignment CORE-13113 svn path=/trunk/; revision=74390
This commit is contained in:
parent
e570b43842
commit
6e74416198
1 changed files with 8 additions and 0 deletions
|
@ -142,6 +142,14 @@ SimpleErrorChecks(HANDLE FileHandleReadOnly, HANDLE FileHandleWriteOnly, HANDLE
|
||||||
BaseAddress = (PVOID)((char *)MmSystemRangeStart + 200);
|
BaseAddress = (PVOID)((char *)MmSystemRangeStart + 200);
|
||||||
TestMapView(WriteSectionHandle, NtCurrentProcess(), &BaseAddress, 0, 0, NULL, &ViewSize, ViewUnmap, 0, PAGE_READWRITE, STATUS_INVALID_PARAMETER_3, IGNORE);
|
TestMapView(WriteSectionHandle, NtCurrentProcess(), &BaseAddress, 0, 0, NULL, &ViewSize, ViewUnmap, 0, PAGE_READWRITE, STATUS_INVALID_PARAMETER_3, IGNORE);
|
||||||
|
|
||||||
|
//invalid section handle AND unaligned base address
|
||||||
|
BaseAddress = (PVOID)0x00567A20;
|
||||||
|
TestMapView((HANDLE)0xDEADBEEF, NtCurrentProcess(), &BaseAddress, 0, 0, NULL, &ViewSize, ViewUnmap, 0, PAGE_READWRITE, STATUS_INVALID_HANDLE, IGNORE);
|
||||||
|
|
||||||
|
//invalid process handle AND unaligned base address
|
||||||
|
BaseAddress = (PVOID)0x00567A20;
|
||||||
|
TestMapView(WriteSectionHandle, (HANDLE)0xDEADBEEF, &BaseAddress, 0, 0, NULL, &ViewSize, ViewUnmap, 0, PAGE_READWRITE, STATUS_INVALID_HANDLE, IGNORE);
|
||||||
|
|
||||||
//try mapping section to an already mapped address
|
//try mapping section to an already mapped address
|
||||||
Status = ZwAllocateVirtualMemory(NtCurrentProcess(), &AllocBase, 0, &AllocSize, MEM_COMMIT, PAGE_READWRITE);
|
Status = ZwAllocateVirtualMemory(NtCurrentProcess(), &AllocBase, 0, &AllocSize, MEM_COMMIT, PAGE_READWRITE);
|
||||||
if (!skip(NT_SUCCESS(Status), "Cannot allocate memory\n"))
|
if (!skip(NT_SUCCESS(Status), "Cannot allocate memory\n"))
|
||||||
|
|
Loading…
Reference in a new issue