BUG: SetupPromptReboot() Does Not Reset Windows 95 or 98

ID: Q193362


The information in this article applies to:
  • Microsoft Win32 Software Development Kit (SDK), on platform(s):
    • Windows 95
    • Windows 98


SYMPTOMS

The SDK documentation states that SetupPromptReboot() is being supported on Windows NT, Windows 95, and Windows 98. However, SetupPromptReboot() does not work correctly under Windows 95 or Windows 98. Under Windows 95 or Windows 98, a call to SetupPromptReboot() returns the following error message:

You must quit this program before you quit Windows.

Click OK to quit the program and Windows, or click Cancel to continue running the program and Windows.
When you click OK the application does not immediately terminate, but a window appears with the option to End Task after a few moments. If you choose to End Task, you reset your computer. This behavior is consistent for version 4.0 of the Setupapi.dll, and the behavior might change with newer versions of Setupapi.dll.

NOTE: SetupPromptReboot() works correctly under Windows NT.


RESOLUTION

If you have a Setup API application that runs under a Windows 95 or Windows 98 computer, do not use SetupPromptReboot(). Instead, use the sample code in the article listed below.

For additional information, please see the following article in the Microsoft Knowledge Base:

Q168690 HOWTO: Programmatically Force a Log off on Windows 95/98
NOTE: Pass the flag EWX_REBOOT rather than EWX_LOGOFF in the function ExitWindowsEx(). The function call will appear as:
ExitWindowsEx(EWX_REBOOT , 0)
This restarts the computer instead of logging off.


STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article.


MORE INFORMATION

Steps to Reproduce Behavior

  1. Create a new console application.


  2. Add a file to the project, such as MyBoot.C.


  3. Add the following sample code:
    
          #include <windows.h>   // Includes basic windows functionality.
          #include <setupapi.h>  // Includes the SetupAPI.
          #pragma comment(lib,"SetupAPI.lib") //Inform linker to use SetupAPI.
    
          main()
          {
             SetupPromptReboot(0,0,FALSE);
             return 0;
          } 


  4. Compile and run the program on a Windows 95 or Windows 98 computer.


Additional query words:

Keywords : kbAPI kbWinOS95 kbWinOS98
Version : WINDOWS:
Platform : WINDOWS
Issue type : kbbug


Last Reviewed: February 1, 2000
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.