RtlFindLongestRunClear - NtDoc

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

NTSYSAPI
ULONG
NTAPI
RtlFindLongestRunClear(
    _In_ PRTL_BITMAP BitMapHeader,
    _Out_ PULONG StartingIndex
    );

#endif

View code on GitHub
// wdm.h

NTSYSAPI ULONG RtlFindLongestRunClear(
  [in]  PRTL_BITMAP BitMapHeader,
  [out] PULONG      StartingIndex
);
View the official Windows Driver Kit DDI reference

NtDoc

This function is documented in Windows Driver Kit.

Windows Driver Kit DDI reference (nf-wdm-rtlfindlongestrunclear)

RtlFindLongestRunClear function

Description

The RtlFindLongestRunClear routine searches for the largest contiguous range of clear bits within a given bitmap.

Parameters

BitMapHeader [in]

A pointer to the RTL_BITMAP structure that describes the bitmap. This structure must have been initialized by the RtlInitializeBitMap routine.

StartingIndex [out]

Pointer to a variable in which the starting index of the longest clear run in the bitmap is returned. This is a zero-based value indicating the bit position of the first clear bit in the returned range.

Return value

RtlFindLongestRunClear returns either the number of bits in the run beginning at StartingIndex, or zero if it cannot find a run of clear bits within the bitmap.

Remarks

A returned run can have a single clear bit.

Callers of RtlFindLongestRunClear must be running at IRQL <= APC_LEVEL if the memory that contains the bitmap variable is pageable or the memory at BitMapHeader is pageable. Otherwise, RtlFindLongestRunClear can be called at any IRQL.

See also

RTL_BITMAP

RtlAreBitsClear

RtlFindClearBits

RtlFindClearRuns

RtlFindFirstRunClear

RtlFindLastBackwardRunClear

RtlFindLongestRunClear

RtlFindNextForwardRunClear

RtlInitializeBitMap

RtlNumberOfClearBits

RtlSetBits