2 Copyright © 1995-2014, The AROS Development Team. All rights reserved.
10 #include "sharedmem.h"
17 static LPTSTR cmdline
;
19 /* Remember our launch context (bootstrap name and command line) */
20 void SaveArgs(char **argv
)
22 bootstrapname
= argv
[0];
23 cmdline
= GetCommandLine();
26 void __aros
Host_Shutdown(unsigned char warm
)
31 PROCESS_INFORMATION ProcInfo
;
32 char var
[SHARED_RAM_LEN
];
35 sprintf(var
, "%s=%p:%p", SHARED_RAM_VAR
, RAM_Handle
, RAM_Address
);
37 strcpy(var
, SHARED_RAM_VAR
"=");
39 D(printf("[Shutdown] Dir: %s, Name: %s, RAM: %s, Command line: %s\n", bootstrapdir
, bootstrapname
, var
, cmdline
));
41 SetCurrentDirectory(bootstrapdir
);
42 FillMemory(&runinfo
, sizeof(runinfo
), 0);
43 runinfo
.cb
= sizeof(runinfo
);
45 bsname
= StrConvert(bootstrapname
);
47 * If we create new process without CREATE_NEW_CONSOLE, strange thing will happen if we start AROS
48 * from within command line processor. Looks like it's Windows bug/misdesign. Well, let's reopen the console every time.
50 res
= CreateProcess(bsname
, cmdline
, NULL
, NULL
, TRUE
, CREATE_NEW_CONSOLE
, NULL
, bootstrapdir
, &runinfo
, &ProcInfo
);
55 D(printf("[Shutdown] AROS re-run\n"));
57 CloseHandle(ProcInfo
.hProcess
);
58 CloseHandle(ProcInfo
.hThread
);
62 D(printf("[Shutdown] Unable to re-run AROS\n"));