RtlFindClearRuns routine

The RtlFindClearRuns routine finds the specified number of runs of clear bits within a given bitmap.

Syntax


ULONG RtlFindClearRuns(
  _In_  PRTL_BITMAP     BitMapHeader,
  _Out_ PRTL_BITMAP_RUN RunArray,
  _In_  ULONG           SizeOfRunArray,
  _In_  BOOLEAN         LocateLongestRuns
);

Parameters

BitMapHeader [in]

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

RunArray [out]

Pointer to the first element in a caller-allocated array for the bit position and length of each clear run found in the given bitmap variable.

SizeOfRunArray [in]

Specifies the maximum number of clear runs to satisfy this request.

LocateLongestRuns [in]

If TRUE, specifies that the routine is to search the entire bitmap for the longest clear runs it can find. Otherwise, the routine stops searching when it has found the number of clear runs specified by SizeOfRunArray.

Return value

RtlFindClearRuns returns the number of clear runs found.

Remarks

If LocateLongestRuns is TRUE, the clear runs indicated at RunArray are sorted from longest to shortest. A clear run can consist of a single bit.

Callers of RtlFindClearRuns 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, RtlFindClearRuns can be called at any IRQL.

Requirements

Target platform

Universal

Version

Available starting with Windows 2000.

Header

Wdm.h (include Wdm.h, Ntddk.h, or Ntifs.h)

Library

NtosKrnl.lib

DLL

NtosKrnl.exe

IRQL

<= APC_LEVEL (See Remarks section)

See also

RtlAreBitsClear
RTL_BITMAP
RtlFindClearBits
RtlFindLongestRunClear
RtlFindFirstRunClear
RtlFindNextForwardRunClear
RtlFindLastBackwardRunClear
RtlInitializeBitMap

 

 

Send comments about this topic to Microsoft

Show: