RtlCompareMemoryUlong - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
#ifndef _NTRTL_H

_Must_inspect_result_
NTSYSAPI
SIZE_T
NTAPI
RtlCompareMemoryUlong(
    _In_reads_bytes_(Length) PVOID Source,
    _In_ SIZE_T Length,
    _In_ ULONG Pattern
    );

#endif

View code on GitHub
// ntifs.h

NTSYSAPI SIZE_T RtlCompareMemoryUlong(
  [in] PVOID  Source,
  [in] SIZE_T Length,
  [in] ULONG  Pattern
);
View the official Windows Driver Kit DDI reference

NtDoc

This function is documented in Windows Driver Kit.

Windows Driver Kit DDI reference (nf-ntifs-rtlcomparememoryulong)

RtlCompareMemoryUlong function

Description

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

Parameters

Source [in]

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

Length [in]

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

Pattern [in]

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.

See also

RtlCompareMemory