Expand Minimize

IoAllocateWorkItem routine

The IoAllocateWorkItem routine allocates a work item.

Syntax


PIO_WORKITEM IoAllocateWorkItem(
  _In_  PDEVICE_OBJECT DeviceObject
);

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.

Requirements

Version

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, or Ntifs.h)

Library

Ntoskrnl.lib

IRQL

<= DISPATCH_LEVEL

See also

IO_WORKITEM
IoInitializeWorkItem
IoQueueWorkItem
IoQueueWorkItemEx
IoFreeWorkItem

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft