다음을 통해 공유


NdisInitializeWorkItem (Windows Embedded CE 6.0)

1/6/2010

This function 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(
  PNDIS_WORK_ITEM WorkItem,
  NDIS_PROC Routine,
  PVOID Context
);

Parameters

  • WorkItem
    [in] Points to the caller-supplied storage to be initialized.
  • 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] Points to a caller-supplied context area that is passed, not interpreted, 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 NIC miniport that is not deserialized should never call an NdisXXXWorkItem function.

The given Routine is responsible for calling NdisFreeMemory to release the storage for Item.

Requirements

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

See Also

Reference

NDIS Library Functions
NdisFreeMemory
NdisScheduleWorkItem