1 /* COPYRIGHT: See COPYING in the top level directory
2 * PROJECT: ReactOS system libraries
4 * PURPOSE: Memory functions
5 * PROGRAMMER: David Welch (welch@mcmail.com)
8 /* INCLUDES *****************************************************************/
16 /* FUNCTIONS *****************************************************************/
18 /******************************************************************************
19 * RtlCompareMemory [NTDLL.@]
21 * Compare one block of memory with another
24 * Source1 [I] Source block
25 * Source2 [I] Block to compare to Source1
26 * Length [I] Number of bytes to fill
29 * The length of the first byte at which Source1 and Source2 differ, or Length
30 * if they are the same.
35 RtlCompareMemory(IN
const VOID
*Source1
,
36 IN
const VOID
*Source2
,
40 for(i
=0; (i
<Length
) && (((PUCHAR
)Source1
)[i
]==((PUCHAR
)Source2
)[i
]); i
++)
51 RtlCompareMemoryUlong (
57 * FUNCTION: Compares a block of ULONGs with an ULONG and returns the number of equal bytes
59 * Source = Block to compare
60 * Length = Number of bytes to compare
61 * Value = Value to compare
62 * RETURNS: Number of equal bytes
65 PULONG ptr
= (PULONG
)Source
;
66 ULONG len
= Length
/ sizeof(ULONG
);
69 for (i
= 0; i
< len
; i
++)
76 return (ULONG
)((PCHAR
)ptr
- (PCHAR
)Source
);
92 memset(Destination
, Fill
, Length
);
108 PULONG Dest
= Destination
;
109 ULONG Count
= Length
/ sizeof(ULONG
);
144 RtlPrefetchMemoryNonTemporal(
149 /* By nature of prefetch, this is non-portable. */