WdfSpinLockAcquire メソッド
The WdfSpinLockAcquire method acquires a specified spin lock.
構文
VOID WdfSpinLockAcquire(
[in] WDFSPINLOCK SpinLock
);
パラメーター
- SpinLock [in]
A handle to a framework spin-lock object, obtained by a previous call to WdfSpinLockCreate.
戻り値
None.
A bug check occurs if the driver supplies an invalid object handle.
解説
The WdfSpinLockAcquire method returns after the specified spin lock has been acquired. The method returns at IRQL = DISPATCH_LEVEL.
Your driver cannot call WdfSpinLockAcquire to acquire a spin lock that the driver has specified in a WDF_INTERRUPT_CONFIG structure.
For more information about spin locks, see Synchronization Techniques for Framework-Based Drivers.
例
The following code example is part of an EvtInterruptDpc callback function from the PCIDRV sample driver. The example acquires a spin lock, calls a routine that processes received packets, and releases the spin lock.
VOID
NICEvtInterruptDpc(
IN WDFINTERRUPT WdfInterrupt,
IN WDFOBJECT WdfDevice
)
{
...
WdfSpinLockAcquire(fdoData->RcvLock);
NICHandleRecvInterrupt(fdoData);
WdfSpinLockRelease(fdoData->RcvLock);
...
}
要件
バージョン |
Available in version 1.0 and later versions of KMDF. |
ヘッダー |
Wdfsync.h (includeWdf.h) |
ライブラリ |
Wdf<MajorVersionNumber>000.sys (see Framework Library Versions.) |
IRQL |
<=DISPATCH_LEVEL |