// wdfsync.h
VOID WdfObjectAcquireLock(
_In_ WDFOBJECT Object
);
View the official Windows Driver Kit DDI referenceNo description available.
[Applies to KMDF and UMDF]
The WdfObjectAcquireLock method acquires an object's synchronization lock.
VOID WdfObjectAcquireLock(
_In_ WDFOBJECT Object
);
Object [in]A handle to a framework device object or a framework queue object.
A bug check occurs if the driver supplies an invalid object handle.
A driver can call the WdfObjectAcquireLock method to acquire the synchronization lock that is associated with a specified framework device object or framework queue object. The method does not return until the lock has been acquired.
When the driver no longer needs the object's synchronization lock, it must call WdfObjectReleaseLock.
If the driver specified WdfExecutionLevelPassive for the ExecutionLevel member of the specified object's WDF_OBJECT_ATTRIBUTES structure, the driver must call WdfObjectAcquireLock at IRQL <= APC_LEVEL. WdfObjectAcquireLock acquires a fast mutex and returns at the caller's IRQL. (In this case, WdfObjectAcquireLock also calls KeEnterCriticalRegion before returning so that normal kernel APCs are disabled.)
If the driver did not specify WdfExecutionLevelPassive for the ExecutionLevel member of the specified object's WDF_OBJECT_ATTRIBUTES structure, the driver must call WdfObjectAcquireLock at IRQL <= DISPATCH_LEVEL. WdfObjectAcquireLock acquires a spin lock and returns at IRQL = DISPATCH_LEVEL.
For more information about synchronization locks, see Synchronization Techniques for Framework-Based Drivers.