revert between 56095 -> 55830 in arch
[AROS.git] / arch / all-mingw32 / exec / shutdowna.c
blob3b3ac2f78e327a01f1c8e467f089be786e0b19f9
1 /*
2 Copyright © 1995-2010, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: ShutdownA() - Shut down the operating system, Windows-hosted implementation.
6 Lang: english
7 */
9 #include <aros/debug.h>
11 #include "exec_intern.h"
13 AROS_LH1(ULONG, ShutdownA,
14 AROS_LHA(ULONG, action, D0),
15 struct ExecBase *, SysBase, 173, Exec)
17 AROS_LIBFUNC_INIT
19 /* WinAPI CreateProcess() call may silently abort if scheduler attempts task switching
20 while it's running. There's no sense in this beyond this point, so we simply Disable() */
21 Disable();
23 switch(action)
25 case SD_ACTION_POWEROFF:
26 PD(SysBase).ExitProcess(0);
27 break;
29 case SD_ACTION_COLDREBOOT:
30 PD(SysBase).Reboot(FALSE);
31 break;
34 Enable();
35 return 0;
37 AROS_LIBFUNC_EXIT