views:

52

answers:

2

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?

+1  A: 

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?

Martin B
+1  A: 

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.

CodeLizard