Reputation: 1319
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?
Upvotes: 0
Views: 310
Reputation: 1319
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.
Upvotes: 1
Reputation: 24140
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?
Upvotes: 1