The RtlCompareMemory routine compares two blocks of memory and returns the number of bytes that match.
NTSYSAPI SIZE_T RtlCompareMemory( const VOID *Source1, const VOID *Source2, SIZE_T Length );
A pointer to the first block of memory.
A pointer to the second block of memory.
The number of bytes to compare.
RtlCompareMemory returns the number of bytes in the two blocks that match. If all bytes match up to the specified Length value, the Length value is returned.
The routine starts by comparing the first byte in the first block to the first byte in the second block, and continues to compare successive bytes in the two blocks while the bytes match. The routine stops comparing bytes when it encounters the first pair of bytes that are not equal, or when the number of matching bytes equals the Length parameter value, whichever occurs first.
Callers of RtlCompareMemory can be running at any IRQL if both blocks of memory are resident.
|Minimum supported client||Available starting with Windows 2000.|
|Header||wdm.h (include Wdm.h, Ntddk.h, Ntifs.h)|
|Library||NtosKrnl.lib; OneCoreUAP.lib on Windows 10|
|DLL||NtDll.dll (user mode); Kernel32.dll (user mode); NtosKrnl.exe (kernel mode)|
|IRQL||Any level (See Remarks section)|
|DDI compliance rules||BufAfterReqCompletedIntIoctlA, BufAfterReqCompletedIoctlA, BufAfterReqCompletedReadA, BufAfterReqCompletedWriteA|
Send feedback about: