The CreateInterrupt method creates a framework interrupt object.
HRESULT CreateInterrupt( [in] PWUDF_INTERRUPT_CONFIG *Configuration, [out] IWDFInterrupt **ppInterrupt );
- Configuration [in]
- ppInterrupt [out]
A pointer to a buffer that receives a pointer to the IWDFInterrupt interface for the new interrupt object.
The method returns S_OK if the operation succeeds. Otherwise, this method returns one of the error codes that are defined in Winerror.h.
Your driver must call CreateInterrupt one time for each interrupt vector that its device requires. If the device supports message-signaled interrupts (MSI), the driver must create an interrupt object for each message that the device can support.
After the Plug and Play (PnP) manager assigns system resources to the device, the framework stores information about the device's assigned interrupt resources in the interrupt objects that the driver has created. (Drivers that do not support Plug and Play cannot use interrupt objects.)
The system might not assign all the interrupt resources that a device can support. For example, a driver creates eight interrupt objects for a device that is capable of supporting eight MSI messages. However, the system might assign only one message to the device. In that case, seven of the interrupt objects will be unused.
Typically, your driver should store interrupt-specific information, such as the copied contents of device interrupt registers, in the interrupt object's context space. A driver calls IWDFObject::AssignContext to register a context and to request notification when the object becomes invalid.
UMDF supports level-triggered interrupts starting in Windows 8. If a driver running on an operating system earlier than Windows 8 creates a level-triggered interrupt in OnDeviceAdd, CreateInterrupt succeeds because the operating system has not yet assigned resources. However, when the framework attempts to connect the interrupt later, the device fails to start.
For more information about handling interrupts in UMDF drivers, see Accessing Hardware and Handling Interrupts.
HRESULT hr; IWDFInterrupt* pInterrupt; WUDF_INTERRUPT_CONFIG interruptConfig; WUDF_INTERRUPT_CONFIG_INIT(&interruptConfig, MyInterruptIsr, MyInterruptWorkItem); hr = pDevice->Create(&interruptConfig, &pInterrupt);
End of support
|Unavailable in UMDF 2.0 and later.|
Minimum UMDF version