INTERRUPT_MESSAGE_INFO Structure
INTERRUPT_MESSAGE_INFO specifies a pointer to a user-allocated buffer which contains a message table and the number of entries in that table.
Syntax
typedef struct _INTERRUPT_MESSAGE_INFO { ULONG MessageCount; INTERRUPT_MESSAGE_INFO_ENTRY MessageInfo[1]; } INTERRUPT_MESSAGE_INFO, *PINTERRUPT_MESSAGE_INFO;
MessageCount
The number of INTERRUPT_MESSAGE_INFO_ENTRY structures allocated in the MessageInfo table.
MessageInfo
An array of INTERRUPT_MESSAGE_INFO_ENTRY structures. See the code sample below, in which we dynamically allocate a buffer to hold the INTERRUPT_MESSAGE_INFO structure and the out-of-bound elements, fill in the buffer, and call RtAttachInterrupt.

//
// Determine the size of the messages table.
//
// NOTE: "MsgCount" must have been properly defined.
// It must contain the number of MSI-X messages needed by the application.
//
ULONG MsgTableSize = sizeof(INTERRUPT_MESSAGE_INFO) + (MsgCount - 1) * sizeof(INTERRUPT_MESSAGE_INFO_ENTRY);
//
// Allocate memory for the messages table.
//
PINTERRUPT_MESSAGE_INFO MsgTable = (PINTERRUPT_MESSAGE_INFO)RtAllocateLocalMemory(MsgTableSize);
if (!MsgTable)
{
//
// Handle the error.
//
}
//
// Fill in the messages table.
//
ULONG MsgId;
PINTERRUPT_MESSAGE_INFO_ENTRY MsgInfo;
for (MsgId=0, MsgInfo=msgTable->MessageInfo; MsgId < MsgCount; MsgId++, MsgInfo++)
{
//
// Here, fill in the following fields based on the needs of your application:
//
// MsgInfo->MessageId = ...
// MsgInfo->TargetProcessor = ...
// MsgInfo->Priority = ...
//
}
MsgTable->MessageCount = MsgCount;
//
// Define the parameters for the call to "RtAttachInterrupt".
//
// NOTE: "ThreadAttributes", "StackSize", "MultiVectorIST", "MultiVectorISR", "MultiVectorEnableInterrupt",
// "Context", "BusNumber" and "SlotNumber" must have been properly defined.
//
ATTACH_INTERRUPT_PARAMETERS AttachParams =
{
.AttachVersion = ATTACH_MESSAGE_BASED_MULTI_VECTOR,
.MessageBasedMvector.InterruptMessageTable = MsgTable,
.MessageBasedMvector.pThreadAttributes = ThreadAttributes,
.MessageBasedMvector.StackSize = StackSize,
.MessageBasedMvector.pRoutine = MultiVectorIST,
.MessageBasedMvector.MyInterrupt = MultiVectorISR,
.MessageBasedMvector.EnableInterruptFromSpecifiedMessage = MultiVectorEnableInterrupt,
.MessageBasedMvector.Context = Context,
.MessageBasedMvector.BusNumber = BusNumber,
.MessageBasedMvector.SlotNumber = SlotNumber,
};
//
// Attach the MSI-X multi vector interrupt.
//
HANDLE hInterrupt = RtAttachInterrupt(&AttachParams);
if (!hInterrupt)
{
//
// Handle the error.
//
}
//
// Free the messages table buffer, as it’s no longer needed.
//
RtFreeLocalMemory(MsgTable);
Requirements
Minimum Supported Version |
RTX64 3.3 |
Header | Rtapi.h |
See Also: