信息
您所需的主题如下所示。但此主题未包含在此库中。

WdfInterruptSetPolicy 方法

The WdfInterruptSetPolicy method specifies the interrupt priority, processor affinity, and affinity policy for a specified interrupt.

语法

VOID WdfInterruptSetPolicy(
  [in]  WDFINTERRUPT Interrupt,
  [in]  WDF_INTERRUPT_POLICY Policy,
  [in]  WDF_INTERRUPT_PRIORITY Priority,
  [in]  KAFFINITY TargetProcessorSet
);

参数

Interrupt [in]

A handle to a framework interrupt object.

Policy [in]

A WDF_INTERRUPT_POLICY-typed enumerator that specifies a processor affinity policy for the interrupt.

Priority [in]

A WDF_INTERRUPT_PRIORITY-typed enumerator that specifies a priority for the interrupt.

TargetProcessorSet [in]

A KAFFINITY-typed value that specifies a processor affinity for the interrupt, if the Policy parameter is set to WdfIrqPolicySpecifiedProcessors.

返回值

None.

A bug check occurs if the driver supplies an invalid object handle.

评论

Windows Vista and later versions of the operation system allow drivers to specify an interrupt's priority, processor affinity, and affinity policy. For information about how to use the registry to override the values that WdfInterruptSetPolicy sets, see Interrupt Affinity and Priority.

If a driver is running on an operating system version that is earlier than Windows Vista, the framework ignores the values that the driver specifies when it calls WdfInterruptSetPolicy.

For more information about registry values and INF sections that specify an interrupt's priority, processor affinity, and affinity policy, see Interrupt Affinity and Priority.

If a driver calls WdfInterruptSetPolicy, it typically does so in its EvtDriverDeviceAdd callback function, after calling WdfInterruptCreate.

For more information about handling interrupts in framework-based drivers, see Handling Hardware Interrupts.

示例

The following code example assigns a device interrupt to processor 0, with normal priority.

#define AFFINITY_MASK(n) ((ULONG_PTR)1 << (n))

WdfInterruptSetPolicy(
                      Interrupt,
                      WdfIrqPolicySpecifiedProcessors,
                      WdfIrqPriorityNormal,
                      AFFINITY_MASK(0)
                      );

要求

版本

Available in version 1.0 and later versions of KMDF.

标头

Wdfinterrupt.h (包括Wdf.h)

Wdf<MajorVersionNumber>000.sys (see Framework Library Versions.)

IRQL

<=DISPATCH_LEVEL

另请参见

WdfInterruptCreate
EvtDriverDeviceAdd
WdfInterruptSetExtendedPolicy

 

 

社区附加资源

显示:
© 2014 Microsoft