NdisInitializeWorkItem routine
Note NDIS 5. x has been deprecated and is superseded by NDIS 6. x. For new NDIS driver development, see Network Drivers Starting with Windows Vista. For information about porting NDIS 5. x drivers to NDIS 6. x, see Porting NDIS 5.x Drivers to NDIS 6.0.
NdisInitializeWorkItem initializes a work-queue item with a caller-supplied context and callback routine to be queued for execution when a system worker thread is given control.
Syntax
VOID NdisInitializeWorkItem(
_In_ PNDIS_WORK_ITEM WorkItem,
_In_ NDIS_PROC Routine,
_In_ PVOID Context
);
Parameters
WorkItem [in]
Pointer to the caller-supplied storage to be initialized. It must be allocated from nonpaged pool.Routine [in]
Specifies the entry point of a caller-supplied function that processes this work item when it is dequeued. This callback is declared as follows:VOID (*NDIS_PROC)( IN struct _NDIS_WORK_ITEM * pWorkItem, IN PVOID Context );
Context [in]
Pointer to a caller-supplied context area that is passed, uninterpreted, to the callback as its only parameter. This area should be in resident memory and accessible in any arbitrary thread context in which the callback might be run subsequently. In particular, Context cannot point to the stack.
Return value
None
Remarks
NdisInitializeWorkItem initializes Item with pointers to Routine and Context and a NULL list pointer.
In general, only higher level drivers queue worker-thread items.
A miniport driver that is neither deserialized nor connection-oriented should never call an Ndis..WorkItem function.
The given Routine is responsible for calling NdisFreeMemory to release the storage for Item.
Requirements
Target platform |
Desktop |
Version |
Not supported for NDIS 6.0 drivers in Windows Vista. Use NdisAllocateIoWorkIteminstead. Supported for NDIS 5.1 drivers in Windows Vista and Windows XP. |
Header |
Ndis.h (include Ndis.h) |
IRQL |
<= DISPATCH_LEVEL |
See also