Windows SEH provides a robust mechanism for C programs to respond to and recover from exceptions and errors. Exception handling is efficient and can result in more understandable, maintainable, and safer code, making it an essential aid to defensive programming and higher-quality programs. Similar concepts are implemented in most languages and OSs, although Windows' solution allows you to analyze the exact cause of an exception.
Console control handlers can respond to external events that do not generate exceptions. VEH is a newer feature that allows functions to be executed before SEH processing occurs. VEH is similar to conventional interrupt handling.
ReportException and exception and termination handlers are used as convenient in subsequent examples. Chapter 5 covers memory management, and, in the process, SEH is used to detect memory allocation errors.