2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS kernel
4 * FILE: ntoskrnl/ex/init.c
5 * PURPOSE: Executive initalization
7 * PROGRAMMERS: Alex Ionescu (alex@relsoft.net) - Added ExpInitializeExecutive
8 * and optimized/cleaned it.
9 * Eric Kohl (ekohl@abo.rhein-zeitung.de)
14 #include <internal/debug.h>
16 /* DATA **********************************************************************/
18 extern ULONG MmCoreDumpType
;
19 extern CHAR KiTimerSystemAuditing
;
20 extern PVOID Ki386InitialStackArray
[MAXIMUM_PROCESSORS
];
21 extern ADDRESS_RANGE KeMemoryMap
[64];
22 extern ULONG KeMemoryMapRangeCount
;
23 extern ULONG_PTR FirstKrnlPhysAddr
;
24 extern ULONG_PTR LastKrnlPhysAddr
;
25 extern ULONG_PTR LastKernelAddress
;
26 extern LOADER_MODULE KeLoaderModules
[64];
27 extern PRTL_MESSAGE_RESOURCE_DATA KiBugCodeMessages
;
28 extern LIST_ENTRY KiProfileListHead
;
29 extern LIST_ENTRY KiProfileSourceListHead
;
30 extern KSPIN_LOCK KiProfileLock
;
31 BOOLEAN SetupMode
= TRUE
;
33 VOID
PspPostInitSystemProcess(VOID
);
35 static VOID INIT_FUNCTION
InitSystemSharedUserPage (PCSZ ParameterLine
);
36 VOID INIT_FUNCTION
ExpDisplayNotice(VOID
);
37 INIT_FUNCTION NTSTATUS
ExpLoadInitialProcess(PHANDLE ProcessHandle
, PHANDLE ThreadHandle
);
39 #if defined (ALLOC_PRAGMA)
40 #pragma alloc_text(INIT, InitSystemSharedUserPage)
41 #pragma alloc_text(INIT, ExpDisplayNotice)
42 #pragma alloc_text(INIT, ExpLoadInitialProcess)
43 #pragma alloc_text(INIT, ExpInitializeExecutive)
44 #pragma alloc_text(INIT, ExInit2)
47 /* FUNCTIONS ****************************************************************/
52 InitSystemSharedUserPage (PCSZ ParameterLine
)
54 UNICODE_STRING ArcDeviceName
;
55 UNICODE_STRING ArcName
;
56 UNICODE_STRING BootPath
;
57 UNICODE_STRING DriveDeviceName
;
58 UNICODE_STRING DriveName
;
59 WCHAR DriveNameBuffer
[20];
65 OBJECT_ATTRIBUTES ObjectAttributes
;
68 BOOLEAN BootDriveFound
= FALSE
;
72 * The shared user page has been zeroed-out right after creation.
73 * There is NO need to do this again.
75 Ki386SetProcessorFeatures();
77 /* Set the Version Data */
78 SharedUserData
->NtProductType
= NtProductWinNt
;
79 SharedUserData
->ProductTypeIsValid
= TRUE
;
80 SharedUserData
->NtMajorVersion
= 5;
81 SharedUserData
->NtMinorVersion
= 0;
84 * Retrieve the current dos system path
85 * (e.g.: C:\reactos) from the given arc path
86 * (e.g.: multi(0)disk(0)rdisk(0)partititon(1)\reactos)
87 * Format: "<arc_name>\<path> [options...]"
90 /* Create local parameter line copy */
91 ParamBuffer
= ExAllocatePool(PagedPool
, 256);
92 strcpy (ParamBuffer
, (char *)ParameterLine
);
93 DPRINT("%s\n", ParamBuffer
);
96 p
= strchr (ParamBuffer
, ' ');
98 DPRINT("%s\n", ParamBuffer
);
101 p
= strchr (ParamBuffer
, '\\');
104 DPRINT("Boot path: %s\n", p
);
105 RtlCreateUnicodeStringFromAsciiz (&BootPath
, p
);
110 DPRINT("Boot path: %s\n", "\\");
111 RtlCreateUnicodeStringFromAsciiz (&BootPath
, "\\");
113 DPRINT("Arc name: %s\n", ParamBuffer
);
115 /* Only ARC Name left - Build full ARC Name */
116 ArcNameBuffer
= ExAllocatePool (PagedPool
, 256 * sizeof(WCHAR
));
117 swprintf (ArcNameBuffer
, L
"\\ArcName\\%S", ParamBuffer
);
118 RtlInitUnicodeString (&ArcName
, ArcNameBuffer
);
119 DPRINT("Arc name: %wZ\n", &ArcName
);
121 /* Free ParamBuffer */
122 ExFreePool (ParamBuffer
);
124 /* Allocate ARC Device Name string */
125 ArcDeviceName
.Length
= 0;
126 ArcDeviceName
.MaximumLength
= 256 * sizeof(WCHAR
);
127 ArcDeviceName
.Buffer
= ExAllocatePool (PagedPool
, 256 * sizeof(WCHAR
));
129 /* Open the Symbolic Link */
130 InitializeObjectAttributes(&ObjectAttributes
,
135 Status
= NtOpenSymbolicLinkObject(&Handle
,
136 SYMBOLIC_LINK_ALL_ACCESS
,
139 /* Free the String */
140 ExFreePool(ArcName
.Buffer
);
142 /* Check for Success */
143 if (!NT_SUCCESS(Status
)) {
145 /* Free the Strings */
146 RtlFreeUnicodeString(&BootPath
);
147 ExFreePool(ArcDeviceName
.Buffer
);
148 CPRINT("NtOpenSymbolicLinkObject() failed (Status %x)\n", Status
);
153 Status
= NtQuerySymbolicLinkObject(Handle
,
158 /* Check for Success */
159 if (!NT_SUCCESS(Status
)) {
161 /* Free the Strings */
162 RtlFreeUnicodeString(&BootPath
);
163 ExFreePool(ArcDeviceName
.Buffer
);
164 CPRINT("NtQuerySymbolicLinkObject() failed (Status %x)\n", Status
);
167 DPRINT("Length: %lu ArcDeviceName: %wZ\n", Length
, &ArcDeviceName
);
169 /* Allocate Device Name string */
170 DriveDeviceName
.Length
= 0;
171 DriveDeviceName
.MaximumLength
= 256 * sizeof(WCHAR
);
172 DriveDeviceName
.Buffer
= ExAllocatePool (PagedPool
, 256 * sizeof(WCHAR
));
175 for (i
= 0; i
< 26; i
++) {
177 /* Setup the String */
178 swprintf (DriveNameBuffer
, L
"\\??\\%C:", 'A' + i
);
179 RtlInitUnicodeString(&DriveName
,
182 /* Open the Symbolic Link */
183 InitializeObjectAttributes(&ObjectAttributes
,
188 Status
= NtOpenSymbolicLinkObject(&Handle
,
189 SYMBOLIC_LINK_ALL_ACCESS
,
192 /* If it failed, skip to the next drive */
193 if (!NT_SUCCESS(Status
)) {
194 DPRINT("Failed to open link %wZ\n", &DriveName
);
199 Status
= NtQuerySymbolicLinkObject(Handle
,
203 /* If it failed, skip to the next drive */
204 if (!NT_SUCCESS(Status
)) {
205 DPRINT("Failed to query link %wZ\n", &DriveName
);
208 DPRINT("Opened link: %wZ ==> %wZ\n", &DriveName
, &DriveDeviceName
);
210 /* See if we've found the boot drive */
211 if (!RtlCompareUnicodeString (&ArcDeviceName
, &DriveDeviceName
, FALSE
)) {
213 DPRINT("DOS Boot path: %c:%wZ\n", 'A' + i
, &BootPath
);
214 swprintf(SharedUserData
->NtSystemRoot
, L
"%C:%wZ", 'A' + i
, &BootPath
);
215 BootDriveFound
= TRUE
;
218 /* Close this Link */
222 /* Free all the Strings we have in memory */
223 RtlFreeUnicodeString (&BootPath
);
224 ExFreePool(DriveDeviceName
.Buffer
);
225 ExFreePool(ArcDeviceName
.Buffer
);
227 /* Make sure we found the Boot Drive */
228 if (BootDriveFound
== FALSE
) {
230 DbgPrint("No system drive found!\n");
231 KEBUGCHECK (NO_BOOT_DEVICE
);
238 ExecuteRuntimeAsserts(VOID
)
241 * Fail at runtime if someone has changed various structures without
242 * updating the offsets used for the assembler code.
244 ASSERT(FIELD_OFFSET(KUSER_SHARED_DATA
, SystemCall
) == 0x300);
245 ASSERT(FIELD_OFFSET(KTHREAD
, InitialStack
) == KTHREAD_INITIAL_STACK
);
246 ASSERT(FIELD_OFFSET(KTHREAD
, Teb
) == KTHREAD_TEB
);
247 ASSERT(FIELD_OFFSET(KTHREAD
, KernelStack
) == KTHREAD_KERNEL_STACK
);
248 ASSERT(FIELD_OFFSET(KTHREAD
, NpxState
) == KTHREAD_NPX_STATE
);
249 ASSERT(FIELD_OFFSET(KTHREAD
, ServiceTable
) == KTHREAD_SERVICE_TABLE
);
250 ASSERT(FIELD_OFFSET(KTHREAD
, PreviousMode
) == KTHREAD_PREVIOUS_MODE
);
251 ASSERT(FIELD_OFFSET(KTHREAD
, TrapFrame
) == KTHREAD_TRAP_FRAME
);
252 ASSERT(FIELD_OFFSET(KTHREAD
, CallbackStack
) == KTHREAD_CALLBACK_STACK
);
253 ASSERT(FIELD_OFFSET(KTHREAD
, ApcState
.Process
) == KTHREAD_APCSTATE_PROCESS
);
254 ASSERT(FIELD_OFFSET(KPROCESS
, DirectoryTableBase
) == KPROCESS_DIRECTORY_TABLE_BASE
);
255 ASSERT(FIELD_OFFSET(KPROCESS
, IopmOffset
) == KPROCESS_IOPM_OFFSET
);
256 ASSERT(FIELD_OFFSET(KPROCESS
, LdtDescriptor
) == KPROCESS_LDT_DESCRIPTOR0
);
257 ASSERT(FIELD_OFFSET(KV86M_TRAP_FRAME
, SavedExceptionStack
) == TF_SAVED_EXCEPTION_STACK
);
258 ASSERT(FIELD_OFFSET(KV86M_TRAP_FRAME
, regs
) == TF_REGS
);
259 ASSERT(FIELD_OFFSET(KV86M_TRAP_FRAME
, orig_ebp
) == TF_ORIG_EBP
);
260 ASSERT(FIELD_OFFSET(KPCR
, Tib
.ExceptionList
) == KPCR_EXCEPTION_LIST
);
261 ASSERT(FIELD_OFFSET(KPCR
, Self
) == KPCR_SELF
);
262 ASSERT(FIELD_OFFSET(KIPCR
, PrcbData
) + FIELD_OFFSET(KPRCB
, CurrentThread
) == KPCR_CURRENT_THREAD
);
263 ASSERT(FIELD_OFFSET(KIPCR
, PrcbData
) + FIELD_OFFSET(KPRCB
, NpxThread
) == KPCR_NPX_THREAD
);
264 ASSERT(FIELD_OFFSET(KTSS
, Esp0
) == KTSS_ESP0
);
265 ASSERT(FIELD_OFFSET(KTSS
, IoMapBase
) == KTSS_IOMAPBASE
);
266 ASSERT(sizeof(FX_SAVE_AREA
) == SIZEOF_FX_SAVE_AREA
);
272 ParseAndCacheLoadedModules(VOID
)
277 /* Loop the Module List and get the modules we want */
278 for (i
= 1; i
< KeLoaderBlock
.ModsCount
; i
++) {
280 /* Get the Name of this Module */
281 if (!(Name
= strrchr((PCHAR
)KeLoaderModules
[i
].String
, '\\'))) {
284 Name
= (PCHAR
)KeLoaderModules
[i
].String
;
292 /* Now check for any of the modules we will need later */
293 if (!_stricmp(Name
, "ansi.nls")) {
295 CachedModules
[AnsiCodepage
] = &KeLoaderModules
[i
];
297 } else if (!_stricmp(Name
, "oem.nls")) {
299 CachedModules
[OemCodepage
] = &KeLoaderModules
[i
];
301 } else if (!_stricmp(Name
, "casemap.nls")) {
303 CachedModules
[UnicodeCasemap
] = &KeLoaderModules
[i
];
305 } else if (!_stricmp(Name
, "system") || !_stricmp(Name
, "system.hiv")) {
307 CachedModules
[SystemRegistry
] = &KeLoaderModules
[i
];
310 } else if (!_stricmp(Name
, "hardware") || !_stricmp(Name
, "hardware.hiv")) {
312 CachedModules
[HardwareRegistry
] = &KeLoaderModules
[i
];
320 ParseCommandLine(PULONG MaxMem
,
323 PBOOLEAN ForceAcpiDisable
)
327 p1
= (PCHAR
)KeLoaderBlock
.CommandLine
;
328 while(*p1
&& (p2
= strchr(p1
, '/'))) {
331 if (!_strnicmp(p2
, "MAXMEM", 6)) {
334 while (isspace(*p2
)) p2
++;
340 while(isspace(*p2
)) p2
++;
343 while (isdigit(*p2
)) {
344 *MaxMem
= *MaxMem
* 10 + *p2
- '0';
350 } else if (!_strnicmp(p2
, "NOGUIBOOT", 9)) {
355 } else if (!_strnicmp(p2
, "CRASHDUMP", 9)) {
361 if (!_strnicmp(p2
, "FULL", 4)) {
363 MmCoreDumpType
= MM_CORE_DUMP_TYPE_FULL
;
367 MmCoreDumpType
= MM_CORE_DUMP_TYPE_NONE
;
370 } else if (!_strnicmp(p2
, "BOOTLOG", 7)) {
374 } else if (!_strnicmp(p2
, "NOACPI", 6)) {
377 *ForceAcpiDisable
= TRUE
;
386 ExpDisplayNotice(VOID
)
393 "\n\n\n ReactOS " KERNEL_VERSION_STR
" Setup \n");
395 " \xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD");
401 HalDisplayString("Starting ReactOS "KERNEL_VERSION_STR
" (Build "
402 KERNEL_VERSION_BUILD_STR
")\n");
403 HalDisplayString(RES_STR_LEGAL_COPYRIGHT
);
404 HalDisplayString("\n\nReactOS is free software, covered by the GNU General "
405 "Public License, and you\n");
406 HalDisplayString("are welcome to change it and/or distribute copies of it "
408 HalDisplayString("conditions. There is absolutely no warranty for "
411 /* Display number of Processors */
413 "Found %x system processor(s). [%lu MB Memory]\n",
414 (int)KeNumberProcessors
,
415 (KeLoaderBlock
.MemHigher
+ 1088)/ 1024);
416 HalDisplayString(str
);
422 ExpLoadInitialProcess(PHANDLE ProcessHandle
,
423 PHANDLE ThreadHandle
)
425 UNICODE_STRING ImagePath
= RTL_CONSTANT_STRING(L
"\\SystemRoot\\system32\\smss.exe");
426 HANDLE SystemProcessHandle
;
428 PRTL_USER_PROCESS_PARAMETERS Params
=NULL
;
429 RTL_USER_PROCESS_INFORMATION Info
;
431 /* Create a handle to the process */
432 Status
= ObpCreateHandle(PsGetCurrentProcess(),
433 PsInitialSystemProcess
,
434 PROCESS_CREATE_PROCESS
| PROCESS_CREATE_THREAD
| PROCESS_QUERY_INFORMATION
,
436 &SystemProcessHandle
);
437 if(!NT_SUCCESS(Status
))
439 DPRINT1("Failed to create a handle for the system process!\n");
443 /* Create the Parameters */
444 Status
= RtlCreateProcessParameters(&Params
,
454 if(!NT_SUCCESS(Status
))
456 DPRINT1("Failed to create ppb!\n");
457 ZwClose(SystemProcessHandle
);
461 DPRINT("Creating process\n");
462 Status
= RtlCreateUserProcess(&ImagePath
,
463 OBJ_CASE_INSENSITIVE
,
473 /* Close the handle and free the params */
474 ZwClose(SystemProcessHandle
);
475 RtlDestroyProcessParameters(Params
);
477 if (!NT_SUCCESS(Status
))
479 DPRINT1("NtCreateProcess() failed (Status %lx)\n", Status
);
484 ZwResumeThread(Info
.ThreadHandle
, NULL
);
487 *ProcessHandle
= Info
.ProcessHandle
;
488 *ThreadHandle
= Info
.ThreadHandle
;
489 DPRINT("Process created successfully\n");
490 return STATUS_SUCCESS
;
496 ExpInitializeExecutive(VOID
)
498 UNICODE_STRING EventName
;
499 HANDLE InitDoneEventHandle
;
500 OBJECT_ATTRIBUTES ObjectAttributes
;
501 BOOLEAN NoGuiBoot
= FALSE
;
502 BOOLEAN BootLog
= FALSE
;
504 BOOLEAN ForceAcpiDisable
= FALSE
;
505 LARGE_INTEGER Timeout
;
506 HANDLE ProcessHandle
;
510 /* Check if the structures match the ASM offset constants */
511 ExecuteRuntimeAsserts();
513 /* Sets up the Text Sections of the Kernel and HAL for debugging */
516 /* Lower the IRQL to Dispatch Level */
517 KeLowerIrql(DISPATCH_LEVEL
);
519 /* Sets up the VDM Data */
522 /* Parse Command Line Settings */
523 ParseCommandLine(&MaxMem
, &NoGuiBoot
, &BootLog
, &ForceAcpiDisable
);
525 /* Initialize Kernel Memory Address Space */
526 MmInit1(FirstKrnlPhysAddr
,
529 (PADDRESS_RANGE
)&KeMemoryMap
,
530 KeMemoryMapRangeCount
,
531 MaxMem
> 8 ? MaxMem
: 4096);
533 /* Parse the Loaded Modules (by FreeLoader) and cache the ones we'll need */
534 ParseAndCacheLoadedModules();
537 /* Initialize the Dispatcher, Clock and Bug Check Mechanisms. */
540 /* Bring back the IRQL to Passive */
541 KeLowerIrql(PASSIVE_LEVEL
);
543 /* Initialize Profiling */
544 InitializeListHead(&KiProfileListHead
);
545 InitializeListHead(&KiProfileSourceListHead
);
546 KeInitializeSpinLock(&KiProfileLock
);
548 /* Load basic Security for other Managers */
549 if (!SeInit1()) KEBUGCHECK(SECURITY_INITIALIZATION_FAILED
);
551 /* Create the Basic Object Manager Types to allow new Object Types */
554 /* Initialize Lookaside Lists */
555 ExpInitLookasideLists();
557 /* Set up Region Maps, Sections and the Paging File */
560 /* Initialize Tokens now that the Object Manager is ready */
561 if (!SeInit2()) KEBUGCHECK(SECURITY1_INITIALIZATION_FAILED
);
563 /* Set 1 CPU for now, we'll increment this later */
564 KeNumberProcessors
= 1;
566 /* Initalize the Process Manager */
567 PiInitProcessManager();
569 /* Break into the Debugger if requested */
570 if (KdPollBreakIn()) DbgBreakPointWithStatus (DBG_STATUS_CONTROL_C
);
572 /* Initialize all processors */
573 while (!HalAllProcessorsStarted()) {
575 PVOID ProcessorStack
;
577 /* Set up the Kernel and Process Manager for this CPU */
578 KePrepareForApplicationProcessorInit(KeNumberProcessors
);
579 KeCreateApplicationProcessorIdleThread(KeNumberProcessors
);
581 /* Allocate a stack for use when booting the processor */
582 ProcessorStack
= RVA(Ki386InitialStackArray
[((int)KeNumberProcessors
)], MM_STACK_SIZE
);
584 /* Tell HAL a new CPU is being started */
585 HalStartNextProcessor(0, (ULONG
)ProcessorStack
- 2*sizeof(FX_SAVE_AREA
));
586 KeNumberProcessors
++;
589 /* Do Phase 1 HAL Initalization */
590 HalInitSystem(1, (PLOADER_PARAMETER_BLOCK
)&KeLoaderBlock
);
592 /* Initialize Basic System Objects and Worker Threads */
595 /* Create the system handle table, assign it to the system process, create
596 the client id table and assign a PID for the system process. This needs
597 to be done before the worker threads are initialized so the system
598 process gets the first PID (4) */
599 PspPostInitSystemProcess();
601 /* initialize the worker threads */
602 ExpInitializeWorkerThreads();
604 /* initialize callbacks */
605 ExpInitializeCallbacks();
607 /* Call KD Providers at Phase 1 */
608 KdInitSystem(1, (PLOADER_PARAMETER_BLOCK
)&KeLoaderBlock
);
610 /* Initialize I/O Objects, Filesystems, Error Logging and Shutdown */
614 PoInit((PLOADER_PARAMETER_BLOCK
)&KeLoaderBlock
, ForceAcpiDisable
);
616 /* Initialize the Registry (Hives are NOT yet loaded!) */
617 CmInitializeRegistry();
619 /* Unmap Low memory, initialize the Page Zeroing and the Balancer Thread */
622 /* Initialize Cache Views */
625 /* Initialize File Locking */
626 FsRtlpInitFileLockingImplementation();
628 /* Report all resources used by hal */
629 HalReportResourceUsage();
631 /* Clear the screen to blue */
632 HalInitSystem(2, (PLOADER_PARAMETER_BLOCK
)&KeLoaderBlock
);
634 /* Display version number and copyright/warranty message */
637 /* Call KD Providers at Phase 2 */
638 KdInitSystem(2, (PLOADER_PARAMETER_BLOCK
)&KeLoaderBlock
);
640 /* Import and create NLS Data and Sections */
643 /* Import and Load Registry Hives */
644 CmInitHives(SetupMode
);
646 /* Initialize the time zone information from the registry */
647 ExpInitTimeZoneInfo();
649 /* Enter the kernel debugger before starting up the boot drivers */
650 if (KdDebuggerEnabled
&& KdpEarlyBreak
)
653 /* Setup Drivers and Root Device Node */
656 /* Display the boot screen image if not disabled */
657 if (!NoGuiBoot
) InbvEnableBootDriver(TRUE
);
659 /* Create ARC Names, SystemRoot SymLink, Load Drivers and Assign Letters */
662 /* Load the System DLL and its Entrypoints */
665 /* Initialize the Default Locale */
666 PiInitDefaultLocale();
668 /* Initialize shared user page. Set dos system path, dos device map, etc. */
669 InitSystemSharedUserPage ((PCHAR
)KeLoaderBlock
.CommandLine
);
671 /* Create 'ReactOSInitDone' event */
672 RtlInitUnicodeString(&EventName
, L
"\\ReactOSInitDone");
673 InitializeObjectAttributes(&ObjectAttributes
,
678 Status
= ZwCreateEvent(&InitDoneEventHandle
,
681 SynchronizationEvent
,
684 /* Check for Success */
685 if (!NT_SUCCESS(Status
)) {
687 DPRINT1("Failed to create 'ReactOSInitDone' event (Status 0x%x)\n", Status
);
688 InitDoneEventHandle
= INVALID_HANDLE_VALUE
;
691 /* Launch initial process */
692 Status
= ExpLoadInitialProcess(&ProcessHandle
,
695 /* Check for success, Bugcheck if we failed */
696 if (!NT_SUCCESS(Status
)) {
698 KEBUGCHECKEX(SESSION4_INITIALIZATION_FAILED
, Status
, 0, 0, 0);
701 /* Wait on the Completion Event */
702 if (InitDoneEventHandle
!= INVALID_HANDLE_VALUE
) {
704 HANDLE Handles
[2]; /* Init event, Initial process */
706 /* Setup the Handles to wait on */
707 Handles
[0] = InitDoneEventHandle
;
708 Handles
[1] = ProcessHandle
;
710 /* Wait for the system to be initialized */
711 Timeout
.QuadPart
= (LONGLONG
)-1200000000; /* 120 second timeout */
712 Status
= ZwWaitForMultipleObjects(2,
717 if (!NT_SUCCESS(Status
)) {
719 DPRINT1("NtWaitForMultipleObjects failed with status 0x%x!\n", Status
);
721 } else if (Status
== STATUS_TIMEOUT
) {
723 DPRINT1("WARNING: System not initialized after 120 seconds.\n");
725 } else if (Status
== STATUS_WAIT_0
+ 1) {
727 /* Crash the system if the initial process was terminated. */
728 KEBUGCHECKEX(SESSION5_INITIALIZATION_FAILED
, Status
, 0, 0, 0);
731 /* Disable the Boot Logo */
732 if (!NoGuiBoot
) InbvEnableBootDriver(FALSE
);
734 /* Signal the Event and close the handle */
735 ZwSetEvent(InitDoneEventHandle
, NULL
);
736 ZwClose(InitDoneEventHandle
);
740 /* On failure to create 'ReactOSInitDone' event, go to text mode ASAP */
741 if (!NoGuiBoot
) InbvEnableBootDriver(FALSE
);
743 /* Crash the system if the initial process terminates within 5 seconds. */
744 Timeout
.QuadPart
= (LONGLONG
)-50000000; /* 5 second timeout */
745 Status
= ZwWaitForSingleObject(ProcessHandle
,
749 /* Check for timeout, crash if the initial process didn't initalize */
750 if (Status
!= STATUS_TIMEOUT
) KEBUGCHECKEX(SESSION5_INITIALIZATION_FAILED
, Status
, 1, 0, 0);
753 /* Enable the Clock, close remaining handles */
754 KiTimerSystemAuditing
= 1;
755 ZwClose(ThreadHandle
);
756 ZwClose(ProcessHandle
);
764 ExpInitializeEventImplementation();
765 ExpInitializeEventPairImplementation();
766 ExpInitializeMutantImplementation();
767 ExpInitializeSemaphoreImplementation();
768 ExpInitializeTimerImplementation();
770 ExpInitializeProfileImplementation();
773 ExpInitializeHandleTables();