mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 16:36:33 +00:00
[KMTESTS/MM] Enable again accessing forbidden memory.
Also adda test case for the PAGE_GUARD case ROSTESTS-110
This commit is contained in:
parent
df25e4e791
commit
5d91d52417
1 changed files with 18 additions and 3 deletions
|
@ -433,8 +433,6 @@ BehaviorChecks(HANDLE FileHandleReadOnly, HANDLE FileHandleWriteOnly)
|
|||
ZwUnmapViewOfSection(NtCurrentProcess(), BaseAddress);
|
||||
}
|
||||
|
||||
/* FIXME: Crash. See ROSTESTS-110 */
|
||||
#ifdef ROSTESTS_110_FIXED
|
||||
//try to access forbidden memory
|
||||
BaseAddress = NULL;
|
||||
ViewSize = 0;
|
||||
|
@ -448,7 +446,24 @@ BehaviorChecks(HANDLE FileHandleReadOnly, HANDLE FileHandleWriteOnly)
|
|||
|
||||
ZwUnmapViewOfSection(NtCurrentProcess(), BaseAddress);
|
||||
}
|
||||
#endif /* ROSTESTS_110_FIXED */
|
||||
|
||||
//try to access guarded memory
|
||||
BaseAddress = NULL;
|
||||
ViewSize = 0;
|
||||
SectionOffset.QuadPart = 0;
|
||||
Status = ZwMapViewOfSection(WriteSectionHandle, NtCurrentProcess(), &BaseAddress, 0, 0, &SectionOffset, &ViewSize, ViewUnmap, 0, PAGE_GUARD | PAGE_READWRITE);
|
||||
if (!skip(NT_SUCCESS(Status), "Error mapping view with PAGE_NOACCESS priv. Error = %p\n", Status))
|
||||
{
|
||||
KmtStartSeh()
|
||||
RtlCompareMemory(BaseAddress, TestString, TestStringSize);
|
||||
KmtEndSeh(STATUS_GUARD_PAGE_VIOLATION);
|
||||
|
||||
KmtStartSeh()
|
||||
RtlCompareMemory(BaseAddress, TestString, TestStringSize);
|
||||
KmtEndSeh(STATUS_SUCCESS);
|
||||
|
||||
ZwUnmapViewOfSection(NtCurrentProcess(), BaseAddress);
|
||||
}
|
||||
|
||||
ZwClose(WriteSectionHandle);
|
||||
|
||||
|
|
Loading…
Reference in a new issue