Problem enabling MSI interrupts, invalid DeviceNode?

So I have been bashing my head against my inability to enable MSI interrupts for a PCI Express card for a few days now. In my IRP_MN_START_DEVICE handler where I connect my interrupts, if I enable MSI interrupts I get a “STATUS_NOT_SUPPORTED” back from IoConnectInterruptEx. If I debug a bit into the actual call I noticed that a null-check fails, and it turns out its the DeviceObject->DeviceObjectExtension->DeviceNode pointer which is null. This pointer is set in my AddDevice routine, at least it is not null. In all my IRP_MJ_PNP calls, it is now null.

I get a feeling that my device creation is wrong somehow. Does windows not think my driver needs a physical device node? I am using a custom device class if that matters. I only really found one pertinent Google hit and that was from a ReactOS developer suggesting this is a sanity check that fails. The post is titled “How to check for a valid PDO?”.

Why are you writing a WDM driver, and not using WDF?

Peter

I had trouble with a very old windows 10 version apparently, and WDM worked but WDF did not. I think, possibly, that compiling for windows 8.1 instead solved the problem for me but at that point I had already switched over to WDM. Also the codebase I was using was WDM-based.

Regarding the “Not supported” status, it seems to imply that the card does not support MSI interrupts! But alas, I can see with the pci windbg extension that both are enabled per the PCI flags. Also I get a list of resources in IRP_MN_FILTER_RESOURCE_REQUIREMENTS where I can see two MSI interrupt resources (with 4 and 1 messages) and one legacy. This all implies that MSI should work.

What’s your .inf look like?
You know about this; right?

@Shane_Corbin said:
What’s your .inf look like?
You know about this; right?

Yes. I can enable/disable MSI in the registry and I see different interrupt resources sent to me in both IRP_MN_FILTER_RESOURCE_REQUIREMENTS and IRP_MN_START_DEVICE. Also I see the MSI flag in the PCI configuration space change when I change the registry setting.