Bewerken

Delen via


WdfInterruptSetExtendedPolicy function (wdfinterrupt.h)

[Applies to KMDF and UMDF]

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

Syntax

void WdfInterruptSetExtendedPolicy(
  [in] WDFINTERRUPT                   Interrupt,
  [in] PWDF_INTERRUPT_EXTENDED_POLICY PolicyAndGroup
);

Parameters

[in] Interrupt

A handle to a framework interrupt object.

[in] PolicyAndGroup

A pointer to a WDF_INTERRUPT_EXTENDED_POLICY structure that the caller allocates and initializes.

Return value

None

Remarks

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

Windows Vista and later versions of the operating system allow drivers to use the WdfInterruptSetPolicy method to specify an interrupt's priority, processor affinity, and affinity policy. In addition, versions 1.9 and later of KMDF allow drivers to use the WdfInterruptSetExtendedPolicy method to specify an interrupt's priority, processor affinity, affinity policy, and processor group.

For information about how to use the registry to override the values that WdfInterruptSetExtendedPolicy sets, see Interrupt Affinity and Priority.

If a driver is running on an operating system version that is earlier than Windows 7, the framework ignores the value that the driver specifies for the processor group number when it calls WdfInterruptSetExtendedPolicy.

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

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 WdfInterruptSetExtendedPolicy, it typically does so in its EvtDriverDeviceAdd callback function, after calling WdfInterruptCreate.

If your driver creates interrupts in EvtDevicePrepareHardware, do not use WdfInterruptSetPolicy or WdfInterruptSetExtendedPolicy. Instead, you can instead apply policy in EvtDeviceFilterAddResourceRequirements, by directly manipulating the interrupt resource requirement that this callback function receives in its IoResourceRequirementsList parameter.

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

Examples

The following code example calls WDF_INTERRUPT_EXTENDED_POLICY_INIT to initialize a WDF_INTERRUPT_EXTENDED_POLICY structure; sets values for the policy, priority, and target processor set; and calls WdfInterruptSetExtendedPolicy. The example sets normal priority for the interrupt and assigns the interrupt to processor 0 in processor group 2.

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

WDF_INTERRUPT_EXTENDED_POLICY myExtendedPolicy;

WDF_INTERRUPT_EXTENDED_POLICY_INIT(&myExtendedPolicy);
myExtendedPolicy.Policy = WdfIrqPolicySpecifiedProcessors;
myExtendedPolicy.Priority = WdfIrqPriorityNormal;
myExtendedPolicy.TargetProcessorSetAndGroup.Mask = AFFINITY_MASK(0);
myExtendedPolicy.TargetProcessorSetAndGroup.Group = 2;

WdfInterruptSetExtendedPolicy(
                              Interrupt,
                              &myExtendedPolicy
 );

Requirements

Requirement Value
Target Platform Universal
Minimum KMDF version 1.9
Minimum UMDF version 2.0
Header wdfinterrupt.h (include Wdf.h)
Library Wdf01000.sys (KMDF); WUDFx02000.dll (UMDF)
IRQL <=DISPATCH_LEVEL
DDI compliance rules DriverCreate(kmdf)

See also

WdfInterruptSetPolicy