ReactOS  0.4.15-dev-2701-g34593d9
csrss.c
Go to the documentation of this file.
1 /*
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
8  */
9 
10 /* INCLUDES *******************************************************************/
11 
12 #define NTOS_MODE_USER
13 #include <ndk/psfuncs.h>
14 #include <ndk/rtlfuncs.h>
15 
16 #include <csr/csrsrv.h>
17 
18 #define NDEBUG
19 #include <debug.h>
20 
21 /* FUNCTIONS ******************************************************************/
22 
23 VOID
24 NTAPI
26 {
27  ULONG DefaultHardErrorMode = 0;
28 
29  /* Disable hard errors */
32  &DefaultHardErrorMode,
33  sizeof(DefaultHardErrorMode));
34 }
35 
36 int
37 _cdecl
38 _main(int argc,
39  char *argv[],
40  char *envp[],
41  int DebugFlag)
42 {
43  KPRIORITY BasePriority = (8 + 1) + 4;
45  //ULONG Response; // see the #if 0
48 
49  /* Set the Priority */
52  &BasePriority,
53  sizeof(KPRIORITY));
54 
55  /* Give us IOPL so that we can access the VGA registers */
58  NULL,
59  0);
60  if (!NT_SUCCESS(Status))
61  {
62  /* Raise a hard error */
63  DPRINT1("CSRSS: Could not raise IOPL, Status: 0x%08lx\n", Status);
64 #if 0
66  0,
67  0,
68  NULL,
69  OptionOk,
70  &Response);
71 #endif
72  }
73 
74  /* Initialize CSR through CSRSRV */
76  if (!NT_SUCCESS(Status))
77  {
78  /* Kill us */
79  DPRINT1("CSRSS: Unable to initialize server, Status: 0x%08lx\n", Status);
81  }
82 
83  /* Disable errors */
85 
86  /* If this is Session 0, make sure killing us bugchecks the system */
88 
89  /* Kill this thread. CSRSRV keeps us going */
91  return 0;
92 }
93 
94 /* EOF */
static int argc
Definition: ServiceArgs.c:12
NTSTATUS NTAPI NtRaiseHardError(IN NTSTATUS ErrorStatus, IN ULONG NumberOfParameters, IN ULONG UnicodeStringParameterMask, IN PULONG_PTR Parameters, IN ULONG ValidResponseOptions, OUT PULONG Response)
Definition: harderr.c:553
#define TRUE
Definition: types.h:120
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
ULONG SessionId
Definition: dllmain.c:28
LONG NTSTATUS
Definition: precomp.h:26
#define NtCurrentThread()
#define argv
Definition: mplay32.c:18
LONG KPRIORITY
Definition: compat.h:662
VOID NTAPI CsrpSetDefaultProcessHardErrorMode(VOID)
Definition: csrss.c:25
NTSTATUS NTAPI CsrServerInitialization(IN ULONG ArgumentCount, IN PCHAR Arguments[])
Definition: init.c:971
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
#define FALSE
Definition: types.h:117
#define NtCurrentProcess()
Definition: nt_native.h:1657
Status
Definition: gdiplustypes.h:24
NTSTATUS NtTerminateThread(IN HANDLE ThreadHandle OPTIONAL, IN NTSTATUS ExitStatus)
Definition: kill.c:1278
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define STATUS_IO_PRIVILEGE_FAILED
Definition: ntstatus.h:547
Definition: ncftp.h:89
ULONG DebugFlag
Definition: fxobject.cpp:44
NTSTATUS NTAPI NtSetInformationProcess(IN HANDLE ProcessHandle, IN PROCESSINFOCLASS ProcessInformationClass, IN PVOID ProcessInformation, IN ULONG ProcessInformationLength)
Definition: query.c:1105
#define NtCurrentPeb()
Definition: FLS.c:22
int _cdecl _main(int argc, char *argv[], char *envp[], int DebugFlag)
Definition: csrss.c:38
#define NULL
Definition: types.h:112
#define DPRINT1
Definition: precomp.h:8
NTSYSAPI NTSTATUS __cdecl RtlSetProcessIsCritical(_In_ BOOLEAN NewValue, _Out_opt_ PBOOLEAN OldValue, _In_ BOOLEAN NeedBreaks)
unsigned int ULONG
Definition: retypes.h:1
NTSTATUS NTAPI NtTerminateProcess(HANDLE ProcessHandle, LONG ExitStatus)