Question

I am doing driver development under Windows (extended with real-time extension RTX from Interval Zero)

Although I don't see anything in the RTX documentation, is there a function that one can use to tell if the current location of code is called from within an interrupt context?

Was it helpful?

Solution 2

There does not exist a function that does this.

The best one can do is to use flags. Set a flag once in an interrupt, check the flag when desired, and reset once done with the interrupt.

OTHER TIPS

What do you need this for?

Since you're talking about the "Windows API", I assume you're running in user space. You will never be in an interrupt in user space -- all interrupts are handled in the kernel.

Edit: Responding to your clarification that you're developing a driver... I've never done this, so I'm not really qualified to answer. However, can't you simply set a flag when you enter your interrupt handler, then reset it when you exit it?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top