// storport.h
HW_INTERRUPT HwInterrupt;
BOOLEAN HwInterrupt(
PVOID DeviceExtension
)
{...}
View the official Windows Driver Kit DDI referenceNo description available.
The Storport driver calls the HwStorInterrupt routine after the HBA generates an interrupt request.
DeviceExtensionA pointer to the miniport driver's per HBA storage area.
If the miniport driver finds that its HBA did not generate the interrupt, HwStorInterrupt should return FALSE as soon as possible. The HwStorInterrupt routine should return within 50 microseconds.
The name HwStorInterrupt is just a placeholder. The actual prototype of this routine is defined in Storport.h as follows:
typedef
BOOLEAN
HW_INTERRUPT (
IN PVOID DeviceExtension
);
The HwStorInterrupt routine should return within 50 microseconds, ideally as short a time as possible. Therefore, all activity does not have to occur at high IRQL should be deferred to the HwStorDpcRoutine that is defined in the miniport driver and issued by using StorPortIssueDpc. The latency of the DPC is very low, and it will be called immediately after the return from high IRQL.
The port driver calls the HwStorInterrupt routine at DIRQL.
To define an HwStorInterrupt callback function, you must first provide a function declaration that identifies the type of callback function you’re defining. Windows provides a set of callback function types for drivers. Declaring a function using the callback function types helps Code Analysis for Drivers, Static Driver Verifier (SDV), and other verification tools find errors, and it’s a requirement for writing drivers for the Windows operating system.
For example, to define a HwStorInterrupt callback routine that is named MyHwInterrupt, use the HW_INTERRUPT type as shown in this code example:
HW_INTERRUPT MyHwInterrupt;
Then, implement your callback routine as follows:
_Use_decl_annotations_
BOOLEAN
MyHwInterrupt (
_In_ PVOID DeviceExtension
);
{
...
}
The HW_INTERRUPT function type is defined in the Storport.h header file. To more accurately identify errors when you run the code analysis tools, be sure to add the _Use_decl_annotations_ annotation to your function definition. The _Use_decl_annotations_ annotation ensures that the annotations that are applied to the HW_INTERRUPT function type in the header file are used. For more information about the requirements for function declarations, see Declaring Functions Using Function Role Types for Storport Drivers. For information about _Use_decl_annotations_, see Annotating Function Behavior.