2 * LICENSE: BSD - See COPYING.ARM in root directory
3 * PROJECT: ReactOS Client/Server Runtime SubSystem
4 * FILE: subsystems/win32/csrss/csrss.c
5 * PURPOSE: CSRSS Process Main Executable Code
6 * PROGRAMMERS: Alex Ionescu (alex@relsoft.net)
7 * ReactOS Portable Systems Group
10 /* INCLUDES *******************************************************************/
12 #define NTOS_MODE_USER
13 #include <ndk/psfuncs.h>
14 #include <ndk/rtlfuncs.h>
16 #include <csr/csrsrv.h>
21 /* FUNCTIONS ******************************************************************/
25 CsrpSetDefaultProcessHardErrorMode(VOID
)
27 ULONG DefaultHardErrorMode
= 0;
29 /* Disable hard errors */
30 NtSetInformationProcess(NtCurrentProcess(),
31 ProcessDefaultHardErrorMode
,
32 &DefaultHardErrorMode
,
33 sizeof(DefaultHardErrorMode
));
43 KPRIORITY BasePriority
= (8 + 1) + 4;
45 //ULONG Response; // see the #if 0
46 UNREFERENCED_PARAMETER(envp
);
47 UNREFERENCED_PARAMETER(DebugFlag
);
49 /* Set the Priority */
50 NtSetInformationProcess(NtCurrentProcess(),
55 /* Give us IOPL so that we can access the VGA registers */
56 Status
= NtSetInformationProcess(NtCurrentProcess(),
60 if (!NT_SUCCESS(Status
))
62 /* Raise a hard error */
63 DPRINT1("CSRSS: Could not raise IOPL, Status: 0x%08lx\n", Status
);
65 Status
= NtRaiseHardError(STATUS_IO_PRIVILEGE_FAILED
,
74 /* Initialize CSR through CSRSRV */
75 Status
= CsrServerInitialization(argc
, argv
);
76 if (!NT_SUCCESS(Status
))
79 DPRINT1("CSRSS: Unable to initialize server, Status: 0x%08lx\n", Status
);
80 NtTerminateProcess(NtCurrentProcess(), Status
);
84 CsrpSetDefaultProcessHardErrorMode();
86 /* If this is Session 0, make sure killing us bugchecks the system */
87 if (NtCurrentPeb()->SessionId
== 0) RtlSetProcessIsCritical(TRUE
, NULL
, FALSE
);
89 /* Kill this thread. CSRSRV keeps us going */
90 NtTerminateThread(NtCurrentThread(), Status
);