ReactOS  0.4.15-dev-316-g938df97
inbv.c
Go to the documentation of this file.
1 /* INCLUDES ******************************************************************/
2 
3 #include <ntoskrnl.h>
4 
5 #define NDEBUG
6 #include <debug.h>
7 
8 #include "inbv/logo.h"
9 
10 /* See also mm/ARM3/miarm.h */
11 #define MM_READONLY 1 // PAGE_READONLY
12 #define MM_READWRITE 4 // PAGE_WRITECOPY
13 
14 #ifndef TAG_OSTR
15 #define TAG_OSTR 'RTSO'
16 #endif
17 
18 /* GLOBALS *******************************************************************/
19 
20 /*
21  * Enable this define if you want Inbv to use coloured headless mode.
22  */
23 // #define INBV_HEADLESS_COLORS
24 
25 /*
26  * ReactOS uses the same boot screen for all the products.
27  * Also it doesn't use a parallel system thread for the
28  * rotating "progress" bar.
29  */
30 
31 /*
32  * Enable this define when ReactOS will have different SKUs
33  * (Workstation, Server, Storage Server, Cluster Server, etc...).
34  */
35 // #define REACTOS_SKUS
36 
37 typedef struct _INBV_PROGRESS_STATE
38 {
43 
44 typedef struct _BT_PROGRESS_INDICATOR
45 {
50 
51 typedef enum _ROT_BAR_TYPE
52 {
56 } ROT_BAR_TYPE;
57 
58 /*
59  * BitBltAligned() alignments
60  */
62 {
67 
69 {
74 
75 /*
76  * Enable this define when Inbv will support rotating progress bar.
77  */
78 #define INBV_ROTBAR_IMPLEMENTED
79 
92 static ULONG ResourceCount = 0;
93 static PUCHAR ResourceList[1 + IDB_MAX_RESOURCE]; // First entry == NULL, followed by 'ResourceCount' entries.
94 
95 #ifdef INBV_ROTBAR_IMPLEMENTED
96 /*
97  * Change this to modify progress bar behaviour
98  */
99 #define ROT_BAR_DEFAULT_MODE RB_PROGRESS_BAR
100 
101 /*
102  * Values for PltRotBarStatus:
103  * - PltRotBarStatus == 1, do palette fading-in (done elsewhere in ReactOS);
104  * - PltRotBarStatus == 2, do rotation bar animation;
105  * - PltRotBarStatus == 3, stop the animation thread.
106  * - Any other value is ignored and the animation thread continues to run.
107  */
108 typedef enum _ROT_BAR_STATUS
109 {
115 
119 static UCHAR RotBarBuffer[24 * 9];
121 #endif
122 
123 
124 /*
125  * Headless terminal text colors
126  */
127 
128 #ifdef INBV_HEADLESS_COLORS
129 
130 // Conversion table CGA to ANSI color index
131 static const UCHAR CGA_TO_ANSI_COLOR_TABLE[16] =
132 {
133  0, // Black
134  4, // Blue
135  2, // Green
136  6, // Cyan
137  1, // Red
138  5, // Magenta
139  3, // Brown/Yellow
140  7, // Grey/White
141 
142  60, // Bright Black
143  64, // Bright Blue
144  62, // Bright Green
145  66, // Bright Cyan
146  61, // Bright Red
147  65, // Bright Magenta
148  63, // Bright Yellow
149  67 // Bright Grey (White)
150 };
151 
152 #define CGA_TO_ANSI_COLOR(CgaColor) \
153  CGA_TO_ANSI_COLOR_TABLE[CgaColor & 0x0F]
154 
155 #endif
156 
157 // Default colors: text in white, background in black
160 
161 
162 /* FADING FUNCTION ***********************************************************/
163 
165 typedef struct tagRGBQUAD
166 {
171 } RGBQUAD,*LPRGBQUAD;
172 /*******************************/
173 
174 static RGBQUAD MainPalette[16];
175 
176 #define PALETTE_FADE_STEPS 12
177 #define PALETTE_FADE_TIME (15 * 1000) /* 15 ms */
178 
180 //
181 // Bitmap Header
182 //
183 typedef struct tagBITMAPINFOHEADER
184 {
185  ULONG biSize;
186  LONG biWidth;
187  LONG biHeight;
197 /****************************/
198 
199 //
200 // Needed prototypes
201 //
204 
205 static VOID
207 {
208  UCHAR PaletteBitmapBuffer[sizeof(BITMAPINFOHEADER) + sizeof(MainPalette)];
209  PBITMAPINFOHEADER PaletteBitmap = (PBITMAPINFOHEADER)PaletteBitmapBuffer;
210  LPRGBQUAD Palette = (LPRGBQUAD)(PaletteBitmapBuffer + sizeof(BITMAPINFOHEADER));
211  ULONG Iteration, Index, ClrUsed;
212 
213  LARGE_INTEGER Delay;
214  Delay.QuadPart = -(PALETTE_FADE_TIME * 10);
215 
216  /* Check if we are installed and we own the display */
219  {
220  return;
221  }
222 
223  /*
224  * Build a bitmap containing the fade-in palette. The palette entries
225  * are then processed in a loop and set using VidBitBlt function.
226  */
227  ClrUsed = RTL_NUMBER_OF(MainPalette);
228  RtlZeroMemory(PaletteBitmap, sizeof(BITMAPINFOHEADER));
229  PaletteBitmap->biSize = sizeof(BITMAPINFOHEADER);
230  PaletteBitmap->biBitCount = 4;
231  PaletteBitmap->biClrUsed = ClrUsed;
232 
233  /*
234  * Main animation loop.
235  */
236  for (Iteration = 0; Iteration <= PALETTE_FADE_STEPS; ++Iteration)
237  {
238  for (Index = 0; Index < ClrUsed; Index++)
239  {
240  Palette[Index].rgbRed = (UCHAR)
241  (MainPalette[Index].rgbRed * Iteration / PALETTE_FADE_STEPS);
242  Palette[Index].rgbGreen = (UCHAR)
243  (MainPalette[Index].rgbGreen * Iteration / PALETTE_FADE_STEPS);
244  Palette[Index].rgbBlue = (UCHAR)
245  (MainPalette[Index].rgbBlue * Iteration / PALETTE_FADE_STEPS);
246  }
247 
248  /* Do the animation */
249  InbvAcquireLock();
250  VidBitBlt(PaletteBitmapBuffer, 0, 0);
251  InbvReleaseLock();
252 
253  /* Wait for a bit */
255  }
256 }
257 
258 static VOID
260  IN PVOID Image,
261  IN BOOLEAN NoPalette,
262  IN ULONG X,
263  IN ULONG Y)
264 {
265  LPRGBQUAD Palette;
266  RGBQUAD OrigPalette[RTL_NUMBER_OF(MainPalette)];
267 
268  /* If requested, remove the palette from the image */
269  if (NoPalette)
270  {
271  /* Get bitmap header and palette */
272  PBITMAPINFOHEADER BitmapInfoHeader = Image;
273  Palette = (LPRGBQUAD)((PUCHAR)Image + BitmapInfoHeader->biSize);
274 
275  /* Save the image original palette and remove palette information */
276  RtlCopyMemory(OrigPalette, Palette, sizeof(OrigPalette));
277  RtlZeroMemory(Palette, sizeof(OrigPalette));
278  }
279 
280  /* Draw the image */
281  InbvBitBlt(Image, X, Y);
282 
283  /* Restore the image original palette */
284  if (NoPalette)
285  {
286  RtlCopyMemory(Palette, OrigPalette, sizeof(OrigPalette));
287  }
288 }
289 
290 static VOID
292  IN PVOID Image,
293  IN BOOLEAN NoPalette,
294  IN BBLT_HORZ_ALIGNMENT HorizontalAlignment,
295  IN BBLT_VERT_ALIGNMENT VerticalAlignment,
296  IN ULONG MarginLeft,
297  IN ULONG MarginTop,
298  IN ULONG MarginRight,
299  IN ULONG MarginBottom)
300 {
301  PBITMAPINFOHEADER BitmapInfoHeader = Image;
302  ULONG X, Y;
303 
304  /* Calculate X */
305  switch (HorizontalAlignment)
306  {
307  case AL_HORIZONTAL_LEFT:
308  X = MarginLeft - MarginRight;
309  break;
310 
312  X = MarginLeft - MarginRight + (SCREEN_WIDTH - BitmapInfoHeader->biWidth + 1) / 2;
313  break;
314 
315  case AL_HORIZONTAL_RIGHT:
316  X = MarginLeft - MarginRight + SCREEN_WIDTH - BitmapInfoHeader->biWidth;
317  break;
318 
319  default:
320  /* Unknown */
321  return;
322  }
323 
324  /* Calculate Y */
325  switch (VerticalAlignment)
326  {
327  case AL_VERTICAL_TOP:
328  Y = MarginTop - MarginBottom;
329  break;
330 
331  case AL_VERTICAL_CENTER:
332  Y = MarginTop - MarginBottom + (SCREEN_HEIGHT - BitmapInfoHeader->biHeight + 1) / 2;
333  break;
334 
335  case AL_VERTICAL_BOTTOM:
336  Y = MarginTop - MarginBottom + SCREEN_HEIGHT - BitmapInfoHeader->biHeight;
337  break;
338 
339  default:
340  /* Unknown */
341  return;
342  }
343 
344  /* Finally draw the image */
345  BitBltPalette(Image, NoPalette, X, Y);
346 }
347 
348 /* FUNCTIONS *****************************************************************/
349 
350 INIT_FUNCTION
351 PVOID
352 NTAPI
354  IN ULONG ResourceId)
355 {
356  UNICODE_STRING UpString = RTL_CONSTANT_STRING(L"ntoskrnl.exe");
357  UNICODE_STRING MpString = RTL_CONSTANT_STRING(L"ntkrnlmp.exe");
358  PLIST_ENTRY NextEntry, ListHead;
359  PLDR_DATA_TABLE_ENTRY LdrEntry;
360  PIMAGE_RESOURCE_DATA_ENTRY ResourceDataEntry;
361  LDR_RESOURCE_INFO ResourceInfo;
363  PVOID Data = NULL;
364 
365  /* Loop the driver list */
366  ListHead = &LoaderBlock->LoadOrderListHead;
367  NextEntry = ListHead->Flink;
368  while (NextEntry != ListHead)
369  {
370  /* Get the entry */
371  LdrEntry = CONTAINING_RECORD(NextEntry,
373  InLoadOrderLinks);
374 
375  /* Check for a match */
376  if (RtlEqualUnicodeString(&LdrEntry->BaseDllName, &UpString, TRUE) ||
377  RtlEqualUnicodeString(&LdrEntry->BaseDllName, &MpString, TRUE))
378  {
379  /* Break out */
380  break;
381  }
382  }
383 
384  /* Check if we found it */
385  if (NextEntry != ListHead)
386  {
387  /* Try to find the resource */
388  ResourceInfo.Type = 2; // RT_BITMAP;
389  ResourceInfo.Name = ResourceId;
390  ResourceInfo.Language = 0;
391  Status = LdrFindResource_U(LdrEntry->DllBase,
392  &ResourceInfo,
394  &ResourceDataEntry);
395  if (NT_SUCCESS(Status))
396  {
397  /* Access the resource */
398  ULONG Size = 0;
399  Status = LdrAccessResource(LdrEntry->DllBase,
400  ResourceDataEntry,
401  &Data,
402  &Size);
403  if ((Data) && (ResourceId < 3))
404  {
406  }
407  if (!NT_SUCCESS(Status)) Data = NULL;
408  }
409  }
410 
411  /* Return the pointer */
412  return Data;
413 }
414 
415 INIT_FUNCTION
416 BOOLEAN
417 NTAPI
419  IN ULONG Count)
420 {
421  PCHAR CommandLine;
422  BOOLEAN ResetMode = FALSE; // By default do not reset the video mode
423  ULONG i;
424 
425  /* Quit if we're already installed */
426  if (InbvBootDriverInstalled) return TRUE;
427 
428  /* Initialize the lock and check the current display state */
431  {
432  /* Reset the video mode in case we do not have a custom boot logo */
433  CommandLine = (LoaderBlock->LoadOptions ? _strupr(LoaderBlock->LoadOptions) : NULL);
434  ResetMode = (CommandLine == NULL) || (strstr(CommandLine, "BOOTLOGO") == NULL);
435  }
436 
437  /* Initialize the video */
440  {
441  /* Find bitmap resources in the kernel */
443  for (i = 1; i <= ResourceCount; i++)
444  {
445  /* Do the lookup */
446  ResourceList[i] = FindBitmapResource(LoaderBlock, i);
447  }
448 
449  /* Set the progress bar ranges */
450  InbvSetProgressBarSubset(0, 100);
451  }
452 
453  /* Return install state */
455 }
456 
457 VOID
458 NTAPI
460 {
461  KIRQL OldIrql;
462 
463  /* Check if we're at dispatch level or lower */
465  if (OldIrql <= DISPATCH_LEVEL)
466  {
467  /* Loop until the lock is free */
468  while (!KeTestSpinLock(&BootDriverLock));
469 
470  /* Raise IRQL to dispatch level */
472  }
473 
474  /* Acquire the lock */
477 }
478 
479 VOID
480 NTAPI
482 {
483  KIRQL OldIrql;
484 
485  /* Capture the old IRQL */
487 
488  /* Release the driver lock */
490 
491  /* If we were at dispatch level or lower, restore the old IRQL */
493 }
494 
495 VOID
496 NTAPI
498 {
499  /* Check if we're installed */
501  {
502  /* Check for lost state */
504 
505  /* Acquire the lock */
506  InbvAcquireLock();
507 
508  /* Cleanup the screen if we own it */
510 
511  /* Set the new display state */
514 
515  /* Release the lock */
516  InbvReleaseLock();
517  }
518  else
519  {
520  /* Set the new display state */
523  }
524 }
525 
526 VOID
527 NTAPI
529 {
530  /* Check if we have a callback and we're just acquiring it now */
533  {
534  /* Call the callback */
536  }
537 
538  /* Acquire the display */
540 }
541 
542 VOID
543 NTAPI
545 {
546  /* Set the new display state */
547  InbvDisplayState = DisplayOwned ? INBV_DISPLAY_STATE_OWNED :
549 }
550 
551 BOOLEAN
552 NTAPI
554 {
555  /* Return if we own it or not */
557 }
558 
560 NTAPI
562 {
563  /* Return the actual state */
564  return InbvDisplayState;
565 }
566 
567 BOOLEAN
568 NTAPI
570 {
571  /* Make sure we own the display */
573  {
574  /* If we're not allowed, return success anyway */
575  if (!InbvDisplayDebugStrings) return TRUE;
576 
577  /* Check if a filter is installed */
579 
580  /* Acquire the lock */
581  InbvAcquireLock();
582 
583  /* Make sure we're installed and display the string */
585 
586  /* Print the string on the EMS port */
588  String,
589  strlen(String) + sizeof(ANSI_NULL),
590  NULL,
591  NULL);
592 
593  /* Release the lock */
594  InbvReleaseLock();
595 
596  /* All done */
597  return TRUE;
598  }
599 
600  /* We don't own it, fail */
601  return FALSE;
602 }
603 
604 BOOLEAN
605 NTAPI
607 {
608  BOOLEAN OldSetting;
609 
610  /* Get the old setting */
611  OldSetting = InbvDisplayDebugStrings;
612 
613  /* Update it */
615 
616  /* Return the old setting */
617  return OldSetting;
618 }
619 
620 VOID
621 NTAPI
623 {
624  /* Save the filter */
626 }
627 
628 BOOLEAN
629 NTAPI
631 {
632  /* Return driver state */
634 }
635 
636 VOID
637 NTAPI
639 {
640  /* Check if we're installed */
642  {
643  /* Acquire the lock and cleanup if we own the screen */
644  InbvAcquireLock();
646 
647  /* Set the reset callback and display state */
650 
651  /* Release the lock */
652  InbvReleaseLock();
653  }
654  else
655  {
656  /* Set the reset callback and display state */
659  }
660 }
661 
662 BOOLEAN
663 NTAPI
665 {
666  /* Check if we're installed and we own it */
669  {
670  /* Do the reset */
672  return TRUE;
673  }
674 
675  /* Nothing to reset */
676  return FALSE;
677 }
678 
679 VOID
680 NTAPI
682  IN ULONG Top,
683  IN ULONG Right,
684  IN ULONG Bottom)
685 {
686  /* Just call bootvid */
687  VidSetScrollRegion(Left, Top, Right, Bottom);
688 }
689 
690 VOID
691 NTAPI
693 {
694  HEADLESS_CMD_SET_COLOR HeadlessSetColor;
695 
696  /* Set color for EMS port */
697 #ifdef INBV_HEADLESS_COLORS
698  InbvTerminalTextColor = 30 + CGA_TO_ANSI_COLOR(Color);
699 #else
701 #endif
702  HeadlessSetColor.TextColor = InbvTerminalTextColor;
703  HeadlessSetColor.BkgdColor = InbvTerminalBkgdColor;
705  &HeadlessSetColor,
706  sizeof(HeadlessSetColor),
707  NULL,
708  NULL);
709 
710  /* Update the text color */
712 }
713 
714 VOID
715 NTAPI
717  IN ULONG Top,
718  IN ULONG Right,
719  IN ULONG Bottom,
720  IN ULONG Color)
721 {
722  HEADLESS_CMD_SET_COLOR HeadlessSetColor;
723 
724  /* Make sure we own it */
726  {
727  /* Acquire the lock */
728  InbvAcquireLock();
729 
730  /* Check if we're installed */
732  {
733  /* Call bootvid */
734  VidSolidColorFill(Left, Top, Right, Bottom, (UCHAR)Color);
735  }
736 
737  /* Set color for EMS port and clear display */
738 #ifdef INBV_HEADLESS_COLORS
739  InbvTerminalBkgdColor = 40 + CGA_TO_ANSI_COLOR(Color);
740 #else
742 #endif
743  HeadlessSetColor.TextColor = InbvTerminalTextColor;
744  HeadlessSetColor.BkgdColor = InbvTerminalBkgdColor;
746  &HeadlessSetColor,
747  sizeof(HeadlessSetColor),
748  NULL,
749  NULL);
751  NULL, 0,
752  NULL, NULL);
753 
754  /* Release the lock */
755  InbvReleaseLock();
756  }
757 }
758 
759 INIT_FUNCTION
760 VOID
761 NTAPI
763 {
764  ULONG FillCount, BoundedProgress;
765 
766  /* Make sure the progress bar is enabled, that we own and are installed */
767  if (ShowProgressBar &&
770  {
771  /* Compute fill count */
772  BoundedProgress = (InbvProgressState.Floor / 100) + Progress;
773  FillCount = ProgressBarWidth * (InbvProgressState.Bias * BoundedProgress) / 1000000;
774 
775  /* Acquire the lock */
776  InbvAcquireLock();
777 
778  /* Fill the progress bar */
781  ProgressBarLeft + FillCount,
784 
785  /* Release the lock */
786  InbvReleaseLock();
787  }
788 }
789 
790 VOID
791 NTAPI
793  IN ULONG X,
794  IN ULONG Y,
795  IN ULONG Width,
796  IN ULONG Height,
797  IN ULONG Delta)
798 {
799  /* Check if we're installed and we own it */
802  {
803  /* Do the blit */
804  VidBufferToScreenBlt(Buffer, X, Y, Width, Height, Delta);
805  }
806 }
807 
808 VOID
809 NTAPI
811  IN ULONG X,
812  IN ULONG Y)
813 {
814  /* Check if we're installed and we own it */
817  {
818  /* Acquire the lock */
819  InbvAcquireLock();
820 
821  /* Do the blit */
822  VidBitBlt(Buffer, X, Y);
823 
824  /* Release the lock */
825  InbvReleaseLock();
826  }
827 }
828 
829 VOID
830 NTAPI
832  IN ULONG X,
833  IN ULONG Y,
834  IN ULONG Width,
835  IN ULONG Height,
836  IN ULONG Delta)
837 {
838  /* Check if we're installed and we own it */
841  {
842  /* Do the blit */
843  VidScreenToBufferBlt(Buffer, X, Y, Width, Height, Delta);
844  }
845 }
846 
847 INIT_FUNCTION
848 VOID
849 NTAPI
851  IN ULONG Top,
852  IN ULONG Width,
853  IN ULONG Height)
854 {
855  /* Update the coordinates */
856  ProgressBarLeft = Left;
858  ProgressBarWidth = Width;
859  ProgressBarHeight = Height;
860 
861  /* Enable the progress bar */
863 }
864 
865 INIT_FUNCTION
866 VOID
867 NTAPI
869  IN ULONG Ceiling)
870 {
871  /* Sanity checks */
872  ASSERT(Floor < Ceiling);
873  ASSERT(Ceiling <= 100);
874 
875  /* Update the progress bar state */
876  InbvProgressState.Floor = Floor * 100;
877  InbvProgressState.Ceiling = Ceiling * 100;
878  InbvProgressState.Bias = (Ceiling * 100) - Floor;
879 }
880 
881 INIT_FUNCTION
882 VOID
883 NTAPI
885 {
886  ULONG Percentage;
887 
888  /* Increase progress */
890 
891  /* Compute new percentage */
892  Percentage = min(100 * InbvProgressIndicator.Count /
894  99);
895  if (Percentage != InbvProgressIndicator.Percentage)
896  {
897  /* Percentage has moved, update the progress bar */
898  InbvProgressIndicator.Percentage = Percentage;
899  InbvUpdateProgressBar(Percentage);
900  }
901 }
902 
903 PUCHAR
904 NTAPI
906 {
907  /* Validate the resource number */
908  if (ResourceNumber > ResourceCount) return NULL;
909 
910  /* Return the address */
911  return ResourceList[ResourceNumber];
912 }
913 
914 NTSTATUS
915 NTAPI
917 {
919  UNICODE_STRING CapturedString;
921  ULONG OemLength;
923 
924  PAGED_CODE();
925 
927 
928  /* We require the TCB privilege */
931 
932  /* Capture the string */
934  if (!NT_SUCCESS(Status))
935  return Status;
936 
937  /* Do not display the string if it is empty */
938  if (CapturedString.Length == 0 || CapturedString.Buffer == NULL)
939  {
941  goto Quit;
942  }
943 
944  /*
945  * Convert the string since INBV understands only ANSI/OEM. Allocate the
946  * string buffer in non-paged pool because INBV passes it down to BOOTVID.
947  * We cannot perform the allocation using RtlUnicodeStringToOemString()
948  * since its allocator uses PagedPool.
949  */
950  OemLength = RtlUnicodeStringToOemSize(&CapturedString);
951  if (OemLength > MAXUSHORT)
952  {
954  goto Quit;
955  }
956  RtlInitEmptyAnsiString((PANSI_STRING)&OemString, NULL, (USHORT)OemLength);
958  if (OemString.Buffer == NULL)
959  {
961  goto Quit;
962  }
963  RtlUnicodeStringToOemString(&OemString, &CapturedString, FALSE);
964 
965  /* Display the string */
967 
968  /* Free the string buffer */
970 
972 
973 Quit:
974  /* Free the captured string */
975  ReleaseCapturedUnicodeString(&CapturedString, PreviousMode);
976 
977  return Status;
978 }
979 
980 #ifdef INBV_ROTBAR_IMPLEMENTED
981 static
982 VOID
983 NTAPI
986 {
987  ULONG X, Y, Index, Total;
988  LARGE_INTEGER Delay = {{0}};
989 
990  InbvAcquireLock();
992  {
993  Index = 0;
994  }
995  else
996  {
997  Index = 32;
998  }
999  X = ProgressBarLeft + 2;
1000  Y = ProgressBarTop + 2;
1001  InbvReleaseLock();
1002 
1004  {
1005  /* Wait for a bit */
1007 
1008  InbvAcquireLock();
1009 
1010  /* Unknown unexpected command */
1012 
1014  {
1015  /* Stop the thread */
1016  InbvReleaseLock();
1017  break;
1018  }
1019 
1021  {
1022  Delay.QuadPart = -800000; // 80 ms
1023  Total = 18;
1024  Index %= Total;
1025 
1026  if (Index >= 3)
1027  {
1028  /* Fill previous bar position */
1029  VidSolidColorFill(X + ((Index - 3) * 8), Y, (X + ((Index - 3) * 8)) + 8 - 1, Y + 9 - 1, BV_COLOR_BLACK);
1030  }
1031  if (Index < Total - 1)
1032  {
1033  /* Draw the progress bar bit */
1034  if (Index < 2)
1035  {
1036  /* Appearing from the left */
1037  VidBufferToScreenBlt(RotBarBuffer + 8 * (2 - Index) / 2, X, Y, 22 - 8 * (2 - Index), 9, 24);
1038  }
1039  else if (Index >= Total - 3)
1040  {
1041  /* Hiding to the right */
1042  VidBufferToScreenBlt(RotBarBuffer, X + ((Index - 2) * 8), Y, 22 - 8 * (4 - (Total - Index)), 9, 24);
1043  }
1044  else
1045  {
1046  VidBufferToScreenBlt(RotBarBuffer, X + ((Index - 2) * 8), Y, 22, 9, 24);
1047  }
1048  }
1049  Index++;
1050  }
1051  else if (RotBarSelection == RB_PROGRESS_BAR)
1052  {
1053  Delay.QuadPart = -600000; // 60 ms
1054  Total = SCREEN_WIDTH;
1055  Index %= Total;
1056 
1057  /* Right part */
1059  if (Index > 0)
1060  {
1061  /* Left part */
1063  }
1064  Index += 32;
1065  }
1066 
1067  InbvReleaseLock();
1068  }
1069 
1071 }
1072 
1073 INIT_FUNCTION
1074 VOID
1075 NTAPI
1077 {
1079  /* Perform other initialization if needed */
1080 }
1081 #endif
1082 
1083 INIT_FUNCTION
1084 VOID
1085 NTAPI
1087 {
1088  PVOID BootCopy = NULL, BootProgress = NULL, BootLogo = NULL, Header = NULL, Footer = NULL;
1089 
1090 #ifdef INBV_ROTBAR_IMPLEMENTED
1091  UCHAR Buffer[24 * 9];
1092  PVOID Bar = NULL, LineBmp = NULL;
1093  ROT_BAR_TYPE TempRotBarSelection = RB_UNSPECIFIED;
1094  NTSTATUS Status;
1095  HANDLE ThreadHandle = NULL;
1096 #endif
1097 
1098 #ifdef REACTOS_SKUS
1099  PVOID Text = NULL;
1100 #endif
1101 
1102 #ifdef INBV_ROTBAR_IMPLEMENTED
1103  /* Check if the animation thread has already been created */
1104  if (RotBarThreadActive)
1105  {
1106  /* Yes, just reset the progress bar but keep the thread alive */
1107  InbvAcquireLock();
1109  InbvReleaseLock();
1110  }
1111 #endif
1112 
1114 
1115  /* Check if this is text mode */
1116  if (TextMode)
1117  {
1118  /*
1119  * Make the kernel resource section temporarily writable,
1120  * as we are going to change the bitmaps' palette in place.
1121  */
1123 
1124  /* Check the type of the OS: workstation or server */
1125  if (SharedUserData->NtProductType == NtProductWinNt)
1126  {
1127  /* Workstation; set colors */
1131 
1132  /* Get resources */
1135  }
1136  else
1137  {
1138  /* Server; set colors */
1142 
1143  /* Get resources */
1146  }
1147 
1148  /* Set the scrolling region */
1151 
1152  /* Make sure we have resources */
1153  if (Header && Footer)
1154  {
1155  /* BitBlt them on the screen */
1156  BitBltAligned(Footer,
1157  TRUE,
1160  0, 0, 0, 59);
1162  FALSE,
1165  0, 0, 0, 0);
1166  }
1167 
1168  /* Restore the kernel resource section protection to be read-only */
1170  }
1171  else
1172  {
1173  /* Is the boot driver installed? */
1174  if (!InbvBootDriverInstalled) return;
1175 
1176  /*
1177  * Make the kernel resource section temporarily writable,
1178  * as we are going to change the bitmaps' palette in place.
1179  */
1181 
1182  /* Load boot screen logo */
1184 
1185 #ifdef REACTOS_SKUS
1186  Text = NULL;
1187  if (SharedUserData->NtProductType == NtProductWinNt)
1188  {
1189 #ifdef INBV_ROTBAR_IMPLEMENTED
1190  /* Workstation product, use appropriate status bar color */
1192 #endif
1193  }
1194  else
1195  {
1196  /* Display correct branding based on server suite */
1198  {
1199  /* Storage Server Edition */
1201  }
1202  else if (ExVerifySuite(ComputeServer))
1203  {
1204  /* Compute Cluster Edition */
1206  }
1207  else
1208  {
1209  /* Normal edition */
1211  }
1212 
1213 #ifdef INBV_ROTBAR_IMPLEMENTED
1214  /* Server product, use appropriate status bar color */
1216 #endif
1217  }
1218 #else
1219  /* Use default status bar */
1221 #endif
1222 
1223  /* Make sure we have a logo */
1224  if (BootLogo)
1225  {
1226  /* Save the main image palette for implementing the fade-in effect */
1227  PBITMAPINFOHEADER BitmapInfoHeader = BootLogo;
1228  LPRGBQUAD Palette = (LPRGBQUAD)((PUCHAR)BootLogo + BitmapInfoHeader->biSize);
1229  RtlCopyMemory(MainPalette, Palette, sizeof(MainPalette));
1230 
1231  /* Draw the logo at the center of the screen */
1233  TRUE,
1236  0, 0, 0, 34);
1237 
1238 #ifdef INBV_ROTBAR_IMPLEMENTED
1239  /* Choose progress bar */
1240  TempRotBarSelection = ROT_BAR_DEFAULT_MODE;
1241 #endif
1242 
1243  /* Set progress bar coordinates and display it */
1248 
1249 #ifdef REACTOS_SKUS
1250  /* Check for non-workstation products */
1251  if (SharedUserData->NtProductType != NtProductWinNt)
1252  {
1253  /* Overwrite part of the logo for a server product */
1255  VID_SKU_SAVE_AREA_TOP, 7, 7, 8);
1259  VID_SKU_SAVE_AREA_TOP, 7, 7, 8);
1260 
1261  /* In setup mode, you haven't selected a SKU yet */
1262  if (ExpInTextModeSetup) Text = NULL;
1263  }
1264 #endif
1265  }
1266 
1267  /* Load and draw progress bar bitmap */
1268  BootProgress = InbvGetResourceAddress(IDB_PROGRESS_BAR);
1269  BitBltAligned(BootProgress,
1270  TRUE,
1273  0, 118, 0, 0);
1274 
1275  /* Load and draw copyright text bitmap */
1277  BitBltAligned(BootCopy,
1278  TRUE,
1281  22, 0, 0, 20);
1282 
1283 #ifdef REACTOS_SKUS
1284  /* Draw the SKU text if it exits */
1285  if (Text)
1287 #endif
1288 
1289 #ifdef INBV_ROTBAR_IMPLEMENTED
1290  if ((TempRotBarSelection == RB_SQUARE_CELLS) && Bar)
1291  {
1292  /* Save previous screen pixels to buffer */
1293  InbvScreenToBufferBlt(Buffer, 0, 0, 22, 9, 24);
1294  /* Draw the progress bar bit */
1295  BitBltPalette(Bar, TRUE, 0, 0);
1296  /* Store it in global buffer */
1297  InbvScreenToBufferBlt(RotBarBuffer, 0, 0, 22, 9, 24);
1298  /* Restore screen pixels */
1299  InbvBufferToScreenBlt(Buffer, 0, 0, 22, 9, 24);
1300  }
1301 
1302  /*
1303  * Add a rotating bottom horizontal bar when using a progress bar,
1304  * to show that ReactOS can be still alive when the bar does not
1305  * appear to progress.
1306  */
1307  if (TempRotBarSelection == RB_PROGRESS_BAR)
1308  {
1310  if (LineBmp)
1311  {
1312  /* Draw the line and store it in global buffer */
1313  BitBltPalette(LineBmp, TRUE, 0, SCREEN_HEIGHT-6);
1315  }
1316  }
1317  else
1318  {
1319  /* Hide the simple progress bar if not used */
1321  }
1322 #endif
1323 
1324  /* Restore the kernel resource section protection to be read-only */
1326 
1327  /* Display the boot logo and fade it in */
1328  BootLogoFadeIn();
1329 
1330 #ifdef INBV_ROTBAR_IMPLEMENTED
1331  if (!RotBarThreadActive && TempRotBarSelection != RB_UNSPECIFIED)
1332  {
1333  /* Start the animation thread */
1334  Status = PsCreateSystemThread(&ThreadHandle,
1335  0,
1336  NULL,
1337  NULL,
1338  NULL,
1340  NULL);
1341  if (NT_SUCCESS(Status))
1342  {
1343  /* The thread has started, close the handle as we don't need it */
1345  ObCloseHandle(ThreadHandle, KernelMode);
1346  }
1347  }
1348 #endif
1349 
1350  /* Set filter which will draw text display if needed */
1352  }
1353 
1354 #ifdef INBV_ROTBAR_IMPLEMENTED
1355  /* Do we have the animation thread? */
1356  if (RotBarThreadActive)
1357  {
1358  /* We do, initialize the progress bar */
1359  InbvAcquireLock();
1360  RotBarSelection = TempRotBarSelection;
1361  InbvRotBarInit();
1362  InbvReleaseLock();
1363  }
1364 #endif
1365 }
1366 
1367 INIT_FUNCTION
1368 VOID
1369 NTAPI
1371 {
1372  /* Windows hack to skip first dots */
1373  static BOOLEAN DotHack = TRUE;
1374 
1375  /* If "." is given set *String to empty string */
1376  if (DotHack && strcmp(*String, ".") == 0)
1377  *String = "";
1378 
1379  if (**String)
1380  {
1381  /* Remove the filter */
1383 
1384  DotHack = FALSE;
1385 
1386  /* Draw text screen */
1388  }
1389 }
1390 
1391 INIT_FUNCTION
1392 VOID
1393 NTAPI
1395 {
1396  /* Acquire lock and check the display state */
1397  InbvAcquireLock();
1399  {
1400  /* Clear the screen */
1402  }
1403 
1404  /* Reset progress bar and lock */
1405 #ifdef INBV_ROTBAR_IMPLEMENTED
1408 #endif
1409  InbvReleaseLock();
1410 }
_ROT_BAR_STATUS
Definition: inbv.c:108
static __inline NTSTATUS ProbeAndCaptureUnicodeString(OUT PUNICODE_STRING Dest, IN KPROCESSOR_MODE CurrentMode, IN const UNICODE_STRING *UnsafeSrc)
Definition: probe.h:142
VOID NTAPI InbvScreenToBufferBlt(OUT PUCHAR Buffer, IN ULONG X, IN ULONG Y, IN ULONG Width, IN ULONG Height, IN ULONG Delta)
Definition: inbv.c:831
#define KeGetCurrentIrql()
Definition: env_spec_w32.h:706
signed char * PCHAR
Definition: retypes.h:7
*BytesInOemString PCHAR OemString
Definition: rtlfuncs.h:1561
static ULONG InbvTerminalTextColor
Definition: inbv.c:158
VOID NTAPI InbvNotifyDisplayOwnershipLost(IN INBV_RESET_DISPLAY_PARAMETERS Callback)
Definition: inbv.c:638
static BT_PROGRESS_INDICATOR InbvProgressIndicator
Definition: inbv.c:90
#define IN
Definition: typedefs.h:39
#define IDB_SERVER_FOOTER
Definition: resource.h:25
#define STATUS_PRIVILEGE_NOT_HELD
Definition: DriverTester.h:9
VOID NTAPI VidScreenToBufferBlt(_Out_ PUCHAR Buffer, _In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Width, _In_ ULONG Height, _In_ ULONG Delta)
Definition: bootvid.c:257
#define KeRaiseIrql(irql, oldIrql)
Definition: env_spec_w32.h:597
INBV_DISPLAY_STATE NTAPI InbvGetDisplayState(VOID)
Definition: inbv.c:561
#define TRUE
Definition: types.h:120
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
struct tagBITMAPINFOHEADER * PBITMAPINFOHEADER
#define KeLowerIrql(oldIrql)
Definition: env_spec_w32.h:602
static VOID BootLogoFadeIn(VOID)
Definition: inbv.c:206
struct _BT_PROGRESS_INDICATOR * PBT_PROGRESS_INDICATOR
#define Y(I)
USHORT biBitCount
Definition: precomp.h:37
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
static ULONG ProgressBarHeight
Definition: inbv.c:87
LONG biXPelsPerMeter
Definition: precomp.h:40
char * strstr(char *String1, char *String2)
Definition: utclib.c:653
BOOLEAN NTAPI InbvDisplayString(IN PCHAR String)
Definition: inbv.c:569
static INBV_RESET_DISPLAY_PARAMETERS InbvResetDisplayParameters
Definition: inbv.c:91
VOID NTAPI InbvEnableBootDriver(IN BOOLEAN Enable)
Definition: inbv.c:497
INIT_FUNCTION VOID NTAPI InbvUpdateProgressBar(IN ULONG Progress)
Definition: inbv.c:762
unsigned char * PUCHAR
Definition: retypes.h:3
INIT_FUNCTION VOID NTAPI InbvIndicateProgress(VOID)
Definition: inbv.c:884
_ROT_BAR_TYPE
Definition: inbv.c:51
LONG NTSTATUS
Definition: precomp.h:26
#define SCREEN_WIDTH
Definition: pc98video.c:27
_In_ ULONGLONG _In_ ULONGLONG _In_ BOOLEAN Enable
Definition: ntddpcm.h:140
#define VID_SKU_SAVE_AREA_LEFT
Definition: logo.h:28
_BBLT_VERT_ALIGNMENT
Definition: inbv.c:61
#define VID_FOOTER_BG_TOP
Definition: logo.h:34
VOID NTAPI InbvBufferToScreenBlt(IN PUCHAR Buffer, IN ULONG X, IN ULONG Y, IN ULONG Width, IN ULONG Height, IN ULONG Delta)
Definition: inbv.c:792
#define VID_SCROLL_AREA_BOTTOM
Definition: logo.h:10
#define PALETTE_FADE_STEPS
Definition: inbv.c:176
static PWSTR Image
Definition: pageheap.c:13
_Inout_ __drv_aliasesMem PSLIST_ENTRY _Inout_ PSLIST_ENTRY _In_ ULONG Count
Definition: exfuncs.h:1015
VOID NTAPI InbvSolidColorFill(IN ULONG Left, IN ULONG Top, IN ULONG Right, IN ULONG Bottom, IN ULONG Color)
Definition: inbv.c:716
BOOLEAN NTAPI SeSinglePrivilegeCheck(IN LUID PrivilegeValue, IN KPROCESSOR_MODE PreviousMode)
Definition: priv.c:524
ULONG biCompression
Definition: precomp.h:38
KPROCESSOR_MODE NTAPI ExGetPreviousMode(VOID)
Definition: sysinfo.c:3066
#define TAG_OSTR
Definition: inbv.c:15
#define BV_COLOR_WHITE
Definition: display.h:30
static WCHAR String[]
Definition: stringtable.c:55
#define VID_SKU_AREA_LEFT
Definition: logo.h:23
#define PALETTE_FADE_TIME
Definition: inbv.c:177
enum _INBV_DISPLAY_STATE INBV_DISPLAY_STATE
#define VID_SCROLL_AREA_TOP
Definition: logo.h:8
STRING OEM_STRING
Definition: umtypes.h:203
#define VID_SKU_AREA_BOTTOM
Definition: logo.h:26
#define IDB_MAX_RESOURCE
Definition: resource.h:46
BOOLEAN NTAPI ExVerifySuite(SUITE_TYPE SuiteType)
Definition: sysinfo.c:377
struct _BT_PROGRESS_INDICATOR BT_PROGRESS_INDICATOR
VOID NTAPI VidResetDisplay(_In_ BOOLEAN HalReset)
Definition: bootvid.c:220
enum _ROT_BAR_TYPE ROT_BAR_TYPE
static UCHAR RotBarBuffer[24 *9]
Definition: inbv.c:119
ULONG_PTR Type
Definition: ldrtypes.h:181
UCHAR rgbBlue
Definition: inbv.c:167
static ULONG ProgressBarWidth
Definition: inbv.c:87
static UCHAR RotLineBuffer[SCREEN_WIDTH *6]
Definition: inbv.c:120
NTSTATUS NTAPI HeadlessDispatch(IN HEADLESS_CMD Command, IN PVOID InputBuffer, IN SIZE_T InputBufferSize, OUT PVOID OutputBuffer, OUT PSIZE_T OutputBufferSize)
Definition: hdlsterm.c:570
static PUCHAR ResourceList[1+IDB_MAX_RESOURCE]
Definition: inbv.c:93
enum _BBLT_VERT_ALIGNMENT BBLT_VERT_ALIGNMENT
UCHAR rgbGreen
Definition: inbv.c:168
VOID NTAPI InbvReleaseLock(VOID)
Definition: inbv.c:481
PVOID DllBase
Definition: btrfs_drv.h:1926
UCHAR rgbRed
Definition: inbv.c:169
BOOLEAN BootLogo
Definition: winldr.c:34
struct tagBITMAPINFOHEADER BITMAPINFOHEADER
UCHAR KIRQL
Definition: env_spec_w32.h:591
#define VID_SKU_TEXT_TOP
Definition: logo.h:32
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
NTSTATUS NTAPI NtDisplayString(IN PUNICODE_STRING DisplayString)
Definition: inbv.c:916
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
#define ANSI_NULL
Definition: Header.h:8
VOID FASTCALL KiReleaseSpinLock(IN PKSPIN_LOCK SpinLock)
Definition: ntoskrnl.c:35
long LONG
Definition: pedump.c:60
#define IDB_PROGRESS_BAR
Definition: resource.h:43
_Must_inspect_result_ _In_opt_ PFLT_FILTER Filter
Definition: fltkernel.h:1802
#define IDB_SERVER_LOGO
Definition: resource.h:23
INIT_FUNCTION VOID NTAPI InbvSetProgressBarCoordinates(IN ULONG Left, IN ULONG Top, IN ULONG Width, IN ULONG Height)
Definition: inbv.c:850
BOOLEAN NTAPI MmChangeKernelResourceSectionProtection(IN ULONG_PTR ProtectionMask)
Definition: sysldr.c:2286
NTSTATUS NTAPI KeDelayExecutionThread(IN KPROCESSOR_MODE WaitMode, IN BOOLEAN Alertable, IN PLARGE_INTEGER Interval OPTIONAL)
Definition: wait.c:283
FORCEINLINE VOID KeInitializeSpinLock(_Out_ PKSPIN_LOCK SpinLock)
Definition: kefuncs.h:238
unsigned char BOOLEAN
_BBLT_HORZ_ALIGNMENT
Definition: inbv.c:68
#define VID_SCROLL_AREA_LEFT
Definition: logo.h:7
ULONG_PTR Name
Definition: ldrtypes.h:182
smooth NULL
Definition: ftsmooth.c:416
_In_ LPGUID _In_ PVOID Data
Definition: classpnp.h:778
static BOOLEAN InbvDisplayDebugStrings
Definition: inbv.c:84
VOID NTAPI VidCleanUp(VOID)
Definition: bootvid.c:246
VOID NTAPI InbvAcquireLock(VOID)
Definition: inbv.c:459
static ROT_BAR_STATUS PltRotBarStatus
Definition: inbv.c:118
Definition: pedump.c:457
enum _ROT_BAR_STATUS ROT_BAR_STATUS
Definition: bufpool.h:45
VOID NTAPI InbvSetDisplayOwnership(IN BOOLEAN DisplayOwned)
Definition: inbv.c:544
NTSTATUS NTAPI LdrFindResource_U(_In_ PVOID BaseAddress, _In_ PLDR_RESOURCE_INFO ResourceInfo, _In_ ULONG Level, _Out_ PIMAGE_RESOURCE_DATA_ENTRY *ResourceDataEntry)
INIT_FUNCTION PVOID NTAPI FindBitmapResource(IN PLOADER_PARAMETER_BLOCK LoaderBlock, IN ULONG ResourceId)
Definition: inbv.c:353
static ULONG ProgressBarLeft
Definition: inbv.c:86
#define IDB_COPYRIGHT
Definition: resource.h:44
#define IDB_LOGO_DEFAULT
Definition: resource.h:15
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
VOID NTAPI InbvSetTextColor(IN ULONG Color)
Definition: inbv.c:692
#define VID_PROGRESS_BAR_LEFT
Definition: logo.h:12
#define IDB_STORAGE_SERVER
Definition: resource.h:37
INIT_FUNCTION VOID NTAPI InbvRotBarInit(VOID)
Definition: inbv.c:1076
NTSTATUS NTAPI LdrAccessResource(_In_ PVOID BaseAddress, _In_ PIMAGE_RESOURCE_DATA_ENTRY ResourceDataEntry, _Out_opt_ PVOID *Resource, _Out_opt_ PULONG Size)
BOOLEAN FASTCALL KeTestSpinLock(IN PKSPIN_LOCK SpinLock)
Definition: spinlock.c:442
#define SCREEN_HEIGHT
Definition: pc98video.c:28
#define MM_READONLY
Definition: inbv.c:11
ULONG biClrImportant
Definition: precomp.h:43
#define IDB_BAR_DEFAULT
Definition: resource.h:14
struct tagRGBQUAD RGBQUAD
struct _LIST_ENTRY * Flink
Definition: typedefs.h:120
static __inline VOID ReleaseCapturedUnicodeString(IN PUNICODE_STRING CapturedString, IN KPROCESSOR_MODE CurrentMode)
Definition: probe.h:239
_In_ KPROCESSOR_MODE PreviousMode
Definition: sefuncs.h:103
static INBV_PROGRESS_STATE InbvProgressState
Definition: inbv.c:89
ULONG RGBQUAD
Definition: precomp.h:50
static VOID NTAPI InbvRotationThread(_In_ PVOID Context)
Definition: inbv.c:984
VOID NTAPI VidBitBlt(_In_ PUCHAR Buffer, _In_ ULONG Left, _In_ ULONG Top)
Definition: common.c:466
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define ROT_BAR_DEFAULT_MODE
Definition: inbv.c:99
ULONG NTAPI VidSetTextColor(_In_ ULONG Color)
Definition: common.c:307
static KIRQL InbvOldIrql
Definition: inbv.c:81
INIT_FUNCTION BOOLEAN NTAPI InbvDriverInitialize(IN PLOADER_PARAMETER_BLOCK LoaderBlock, IN ULONG Count)
Definition: inbv.c:418
static const UCHAR Index[8]
Definition: usbohci.c:18
#define VID_SKU_AREA_RIGHT
Definition: logo.h:25
ULONG_PTR KiBugCheckData[5]
Definition: bug.c:31
INIT_FUNCTION VOID NTAPI DisplayFilter(PCHAR *String)
Definition: inbv.c:1370
CCHAR KPROCESSOR_MODE
Definition: ketypes.h:7
#define BV_COLOR_CYAN
Definition: display.h:21
VOID NTAPI VidSolidColorFill(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Right, _In_ ULONG Bottom, _In_ UCHAR Color)
Definition: bootvid.c:274
#define BV_COLOR_DARK_GRAY
Definition: display.h:22
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
VOID NTAPI InbvAcquireDisplayOwnership(VOID)
Definition: inbv.c:528
static ULONG ResourceCount
Definition: inbv.c:92
#define SharedUserData
unsigned char UCHAR
Definition: xmlstorage.h:181
NTSTATUS NTAPI ObCloseHandle(IN HANDLE Handle, IN KPROCESSOR_MODE AccessMode)
Definition: obhandle.c:3376
static const WCHAR L[]
Definition: oid.c:1250
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql
Definition: kefuncs.h:790
#define MM_READWRITE
Definition: inbv.c:12
NTSYSAPI NTSTATUS NTAPI RtlUnicodeStringToOemString(POEM_STRING DestinationString, PCUNICODE_STRING SourceString, BOOLEAN AllocateDestinationString)
Definition: btrfs_drv.h:1922
VOID(NTAPI * INBV_DISPLAY_STRING_FILTER)(PCHAR *Str)
Definition: inbvtypes.h:50
#define BV_COLOR_LIGHT_CYAN
Definition: display.h:29
Definition: typedefs.h:118
static INBV_DISPLAY_STRING_FILTER InbvDisplayFilter
Definition: inbv.c:85
#define VID_PROGRESS_BAR_TOP
Definition: logo.h:13
static ROT_BAR_TYPE RotBarSelection
Definition: inbv.c:117
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:361
#define VID_PROGRESS_BAR_HEIGHT
Definition: logo.h:15
VOID DisplayString(LPWSTR Msg)
Definition: misc.c:211
Status
Definition: gdiplustypes.h:24
const LUID SeTcbPrivilege
Definition: priv.c:28
LONG biYPelsPerMeter
Definition: precomp.h:41
#define DISPATCH_LEVEL
Definition: env_spec_w32.h:696
BOOLEAN NTAPI InbvEnableDisplayString(IN BOOLEAN Enable)
Definition: inbv.c:606
#define _In_
Definition: no_sal2.h:204
#define VID_SCROLL_AREA_RIGHT
Definition: logo.h:9
BOOLEAN NTAPI InbvIsBootDriverInstalled(VOID)
Definition: inbv.c:630
enum _BBLT_HORZ_ALIGNMENT BBLT_HORZ_ALIGNMENT
#define RESOURCE_DATA_LEVEL
Definition: ldrtypes.h:33
BOOLEAN ExpInTextModeSetup
Definition: init.c:67
BOOLEAN NTAPI InbvResetDisplay(VOID)
Definition: inbv.c:664
static VOID BitBltAligned(IN PVOID Image, IN BOOLEAN NoPalette, IN BBLT_HORZ_ALIGNMENT HorizontalAlignment, IN BBLT_VERT_ALIGNMENT VerticalAlignment, IN ULONG MarginLeft, IN ULONG MarginTop, IN ULONG MarginRight, IN ULONG MarginBottom)
Definition: inbv.c:291
#define VID_SKU_TEXT_LEFT
Definition: logo.h:31
_CRTIMP char *__cdecl _strupr(_Inout_z_ char *_String)
NTSYSAPI ULONG NTAPI RtlComputeCrc32(_In_ ULONG InitialCrc, _In_ PUCHAR Buffer, _In_ ULONG Length)
static LPHIST_ENTRY Bottom
Definition: history.c:54
VOID NTAPI VidSetScrollRegion(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Right, _In_ ULONG Bottom)
Definition: common.c:344
#define STATUS_BUFFER_OVERFLOW
Definition: shellext.h:66
BOOLEAN NTAPI VidInitialize(_In_ BOOLEAN SetMode)
Definition: bootvid.c:184
#define IDB_WKSTA_FOOTER
Definition: resource.h:18
static BOOLEAN RotBarThreadActive
Definition: inbv.c:116
unsigned short USHORT
Definition: pedump.c:61
#define RTL_NUMBER_OF(x)
Definition: RtlRegistry.c:12
struct _INBV_PROGRESS_STATE INBV_PROGRESS_STATE
NTSTATUS NTAPI PsTerminateSystemThread(IN NTSTATUS ExitStatus)
Definition: kill.c:1144
static ULONG Delta
Definition: xboxvideo.c:32
#define STATUS_NO_MEMORY
Definition: ntstatus.h:246
VOID FASTCALL KiAcquireSpinLock(IN PKSPIN_LOCK SpinLock)
Definition: ntoskrnl.c:28
ULONG KSPIN_LOCK
Definition: env_spec_w32.h:72
NTSTATUS NTAPI PsCreateSystemThread(OUT PHANDLE ThreadHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes, IN HANDLE ProcessHandle, IN PCLIENT_ID ClientId, IN PKSTART_ROUTINE StartRoutine, IN PVOID StartContext)
Definition: thread.c:602
UNICODE_STRING BaseDllName
Definition: ldrtypes.h:145
VOID NTAPI InbvBitBlt(IN PUCHAR Buffer, IN ULONG X, IN ULONG Y)
Definition: inbv.c:810
#define min(a, b)
Definition: monoChain.cc:55
NTSYSAPI DWORD WINAPI RtlUnicodeStringToOemSize(const UNICODE_STRING *)
VOID NTAPI InbvInstallDisplayStringFilter(IN INBV_DISPLAY_STRING_FILTER Filter)
Definition: inbv.c:622
#define VID_SKU_AREA_TOP
Definition: logo.h:24
#define BV_COLOR_BLACK
Definition: display.h:15
#define MAXUSHORT
Definition: typedefs.h:82
ULONG_PTR Language
Definition: ldrtypes.h:183
INIT_FUNCTION VOID NTAPI DisplayBootBitmap(IN BOOLEAN TextMode)
Definition: inbv.c:1086
#define VID_SKU_SAVE_AREA_TOP
Definition: logo.h:29
VOID NTAPI VidDisplayString(_In_ PUCHAR String)
Definition: common.c:370
static INBV_DISPLAY_STATE InbvDisplayState
Definition: inbv.c:82
#define OUT
Definition: typedefs.h:40
#define VID_PROGRESS_BAR_WIDTH
Definition: logo.h:14
#define IDB_ROTATING_LINE
Definition: resource.h:42
#define IDB_BAR_WKSTA
Definition: resource.h:20
unsigned int ULONG
Definition: retypes.h:1
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
static ULONG InbvTerminalBkgdColor
Definition: inbv.c:159
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
static ULONG ProgressBarTop
Definition: inbv.c:86
PUCHAR NTAPI InbvGetResourceAddress(IN ULONG ResourceNumber)
Definition: inbv.c:905
UCHAR rgbReserved
Definition: inbv.c:170
static KSPIN_LOCK BootDriverLock
Definition: inbv.c:80
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1099
BOOLEAN InbvBootDriverInstalled
Definition: inbv.c:83
VOID NTAPI InbvSetScrollRegion(IN ULONG Left, IN ULONG Top, IN ULONG Right, IN ULONG Bottom)
Definition: inbv.c:681
BOOLEAN NTAPI InbvCheckDisplayOwnership(VOID)
Definition: inbv.c:553
VOID NTAPI VidBufferToScreenBlt(_In_ PUCHAR Buffer, _In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Width, _In_ ULONG Height, _In_ ULONG Delta)
Definition: common.c:448
INIT_FUNCTION VOID NTAPI InbvSetProgressBarSubset(IN ULONG Floor, IN ULONG Ceiling)
Definition: inbv.c:868
#define BV_COLOR_RED
Definition: display.h:16
return STATUS_SUCCESS
Definition: btrfs.c:3014
BOOLEAN(NTAPI * INBV_RESET_DISPLAY_PARAMETERS)(ULONG Cols, ULONG Rows)
Definition: inbvtypes.h:43
LPFNPSPCALLBACK Callback
Definition: desk.c:112
static RGBQUAD MainPalette[16]
Definition: inbv.c:174
NTSYSAPI BOOLEAN NTAPI RtlEqualUnicodeString(PUNICODE_STRING String1, PUNICODE_STRING String2, BOOLEAN CaseInSensitive)
static LPHIST_ENTRY Top
Definition: history.c:53
INIT_FUNCTION VOID NTAPI FinalizeBootLogo(VOID)
Definition: inbv.c:1394
#define IDB_CLUSTER_SERVER
Definition: resource.h:38
static BOOLEAN ShowProgressBar
Definition: inbv.c:88
#define IDB_WKSTA_HEADER
Definition: resource.h:17
#define X(b, s)
char * Text
Definition: combotst.c:136
#define IDB_SERVER_HEADER
Definition: resource.h:24
LONGLONG QuadPart
Definition: typedefs.h:113
#define PAGED_CODE()
static VOID BitBltPalette(IN PVOID Image, IN BOOLEAN NoPalette, IN ULONG X, IN ULONG Y)
Definition: inbv.c:259
#define RTL_CONSTANT_STRING(s)
Definition: tunneltest.c:14
struct tagRGBQUAD * LPRGBQUAD