Export (0) Print
Expand All
Expand Minimize
This topic has not yet been rated - Rate this topic

KeSetImportanceDpc routine

The KeSetImportanceDpc routine specifies how soon the DPC routine is run.

Syntax


VOID KeSetImportanceDpc(
  _Inout_  PRKDPC Dpc,
  _In_     KDPC_IMPORTANCE Importance
);

Parameters

Dpc [in, out]

Pointer to the caller's DPC object, which KeInitializeDpc already initialized.

Importance [in]

Specifies one of the following system-defined values to determine the behavior of KeInsertQueueDpc and IoRequestDpc when either routine is used to queue the DPC.

LowImportance

Place the DPC at the end of the DPC queue, and do not begin processing of the queue.

MediumImportance

Place the DPC at the end of the DPC queue. If the DPC is assigned to the current processor's DPC queue, begin processing the queue immediately. MediumImportance is the default value for Importance.

MediumHighImportance

Place the DPC at the end of the DPC queue, and begin processing the queue immediately. MediumHighImportance is available only on Windows Vista and later versions of Windows.

HighImportance

Place the DPC at the beginning of the DPC queue, and begin processing the queue immediately.

Return value

None

Remarks

The KeSetImportanceDpc routine influences how soon a DPC is run after it is queued by determining:

  • The location of the DPC within the DPC queue. Typically, the KeInsertQueueDpc and IoRequestDpc routines place a DPC at the end of the queue. If a driver first calls KeSetImportanceDpc with Importance = HighImportance, KeInsertQueueDpc and IoRequestDpc will place the DPC at the beginning of the queue.

  • When the system begins processing the DPC queue. Typically, KeInsertQueueDpc and IoRequestDpc immediately begin processing the DPC queue for the current processor. Drivers can specify different values for Importance to change this behavior.

By default, DPCs are assigned to the DPC queue for the current processor, so specifying MediumImportance or MediumHighImportance for Importance has the same effect. However, drivers can use KeSetTargetProcessorDpc to change the processor that the DPC will be assigned to.

For Windows Vista and later versions of the Windows operating system, you can use KeSetImportanceDpc for threaded DPCs. If the caller sets Importance to HighImportance, the DPC is placed at the beginning of the queue; otherwise, it is placed at the end. The routine does not affect when the threaded DPC queue is processed. Threaded DPCs are always processed by a dedicated thread at IRQL = PASSIVE_LEVEL. For more information about threaded DPCs, see Threaded DPCs.

Note that a driver must call KeSetImportanceDpc before it calls KeInsertQueueDpc and IoRequestDpc to have any effect.

For more information about how the system processes the DPC queue, see Organization of DPC Queues.

Requirements

Version

Available starting with Windows 2000.

Header

Wdm.h (include Wdm.h, Ntddk.h, or Ntifs.h)

Library

Ntoskrnl.lib

IRQL

Any level

See also

IoRequestDpc
KeInitializeDpc
KeInsertQueueDpc
KeSetTargetProcessorDpc
KeSynchronizeExecution

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft. All rights reserved.