The IoAllocateWorkItem routine allocates a work item.
PIO_WORKITEM IoAllocateWorkItem( PDEVICE_OBJECT DeviceObject );
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.
IoAllocateWorkItem returns a pointer to the allocated IO_WORKITEM structure. The routine returns NULL if sufficient resources do not exist.
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.
|Minimum supported client||Available in Windows 2000 and later versions of the Windows operating system, and in Windows Me. This routine is not available in Windows 98.|
|Header||wdm.h (include Wdm.h, Ntddk.h, Ntifs.h)|