AudRecordLib
Public Member Functions
RtlResource Class Reference

#include <rtlresource.h>

List of all members.

Public Member Functions

 RtlResource ()
 ~RtlResource ()
BOOLEAN AcquireShared (BOOLEAN waitForAccess)
BOOLEAN AcquireExclusive (BOOLEAN waitForAccess)
void Release ()
void OutputDebugText () const

Detailed Description

Very thin RAII wrapper around the fat read/writer lock


Constructor & Destructor Documentation

RtlResource::RtlResource ( )

Initialises a resource

If this is the first object initialised, the function pointers to the Rtl*Resource functions in ntdll.dll are retreived before initialisation.

RtlResource::~RtlResource ( )

Frees the memory and handles associated with the resource


Member Function Documentation

BOOLEAN RtlResource::AcquireExclusive ( BOOLEAN  waitForAccess)

Acquires the resource for exclusive access

Exclusive access cannot be requested if the thread already has shared access, this will lead to deadlock unless waitForAccess is FALSE

Parameters:
waitForAccessSpecifies whether to block if access can't be immediately granted
Returns:
Non-zero if access was granted, zero if not
BOOLEAN RtlResource::AcquireShared ( BOOLEAN  waitForAccess)

Acquires the resource for shared access

Shared access can be requested if the thread already has exclusive access, the thread however retains the exclusive access state

Parameters:
waitForAccessSpecifies whether to block if access can't be immediately granted
Returns:
Non-zero if access was granted, zero if not
void RtlResource::OutputDebugText ( ) const

Outputs details about the current state of the resource to the debug output

The display is of the format:
Resource @ <address of resource>
NumberOfWaitingShared = <number>
NumberOfWaitingExclusive = <number>
NumberOfActive = <number>

void RtlResource::Release ( )

Undoes the previous acquire operation whether shared or exclusive


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Defines