ExQueueWorkItem inserts a given work item into a queue from which a system worker thread removes the item and gives control to the routine that the caller supplied to ExInitializeWorkItem.
void ExQueueWorkItem( __drv_aliasesMem PWORK_QUEUE_ITEM WorkItem, WORK_QUEUE_TYPE QueueType );
Pointer to the work item. This work item must have been initialized by a preceding call to ExInitializeWorkItem.
Specifies the queue into which the work item pointed to by WorkItem is to be inserted. QueueType can be either of the following:
|CriticalWorkQueue||Insert the WorkItem into the queue from which a system thread with a real-time priority attribute will process the work item.|
|DelayedWorkQueue||Insert the WorkItem into the queue from which a system thread with a variable priority attribute will process the work item.|
The QueueType value HyperCriticalWorkQueue is reserved for system use.
System worker threads are a limited resource. Drivers must not permanently reserve a work item for the driver's use. Work items are designed for operations that complete quickly. Drivers should free any work items that they allocate as soon as possible.
A driver must not wait for its callback routine to complete an operation if it is already holding one synchronization object and might attempt to acquire another. To prevent deadlock, a driver should release any currently held semaphores, mutexes, resource variables, and so forth before it calls ExQueueWorkItem.
The value of QueueType determines the runtime priority at which the callback routine is run, as follows:
If the callback runs in the system thread with a real-time priority attribute, the callback routine cannot be preempted except by threads with higher real-time priorities.
If the callback runs in the system thread with a variable priority attribute, the callback can be preempted by threads with higher variable and real-time priorities, and the callback is scheduled to run round-robin with other threads of the same priority for a quantum each.
|Header||wdm.h (include Wdm.h, Ntifs.h, Fltkernel.h)|