1 /* $Id: smss.c,v 1.12 2002/09/07 15:13:09 chorns 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
30 #define NTOS_USER_MODE
36 DisplayString(LPCWSTR lpwString
)
40 RtlInitUnicodeString(&us
, lpwString
);
46 PrintString(char* fmt
,...)
50 UNICODE_STRING UnicodeString
;
51 ANSI_STRING AnsiString
;
54 vsprintf(buffer
, fmt
, ap
);
57 RtlInitAnsiString(&AnsiString
, buffer
);
58 RtlAnsiStringToUnicodeString(&UnicodeString
,
61 NtDisplayString(&UnicodeString
);
62 RtlFreeUnicodeString(&UnicodeString
);
66 /* Native image's entry point */
69 NtProcessStartup(PPEB Peb
)
71 HANDLE Children
[2]; /* csrss, winlogon */
74 Status
= InitSessionManager(Children
);
75 if (!NT_SUCCESS(Status
))
77 PrintString("SM: Initialization failed!\n");
81 Status
= NtWaitForMultipleObjects(((LONG
) sizeof(Children
) / sizeof(HANDLE
)),
85 NULL
); /* NULL for infinite */
86 if (!NT_SUCCESS(Status
))
88 PrintString("SM: NtWaitForMultipleObjects failed!\n");
92 PrintString("SM: Process terminated!\n");
96 /* Raise a hard error (crash the system/BSOD) */
97 NtRaiseHardError(STATUS_SYSTEM_PROCESS_TERMINATED
,
100 // NtTerminateProcess(NtCurrentProcess(), 0);