ReactOS  0.4.15-dev-3173-g40ee59d
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);
33  ok(Status == STATUS_SUCCESS, "RtlCopyMappedMemory returned %lx\n", Status);
34 
35  RtlFillMemory(Buffer1, sizeof(Buffer1), 0x11);
36  RtlFillMemory(Buffer2, sizeof(Buffer2), 0x22);
37  StartSeh()
38  Status = pRtlCopyMappedMemory(Buffer1, Buffer2, sizeof(Buffer1));
40  ok(Status == STATUS_SUCCESS, "RtlCopyMappedMemory returned %lx\n", Status);
41  ok(RtlCompareMemory(Buffer1, Buffer2, sizeof(Buffer1)) == sizeof(Buffer1), "Data not copied\n");
42 }
ActualNumberDriverObjects * sizeof(PDRIVER_OBJECT)) PDRIVER_OBJECT *DriverObjectList
LONG NTSTATUS
Definition: precomp.h:26
GLdouble n
Definition: glext.h:7729
#define StartSeh()
Definition: _sntprintf.h:16
void * PVOID
Definition: retypes.h:9
Status
Definition: gdiplustypes.h:24
#define RtlFillMemory(Dest, Length, Fill)
Definition: winternl.h:593
unsigned char UCHAR
Definition: xmlstorage.h:181
static const WCHAR L[]
Definition: oid.c:1250
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 ok(value,...)
Definition: atltest.h:57
#define NULL
Definition: types.h:112
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
Definition: loader.c:838
#define GetProcAddress(x, y)
Definition: compat.h:612
#define STATUS_SUCCESS
Definition: shellext.h:65
#define win_skip
Definition: test.h:151
#define RtlCompareMemory(s1, s2, l)
Definition: env_spec_w32.h:465
#define EndSeh(ExpectedStatus)
Definition: _sntprintf.h:17

Variable Documentation

◆ SIZE_T

Definition at line 10 of file RtlCopyMappedMemory.c.