none
How to reboot Windows using NtShutdownSystem without Windows advanced options menu?

    Question

  • Hi, I have a problem in native mode (entry point is NtProcessStartup(...)).
    My program runs before login in Windows.

    //-----------------------------------------------------------
    #include <Ntddk.h>

    typedef enum _SHUTDOWN_ACTION {
    ShutdownNoReboot,
    ShutdownReboot,
    ShutdownPowerOff
    } SHUTDOWN_ACTION;

    NTSTATUS NTAPI NtTerminateProcess(HANDLE ProcessHandle, LONG ExitStatus);
    NTSYSCALLAPI NTSTATUS NTAPI NtShutdownSystem(IN SHUTDOWN_ACTION Action);

    void NtProcessStartup(PPEB pPEB)
    {
        NtShutdownSystem(ShutdownReboot);
        NtTerminateProcess(NtCurrentProcess(), 0 );
    }
    //-----------------------------------------------------------

    My purpose is making Windows reboot normally.
    But, when rebooting Windows, system shows the Windows advanced options menu (Options: Safe mode, Last Known Good Configuration, Start Windows Normally... etc).

    How to reboot Windows using NtShutdownSystem without Windows advanced options menu?

    Thank you !
    Friday, February 26, 2010 9:33 AM

All replies

  • Usually, to make Windows load faster once the reboot has been done, the automatic detection of OS would be chosen .

    What Windows are you using ?
    - Still a Learner :) -
    Thursday, March 04, 2010 3:24 AM
  • I use Vista x86 and Win7 x86.

    Thank you!
    Thursday, March 04, 2010 5:07 AM