KeSetTargetProcessorDpc function (ntddk.h)
The KeSetTargetProcessorDpc routine specifies the processor that a DPC routine will be run on.
Syntax
void KeSetTargetProcessorDpc(
[in, out] PRKDPC Dpc,
[in] CCHAR Number
);
Parameters
[in, out] Dpc
Pointer to the caller's DPC object, which KeInitializeDpc already initialized.
[in] Number
Specifies the zero-based number of the target processor on which the DPC should be queued and executed.
Return value
None
Remarks
On multiprocessor systems, each processor has its own DPC queue. The KeSetTargetProcessorDpc routine specifies which processor's queue the system should use when the driver calls KeInsertQueueDpc or IoRequestDpc to queue a DPC to be run later.
Starting with Windows Vista, you can also use KeSetTargetProcessorDpc to specify the target processor for threaded DPCs.
A call to KeSetTargetProcessorDpc that occurs after a DPC object has been queued has no effect on the selection of a processor for the DPC routine to run on. To control the selection of the target processor, a KeSetTargetProcessorDpc call must occur before the call to KeInsertQueueDpc or IoRequestDpc that queues the DPC object.
For more information about DPC queues, see Organization of DPC Queues.
Windows 7 and later versions of Windows support processor groups. Drivers that are designed to handle information about processor groups should use the KeSetTargetProcessorDpcEx routine, which specifies a processor group, instead of KeSetTargetProcessorDpc, which does not. However, the implementation of KeSetTargetProcessorDpc in Windows 7 and later versions of Windows provides compatibility for drivers that were written for earlier versions of Windows, which do not support processor groups. In this implementation, if Number is less than the number of active logical processors in group 0, KeSetTargetProcessorDpc sets the target for the DPC to the processor in group 0 that is specified by Number. Otherwise, the DPC target does not change.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Available starting with Windows 2000. |
Target Platform | Universal |
Header | ntddk.h (include Wdm.h, Ntddk.h, Ntifs.h) |
Library | NtosKrnl.lib |
DLL | NtosKrnl.exe |
IRQL | Any level |