MiniportEnableMessageInterrupt routine

NDIS can call a miniport driver's MiniportEnableMessageInterrupt function to enable a message interrupt for diagnostic and troubleshooting purposes.

Note  You must declare the function by using the MINIPORT_ENABLE_MESSAGE_INTERRUPT type. For more information, see the following Examples section.

Syntax


MINIPORT_ENABLE_MESSAGE_INTERRUPT MiniportEnableMessageInterrupt;

VOID MiniportEnableMessageInterrupt(
  _In_  NDIS_HANDLE MiniportInterruptContext,
  _In_  ULONG MessageId
)
{ ... }

Parameters

MiniportInterruptContext [in]

A handle to a block of context information. The miniport driver supplied this handle in the MiniportInterruptContext parameter that the miniport driver passed to the NdisMRegisterInterruptEx function.

MessageId [in]

A message-signaled interrupt. MessageId is an index to the IO_INTERRUPT_MESSAGE_INFO_ENTRY structures inside a IO_INTERRUPT_MESSAGE_INFO structure. NDIS passes a pointer to the associated IO_INTERRUPT_MESSAGE_INFO structure at the MessageInfoTable member when the driver successfully registers for MSI with the NdisMRegisterInterruptEx function.

Return value

None

Remarks

A miniport driver must provide a MiniportEnableMessageInterrupt function if the driver calls the NdisMRegisterInterruptEx function to register an interrupt.

Miniport drivers should disable and enable a message interrupt as explained in the MiniportMessageInterrupt and MiniportMessageInterruptDpc reference pages.

NDIS calls the MiniportEnableMessageInterrupt and MiniportDisableMessageInterrupt functions to enable and disable a message interrupt for diagnostic and troubleshooting purposes. Typically, MiniportEnableMessageInterrupt and MiniportDisableMessageInterrupt access miniport driver resources that are shared by the MiniportMessageInterrupt function. Therefore, NDIS calls these handlers at DIRQL.

Examples

To define a MiniportEnableMessageInterrupt function, you must first provide a function declaration that identifies the type of function you're defining. Windows provides a set of function types for drivers. Declaring a function using the 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 MiniportEnableMessageInterrupt function that is named "MyEnableMessageInterrupt", use the MINIPORT_ENABLE_MESSAGE_INTERRUPT type as shown in this code example:


MINIPORT_ENABLE_MESSAGE_INTERRUPT MyEnableMessageInterrupt;

Then, implement your function as follows:


_Use_decl_annotations_
VOID
 MyEnableMessageInterrupt(
    __in  NDIS_HANDLE  MiniportInterruptContext,
    __in  ULONG  MessageId
    )
  {...}

The MINIPORT_ENABLE_MESSAGE_INTERRUPT function type is defined in the Ndis.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 MINIPORT_ENABLE_MESSAGE_INTERRUPT function type in the header file are used. For more information about the requirements for function declarations, see Declaring Functions by Using Function Role Types for NDIS Drivers. For information about _Use_decl_annotations_, see Annotating Function Behavior.

Requirements

Version

Supported in NDIS 6.0 and later.

Header

Ndis.h (include Ndis.h)

IRQL

DIRQL (see Remarks section)

See also

IO_INTERRUPT_MESSAGE_INFO
IO_INTERRUPT_MESSAGE_INFO_ENTRY
MiniportDisableMessageInterrupt
MiniportMessageInterrupt
MiniportMessageInterruptDPC
NDIS_MINIPORT_INTERRUPT_CHARACTERISTICS
NdisMRegisterInterruptEx

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft