3 * init.c - Session Manager initialization
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 * --------------------------------------------------------------------
28 #include <rosrtl/string.h>
34 /* FUNCTIONS ****************************************************************/
37 SmpSignalInitEvent(VOID
)
39 NTSTATUS Status
= STATUS_SUCCESS
;
40 OBJECT_ATTRIBUTES ObjectAttributes
= {0};
41 UNICODE_STRING EventName
={0};
42 HANDLE ReactOSInitEvent
= (HANDLE
) 0;
44 RtlInitUnicodeString (& EventName
, L
"\\ReactOSInitDone");
45 InitializeObjectAttributes(&ObjectAttributes
,
50 Status
= NtOpenEvent(&ReactOSInitEvent
,
53 if (NT_SUCCESS(Status
))
55 LARGE_INTEGER Timeout
;
56 /* This will cause the boot screen image to go away (if displayed) */
57 NtPulseEvent(ReactOSInitEvent
, NULL
);
59 /* Wait for the display mode to be changed (if in graphics mode) */
60 Timeout
.QuadPart
= -50000000LL; /* 5 second timeout */
61 NtWaitForSingleObject(ReactOSInitEvent
, FALSE
, &Timeout
);
63 NtClose(ReactOSInitEvent
);
67 /* We don't really care if this fails */
68 DPRINT1("SM: Failed to open ReactOS init notification event\n");
73 typedef NTSTATUS (* SM_INIT_ROUTINE
)(VOID
);
77 SM_INIT_ROUTINE EntryPoint
;
80 {TRUE
, SmCreateHeap
, "create private heap, aborting"},
81 {TRUE
, SmCreateObjectDirectories
, "create object directories"},
82 {TRUE
, SmCreateApiPort
, "create \\SmApiPort"},
83 {TRUE
, SmCreateEnvironment
, "create the system environment"},
84 {TRUE
, SmSetEnvironmentVariables
, "set system environment variables"},
85 {TRUE
, SmInitDosDevices
, "create dos device links"},
86 {TRUE
, SmRunBootApplications
, "run boot applications"},
87 {TRUE
, SmProcessFileRenameList
, "process the file rename list"},
88 {FALSE
, SmLoadKnownDlls
, "preload system DLLs"},
89 {TRUE
, SmCreatePagingFiles
, "create paging files"},
90 {TRUE
, SmInitializeRegistry
, "initialize the registry"},
91 {FALSE
, SmUpdateEnvironment
, "update environment variables"},
92 {TRUE
, SmInitializeClientManagement
, "initialize client management"},
93 {TRUE
, SmLoadSubsystems
, "load subsystems"},
94 {FALSE
, SmpSignalInitEvent
, "open ReactOS init notification event"},
98 InitSessionManager(VOID
)
101 NTSTATUS Status
= STATUS_SUCCESS
;
103 for (i
=0; i
< (sizeof InitRoutine
/ sizeof InitRoutine
[0]); i
++)
105 Status
= InitRoutine
[i
].EntryPoint();
106 if(!NT_SUCCESS(Status
))
108 DPRINT1("SM: %s: failed to %s (Status=%lx)\n",
110 InitRoutine
[i
].ErrorMessage
,
112 if (InitRoutine
[i
].Required
)
118 return(STATUS_SUCCESS
);