2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS kernel
4 * FILE: kernel/rtl/mem.c
5 * PURPOSE: Graceful system shutdown if a bug is detected
6 * PROGRAMMER: David Welch (welch@mcmail.com)
11 /* INCLUDES *****************************************************************/
13 #include <internal/kernel.h>
14 #include <internal/linkage.h>
15 #include <internal/string.h>
17 #include <ddk/ntddk.h>
19 #include <internal/debug.h>
21 /* FUNCTIONS *****************************************************************/
23 ULONG
RtlCompareMemory(PVOID Source1
, PVOID Source2
, ULONG Length
)
25 * FUNCTION: Compares blocks of memory and returns the number of equal bytes
27 * Source1 = Block to compare
28 * Source2 = Block to compare
29 * Length = Number of bytes to compare
30 * RETURNS: Number of equal bytes
35 for (i
=0,total
=0;i
<Length
;i
++)
37 if ( ((PUCHAR
)Source1
)[i
] == ((PUCHAR
)Source2
)[i
] )
45 VOID
RtlCopyBytes(PVOID Destination
,
49 RtlCopyMemory(Destination
,Source
,Length
);
52 VOID
RtlCopyMemory(VOID
* Destination
, VOID
* Source
, ULONG Length
)
54 memcpy(Destination
,Source
,Length
);
57 VOID
RtlFillMemory(PVOID Destination
, ULONG Length
, UCHAR Fill
)
59 memset(Destination
,Fill
,Length
);
62 VOID
RtlZeroMemory(PVOID Destination
, ULONG Length
)
64 RtlFillMemory(Destination
,Length
,0);
67 VOID
RtlMoveMemory(PVOID Destination
,
71 memmove(Destination
,Source
,Length
);