Freigeben über


RtlCompareMemory-Funktion (wdm.h)

The RtlCompareMemory routine compares two blocks of memory and returns the number of bytes that match until the first difference.

Syntax

NTSYSAPI SIZE_T RtlCompareMemory(
  [in] const VOID *Source1,
  [in] const VOID *Source2,
  [in] SIZE_T     Length
);

Parameters

[in] Source1

Ein Zeiger auf den ersten Speicherblock.

[in] Source2

Ein Zeiger auf den zweiten Speicherblock.

[in] Length

Die Anzahl der zu vergleichenden Bytes.

Return value

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.

Remarks

Die Routine beginnt mit dem Vergleichen des ersten Byte im ersten Block mit dem ersten Byte im zweiten Block und vergleicht weiterhin aufeinander folgende Bytes in den beiden Blöcken, während die Bytes übereinstimmen. 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.

Requirements

Requirement Value
Target Platform Universal
Header wdm.h (einschließlich Wdm.h, Ntddk.h, Ntifs.h)
Library NtosKrnl.lib; OneCoreUAP.lib unter Windows 10
DLL NtDll.dll (Benutzermodus); Kernel32.dll (Benutzermodus); NtosKrnl.exe (Kernelmodus)
IRQL Beliebige Ebene (Siehe Abschnitt "Hinweise")
DDI-Complianceregeln BufAfterReqCompletedIntIoctlA(kmdf), BufAfterReqCompletedIoctlA(kmdf), BufAfterReqCompletedReadA(kmdf), BufAfterReqCompletedWriteA(kmdf)

See also

RtlCompareDeviceMemory