Share via


NdisScheduleWorkItem (Windows Embedded CE 6.0)

1/6/2010

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.

Syntax

NDIS_STATUS NdisScheduleWorkItem(
  PNDIS_WORK_ITEM WorkItem
);

Parameters

  • WorkItem
    [in] Points to the work item that was set up by a preceding call to NdisInitializeWorkItem.

Return Value

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

Header ndis.h
Windows Embedded CE Windows CE .NET 4.0 and later

See Also

Reference

NDIS Library Functions
NdisFreeMemory
NdisInitializeWorkItem