93bd2a81f5a8d49d7a1e86d665835e132ccb94de
[reactos.git] / reactos / subsys / csrss / csrss.c
1 /* $Id: csrss.c,v 1.2 1999/07/17 23:10:30 ea Exp $
2 *
3 * csrss.c - Client/Server Runtime subsystem
4 *
5 * ReactOS Operating System
6 *
7 * --------------------------------------------------------------------
8 *
9 * This software is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License as
11 * published by the Free Software Foundation; either version 2 of the
12 * License, or (at your option) any later version.
13 *
14 * This software is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Library General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this software; see the file COPYING.LIB. If not, write
21 * to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge,
22 * MA 02139, USA.
23 *
24 * --------------------------------------------------------------------
25 *
26 * 19990417 (Emanuele Aliberti)
27 * Do nothing native application skeleton
28 * 19990528 (Emanuele Aliberti)
29 * Compiled successfully with egcs 1.1.2
30 * 19990605 (Emanuele Aliberti)
31 * First standalone run under ReactOS (it
32 * actually does nothing but running).
33 */
34 #include <ddk/ntddk.h>
35
36 BOOL TerminationRequestPending = FALSE;
37
38 BOOL InitializeServer(void);
39
40
41 void
42 DisplayString(
43 LPCWSTR Message
44 )
45 {
46 UNICODE_STRING title;
47
48 title.Buffer = (LPWSTR) Message;
49 title.Length = wcslen(title.Buffer) * sizeof (WCHAR);
50 title.MaximumLength = title.Length + sizeof (WCHAR);
51 NtDisplayString( & title );
52 }
53
54
55 /* Native process' entry point */
56
57 void
58 NtProcessStartup( PSTARTUP_ARGUMENT StartupArgument )
59 {
60 DisplayString( L"Client/Server Runtime Subsystem\n" );
61
62 if (TRUE == InitializeServer())
63 {
64 while (FALSE == TerminationRequestPending)
65 {
66 /* Do nothing! Should it
67 * be the SbApi port's
68 * thread instead?
69 */
70 NtYieldExecution();
71 }
72 }
73 else
74 {
75 DisplayString( L"CSR: Subsystem initialization failed.\n" );
76 /*
77 * Tell SM we failed.
78 */
79 }
80 NtTerminateProcess( NtCurrentProcess(), 0 );
81 }
82
83 /* EOF */