ReactOS 0.4.15-dev-7918-g2a2556c
GuardedMemory.c File Reference
#include <kmt_test.h>
Include dependency graph for GuardedMemory.c:

Go to the source code of this file.

Functions

 START_TEST (GuardedMemory)
 

Function Documentation

◆ START_TEST()

START_TEST ( GuardedMemory  )

Definition at line 14 of file GuardedMemory.c.

15{
17 SIZE_T Size = 123;
19
20 /* access some invalid memory to test SEH */
23 {
24 RtlFillMemory(NULL, 1, 0);
25 }
27 {
29 } _SEH2_END;
31
32 /* get guarded mem */
34
35 if (skip(Buffer != NULL, "Failed to allocate guarded memory\n"))
36 return;
37
38 /* access to guarded mem should be fine */
41 {
43 }
45 {
47 } _SEH2_END;
49
50 /* access one byte behind guarded mem must cause an access violation! */
53 {
54 RtlFillMemory(Buffer + Size, 1, 0);
55 }
57 {
59 } _SEH2_END;
61
63}
#define ok_eq_hex(value, expected)
Definition: apitest.h:77
#define skip(...)
Definition: atltest.h:64
LONG NTSTATUS
Definition: precomp.h:26
Definition: bufpool.h:45
#define NULL
Definition: types.h:112
#define _SEH2_END
Definition: filesup.c:22
#define _SEH2_TRY
Definition: filesup.c:19
Status
Definition: gdiplustypes.h:25
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
#define RtlFillMemory(Dest, Length, Fill)
Definition: winternl.h:599
VOID KmtFreeGuarded(PVOID Pointer)
BOOLEAN BOOLEAN VOID VOID BOOLEAN BOOLEAN PVOID KmtAllocateGuarded(SIZE_T SizeRequested)
#define STATUS_ACCESS_VIOLATION
Definition: ntstatus.h:242
#define _SEH2_GetExceptionCode()
Definition: pseh2_64.h:159
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:34
#define STATUS_SUCCESS
Definition: shellext.h:65
ULONG_PTR SIZE_T
Definition: typedefs.h:80
char * PCHAR
Definition: typedefs.h:51
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4533