Microsoft KB Archive/82149

= Microsoft Knowledge Base =

Undocumented Reboot Function in TESTEVNT.DLL
Last reviewed: October 19, 1994

Article ID: Q82149

The information in this article applies to:

- Microsoft Test for Windows, version 1.0

SUMMARY
There is an undocumented subroutine, Reboot, in TESTEVNT.DLL that is included with Microsoft Test version 1.0 for Windows. The Reboot subroutine will cause a system cold boot without exiting Windows. This is not a recommended method for exiting Windows, and is included with Test only as a last resort for restarting the system in a critical situation, such as after multiple Unrecoverable Application Errors (UAEs) have occurred. Therefore, integrity of data/test when using Reboot is not guaranteed by Microsoft. An alternative method for exiting Windows is to call the Windows API function ExitWindows.

This information applies to Microsoft Test version 1.0 for Windows.

MORE INFORMATION
To call the Reboot subroutine, put the following in a Test Driver script and execute it:

Declare Sub Reboot Lib &quot;TESTEVNT.DLL&quot; Reboot Exiting Windows by rebooting the system can cause unpredictable results. Before exiting, Windows needs to close and save each application and do some other &quot;housekeeping.&quot;

The following code uses the Windows API function call ExitWindows to exit Windows without any adverse affects:

Declare Function ExitWindows Lib &quot;USER&quot; (dwReserved As Long,                wReturnCode As Integer) As Integer ' The above Declare statement must be on one line. Dim wReturnCode As Integer Dim dwReserved As Long Dim ReturnValue as integer dwReserved = 0 dwReturnCode = 0 ReturnValue = ExitWindows(dwReserved, wReturnCode)