2 * PROJECT: ReactOS api tests
3 * LICENSE: LGPLv2.1+ - See COPYING.LIB in the top level directory
4 * PURPOSE: Test for RtlCopyMappedMemory
5 * PROGRAMMERS: Thomas Faber <thomas.faber@reactos.org>
10 static NTSTATUS (NTAPI
*pRtlCopyMappedMemory
)(PVOID
, const VOID
*, SIZE_T
);
12 START_TEST(RtlCopyMappedMemory
)
18 pRtlCopyMappedMemory
= (PVOID
)GetProcAddress(GetModuleHandleW(L
"ntdll.dll"),
19 "RtlCopyMappedMemory");
20 if (!pRtlCopyMappedMemory
)
22 win_skip("RtlCopyMappedMemory (NT >= 5.2 API) not available\n");
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
);
31 Status
= pRtlCopyMappedMemory(NULL
, NULL
, 0);
32 EndSeh(STATUS_SUCCESS
);
33 ok(Status
== STATUS_SUCCESS
, "RtlCopyMappedMemory returned %lx\n", Status
);
35 RtlFillMemory(Buffer1
, sizeof(Buffer1
), 0x11);
36 RtlFillMemory(Buffer2
, sizeof(Buffer2
), 0x22);
38 Status
= pRtlCopyMappedMemory(Buffer1
, Buffer2
, sizeof(Buffer1
));
39 EndSeh(STATUS_SUCCESS
);
40 ok(Status
== STATUS_SUCCESS
, "RtlCopyMappedMemory returned %lx\n", Status
);
41 ok(RtlCompareMemory(Buffer1
, Buffer2
, sizeof(Buffer1
)) == sizeof(Buffer1
), "Data not copied\n");