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