ReactOS 0.4.15-dev-7934-g1dc8d80
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/exfuncs.h>
14#include <ndk/psfuncs.h>
15#include <ndk/rtlfuncs.h>
16
17#include <csr/csrsrv.h>
18
19#define NDEBUG
20#include <debug.h>
21
22/* FUNCTIONS ******************************************************************/
23
24VOID
27{
28 ULONG DefaultHardErrorMode = 0;
29
30 /* Disable hard errors */
33 &DefaultHardErrorMode,
34 sizeof(DefaultHardErrorMode));
35}
36
37int
38_cdecl
40 char *argv[],
41 char *envp[],
42 int DebugFlag)
43{
46#if defined (_X86_)
48#endif
51
52 /* Set the base priority */
55 &BasePriority,
56 sizeof(BasePriority));
57
58#if defined (_X86_)
59 /* Give us IOPL so that we can access the VGA registers */
62 NULL,
63 0);
64 if (!NT_SUCCESS(Status))
65 {
66 /* Raise a hard error */
67 DPRINT1("CSRSS: Could not raise IOPL, Status: 0x%08lx\n", Status);
69 0,
70 0,
71 NULL,
73 &Response);
74 }
75#endif
76
77 /* Initialize CSR through CSRSRV */
79 if (!NT_SUCCESS(Status))
80 {
81 /* Kill us */
82 DPRINT1("CSRSS: Unable to initialize server, Status: 0x%08lx\n", Status);
84 }
85
86 /* Disable errors */
88
89 /* If this is Session 0, make sure killing us bugchecks the system */
91
92 /* Kill this thread. CSRSRV keeps us going */
94 return 0;
95}
96
97/* EOF */
#define NtCurrentPeb()
Definition: FLS.c:22
static int argc
Definition: ServiceArgs.c:12
LONG NTSTATUS
Definition: precomp.h:26
#define DPRINT1
Definition: precomp.h:8
NTSTATUS NTAPI CsrServerInitialization(IN ULONG ArgumentCount, IN PCHAR Arguments[])
Definition: init.c:1011
VOID NTAPI CsrpSetDefaultProcessHardErrorMode(VOID)
Definition: csrss.c:26
int _cdecl _main(int argc, char *argv[], char *envp[], int DebugFlag)
Definition: csrss.c:39
ULONG DebugFlag
Definition: fxobject.cpp:44
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
LONG KPRIORITY
Definition: compat.h:803
ULONG SessionId
Definition: dllmain.c:28
Status
Definition: gdiplustypes.h:25
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:551
#define PROCESS_PRIORITY_NORMAL_FOREGROUND
Definition: pstypes.h:119
@ ProcessDefaultHardErrorMode
Definition: winternl.h:868
@ ProcessBasePriority
Definition: winternl.h:861
@ ProcessUserModeIOPL
Definition: winternl.h:872
#define argv
Definition: mplay32.c:18
@ OptionOk
Definition: extypes.h:187
NTSYSAPI NTSTATUS __cdecl RtlSetProcessIsCritical(_In_ BOOLEAN NewValue, _Out_opt_ PBOOLEAN OldValue, _In_ BOOLEAN NeedBreaks)
NTSTATUS NtTerminateThread(IN HANDLE ThreadHandle OPTIONAL, IN NTSTATUS ExitStatus)
Definition: kill.c:1279
NTSTATUS NTAPI NtTerminateProcess(HANDLE ProcessHandle, LONG ExitStatus)
#define NtCurrentProcess()
Definition: nt_native.h:1657
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
NTSTATUS NTAPI NtSetInformationProcess(IN HANDLE ProcessHandle, IN PROCESSINFOCLASS ProcessInformationClass, IN PVOID ProcessInformation, IN ULONG ProcessInformationLength)
Definition: query.c:1105
#define STATUS_IO_PRIVILEGE_FAILED
Definition: ntstatus.h:547
Definition: ncftp.h:89
#define NTAPI
Definition: typedefs.h:36
uint32_t ULONG
Definition: typedefs.h:59
#define NtCurrentThread()