Author: tfaber
Date: Tue Sep 29 17:24:48 2015
New Revision: 69413
URL:
http://svn.reactos.org/svn/reactos?rev=69413&view=rev
Log:
[CRT]
- Add "memcmp" library that is used by kernel drivers to get
memcmp/RtlEqualMemory
CORE-10285 #resolve
Modified:
trunk/reactos/lib/sdk/crt/CMakeLists.txt
trunk/rostests/kmtests/CMakeLists.txt
trunk/rostests/kmtests/rtl/RtlMemory.c
Modified: trunk/reactos/lib/sdk/crt/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/crt/CMakeLists.txt…
==============================================================================
--- trunk/reactos/lib/sdk/crt/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/reactos/lib/sdk/crt/CMakeLists.txt [iso-8859-1] Tue Sep 29 17:24:48 2015
@@ -49,6 +49,9 @@
add_dependencies(user32_wsprintf psdk)
add_target_compile_definitions(user32_wsprintf _USER32_WSPRINTF)
+add_library(memcmp mem/memcmp.c)
+add_dependencies(memcmp psdk)
+
add_library(getopt misc/getopt.c)
add_target_compile_definitions(getopt _DLL __USE_CRTIMP)
add_dependencies(getopt psdk)
Modified: trunk/rostests/kmtests/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/kmtests/CMakeLists.txt?re…
==============================================================================
--- trunk/rostests/kmtests/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/rostests/kmtests/CMakeLists.txt [iso-8859-1] Tue Sep 29 17:24:48 2015
@@ -85,7 +85,7 @@
add_library(kmtest_drv SHARED ${KMTEST_DRV_SOURCE})
set_module_type(kmtest_drv kernelmodedriver)
-target_link_libraries(kmtest_drv kmtest_printf chkstk ${PSEH_LIB})
+target_link_libraries(kmtest_drv kmtest_printf chkstk memcmp ${PSEH_LIB})
add_importlibs(kmtest_drv ntoskrnl hal)
add_dependencies(kmtest_drv bugcodes xdk)
add_target_compile_definitions(kmtest_drv KMT_KERNEL_MODE NTDDI_VERSION=NTDDI_WS03SP1)
Modified: trunk/rostests/kmtests/rtl/RtlMemory.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/kmtests/rtl/RtlMemory.c?r…
==============================================================================
--- trunk/rostests/kmtests/rtl/RtlMemory.c [iso-8859-1] (original)
+++ trunk/rostests/kmtests/rtl/RtlMemory.c [iso-8859-1] Tue Sep 29 17:24:48 2015
@@ -287,7 +287,19 @@
KeRaiseIrql(HIGH_LEVEL, &Irql);
/* RtlEqualMemory */
- /* TODO: where is memcmp? */
+ MakePattern(Buffer, 8, HalfSize / 8 - 1, 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE,
0xF0,
+ 1, 1, 0x12,
+ 8, HalfSize / 8, 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE,
0xF0,
+ 1, 7, 0x12, 0);
+
+ ok_bool_true(RtlEqualMemory((PVOID)1, (PVOID)2, 0),
+ "RtlEqualMemory returned");
+ ok_bool_true(RtlEqualMemory(Buffer, Buffer + HalfSize - 7, HalfSize - 8),
+ "RtlEqualMemory returned");
+ ok_bool_true(RtlEqualMemory(Buffer, Buffer + HalfSize - 7, HalfSize - 8 + 1),
+ "RtlEqualMemory returned");
+ ok_bool_false(RtlEqualMemory(Buffer, Buffer + HalfSize - 7, HalfSize - 8 + 2),
+ "RtlEqualMemory returned");
/* RtlCompareMemory */
MakePattern(Buffer, 8, HalfSize / 8 - 1, 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE,
0xF0,