Macros Defined by RDBSS

A number of useful macros are defined in the Window Driver Kit (WDK)header files that call these RDBSS routines or other kernel routines. Some of these macros are normally used instead of calling the RDBSS routines directly. Some of these macros are used as convenience routines.

The following macros are defined by RDBSS.

Macro Description

RxAcquirePrefixTableLockExclusive (TABLE, WAIT)

This macro acquires the prefix table lock in exclusive mode for change operations.

RxAcquirePrefixTableLockShared (TABLE, WAIT)

This macro acquires the prefix table lock in shared mode for lookup operations.

RxAllocatePoolWithTag (type, size, tag)

On checked builds, this macro allocates memory from a pool with a four-byte tag at the beginning of the block that can be used to help catch instances of memory trashing.

On retail builds, this macro becomes a direct call to ExAllocatePoolWithTag.

RxCheckMemoryBlock (ptr)

On checked builds, this macro checks a memory block for a special RX_POOL_HEADER header signature.

On retail builds, this macro does nothing.

RxDereferenceAndFinalizeNetFcb (Fcb ,RxContext, RecursiveFinalize, ForceFinalize)

This macro is used to track dereference operations on FCB structures.

Note that this macro manipulates the reference count and also returns the status of the final dereference call.

RxDereferenceNetFcb (Fcb)

This macro is used to track dereference operations on FCB structures.

Note that this macro manipulates the reference count and also returns the status of the final dereference call.

RxDereferenceNetFobx (Fobx,LockHoldingState)

This macro is used to track dereference operations on FOBX structures.

RxDereferenceNetRoot (NetRoot, LockHoldingState)

This macro is used to track dereference operations on NET_ROOT structures.

RxDereferenceSrvCall (SrvCall, LockHoldingState)

This macro is used to track dereference operations on SRV_CALL structures.

RxDereferenceSrvOpen ( SrvOpen, LockHoldingState)

This macro is used to track dereference operations on SRV_OPEN structures.

RxDereferenceVNetRoot ( VNetRoot, LockHoldingState)

This macro is used to track dereference operations on V_NET_ROOT structures.

RxFcbAcquiredShared (RXCONTEXT, FCB)

This macro checks if the current thread has access to the regular resource in shared mode. This macro calls the ExIsResourceAcquiredSharedLite routine.

RxFillAndInstallFastIoDispatch(__devobj, __fastiodisp)

This macro calls __RxFillAndInstallFastIoDispatch to fill out a fast I/O dispatch vector to be identical with the normal dispatch I/O vector and installs it into the driver object associated with the device object passed.

RxFreePool (ptr)

On checked builds, this macro frees a memory pool.

On retail builds, this macro becomes a direct call to ExFreePool.

RxIsFcbAcquiredShared (FCB)

This macro checks if the current thread has access to the regular resource in shared mode. This macro calls the ExIsResourceAcquiredSharedLite routine.

RxIsFcbAcquiredExclusive (FCB)

This macro checks if the current thread has access to the regular resource in exclusive mode. This macro calls the ExIsResourceAcquiredExclusiveLite routine.

RxIsFcbAcquired (FCB)

This macro checks if the current thread has access to the regular resource in either shared or exclusive mode. This macro calls the ExIsResourceAcquiredSharedLite and ExIsResourceAcquiredExclusiveLite routines.

RxIsPrefixTableLockAcquired (TABLE)

This macro indicates if the prefix table lock was acquired in either exclusive or shared mode.

RxIsPrefixTableLockExclusive (TABLE)

This macro indicates if the prefix table lock was acquired in exclusive mode.

RxLog(Args)

On checked builds, this macro calls the _RxLog routine.

On retail builds, this macro does nothing.

Note that the arguments to RxLog must be enclosed with an additional pair of parenthesis to enable translation into a null call when logging should be turned off.

RxLogEvent (_DeviceObject, _OriginatorId, _EventId, _Status)

This macro calls the RxLogEventDirect routine.

RxLogFailure (_DeviceObject, _OriginatorId, _EventId, _Status)

This macro calls the RxLogEventDirect routine.

RxLogFailureWithBuffer (_DeviceObject, _OriginatorId, _EventId, _Status, _Buffer, _Length)

This macro calls the RxLogEventWithBufferDirect routine.

RxLogRetail(Args)

On checked builds, this macro calls the _RxLog routine.

On retail builds, this macro does nothing.

Note that the arguments to RxLogRetail must be enclosed with an additional pair of parenthesis to enable translation into a null call when logging should be turned off.

RxReferenceNetFcb (Fcb)

This macro is used to track reference operations on FCB structures.

RxReferenceNetFobx (Fobx)

This macro is used to track reference operations on FOBX structures. A log of these reference operations can be accessed by the logging system and WMI.

RxReferenceNetRoot (NetRoot)

This macro is used to track reference operations on NET_ROOT structures. A log of these reference operations can be accessed by the logging system and Windows Management Instrumentation (WMI).

RxReferenceSrvCall (SrvCall)

This macro is used to track reference operations on SRV_CALL structures that are not at Deferred Procedure Call (DPC) level.

RxReferenceSrvCallAtDpc (SrvCall)

This macro is used to track reference operations on SRV_CALL structures at DPC level.

RxReferenceSrvOpen (SrvOpen)

This macro is used to track reference operations on SRV_OPEN structures.

RxReferenceVNetRoot (VNetRoot)

This macro is used to track reference operations on V_NET_ROOT structures.

RxReleasePrefixTableLock (TABLE)

This macro frees the prefix table lock.

RxSynchronizeBlockingOperations(RXCONTEXT,FCB,IOQUEUE)

This macro synchronizes blocking I/O requests to the same work queue. On Windows Server 2003, this macro calls the __RxSynchronizeBlockingOperations routine with the DropFcbLock parameter set to FALSE.

On Windows XP and Windows 2000, this macro calls the __RxSynchronizeBlockingOperationsMaybeDroppingFcbLock routine with the DropFcbLock parameter set to FALSE.

RxSynchronizeBlockingOperations(RXCONTEXT,FCB,IOQUEUE)

This macro synchronizes blocking I/O requests to the same work queue. On Windows Server 2003, this macro calls the __RxSynchronizeBlockingOperations routine with the DropFcbLock parameter set to TRUE.

On Windows XP and Windows 2000, this macro calls the __RxSynchronizeBlockingOperationsMaybeDroppingFcbLock routine with the DropFcbLock parameter set to TRUE.