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 #define BUILD_OSCSDVERSION(major, minor) (((major & 0xFF) << 8) | (minor & 0xFF))
21 ULONG NtMajorVersion
= 5;
22 ULONG NtMinorVersion
= 0;
23 ULONG NtOSCSDVersion
= BUILD_OSCSDVERSION(4, 0);
24 ULONG NtBuildNumber
= KERNEL_VERSION_BUILD
;
25 ULONG NtGlobalFlag
= 0;
27 ULONG InitSafeBootMode
= 0; /* KB83764 */
29 extern ULONG MmCoreDumpType
;
30 extern CHAR KiTimerSystemAuditing
;
31 extern PVOID Ki386InitialStackArray
[MAXIMUM_PROCESSORS
];
32 extern ADDRESS_RANGE KeMemoryMap
[64];
33 extern ULONG KeMemoryMapRangeCount
;
34 extern ULONG_PTR FirstKrnlPhysAddr
;
35 extern ULONG_PTR LastKrnlPhysAddr
;
36 extern ULONG_PTR LastKernelAddress
;
37 extern LOADER_MODULE KeLoaderModules
[64];
38 extern PRTL_MESSAGE_RESOURCE_DATA KiBugCodeMessages
;
39 BOOLEAN SetupMode
= TRUE
;
40 BOOLEAN NoGuiBoot
= FALSE
;
42 VOID
PspPostInitSystemProcess(VOID
);
44 static VOID INIT_FUNCTION
InitSystemSharedUserPage (PCSZ ParameterLine
);
45 VOID INIT_FUNCTION
ExpDisplayNotice(VOID
);
46 INIT_FUNCTION NTSTATUS
ExpLoadInitialProcess(PHANDLE ProcessHandle
, PHANDLE ThreadHandle
);
48 #if defined (ALLOC_PRAGMA)
49 #pragma alloc_text(INIT, InitSystemSharedUserPage)
50 #pragma alloc_text(INIT, ExpDisplayNotice)
51 #pragma alloc_text(INIT, ExpLoadInitialProcess)
52 #pragma alloc_text(INIT, ExpInitializeExecutive)
53 #pragma alloc_text(INIT, ExInit2)
56 /* FUNCTIONS ****************************************************************/
61 InitSystemSharedUserPage (PCSZ ParameterLine
)
63 UNICODE_STRING ArcDeviceName
;
64 UNICODE_STRING ArcName
;
65 UNICODE_STRING BootPath
;
66 UNICODE_STRING DriveDeviceName
;
67 UNICODE_STRING DriveName
;
68 WCHAR DriveNameBuffer
[20];
74 OBJECT_ATTRIBUTES ObjectAttributes
;
77 BOOLEAN BootDriveFound
= FALSE
;
81 * The shared user page has been zeroed-out right after creation.
82 * There is NO need to do this again.
84 Ki386SetProcessorFeatures();
86 /* Set the Version Data */
87 SharedUserData
->NtProductType
= NtProductWinNt
;
88 SharedUserData
->ProductTypeIsValid
= TRUE
;
89 SharedUserData
->NtMajorVersion
= 5;
90 SharedUserData
->NtMinorVersion
= 0;
93 * Retrieve the current dos system path
94 * (e.g.: C:\reactos) from the given arc path
95 * (e.g.: multi(0)disk(0)rdisk(0)partititon(1)\reactos)
96 * Format: "<arc_name>\<path> [options...]"
99 /* Create local parameter line copy */
100 ParamBuffer
= ExAllocatePool(PagedPool
, 256);
101 strcpy (ParamBuffer
, (const char *)ParameterLine
);
102 DPRINT("%s\n", ParamBuffer
);
104 /* Cut options off */
105 p
= strchr (ParamBuffer
, ' ');
107 DPRINT("%s\n", ParamBuffer
);
110 p
= strchr (ParamBuffer
, '\\');
113 DPRINT("Boot path: %s\n", p
);
114 RtlCreateUnicodeStringFromAsciiz (&BootPath
, p
);
119 DPRINT("Boot path: %s\n", "\\");
120 RtlCreateUnicodeStringFromAsciiz (&BootPath
, "\\");
122 DPRINT("Arc name: %s\n", ParamBuffer
);
124 /* Only ARC Name left - Build full ARC Name */
125 ArcNameBuffer
= ExAllocatePool (PagedPool
, 256 * sizeof(WCHAR
));
126 swprintf (ArcNameBuffer
, L
"\\ArcName\\%S", ParamBuffer
);
127 RtlInitUnicodeString (&ArcName
, ArcNameBuffer
);
128 DPRINT("Arc name: %wZ\n", &ArcName
);
130 /* Free ParamBuffer */
131 ExFreePool (ParamBuffer
);
133 /* Allocate ARC Device Name string */
134 ArcDeviceName
.Length
= 0;
135 ArcDeviceName
.MaximumLength
= 256 * sizeof(WCHAR
);
136 ArcDeviceName
.Buffer
= ExAllocatePool (PagedPool
, 256 * sizeof(WCHAR
));
138 /* Open the Symbolic Link */
139 InitializeObjectAttributes(&ObjectAttributes
,
144 Status
= NtOpenSymbolicLinkObject(&Handle
,
145 SYMBOLIC_LINK_ALL_ACCESS
,
148 /* Free the String */
149 ExFreePool(ArcName
.Buffer
);
151 /* Check for Success */
152 if (!NT_SUCCESS(Status
)) {
154 /* Free the Strings */
155 RtlFreeUnicodeString(&BootPath
);
156 ExFreePool(ArcDeviceName
.Buffer
);
157 CPRINT("NtOpenSymbolicLinkObject() failed (Status %x)\n", Status
);
162 Status
= NtQuerySymbolicLinkObject(Handle
,
167 /* Check for Success */
168 if (!NT_SUCCESS(Status
)) {
170 /* Free the Strings */
171 RtlFreeUnicodeString(&BootPath
);
172 ExFreePool(ArcDeviceName
.Buffer
);
173 CPRINT("NtQuerySymbolicLinkObject() failed (Status %x)\n", Status
);
176 DPRINT("Length: %lu ArcDeviceName: %wZ\n", Length
, &ArcDeviceName
);
178 /* Allocate Device Name string */
179 DriveDeviceName
.Length
= 0;
180 DriveDeviceName
.MaximumLength
= 256 * sizeof(WCHAR
);
181 DriveDeviceName
.Buffer
= ExAllocatePool (PagedPool
, 256 * sizeof(WCHAR
));
184 for (i
= 0; i
< 26; i
++) {
186 /* Setup the String */
187 swprintf (DriveNameBuffer
, L
"\\??\\%C:", 'A' + i
);
188 RtlInitUnicodeString(&DriveName
,
191 /* Open the Symbolic Link */
192 InitializeObjectAttributes(&ObjectAttributes
,
197 Status
= NtOpenSymbolicLinkObject(&Handle
,
198 SYMBOLIC_LINK_ALL_ACCESS
,
201 /* If it failed, skip to the next drive */
202 if (!NT_SUCCESS(Status
)) {
203 DPRINT("Failed to open link %wZ\n", &DriveName
);
208 Status
= NtQuerySymbolicLinkObject(Handle
,
212 /* If it failed, skip to the next drive */
213 if (!NT_SUCCESS(Status
)) {
214 DPRINT("Failed to query link %wZ\n", &DriveName
);
217 DPRINT("Opened link: %wZ ==> %wZ\n", &DriveName
, &DriveDeviceName
);
219 /* See if we've found the boot drive */
220 if (!RtlCompareUnicodeString (&ArcDeviceName
, &DriveDeviceName
, FALSE
)) {
222 DPRINT("DOS Boot path: %c:%wZ\n", 'A' + i
, &BootPath
);
223 swprintf(SharedUserData
->NtSystemRoot
, L
"%C:%wZ", 'A' + i
, &BootPath
);
224 BootDriveFound
= TRUE
;
227 /* Close this Link */
231 /* Free all the Strings we have in memory */
232 RtlFreeUnicodeString (&BootPath
);
233 ExFreePool(DriveDeviceName
.Buffer
);
234 ExFreePool(ArcDeviceName
.Buffer
);
236 /* Make sure we found the Boot Drive */
237 if (BootDriveFound
== FALSE
) {
239 DbgPrint("No system drive found!\n");
240 KEBUGCHECK (NO_BOOT_DEVICE
);
247 ExecuteRuntimeAsserts(VOID
)
250 * Fail at runtime if someone has changed various structures without
251 * updating the offsets used for the assembler code.
253 ASSERT(FIELD_OFFSET(KUSER_SHARED_DATA
, SystemCall
) == 0x300);
254 ASSERT(FIELD_OFFSET(KTHREAD
, InitialStack
) == KTHREAD_INITIAL_STACK
);
255 ASSERT(FIELD_OFFSET(KTHREAD
, Teb
) == KTHREAD_TEB
);
256 ASSERT(FIELD_OFFSET(KTHREAD
, KernelStack
) == KTHREAD_KERNEL_STACK
);
257 ASSERT(FIELD_OFFSET(KTHREAD
, NpxState
) == KTHREAD_NPX_STATE
);
258 ASSERT(FIELD_OFFSET(KTHREAD
, ServiceTable
) == KTHREAD_SERVICE_TABLE
);
259 ASSERT(FIELD_OFFSET(KTHREAD
, PreviousMode
) == KTHREAD_PREVIOUS_MODE
);
260 ASSERT(FIELD_OFFSET(KTHREAD
, TrapFrame
) == KTHREAD_TRAP_FRAME
);
261 ASSERT(FIELD_OFFSET(KTHREAD
, CallbackStack
) == KTHREAD_CALLBACK_STACK
);
262 ASSERT(FIELD_OFFSET(KTHREAD
, ApcState
.Process
) == KTHREAD_APCSTATE_PROCESS
);
263 ASSERT(FIELD_OFFSET(KPROCESS
, DirectoryTableBase
) == KPROCESS_DIRECTORY_TABLE_BASE
);
264 ASSERT(FIELD_OFFSET(KPROCESS
, IopmOffset
) == KPROCESS_IOPM_OFFSET
);
265 ASSERT(FIELD_OFFSET(KPROCESS
, LdtDescriptor
) == KPROCESS_LDT_DESCRIPTOR0
);
266 ASSERT(FIELD_OFFSET(KV86M_TRAP_FRAME
, SavedExceptionStack
) == TF_SAVED_EXCEPTION_STACK
);
267 ASSERT(FIELD_OFFSET(KV86M_TRAP_FRAME
, regs
) == TF_REGS
);
268 ASSERT(FIELD_OFFSET(KV86M_TRAP_FRAME
, orig_ebp
) == TF_ORIG_EBP
);
269 ASSERT(FIELD_OFFSET(KPCR
, Tib
.ExceptionList
) == KPCR_EXCEPTION_LIST
);
270 ASSERT(FIELD_OFFSET(KPCR
, Self
) == KPCR_SELF
);
271 ASSERT(FIELD_OFFSET(KPCR
, IRR
) == KPCR_IRR
);
272 ASSERT(KeGetPcr()->IRR
== 0);
273 ASSERT(FIELD_OFFSET(KPCR
, IDR
) == KPCR_IDR
);
274 ASSERT(FIELD_OFFSET(KPCR
, Irql
) == KPCR_IRQL
);
275 ASSERT(FIELD_OFFSET(KIPCR
, PrcbData
) + FIELD_OFFSET(KPRCB
, CurrentThread
) == KPCR_CURRENT_THREAD
);
276 ASSERT(FIELD_OFFSET(KIPCR
, PrcbData
) + FIELD_OFFSET(KPRCB
, NpxThread
) == KPCR_NPX_THREAD
);
277 ASSERT(FIELD_OFFSET(KTSS
, Esp0
) == KTSS_ESP0
);
278 ASSERT(FIELD_OFFSET(KTSS
, IoMapBase
) == KTSS_IOMAPBASE
);
279 ASSERT(sizeof(FX_SAVE_AREA
) == SIZEOF_FX_SAVE_AREA
);
285 ParseAndCacheLoadedModules(VOID
)
290 /* Loop the Module List and get the modules we want */
291 for (i
= 1; i
< KeLoaderBlock
.ModsCount
; i
++) {
293 /* Get the Name of this Module */
294 if (!(Name
= strrchr((PCHAR
)KeLoaderModules
[i
].String
, '\\'))) {
297 Name
= (PCHAR
)KeLoaderModules
[i
].String
;
305 /* Now check for any of the modules we will need later */
306 if (!_stricmp(Name
, "ansi.nls")) {
308 CachedModules
[AnsiCodepage
] = &KeLoaderModules
[i
];
310 } else if (!_stricmp(Name
, "oem.nls")) {
312 CachedModules
[OemCodepage
] = &KeLoaderModules
[i
];
314 } else if (!_stricmp(Name
, "casemap.nls")) {
316 CachedModules
[UnicodeCasemap
] = &KeLoaderModules
[i
];
318 } else if (!_stricmp(Name
, "system") || !_stricmp(Name
, "system.hiv")) {
320 CachedModules
[SystemRegistry
] = &KeLoaderModules
[i
];
323 } else if (!_stricmp(Name
, "hardware") || !_stricmp(Name
, "hardware.hiv")) {
325 CachedModules
[HardwareRegistry
] = &KeLoaderModules
[i
];
333 ParseCommandLine(PULONG MaxMem
,
336 PBOOLEAN ForceAcpiDisable
)
340 p1
= (PCHAR
)KeLoaderBlock
.CommandLine
;
341 while(*p1
&& (p2
= strchr(p1
, '/'))) {
344 if (!_strnicmp(p2
, "MAXMEM", 6)) {
347 while (isspace(*p2
)) p2
++;
353 while(isspace(*p2
)) p2
++;
356 while (isdigit(*p2
)) {
357 *MaxMem
= *MaxMem
* 10 + *p2
- '0';
363 } else if (!_strnicmp(p2
, "NOGUIBOOT", 9)) {
368 } else if (!_strnicmp(p2
, "CRASHDUMP", 9)) {
374 if (!_strnicmp(p2
, "FULL", 4)) {
376 MmCoreDumpType
= MM_CORE_DUMP_TYPE_FULL
;
380 MmCoreDumpType
= MM_CORE_DUMP_TYPE_NONE
;
383 } else if (!_strnicmp(p2
, "BOOTLOG", 7)) {
387 } else if (!_strnicmp(p2
, "NOACPI", 6)) {
390 *ForceAcpiDisable
= TRUE
;
399 ExpDisplayNotice(VOID
)
406 "\n\n\n ReactOS " KERNEL_VERSION_STR
" Setup \n");
408 " \xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD");
414 HalDisplayString("Starting ReactOS "KERNEL_VERSION_STR
" (Build "
415 KERNEL_VERSION_BUILD_STR
")\n");
416 HalDisplayString(RES_STR_LEGAL_COPYRIGHT
);
417 HalDisplayString("\n\nReactOS is free software, covered by the GNU General "
418 "Public License, and you\n");
419 HalDisplayString("are welcome to change it and/or distribute copies of it "
421 HalDisplayString("conditions. There is absolutely no warranty for "
424 /* Display number of Processors */
426 "Found %x system processor(s). [%lu MB Memory]\n",
427 (int)KeNumberProcessors
,
428 (KeLoaderBlock
.MemHigher
+ 1088)/ 1024);
429 HalDisplayString(str
);
435 ExpLoadInitialProcess(PHANDLE ProcessHandle
,
436 PHANDLE ThreadHandle
)
438 UNICODE_STRING CurrentDirectory
;
439 UNICODE_STRING ImagePath
= RTL_CONSTANT_STRING(L
"\\SystemRoot\\system32\\smss.exe");
441 PRTL_USER_PROCESS_PARAMETERS Params
=NULL
;
442 RTL_USER_PROCESS_INFORMATION Info
;
444 RtlInitUnicodeString(&CurrentDirectory
,
445 SharedUserData
->NtSystemRoot
);
447 /* Create the Parameters */
448 Status
= RtlCreateProcessParameters(&Params
,
458 if(!NT_SUCCESS(Status
))
460 DPRINT1("Failed to create ppb!\n");
464 DPRINT("Creating process\n");
465 Status
= RtlCreateUserProcess(&ImagePath
,
466 OBJ_CASE_INSENSITIVE
,
476 /* Close the handle and free the params */
477 RtlDestroyProcessParameters(Params
);
479 if (!NT_SUCCESS(Status
))
481 DPRINT1("NtCreateProcess() failed (Status %lx)\n", Status
);
486 ZwResumeThread(Info
.ThreadHandle
, NULL
);
489 *ProcessHandle
= Info
.ProcessHandle
;
490 *ThreadHandle
= Info
.ThreadHandle
;
491 DPRINT("Process created successfully\n");
492 return STATUS_SUCCESS
;
498 ExpInitializeExecutive(VOID
)
500 UNICODE_STRING EventName
;
501 HANDLE InitDoneEventHandle
;
502 OBJECT_ATTRIBUTES ObjectAttributes
;
503 BOOLEAN BootLog
= FALSE
;
505 BOOLEAN ForceAcpiDisable
= FALSE
;
506 LARGE_INTEGER Timeout
;
507 HANDLE ProcessHandle
;
511 /* Check if the structures match the ASM offset constants */
512 ExecuteRuntimeAsserts();
515 HalInitSystem (0, (PLOADER_PARAMETER_BLOCK
)&KeLoaderBlock
);
517 /* Sets up the Text Sections of the Kernel and HAL for debugging */
520 /* Setup bugcheck messages */
521 KiInitializeBugCheck();
523 /* Lower the IRQL to Dispatch Level */
524 KeLowerIrql(DISPATCH_LEVEL
);
526 /* Sets up the VDM Data */
529 /* Parse Command Line Settings */
530 ParseCommandLine(&MaxMem
, &NoGuiBoot
, &BootLog
, &ForceAcpiDisable
);
532 /* Initialize Kernel Memory Address Space */
533 MmInit1(FirstKrnlPhysAddr
,
536 (PADDRESS_RANGE
)&KeMemoryMap
,
537 KeMemoryMapRangeCount
,
538 MaxMem
> 8 ? MaxMem
: 4096);
540 /* Parse the Loaded Modules (by FreeLoader) and cache the ones we'll need */
541 ParseAndCacheLoadedModules();
543 /* Setup system time */
544 KiInitializeSystemClock();
546 /* Initialize the second stage of the kernel */
549 /* Bring back the IRQL to Passive */
550 KeLowerIrql(PASSIVE_LEVEL
);
552 /* Initialize resources */
553 ExpResourceInitialization();
555 /* Load basic Security for other Managers */
556 if (!SeInit1()) KEBUGCHECK(SECURITY_INITIALIZATION_FAILED
);
558 /* Initialize Lookaside Lists */
559 ExpInitLookasideLists();
561 /* Create the Basic Object Manager Types to allow new Object Types */
564 /* Set up Region Maps, Sections and the Paging File */
567 /* Initialize Tokens now that the Object Manager is ready */
568 if (!SeInit2()) KEBUGCHECK(SECURITY1_INITIALIZATION_FAILED
);
570 /* Initalize the Process Manager */
571 PiInitProcessManager();
573 /* Break into the Debugger if requested */
574 if (KdPollBreakIn()) DbgBreakPointWithStatus (DBG_STATUS_CONTROL_C
);
576 /* Initialize all processors */
577 HalAllProcessorsStarted();
579 /* Do Phase 1 HAL Initalization */
580 HalInitSystem(1, (PLOADER_PARAMETER_BLOCK
)&KeLoaderBlock
);
582 /* Initialize Basic System Objects and Worker Threads */
585 /* Create the system handle table, assign it to the system process, create
586 the client id table and assign a PID for the system process. This needs
587 to be done before the worker threads are initialized so the system
588 process gets the first PID (4) */
589 PspPostInitSystemProcess();
591 /* initialize the worker threads */
592 ExpInitializeWorkerThreads();
594 /* initialize callbacks */
595 ExpInitializeCallbacks();
597 /* Call KD Providers at Phase 1 */
598 KdInitSystem(1, (PROS_LOADER_PARAMETER_BLOCK
)&KeLoaderBlock
);
600 /* Initialize I/O Objects, Filesystems, Error Logging and Shutdown */
604 PoInit((PROS_LOADER_PARAMETER_BLOCK
)&KeLoaderBlock
, ForceAcpiDisable
);
606 /* Initialize the Registry (Hives are NOT yet loaded!) */
607 CmInitializeRegistry();
609 /* Unmap Low memory, initialize the Page Zeroing and the Balancer Thread */
612 /* Initialize Cache Views */
615 /* Initialize File Locking */
616 FsRtlpInitFileLockingImplementation();
618 /* Report all resources used by hal */
619 HalReportResourceUsage();
621 /* Clear the screen to blue */
622 HalInitSystem(2, (PLOADER_PARAMETER_BLOCK
)&KeLoaderBlock
);
624 /* Display version number and copyright/warranty message */
625 if (NoGuiBoot
) ExpDisplayNotice();
627 /* Call KD Providers at Phase 2 */
628 KdInitSystem(2, (PROS_LOADER_PARAMETER_BLOCK
)&KeLoaderBlock
);
630 /* Import and create NLS Data and Sections */
633 /* Import and Load Registry Hives */
634 CmInitHives(SetupMode
);
636 /* Initialize VDM support */
637 KeI386VdmInitialize();
639 /* Initialize the time zone information from the registry */
640 ExpInitTimeZoneInfo();
642 /* Enter the kernel debugger before starting up the boot drivers */
643 if (KdDebuggerEnabled
&& KdpEarlyBreak
)
646 /* Setup Drivers and Root Device Node */
649 /* Display the boot screen image if not disabled */
650 if (!NoGuiBoot
) InbvEnableBootDriver(TRUE
);
652 /* Create ARC Names, SystemRoot SymLink, Load Drivers and Assign Letters */
655 /* Load the System DLL and its Entrypoints */
658 /* Initialize shared user page. Set dos system path, dos device map, etc. */
659 InitSystemSharedUserPage ((PCHAR
)KeLoaderBlock
.CommandLine
);
661 /* Create 'ReactOSInitDone' event */
662 RtlInitUnicodeString(&EventName
, L
"\\ReactOSInitDone");
663 InitializeObjectAttributes(&ObjectAttributes
,
668 Status
= ZwCreateEvent(&InitDoneEventHandle
,
671 SynchronizationEvent
,
674 /* Check for Success */
675 if (!NT_SUCCESS(Status
)) {
677 DPRINT1("Failed to create 'ReactOSInitDone' event (Status 0x%x)\n", Status
);
678 InitDoneEventHandle
= INVALID_HANDLE_VALUE
;
681 /* Launch initial process */
682 Status
= ExpLoadInitialProcess(&ProcessHandle
,
685 /* Check for success, Bugcheck if we failed */
686 if (!NT_SUCCESS(Status
)) {
688 KEBUGCHECKEX(SESSION4_INITIALIZATION_FAILED
, Status
, 0, 0, 0);
691 /* Wait on the Completion Event */
692 if (InitDoneEventHandle
!= INVALID_HANDLE_VALUE
) {
694 HANDLE Handles
[2]; /* Init event, Initial process */
696 /* Setup the Handles to wait on */
697 Handles
[0] = InitDoneEventHandle
;
698 Handles
[1] = ProcessHandle
;
700 /* Wait for the system to be initialized */
701 Timeout
.QuadPart
= (LONGLONG
)-1200000000; /* 120 second timeout */
702 Status
= ZwWaitForMultipleObjects(2,
707 if (!NT_SUCCESS(Status
)) {
709 DPRINT1("NtWaitForMultipleObjects failed with status 0x%x!\n", Status
);
711 } else if (Status
== STATUS_TIMEOUT
) {
713 DPRINT1("WARNING: System not initialized after 120 seconds.\n");
715 } else if (Status
== STATUS_WAIT_0
+ 1) {
717 /* Crash the system if the initial process was terminated. */
718 KEBUGCHECKEX(SESSION5_INITIALIZATION_FAILED
, Status
, 0, 0, 0);
723 * Disable the Boot Logo
725 if (!NoGuiBoot
) InbvEnableBootDriver(FALSE
);
727 /* Signal the Event and close the handle */
728 ZwSetEvent(InitDoneEventHandle
, NULL
);
729 ZwClose(InitDoneEventHandle
);
733 /* On failure to create 'ReactOSInitDone' event, go to text mode ASAP */
734 if (!NoGuiBoot
) InbvEnableBootDriver(FALSE
);
736 /* Crash the system if the initial process terminates within 5 seconds. */
737 Timeout
.QuadPart
= (LONGLONG
)-50000000; /* 5 second timeout */
738 Status
= ZwWaitForSingleObject(ProcessHandle
,
742 /* Check for timeout, crash if the initial process didn't initalize */
743 if (Status
!= STATUS_TIMEOUT
) KEBUGCHECKEX(SESSION5_INITIALIZATION_FAILED
, Status
, 1, 0, 0);
746 /* Enable the Clock, close remaining handles */
747 KiTimerSystemAuditing
= 1;
748 ZwClose(ThreadHandle
);
749 ZwClose(ProcessHandle
);
757 ExpInitializeEventImplementation();
758 ExpInitializeEventPairImplementation();
759 ExpInitializeMutantImplementation();
760 ExpInitializeSemaphoreImplementation();
761 ExpInitializeTimerImplementation();
763 ExpInitializeProfileImplementation();
766 ExpInitializeHandleTables();