ID Number: Q82149
1.00
WINDOWS
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 "TESTEVNT.DLL" ()
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 "housekeeping."
The following code uses the Windows API function call ExitWindows() to
exit Windows without any adverse affects:
Declare Function ExitWindows Lib "USER" (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)
Additional reference words: 1.00