ULONG
RtlFindFirstRunSet(
  IN  PRTL_BITMAP BitMapHeader,
  OUT PULONG StartingIndex
  );

Routine Description:

    This procedure finds the first contiguous range of set bits
    within the specified bit map.

Arguments:

    BitMapHeader - Supplies a pointer to the previously initialized BitMap.

    StartingIndex - Receives the index (zero based) of the first run
        equal to the longest run of set bits in the BitMap.

Return Value:

    ULONG - Receives the number of bits contained in the largest contiguous
        run of set bits.