Bug check on IoConnectInterruptEx()

This post was written by eli on February 5, 2012
Posted Under: Microsoft,Windows device drivers

If you’re reading this, it’s likely that you’ve experienced a bug check (blue screen of death, BSOD, if you like) as a result of calling IoConnectInterruptEx().

It’s also likely that you used this function to support MSI (Message Signaling Interrupt). You may have attempted to follow the horribly misleading example given by Microsoft itself.

The thing is, that there’s a parameter they omitted in that example, and that’s params.MessageBased.ConnectionContext.InterruptMessageTable. That’s a pointer to a PIO_INTERRUPT_MESSAGE_INFO. If you don’t know what I’m talking about, I won’t bother to explain that: It already means I’ve just solved your problem.

I’ll just say, that IoConnectInterruptEx() uses that parameter as a pointer to write the value of another pointer of some all-so-cute and most likely useless structure of information. So if this parameter isn’t initialized, the kernel attempts to write to a null pointer, and there we are with a blue screen.

To get the example wrong in an official page is somewhat understandable. Using a pointer without checking it for being null in a kernel function is completely amazing.

Add a Comment

required, use real name
required, will not be published
optional, your blog address