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 * --------------------------------------------------------------------
32 /* FUNCTIONS ****************************************************************/
35 SmpSignalInitEvent(VOID
)
37 NTSTATUS Status
= STATUS_SUCCESS
;
38 OBJECT_ATTRIBUTES ObjectAttributes
= {0};
39 UNICODE_STRING EventName
={0};
40 HANDLE ReactOSInitEvent
= (HANDLE
) 0;
42 RtlInitUnicodeString (& EventName
, L
"\\ReactOSInitDone");
43 InitializeObjectAttributes(&ObjectAttributes
,
48 Status
= NtOpenEvent(&ReactOSInitEvent
,
51 if (NT_SUCCESS(Status
))
53 LARGE_INTEGER Timeout
;
54 /* This will cause the boot screen image to go away (if displayed) */
55 NtPulseEvent(ReactOSInitEvent
, NULL
);
57 /* Wait for the display mode to be changed (if in graphics mode) */
58 Timeout
.QuadPart
= -50000000LL; /* 5 second timeout */
59 NtWaitForSingleObject(ReactOSInitEvent
, FALSE
, &Timeout
);
61 NtClose(ReactOSInitEvent
);
65 /* We don't really care if this fails */
66 DPRINT1("SM: Failed to open ReactOS init notification event\n");
71 typedef NTSTATUS (* SM_INIT_ROUTINE
)(VOID
);
75 SM_INIT_ROUTINE EntryPoint
;
78 {TRUE
, SmCreateHeap
, "create private heap, aborting"},
79 {TRUE
, SmCreateObjectDirectories
, "create object directories"},
80 {TRUE
, SmCreateApiPort
, "create \\SmApiPort"},
81 {TRUE
, SmCreateEnvironment
, "create the system environment"},
82 {TRUE
, SmSetEnvironmentVariables
, "set system environment variables"},
83 {TRUE
, SmInitDosDevices
, "create dos device links"},
84 {TRUE
, SmRunBootApplications
, "run boot applications"},
85 {TRUE
, SmProcessFileRenameList
, "process the file rename list"},
86 {FALSE
, SmLoadKnownDlls
, "preload system DLLs"},
87 {TRUE
, SmCreatePagingFiles
, "create paging files"},
88 {TRUE
, SmInitializeRegistry
, "initialize the registry"},
89 {FALSE
, SmUpdateEnvironment
, "update environment variables"},
90 {TRUE
, SmInitializeClientManagement
, "initialize client management"},
91 {TRUE
, SmLoadSubsystems
, "load subsystems"},
92 {FALSE
, SmpSignalInitEvent
, "open ReactOS init notification event"},
96 InitSessionManager(VOID
)
99 NTSTATUS Status
= STATUS_SUCCESS
;
101 for (i
=0; i
< (sizeof InitRoutine
/ sizeof InitRoutine
[0]); i
++)
103 Status
= InitRoutine
[i
].EntryPoint();
104 if(!NT_SUCCESS(Status
))
106 DPRINT1("SM: %s: failed to %s (Status=%lx)\n",
108 InitRoutine
[i
].ErrorMessage
,
110 if (InitRoutine
[i
].Required
)
116 return(STATUS_SUCCESS
);