2 * PROJECT: ReactOS Client Server Runtime SubSystem (CSRSS)
3 * LICENSE: BSD - See COPYING.ARM in root directory
4 * FILE: subsystems/win32/csrss/csrss.c
5 * PURPOSE: CSRSS Main Executable Code
6 * PROGRAMMERS: Alex Ionescu (alex@relsoft.net)
7 * ReactOS Portable Systems Group
10 /* INCLUDES *******************************************************************/
12 #define WIN32_NO_STATUS
14 #define NTOS_MODE_USER
15 #include <ndk/ntndk.h>
17 #include <csr/csrsrv.h>
22 /* FUNCTIONS ******************************************************************/
26 CsrpSetDefaultProcessHardErrorMode(VOID
)
28 ULONG DefaultHardErrorMode
= 0;
30 /* Disable hard errors */
31 NtSetInformationProcess(NtCurrentProcess(),
32 ProcessDefaultHardErrorMode
,
33 &DefaultHardErrorMode
,
34 sizeof(DefaultHardErrorMode
));
44 KPRIORITY BasePriority
= (8 + 1) + 4;
46 //ULONG Response; // see the #if 0
47 UNREFERENCED_PARAMETER(envp
);
48 UNREFERENCED_PARAMETER(DebugFlag
);
50 /* Set the Priority */
51 NtSetInformationProcess(NtCurrentProcess(),
56 /* Give us IOPL so that we can access the VGA registers */
57 Status
= NtSetInformationProcess(NtCurrentProcess(),
61 if (!NT_SUCCESS(Status
))
63 /* Raise a hard error */
64 DPRINT1("CSRSS: Could not raise IOPL: %x\n", Status
);
66 Status
= NtRaiseHardError(STATUS_IO_PRIVILEGE_FAILED
,
75 /* Initialize CSR through CSRSRV */
76 Status
= CsrServerInitialization(argc
, argv
);
77 if (!NT_SUCCESS(Status
))
80 DPRINT1("CSRSS: CsrServerInitialization failed:% lx\n", Status
);
81 NtTerminateProcess(NtCurrentProcess(), Status
);
85 CsrpSetDefaultProcessHardErrorMode();
87 /* If this is Session 0, make sure killing us bugchecks the system */
88 if (NtCurrentPeb()->SessionId
== 0) RtlSetProcessIsCritical(TRUE
, NULL
, FALSE
);
90 /* Kill this thread. CSRSRV keeps us going */
91 NtTerminateThread(NtCurrentThread(), Status
);