IoQueueWorkItem function

The IoQueueWorkItem routine associates a WorkItem routine with a work item, and it inserts the work item into a queue for later processing by a system worker thread.

Syntax

NTKERNELAPI VOID IoQueueWorkItem(
  __drv_aliasesMem PIO_WORKITEM IoWorkItem,
  PIO_WORKITEM_ROUTINE          WorkerRoutine,
  WORK_QUEUE_TYPE               QueueType,
  __drv_aliasesMem PVOID        Context
);

Parameters

IoWorkItem

Pointer to an IO_WORKITEM structure that was allocated by IoAllocateWorkItem or initialized by IoInitializeWorkItem.

WorkerRoutine

Pointer to a WorkItem routine.

QueueType

Specifies a WORK_QUEUE_TYPE value that stipulates the type of system worker thread to handle the work item. Drivers must specify DelayedWorkQueue.

Context

Specifies driver-specific information for the work item. The system passes this value as the Context parameter to WorkItem.

Return Value

None.

Remarks

For more information about work items, see System Worker Threads.

Requirements

   
Windows version Available starting with Windows 2000.
Target Platform Universal
Header wdm.h (include Wdm.h, Ntddk.h, Ntifs.h)
Library NtosKrnl.lib
DLL NtosKrnl.exe
IRQL "<= DISPATCH_LEVEL"

See Also

IO_WORKITEM

IoAllocateWorkItem

IoQueueWorkItemEx

WorkItem