1 /* $Id: smss.c,v 1.8 2000/10/09 00:18:00 ekohl Exp $
3 * smss.c - Session Manager
5 * ReactOS Operating System
7 * --------------------------------------------------------------------
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.
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 * General Public License for more details.
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,
24 * --------------------------------------------------------------------
26 * 19990529 (Emanuele Aliberti)
27 * Compiled successfully with egcs 1.1.2
29 #include <ddk/ntddk.h>
35 DisplayString( LPCWSTR lpwString
)
39 RtlInitUnicodeString (&us
, lpwString
);
40 NtDisplayString (&us
);
45 PrintString (char* fmt
,...)
49 UNICODE_STRING UnicodeString
;
50 ANSI_STRING AnsiString
;
53 vsprintf(buffer
, fmt
, ap
);
56 RtlInitAnsiString (&AnsiString
, buffer
);
57 RtlAnsiStringToUnicodeString (
61 NtDisplayString(&UnicodeString
);
62 RtlFreeUnicodeString (&UnicodeString
);
66 /* Native image's entry point */
68 void NtProcessStartup (PPEB Peb
)
70 HANDLE Children
[2]; /* csrss, winlogon */
72 DisplayString( L
"Session Manager\n" );
74 if (TRUE
== InitSessionManager(Children
))
78 DisplayString( L
"SM: Waiting for process termination...\n" );
81 wws
= NtWaitForMultipleObjects (
82 ((LONG
) sizeof Children
/ sizeof (HANDLE
)),
86 NULL
/* NULL for infinite */
89 wws
= NtWaitForSingleObject (
90 Children
[CHILD_WINLOGON
],
95 // if (!NT_SUCCESS(wws))
98 DisplayString( L
"SM: NtWaitForMultipleObjects failed!\n" );
102 DisplayString( L
"SM: Process terminated!\n" );
107 DisplayString( L
"SM: Initialization failed!\n" );
110 /* Raise a hard error (crash the system/BSOD) */
111 NtRaiseHardError (STATUS_SYSTEM_PROCESS_TERMINATED
,
114 // NtTerminateProcess(NtCurrentProcess(), 0);