Bewerken

Delen via


IWDFInterrupt::SetPolicy method (wudfddi.h)

[Warning: UMDF 2 is the latest version of UMDF and supersedes UMDF 1. All new UMDF drivers should be written using UMDF 2. No new features are being added to UMDF 1 and there is limited support for UMDF 1 on newer versions of Windows 10. Universal Windows drivers must use UMDF 2. For more info, see Getting Started with UMDF.]

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

Syntax

void SetPolicy(
  [in] WDF_INTERRUPT_POLICY   Policy,
  [in] WDF_INTERRUPT_PRIORITY Priority,
  [in] KAFFINITY              TargetProcessorSet
);

Parameters

[in] Policy

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

[in] Priority

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

[in] TargetProcessorSet

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

Return value

None

Remarks

Starting in Windows Vista, drivers can specify an interrupt's priority, processor affinity, and affinity policy. For more information about how to use the registry to override the values that SetPolicy 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 SetPolicy.

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 SetPolicy, it must do so in its IDriverEntry::OnDeviceAdd callback function, after calling the IWDFDevice3::CreateInterrupt method.

For more information about handling interrupts in UMDF drivers, see Accessing Hardware and Handling Interrupts.

Examples

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

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

pIWdfInterrupt->SetPolicy(
                          WdfIrqPolicySpecifiedProcessors,
                          WdfIrqPriorityNormal,
                          AFFINITY_MASK(0)
                          );

Requirements

Requirement Value
End of support Unavailable in UMDF 2.0 and later.
Target Platform Desktop
Minimum UMDF version 1.11
Header wudfddi.h
DLL WUDFx.dll

See also

IWDFInterrupt

KAFFINITY

WDF_INTERRUPT_POLICY

WDF_INTERRUPT_PRIORITY