Share via


NdisAllocateIoWorkItem (Compact 2013)

3/26/2014

NDIS drivers call this function to allocate a work item.

Syntax

NDIS_HANDLE
  NdisAllocateIoWorkItem(
    IN NDIS_HANDLE  NdisObjectHandle
    );

Parameters

  • NdisObjectHandle
    The handle of an NDIS object that is associated with a device object or driver object.

Return Value

If NdisAllocateIoWorkItem successfully allocates a work item, it returns a handle to the work item. If it fails, NdisAllocateIoWorkItem returns NULL.

Remarks

NDIS miniport drivers pass NdisAllocateIoWorkItem either of two handles: the adapter handle that NDIS passed to the MiniportInitializeEx function or the miniport driver handle that NDIS returned when the miniport driver called NdisMRegisterMiniportDriver.

NDIS filter drivers can pass NdisAllocateIoWorkItem the filter driver handle that NDIS returned when the filter driver called NdisFRegisterFilterDriver.

NDIS miniport drivers and filter drivers can also pass NdisAllocateIoWorkItem the NDIS device handle that NDIS returned when the driver called NdisRegisterDeviceEx. NdisAllocateIoWorkItem gets the device object or driver object that is associated with the handle and passes the device object or driver object to the IoAllocateWorkItem function. Protocol drivers cannot use this function because NDIS does not associate protocol drivers with device objects or driver objects.

NDIS drivers call the NdisQueueIoWorkItem function to queue work items. After a driver calls NdisQueueIoWorkItem, NDIS calls the driver-specified callback function at IRQL = PASSIVE_LEVEL. This can improve system performance by allowing the current function to end immediately and the driver to do work later at a lower IRQL.

NDIS drivers must call the NdisFreeIoWorkItem function to free the resources associated with a work item that NdisAllocateIoWorkItem allocated. Drivers call NdisFreeIoWorkItem in the callback routine that is passed to NdisQueueIoWorkItem.

Requirements

Header

ndis.h

See Also

Reference

NDIS I/O Work Item Functions
MiniportInitializeEx
NdisQueueIoWorkItem
NdisFreeIoWorkItem
NdisFRegisterFilterDriver
NdisMRegisterMiniportDriver