Question regarding WDFINTERRUPT and MSI-X vector number order.

Hi,

Is it safe to assume that MSI-X vector numbers (MessageIDs) are assigned in the same order that interrupt objects are created?
As in: 1st interrupt object gets message id 0, 2nd object gets message id 1, 3rd gets 2, etc…?

The interrupt objects are being created in EvtDeviceAdd and not in EvtPrepareHardware if that matters.

So far, from practice that appears to be the case, but I want to make sure I’m not depending on a coincidence.

Thanks.

I have no idea what the correct answer is, but do you need to depend on this?

How could it work any other way? If they weren’t aligned, there would be no way to correlate the two lists.

MBond2:
In my case yes. The device has the ability to create one or more input queues in memory and allows you to tell it which MSI-X vector/message number to use when the queue is updated and the interrupt fires.

In my specific case I use interrupt object 0 (msix 0) for basic register/configuration operations.
MSIX vector 1 is associated with the 1st input queue and interrupt object 1
MSIX vector 2 with the 2nd queue and interrupt object 2 etc etc.

Tim,

Thanks for the input. I figured that was probably the case, but I’ve learned not to make assumptions if possible.