ReactOS 0.4.16-dev-297-gc569aee
eng-mem-1.c File Reference
#include <ntddk.h>
#include <winddi.h>
#include "regtests.h"
Include dependency graph for eng-mem-1.c:

Go to the source code of this file.

Functions

static void RunTest ()
 

Function Documentation

◆ RunTest()

static void RunTest ( )
static

Definition at line 6 of file eng-mem-1.c.

7{
8#if 0
9 VOID *pmem1, *pmem2;
10 ULONG AllocSize1, AllocSize2;
11 ULONG AllocTag1, AllocTag2;
12 HANDLE Handle1, Handle2;
13
14 /* Allocate memory with EngAllocMem */
15 pmem1 = 0;
16 AllocSize1 = 1024;
17 AllocTag1 = 'zyxD';
18 pmem1 = EngAllocMem(FL_ZERO_MEMORY, AllocSize1, AllocTag1);
19 _AssertNotEqualValue(pmem1, NULL);
20
21 /* Allocate memory with EngAllocMem */
22 pmem2 = 0;
23 AllocSize2 = 1024;
24 AllocTag2 = 'zyxD';
25 pmem2 = EngAllocUserMem(AllocSize2, AllocTag2);
26 _AssertNotEqualValue(pmem1, NULL);
27
28 /* Lock down memory with EngSecureMem
29 ** Dependant functions in ntoskrnl.exe are currently unimplemented
30 Handle1 = EngSecureMem(pmem1, AllocSize1);
31 _AssertNotEqualValue(pmem1, NULL);
32 Handle2 = EngSecureMem(pmem2, AllocSize2);
33 _AssertNotEqualValue(pmem2, NULL);
34
35 /* Unlock down memory with EngSecureMem
36 ** Dependant functions in ntoskrnl.exe are currently unimplemented
37 EngUnsecureMem(Handle1);
38 EngUnsecureMem(Handle2); */
39
40 /* Free memory with EngFreeMem */
41 EngFreeMem(pmem1);
42
43 /* Free memory with EngFreeUserMem */
44 EngFreeUserMem(pmem2);
45#endif
46}
#define NULL
Definition: types.h:112
#define EngFreeMem
Definition: polytest.cpp:56
#define FL_ZERO_MEMORY
Definition: polytest.cpp:58
void * EngAllocMem(int zero, unsigned long size, int tag=0)
Definition: polytest.cpp:70
uint32_t ULONG
Definition: typedefs.h:59
ENGAPI VOID APIENTRY EngFreeUserMem(_Pre_notnull_ __drv_freesMem(UserMem) PVOID pv)