RtlCompareMemoryUlong function

The RtlCompareMemoryUlong routine returns how many bytes in a block of memory match a specified pattern.

Syntax

NTSYSAPI SIZE_T RtlCompareMemoryUlong(
  PVOID  Source,
  SIZE_T Length,
  ULONG  Pattern
);

Parameters

Source

Pointer to a block of memory. Must be aligned on a ULONG boundary.

Length

Number of bytes over which the comparison should be done. Must be a multiple of sizeof(ULONG).

Pattern

Pattern to be compared byte by byte, repeatedly, through the specified memory range.

Return Value

RtlCompareMemoryUlong returns the number of bytes that were compared and found to be equal. If all bytes compare as equal, the input Length is returned. RtlCompareMemoryUlong returns zero if Source is not ULONG-aligned or if Length is not a multiple of sizeof(ULONG).

Remarks

If the block of memory at Source is nonpaged, the caller can be running at any IRQL. Otherwise, callers of RtlCompareMemoryUlong must be running at IRQL < DISPATCH_LEVEL.

For more information about managing buffered data and initializing driver-allocated buffers, see Buffered Data and Buffer Initialization.

Requirements

   
Target Platform Universal
Header ntifs.h (include Ntifs.h)
Library NtosKrnl.lib
DLL NtosKrnl.exe (kernel mode); Ntdll.dll (user mode)
IRQL Any level (see Remarks section)

See Also

RtlCompareMemory