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 SetCurrentDirectory(bootstrapdir
);
20 FillMemory(&runinfo
, sizeof(runinfo
), 0);
21 runinfo
.cb
= sizeof(runinfo
);
22 /* If we create new process without CREATE_NEW_CONSOLE, strange thing will happen if we start AROS
23 * from within command line processor. Looks like it's Windows bug/misdesign. Well, let's reopen the console every time. */
24 if (CreateProcess(bootstrapname
, cmdline
, NULL
, NULL
, FALSE
, CREATE_NEW_CONSOLE
, NULL
, bootstrapdir
, &runinfo
, &ProcInfo
)) {
25 D(printf("[Shutdown] AROS re-run\n"));
26 CloseHandle(ProcInfo
.hProcess
);
27 CloseHandle(ProcInfo
.hThread
);
30 D(printf("[Shutdown] Unable to re-run AROS\n"));