RtlCheckBit - NtDoc

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

_Check_return_
FORCEINLINE
BOOLEAN
NTAPI_INLINE
RtlCheckBit(
    _In_ PRTL_BITMAP BitMapHeader,
    _In_range_(<, BitMapHeader->SizeOfBitMap) ULONG BitPosition
    )
{
#ifdef _WIN64
    return BitTest64((LONG64 const *)BitMapHeader->Buffer, (LONG64)BitPosition);
#else
    return (((PLONG)BitMapHeader->Buffer)[BitPosition / 32] >> (BitPosition % 32)) & 0x1;
#endif // _WIN64
}

#endif

View code on GitHub
// wdm.h

BOOLEAN RtlCheckBit(
  [in] PRTL_BITMAP BitMapHeader,
  [in] ULONG       BitPosition
);
View the official Windows Driver Kit DDI reference

NtDoc

This function is documented in Windows Driver Kit.

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

RtlCheckBit macro

Description

The RtlCheckBit routine determines whether a particular bit in a given bitmap variable is clear or set.

Parameters

BitMapHeader [in]

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

BitPosition [in]

Specifies which bit to check. This is a zero-based value indicating the position of the bit to be tested.

Return value

RtlCheckBit returns zero if the given bit is clear, or one if the given bit is set.

Remarks

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

See also

RTL_BITMAP

RtlAreBitsClear

RtlAreBitsSet

RtlInitializeBitMap

RtlNumberOfClearBits

RtlNumberOfSetBits