IoAllocateWorkItem - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
// wdm.h

PIO_WORKITEM IoAllocateWorkItem(
  [in] PDEVICE_OBJECT DeviceObject
);

View the official Windows Driver Kit DDI reference

NtDoc

No description available.

Windows Driver Kit DDI reference (nf-wdm-ioallocateworkitem)

IoAllocateWorkItem function

Description

The IoAllocateWorkItem routine allocates a work item.

Parameters

DeviceObject [in]

Pointer to the caller's driver object or to one of the caller's device objects. If the caller will later pass the work item to IoQueueWorkItem, DeviceObject must point to a device object.

Return value

IoAllocateWorkItem returns a pointer to the allocated IO_WORKITEM structure. The routine returns NULL if sufficient resources do not exist.

Remarks

The driver must free the work item that is returned by IoAllocateWorkItem by calling IoFreeWorkItem.

IoAllocateWorkItem both allocates and initializes a work item. A related routine, IoInitializeWorkItem, initializes a work item in storage that the driver has previously allocated. Do not call IoInitializeWorkItem to initialize a work item that was allocated by IoAllocateWorkItem.

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

See also

IO_WORKITEM

IoFreeWorkItem

IoInitializeWorkItem

IoQueueWorkItem

IoQueueWorkItemEx