ReactOS 0.4.15-dev-8222-g9164419
RtlCopyMappedMemory.c File Reference
#include "precomp.h"
Include dependency graph for RtlCopyMappedMemory.c:

Go to the source code of this file.

Functions

static NTSTATUS (NTAPI *pRtlCopyMappedMemory)(PVOID
 
 START_TEST (RtlCopyMappedMemory)
 

Variables

static const VOID SIZE_T
 

Function Documentation

◆ NTSTATUS()

static NTSTATUS ( NTAPI pRtlCopyMappedMemory)
static

◆ START_TEST()

START_TEST ( RtlCopyMappedMemory  )

Definition at line 12 of file RtlCopyMappedMemory.c.

13{
15 UCHAR Buffer1[32];
16 UCHAR Buffer2[32];
17
18 pRtlCopyMappedMemory = (PVOID)GetProcAddress(GetModuleHandleW(L"ntdll.dll"),
19 "RtlCopyMappedMemory");
20 if (!pRtlCopyMappedMemory)
21 {
22 win_skip("RtlCopyMappedMemory (NT >= 5.2 API) not available\n");
23 return;
24 }
25
26 StartSeh() pRtlCopyMappedMemory(NULL, NULL, 1); EndSeh(STATUS_ACCESS_VIOLATION);
27 StartSeh() pRtlCopyMappedMemory(Buffer1, NULL, 1); EndSeh(STATUS_ACCESS_VIOLATION);
28 StartSeh() pRtlCopyMappedMemory(NULL, Buffer1, 1); EndSeh(STATUS_ACCESS_VIOLATION);
29
30 StartSeh()
31 Status = pRtlCopyMappedMemory(NULL, NULL, 0);
34
35 RtlFillMemory(Buffer1, sizeof(Buffer1), 0x11);
36 RtlFillMemory(Buffer2, sizeof(Buffer2), 0x22);
37 StartSeh()
38 Status = pRtlCopyMappedMemory(Buffer1, Buffer2, sizeof(Buffer1));
41 ok(RtlCompareMemory(Buffer1, Buffer2, sizeof(Buffer1)) == sizeof(Buffer1), "Data not copied\n");
42}
#define StartSeh()
Definition: _sntprintf.h:16
#define EndSeh(ExpectedStatus)
Definition: _sntprintf.h:17
#define ok(value,...)
Definition: atltest.h:57
LONG NTSTATUS
Definition: precomp.h:26
#define NULL
Definition: types.h:112
#define GetProcAddress(x, y)
Definition: compat.h:753
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
Definition: loader.c:838
#define RtlCompareMemory(s1, s2, l)
Definition: env_spec_w32.h:465
Status
Definition: gdiplustypes.h:25
GLdouble n
Definition: glext.h:7729
#define RtlFillMemory(Dest, Length, Fill)
Definition: winternl.h:599
NTSTATUS NTAPI RtlCopyMappedMemory(_Out_writes_bytes_all_(Size) PVOID Destination, _In_reads_bytes_(Size) const VOID *Source, _In_ SIZE_T Size)
Definition: memstream.c:479
#define STATUS_ACCESS_VIOLATION
Definition: ntstatus.h:242
#define L(x)
Definition: ntvdm.h:50
#define win_skip
Definition: test.h:163
#define STATUS_SUCCESS
Definition: shellext.h:65
void * PVOID
Definition: typedefs.h:50
ActualNumberDriverObjects * sizeof(PDRIVER_OBJECT)) PDRIVER_OBJECT *DriverObjectList
unsigned char UCHAR
Definition: xmlstorage.h:181

Variable Documentation

◆ SIZE_T

Definition at line 10 of file RtlCopyMappedMemory.c.