winapisignalsinternalsnt-native-api

What does SIGINT translate into in the NT native API?


Windows has support for SIGINT in console applications in response to Ctrl-C. This implies Windows has functionality to interrupt a running thread from a remote thread (process even!) and invoke a signal handler.

Exactly how does this work at the NT Native API level? Can this thread-interruption API be used for other purposes in userspace?


Solution

  • According to http://msdn.microsoft.com/en-us/library/xdkz3x12(v=vs.71).aspx, a SIGINT causes a new thread to be created to handle the interrupt.

    So it looks like it doesn't really "interrupt" any running threads. You can achieve the same effect by simply spawning your own thread.

    There is more commentary here: