NdisScheduleWorkItem (Windows CE 5.0)
This function inserts a given work item into a queue from which a system worker thread removes the item and gives control to the callback function that the driver previously supplied to NdisInitializeWorkItem.
NDIS_STATUS NdisScheduleWorkItem(PNDIS_WORK_ITEMWorkItem);
Parameters
- WorkItem
[in] Points to the work item that was set up by a preceding call to NdisInitializeWorkItem.
Return Values
None.
Remarks
A driver must not wait for its callback routine to complete an operation if it is already holding one synchronization object and might attempt to acquire another. For example, a NDIS driver should release any currently held spin locks, and so forth before it calls NdisScheduleWorkItem. A highest-level NDIS protocol driver also must release any currently held semaphores, mutexes, resource variables, and so forth before it calls NdisScheduleWorkItem. Releasing all synchronization resources before queuing a synchronous worker-thread operation prevents deadlocks.
A serialized miniport driver should never attempt to queue a worker-thread callback routine, because there is no way for such a driver to synchronize access to its NIC context areas with a worker-thread callback. Consequently, such a serialized NDIS driver cannot share anything in its per-adapter context area with a worker-thread callback function without causing intermittent system crashes.
Requirements
OS Versions: Windows CE .NET 4.0 and later.
Header: Ndis.h.
See Also
NdisFreeMemory | NdisInitializeWorkItem
Send Feedback on this topic to the authors