7 void Host_Shutdown(unsigned long action
)
10 PROCESS_INFORMATION ProcInfo
;
13 case SD_ACTION_POWEROFF
:
14 D(printf("[Shutdown] POWER OFF request\n"));
17 case SD_ACTION_COLDREBOOT
:
18 D(printf("[Shutdown] Cold reboot, dir: %s, name: %s, command line: %s\n", bootstrapdir
, bootstrapname
, cmdline
));
19 FillMemory(&runinfo
, sizeof(runinfo
), 0);
20 runinfo
.cb
= sizeof(runinfo
);
21 /* If we create new process without CREATE_NEW_CONSOLE, strange thing will happen if we start AROS
22 * from within command line processor. Looks like it's Windows bug/misdesign. Well, let's reopen the console every time. */
23 if (CreateProcess(bootstrapname
, cmdline
, NULL
, NULL
, FALSE
, CREATE_NEW_CONSOLE
, NULL
, bootstrapdir
, &runinfo
, &ProcInfo
)) {
24 D(printf("[Shutdown] AROS re-run\n"));
25 CloseHandle(ProcInfo
.hProcess
);
26 CloseHandle(ProcInfo
.hThread
);
29 D(printf("[Shutdown] Unable to re-run AROS\n"));