ReactOS 0.4.17-dev-37-g0bfb40d
init.c
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS Kernel
3 * LICENSE: GPL - See COPYING in the top level directory
4 * FILE: ntoskrnl/ex/init.c
5 * PURPOSE: Executive Initialization Code
6 * PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org)
7 * Eric Kohl
8 */
9
10/* INCLUDES ******************************************************************/
11
12#include <ntoskrnl.h>
13#include <reactos/buildno.h>
14#include "inbv/logo.h"
15
16#define NDEBUG
17#include <debug.h>
18
19/* This is the size that we can expect from the win 2003 loader */
20#define LOADER_PARAMETER_EXTENSION_MIN_SIZE \
21 RTL_SIZEOF_THROUGH_FIELD(LOADER_PARAMETER_EXTENSION, AcpiTableSize)
22
23/* Temporary hack */
24CODE_SEG("INIT")
28 IN ULONG Phase,
29 IN PLOADER_PARAMETER_BLOCK LoaderBlock
30);
31
33{
34 WCHAR DebugBuffer[256];
35 CHAR VersionBuffer[256];
36 CHAR BootlogHeader[256];
37 CHAR VersionNumber[24];
39 WCHAR RegistryBuffer[256];
41
42/* DATA **********************************************************************/
43
44/* NT Version Info */
47#if DBG /* Checked Build */
49#else /* Free Build */
51#endif
52
53/* NT System Info */
56
57/* Cm Version Info */
63
64CHAR NtBuildLab[] = KERNEL_VERSION_BUILD_STR "."
65 REACTOS_COMPILER_NAME "_" REACTOS_COMPILER_VERSION;
66
67/* Init flags and settings */
73BOOLEAN SosEnabled; // Used by driver.c!IopDisplayLoadingMessage()
74
75/* NT Boot Path */
77
78/* NT Initial User Application */
79WCHAR NtInitialUserProcessBuffer[128] = L"\\SystemRoot\\System32\\smss.exe";
81 sizeof(WCHAR);
83
84/* Boot NLS information */
91
92/* CMOS Timer Sanity */
95
96/* FUNCTIONS ****************************************************************/
97
98CODE_SEG("INIT")
100NTAPI
102{
103 UNICODE_STRING LinkName;
105 HANDLE LinkHandle;
107 ANSI_STRING AnsiName;
108 CHAR Buffer[256];
111
112 /* Initialize the ArcName tree */
113 RtlInitUnicodeString(&LinkName, L"\\ArcName");
115 &LinkName,
117 NULL,
119
120 /* Create it */
121 Status = NtCreateDirectoryObject(&LinkHandle,
124 if (!NT_SUCCESS(Status))
125 {
126 /* Failed */
127 KeBugCheckEx(SYMBOLIC_INITIALIZATION_FAILED, Status, 1, 0, 0);
128 }
129
130 /* Close the LinkHandle */
131 NtClose(LinkHandle);
132
133 /* Initialize the Device tree */
134 RtlInitUnicodeString(&LinkName, L"\\Device");
136 &LinkName,
138 NULL,
140
141 /* Create it */
142 Status = NtCreateDirectoryObject(&LinkHandle,
145 if (!NT_SUCCESS(Status))
146 {
147 /* Failed */
148 KeBugCheckEx(SYMBOLIC_INITIALIZATION_FAILED, Status, 2, 0, 0);
149 }
150
151 /* Close the LinkHandle */
152 ObCloseHandle(LinkHandle, KernelMode);
153
154 /* Create the system root symlink name */
155 RtlInitAnsiString(&AnsiName, "\\SystemRoot");
156 Status = RtlAnsiStringToUnicodeString(&LinkName, &AnsiName, TRUE);
157 if (!NT_SUCCESS(Status))
158 {
159 /* Failed */
160 KeBugCheckEx(SYMBOLIC_INITIALIZATION_FAILED, Status, 3, 0, 0);
161 }
162
163 /* Initialize the attributes for the link */
165 &LinkName,
167 NULL,
169
170 /* Build the ARC name */
172 "\\ArcName\\%s%s",
173 LoaderBlock->ArcBootDeviceName,
174 LoaderBlock->NtBootPathName);
176
177 /* Convert it to Unicode */
181 TRUE);
182 if (!NT_SUCCESS(Status))
183 {
184 /* We failed, bugcheck */
185 KeBugCheckEx(SYMBOLIC_INITIALIZATION_FAILED, Status, 4, 0, 0);
186 }
187
188 /* Create it */
192 &TargetName);
193
194 /* Free the strings */
195 RtlFreeUnicodeString(&LinkName);
197
198 /* Check if creating the link failed */
199 if (!NT_SUCCESS(Status))
200 {
201 /* Failed */
202 KeBugCheckEx(SYMBOLIC_INITIALIZATION_FAILED, Status, 5, 0, 0);
203 }
204
205 /* Close the handle and return success */
206 ObCloseHandle(LinkHandle, KernelMode);
207 return STATUS_SUCCESS;
208}
209
210CODE_SEG("INIT")
211VOID
212NTAPI
214{
215 LARGE_INTEGER SectionSize;
217 HANDLE NlsSection;
218 PVOID SectionBase = NULL;
219 SIZE_T ViewSize = 0;
220 LARGE_INTEGER SectionOffset = {{0, 0}};
221 PLIST_ENTRY ListHead, NextEntry;
223 ULONG NlsTablesEncountered = 0;
224 SIZE_T NlsTableSizes[3] = {0, 0, 0}; /* 3 NLS tables */
225
226 /* Check if this is boot-time phase 0 initialization */
228 {
229 /* Loop the memory descriptors */
230 ListHead = &LoaderBlock->MemoryDescriptorListHead;
231 NextEntry = ListHead->Flink;
232 while (NextEntry != ListHead)
233 {
234 /* Get the current block */
235 MdBlock = CONTAINING_RECORD(NextEntry,
237 ListEntry);
238
239 /* Check if this is an NLS block */
240 if (MdBlock->MemoryType == LoaderNlsData)
241 {
242 /* Increase the table size */
243 ExpNlsTableSize += MdBlock->PageCount * PAGE_SIZE;
244
245 /* FreeLdr-specific */
246 NlsTableSizes[NlsTablesEncountered] = MdBlock->PageCount * PAGE_SIZE;
247 NlsTablesEncountered++;
248 ASSERT(NlsTablesEncountered < 4);
249 }
250
251 /* Go to the next block */
252 NextEntry = MdBlock->ListEntry.Flink;
253 }
254
255 /* Allocate the a new buffer since loader memory will be freed */
258 TAG_RTLI);
259 if (!ExpNlsTableBase) KeBugCheck(PHASE0_INITIALIZATION_FAILED);
260
261 /* Copy the codepage data in its new location. */
262 if (NlsTablesEncountered == 1)
263 {
264 /* Ntldr-way boot process */
266 LoaderBlock->NlsData->AnsiCodePageData,
268 }
269 else
270 {
271 /*
272 * In NT, the memory blocks are contiguous, but in ReactOS they aren't,
273 * so unless someone fixes FreeLdr, we'll have to use this icky hack.
274 */
276 LoaderBlock->NlsData->AnsiCodePageData,
277 NlsTableSizes[0]);
278
279 RtlCopyMemory((PVOID)((ULONG_PTR)ExpNlsTableBase + NlsTableSizes[0]),
280 LoaderBlock->NlsData->OemCodePageData,
281 NlsTableSizes[1]);
282
283 RtlCopyMemory((PVOID)((ULONG_PTR)ExpNlsTableBase + NlsTableSizes[0] +
284 NlsTableSizes[1]),
285 LoaderBlock->NlsData->UnicodeCodePageData,
286 NlsTableSizes[2]);
287 /* End of Hack */
288 }
289
290 /* Initialize and reset the NLS TAbles */
299 return;
300 }
301
302 /* Set the section size */
303 SectionSize.QuadPart = ExpNlsTableSize;
304
305 /* Create the NLS Section */
306 Status = ZwCreateSection(&NlsSection,
308 NULL,
309 &SectionSize,
311 SEC_COMMIT | 0x1,
312 NULL);
313 if (!NT_SUCCESS(Status))
314 {
315 /* Failed */
316 KeBugCheckEx(PHASE1_INITIALIZATION_FAILED, Status, 1, 0, 0);
317 }
318
319 /* Get a pointer to the section */
325 NULL);
326 ObCloseHandle(NlsSection, KernelMode);
327 if (!NT_SUCCESS(Status))
328 {
329 /* Failed */
330 KeBugCheckEx(PHASE1_INITIALIZATION_FAILED, Status, 2, 0, 0);
331 }
332
333 /* Map the NLS Section in system space */
335 &SectionBase,
337 if (!NT_SUCCESS(Status))
338 {
339 /* Failed */
340 KeBugCheckEx(PHASE1_INITIALIZATION_FAILED, Status, 3, 0, 0);
341 }
342
343 /* Copy the codepage data in its new location. */
344 ASSERT(SectionBase >= MmSystemRangeStart);
346
347 /* Free the previously allocated buffer and set the new location */
349 ExpNlsTableBase = SectionBase;
350
351 /* Initialize the NLS Tables */
360
361 /* Reset the base to 0 */
362 SectionBase = NULL;
363
364 /* Map the section in the system process */
367 &SectionBase,
368 0L,
369 0L,
371 &ViewSize,
372 ViewShare,
373 0L,
375 if (!NT_SUCCESS(Status))
376 {
377 /* Failed */
378 KeBugCheckEx(PHASE1_INITIALIZATION_FAILED, Status, 5, 0, 0);
379 }
380
381 /* Copy the table into the system process and set this as the base */
383 ExpNlsTableBase = SectionBase;
384}
385
386CODE_SEG("INIT")
387VOID
388NTAPI
390 OUT PRTL_USER_PROCESS_PARAMETERS *ProcessParameters,
391 OUT PCHAR *ProcessEnvironment)
392{
394 SIZE_T Size;
395 PWSTR p;
396 UNICODE_STRING NullString = RTL_CONSTANT_STRING(L"");
397 UNICODE_STRING SmssName, Environment, SystemDriveString, DebugString;
398 PVOID EnvironmentPtr = NULL;
399 PRTL_USER_PROCESS_INFORMATION ProcessInformation;
400 PRTL_USER_PROCESS_PARAMETERS ProcessParams = NULL;
401
402 NullString.Length = sizeof(WCHAR);
403
404 /* Use the initial buffer, after the strings */
405 ProcessInformation = &InitBuffer->ProcessInfo;
406
407 /* Allocate memory for the process parameters */
408 Size = sizeof(*ProcessParams) + ((MAX_WIN32_PATH * 6) * sizeof(WCHAR));
409 Status = ZwAllocateVirtualMemory(NtCurrentProcess(),
410 (PVOID*)&ProcessParams,
411 0,
412 &Size,
415 if (!NT_SUCCESS(Status))
416 {
417 /* Failed, display error */
418 _snwprintf(InitBuffer->DebugBuffer,
419 sizeof(InitBuffer->DebugBuffer)/sizeof(WCHAR),
420 L"INIT: Unable to allocate Process Parameters. 0x%lx",
421 Status);
422 RtlInitUnicodeString(&DebugString, InitBuffer->DebugBuffer);
424
425 /* Bugcheck the system */
426 KeBugCheckEx(SESSION1_INITIALIZATION_FAILED, Status, 0, 0, 0);
427 }
428
429 /* Setup the basic header, and give the process the low 1MB to itself */
430 ProcessParams->Length = (ULONG)Size;
431 ProcessParams->MaximumLength = (ULONG)Size;
434
435 /* Allocate a page for the environment */
436 Size = PAGE_SIZE;
437 Status = ZwAllocateVirtualMemory(NtCurrentProcess(),
438 &EnvironmentPtr,
439 0,
440 &Size,
443 if (!NT_SUCCESS(Status))
444 {
445 /* Failed, display error */
446 _snwprintf(InitBuffer->DebugBuffer,
447 sizeof(InitBuffer->DebugBuffer)/sizeof(WCHAR),
448 L"INIT: Unable to allocate Process Environment. 0x%lx",
449 Status);
450 RtlInitUnicodeString(&DebugString, InitBuffer->DebugBuffer);
452
453 /* Bugcheck the system */
454 KeBugCheckEx(SESSION2_INITIALIZATION_FAILED, Status, 0, 0, 0);
455 }
456
457 /* Write the pointer */
458 ProcessParams->Environment = EnvironmentPtr;
459
460 /* Make a buffer for the DOS path */
461 p = (PWSTR)(ProcessParams + 1);
462 ProcessParams->CurrentDirectory.DosPath.Buffer = p;
464 sizeof(WCHAR);
465
466 /* Copy the DOS path */
468 &NtSystemRoot);
469
470 /* Make a buffer for the DLL Path */
471 p = (PWSTR)((PCHAR)ProcessParams->CurrentDirectory.DosPath.Buffer +
472 ProcessParams->CurrentDirectory.DosPath.MaximumLength);
473 ProcessParams->DllPath.Buffer = p;
474 ProcessParams->DllPath.MaximumLength = MAX_WIN32_PATH * sizeof(WCHAR);
475
476 /* Copy the DLL path and append the system32 directory */
477 RtlCopyUnicodeString(&ProcessParams->DllPath,
478 &ProcessParams->CurrentDirectory.DosPath);
479 RtlAppendUnicodeToString(&ProcessParams->DllPath, L"\\System32");
480
481 /* Make a buffer for the image name */
482 p = (PWSTR)((PCHAR)ProcessParams->DllPath.Buffer +
483 ProcessParams->DllPath.MaximumLength);
484 ProcessParams->ImagePathName.Buffer = p;
485 ProcessParams->ImagePathName.MaximumLength = MAX_WIN32_PATH * sizeof(WCHAR);
486
487 /* Make sure the buffer is a valid string which within the given length */
492 sizeof(NtInitialUserProcessBuffer) - sizeof(WCHAR)))))
493 {
494 /* Invalid initial process string, bugcheck */
495 KeBugCheckEx(SESSION2_INITIALIZATION_FAILED,
500 }
501
502 /* Cut out anything after a space */
504 while ((*p) && (*p != L' ')) p++;
505
506 /* Set the image path length */
507 ProcessParams->ImagePathName.Length =
509
510 /* Copy the actual buffer */
511 RtlCopyMemory(ProcessParams->ImagePathName.Buffer,
513 ProcessParams->ImagePathName.Length);
514
515 /* Null-terminate it */
516 ProcessParams->ImagePathName.Buffer[ProcessParams->ImagePathName.Length /
517 sizeof(WCHAR)] = UNICODE_NULL;
518
519 /* Make a buffer for the command line */
520 p = (PWSTR)((PCHAR)ProcessParams->ImagePathName.Buffer +
521 ProcessParams->ImagePathName.MaximumLength);
522 ProcessParams->CommandLine.Buffer = p;
523 ProcessParams->CommandLine.MaximumLength = MAX_WIN32_PATH * sizeof(WCHAR);
524
525 /* Add the image name to the command line */
528
529 /* Create the environment string */
530 RtlInitEmptyUnicodeString(&Environment,
531 ProcessParams->Environment,
532 (USHORT)Size);
533
534 /* Append the DLL path to it */
538
539 /* Create the system drive string */
540 SystemDriveString = NtSystemRoot;
541 SystemDriveString.Length = 2 * sizeof(WCHAR);
542
543 /* Append it to the environment */
544 RtlAppendUnicodeToString(&Environment, L"SystemDrive=");
545 RtlAppendUnicodeStringToString(&Environment, &SystemDriveString);
547
548 /* Append the system root to the environment */
549 RtlAppendUnicodeToString(&Environment, L"SystemRoot=");
552
553 /* Prepare the prefetcher */
554 //CcPfBeginBootPhase(150);
555
556 /* Create SMSS process */
557 SmssName = ProcessParams->ImagePathName;
558 Status = RtlCreateUserProcess(&SmssName,
560 RtlDeNormalizeProcessParams(ProcessParams),
561 NULL,
562 NULL,
563 NULL,
564 FALSE,
565 NULL,
566 NULL,
567 ProcessInformation);
568 if (!NT_SUCCESS(Status))
569 {
570 /* Failed, display error */
571 _snwprintf(InitBuffer->DebugBuffer,
572 sizeof(InitBuffer->DebugBuffer)/sizeof(WCHAR),
573 L"INIT: Unable to create Session Manager. 0x%lx",
574 Status);
575 RtlInitUnicodeString(&DebugString, InitBuffer->DebugBuffer);
577
578 /* Bugcheck the system */
579 KeBugCheckEx(SESSION3_INITIALIZATION_FAILED, Status, 0, 0, 0);
580 }
581
582 /* Resume the thread */
583 Status = ZwResumeThread(ProcessInformation->ThreadHandle, NULL);
584 if (!NT_SUCCESS(Status))
585 {
586 /* Failed, display error */
587 _snwprintf(InitBuffer->DebugBuffer,
588 sizeof(InitBuffer->DebugBuffer)/sizeof(WCHAR),
589 L"INIT: Unable to resume Session Manager. 0x%lx",
590 Status);
591 RtlInitUnicodeString(&DebugString, InitBuffer->DebugBuffer);
593
594 /* Bugcheck the system */
595 KeBugCheckEx(SESSION4_INITIALIZATION_FAILED, Status, 0, 0, 0);
596 }
597
598 /* Return success */
599 *ProcessParameters = ProcessParams;
600 *ProcessEnvironment = EnvironmentPtr;
601}
602
603CODE_SEG("INIT")
604ULONG
605NTAPI
607{
608 ULONG MsRemainder = 0, MsIncrement;
609 ULONG IncrementRemainder;
610 ULONG i;
611
612 /* Count the number of milliseconds for each clock interrupt */
613 MsIncrement = ClockIncrement / (10 * 1000);
614
615 /* Count the remainder from the division above, with 24-bit precision */
616 IncrementRemainder = ClockIncrement - (MsIncrement * (10 * 1000));
617 for (i= 0; i < 24; i++)
618 {
619 /* Shift the remainders */
620 MsRemainder <<= 1;
621 IncrementRemainder <<= 1;
622
623 /* Check if we've went past 1 ms */
624 if (IncrementRemainder >= (10 * 1000))
625 {
626 /* Increase the remainder by one, and substract from increment */
627 IncrementRemainder -= (10 * 1000);
628 MsRemainder |= 1;
629 }
630 }
631
632 /* Return the increment */
633 return (MsIncrement << 24) | MsRemainder;
634}
635
636CODE_SEG("INIT")
638NTAPI
640{
641 /* Initialize EXRESOURCE Support */
643
644 /* Initialize the environment lock */
646
647 /* Initialize the lookaside lists and locks */
649
650 /* Initialize the Firmware Table resource and listhead */
654
655 /* Set the suite mask to maximum and return */
656 ExSuiteMask = 0xFFFFFFFF;
657 return TRUE;
658}
659
660CODE_SEG("INIT")
662NTAPI
664{
665 /* Initialize worker threads */
667
668 /* Initialize pushlocks */
670
671 /* Initialize events and event pairs */
673 {
674 DPRINT1("Executive: Event initialization failed\n");
675 return FALSE;
676 }
678 {
679 DPRINT1("Executive: Event Pair initialization failed\n");
680 return FALSE;
681 }
682
683 /* Initialize mutants */
685 {
686 DPRINT1("Executive: Mutant initialization failed\n");
687 return FALSE;
688 }
689
690 /* Initialize callbacks */
692 {
693 DPRINT1("Executive: Callback initialization failed\n");
694 return FALSE;
695 }
696
697 /* Initialize semaphores */
699 {
700 DPRINT1("Executive: Semaphore initialization failed\n");
701 return FALSE;
702 }
703
704 /* Initialize timers */
706 {
707 DPRINT1("Executive: Timer initialization failed\n");
708 return FALSE;
709 }
710
711 /* Initialize profiling */
713 {
714 DPRINT1("Executive: Profile initialization failed\n");
715 return FALSE;
716 }
717
718 /* Initialize UUIDs */
720 {
721 DPRINT1("Executive: Uuid initialization failed\n");
722 return FALSE;
723 }
724
725 /* Initialize keyed events */
727 {
728 DPRINT1("Executive: Keyed event initialization failed\n");
729 return FALSE;
730 }
731
732 /* Initialize Win32K */
733 if (ExpWin32kInit() == FALSE)
734 {
735 DPRINT1("Executive: Win32 initialization failed\n");
736 return FALSE;
737 }
738 return TRUE;
739}
740
741CODE_SEG("INIT")
743NTAPI
745{
746 /* Check the initialization phase */
748 {
749 case 0:
750
751 /* Do Phase 0 */
752 return ExpInitSystemPhase0();
753
754 case 1:
755
756 /* Do Phase 1 */
757 return ExpInitSystemPhase1();
758
759 default:
760
761 /* Don't know any other phase! Bugcheck! */
762 KeBugCheck(UNEXPECTED_INITIALIZATION_CALL);
763 return FALSE;
764 }
765}
766
767CODE_SEG("INIT")
769NTAPI
771{
773
774 /* Get the loader extension */
775 Extension = LoaderBlock->Extension;
776
777 /* Validate the size (Windows 2003 loader doesn't provide more) */
779
780 /* Don't validate upper versions */
781 if (Extension->MajorVersion > VER_PRODUCTMAJORVERSION) return TRUE;
782
783 /* Fail if this is NT 4 */
784 if (Extension->MajorVersion < VER_PRODUCTMAJORVERSION) return FALSE;
785
786 /* Fail if this is XP */
787 if (Extension->MinorVersion < VER_PRODUCTMINORVERSION) return FALSE;
788
789 /* This is 2003 or newer, approve it */
790 return TRUE;
791}
792
793static CODE_SEG("INIT")
794VOID
795ExpLoadBootSymbols(
796 _In_ PLOADER_PARAMETER_BLOCK LoaderBlock)
797{
798 PLIST_ENTRY NextEntry;
799 PLDR_DATA_TABLE_ENTRY LdrEntry;
801 ULONG i;
803 PWCHAR Name;
805 CHAR NameBuffer[256];
806
807 /* Loop over the boot modules list */
808 for (NextEntry = LoaderBlock->LoadOrderListHead.Flink, i = 0;
809 NextEntry != &LoaderBlock->LoadOrderListHead;
810 NextEntry = NextEntry->Flink, ++i)
811 {
812 /* Skip the first two images: HAL and kernel */
813 if (i < 2)
814 continue;
815
816 /* Get the entry */
817 LdrEntry = CONTAINING_RECORD(NextEntry,
819 InLoadOrderLinks);
820 if (LdrEntry->FullDllName.Buffer[0] == L'\\')
821 {
822 /* We have a name, read its data */
823 Name = LdrEntry->FullDllName.Buffer;
824 Length = LdrEntry->FullDllName.Length / sizeof(WCHAR);
825
826 /* Check if our buffer can hold it */
827 if (sizeof(NameBuffer) < Length + sizeof(ANSI_NULL))
828 {
829 /* It's too long */
831 }
832 else
833 {
834 /* Copy the name */
835 Count = 0;
836 do
837 {
838 /* Do cheap Unicode to ANSI conversion */
839 NameBuffer[Count++] = (CHAR)*Name++;
840 } while (Count < Length);
841
842 /* Null-terminate */
843 NameBuffer[Count] = ANSI_NULL;
845 }
846 }
847 else
848 {
849 /* Safely print the string into our buffer */
850 Status = RtlStringCbPrintfA(NameBuffer,
851 sizeof(NameBuffer),
852 "%S\\System32\\Drivers\\%wZ",
853 &SharedUserData->NtSystemRoot[2],
854 &LdrEntry->BaseDllName);
855 }
856
857 /* Check if the buffer is OK */
858 if (NT_SUCCESS(Status))
859 {
860 /* Load the symbols */
861 RtlInitString(&ImageName, NameBuffer);
863 LdrEntry->DllBase,
865 }
866
867#ifdef CONFIG_SMP
868 /* Check that the image is safe to use if we have more than one CPU */
869 if (!MmVerifyImageIsOkForMpUse(LdrEntry->DllBase))
870 {
871 KeBugCheckEx(UP_DRIVER_ON_MP_SYSTEM,
872 (ULONG_PTR)LdrEntry->DllBase,
873 0, 0, 0);
874 }
875#endif // CONFIG_SMP
876 }
877}
878
879CODE_SEG("INIT")
880VOID
881NTAPI
883 IN ULONG_PTR PagesToDestroy,
884 IN TYPE_OF_MEMORY MemoryType)
885{
886 PLIST_ENTRY ListEntry;
887 PMEMORY_ALLOCATION_DESCRIPTOR MemDescriptor;
888
889 DPRINT1("Burn RAM amount: %lu pages\n", PagesToDestroy);
890
891 /* Loop the memory descriptors, beginning at the end */
892 for (ListEntry = LoaderBlock->MemoryDescriptorListHead.Blink;
893 ListEntry != &LoaderBlock->MemoryDescriptorListHead;
894 ListEntry = ListEntry->Blink)
895 {
896 /* Get the memory descriptor structure */
897 MemDescriptor = CONTAINING_RECORD(ListEntry,
899 ListEntry);
900
901 /* Is memory free there or is it temporary? */
902 if (MemDescriptor->MemoryType == LoaderFree ||
903 MemDescriptor->MemoryType == LoaderFirmwareTemporary)
904 {
905 /* Check if the descriptor has more pages than we want */
906 if (MemDescriptor->PageCount > PagesToDestroy)
907 {
908 /* Change block's page count, ntoskrnl doesn't care much */
909 MemDescriptor->PageCount -= PagesToDestroy;
910 break;
911 }
912 else
913 {
914 /* Change block type */
915 MemDescriptor->MemoryType = MemoryType;
916 PagesToDestroy -= MemDescriptor->PageCount;
917
918 /* Check if we are done */
919 if (PagesToDestroy == 0) break;
920 }
921 }
922 }
923}
924
925CODE_SEG("INIT")
926VOID
927NTAPI
929 IN PLOADER_PARAMETER_BLOCK LoaderBlock)
930{
931 PNLS_DATA_BLOCK NlsData;
932 CHAR Buffer[256];
933 ANSI_STRING AnsiPath;
935 PCHAR CommandLine, PerfMem;
936 ULONG PerfMemUsed;
937 PLDR_DATA_TABLE_ENTRY NtosEntry;
939 ANSI_STRING CSDString;
940 size_t Remaining = 0;
941 PCHAR RcEnd = NULL;
942 CHAR VersionBuffer[65];
943
944 /* Validate Loader */
945 if (!ExpIsLoaderValid(LoaderBlock))
946 {
947 /* Invalid loader version */
948 KeBugCheckEx(MISMATCHED_HAL,
949 3,
950 LoaderBlock->Extension->Size,
951 LoaderBlock->Extension->MajorVersion,
952 LoaderBlock->Extension->MinorVersion);
953 }
954
955 /* Initialize PRCB pool lookaside pointers */
957
958 /* Check if this is an application CPU */
959 if (Cpu)
960 {
961 /* Then simply initialize it with HAL */
962 if (!HalInitSystem(ExpInitializationPhase, LoaderBlock))
963 {
964 /* Initialization failed */
965 KeBugCheck(HAL_INITIALIZATION_FAILED);
966 }
967
968 /* We're done */
969 return;
970 }
971
972 /* Assume no text-mode or remote boot */
975
976 /* Check if we have a setup loader block */
977 if (LoaderBlock->SetupLdrBlock)
978 {
979 /* Check if this is text-mode setup */
980 if (LoaderBlock->SetupLdrBlock->Flags & SETUPLDR_TEXT_MODE)
982
983 /* Check if this is network boot */
984 if (LoaderBlock->SetupLdrBlock->Flags & SETUPLDR_REMOTE_BOOT)
985 {
986 /* Set variable */
988
989 /* Make sure we're actually booting off the network */
990 ASSERT(!_memicmp(LoaderBlock->ArcBootDeviceName, "net(0)", 6));
991 }
992 }
993
994 /* Set phase to 0 */
996
997 /* Get boot command line */
998 CommandLine = LoaderBlock->LoadOptions;
999 if (CommandLine)
1000 {
1001 /* Upcase it for comparison and check if we're in performance mode */
1002 _strupr(CommandLine);
1003 PerfMem = strstr(CommandLine, "PERFMEM");
1004 if (PerfMem)
1005 {
1006 /* Check if the user gave a number of bytes to use */
1007 PerfMem = strstr(PerfMem, "=");
1008 if (PerfMem)
1009 {
1010 /* Read the number of pages we'll use */
1011 PerfMemUsed = atol(PerfMem + 1) * (1024 * 1024 / PAGE_SIZE);
1012 if (PerfMemUsed)
1013 {
1014 /* FIXME: TODO */
1015 DPRINT1("BBT performance mode not yet supported."
1016 "/PERFMEM option ignored.\n");
1017 }
1018 }
1019 }
1020
1021 /* Check if we're burning memory */
1022 PerfMem = strstr(CommandLine, "BURNMEMORY");
1023 if (PerfMem)
1024 {
1025 /* Check if the user gave a number of bytes to use */
1026 PerfMem = strstr(PerfMem, "=");
1027 if (PerfMem)
1028 {
1029 /* Read the number of pages we'll use */
1030 PerfMemUsed = atol(PerfMem + 1) * (1024 * 1024 / PAGE_SIZE);
1031 if (PerfMemUsed) ExBurnMemory(LoaderBlock, PerfMemUsed, LoaderBad);
1032 }
1033 }
1034 }
1035
1036 /* Setup NLS Base and offsets */
1037 NlsData = LoaderBlock->NlsData;
1041 (ULONG_PTR)NlsData->AnsiCodePageData);
1043 (ULONG_PTR)NlsData->AnsiCodePageData);
1044
1045 /* Initialize the NLS Tables */
1054
1055 /* Now initialize the HAL */
1056 if (!HalInitSystem(ExpInitializationPhase, LoaderBlock))
1057 {
1058 /* HAL failed to initialize, bugcheck */
1059 KeBugCheck(HAL_INITIALIZATION_FAILED);
1060 }
1061
1062 /* Make sure interrupts are active now */
1063 _enable();
1064
1065 /* Clear the crypto exponent */
1066 SharedUserData->CryptoExponent = 0;
1067
1068 /* Set global flags for the checked build */
1069#if DBG
1072#endif
1073
1074 /* Setup NT System Root Path */
1075 sprintf(Buffer, "C:%s", LoaderBlock->NtBootPathName);
1076
1077 /* Convert to ANSI_STRING and null-terminate it */
1078 RtlInitString(&AnsiPath, Buffer);
1079 Buffer[--AnsiPath.Length] = ANSI_NULL;
1080
1081 /* Get the string from KUSER_SHARED_DATA's buffer */
1082 RtlInitEmptyUnicodeString(&NtSystemRoot,
1083 SharedUserData->NtSystemRoot,
1084 sizeof(SharedUserData->NtSystemRoot));
1085
1086 /* Now fill it in */
1088 if (!NT_SUCCESS(Status)) KeBugCheck(SESSION3_INITIALIZATION_FAILED);
1089
1090 /* Setup bugcheck messages */
1092
1093 /* Setup initial system settings */
1094 CmGetSystemControlValues(LoaderBlock->RegistryBase, CmControlVector);
1095
1096 /* Set the Service Pack Number and add it to the CSD Version number if needed */
1098 if (((CmNtCSDVersion & 0xFFFF0000) == 0) && (CmNtCSDReleaseType == 1))
1099 {
1101 }
1102
1103 /* Add loaded CmNtGlobalFlag value */
1105
1106 /* Initialize the executive at phase 0 */
1107 if (!ExInitSystem()) KeBugCheck(PHASE0_INITIALIZATION_FAILED);
1108
1109 /* Initialize the memory manager at phase 0 */
1110 if (!MmArmInitSystem(0, LoaderBlock)) KeBugCheck(PHASE0_INITIALIZATION_FAILED);
1111
1112 /* Load boot symbols */
1113 ExpLoadBootSymbols(LoaderBlock);
1114
1115 /* Check if we should break after symbol load */
1118
1119 /* Check if this loader is compatible with NT 5.2 */
1120 if (LoaderBlock->Extension->Size >= sizeof(LOADER_PARAMETER_EXTENSION))
1121 {
1122 /* Setup headless terminal settings */
1123 HeadlessInit(LoaderBlock);
1124 }
1125
1126 /* Set system ranges */
1127#ifdef _M_AMD64
1130#else
1133#endif
1134
1135 /* Make a copy of the NLS Tables */
1136 ExpInitNls(LoaderBlock);
1137
1138 /* Get the kernel's load entry */
1139 NtosEntry = CONTAINING_RECORD(LoaderBlock->LoadOrderListHead.Flink,
1141 InLoadOrderLinks);
1142
1143 /* Check if this is a service pack */
1144 if (CmNtCSDVersion & 0xFFFF)
1145 {
1146 /* Get the service pack string */
1147 Status = RtlFindMessage(NtosEntry->DllBase,
1150 WINDOWS_NT_CSD_STRING,
1151 &MsgEntry);
1152 if (NT_SUCCESS(Status))
1153 {
1154 /* Setup the string */
1155 RtlInitAnsiString(&CSDString, (PCHAR)MsgEntry->Text);
1156
1157 /* Remove trailing newline */
1158 while ((CSDString.Length > 0) &&
1159 ((CSDString.Buffer[CSDString.Length - 1] == '\r') ||
1160 (CSDString.Buffer[CSDString.Length - 1] == '\n')))
1161 {
1162 /* Skip the trailing character */
1163 CSDString.Length--;
1164 }
1165
1166 /* Fill the buffer with version information */
1168 sizeof(Buffer),
1169 "%Z %u%c",
1170 &CSDString,
1171 (CmNtCSDVersion & 0xFF00) >> 8,
1172 (CmNtCSDVersion & 0xFF) ?
1173 'A' + (CmNtCSDVersion & 0xFF) - 1 :
1174 ANSI_NULL);
1175 }
1176 else
1177 {
1178 /* Build default string */
1180 sizeof(Buffer),
1181 "CSD %04x",
1183 }
1184
1185 /* Check for success */
1186 if (!NT_SUCCESS(Status))
1187 {
1188 /* Fail */
1189 KeBugCheckEx(PHASE0_INITIALIZATION_FAILED, Status, 0, 0, 0);
1190 }
1191 }
1192 else
1193 {
1194 /* Then this is a beta */
1196 sizeof(Buffer),
1198 NULL,
1199 &Remaining,
1200 0);
1201 if (!NT_SUCCESS(Status))
1202 {
1203 /* Fail */
1204 KeBugCheckEx(PHASE0_INITIALIZATION_FAILED, Status, 0, 0, 0);
1205 }
1206
1207 /* Update length */
1208 CmCSDVersionString.MaximumLength = sizeof(Buffer) - (USHORT)Remaining;
1209 }
1210
1211 /* Check if we have an RC number */
1212 if ((CmNtCSDVersion & 0xFFFF0000) && (CmNtCSDReleaseType == 1))
1213 {
1214 /* Check if we have no version data yet */
1215 if (!(*Buffer))
1216 {
1217 /* Set defaults */
1218 Remaining = sizeof(Buffer);
1219 RcEnd = Buffer;
1220 }
1221 else
1222 {
1223 /* Add comma and space */
1225 sizeof(Buffer),
1226 ", ",
1227 &RcEnd,
1228 &Remaining,
1229 0);
1230 if (!NT_SUCCESS(Status))
1231 {
1232 /* Fail */
1233 KeBugCheckEx(PHASE0_INITIALIZATION_FAILED, Status, 0, 0, 0);
1234 }
1235 }
1236
1237 /* Add the version format string */
1238 Status = RtlStringCbPrintfA(RcEnd,
1239 Remaining,
1240 "v.%u",
1241 (CmNtCSDVersion & 0xFFFF0000) >> 16);
1242 if (!NT_SUCCESS(Status))
1243 {
1244 /* Fail */
1245 KeBugCheckEx(PHASE0_INITIALIZATION_FAILED, Status, 0, 0, 0);
1246 }
1247 }
1248
1249 /* Now setup the final string */
1250 RtlInitAnsiString(&CSDString, Buffer);
1252 &CSDString,
1253 TRUE);
1254 if (!NT_SUCCESS(Status))
1255 {
1256 /* Fail */
1257 KeBugCheckEx(PHASE0_INITIALIZATION_FAILED, Status, 0, 0, 0);
1258 }
1259
1260 /* Add our version */
1261 Status = RtlStringCbPrintfA(VersionBuffer,
1262 sizeof(VersionBuffer),
1263 "%u.%u",
1266 if (!NT_SUCCESS(Status))
1267 {
1268 /* Fail */
1269 KeBugCheckEx(PHASE0_INITIALIZATION_FAILED, Status, 0, 0, 0);
1270 }
1271
1272 /* Build the final version string */
1274
1275 /* Check if the user wants a kernel stack trace database */
1277 {
1278 /* FIXME: TODO */
1279 DPRINT1("Kernel-mode stack trace support not yet present."
1280 "FLG_KERNEL_STACK_TRACE_DB flag ignored.\n");
1281 }
1282
1283 /* Check if he wanted exception logging */
1285 {
1286 /* FIXME: TODO */
1287 DPRINT1("Kernel-mode exception logging support not yet present."
1288 "FLG_ENABLE_EXCEPTION_LOGGING flag ignored.\n");
1289 }
1290
1291 /* Initialize the Handle Table */
1293
1294#if DBG
1295 /* On checked builds, allocate the system call count table */
1298 KiServiceLimit * sizeof(ULONG),
1299 'llaC');
1300
1301 /* Use it for the shadow table too */
1303
1304 /* Make sure allocation succeeded */
1306 {
1307 /* Zero the call counts to 0 */
1309 KiServiceLimit * sizeof(ULONG));
1310 }
1311#endif
1312
1313 /* Create the Basic Object Manager Types to allow new Object Types */
1314 if (!ObInitSystem()) KeBugCheck(OBJECT_INITIALIZATION_FAILED);
1315
1316 /* Load basic Security for other Managers */
1317 if (!SeInitSystem()) KeBugCheck(SECURITY_INITIALIZATION_FAILED);
1318
1319 /* Initialize the Process Manager */
1320 if (!PsInitSystem(LoaderBlock)) KeBugCheck(PROCESS_INITIALIZATION_FAILED);
1321
1322 /* Initialize the PnP Manager */
1323 if (!PpInitSystem()) KeBugCheck(PP0_INITIALIZATION_FAILED);
1324
1325 /* Initialize the User-Mode Debugging Subsystem */
1327
1328 /* Calculate the tick count multiplier */
1330 SharedUserData->TickCountMultiplier = ExpTickCountMultiplier;
1331
1332 /* Set the OS Version */
1333 SharedUserData->NtMajorVersion = NtMajorVersion;
1334 SharedUserData->NtMinorVersion = NtMinorVersion;
1335
1336 /* Set the machine type */
1337 SharedUserData->ImageNumberLow = IMAGE_FILE_MACHINE_NATIVE;
1338 SharedUserData->ImageNumberHigh = IMAGE_FILE_MACHINE_NATIVE;
1339
1340 /* ReactOS magic */
1341 *(PULONG)(KI_USER_SHARED_DATA + PAGE_SIZE - sizeof(ULONG)) = 0x8eac705;
1342}
1343
1344VOID
1345NTAPI
1347
1348CODE_SEG("INIT")
1349VOID
1350NTAPI
1352{
1353 PLOADER_PARAMETER_BLOCK LoaderBlock = Context;
1354 NTSTATUS Status, MsgStatus;
1356 LARGE_INTEGER SystemBootTime, UniversalBootTime, OldTime, Timeout;
1357 BOOLEAN NoGuiBoot, ResetBias = FALSE, AlternateShell = FALSE;
1358 PLDR_DATA_TABLE_ENTRY NtosEntry;
1359 PMESSAGE_RESOURCE_ENTRY MsgEntry;
1360 PCHAR CommandLine, Y2KHackRequired, SafeBoot, Environment;
1361 PCHAR StringBuffer, EndBuffer, BeginBuffer, MpString = "";
1362 PINIT_BUFFER InitBuffer;
1363 ANSI_STRING TempString;
1364 ULONG LastTzBias, Length, YearHack = 0, Disposition, MessageCode = 0;
1365 SIZE_T Size;
1366 size_t Remaining;
1368 KEY_VALUE_PARTIAL_INFORMATION KeyPartialInfo;
1371 HANDLE KeyHandle, OptionHandle;
1372 PRTL_USER_PROCESS_PARAMETERS ProcessParameters = NULL;
1373
1374 /* Allocate the initialization buffer */
1376 sizeof(INIT_BUFFER),
1377 TAG_INIT);
1378 if (!InitBuffer)
1379 {
1380 /* Bugcheck */
1381 KeBugCheckEx(PHASE1_INITIALIZATION_FAILED, STATUS_NO_MEMORY, 8, 0, 0);
1382 }
1383
1384 /* Set to phase 1 */
1386
1387 /* Set us at maximum priority */
1389
1390 /* Do Phase 1 HAL Initialization */
1391 if (!HalInitSystem(1, LoaderBlock)) KeBugCheck(HAL1_INITIALIZATION_FAILED);
1392
1393 /* Get the command line and upcase it */
1394 CommandLine = (LoaderBlock->LoadOptions ? _strupr(LoaderBlock->LoadOptions) : NULL);
1395
1396 /* Check if GUI Boot is enabled */
1397 NoGuiBoot = (CommandLine && strstr(CommandLine, "NOGUIBOOT") != NULL);
1398
1399 /* Get the SOS setting */
1400 SosEnabled = (CommandLine && strstr(CommandLine, "SOS") != NULL);
1401
1402 /* Setup the boot video driver */
1403 InbvEnableBootDriver(!NoGuiBoot);
1405
1406 /* Check if GUI boot is enabled */
1407 if (!NoGuiBoot)
1408 {
1409 /* It is, display the boot logo and enable printing strings */
1412 }
1413 else
1414 {
1415 /* Release display ownership if not using GUI boot */
1417
1418 /* Don't allow boot-time strings */
1420 }
1421
1422 /* Check if this is LiveCD (WinPE) mode */
1423 if (CommandLine && strstr(CommandLine, "MININT") != NULL)
1424 {
1425 /* Setup WinPE Settings */
1427 InitWinPEModeType |= (strstr(CommandLine, "INRAM") != NULL) ? 0x80000000 : 0x00000001;
1428 }
1429
1430 /* Get the kernel's load entry */
1431 NtosEntry = CONTAINING_RECORD(LoaderBlock->LoadOrderListHead.Flink,
1433 InLoadOrderLinks);
1434
1435 /* Find the banner message */
1436 MsgStatus = RtlFindMessage(NtosEntry->DllBase,
1439 WINDOWS_NT_BANNER,
1440 &MsgEntry);
1441
1442 /* Setup defaults and check if we have a version string */
1443 StringBuffer = InitBuffer->VersionBuffer;
1444 BeginBuffer = StringBuffer;
1445 EndBuffer = StringBuffer;
1446 Remaining = sizeof(InitBuffer->VersionBuffer);
1448 {
1449 /* Print the version string */
1451 Remaining,
1452 &EndBuffer,
1453 &Remaining,
1454 0,
1455 ": %wZ",
1457 if (!NT_SUCCESS(Status))
1458 {
1459 /* Bugcheck */
1460 KeBugCheckEx(PHASE1_INITIALIZATION_FAILED, Status, 7, 0, 0);
1461 }
1462 }
1463 else
1464 {
1465 /* No version */
1466 *EndBuffer = ANSI_NULL; /* Null-terminate the string */
1467 }
1468
1469 /* Skip over the null-terminator to start a new string */
1470 ++EndBuffer;
1471 --Remaining;
1472
1473 /* Build the version number */
1474 StringBuffer = InitBuffer->VersionNumber;
1476 sizeof(InitBuffer->VersionNumber),
1477 "%u.%u",
1480 if (!NT_SUCCESS(Status))
1481 {
1482 /* Bugcheck */
1483 KeBugCheckEx(PHASE1_INITIALIZATION_FAILED, Status, 7, 0, 0);
1484 }
1485
1486 /* Check if we had found a banner message */
1487 if (NT_SUCCESS(MsgStatus))
1488 {
1489 /* Create the banner message */
1490 /* ReactOS specific: Report ReactOS version, NtBuildLab information and reported NT kernel version */
1491 Status = RtlStringCbPrintfA(EndBuffer,
1492 Remaining,
1493 (PCHAR)MsgEntry->Text,
1494 KERNEL_VERSION_STR,
1495 NtBuildLab,
1497 NtBuildNumber & 0xFFFF,
1498 BeginBuffer);
1499 if (!NT_SUCCESS(Status))
1500 {
1501 /* Bugcheck */
1502 KeBugCheckEx(PHASE1_INITIALIZATION_FAILED, Status, 7, 0, 0);
1503 }
1504 }
1505 else
1506 {
1507 /* Use hard-coded banner message */
1508 Status = RtlStringCbCopyA(EndBuffer, Remaining, "REACTOS (R)\r\n");
1509 if (!NT_SUCCESS(Status))
1510 {
1511 /* Bugcheck */
1512 KeBugCheckEx(PHASE1_INITIALIZATION_FAILED, Status, 7, 0, 0);
1513 }
1514 }
1515
1516 /* Display the version string on-screen */
1517 InbvDisplayString(EndBuffer);
1518
1519 /* Initialize Power Subsystem in Phase 0 */
1520 if (!PoInitSystem(0)) KeBugCheck(INTERNAL_POWER_ERROR);
1521
1522 /* Check for Y2K hack */
1523 Y2KHackRequired = CommandLine ? strstr(CommandLine, "YEAR") : NULL;
1524 if (Y2KHackRequired) Y2KHackRequired = strstr(Y2KHackRequired, "=");
1525 if (Y2KHackRequired) YearHack = atol(Y2KHackRequired + 1);
1526
1527 /* Query the clock */
1529 {
1530 /* Check if we're using the Y2K hack */
1531 if (Y2KHackRequired) TimeFields.Year = (CSHORT)YearHack;
1532
1533 /* Convert to time fields */
1534 RtlTimeFieldsToTime(&TimeFields, &SystemBootTime);
1535 UniversalBootTime = SystemBootTime;
1536
1537 /* Check if real time is GMT */
1539 {
1540 /* Check if we don't have a valid bias */
1542 {
1543 /* Reset */
1544 ResetBias = TRUE;
1546 }
1547
1548 /* Calculate the bias in seconds */
1550 10000000);
1551
1552 /* Set the boot time-zone bias */
1554
1555 /* Convert the boot time to local time, and set it */
1556 UniversalBootTime.QuadPart = SystemBootTime.QuadPart +
1558 }
1559
1560 /* Update the system time and notify the system */
1561 KeSetSystemTime(&UniversalBootTime, &OldTime, FALSE, NULL);
1563
1564 /* Remember this as the boot time */
1565 KeBootTime = UniversalBootTime;
1566 KeBootTimeBias = 0;
1567 }
1568
1569#ifdef CONFIG_SMP
1570 /*
1571 * IMPORTANT NOTE:
1572 * Because ReactOS is a "nice" OS, we do not care _at all_
1573 * about any number of registered/licensed processors:
1574 * no usage of KeRegisteredProcessors nor KeLicensedProcessors.
1575 */
1576 if (CommandLine)
1577 {
1578 PSTR Option;
1579
1580 /* Check for NUMPROC: maximum number of logical processors
1581 * that can be started (including dynamically) at run-time */
1582 Option = strstr(CommandLine, "NUMPROC");
1583 if (Option) Option = strstr(Option, "=");
1584 if (Option) KeNumprocSpecified = atol(Option + 1);
1585
1586 /* Check for BOOTPROC (NT6+ and ReactOS): maximum number
1587 * of logical processors that can be started at boot-time */
1588 Option = strstr(CommandLine, "BOOTPROC");
1589 if (Option) Option = strstr(Option, "=");
1590 if (Option) KeBootprocSpecified = atol(Option + 1);
1591
1592 /* Check for MAXPROC (NT6+ and ReactOS): forces the kernel to report
1593 * as existing the maximum number of processors that can be handled */
1594 if (strstr(CommandLine, "MAXPROC"))
1595 KeMaximumProcessors = MAXIMUM_PROCESSORS;
1596 }
1597
1598 /* Start Application Processors */
1600#endif
1601
1602 /* Initialize all processors */
1603 if (!HalAllProcessorsStarted()) KeBugCheck(HAL1_INITIALIZATION_FAILED);
1604
1605#ifdef CONFIG_SMP
1606 /* HACK: We should use RtlFindMessage and not only fallback to this */
1607 MpString = "MultiProcessor Kernel\r\n";
1608#endif
1609
1610 /* Setup the "MP" String */
1611 RtlInitAnsiString(&TempString, MpString);
1612
1613 /* Make sure to remove the \r\n if we actually have a string */
1614 while ((TempString.Length > 0) &&
1615 ((TempString.Buffer[TempString.Length - 1] == '\r') ||
1616 (TempString.Buffer[TempString.Length - 1] == '\n')))
1617 {
1618 /* Skip the trailing character */
1619 TempString.Length--;
1620 }
1621
1622 /* Get the information string from our resource file */
1623 MsgStatus = RtlFindMessage(NtosEntry->DllBase,
1626 KeNumberProcessors > 1 ?
1627 WINDOWS_NT_INFO_STRING_PLURAL :
1628 WINDOWS_NT_INFO_STRING,
1629 &MsgEntry);
1630
1631 /* Get total RAM size, in MiB */
1632 /* Round size up. Assumed to better match actual physical RAM size */
1633 Size = ALIGN_UP_BY(MmNumberOfPhysicalPages * PAGE_SIZE, 1024 * 1024) / (1024 * 1024);
1634
1635 /* Create the string */
1636 StringBuffer = InitBuffer->VersionBuffer;
1638 sizeof(InitBuffer->VersionBuffer),
1639 NT_SUCCESS(MsgStatus) ?
1640 (PCHAR)MsgEntry->Text :
1641 "%u System Processor [%Iu MB Memory] %Z\r\n",
1643 Size,
1644 &TempString);
1645 if (!NT_SUCCESS(Status))
1646 {
1647 /* Bugcheck */
1648 KeBugCheckEx(PHASE1_INITIALIZATION_FAILED, Status, 4, 0, 0);
1649 }
1650
1651 /* Display RAM and CPU count */
1653
1654 /* Update the progress bar */
1656
1657 /* Call OB initialization again */
1658 if (!ObInitSystem()) KeBugCheck(OBJECT1_INITIALIZATION_FAILED);
1659
1660 /* Initialize Basic System Objects and Worker Threads */
1661 if (!ExInitSystem()) KeBugCheckEx(PHASE1_INITIALIZATION_FAILED, 0, 0, 1, 0);
1662
1663 /* Initialize the later stages of the kernel */
1664 if (!KeInitSystem()) KeBugCheckEx(PHASE1_INITIALIZATION_FAILED, 0, 0, 2, 0);
1665
1666 /* Call KD Providers at Phase 1 */
1668 {
1669 /* Failed, bugcheck */
1670 KeBugCheckEx(PHASE1_INITIALIZATION_FAILED, 0, 0, 3, 0);
1671 }
1672
1673 /* Initialize the SRM in Phase 1 */
1674 if (!SeInitSystem()) KeBugCheck(SECURITY1_INITIALIZATION_FAILED);
1675
1676 /* Update the progress bar */
1678
1679 /* Create SystemRoot Link */
1680 Status = ExpCreateSystemRootLink(LoaderBlock);
1681 if (!NT_SUCCESS(Status))
1682 {
1683 /* Failed to create the system root link */
1684 KeBugCheckEx(SYMBOLIC_INITIALIZATION_FAILED, Status, 0, 0, 0);
1685 }
1686
1687 /* Set up Region Maps, Sections and the Paging File */
1688 if (!MmInitSystem(1, LoaderBlock)) KeBugCheck(MEMORY1_INITIALIZATION_FAILED);
1689
1690 /* Create NLS section */
1691 ExpInitNls(LoaderBlock);
1692
1693 /* Initialize Cache Views */
1694 if (!CcInitializeCacheManager()) KeBugCheck(CACHE_INITIALIZATION_FAILED);
1695
1696 /* Initialize the Registry */
1697 if (!CmInitSystem1()) KeBugCheck(CONFIG_INITIALIZATION_FAILED);
1698
1699 /* Initialize Prefetcher */
1701
1702 /* Update progress bar */
1704
1705 /* Update timezone information */
1706 LastTzBias = ExpLastTimeZoneBias;
1707 ExRefreshTimeZoneInformation(&SystemBootTime);
1708
1709 /* Check if we're resetting timezone data */
1710 if (ResetBias)
1711 {
1712 /* Convert the local time to system time */
1713 ExLocalTimeToSystemTime(&SystemBootTime, &UniversalBootTime);
1714 KeBootTime = UniversalBootTime;
1715 KeBootTimeBias = 0;
1716
1717 /* Set the new time */
1718 KeSetSystemTime(&UniversalBootTime, &OldTime, FALSE, NULL);
1719 }
1720 else
1721 {
1722 /* Check if the timezone switched and update the time */
1723 if (LastTzBias != ExpLastTimeZoneBias)
1725 }
1726
1727 /* Initialize the File System Runtime Library */
1728 if (!FsRtlInitSystem()) KeBugCheck(FILE_INITIALIZATION_FAILED);
1729
1730 /* Initialize range lists */
1732
1733 /* Report all resources used by HAL */
1735
1736 /* Call the debugger DLL */
1737 KdDebuggerInitialize1(LoaderBlock);
1738
1739 /* Setup PnP Manager in phase 1 */
1740 if (!PpInitSystem()) KeBugCheck(PP1_INITIALIZATION_FAILED);
1741
1742 /* Update progress bar */
1744
1745 /* Initialize LPC */
1746 if (!LpcInitSystem()) KeBugCheck(LPC_INITIALIZATION_FAILED);
1747
1748 /* Make sure we have a command line */
1749 if (CommandLine)
1750 {
1751 /* Check if this is a safe mode boot */
1752 SafeBoot = strstr(CommandLine, "SAFEBOOT:");
1753 if (SafeBoot)
1754 {
1755 /* Check what kind of boot this is */
1756 SafeBoot += 9;
1757 if (!strncmp(SafeBoot, "MINIMAL", 7))
1758 {
1759 /* Minimal mode */
1760 InitSafeBootMode = 1;
1761 SafeBoot += 7;
1762 MessageCode = BOOTING_IN_SAFEMODE_MINIMAL;
1763 }
1764 else if (!strncmp(SafeBoot, "NETWORK", 7))
1765 {
1766 /* With Networking */
1767 InitSafeBootMode = 2;
1768 SafeBoot += 7;
1769 MessageCode = BOOTING_IN_SAFEMODE_NETWORK;
1770 }
1771 else if (!strncmp(SafeBoot, "DSREPAIR", 8))
1772 {
1773 /* Domain Server Repair */
1774 InitSafeBootMode = 3;
1775 SafeBoot += 8;
1776 MessageCode = BOOTING_IN_SAFEMODE_DSREPAIR;
1777
1778 }
1779 else
1780 {
1781 /* Invalid */
1782 InitSafeBootMode = 0;
1783 }
1784
1785 /* Check if there's any settings left */
1786 if (*SafeBoot)
1787 {
1788 /* Check if an alternate shell was requested */
1789 if (!strncmp(SafeBoot, "(ALTERNATESHELL)", 16))
1790 {
1791 /* Remember this for later */
1792 AlternateShell = TRUE;
1793 }
1794 }
1795
1796 /* Find the message to print out */
1797 Status = RtlFindMessage(NtosEntry->DllBase,
1800 MessageCode,
1801 &MsgEntry);
1802 if (NT_SUCCESS(Status))
1803 {
1804 /* Display it */
1805 InbvDisplayString((PCSTR)MsgEntry->Text);
1806 }
1807 }
1808 }
1809
1810 /* Make sure we have a command line */
1811 if (CommandLine)
1812 {
1813 /* Check if bootlogging is enabled */
1814 if (strstr(CommandLine, "BOOTLOG"))
1815 {
1816 /* Find the message to print out */
1817 Status = RtlFindMessage(NtosEntry->DllBase,
1820 BOOTLOG_ENABLED,
1821 &MsgEntry);
1822 if (NT_SUCCESS(Status))
1823 {
1824 /* Display it */
1825 InbvDisplayString((PCSTR)MsgEntry->Text);
1826 }
1827
1828 /* Setup boot logging */
1829 //IopInitializeBootLogging(LoaderBlock, InitBuffer->BootlogHeader);
1830 }
1831 }
1832
1833 /* Setup the Executive in Phase 2 */
1834 //ExInitSystemPhase2();
1835
1836 /* Update progress bar */
1838
1839 /* No KD Time Slip is pending */
1841
1842 /* Initialize in-place execution support */
1843 XIPInit(LoaderBlock);
1844
1845 /* Set maximum update to 75% */
1847
1848 /* Initialize the I/O Subsystem */
1849 if (!IoInitSystem(LoaderBlock)) KeBugCheck(IO1_INITIALIZATION_FAILED);
1850
1851 /* Set maximum update to 100% */
1853
1854 /* Are we in safe mode? */
1855 if (InitSafeBootMode)
1856 {
1857 /* Open the safe boot key */
1859 L"\\REGISTRY\\MACHINE\\SYSTEM\\CURRENTCONTROLSET"
1860 L"\\CONTROL\\SAFEBOOT");
1862 &KeyName,
1864 NULL,
1865 NULL);
1867 if (NT_SUCCESS(Status))
1868 {
1869 /* First check if we have an alternate shell */
1870 if (AlternateShell)
1871 {
1872 /* Make sure that the registry has one setup */
1873 RtlInitUnicodeString(&KeyName, L"AlternateShell");
1875 &KeyName,
1877 &KeyPartialInfo,
1878 sizeof(KeyPartialInfo),
1879 &Length);
1881 {
1882 AlternateShell = FALSE;
1883 }
1884 }
1885
1886 /* Create the option key */
1887 RtlInitUnicodeString(&KeyName, L"Option");
1889 &KeyName,
1891 KeyHandle,
1892 NULL);
1893 Status = ZwCreateKey(&OptionHandle,
1896 0,
1897 NULL,
1899 &Disposition);
1901
1902 /* Check if the key create worked */
1903 if (NT_SUCCESS(Status))
1904 {
1905 /* Write the safe boot type */
1906 RtlInitUnicodeString(&KeyName, L"OptionValue");
1907 NtSetValueKey(OptionHandle,
1908 &KeyName,
1909 0,
1910 REG_DWORD,
1912 sizeof(InitSafeBootMode));
1913
1914 /* Check if we have to use an alternate shell */
1915 if (AlternateShell)
1916 {
1917 /* Remember this for later */
1918 Disposition = TRUE;
1919 RtlInitUnicodeString(&KeyName, L"UseAlternateShell");
1920 NtSetValueKey(OptionHandle,
1921 &KeyName,
1922 0,
1923 REG_DWORD,
1924 &Disposition,
1925 sizeof(Disposition));
1926 }
1927
1928 /* Close the options key handle */
1929 NtClose(OptionHandle);
1930 }
1931 }
1932 }
1933
1934 /* Are we in Win PE mode? */
1935 if (InitIsWinPEMode)
1936 {
1937 /* Open the safe control key */
1939 L"\\REGISTRY\\MACHINE\\SYSTEM\\CURRENTCONTROLSET"
1940 L"\\CONTROL");
1942 &KeyName,
1944 NULL,
1945 NULL);
1947 if (!NT_SUCCESS(Status))
1948 {
1949 /* Bugcheck */
1950 KeBugCheckEx(PHASE1_INITIALIZATION_FAILED, Status, 6, 0, 0);
1951 }
1952
1953 /* Create the MiniNT key */
1954 RtlInitUnicodeString(&KeyName, L"MiniNT");
1956 &KeyName,
1958 KeyHandle,
1959 NULL);
1960 Status = ZwCreateKey(&OptionHandle,
1963 0,
1964 NULL,
1966 &Disposition);
1967 if (!NT_SUCCESS(Status))
1968 {
1969 /* Bugcheck */
1970 KeBugCheckEx(PHASE1_INITIALIZATION_FAILED, Status, 6, 0, 0);
1971 }
1972
1973 /* Close the handles */
1975 NtClose(OptionHandle);
1976 }
1977
1978 /* FIXME: This doesn't do anything for now */
1979 MmArmInitSystem(2, LoaderBlock);
1980
1981 /* Update progress bar */
1983
1984 /* Initialize VDM support */
1985#if defined(_M_IX86)
1987#endif
1988
1989 /* Initialize Power Subsystem in Phase 1*/
1990 if (!PoInitSystem(1)) KeBugCheck(INTERNAL_POWER_ERROR);
1991
1992 /* Update progress bar */
1994
1995 /* Initialize the Process Manager at Phase 1 */
1996 if (!PsInitSystem(LoaderBlock)) KeBugCheck(PROCESS1_INITIALIZATION_FAILED);
1997
1998 /* Make sure nobody touches the loader block again */
1999 if (LoaderBlock == KeLoaderBlock) KeLoaderBlock = NULL;
2000 MmFreeLoaderBlock(LoaderBlock);
2001 LoaderBlock = Context = NULL;
2002
2003 /* Initialize the SRM in phase 1 */
2004 if (!SeRmInitPhase1()) KeBugCheck(PROCESS1_INITIALIZATION_FAILED);
2005
2006 /* Update progress bar */
2008
2009 /* Clear the screen */
2011
2012 /* Allow strings to be displayed */
2014
2015 /* Launch initial process */
2016 ProcessInfo = &InitBuffer->ProcessInfo;
2017 ExpLoadInitialProcess(InitBuffer, &ProcessParameters, &Environment);
2018
2019 /* Wait 5 seconds for initial process to initialize */
2020 Timeout.QuadPart = Int32x32To64(5, -10000000);
2021 Status = ZwWaitForSingleObject(ProcessInfo->ProcessHandle, FALSE, &Timeout);
2022 if (Status == STATUS_SUCCESS)
2023 {
2024 /* Failed, display error */
2025 DPRINT1("INIT: Session Manager terminated.\n");
2026
2027 /* Bugcheck the system if SMSS couldn't initialize */
2028 KeBugCheck(SESSION5_INITIALIZATION_FAILED);
2029 }
2030
2031 /* Close process handles */
2032 ZwClose(ProcessInfo->ThreadHandle);
2033 ZwClose(ProcessInfo->ProcessHandle);
2034
2035 /* Free the initial process environment */
2036 Size = 0;
2037 ZwFreeVirtualMemory(NtCurrentProcess(),
2038 (PVOID*)&Environment,
2039 &Size,
2040 MEM_RELEASE);
2041
2042 /* Free the initial process parameters */
2043 Size = 0;
2044 ZwFreeVirtualMemory(NtCurrentProcess(),
2045 (PVOID*)&ProcessParameters,
2046 &Size,
2047 MEM_RELEASE);
2048
2049 /* Increase init phase */
2051
2052 /* Free the boot buffer */
2053 ExFreePoolWithTag(InitBuffer, TAG_INIT);
2054}
2055
2056VOID
2057NTAPI
2059{
2060 /* Do the .INIT part of Phase 1 which we can free later */
2062
2063 /* Jump into zero page thread */
2065}
#define CODE_SEG(...)
#define ALIGN_UP_BY(size, align)
unsigned char BOOLEAN
Definition: actypes.h:127
LONG NTSTATUS
Definition: precomp.h:26
#define DPRINT1
Definition: precomp.h:8
#define CHAR(Char)
DECLSPEC_NORETURN VOID NTAPI KeBugCheckEx(IN ULONG BugCheckCode, IN ULONG_PTR BugCheckParameter1, IN ULONG_PTR BugCheckParameter2, IN ULONG_PTR BugCheckParameter3, IN ULONG_PTR BugCheckParameter4)
Definition: debug.c:485
PVOID MmHighestUserAddress
Definition: libsupp.c:23
static CCHAR DebugString[256]
Definition: settings.c:16
VOID NTAPI FinalizeBootLogo(VOID)
Definition: bootanim.c:799
VOID NTAPI DisplayBootBitmap(_In_ BOOLEAN TextMode)
Definition: bootanim.c:507
DECLSPEC_NORETURN VOID NTAPI KeBugCheck(ULONG BugCheckCode)
Definition: bug.c:1434
_In_z_ PCHAR TargetString
Definition: cdrom.h:954
Definition: bufpool.h:45
CM_SYSTEM_CONTROL_VECTOR CmControlVector[]
VOID NTAPI CmGetSystemControlValues(IN PVOID SystemHiveData, IN PCM_SYSTEM_CONTROL_VECTOR ControlVector)
Definition: cmcontrl.c:104
ULONG CmNtGlobalFlag
Definition: cmdata.c:19
BOOLEAN NTAPI CmInitSystem1(VOID)
Definition: cmsysini.c:1642
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
Definition: conport.c:36
#define STATUS_NO_MEMORY
Definition: d3dkmdt.h:51
VOID NTAPI DbgkInitialize(VOID)
Definition: dbgkobj.c:1498
LPWSTR Name
Definition: desk.c:124
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
#define RTL_CONSTANT_STRING(s)
Definition: combase.c:35
_ACRTIMP int __cdecl _snwprintf(wchar_t *, size_t, const wchar_t *,...)
Definition: wcs.c:1493
_ACRTIMP int __cdecl _memicmp(const void *, const void *, size_t)
Definition: string.c:3485
_ACRTIMP __msvcrt_long __cdecl atol(const char *)
Definition: string.c:1782
_ACRTIMP size_t __cdecl strlen(const char *)
Definition: string.c:1592
_ACRTIMP char *__cdecl strstr(const char *, const char *)
Definition: string.c:3415
_ACRTIMP int __cdecl strncmp(const char *, const char *, size_t)
Definition: string.c:3330
#define L(x)
Definition: resources.c:13
#define ULONG_PTR
Definition: config.h:101
BOOLEAN RtlTimeFieldsToTime(IN PTIME_FIELDS TimeFields, IN PLARGE_INTEGER Time)
#define ExLocalTimeToSystemTime(LocTime, SysTime)
Definition: env_spec_w32.h:738
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
NTSTATUS ExInitializeResourceLite(PULONG res)
Definition: env_spec_w32.h:641
#define PAGE_SIZE
Definition: env_spec_w32.h:49
NTSTATUS RtlAppendUnicodeToString(IN PUNICODE_STRING Str1, IN PWSTR Str2)
Definition: string_lib.cpp:62
#define NonPagedPool
Definition: env_spec_w32.h:307
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
BOOLEAN NTAPI ExpInitializeEventPairImplementation(VOID)
Definition: evtpair.c:33
BOOLEAN NTAPI ExpInitializeKeyedEventImplementation(VOID)
#define MAXIMUM_PROCESSORS
Definition: rwlock.h:5
_Inout_opt_ PUNICODE_STRING Extension
Definition: fltkernel.h:1092
std::wstring STRING
Definition: fontsub.cpp:33
BOOLEAN NTAPI FsRtlInitSystem(VOID)
Definition: fsrtlpc.c:161
BOOLEAN NTAPI CcInitializeCacheManager(VOID)
Definition: fssup.c:83
VOID NTAPI CcPfInitializePrefetcher(VOID)
Definition: fssup.c:114
Status
Definition: gdiplustypes.h:25
GLfloat GLfloat p
Definition: glext.h:8902
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
BOOLEAN NTAPI HalAllProcessorsStarted(VOID)
Definition: processor.c:60
VOID NTAPI HalReportResourceUsage(VOID)
Definition: usage.c:67
#define KeGetCurrentThread
Definition: hal.h:55
BOOLEAN NTAPI HalInitSystem(_In_ ULONG BootPhase, _In_ PLOADER_PARAMETER_BLOCK LoaderBlock)
Definition: halinit.c:45
VOID NTAPI HeadlessInit(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
Definition: hdlsterm.c:189
#define VER_PRODUCTBETA_STR
Definition: ieverp.h:10
#define VER_PRODUCTBUILD
Definition: ieverp.h:6
VOID NTAPI InbvNotifyDisplayOwnershipLost(_In_ INBV_RESET_DISPLAY_PARAMETERS Callback)
Definition: inbv.c:410
BOOLEAN InbvBootDriverInstalled
Definition: inbv.c:39
VOID NTAPI InbvEnableBootDriver(_In_ BOOLEAN Enable)
Definition: inbv.c:261
VOID NTAPI InbvSetProgressBarSubset(_In_ ULONG Floor, _In_ ULONG Ceiling)
Specifies a progress percentage sub-range. Further calls to InbvIndicateProgress() or InbvUpdateProgr...
Definition: inbv.c:670
BOOLEAN NTAPI InbvEnableDisplayString(_In_ BOOLEAN Enable)
Definition: inbv.c:376
BOOLEAN NTAPI InbvDriverInitialize(_In_ PLOADER_PARAMETER_BLOCK LoaderBlock, _In_ ULONG Count)
Definition: inbv.c:179
VOID NTAPI InbvUpdateProgressBar(_In_ ULONG Percentage)
Updates the progress bar percentage, relative to the current percentage sub-range previously set by I...
Definition: inbv.c:696
BOOLEAN NTAPI InbvDisplayString(_In_ PCSTR String)
Definition: inbv.c:335
#define FLG_KERNEL_STACK_TRACE_DB
Definition: pstypes.h:63
#define FLG_ENABLE_EXCEPTION_LOGGING
Definition: pstypes.h:77
#define FLG_ENABLE_CLOSE_EXCEPTIONS
Definition: pstypes.h:76
#define FLG_ENABLE_KDEBUG_SYMBOL_LOAD
Definition: pstypes.h:68
#define HIGH_PRIORITY
VOID ExpInitLookasideLists()
BOOLEAN NTAPI KdInitSystem(_In_ ULONG BootPhase, _In_opt_ PLOADER_PARAMETER_BLOCK LoaderBlock)
Definition: kdinit.c:164
BOOLEAN KdBreakAfterSymbolLoad
Definition: kddata.c:79
LONG KdpTimeSlipPending
Definition: kddata.c:118
NTSTATUS NTAPI KdDebuggerInitialize1(IN PLOADER_PARAMETER_BLOCK LoaderBlock OPTIONAL)
Definition: kdcom.c:236
PLOADER_PARAMETER_BLOCK KeLoaderBlock
Definition: krnlinit.c:28
#define REG_SZ
Definition: layer.c:22
WCHAR StringBuffer[156]
Definition: ldrinit.c:41
VOID NTAPI ExInitPoolLookasidePointers(VOID)
Definition: lookas.c:59
BOOLEAN NTAPI LpcInitSystem(VOID)
Definition: port.c:37
#define PCHAR
Definition: match.c:90
#define ASSERT(a)
Definition: mode.c:44
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1109
PVOID PVOID PWCHAR PVOID Environment
Definition: env.c:47
#define sprintf
Definition: sprintf.c:45
static const char * ImageName
Definition: image.c:34
#define InitializeObjectAttributes(p, n, a, r, s)
Definition: reg.c:115
static PTIME_FIELDS TimeFields
Definition: time.c:36
BOOLEAN NTAPI ExpInitializeMutantImplementation(VOID)
Definition: mutant.c:52
_Must_inspect_result_ _Out_ PNDIS_STATUS _In_ NDIS_HANDLE _In_ ULONG _Out_ PNDIS_STRING _Out_ PNDIS_HANDLE KeyHandle
Definition: ndis.h:4715
_In_ ACCESS_MASK _In_ POBJECT_ATTRIBUTES _Reserved_ ULONG _In_opt_ PUNICODE_STRING _In_ ULONG _Out_opt_ PULONG Disposition
Definition: cmfuncs.h:56
NTSYSAPI NTSTATUS NTAPI ZwDisplayString(_In_ PUNICODE_STRING DisplayString)
#define KernelMode
Definition: asm.h:38
#define DBG_STATUS_CONTROL_C
Definition: kdtypes.h:39
NTSYSAPI NTSTATUS NTAPI ZwSetSystemTime(_In_ PLARGE_INTEGER SystemTime, _In_opt_ PLARGE_INTEGER NewSystemTime)
FORCEINLINE VOID KiWriteSystemTime(_Out_ volatile KSYSTEM_TIME *SystemTime, _In_ LARGE_INTEGER NewTime)
Definition: kefuncs.h:429
_In_ HANDLE _Outptr_result_bytebuffer_ ViewSize PVOID _In_ ULONG_PTR _In_ SIZE_T _Inout_opt_ PLARGE_INTEGER SectionOffset
Definition: mmfuncs.h:407
_In_ HANDLE _Outptr_result_bytebuffer_ ViewSize PVOID _In_ ULONG_PTR _In_ SIZE_T _Inout_opt_ PLARGE_INTEGER _Inout_ PSIZE_T ViewSize
Definition: mmfuncs.h:408
#define SEC_COMMIT
Definition: mmtypes.h:100
NTSYSAPI NTSTATUS NTAPI ZwClose(_In_ HANDLE Handle)
NTSYSAPI NTSTATUS NTAPI ZwResumeThread(_In_ HANDLE ThreadHandle, _Out_opt_ PULONG SuspendCount)
NTSYSAPI VOID NTAPI RtlInitNlsTables(_In_ PUSHORT AnsiTableBase, _In_ PUSHORT OemTableBase, _In_ PUSHORT CaseTableBase, _Out_ PNLSTABLEINFO NlsTable)
NTSYSAPI VOID NTAPI RtlResetRtlTranslations(_In_ PNLSTABLEINFO NlsTable)
NTSYSAPI NTSTATUS NTAPI RtlCreateUserProcess(_In_ PUNICODE_STRING ImageFileName, _In_ ULONG Attributes, _In_ PRTL_USER_PROCESS_PARAMETERS ProcessParameters, _In_opt_ PSECURITY_DESCRIPTOR ProcessSecutityDescriptor, _In_opt_ PSECURITY_DESCRIPTOR ThreadSecurityDescriptor, _In_opt_ HANDLE ParentProcess, _In_ BOOLEAN CurrentDirectory, _In_opt_ HANDLE DebugPort, _In_opt_ HANDLE ExceptionPort, _Out_ PRTL_USER_PROCESS_INFORMATION ProcessInfo)
NTSYSAPI BOOLEAN NTAPI RtlCreateUnicodeStringFromAsciiz(_Out_ PUNICODE_STRING Destination, _In_ PCSZ Source)
NTSYSAPI NTSTATUS NTAPI RtlFindMessage(_In_ PVOID BaseAddress, _In_ ULONG Type, _In_ ULONG Language, _In_ ULONG MessageId, _Out_ PMESSAGE_RESOURCE_ENTRY *MessageResourceEntry)
NTSYSAPI PRTL_USER_PROCESS_PARAMETERS NTAPI RtlDeNormalizeProcessParams(_In_ PRTL_USER_PROCESS_PARAMETERS ProcessParameters)
VOID NTAPI DbgLoadImageSymbols(_In_ PSTRING Name, _In_ PVOID Base, _In_ ULONG_PTR ProcessId)
#define RTL_USER_PROCESS_PARAMETERS_RESERVE_1MB
Definition: rtltypes.h:46
#define RTL_USER_PROCESS_PARAMETERS_NORMALIZED
Definition: rtltypes.h:41
#define _In_
Definition: no_sal2.h:158
int Count
Definition: noreturn.cpp:7
NTSYSAPI VOID NTAPI RtlCopyUnicodeString(PUNICODE_STRING DestinationString, PUNICODE_STRING SourceString)
#define SYMBOLIC_LINK_ALL_ACCESS
Definition: nt_native.h:1270
NTSYSAPI NTSTATUS NTAPI NtSetValueKey(IN HANDLE KeyHandle, IN PUNICODE_STRING ValueName, IN ULONG TitleIndex OPTIONAL, IN ULONG Type, IN PVOID Data, IN ULONG DataSize)
Definition: ntapi.c:859
@ KeyValuePartialInformation
Definition: nt_native.h:1185
NTSYSAPI NTSTATUS NTAPI RtlAppendUnicodeStringToString(PUNICODE_STRING Destination, PUNICODE_STRING Source)
NTSYSAPI VOID NTAPI RtlInitString(PSTRING DestinationString, PCSZ SourceString)
#define PAGE_READWRITE
Definition: nt_native.h:1307
#define KEY_ALL_ACCESS
Definition: nt_native.h:1044
#define SECTION_ALL_ACCESS
Definition: nt_native.h:1296
NTSYSAPI NTSTATUS NTAPI RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString, PANSI_STRING SourceString, BOOLEAN AllocateDestinationString)
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define NtCurrentProcess()
Definition: nt_native.h:1660
NTSYSAPI NTSTATUS NTAPI NtQueryValueKey(IN HANDLE KeyHandle, IN PUNICODE_STRING ValueName, IN KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass, IN PVOID KeyValueInformation, IN ULONG Length, IN PULONG ResultLength)
@ ViewShare
Definition: nt_native.h:1281
NTSTATUS NTAPI NtClose(IN HANDLE Handle)
Definition: obhandle.c:3402
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
#define MEM_RESERVE
Definition: nt_native.h:1317
#define MEM_RELEASE
Definition: nt_native.h:1319
#define DIRECTORY_ALL_ACCESS
Definition: nt_native.h:1262
#define MEM_COMMIT
Definition: nt_native.h:1316
#define REG_OPTION_VOLATILE
Definition: nt_native.h:1063
NTSYSAPI VOID NTAPI RtlInitAnsiString(PANSI_STRING DestinationString, PCSZ SourceString)
#define Int32x32To64(a, b)
#define UNICODE_NULL
#define ANSI_NULL
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
BOOLEAN NTAPI ExpInitializeCallbacks(VOID)
Definition: callback.c:256
BOOLEAN NTAPI ExpInitializeEventImplementation(VOID)
Definition: event.c:39
VOID NTAPI ExpInitializeHandleTables(VOID)
Definition: handle.c:34
SIZE_T ExpNlsTableSize
Definition: init.c:89
ULONG ExpInitializationPhase
Definition: init.c:68
VOID NTAPI ExBurnMemory(IN PLOADER_PARAMETER_BLOCK LoaderBlock, IN ULONG_PTR PagesToDestroy, IN TYPE_OF_MEMORY MemoryType)
Definition: init.c:882
ULONG CmNtCSDReleaseType
Definition: init.c:60
PVOID ExpNlsTableBase
Definition: init.c:85
ULONG NTAPI ExComputeTickCountMultiplier(IN ULONG ClockIncrement)
Definition: init.c:606
BOOLEAN InitWinPEModeType
Definition: init.c:72
BOOLEAN IoRemoteBootClient
Definition: init.c:70
BOOLEAN NTAPI ExpInitSystemPhase0(VOID)
Definition: init.c:639
BOOLEAN ExCmosClockIsSane
Definition: init.c:93
UNICODE_STRING NtSystemRoot
Definition: init.c:76
ULONG NtBuildNumber
Definition: init.c:50
NTSTATUS NTAPI ExpCreateSystemRootLink(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
Definition: init.c:101
ULONG ExpOemCodePageDataOffset
Definition: init.c:86
NLSTABLEINFO ExpNlsTableInfo
Definition: init.c:88
struct _INIT_BUFFER INIT_BUFFER
BOOLEAN NTAPI ExpIsLoaderValid(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
Definition: init.c:770
ULONG NtMajorVersion
Definition: init.c:45
ULONG ExpUnicodeCaseTableDataOffset
Definition: init.c:87
WCHAR NtInitialUserProcessBuffer[128]
Definition: init.c:79
BOOLEAN NTAPI MmArmInitSystem(IN ULONG Phase, IN PLOADER_PARAMETER_BLOCK LoaderBlock)
Definition: mminit.c:2049
struct _INIT_BUFFER * PINIT_BUFFER
CHAR NtBuildLab[]
Definition: init.c:64
ULONG NtGlobalFlag
Definition: init.c:54
#define LOADER_PARAMETER_EXTENSION_MIN_SIZE
Definition: init.c:20
VOID NTAPI MmFreeLoaderBlock(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
Definition: mminit.c:1085
UNICODE_STRING CmVersionString
Definition: init.c:61
ULONG ExSuiteMask
Definition: init.c:55
PVOID ExpNlsSectionPointer
Definition: init.c:90
ULONG CmNtSpBuildNumber
Definition: init.c:58
BOOLEAN NTAPI ExpInitSystemPhase1(VOID)
Definition: init.c:663
BOOLEAN ExpInTextModeSetup
Definition: init.c:69
ULONG NtInitialUserProcessBufferType
Definition: init.c:82
ULONG ExpAnsiCodePageDataOffset
Definition: init.c:86
ULONG NtMinorVersion
Definition: init.c:46
VOID NTAPI ExpLoadInitialProcess(IN PINIT_BUFFER InitBuffer, OUT PRTL_USER_PROCESS_PARAMETERS *ProcessParameters, OUT PCHAR *ProcessEnvironment)
Definition: init.c:389
ULONG CmNtCSDVersion
Definition: init.c:59
VOID NTAPI ExpInitNls(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
Definition: init.c:213
VOID NTAPI ExpInitializeExecutive(IN ULONG Cpu, IN PLOADER_PARAMETER_BLOCK LoaderBlock)
Definition: init.c:928
VOID NTAPI Phase1Initialization(IN PVOID Context)
Definition: init.c:2058
UNICODE_STRING CmCSDVersionString
Definition: init.c:62
VOID NTAPI Phase1InitializationDiscard(IN PVOID Context)
Definition: init.c:1351
BOOLEAN NTAPI ExInitSystem(VOID)
Definition: init.c:744
BOOLEAN ExpRealTimeIsUniversal
Definition: init.c:94
BOOLEAN SosEnabled
Definition: init.c:73
ULONG NtInitialUserProcessBufferLength
Definition: init.c:80
ULONG InitSafeBootMode
Definition: init.c:71
BOOLEAN InitIsWinPEMode
Definition: init.c:72
BOOLEAN NTAPI ExpInitializeProfileImplementation(VOID)
Definition: profile.c:62
VOID NTAPI ExpResourceInitialization(VOID)
Definition: resource.c:173
LIST_ENTRY ExpFirmwareTableProviderListHead
Definition: sysinfo.c:31
FAST_MUTEX ExpEnvironmentLock
Definition: sysinfo.c:29
ERESOURCE ExpFirmwareTableResource
Definition: sysinfo.c:30
LARGE_INTEGER ExpTimeZoneBias
Definition: time.c:23
ERESOURCE ExpTimeRefreshLock
Definition: time.c:27
ULONG ExpAltTimeZoneBias
Definition: time.c:24
ULONG ExpTickCountMultiplier
Definition: time.c:26
ULONG ExpLastTimeZoneBias
Definition: time.c:22
BOOLEAN NTAPI ExRefreshTimeZoneInformation(IN PLARGE_INTEGER CurrentBootTime)
Definition: time.c:320
BOOLEAN NTAPI ExpInitializeTimerImplementation(VOID)
Definition: timer.c:223
BOOLEAN NTAPI ExpUuidInitialization(VOID)
Definition: uuid.c:53
#define MM_HIGHEST_USER_ADDRESS_WOW64
Definition: mm.h:35
#define MM_SYSTEM_RANGE_START_WOW64
Definition: mm.h:36
#define MmSystemRangeStart
Definition: mm.h:32
VOID NTAPI KeI386VdmInitialize(VOID)
Definition: vdmmain.c:42
BOOLEAN NTAPI IoInitSystem(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
Definition: iomgr.c:466
BOOLEAN NTAPI PpInitSystem(VOID)
Definition: pnpmgr.c:1142
VOID NTAPI KeSetSystemTime(IN PLARGE_INTEGER NewSystemTime, OUT PLARGE_INTEGER OldSystemTime, IN BOOLEAN FixInterruptTime, IN PLARGE_INTEGER HalTime)
Definition: clock.c:28
VOID NTAPI KiInitializeBugCheck(VOID)
Definition: bug.c:300
ULONGLONG KeBootTimeBias
Definition: clock.c:18
BOOLEAN NTAPI KeInitSystem(VOID)
Definition: krnlinit.c:292
VOID NTAPI KeStartAllProcessors(VOID)
Definition: mproc.c:20
ULONG KiServiceLimit
Definition: krnlinit.c:25
LARGE_INTEGER KeBootTime
Definition: clock.c:17
PFN_COUNT MmNumberOfPhysicalPages
Definition: init.c:48
VOID NTAPI MmZeroPageThread(VOID)
Definition: zeropage.c:36
BOOLEAN NTAPI MmInitSystem(IN ULONG Phase, IN PLOADER_PARAMETER_BLOCK LoaderBlock)
Definition: mminit.c:217
VOID NTAPI RtlInitializeRangeListPackage(VOID)
Definition: libsupp.c:62
BOOLEAN NTAPI SeInitSystem(VOID)
Main security manager initialization function.
Definition: semgr.c:285
PSECURITY_DESCRIPTOR SePublicDefaultUnrestrictedSd
Definition: sd.c:17
BOOLEAN NTAPI SeRmInitPhase1(VOID)
Manages the phase 1 initialization of the security reference monitoring module of the kernel.
Definition: srm.c:212
#define MAX_WIN32_PATH
Definition: ntoskrnl.h:125
#define IDB_MAX_RESOURCES
Definition: resource.h:55
ULONG KeMaximumIncrement
Definition: clock.c:20
CCHAR KeNumberProcessors
Definition: processor.c:19
HANDLE NTAPI PsGetCurrentProcessId(VOID)
Definition: process.c:1123
NTSTRSAFEVAPI RtlStringCbPrintfA(_Out_writes_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, _In_ size_t cbDest, _In_ _Printf_format_string_ NTSTRSAFE_PCSTR pszFormat,...)
Definition: ntstrsafe.h:1148
NTSTRSAFEAPI RtlStringCbCatExA(_Inout_updates_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, _In_ size_t cbDest, _In_ NTSTRSAFE_PCSTR pszSrc, _Outptr_opt_result_bytebuffer_(*pcbRemaining) NTSTRSAFE_PSTR *ppszDestEnd, _Out_opt_ size_t *pcbRemaining, _In_ STRSAFE_DWORD dwFlags)
Definition: ntstrsafe.h:718
NTSTRSAFEVAPI RtlStringCbPrintfExA(_Out_writes_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, _In_ size_t cbDest, _Outptr_opt_result_bytebuffer_(*pcbRemaining) NTSTRSAFE_PSTR *ppszDestEnd, _Out_opt_ size_t *pcbRemaining, _In_ STRSAFE_DWORD dwFlags, _In_ _Printf_format_string_ NTSTRSAFE_PCSTR pszFormat,...)
Definition: ntstrsafe.h:1294
NTSTRSAFEAPI RtlStringCbCopyExA(_Out_writes_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, _In_ size_t cbDest, _In_ NTSTRSAFE_PCSTR pszSrc, _Outptr_opt_result_bytebuffer_(*pcbRemaining) STRSAFE_LPSTR *ppszDestEnd, _Out_opt_ size_t *pcbRemaining, _In_ STRSAFE_DWORD dwFlags)
Definition: ntstrsafe.h:270
NTSTRSAFEAPI RtlStringCbCopyA(_Out_writes_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, _In_ size_t cbDest, _In_ NTSTRSAFE_PCSTR pszSrc)
Definition: ntstrsafe.h:156
#define VER_PRODUCTMAJORVERSION
Definition: ntverp.h:25
#define VER_PRODUCTBUILD_QFE
Definition: ntverp.h:20
#define VER_PRODUCTMINORVERSION
Definition: ntverp.h:26
BOOLEAN NTAPI ObInitSystem(VOID)
Definition: obinit.c:203
NTSTATUS NTAPI NtCreateDirectoryObject(OUT PHANDLE DirectoryHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes)
Definition: obdir.c:765
NTSTATUS NTAPI ObCloseHandle(IN HANDLE Handle, IN KPROCESSOR_MODE AccessMode)
Definition: obhandle.c:3379
NTSTATUS NTAPI ObReferenceObjectByHandle(IN HANDLE Handle, IN ACCESS_MASK DesiredAccess, IN POBJECT_TYPE ObjectType, IN KPROCESSOR_MODE AccessMode, OUT PVOID *Object, OUT POBJECT_HANDLE_INFORMATION HandleInformation OPTIONAL)
Definition: obref.c:494
short WCHAR
Definition: pedump.c:58
#define RT_MESSAGETABLE
Definition: pedump.c:373
unsigned short USHORT
Definition: pedump.c:61
char CHAR
Definition: pedump.c:57
static ULONG Timeout
Definition: ping.c:61
static PCWSTR TargetName
Definition: ping.c:67
BOOLEAN NTAPI PoInitSystem(IN ULONG BootPhase)
Definition: power.c:397
VOID NTAPI PoNotifySystemTimeSet(VOID)
Definition: events.c:39
KSERVICE_TABLE_DESCRIPTOR KeServiceDescriptorTable[SSDT_MAX_ENTRIES]
Definition: procobj.c:23
KSERVICE_TABLE_DESCRIPTOR KeServiceDescriptorTableShadow[SSDT_MAX_ENTRIES]
Definition: procobj.c:24
BOOLEAN NTAPI PsInitSystem(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
Definition: psmgr.c:532
#define OBJ_CASE_INSENSITIVE
Definition: winternl.h:228
#define OBJ_PERMANENT
Definition: winternl.h:226
VOID NTAPI ExpInitializePushLocks(VOID)
Definition: pushlock.c:45
BOOLEAN NTAPI HalQueryRealTimeClock(IN PTIME_FIELDS Time)
Definition: rtc.c:24
#define REG_DWORD
Definition: sdbapi.c:615
#define LANG_NEUTRAL
Definition: nls.h:22
#define MAKELANGID(p, s)
Definition: nls.h:15
#define SUBLANG_NEUTRAL
Definition: nls.h:167
@ LoaderBad
Definition: arc.h:296
@ LoaderFree
Definition: arc.h:295
@ LoaderFirmwareTemporary
Definition: arc.h:298
@ LoaderNlsData
Definition: arc.h:314
enum _TYPE_OF_MEMORY TYPE_OF_MEMORY
_strupr
Definition: string.h:453
void __cdecl _enable(void)
Definition: intrin_arm.h:373
#define KI_USER_SHARED_DATA
#define SharedUserData
NTSTATUS NTAPI MmMapViewInSystemSpace(IN PVOID SectionObject, OUT PVOID *MappedBase, IN OUT PSIZE_T ViewSize)
Definition: section.c:4498
NTSTATUS NTAPI MmMapViewOfSection(IN PVOID SectionObject, IN PEPROCESS Process, IN OUT PVOID *BaseAddress, IN ULONG_PTR ZeroBits, IN SIZE_T CommitSize, IN OUT PLARGE_INTEGER SectionOffset OPTIONAL, IN OUT PSIZE_T ViewSize, IN SECTION_INHERIT InheritDisposition, IN ULONG AllocationType, IN ULONG Protect)
Definition: section.c:4027
POBJECT_TYPE MmSectionObjectType
Definition: section.c:192
BOOLEAN NTAPI ExpInitializeSemaphoreImplementation(VOID)
Definition: sem.c:43
#define SETUPLDR_REMOTE_BOOT
Definition: setupblk.h:8
#define SETUPLDR_TEXT_MODE
Definition: setupblk.h:7
#define STATUS_SUCCESS
Definition: shellext.h:65
#define STATUS_BUFFER_OVERFLOW
Definition: shellext.h:66
_In_ PVOID Context
Definition: storport.h:2269
UNICODE_STRING DosPath
Definition: rtltypes.h:1362
RTL_USER_PROCESS_INFORMATION ProcessInfo
Definition: init.c:38
CHAR VersionBuffer[256]
Definition: init.c:35
CHAR VersionNumber[24]
Definition: init.c:37
Definition: btrfs_drv.h:1876
UNICODE_STRING FullDllName
Definition: btrfs_drv.h:1882
PVOID DllBase
Definition: btrfs_drv.h:1880
UNICODE_STRING BaseDllName
Definition: ldrtypes.h:149
Definition: typedefs.h:120
struct _LIST_ENTRY * Blink
Definition: typedefs.h:122
struct _LIST_ENTRY * Flink
Definition: typedefs.h:121
LIST_ENTRY LoadOrderListHead
Definition: arc.h:820
TYPE_OF_MEMORY MemoryType
Definition: arc.h:328
Definition: rtltypes.h:1932
UCHAR Text[ANYSIZE_ARRAY]
Definition: rtltypes.h:1935
PVOID UnicodeCodePageData
Definition: arc.h:401
PVOID AnsiCodePageData
Definition: arc.h:399
PVOID OemCodePageData
Definition: arc.h:400
UNICODE_STRING CommandLine
Definition: btrfs_drv.h:1902
UNICODE_STRING ImagePathName
Definition: btrfs_drv.h:1901
USHORT MaximumLength
Definition: env_spec_w32.h:370
#define TAG_RTLI
Definition: tag.h:28
#define TAG_INIT
Definition: tag.h:27
KPRIORITY NTAPI KeSetPriorityThread(IN PKTHREAD Thread, IN KPRIORITY Priority)
Definition: thrdobj.c:1300
uint16_t * PWSTR
Definition: typedefs.h:56
#define MAXULONG
Definition: typedefs.h:251
uint32_t * PULONG
Definition: typedefs.h:59
char * PSTR
Definition: typedefs.h:51
#define NTAPI
Definition: typedefs.h:36
ULONG_PTR SIZE_T
Definition: typedefs.h:80
const char * PCSTR
Definition: typedefs.h:52
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
uint32_t ULONG_PTR
Definition: typedefs.h:65
#define IN
Definition: typedefs.h:39
uint16_t * PWCHAR
Definition: typedefs.h:56
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
uint32_t ULONG
Definition: typedefs.h:59
#define OUT
Definition: typedefs.h:40
char * PCHAR
Definition: typedefs.h:51
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
__analysis_noreturn NTSYSAPI VOID NTAPI DbgBreakPointWithStatus(_In_ ULONG Status)
short CSHORT
Definition: umtypes.h:127
LONGLONG QuadPart
Definition: typedefs.h:114
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4539
_Must_inspect_result_ _In_ WDFDEVICE _In_ PCUNICODE_STRING KeyName
Definition: wdfdevice.h:2705
BOOLEAN NTAPI ExpWin32kInit(VOID)
Definition: win32k.c:259
BOOLEAN SafeBoot
Definition: winldr.c:35
VOID NTAPI ExpInitializeWorkerThreads(VOID)
Definition: work.c:522
FORCEINLINE VOID ExInitializeFastMutex(_Out_ PFAST_MUTEX FastMutex)
Definition: exfuncs.h:274
#define PsGetCurrentProcess
Definition: psfuncs.h:17
VOID NTAPI XIPInit(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
Definition: xipdisp.c:55