KsQueueWorkItem function (ks.h)

The KsQueueWorkItem function queues the specified work item with a worker previous created by the KsRegisterWorker function.

Syntax

KSDDKAPI NTSTATUS KsQueueWorkItem(
  [in] PKSWORKER        Worker,
  [in] PWORK_QUEUE_ITEM WorkItem
);

Parameters

[in] Worker

Specifies the previously allocated worker.

[in] WorkItem

Specifies the initialized work item to queue. This work item is only associated with the worker as long as the worker is on a queue. The work item must have been initialized by IoAllocateWorkItem.

Return value

The KsQueueWorkItem function returns STATUS_SUCCESS if the work item was queued, or if unsuccessful the function returns an error when attempting to create a new worker if no threads are currently available.

Remarks

The worker can only be on a queue in one place, so subsequent queuing of the worker must wait until the work item has begun executing. This function may be called at DISPATCH_LEVEL.

Requirements

Requirement Value
Target Platform Universal
Header ks.h (include Ks.h)
Library Ks.lib