diff --git a/rostests/kmtests/include/kmt_platform.h b/rostests/kmtests/include/kmt_platform.h index c2251658746..f8f2e4a1d32 100644 --- a/rostests/kmtests/include/kmt_platform.h +++ b/rostests/kmtests/include/kmt_platform.h @@ -55,6 +55,7 @@ typedef ULONG LOGICAL, *PLOGICAL; #define ExFreePoolWithTag(p, tag) HeapFree(GetProcessHeap(), 0, p) #define RtlCopyMemoryNonTemporal RtlCopyMemory #define RtlPrefetchMemoryNonTemporal(s, l) +#define ExRaiseStatus RtlRaiseStatus #endif /* defined KMT_EMULATE_KERNEL */ #endif /* defined KMT_USER_MODE */ diff --git a/rostests/kmtests/rtl/RtlException.c b/rostests/kmtests/rtl/RtlException.c index 2591c883e99..d5cae4c28d5 100644 --- a/rostests/kmtests/rtl/RtlException.c +++ b/rostests/kmtests/rtl/RtlException.c @@ -5,6 +5,7 @@ * PROGRAMMER: Thomas Faber */ +#define KMT_EMULATE_KERNEL #include START_TEST(RtlException) @@ -39,13 +40,29 @@ START_TEST(RtlException) KmtEndSeh(STATUS_ACCESS_VIOLATION); #endif + KmtStartSeh() + ExRaiseStatus(STATUS_ACCESS_VIOLATION); + KmtEndSeh(STATUS_ACCESS_VIOLATION); + + KmtStartSeh() + ExRaiseStatus(STATUS_TIMEOUT); + KmtEndSeh(STATUS_TIMEOUT); + + KmtStartSeh() + ExRaiseStatus(STATUS_STACK_OVERFLOW); + KmtEndSeh(STATUS_STACK_OVERFLOW); + + KmtStartSeh() + ExRaiseStatus(STATUS_GUARD_PAGE_VIOLATION); + KmtEndSeh(STATUS_GUARD_PAGE_VIOLATION); + /* We cannot test this in kernel mode easily - the stack is just "somewhere" * in system space, and there's no guard page below it */ #if CORE_6640_IS_FIXED #ifdef KMT_USER_MODE /* Overflow the stack - must cause a special exception */ KmtStartSeh() - PCHAR Pointer; + volatile CHAR *Pointer; while (1) {