ReactOS  0.4.15-dev-4603-gb922b6d
inbv.c
Go to the documentation of this file.
1 /*
2  * PROJECT: ReactOS Kernel
3  * LICENSE: BSD - See COPYING.ARM in the top level directory
4  * PURPOSE: Boot Video Driver support
5  * COPYRIGHT: Copyright 2007 Alex Ionescu (alex.ionescu@reactos.org)
6  * Copyright 2010 Aleksey Bragin (aleksey@reactos.org)
7  * Copyright 2015-2022 Hermès Bélusca-Maïto
8  */
9 
10 /* INCLUDES ******************************************************************/
11 
12 #include <ntoskrnl.h>
13 #include "inbv/logo.h"
14 
15 /* GLOBALS *******************************************************************/
16 
17 /*
18  * Enable this define if you want Inbv to use coloured headless mode.
19  */
20 // #define INBV_HEADLESS_COLORS
21 
22 typedef struct _INBV_PROGRESS_STATE
23 {
28 
29 typedef struct _BT_PROGRESS_INDICATOR
30 {
35 
41 
44 
49 
50 static ULONG ResourceCount = 0;
51 static PUCHAR ResourceList[1 + IDB_MAX_RESOURCE]; // First entry == NULL, followed by 'ResourceCount' entries.
52 
53 
54 /*
55  * Headless terminal text colors
56  */
57 
58 #ifdef INBV_HEADLESS_COLORS
59 
60 // Conversion table CGA to ANSI color index
61 static const UCHAR CGA_TO_ANSI_COLOR_TABLE[16] =
62 {
63  0, // Black
64  4, // Blue
65  2, // Green
66  6, // Cyan
67  1, // Red
68  5, // Magenta
69  3, // Brown/Yellow
70  7, // Grey/White
71 
72  60, // Bright Black
73  64, // Bright Blue
74  62, // Bright Green
75  66, // Bright Cyan
76  61, // Bright Red
77  65, // Bright Magenta
78  63, // Bright Yellow
79  67 // Bright Grey (White)
80 };
81 
82 #define CGA_TO_ANSI_COLOR(CgaColor) \
83  CGA_TO_ANSI_COLOR_TABLE[CgaColor & 0x0F]
84 
85 #endif
86 
87 // Default colors: text in white, background in black
90 
91 
92 /* FUNCTIONS *****************************************************************/
93 
94 CODE_SEG("INIT")
95 static
96 PVOID
98  _In_ PLOADER_PARAMETER_BLOCK LoaderBlock,
99  _In_ ULONG ResourceId)
100 {
101  UNICODE_STRING UpString = RTL_CONSTANT_STRING(L"ntoskrnl.exe");
102  UNICODE_STRING MpString = RTL_CONSTANT_STRING(L"ntkrnlmp.exe");
103  PLIST_ENTRY NextEntry, ListHead;
104  PLDR_DATA_TABLE_ENTRY LdrEntry;
105  PIMAGE_RESOURCE_DATA_ENTRY ResourceDataEntry;
106  LDR_RESOURCE_INFO ResourceInfo;
108  PVOID Data = NULL;
109 
110  /* Loop the driver list */
111  ListHead = &LoaderBlock->LoadOrderListHead;
112  NextEntry = ListHead->Flink;
113  while (NextEntry != ListHead)
114  {
115  /* Get the entry */
116  LdrEntry = CONTAINING_RECORD(NextEntry,
118  InLoadOrderLinks);
119 
120  /* Check for a match */
121  if (RtlEqualUnicodeString(&LdrEntry->BaseDllName, &UpString, TRUE) ||
122  RtlEqualUnicodeString(&LdrEntry->BaseDllName, &MpString, TRUE))
123  {
124  /* Break out */
125  break;
126  }
127  }
128 
129  /* Check if we found it */
130  if (NextEntry != ListHead)
131  {
132  /* Try to find the resource */
133  ResourceInfo.Type = 2; // RT_BITMAP;
134  ResourceInfo.Name = ResourceId;
135  ResourceInfo.Language = 0;
136  Status = LdrFindResource_U(LdrEntry->DllBase,
137  &ResourceInfo,
139  &ResourceDataEntry);
140  if (NT_SUCCESS(Status))
141  {
142  /* Access the resource */
143  ULONG Size = 0;
144  Status = LdrAccessResource(LdrEntry->DllBase,
145  ResourceDataEntry,
146  &Data,
147  &Size);
148  if ((Data) && (ResourceId < 3))
149  {
151  }
152  if (!NT_SUCCESS(Status)) Data = NULL;
153  }
154  }
155 
156  /* Return the pointer */
157  return Data;
158 }
159 
160 PUCHAR
161 NTAPI
163  _In_ ULONG ResourceNumber)
164 {
165  /* Validate the resource number */
166  if (ResourceNumber > ResourceCount) return NULL;
167 
168  /* Return the address */
169  return ResourceList[ResourceNumber];
170 }
171 
172 CODE_SEG("INIT")
173 BOOLEAN
174 NTAPI
176  _In_ PLOADER_PARAMETER_BLOCK LoaderBlock,
177  _In_ ULONG Count)
178 {
179  PCHAR CommandLine;
180  BOOLEAN ResetMode = FALSE; // By default do not reset the video mode
181  ULONG i;
182 
183  /* Quit if we're already installed */
184  if (InbvBootDriverInstalled) return TRUE;
185 
186  /* Initialize the lock and check the current display state */
189  {
190  /* Reset the video mode in case we do not have a custom boot logo */
191  CommandLine = (LoaderBlock->LoadOptions ? _strupr(LoaderBlock->LoadOptions) : NULL);
192  ResetMode = (CommandLine == NULL) || (strstr(CommandLine, "BOOTLOGO") == NULL);
193  }
194 
195  /* Initialize the video */
198  {
199  /* Find bitmap resources in the kernel */
201  for (i = 1; i <= ResourceCount; i++)
202  {
203  /* Do the lookup */
204  ResourceList[i] = FindBitmapResource(LoaderBlock, i);
205  }
206 
207  /* Set the progress bar ranges */
208  InbvSetProgressBarSubset(0, 100);
209 
210  // BootAnimInitialize(LoaderBlock, Count);
211  }
212 
213  /* Return install state */
215 }
216 
217 VOID
218 NTAPI
220 {
221  KIRQL OldIrql;
222 
223  /* Check if we're at dispatch level or lower */
225  if (OldIrql <= DISPATCH_LEVEL)
226  {
227  /* Loop until the lock is free */
228  while (!KeTestSpinLock(&BootDriverLock));
229 
230  /* Raise IRQL to dispatch level */
232  }
233 
234  /* Acquire the lock */
237 }
238 
239 VOID
240 NTAPI
242 {
243  KIRQL OldIrql;
244 
245  /* Capture the old IRQL */
247 
248  /* Release the driver lock */
250 
251  /* If we were at dispatch level or lower, restore the old IRQL */
253 }
254 
255 VOID
256 NTAPI
259 {
260  /* Check if we're installed */
262  {
263  /* Check for lost state */
265 
266  /* Acquire the lock */
267  InbvAcquireLock();
268 
269  /* Cleanup the screen if we own it */
271 
272  /* Set the new display state */
275 
276  /* Release the lock */
277  InbvReleaseLock();
278  }
279  else
280  {
281  /* Set the new display state */
284  }
285 }
286 
287 VOID
288 NTAPI
290 {
291  /* Check if we have a callback and we're just acquiring it now */
294  {
295  /* Call the callback */
297  }
298 
299  /* Acquire the display */
301 }
302 
303 VOID
304 NTAPI
306  _In_ BOOLEAN DisplayOwned)
307 {
308  /* Set the new display state */
309  InbvDisplayState = DisplayOwned ? INBV_DISPLAY_STATE_OWNED :
311 }
312 
313 BOOLEAN
314 NTAPI
316 {
317  /* Return if we own it or not */
319 }
320 
322 NTAPI
324 {
325  /* Return the actual state */
326  return InbvDisplayState;
327 }
328 
329 BOOLEAN
330 NTAPI
332  _In_ PCHAR String)
333 {
334  /* Make sure we own the display */
336  {
337  /* If we're not allowed, return success anyway */
338  if (!InbvDisplayDebugStrings) return TRUE;
339 
340  /* Check if a filter is installed */
342 
343  /* Acquire the lock */
344  InbvAcquireLock();
345 
346  /* Make sure we're installed and display the string */
348 
349  /* Print the string on the EMS port */
351  String,
352  strlen(String) + sizeof(ANSI_NULL),
353  NULL,
354  NULL);
355 
356  /* Release the lock */
357  InbvReleaseLock();
358 
359  /* All done */
360  return TRUE;
361  }
362 
363  /* We don't own it, fail */
364  return FALSE;
365 }
366 
367 BOOLEAN
368 NTAPI
371 {
372  BOOLEAN OldSetting;
373 
374  /* Get the old setting */
375  OldSetting = InbvDisplayDebugStrings;
376 
377  /* Update it */
379 
380  /* Return the old setting */
381  return OldSetting;
382 }
383 
384 VOID
385 NTAPI
388 {
389  /* Save the filter */
391 }
392 
393 BOOLEAN
394 NTAPI
396 {
397  /* Return driver state */
399 }
400 
401 VOID
402 NTAPI
405 {
406  /* Check if we're installed */
408  {
409  /* Acquire the lock and cleanup if we own the screen */
410  InbvAcquireLock();
412 
413  /* Set the reset callback and display state */
416 
417  /* Release the lock */
418  InbvReleaseLock();
419  }
420  else
421  {
422  /* Set the reset callback and display state */
425  }
426 }
427 
428 BOOLEAN
429 NTAPI
431 {
432  /* Check if we're installed and we own it */
435  {
436  /* Do the reset */
438  return TRUE;
439  }
440 
441  /* Nothing to reset */
442  return FALSE;
443 }
444 
445 VOID
446 NTAPI
448  _In_ ULONG Left,
449  _In_ ULONG Top,
450  _In_ ULONG Right,
451  _In_ ULONG Bottom)
452 {
453  /* Just call bootvid */
454  VidSetScrollRegion(Left, Top, Right, Bottom);
455 }
456 
457 VOID
458 NTAPI
460  _In_ ULONG Color)
461 {
462  HEADLESS_CMD_SET_COLOR HeadlessSetColor;
463 
464  /* Set color for EMS port */
465 #ifdef INBV_HEADLESS_COLORS
466  InbvTerminalTextColor = 30 + CGA_TO_ANSI_COLOR(Color);
467 #else
469 #endif
470  HeadlessSetColor.TextColor = InbvTerminalTextColor;
471  HeadlessSetColor.BkgdColor = InbvTerminalBkgdColor;
473  &HeadlessSetColor,
474  sizeof(HeadlessSetColor),
475  NULL,
476  NULL);
477 
478  /* Update the text color */
480 }
481 
482 VOID
483 NTAPI
485  _In_ ULONG Left,
486  _In_ ULONG Top,
487  _In_ ULONG Right,
488  _In_ ULONG Bottom,
489  _In_ ULONG Color)
490 {
491  HEADLESS_CMD_SET_COLOR HeadlessSetColor;
492 
493  /* Make sure we own it */
495  {
496  /* Acquire the lock */
497  InbvAcquireLock();
498 
499  /* Check if we're installed */
501  {
502  /* Call bootvid */
503  VidSolidColorFill(Left, Top, Right, Bottom, (UCHAR)Color);
504  }
505 
506  /* Set color for EMS port and clear display */
507 #ifdef INBV_HEADLESS_COLORS
508  InbvTerminalBkgdColor = 40 + CGA_TO_ANSI_COLOR(Color);
509 #else
511 #endif
512  HeadlessSetColor.TextColor = InbvTerminalTextColor;
513  HeadlessSetColor.BkgdColor = InbvTerminalBkgdColor;
515  &HeadlessSetColor,
516  sizeof(HeadlessSetColor),
517  NULL,
518  NULL);
520  NULL, 0,
521  NULL, NULL);
522 
523  /* Release the lock */
524  InbvReleaseLock();
525  }
526 }
527 
528 VOID
529 NTAPI
532  _In_ ULONG X,
533  _In_ ULONG Y)
534 {
535  /* Check if we're installed and we own it */
538  {
539  /* Acquire the lock */
540  InbvAcquireLock();
541 
542  /* Do the blit */
543  VidBitBlt(Buffer, X, Y);
544 
545  /* Release the lock */
546  InbvReleaseLock();
547  }
548 }
549 
550 VOID
551 NTAPI
554  _In_ ULONG X,
555  _In_ ULONG Y,
556  _In_ ULONG Width,
557  _In_ ULONG Height,
558  _In_ ULONG Delta)
559 {
560  /* Check if we're installed and we own it */
563  {
564  /* Do the blit */
566  }
567 }
568 
569 VOID
570 NTAPI
573  _In_ ULONG X,
574  _In_ ULONG Y,
575  _In_ ULONG Width,
576  _In_ ULONG Height,
577  _In_ ULONG Delta)
578 {
579  /* Check if we're installed and we own it */
582  {
583  /* Do the blit */
585  }
586 }
587 
598 VOID
599 NTAPI
601  _In_ ULONG Left,
602  _In_ ULONG Top)
603 {
604  /* Update the coordinates */
605  ProgressBarLeft = Left;
607 
608  /* Enable the progress bar */
610 }
611 
622 CODE_SEG("INIT")
623 VOID
624 NTAPI
626 {
627  ULONG Percentage;
628 
629  /* Increase progress */
631 
632  /* Compute the new percentage - Don't go over 100% */
633  Percentage = 100 * InbvProgressIndicator.Count /
635  Percentage = min(Percentage, 99);
636 
637  if (Percentage != InbvProgressIndicator.Percentage)
638  {
639  /* Percentage has changed, update the progress bar */
640  InbvProgressIndicator.Percentage = Percentage;
641  InbvUpdateProgressBar(Percentage);
642  }
643 }
644 
661 VOID
662 NTAPI
664  _In_ ULONG Floor,
665  _In_ ULONG Ceiling)
666 {
667  /* Sanity checks */
668  ASSERT(Floor < Ceiling);
669  ASSERT(Ceiling <= 100);
670 
671  /* Update the progress bar state */
672  InbvProgressState.Floor = Floor * 100;
673  InbvProgressState.Ceiling = Ceiling * 100;
674  InbvProgressState.Bias = Ceiling - Floor;
675 }
676 
687 VOID
688 NTAPI
690  _In_ ULONG Percentage)
691 {
692  ULONG TotalProgress;
693 
694  /* Make sure the progress bar is enabled, that we own and are installed */
695  if (ShowProgressBar &&
698  {
699  /* Compute the total progress and tick the progress bar */
700  TotalProgress = InbvProgressState.Floor + (Percentage * InbvProgressState.Bias);
701  // TotalProgress /= (100 * 100);
702 
703  BootAnimTickProgressBar(TotalProgress);
704  }
705 }
706 
707 NTSTATUS
708 NTAPI
710 {
712  UNICODE_STRING CapturedString;
716 
717  PAGED_CODE();
718 
720 
721  /* We require the TCB privilege */
724 
725  /* Capture the string */
727  if (!NT_SUCCESS(Status))
728  return Status;
729 
730  /* Do not display the string if it is empty */
731  if (CapturedString.Length == 0 || CapturedString.Buffer == NULL)
732  {
734  goto Quit;
735  }
736 
737  /*
738  * Convert the string since INBV understands only ANSI/OEM. Allocate the
739  * string buffer in non-paged pool because INBV passes it down to BOOTVID.
740  * We cannot perform the allocation using RtlUnicodeStringToOemString()
741  * since its allocator uses PagedPool.
742  */
743  OemLength = RtlUnicodeStringToOemSize(&CapturedString);
744  if (OemLength > MAXUSHORT)
745  {
747  goto Quit;
748  }
749  RtlInitEmptyAnsiString((PANSI_STRING)&OemString, NULL, (USHORT)OemLength);
751  if (OemString.Buffer == NULL)
752  {
754  goto Quit;
755  }
756  Status = RtlUnicodeStringToOemString(&OemString, &CapturedString, FALSE);
757  if (!NT_SUCCESS(Status))
758  {
760  goto Quit;
761  }
762 
763  /* Display the string */
765 
766  /* Free the string buffer */
768 
770 
771 Quit:
772  /* Free the captured string */
773  ReleaseCapturedUnicodeString(&CapturedString, PreviousMode);
774 
775  return Status;
776 }
static __inline NTSTATUS ProbeAndCaptureUnicodeString(OUT PUNICODE_STRING Dest, IN KPROCESSOR_MODE CurrentMode, IN const UNICODE_STRING *UnsafeSrc)
Definition: probe.h:142
#define KeGetCurrentIrql()
Definition: env_spec_w32.h:706
signed char * PCHAR
Definition: retypes.h:7
*BytesInOemString PCHAR OemString
Definition: rtlfuncs.h:1560
static ULONG InbvTerminalTextColor
Definition: inbv.c:88
static BT_PROGRESS_INDICATOR InbvProgressIndicator
Definition: inbv.c:48
#define IN
Definition: typedefs.h:39
#define STATUS_PRIVILEGE_NOT_HELD
Definition: DriverTester.h:9
INBV_DISPLAY_STATE NTAPI InbvGetDisplayState(VOID)
Definition: inbv.c:323
VOID NTAPI InbvIndicateProgress(VOID)
Gives some progress feedback, without specifying any explicit number of progress steps or percentage....
Definition: inbv.c:625
VOID NTAPI InbvSetScrollRegion(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Right, _In_ ULONG Bottom)
Definition: inbv.c:447
struct _BT_PROGRESS_INDICATOR * PBT_PROGRESS_INDICATOR
#define Y(I)
#define _Out_
Definition: ms_sal.h:345
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define TRUE
Definition: types.h:120
_In_ HFONT _Out_ PUINT _Out_ PUINT Width
Definition: font.h:124
char * strstr(char *String1, char *String2)
Definition: utclib.c:653
static INBV_RESET_DISPLAY_PARAMETERS InbvResetDisplayParameters
Definition: inbv.c:40
unsigned char * PUCHAR
Definition: retypes.h:3
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG _In_opt_ PVOID Data
Definition: wdfdevice.h:4527
VOID NTAPI InbvBufferToScreenBlt(_In_ PUCHAR Buffer, _In_ ULONG X, _In_ ULONG Y, _In_ ULONG Width, _In_ ULONG Height, _In_ ULONG Delta)
Definition: inbv.c:552
LONG NTSTATUS
Definition: precomp.h:26
VOID NTAPI VidDisplayString(_In_z_ PUCHAR String)
Definition: common.c:374
_In_ ULONGLONG _In_ ULONGLONG _In_ BOOLEAN Enable
Definition: ntddpcm.h:140
ULONG_PTR KiBugCheckData[5]
Definition: bug.c:27
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:361
KPROCESSOR_MODE NTAPI ExGetPreviousMode(VOID)
Definition: sysinfo.c:3063
_In_ HFONT _Out_ PUINT Height
Definition: font.h:124
enum _INBV_DISPLAY_STATE INBV_DISPLAY_STATE
static VOID NTAPI DisplayFilter(_Inout_ PCHAR *String)
Definition: bootanim.c:446
VOID NTAPI InbvNotifyDisplayOwnershipLost(_In_ INBV_RESET_DISPLAY_PARAMETERS Callback)
Definition: inbv.c:403
STRING OEM_STRING
Definition: umtypes.h:203
#define IDB_MAX_RESOURCE
Definition: resource.h:46
struct _BT_PROGRESS_INDICATOR BT_PROGRESS_INDICATOR
VOID NTAPI VidResetDisplay(_In_ BOOLEAN HalReset)
Definition: bootvid.c:220
_Must_inspect_result_ _In_ WDFIORESREQLIST _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFIORESLIST * ResourceList
Definition: wdfresource.h:304
ULONG_PTR Type
Definition: ldrtypes.h:181
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
#define TAG_OSTR
Definition: tag.h:144
VOID NTAPI InbvReleaseLock(VOID)
Definition: inbv.c:241
PVOID DllBase
Definition: btrfs_drv.h:1870
UCHAR KIRQL
Definition: env_spec_w32.h:591
NTSTATUS NTAPI NtDisplayString(IN PUNICODE_STRING DisplayString)
Definition: inbv.c:709
#define L(x)
Definition: ntvdm.h:50
VOID NTAPI InbvUpdateProgressBar(_In_ ULONG Percentage)
Updates the progress bar percentage, relative to the current percentage sub-range previously set by I...
Definition: inbv.c:689
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFSTRING String
Definition: wdfdevice.h:2430
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
static PVOID FindBitmapResource(_In_ PLOADER_PARAMETER_BLOCK LoaderBlock, _In_ ULONG ResourceId)
Definition: inbv.c:97
#define FALSE
Definition: types.h:117
#define ANSI_NULL
BOOLEAN(NTAPI * INBV_RESET_DISPLAY_PARAMETERS)(_In_ ULONG Cols, _In_ ULONG Rows)
Definition: inbvtypes.h:43
FORCEINLINE VOID KeInitializeSpinLock(_Out_ PKSPIN_LOCK SpinLock)
Definition: kefuncs.h:240
unsigned char BOOLEAN
ULONG_PTR Name
Definition: ldrtypes.h:182
VOID NTAPI InbvInstallDisplayStringFilter(_In_ INBV_DISPLAY_STRING_FILTER DisplayFilter)
Definition: inbv.c:386
#define _In_
Definition: ms_sal.h:308
static BOOLEAN InbvDisplayDebugStrings
Definition: inbv.c:42
VOID NTAPI VidCleanUp(VOID)
Definition: bootvid.c:246
VOID NTAPI InbvAcquireLock(VOID)
Definition: inbv.c:219
Definition: pedump.c:457
Definition: bufpool.h:45
NTSTATUS NTAPI LdrFindResource_U(_In_ PVOID BaseAddress, _In_ PLDR_RESOURCE_INFO ResourceInfo, _In_ ULONG Level, _Out_ PIMAGE_RESOURCE_DATA_ENTRY *ResourceDataEntry)
ULONG ProgressBarLeft
Definition: inbv.c:45
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
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:475
VOID NTAPI InbvSetDisplayOwnership(_In_ BOOLEAN DisplayOwned)
Definition: inbv.c:305
Status
Definition: gdiplustypes.h:24
struct _LIST_ENTRY * Flink
Definition: typedefs.h:121
static __inline VOID ReleaseCapturedUnicodeString(IN PUNICODE_STRING CapturedString, IN KPROCESSOR_MODE CurrentMode)
Definition: probe.h:239
_In_ KPROCESSOR_MODE PreviousMode
Definition: sefuncs.h:103
int Count
Definition: noreturn.cpp:7
static INBV_PROGRESS_STATE InbvProgressState
Definition: inbv.c:47
#define ASSERT(a)
Definition: mode.c:44
VOID NTAPI VidBitBlt(_In_ PUCHAR Buffer, _In_ ULONG Left, _In_ ULONG Top)
Definition: common.c:470
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
PUCHAR NTAPI InbvGetResourceAddress(_In_ ULONG ResourceNumber)
Definition: inbv.c:162
ULONG NTAPI VidSetTextColor(_In_ ULONG Color)
Definition: common.c:311
static KIRQL InbvOldIrql
Definition: inbv.c:37
BOOLEAN NTAPI InbvDisplayString(_In_ PCHAR String)
Definition: inbv.c:331
CCHAR KPROCESSOR_MODE
Definition: ketypes.h:7
VOID NTAPI VidSolidColorFill(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Right, _In_ ULONG Bottom, _In_ UCHAR Color)
Definition: bootvid.c:274
VOID NTAPI BootAnimTickProgressBar(_In_ ULONG SubPercentTimes100)
Ticks the progress bar. Used by InbvUpdateProgressBar() and related.
Definition: bootanim.c:312
VOID NTAPI InbvSetProgressBarSubset(_In_ ULONG Floor, _In_ ULONG Ceiling)
Specifies a progress percentage sub-range. Further calls to InbvIndicateProgress() or InbvUpdateProgr...
Definition: inbv.c:663
BOOLEAN NTAPI InbvEnableDisplayString(_In_ BOOLEAN Enable)
Definition: inbv.c:369
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
VOID NTAPI InbvAcquireDisplayOwnership(VOID)
Definition: inbv.c:289
static ULONG ResourceCount
Definition: inbv.c:50
unsigned char UCHAR
Definition: xmlstorage.h:181
VOID NTAPI VidScreenToBufferBlt(_Out_writes_bytes_(Delta *Height) PUCHAR Buffer, _In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Width, _In_ ULONG Height, _In_ ULONG Delta)
Definition: bootvid.c:257
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql
Definition: kefuncs.h:792
VOID NTAPI InbvBitBlt(_In_ PUCHAR Buffer, _In_ ULONG X, _In_ ULONG Y)
Definition: inbv.c:530
NTSYSAPI NTSTATUS NTAPI RtlUnicodeStringToOemString(POEM_STRING DestinationString, PCUNICODE_STRING SourceString, BOOLEAN AllocateDestinationString)
Definition: btrfs_drv.h:1866
Definition: typedefs.h:119
static INBV_DISPLAY_STRING_FILTER InbvDisplayFilter
Definition: inbv.c:43
VOID NTAPI InbvSolidColorFill(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Right, _In_ ULONG Bottom, _In_ ULONG Color)
Definition: inbv.c:484
VOID DisplayString(LPWSTR Msg)
Definition: misc.c:211
BOOLEAN NTAPI InbvDriverInitialize(_In_ PLOADER_PARAMETER_BLOCK LoaderBlock, _In_ ULONG Count)
Definition: inbv.c:175
_In_ WDFINTERRUPT _In_ PFN_WDF_INTERRUPT_SYNCHRONIZE Callback
Definition: wdfinterrupt.h:456
const LUID SeTcbPrivilege
Definition: priv.c:26
#define RtlComputeCrc32
Definition: compat.h:669
#define DISPATCH_LEVEL
Definition: env_spec_w32.h:696
BOOLEAN NTAPI InbvIsBootDriverInstalled(VOID)
Definition: inbv.c:395
VOID FASTCALL KiReleaseSpinLock(IN PKSPIN_LOCK SpinLock)
Definition: spinlock.c:298
#define RESOURCE_DATA_LEVEL
Definition: ldrtypes.h:33
BOOLEAN NTAPI InbvResetDisplay(VOID)
Definition: inbv.c:430
_CRTIMP char *__cdecl _strupr(_Inout_z_ char *_String)
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:348
#define STATUS_BUFFER_OVERFLOW
Definition: shellext.h:66
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
BOOLEAN NTAPI VidInitialize(_In_ BOOLEAN SetMode)
Definition: bootvid.c:184
unsigned short USHORT
Definition: pedump.c:61
#define RTL_NUMBER_OF(x)
Definition: RtlRegistry.c:12
struct _INBV_PROGRESS_STATE INBV_PROGRESS_STATE
static ULONG Delta
Definition: xboxvideo.c:33
#define STATUS_NO_MEMORY
Definition: ntstatus.h:260
ULONG KSPIN_LOCK
Definition: env_spec_w32.h:72
UNICODE_STRING BaseDllName
Definition: ldrtypes.h:145
#define min(a, b)
Definition: monoChain.cc:55
#define NULL
Definition: types.h:112
NTSYSAPI DWORD WINAPI RtlUnicodeStringToOemSize(const UNICODE_STRING *)
VOID FASTCALL KiAcquireSpinLock(IN PKSPIN_LOCK SpinLock)
Definition: spinlock.c:287
VOID NTAPI KeRaiseIrql(KIRQL NewIrql, PKIRQL OldIrql)
Definition: spinlock.c:27
#define MAXUSHORT
Definition: typedefs.h:83
ULONG_PTR Language
Definition: ldrtypes.h:183
BOOLEAN NTAPI SeSinglePrivilegeCheck(_In_ LUID PrivilegeValue, _In_ KPROCESSOR_MODE PreviousMode)
Checks if a single privilege is present in the context of the calling thread.
Definition: priv.c:744
static INBV_DISPLAY_STATE InbvDisplayState
Definition: inbv.c:38
VOID NTAPI InbvEnableBootDriver(_In_ BOOLEAN Enable)
Definition: inbv.c:257
VOID NTAPI VidBufferToScreenBlt(_In_reads_bytes_(Delta *Height) PUCHAR Buffer, _In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Width, _In_ ULONG Height, _In_ ULONG Delta)
Definition: common.c:452
unsigned int ULONG
Definition: retypes.h:1
static ULONG InbvTerminalBkgdColor
Definition: inbv.c:89
VOID(NTAPI * INBV_DISPLAY_STRING_FILTER)(_Inout_ PCHAR *String)
Definition: inbvtypes.h:50
ULONG ProgressBarTop
Definition: inbv.c:45
static KSPIN_LOCK BootDriverLock
Definition: inbv.c:36
#define STATUS_SUCCESS
Definition: shellext.h:65
BOOLEAN InbvBootDriverInstalled
Definition: inbv.c:39
BOOLEAN NTAPI InbvCheckDisplayOwnership(VOID)
Definition: inbv.c:315
VOID NTAPI KeLowerIrql(KIRQL NewIrql)
Definition: spinlock.c:39
VOID NTAPI InbvScreenToBufferBlt(_Out_ PUCHAR Buffer, _In_ ULONG X, _In_ ULONG Y, _In_ ULONG Width, _In_ ULONG Height, _In_ ULONG Delta)
Definition: inbv.c:571
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1099
static CODE_SEG("PAGE")
Definition: isapnp.c:1482
NTSYSAPI BOOLEAN NTAPI RtlEqualUnicodeString(PUNICODE_STRING String1, PUNICODE_STRING String2, BOOLEAN CaseInSensitive)
static LPHIST_ENTRY Top
Definition: history.c:53
VOID NTAPI InbvSetTextColor(_In_ ULONG Color)
Definition: inbv.c:459
BOOLEAN ShowProgressBar
Definition: inbv.c:46
#define PAGED_CODE()
#define RTL_CONSTANT_STRING(s)
Definition: tunneltest.c:14
VOID NTAPI InbvSetProgressBarCoordinates(_In_ ULONG Left, _In_ ULONG Top)
Sets the screen coordinates of the loading progress bar and enable it.
Definition: inbv.c:600