Shutdown
Description
Demonstrates the use of a system shutdown handler in an application.
Source Files
Shutdown project source file:
Shutdown.c
sets up a continuous periodic timer that drives the speaker. When the shutdown occurs (either a normal Windows shutdown or a "blue screen" stop), the shutdown handler is called and it prints out a message, waits another 10 seconds, and then stops the timer and returns, allowing Windows to complete the shutdown.
Building the Sample
Build the sample as an .rtss executable binary file.
Running the Sample
- Run the sample in the real-time environment.
- Test the two types of shutdown behavior by forcing Windows to shut down via the following methods:
- Use the Windows utility NotMyFault, available from Microsoft at https://docs.microsoft.com/en-us/sysinternals/downloads/notmyfault, to generate a Windows Blue Screen.
- Shut down the machine through the Start menu.
NOTE: On Windows 10, the thread will continue to run but no output will appear on the screen.
Remarks
See also Shutdown Handling.
APIs Referenced
RTAPI |
Win32 APIs |