Previous Next

IoFreeWorkItem

The IoFreeWorkItem routine frees the specified work item.

VOID 
  IoFreeWorkItem(
    IN PIO_WORKITEM  IoWorkItem
    );

Parameters

IoWorkItem
Pointer to a private IO_WORKITEM structure that was returned by a previous call to IoAllocateWorkItem.

Return Value

None

Headers

Declared in wdm.h and ntddk.h. Include wdm.h or ntddk.h.

Comments

Drivers must call IoFreeWorkItem from within the callback routine that was supplied to IoQueueWorkItem.

Work items are a limited system resource, and drivers should free them as soon as they are no longer required. For example, drivers should not wait until Unload to free any work items were allocated but not queued.

See Also

IoAllocateWorkItem, IoQueueWorkItem