From c845f97fbfe02373b996246678ea1a594dacdd3f Mon Sep 17 00:00:00 2001 From: Thomas Faber Date: Thu, 19 Feb 2015 12:55:57 +0000 Subject: [PATCH 1/1] [KMTESTS:RTL] - Add some simple tests for RtlRaiseStatus to the RtlException test - Add missing volatile in (disabled) stack overflow test that caused an infinite loop on GCC builds CORE-8773 svn path=/trunk/; revision=66351 --- rostests/kmtests/include/kmt_platform.h | 1 + rostests/kmtests/rtl/RtlException.c | 19 ++++++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) 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) { -- 2.17.1