IWDFObject::AcquireLock method (wudfddi.h)
[Warning: UMDF 2 is the latest version of UMDF and supersedes UMDF 1. All new UMDF drivers should be written using UMDF 2. No new features are being added to UMDF 1 and there is limited support for UMDF 1 on newer versions of Windows 10. Universal Windows drivers must use UMDF 2. For more info, see Getting Started with UMDF.]
The AcquireLock method prevents the framework from calling methods of interfaces that a driver registered.
Syntax
void AcquireLock();
Return value
None
Remarks
If a driver configured itself to use the AcquireLock locking scheme, the framework automatically acquires the "presentation" lock before calling into the driver. (For more information about this locking scheme, see Specifying a Callback Synchronization Mode.) The AcquireLock and IWDFObject::ReleaseLock methods acquire and release the presentation lock, respectively. Framework device objects and framework I/O queue objects currently support the AcquireLock method.
The driver calls the AcquireLock method to manipulate its objects that were created from its callback interfaces outside the callback scope in a thread-safe manner. The AcquireLock method represents an advanced feature of the framework that most drivers will not use because improper usage can result in deadlocks.
Unsynchronized code can call AcquireLock. The driver should call on objects that match its synchronization scope.
Examples
For a code example of how to use the AcquireLock method, see IWDFDevice::SetPnpState.
Requirements
Requirement | Value |
---|---|
End of support | Unavailable in UMDF 2.0 and later. |
Target Platform | Desktop |
Minimum UMDF version | 1.5 |
Header | wudfddi.h (include Wudfddi.h) |
DLL | WUDFx.dll |