- Implement ProtocolResetComplete
[reactos.git] / base / system / smss / init.c
1 /* $Id$
2 *
3 * init.c - Session Manager initialization
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 * 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 #include "smss.h"
27
28 #define NDEBUG
29 #include <debug.h>
30
31
32 /* FUNCTIONS ****************************************************************/
33
34 typedef NTSTATUS (* SM_INIT_ROUTINE)(VOID);
35
36 struct {
37 BOOL Required;
38 SM_INIT_ROUTINE EntryPoint;
39 PCHAR ErrorMessage;
40 } InitRoutine [] = {
41 {TRUE, SmCreateHeap, "create private heap, aborting"},
42 {TRUE, SmCreateObjectDirectories, "create object directories"},
43 {TRUE, SmCreateApiPort, "create \\SmApiPort"},
44 {TRUE, SmCreateEnvironment, "create the system environment"},
45 {TRUE, SmSetEnvironmentVariables, "set system environment variables"},
46 {TRUE, SmInitDosDevices, "create dos device links"},
47 {TRUE, SmRunBootApplications, "run boot applications"},
48 {TRUE, SmProcessFileRenameList, "process the file rename list"},
49 {FALSE, SmLoadKnownDlls, "preload system DLLs"},
50 {TRUE, SmCreatePagingFiles, "create paging files"},
51 {TRUE, SmInitializeRegistry, "initialize the registry"},
52 {FALSE, SmUpdateEnvironment, "update environment variables"},
53 {TRUE, SmInitializeClientManagement, "initialize client management"},
54 {TRUE, SmLoadSubsystems, "load subsystems"}
55 };
56
57 NTSTATUS
58 InitSessionManager(VOID)
59 {
60 UINT i = 0;
61 NTSTATUS Status = STATUS_SUCCESS;
62
63 for (i=0; i < (sizeof InitRoutine / sizeof InitRoutine[0]); i++)
64 {
65 Status = InitRoutine[i].EntryPoint();
66 if(!NT_SUCCESS(Status))
67 {
68 DPRINT1("SM: %s: failed to %s (Status=%lx)\n",
69 __FUNCTION__,
70 InitRoutine[i].ErrorMessage,
71 Status);
72 if (InitRoutine[i].Required)
73 {
74 return(Status);
75 }
76 }
77 }
78 return(STATUS_SUCCESS);
79 }
80
81 /* EOF */