ReactOS  0.4.15-dev-425-gc40b086
inbv.c File Reference
#include <ntoskrnl.h>
#include <debug.h>
#include "inbv/logo.h"
Include dependency graph for inbv.c:

Go to the source code of this file.

Classes

struct  _INBV_PROGRESS_STATE
 
struct  _BT_PROGRESS_INDICATOR
 
struct  tagRGBQUAD
 
struct  tagBITMAPINFOHEADER
 

Macros

#define NDEBUG
 
#define MM_READONLY   1
 
#define MM_READWRITE   4
 
#define TAG_OSTR   'RTSO'
 
#define INBV_ROTBAR_IMPLEMENTED
 
#define ROT_BAR_DEFAULT_MODE   RB_PROGRESS_BAR
 
#define PALETTE_FADE_STEPS   12
 
#define PALETTE_FADE_TIME   (15 * 1000) /* 15 ms */
 

Typedefs

typedef struct _INBV_PROGRESS_STATE INBV_PROGRESS_STATE
 
typedef struct _BT_PROGRESS_INDICATOR BT_PROGRESS_INDICATOR
 
typedef struct _BT_PROGRESS_INDICATORPBT_PROGRESS_INDICATOR
 
typedef enum _ROT_BAR_TYPE ROT_BAR_TYPE
 
typedef enum _BBLT_VERT_ALIGNMENT BBLT_VERT_ALIGNMENT
 
typedef enum _BBLT_HORZ_ALIGNMENT BBLT_HORZ_ALIGNMENT
 
typedef enum _ROT_BAR_STATUS ROT_BAR_STATUS
 
typedef struct tagRGBQUAD RGBQUAD
 
typedef struct tagRGBQUADLPRGBQUAD
 
typedef struct tagBITMAPINFOHEADER BITMAPINFOHEADER
 
typedef struct tagBITMAPINFOHEADERPBITMAPINFOHEADER
 

Enumerations

enum  _ROT_BAR_TYPE { RB_UNSPECIFIED, RB_SQUARE_CELLS, RB_PROGRESS_BAR }
 
enum  _BBLT_VERT_ALIGNMENT { AL_VERTICAL_TOP = 0, AL_VERTICAL_CENTER, AL_VERTICAL_BOTTOM }
 
enum  _BBLT_HORZ_ALIGNMENT { AL_HORIZONTAL_LEFT = 0, AL_HORIZONTAL_CENTER, AL_HORIZONTAL_RIGHT }
 
enum  _ROT_BAR_STATUS { RBS_FADEIN = 1, RBS_ANIMATE, RBS_STOP_ANIMATE, RBS_STATUS_MAX }
 

Functions

VOID NTAPI InbvAcquireLock (VOID)
 
VOID NTAPI InbvReleaseLock (VOID)
 
static VOID BootLogoFadeIn (VOID)
 
static VOID BitBltPalette (IN PVOID Image, IN BOOLEAN NoPalette, IN ULONG X, IN ULONG Y)
 
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)
 
INIT_FUNCTION PVOID NTAPI FindBitmapResource (IN PLOADER_PARAMETER_BLOCK LoaderBlock, IN ULONG ResourceId)
 
INIT_FUNCTION BOOLEAN NTAPI InbvDriverInitialize (IN PLOADER_PARAMETER_BLOCK LoaderBlock, IN ULONG Count)
 
VOID NTAPI InbvEnableBootDriver (IN BOOLEAN Enable)
 
VOID NTAPI InbvAcquireDisplayOwnership (VOID)
 
VOID NTAPI InbvSetDisplayOwnership (IN BOOLEAN DisplayOwned)
 
BOOLEAN NTAPI InbvCheckDisplayOwnership (VOID)
 
INBV_DISPLAY_STATE NTAPI InbvGetDisplayState (VOID)
 
BOOLEAN NTAPI InbvDisplayString (IN PCHAR String)
 
BOOLEAN NTAPI InbvEnableDisplayString (IN BOOLEAN Enable)
 
VOID NTAPI InbvInstallDisplayStringFilter (IN INBV_DISPLAY_STRING_FILTER Filter)
 
BOOLEAN NTAPI InbvIsBootDriverInstalled (VOID)
 
VOID NTAPI InbvNotifyDisplayOwnershipLost (IN INBV_RESET_DISPLAY_PARAMETERS Callback)
 
BOOLEAN NTAPI InbvResetDisplay (VOID)
 
VOID NTAPI InbvSetScrollRegion (IN ULONG Left, IN ULONG Top, IN ULONG Right, IN ULONG Bottom)
 
VOID NTAPI InbvSetTextColor (IN ULONG Color)
 
VOID NTAPI InbvSolidColorFill (IN ULONG Left, IN ULONG Top, IN ULONG Right, IN ULONG Bottom, IN ULONG Color)
 
INIT_FUNCTION VOID NTAPI InbvUpdateProgressBar (IN ULONG Progress)
 
VOID NTAPI InbvBufferToScreenBlt (IN PUCHAR Buffer, IN ULONG X, IN ULONG Y, IN ULONG Width, IN ULONG Height, IN ULONG Delta)
 
VOID NTAPI InbvBitBlt (IN PUCHAR Buffer, IN ULONG X, IN ULONG Y)
 
VOID NTAPI InbvScreenToBufferBlt (OUT PUCHAR Buffer, IN ULONG X, IN ULONG Y, IN ULONG Width, IN ULONG Height, IN ULONG Delta)
 
INIT_FUNCTION VOID NTAPI InbvSetProgressBarCoordinates (IN ULONG Left, IN ULONG Top, IN ULONG Width, IN ULONG Height)
 
INIT_FUNCTION VOID NTAPI InbvSetProgressBarSubset (IN ULONG Floor, IN ULONG Ceiling)
 
INIT_FUNCTION VOID NTAPI InbvIndicateProgress (VOID)
 
PUCHAR NTAPI InbvGetResourceAddress (IN ULONG ResourceNumber)
 
NTSTATUS NTAPI NtDisplayString (IN PUNICODE_STRING DisplayString)
 
static VOID NTAPI InbvRotationThread (_In_ PVOID Context)
 
INIT_FUNCTION VOID NTAPI InbvRotBarInit (VOID)
 
INIT_FUNCTION VOID NTAPI DisplayBootBitmap (IN BOOLEAN TextMode)
 
INIT_FUNCTION VOID NTAPI DisplayFilter (PCHAR *String)
 
INIT_FUNCTION VOID NTAPI FinalizeBootLogo (VOID)
 

Variables

static KSPIN_LOCK BootDriverLock
 
static KIRQL InbvOldIrql
 
static INBV_DISPLAY_STATE InbvDisplayState = INBV_DISPLAY_STATE_DISABLED
 
BOOLEAN InbvBootDriverInstalled = FALSE
 
static BOOLEAN InbvDisplayDebugStrings = FALSE
 
static INBV_DISPLAY_STRING_FILTER InbvDisplayFilter = NULL
 
static ULONG ProgressBarLeft = 0
 
static ULONG ProgressBarTop = 0
 
static ULONG ProgressBarWidth = 0
 
static ULONG ProgressBarHeight = 0
 
static BOOLEAN ShowProgressBar = FALSE
 
static INBV_PROGRESS_STATE InbvProgressState
 
static BT_PROGRESS_INDICATOR InbvProgressIndicator = {0, 25, 0}
 
static INBV_RESET_DISPLAY_PARAMETERS InbvResetDisplayParameters = NULL
 
static ULONG ResourceCount = 0
 
static PUCHAR ResourceList [1+IDB_MAX_RESOURCE]
 
static BOOLEAN RotBarThreadActive = FALSE
 
static ROT_BAR_TYPE RotBarSelection = RB_UNSPECIFIED
 
static ROT_BAR_STATUS PltRotBarStatus = 0
 
static UCHAR RotBarBuffer [24 *9]
 
static UCHAR RotLineBuffer [SCREEN_WIDTH *6]
 
static ULONG InbvTerminalTextColor = 37
 
static ULONG InbvTerminalBkgdColor = 40
 
static RGBQUAD MainPalette [16]
 

Macro Definition Documentation

◆ INBV_ROTBAR_IMPLEMENTED

#define INBV_ROTBAR_IMPLEMENTED

Definition at line 78 of file inbv.c.

◆ MM_READONLY

#define MM_READONLY   1

Definition at line 11 of file inbv.c.

◆ MM_READWRITE

#define MM_READWRITE   4

Definition at line 12 of file inbv.c.

◆ NDEBUG

#define NDEBUG

Definition at line 5 of file inbv.c.

◆ PALETTE_FADE_STEPS

#define PALETTE_FADE_STEPS   12

Definition at line 176 of file inbv.c.

◆ PALETTE_FADE_TIME

#define PALETTE_FADE_TIME   (15 * 1000) /* 15 ms */

Definition at line 177 of file inbv.c.

◆ ROT_BAR_DEFAULT_MODE

#define ROT_BAR_DEFAULT_MODE   RB_PROGRESS_BAR

Definition at line 99 of file inbv.c.

◆ TAG_OSTR

#define TAG_OSTR   'RTSO'

Definition at line 15 of file inbv.c.

Typedef Documentation

◆ BBLT_HORZ_ALIGNMENT

◆ BBLT_VERT_ALIGNMENT

◆ BITMAPINFOHEADER

From bootvid/precomp.h

◆ BT_PROGRESS_INDICATOR

◆ INBV_PROGRESS_STATE

◆ LPRGBQUAD

◆ PBITMAPINFOHEADER

◆ PBT_PROGRESS_INDICATOR

◆ RGBQUAD

From include/psdk/wingdi.h

◆ ROT_BAR_STATUS

◆ ROT_BAR_TYPE

Enumeration Type Documentation

◆ _BBLT_HORZ_ALIGNMENT

Enumerator
AL_HORIZONTAL_LEFT 
AL_HORIZONTAL_CENTER 
AL_HORIZONTAL_RIGHT 

Definition at line 68 of file inbv.c.

69 {
enum _BBLT_HORZ_ALIGNMENT BBLT_HORZ_ALIGNMENT

◆ _BBLT_VERT_ALIGNMENT

Enumerator
AL_VERTICAL_TOP 
AL_VERTICAL_CENTER 
AL_VERTICAL_BOTTOM 

Definition at line 61 of file inbv.c.

62 {
63  AL_VERTICAL_TOP = 0,
enum _BBLT_VERT_ALIGNMENT BBLT_VERT_ALIGNMENT

◆ _ROT_BAR_STATUS

Enumerator
RBS_FADEIN 
RBS_ANIMATE 
RBS_STOP_ANIMATE 
RBS_STATUS_MAX 

Definition at line 108 of file inbv.c.

109 {
110  RBS_FADEIN = 1,
111  RBS_ANIMATE,
enum _ROT_BAR_STATUS ROT_BAR_STATUS

◆ _ROT_BAR_TYPE

Enumerator
RB_UNSPECIFIED 
RB_SQUARE_CELLS 
RB_PROGRESS_BAR 

Definition at line 51 of file inbv.c.

52 {
56 } ROT_BAR_TYPE;
enum _ROT_BAR_TYPE ROT_BAR_TYPE

Function Documentation

◆ BitBltAligned()

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 
)
static

Definition at line 291 of file inbv.c.

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 }
#define Y(I)
#define SCREEN_WIDTH
Definition: pc98video.c:27
static PWSTR Image
Definition: pageheap.c:13
#define SCREEN_HEIGHT
Definition: pc98video.c:28
unsigned int ULONG
Definition: retypes.h:1
#define X(b, s)
static VOID BitBltPalette(IN PVOID Image, IN BOOLEAN NoPalette, IN ULONG X, IN ULONG Y)
Definition: inbv.c:259

Referenced by DisplayBootBitmap().

◆ BitBltPalette()

static VOID BitBltPalette ( IN PVOID  Image,
IN BOOLEAN  NoPalette,
IN ULONG  X,
IN ULONG  Y 
)
static

Definition at line 259 of file inbv.c.

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 }
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
#define Y(I)
unsigned char * PUCHAR
Definition: retypes.h:3
static PWSTR Image
Definition: pageheap.c:13
ULONG RGBQUAD
Definition: precomp.h:50
#define RTL_NUMBER_OF(x)
Definition: RtlRegistry.c:12
VOID NTAPI InbvBitBlt(IN PUCHAR Buffer, IN ULONG X, IN ULONG Y)
Definition: inbv.c:810
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
static RGBQUAD MainPalette[16]
Definition: inbv.c:174
struct tagRGBQUAD * LPRGBQUAD

Referenced by BitBltAligned(), and DisplayBootBitmap().

◆ BootLogoFadeIn()

static VOID BootLogoFadeIn ( VOID  )
static

Definition at line 206 of file inbv.c.

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 }
struct tagBITMAPINFOHEADER * PBITMAPINFOHEADER
USHORT biBitCount
Definition: precomp.h:37
#define PALETTE_FADE_STEPS
Definition: inbv.c:176
#define PALETTE_FADE_TIME
Definition: inbv.c:177
UCHAR rgbBlue
Definition: inbv.c:167
UCHAR rgbGreen
Definition: inbv.c:168
VOID NTAPI InbvReleaseLock(VOID)
Definition: inbv.c:481
UCHAR rgbRed
Definition: inbv.c:169
struct tagBITMAPINFOHEADER BITMAPINFOHEADER
NTSTATUS NTAPI KeDelayExecutionThread(IN KPROCESSOR_MODE WaitMode, IN BOOLEAN Alertable, IN PLARGE_INTEGER Interval OPTIONAL)
Definition: wait.c:283
VOID NTAPI InbvAcquireLock(VOID)
Definition: inbv.c:459
VOID NTAPI VidBitBlt(_In_ PUCHAR Buffer, _In_ ULONG Left, _In_ ULONG Top)
Definition: common.c:466
static const UCHAR Index[8]
Definition: usbohci.c:18
unsigned char UCHAR
Definition: xmlstorage.h:181
#define RTL_NUMBER_OF(x)
Definition: RtlRegistry.c:12
static INBV_DISPLAY_STATE InbvDisplayState
Definition: inbv.c:82
unsigned int ULONG
Definition: retypes.h:1
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
BOOLEAN InbvBootDriverInstalled
Definition: inbv.c:83
static RGBQUAD MainPalette[16]
Definition: inbv.c:174
LONGLONG QuadPart
Definition: typedefs.h:113
struct tagRGBQUAD * LPRGBQUAD

Referenced by DisplayBootBitmap().

◆ DisplayBootBitmap()

INIT_FUNCTION VOID NTAPI DisplayBootBitmap ( IN BOOLEAN  TextMode)

Definition at line 1086 of file inbv.c.

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 }
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 IDB_SERVER_FOOTER
Definition: resource.h:25
#define TRUE
Definition: types.h:120
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
static VOID BootLogoFadeIn(VOID)
Definition: inbv.c:206
unsigned char * PUCHAR
Definition: retypes.h:3
LONG NTSTATUS
Definition: precomp.h:26
#define SCREEN_WIDTH
Definition: pc98video.c:27
#define VID_SKU_SAVE_AREA_LEFT
Definition: logo.h:28
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_FOOTER_BG_TOP
Definition: logo.h:34
#define VID_SCROLL_AREA_BOTTOM
Definition: logo.h:10
VOID NTAPI InbvSolidColorFill(IN ULONG Left, IN ULONG Top, IN ULONG Right, IN ULONG Bottom, IN ULONG Color)
Definition: inbv.c:716
#define BV_COLOR_WHITE
Definition: display.h:30
#define VID_SKU_AREA_LEFT
Definition: logo.h:23
#define VID_SCROLL_AREA_TOP
Definition: logo.h:8
#define VID_SKU_AREA_BOTTOM
Definition: logo.h:26
BOOLEAN NTAPI ExVerifySuite(SUITE_TYPE SuiteType)
Definition: sysinfo.c:377
enum _ROT_BAR_TYPE ROT_BAR_TYPE
static UCHAR RotBarBuffer[24 *9]
Definition: inbv.c:119
static UCHAR RotLineBuffer[SCREEN_WIDTH *6]
Definition: inbv.c:120
VOID NTAPI InbvReleaseLock(VOID)
Definition: inbv.c:481
BOOLEAN BootLogo
Definition: winldr.c:34
#define VID_SKU_TEXT_TOP
Definition: logo.h:32
Definition: Header.h:8
#define IDB_PROGRESS_BAR
Definition: resource.h:43
INIT_FUNCTION VOID NTAPI InbvSetProgressBarCoordinates(IN ULONG Left, IN ULONG Top, IN ULONG Width, IN ULONG Height)
Definition: inbv.c:850
#define IDB_SERVER_LOGO
Definition: resource.h:23
BOOLEAN NTAPI MmChangeKernelResourceSectionProtection(IN ULONG_PTR ProtectionMask)
Definition: sysldr.c:2286
#define VID_SCROLL_AREA_LEFT
Definition: logo.h:7
smooth NULL
Definition: ftsmooth.c:416
VOID NTAPI InbvAcquireLock(VOID)
Definition: inbv.c:459
Definition: bufpool.h:45
#define IDB_COPYRIGHT
Definition: resource.h:44
#define IDB_LOGO_DEFAULT
Definition: resource.h:15
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
#define SCREEN_HEIGHT
Definition: pc98video.c:28
#define MM_READONLY
Definition: inbv.c:11
#define IDB_BAR_DEFAULT
Definition: resource.h:14
static VOID NTAPI InbvRotationThread(_In_ PVOID Context)
Definition: inbv.c:984
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define ROT_BAR_DEFAULT_MODE
Definition: inbv.c:99
#define VID_SKU_AREA_RIGHT
Definition: logo.h:25
INIT_FUNCTION VOID NTAPI DisplayFilter(PCHAR *String)
Definition: inbv.c:1370
#define BV_COLOR_CYAN
Definition: display.h:21
#define BV_COLOR_DARK_GRAY
Definition: display.h:22
#define SharedUserData
unsigned char UCHAR
Definition: xmlstorage.h:181
NTSTATUS NTAPI ObCloseHandle(IN HANDLE Handle, IN KPROCESSOR_MODE AccessMode)
Definition: obhandle.c:3376
#define MM_READWRITE
Definition: inbv.c:12
#define BV_COLOR_LIGHT_CYAN
Definition: display.h:29
#define VID_PROGRESS_BAR_TOP
Definition: logo.h:13
static ROT_BAR_TYPE RotBarSelection
Definition: inbv.c:117
#define VID_PROGRESS_BAR_HEIGHT
Definition: logo.h:15
Status
Definition: gdiplustypes.h:24
#define VID_SCROLL_AREA_RIGHT
Definition: logo.h:9
BOOLEAN ExpInTextModeSetup
Definition: init.c:67
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
#define IDB_WKSTA_FOOTER
Definition: resource.h:18
static BOOLEAN RotBarThreadActive
Definition: inbv.c:116
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
VOID NTAPI InbvInstallDisplayStringFilter(IN INBV_DISPLAY_STRING_FILTER Filter)
Definition: inbv.c:622
#define BV_COLOR_BLACK
Definition: display.h:15
#define VID_SKU_AREA_TOP
Definition: logo.h:24
#define VID_SKU_SAVE_AREA_TOP
Definition: logo.h:29
#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
PUCHAR NTAPI InbvGetResourceAddress(IN ULONG ResourceNumber)
Definition: inbv.c:905
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
#define BV_COLOR_RED
Definition: display.h:16
static RGBQUAD MainPalette[16]
Definition: inbv.c:174
#define IDB_CLUSTER_SERVER
Definition: resource.h:38
static BOOLEAN ShowProgressBar
Definition: inbv.c:88
#define IDB_WKSTA_HEADER
Definition: resource.h:17
char * Text
Definition: combotst.c:136
#define IDB_SERVER_HEADER
Definition: resource.h:24
static VOID BitBltPalette(IN PVOID Image, IN BOOLEAN NoPalette, IN ULONG X, IN ULONG Y)
Definition: inbv.c:259
struct tagRGBQUAD * LPRGBQUAD

Referenced by DisplayFilter(), and Phase1InitializationDiscard().

◆ DisplayFilter()

INIT_FUNCTION VOID NTAPI DisplayFilter ( PCHAR String)

Definition at line 1370 of file inbv.c.

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 }
#define TRUE
Definition: types.h:120
static WCHAR String[]
Definition: stringtable.c:55
unsigned char BOOLEAN
smooth NULL
Definition: ftsmooth.c:416
VOID NTAPI InbvInstallDisplayStringFilter(IN INBV_DISPLAY_STRING_FILTER Filter)
Definition: inbv.c:622
INIT_FUNCTION VOID NTAPI DisplayBootBitmap(IN BOOLEAN TextMode)
Definition: inbv.c:1086
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469

Referenced by DisplayBootBitmap().

◆ FinalizeBootLogo()

INIT_FUNCTION VOID NTAPI FinalizeBootLogo ( VOID  )

Definition at line 1394 of file inbv.c.

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 }
INBV_DISPLAY_STATE NTAPI InbvGetDisplayState(VOID)
Definition: inbv.c:561
#define SCREEN_WIDTH
Definition: pc98video.c:27
VOID NTAPI InbvReleaseLock(VOID)
Definition: inbv.c:481
VOID NTAPI InbvAcquireLock(VOID)
Definition: inbv.c:459
static ROT_BAR_STATUS PltRotBarStatus
Definition: inbv.c:118
#define SCREEN_HEIGHT
Definition: pc98video.c:28
VOID NTAPI VidSolidColorFill(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Right, _In_ ULONG Bottom, _In_ UCHAR Color)
Definition: bootvid.c:274
static BOOLEAN RotBarThreadActive
Definition: inbv.c:116
#define BV_COLOR_BLACK
Definition: display.h:15

Referenced by Phase1InitializationDiscard().

◆ FindBitmapResource()

INIT_FUNCTION PVOID NTAPI FindBitmapResource ( IN PLOADER_PARAMETER_BLOCK  LoaderBlock,
IN ULONG  ResourceId 
)

Definition at line 353 of file inbv.c.

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 }
#define TRUE
Definition: types.h:120
LONG NTSTATUS
Definition: precomp.h:26
ULONG_PTR Type
Definition: ldrtypes.h:181
PVOID DllBase
Definition: btrfs_drv.h:1926
ULONG_PTR Name
Definition: ldrtypes.h:182
smooth NULL
Definition: ftsmooth.c:416
_In_ LPGUID _In_ PVOID Data
Definition: classpnp.h:778
Definition: pedump.c:457
NTSTATUS NTAPI LdrFindResource_U(_In_ PVOID BaseAddress, _In_ PLDR_RESOURCE_INFO ResourceInfo, _In_ ULONG Level, _Out_ PIMAGE_RESOURCE_DATA_ENTRY *ResourceDataEntry)
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)
struct _LIST_ENTRY * Flink
Definition: typedefs.h:120
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
ULONG_PTR KiBugCheckData[5]
Definition: bug.c:31
static const WCHAR L[]
Definition: oid.c:1250
Definition: btrfs_drv.h:1922
Definition: typedefs.h:118
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:361
Status
Definition: gdiplustypes.h:24
#define RESOURCE_DATA_LEVEL
Definition: ldrtypes.h:33
NTSYSAPI ULONG NTAPI RtlComputeCrc32(_In_ ULONG InitialCrc, _In_ PUCHAR Buffer, _In_ ULONG Length)
UNICODE_STRING BaseDllName
Definition: ldrtypes.h:145
ULONG_PTR Language
Definition: ldrtypes.h:183
unsigned int ULONG
Definition: retypes.h:1
NTSYSAPI BOOLEAN NTAPI RtlEqualUnicodeString(PUNICODE_STRING String1, PUNICODE_STRING String2, BOOLEAN CaseInSensitive)
#define RTL_CONSTANT_STRING(s)
Definition: tunneltest.c:14

Referenced by InbvDriverInitialize().

◆ InbvAcquireDisplayOwnership()

VOID NTAPI InbvAcquireDisplayOwnership ( VOID  )

Definition at line 528 of file inbv.c.

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 }
static INBV_RESET_DISPLAY_PARAMETERS InbvResetDisplayParameters
Definition: inbv.c:91
static INBV_DISPLAY_STATE InbvDisplayState
Definition: inbv.c:82

Referenced by HalHandleNMI(), HalReturnToFirmware(), KdpScreenAcquire(), KiDisplayBlueScreen(), and PopShutdownHandler().

◆ InbvAcquireLock()

VOID NTAPI InbvAcquireLock ( VOID  )

Definition at line 459 of file inbv.c.

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 }
#define KeGetCurrentIrql()
Definition: env_spec_w32.h:706
#define KeRaiseIrql(irql, oldIrql)
Definition: env_spec_w32.h:597
UCHAR KIRQL
Definition: env_spec_w32.h:591
BOOLEAN FASTCALL KeTestSpinLock(IN PKSPIN_LOCK SpinLock)
Definition: spinlock.c:442
static KIRQL InbvOldIrql
Definition: inbv.c:81
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql
Definition: kefuncs.h:790
#define DISPATCH_LEVEL
Definition: env_spec_w32.h:696
VOID FASTCALL KiAcquireSpinLock(IN PKSPIN_LOCK SpinLock)
Definition: ntoskrnl.c:28
static KSPIN_LOCK BootDriverLock
Definition: inbv.c:80

Referenced by BootLogoFadeIn(), DisplayBootBitmap(), FinalizeBootLogo(), InbvBitBlt(), InbvDisplayString(), InbvEnableBootDriver(), InbvNotifyDisplayOwnershipLost(), InbvRotationThread(), InbvSolidColorFill(), and InbvUpdateProgressBar().

◆ InbvBitBlt()

VOID NTAPI InbvBitBlt ( IN PUCHAR  Buffer,
IN ULONG  X,
IN ULONG  Y 
)

Definition at line 810 of file inbv.c.

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 }
#define Y(I)
VOID NTAPI InbvReleaseLock(VOID)
Definition: inbv.c:481
VOID NTAPI InbvAcquireLock(VOID)
Definition: inbv.c:459
Definition: bufpool.h:45
VOID NTAPI VidBitBlt(_In_ PUCHAR Buffer, _In_ ULONG Left, _In_ ULONG Top)
Definition: common.c:466
static INBV_DISPLAY_STATE InbvDisplayState
Definition: inbv.c:82
BOOLEAN InbvBootDriverInstalled
Definition: inbv.c:83

Referenced by BitBltPalette(), and PopShutdownHandler().

◆ InbvBufferToScreenBlt()

VOID NTAPI InbvBufferToScreenBlt ( IN PUCHAR  Buffer,
IN ULONG  X,
IN ULONG  Y,
IN ULONG  Width,
IN ULONG  Height,
IN ULONG  Delta 
)

Definition at line 792 of file inbv.c.

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 }
#define Y(I)
Definition: bufpool.h:45
static ULONG Delta
Definition: xboxvideo.c:32
static INBV_DISPLAY_STATE InbvDisplayState
Definition: inbv.c:82
BOOLEAN InbvBootDriverInstalled
Definition: inbv.c:83
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

Referenced by DisplayBootBitmap().

◆ InbvCheckDisplayOwnership()

BOOLEAN NTAPI InbvCheckDisplayOwnership ( VOID  )

Definition at line 553 of file inbv.c.

554 {
555  /* Return if we own it or not */
557 }
static INBV_DISPLAY_STATE InbvDisplayState
Definition: inbv.c:82

Referenced by InbvMonitorThread(), KdpScreenRelease(), and PopShutdownHandler().

◆ InbvDisplayString()

BOOLEAN NTAPI InbvDisplayString ( IN PCHAR  String)

Definition at line 569 of file inbv.c.

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 }
#define TRUE
Definition: types.h:120
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
unsigned char * PUCHAR
Definition: retypes.h:3
static WCHAR String[]
Definition: stringtable.c:55
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
VOID NTAPI InbvReleaseLock(VOID)
Definition: inbv.c:481
#define ANSI_NULL
smooth NULL
Definition: ftsmooth.c:416
static BOOLEAN InbvDisplayDebugStrings
Definition: inbv.c:84
VOID NTAPI InbvAcquireLock(VOID)
Definition: inbv.c:459
static INBV_DISPLAY_STRING_FILTER InbvDisplayFilter
Definition: inbv.c:85
VOID NTAPI VidDisplayString(_In_ PUCHAR String)
Definition: common.c:370
static INBV_DISPLAY_STATE InbvDisplayState
Definition: inbv.c:82
BOOLEAN InbvBootDriverInstalled
Definition: inbv.c:83

Referenced by HalDisplayString(), HalHandleNMI(), KeBugCheckWithTf(), KeGetBugMessageText(), KiDisplayBlueScreen(), KiDumpParameterImages(), NtDisplayString(), Phase1InitializationDiscard(), and PopShutdownHandler().

◆ InbvDriverInitialize()

INIT_FUNCTION BOOLEAN NTAPI InbvDriverInitialize ( IN PLOADER_PARAMETER_BLOCK  LoaderBlock,
IN ULONG  Count 
)

Definition at line 418 of file inbv.c.

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 }
signed char * PCHAR
Definition: retypes.h:7
#define TRUE
Definition: types.h:120
char * strstr(char *String1, char *String2)
Definition: utclib.c:653
_Inout_ __drv_aliasesMem PSLIST_ENTRY _Inout_ PSLIST_ENTRY _In_ ULONG Count
Definition: exfuncs.h:1015
static PUCHAR ResourceList[1+IDB_MAX_RESOURCE]
Definition: inbv.c:93
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
FORCEINLINE VOID KeInitializeSpinLock(_Out_ PKSPIN_LOCK SpinLock)
Definition: kefuncs.h:238
unsigned char BOOLEAN
smooth NULL
Definition: ftsmooth.c:416
INIT_FUNCTION PVOID NTAPI FindBitmapResource(IN PLOADER_PARAMETER_BLOCK LoaderBlock, IN ULONG ResourceId)
Definition: inbv.c:353
static ULONG ResourceCount
Definition: inbv.c:92
_CRTIMP char *__cdecl _strupr(_Inout_z_ char *_String)
BOOLEAN NTAPI VidInitialize(_In_ BOOLEAN SetMode)
Definition: bootvid.c:184
#define RTL_NUMBER_OF(x)
Definition: RtlRegistry.c:12
#define min(a, b)
Definition: monoChain.cc:55
static INBV_DISPLAY_STATE InbvDisplayState
Definition: inbv.c:82
unsigned int ULONG
Definition: retypes.h:1
static KSPIN_LOCK BootDriverLock
Definition: inbv.c:80
BOOLEAN InbvBootDriverInstalled
Definition: inbv.c:83
INIT_FUNCTION VOID NTAPI InbvSetProgressBarSubset(IN ULONG Floor, IN ULONG Ceiling)
Definition: inbv.c:868

Referenced by Phase1InitializationDiscard().

◆ InbvEnableBootDriver()

VOID NTAPI InbvEnableBootDriver ( IN BOOLEAN  Enable)

Definition at line 497 of file inbv.c.

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 }
_In_ ULONGLONG _In_ ULONGLONG _In_ BOOLEAN Enable
Definition: ntddpcm.h:140
VOID NTAPI InbvReleaseLock(VOID)
Definition: inbv.c:481
VOID NTAPI VidCleanUp(VOID)
Definition: bootvid.c:246
VOID NTAPI InbvAcquireLock(VOID)
Definition: inbv.c:459
static INBV_DISPLAY_STATE InbvDisplayState
Definition: inbv.c:82
BOOLEAN InbvBootDriverInstalled
Definition: inbv.c:83

Referenced by Phase1InitializationDiscard().

◆ InbvEnableDisplayString()

BOOLEAN NTAPI InbvEnableDisplayString ( IN BOOLEAN  Enable)

Definition at line 606 of file inbv.c.

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 }
_In_ ULONGLONG _In_ ULONGLONG _In_ BOOLEAN Enable
Definition: ntddpcm.h:140
unsigned char BOOLEAN
static BOOLEAN InbvDisplayDebugStrings
Definition: inbv.c:84

Referenced by HalHandleNMI(), KdpScreenAcquire(), KiDisplayBlueScreen(), Phase1InitializationDiscard(), and PopShutdownHandler().

◆ InbvGetDisplayState()

INBV_DISPLAY_STATE NTAPI InbvGetDisplayState ( VOID  )

Definition at line 561 of file inbv.c.

562 {
563  /* Return the actual state */
564  return InbvDisplayState;
565 }
static INBV_DISPLAY_STATE InbvDisplayState
Definition: inbv.c:82

Referenced by FinalizeBootLogo().

◆ InbvGetResourceAddress()

PUCHAR NTAPI InbvGetResourceAddress ( IN ULONG  ResourceNumber)

Definition at line 905 of file inbv.c.

906 {
907  /* Validate the resource number */
908  if (ResourceNumber > ResourceCount) return NULL;
909 
910  /* Return the address */
911  return ResourceList[ResourceNumber];
912 }
static PUCHAR ResourceList[1+IDB_MAX_RESOURCE]
Definition: inbv.c:93
smooth NULL
Definition: ftsmooth.c:416
static ULONG ResourceCount
Definition: inbv.c:92

Referenced by DisplayBootBitmap(), and PopShutdownHandler().

◆ InbvIndicateProgress()

INIT_FUNCTION VOID NTAPI InbvIndicateProgress ( VOID  )

Definition at line 884 of file inbv.c.

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 }
static BT_PROGRESS_INDICATOR InbvProgressIndicator
Definition: inbv.c:90
INIT_FUNCTION VOID NTAPI InbvUpdateProgressBar(IN ULONG Progress)
Definition: inbv.c:762
#define min(a, b)
Definition: monoChain.cc:55
unsigned int ULONG
Definition: retypes.h:1

Referenced by IopInitializeBuiltinDriver(), and IopInitializeSystemDrivers().

◆ InbvInstallDisplayStringFilter()

VOID NTAPI InbvInstallDisplayStringFilter ( IN INBV_DISPLAY_STRING_FILTER  Filter)

Definition at line 622 of file inbv.c.

623 {
624  /* Save the filter */
626 }
_Must_inspect_result_ _In_opt_ PFLT_FILTER Filter
Definition: fltkernel.h:1802
static INBV_DISPLAY_STRING_FILTER InbvDisplayFilter
Definition: inbv.c:85

Referenced by DisplayBootBitmap(), DisplayFilter(), HalHandleNMI(), KdpScreenAcquire(), and KiDisplayBlueScreen().

◆ InbvIsBootDriverInstalled()

BOOLEAN NTAPI InbvIsBootDriverInstalled ( VOID  )

Definition at line 630 of file inbv.c.

631 {
632  /* Return driver state */
634 }
BOOLEAN InbvBootDriverInstalled
Definition: inbv.c:83

Referenced by HalHandleNMI(), KdpScreenAcquire(), KdpScreenRelease(), KiDisplayBlueScreen(), and PopShutdownHandler().

◆ InbvNotifyDisplayOwnershipLost()

VOID NTAPI InbvNotifyDisplayOwnershipLost ( IN INBV_RESET_DISPLAY_PARAMETERS  Callback)

Definition at line 638 of file inbv.c.

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 }
static INBV_RESET_DISPLAY_PARAMETERS InbvResetDisplayParameters
Definition: inbv.c:91
VOID NTAPI InbvReleaseLock(VOID)
Definition: inbv.c:481
VOID NTAPI VidCleanUp(VOID)
Definition: bootvid.c:246
VOID NTAPI InbvAcquireLock(VOID)
Definition: inbv.c:459
static INBV_DISPLAY_STATE InbvDisplayState
Definition: inbv.c:82
BOOLEAN InbvBootDriverInstalled
Definition: inbv.c:83
LPFNPSPCALLBACK Callback
Definition: desk.c:112

Referenced by InbvMonitorThread(), IntVideoPortInbvCleanup(), IntVideoPortInbvInitialize(), KdpScreenRelease(), Phase1InitializationDiscard(), ScrInbvCleanup(), and ScrInbvInitialize().

◆ InbvReleaseLock()

VOID NTAPI InbvReleaseLock ( VOID  )

Definition at line 481 of file inbv.c.

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 }
#define KeLowerIrql(oldIrql)
Definition: env_spec_w32.h:602
UCHAR KIRQL
Definition: env_spec_w32.h:591
VOID FASTCALL KiReleaseSpinLock(IN PKSPIN_LOCK SpinLock)
Definition: ntoskrnl.c:35
static KIRQL InbvOldIrql
Definition: inbv.c:81
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql
Definition: kefuncs.h:790
#define DISPATCH_LEVEL
Definition: env_spec_w32.h:696
static KSPIN_LOCK BootDriverLock
Definition: inbv.c:80

Referenced by BootLogoFadeIn(), DisplayBootBitmap(), FinalizeBootLogo(), InbvBitBlt(), InbvDisplayString(), InbvEnableBootDriver(), InbvNotifyDisplayOwnershipLost(), InbvRotationThread(), InbvSolidColorFill(), and InbvUpdateProgressBar().

◆ InbvResetDisplay()

BOOLEAN NTAPI InbvResetDisplay ( VOID  )

Definition at line 664 of file inbv.c.

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 }
#define TRUE
Definition: types.h:120
VOID NTAPI VidResetDisplay(_In_ BOOLEAN HalReset)
Definition: bootvid.c:220
static INBV_DISPLAY_STATE InbvDisplayState
Definition: inbv.c:82
BOOLEAN InbvBootDriverInstalled
Definition: inbv.c:83

Referenced by HalHandleNMI(), KdpScreenAcquire(), KiDisplayBlueScreen(), and PopShutdownHandler().

◆ InbvRotationThread()

static VOID NTAPI InbvRotationThread ( _In_ PVOID  Context)
static

Definition at line 984 of file inbv.c.

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 }
#define Y(I)
#define SCREEN_WIDTH
Definition: pc98video.c:27
static UCHAR RotBarBuffer[24 *9]
Definition: inbv.c:119
static UCHAR RotLineBuffer[SCREEN_WIDTH *6]
Definition: inbv.c:120
VOID NTAPI InbvReleaseLock(VOID)
Definition: inbv.c:481
NTSTATUS NTAPI KeDelayExecutionThread(IN KPROCESSOR_MODE WaitMode, IN BOOLEAN Alertable, IN PLARGE_INTEGER Interval OPTIONAL)
Definition: wait.c:283
VOID NTAPI InbvAcquireLock(VOID)
Definition: inbv.c:459
static ROT_BAR_STATUS PltRotBarStatus
Definition: inbv.c:118
static ULONG ProgressBarLeft
Definition: inbv.c:86
#define SCREEN_HEIGHT
Definition: pc98video.c:28
static const UCHAR Index[8]
Definition: usbohci.c:18
VOID NTAPI VidSolidColorFill(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Right, _In_ ULONG Bottom, _In_ UCHAR Color)
Definition: bootvid.c:274
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
static ROT_BAR_TYPE RotBarSelection
Definition: inbv.c:117
NTSTATUS NTAPI PsTerminateSystemThread(IN NTSTATUS ExitStatus)
Definition: kill.c:1144
#define BV_COLOR_BLACK
Definition: display.h:15
static INBV_DISPLAY_STATE InbvDisplayState
Definition: inbv.c:82
unsigned int ULONG
Definition: retypes.h:1
static ULONG ProgressBarTop
Definition: inbv.c:86
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
return STATUS_SUCCESS
Definition: btrfs.c:3014
#define X(b, s)
LONGLONG QuadPart
Definition: typedefs.h:113

Referenced by DisplayBootBitmap().

◆ InbvRotBarInit()

INIT_FUNCTION VOID NTAPI InbvRotBarInit ( VOID  )

Definition at line 1076 of file inbv.c.

1077 {
1079  /* Perform other initialization if needed */
1080 }
static ROT_BAR_STATUS PltRotBarStatus
Definition: inbv.c:118

Referenced by DisplayBootBitmap().

◆ InbvScreenToBufferBlt()

VOID NTAPI InbvScreenToBufferBlt ( OUT PUCHAR  Buffer,
IN ULONG  X,
IN ULONG  Y,
IN ULONG  Width,
IN ULONG  Height,
IN ULONG  Delta 
)

Definition at line 831 of file inbv.c.

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 }
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 Y(I)
Definition: bufpool.h:45
static ULONG Delta
Definition: xboxvideo.c:32
static INBV_DISPLAY_STATE InbvDisplayState
Definition: inbv.c:82
BOOLEAN InbvBootDriverInstalled
Definition: inbv.c:83

Referenced by DisplayBootBitmap().

◆ InbvSetDisplayOwnership()

VOID NTAPI InbvSetDisplayOwnership ( IN BOOLEAN  DisplayOwned)

Definition at line 544 of file inbv.c.

545 {
546  /* Set the new display state */
547  InbvDisplayState = DisplayOwned ? INBV_DISPLAY_STATE_OWNED :
549 }
static INBV_DISPLAY_STATE InbvDisplayState
Definition: inbv.c:82

◆ InbvSetProgressBarCoordinates()

INIT_FUNCTION VOID NTAPI InbvSetProgressBarCoordinates ( IN ULONG  Left,
IN ULONG  Top,
IN ULONG  Width,
IN ULONG  Height 
)

Definition at line 850 of file inbv.c.

854 {
855  /* Update the coordinates */
856  ProgressBarLeft = Left;
858  ProgressBarWidth = Width;
859  ProgressBarHeight = Height;
860 
861  /* Enable the progress bar */
863 }
#define TRUE
Definition: types.h:120
static ULONG ProgressBarHeight
Definition: inbv.c:87
static ULONG ProgressBarWidth
Definition: inbv.c:87
static ULONG ProgressBarLeft
Definition: inbv.c:86
static ULONG ProgressBarTop
Definition: inbv.c:86
static LPHIST_ENTRY Top
Definition: history.c:53
static BOOLEAN ShowProgressBar
Definition: inbv.c:88

Referenced by DisplayBootBitmap().

◆ InbvSetProgressBarSubset()

INIT_FUNCTION VOID NTAPI InbvSetProgressBarSubset ( IN ULONG  Floor,
IN ULONG  Ceiling 
)

Definition at line 868 of file inbv.c.

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 }
static INBV_PROGRESS_STATE InbvProgressState
Definition: inbv.c:89
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)

Referenced by InbvDriverInitialize(), and Phase1InitializationDiscard().

◆ InbvSetScrollRegion()

VOID NTAPI InbvSetScrollRegion ( IN ULONG  Left,
IN ULONG  Top,
IN ULONG  Right,
IN ULONG  Bottom 
)

Definition at line 681 of file inbv.c.

685 {
686  /* Just call bootvid */
687  VidSetScrollRegion(Left, Top, Right, Bottom);
688 }
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
static LPHIST_ENTRY Top
Definition: history.c:53

Referenced by DisplayBootBitmap(), HalHandleNMI(), KdpScreenAcquire(), KiDisplayBlueScreen(), and PopShutdownHandler().

◆ InbvSetTextColor()

VOID NTAPI InbvSetTextColor ( IN ULONG  Color)

Definition at line 692 of file inbv.c.

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 }
static ULONG InbvTerminalTextColor
Definition: inbv.c:158
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
smooth NULL
Definition: ftsmooth.c:416
ULONG NTAPI VidSetTextColor(_In_ ULONG Color)
Definition: common.c:307
static ULONG InbvTerminalBkgdColor
Definition: inbv.c:159

Referenced by DisplayBootBitmap(), HalHandleNMI(), KdpScreenAcquire(), and KiDisplayBlueScreen().

◆ InbvSolidColorFill()

VOID NTAPI InbvSolidColorFill ( IN ULONG  Left,
IN ULONG  Top,
IN ULONG  Right,
IN ULONG  Bottom,
IN ULONG  Color 
)

Definition at line 716 of file inbv.c.

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 }
static ULONG InbvTerminalTextColor
Definition: inbv.c:158
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
VOID NTAPI InbvReleaseLock(VOID)
Definition: inbv.c:481
smooth NULL
Definition: ftsmooth.c:416
VOID NTAPI InbvAcquireLock(VOID)
Definition: inbv.c:459
VOID NTAPI VidSolidColorFill(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Right, _In_ ULONG Bottom, _In_ UCHAR Color)
Definition: bootvid.c:274
unsigned char UCHAR
Definition: xmlstorage.h:181
static LPHIST_ENTRY Bottom
Definition: history.c:54
static INBV_DISPLAY_STATE InbvDisplayState
Definition: inbv.c:82
static ULONG InbvTerminalBkgdColor
Definition: inbv.c:159
BOOLEAN InbvBootDriverInstalled
Definition: inbv.c:83
static LPHIST_ENTRY Top
Definition: history.c:53

Referenced by DisplayBootBitmap(), HalHandleNMI(), KdpScreenAcquire(), KiDisplayBlueScreen(), and PopShutdownHandler().

◆ InbvUpdateProgressBar()

INIT_FUNCTION VOID NTAPI InbvUpdateProgressBar ( IN ULONG  Progress)

Definition at line 762 of file inbv.c.

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 }
static ULONG ProgressBarHeight
Definition: inbv.c:87
#define BV_COLOR_WHITE
Definition: display.h:30
static ULONG ProgressBarWidth
Definition: inbv.c:87
VOID NTAPI InbvReleaseLock(VOID)
Definition: inbv.c:481
VOID NTAPI InbvAcquireLock(VOID)
Definition: inbv.c:459
static ULONG ProgressBarLeft
Definition: inbv.c:86
static INBV_PROGRESS_STATE InbvProgressState
Definition: inbv.c:89
VOID NTAPI VidSolidColorFill(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Right, _In_ ULONG Bottom, _In_ UCHAR Color)
Definition: bootvid.c:274
static INBV_DISPLAY_STATE InbvDisplayState
Definition: inbv.c:82
unsigned int ULONG
Definition: retypes.h:1
static ULONG ProgressBarTop
Definition: inbv.c:86
BOOLEAN InbvBootDriverInstalled
Definition: inbv.c:83
static BOOLEAN ShowProgressBar
Definition: inbv.c:88

Referenced by InbvIndicateProgress(), and Phase1InitializationDiscard().

◆ NtDisplayString()

NTSTATUS NTAPI NtDisplayString ( IN PUNICODE_STRING  DisplayString)

Definition at line 916 of file inbv.c.

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 }
static __inline NTSTATUS ProbeAndCaptureUnicodeString(OUT PUNICODE_STRING Dest, IN KPROCESSOR_MODE CurrentMode, IN const UNICODE_STRING *UnsafeSrc)
Definition: probe.h:142
*BytesInOemString PCHAR OemString
Definition: rtlfuncs.h:1561
#define STATUS_PRIVILEGE_NOT_HELD
Definition: DriverTester.h:9
BOOLEAN NTAPI InbvDisplayString(IN PCHAR String)
Definition: inbv.c:569
LONG NTSTATUS
Definition: precomp.h:26
BOOLEAN NTAPI SeSinglePrivilegeCheck(IN LUID PrivilegeValue, IN KPROCESSOR_MODE PreviousMode)
Definition: priv.c:524
KPROCESSOR_MODE NTAPI ExGetPreviousMode(VOID)
Definition: sysinfo.c:3066
#define TAG_OSTR
Definition: inbv.c:15
STRING OEM_STRING
Definition: umtypes.h:203
smooth NULL
Definition: ftsmooth.c:416
static __inline VOID ReleaseCapturedUnicodeString(IN PUNICODE_STRING CapturedString, IN KPROCESSOR_MODE CurrentMode)
Definition: probe.h:239
_In_ KPROCESSOR_MODE PreviousMode
Definition: sefuncs.h:103
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
CCHAR KPROCESSOR_MODE
Definition: ketypes.h:7
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
NTSYSAPI NTSTATUS NTAPI RtlUnicodeStringToOemString(POEM_STRING DestinationString, PCUNICODE_STRING SourceString, BOOLEAN AllocateDestinationString)
VOID DisplayString(LPWSTR Msg)
Definition: misc.c:211
Status
Definition: gdiplustypes.h:24
const LUID SeTcbPrivilege
Definition: priv.c:28
#define STATUS_BUFFER_OVERFLOW
Definition: shellext.h:66
unsigned short USHORT
Definition: pedump.c:61
#define STATUS_NO_MEMORY
Definition: ntstatus.h:246
NTSYSAPI DWORD WINAPI RtlUnicodeStringToOemSize(const UNICODE_STRING *)
#define MAXUSHORT
Definition: typedefs.h:82
unsigned int ULONG
Definition: retypes.h:1
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1099
return STATUS_SUCCESS
Definition: btrfs.c:3014
#define PAGED_CODE()

Variable Documentation

◆ BootDriverLock

KSPIN_LOCK BootDriverLock
static

Definition at line 80 of file inbv.c.

Referenced by InbvAcquireLock(), InbvDriverInitialize(), and InbvReleaseLock().

◆ InbvBootDriverInstalled

◆ InbvDisplayDebugStrings

BOOLEAN InbvDisplayDebugStrings = FALSE
static

Definition at line 84 of file inbv.c.

Referenced by InbvDisplayString(), and InbvEnableDisplayString().

◆ InbvDisplayFilter

INBV_DISPLAY_STRING_FILTER InbvDisplayFilter = NULL
static

Definition at line 85 of file inbv.c.

Referenced by InbvDisplayString(), and InbvInstallDisplayStringFilter().

◆ InbvDisplayState

◆ InbvOldIrql

KIRQL InbvOldIrql
static

Definition at line 81 of file inbv.c.

Referenced by InbvAcquireLock(), and InbvReleaseLock().

◆ InbvProgressIndicator

BT_PROGRESS_INDICATOR InbvProgressIndicator = {0, 25, 0}
static

Definition at line 90 of file inbv.c.

Referenced by InbvIndicateProgress().

◆ InbvProgressState

INBV_PROGRESS_STATE InbvProgressState
static

Definition at line 89 of file inbv.c.

Referenced by InbvSetProgressBarSubset(), and InbvUpdateProgressBar().

◆ InbvResetDisplayParameters

INBV_RESET_DISPLAY_PARAMETERS InbvResetDisplayParameters = NULL
static

Definition at line 91 of file inbv.c.

Referenced by InbvAcquireDisplayOwnership(), and InbvNotifyDisplayOwnershipLost().

◆ InbvTerminalBkgdColor

ULONG InbvTerminalBkgdColor = 40
static

Definition at line 159 of file inbv.c.

Referenced by InbvSetTextColor(), and InbvSolidColorFill().

◆ InbvTerminalTextColor

ULONG InbvTerminalTextColor = 37
static

Definition at line 158 of file inbv.c.

Referenced by InbvSetTextColor(), and InbvSolidColorFill().

◆ MainPalette

RGBQUAD MainPalette[16]
static

Definition at line 174 of file inbv.c.

Referenced by BitBltPalette(), BootLogoFadeIn(), and DisplayBootBitmap().

◆ PltRotBarStatus

ROT_BAR_STATUS PltRotBarStatus = 0
static

Definition at line 118 of file inbv.c.

Referenced by FinalizeBootLogo(), InbvRotationThread(), and InbvRotBarInit().

◆ ProgressBarHeight

ULONG ProgressBarHeight = 0
static

Definition at line 87 of file inbv.c.

Referenced by InbvSetProgressBarCoordinates(), and InbvUpdateProgressBar().

◆ ProgressBarLeft

ULONG ProgressBarLeft = 0
static

Definition at line 86 of file inbv.c.

Referenced by InbvRotationThread(), InbvSetProgressBarCoordinates(), and InbvUpdateProgressBar().

◆ ProgressBarTop

ULONG ProgressBarTop = 0
static

Definition at line 86 of file inbv.c.

Referenced by InbvRotationThread(), InbvSetProgressBarCoordinates(), and InbvUpdateProgressBar().

◆ ProgressBarWidth

ULONG ProgressBarWidth = 0
static

◆ ResourceCount

◆ ResourceList

PUCHAR ResourceList[1+IDB_MAX_RESOURCE]
static

Definition at line 93 of file inbv.c.

Referenced by InbvDriverInitialize(), and InbvGetResourceAddress().

◆ RotBarBuffer

UCHAR RotBarBuffer[24 *9]
static

Definition at line 119 of file inbv.c.

Referenced by DisplayBootBitmap(), and InbvRotationThread().

◆ RotBarSelection

ROT_BAR_TYPE RotBarSelection = RB_UNSPECIFIED
static

Definition at line 117 of file inbv.c.

Referenced by DisplayBootBitmap(), and InbvRotationThread().

◆ RotBarThreadActive

BOOLEAN RotBarThreadActive = FALSE
static

Definition at line 116 of file inbv.c.

Referenced by DisplayBootBitmap(), and FinalizeBootLogo().

◆ RotLineBuffer

UCHAR RotLineBuffer[SCREEN_WIDTH *6]
static

Definition at line 120 of file inbv.c.

Referenced by DisplayBootBitmap(), and InbvRotationThread().

◆ ShowProgressBar

BOOLEAN ShowProgressBar = FALSE
static

Definition at line 88 of file inbv.c.

Referenced by DisplayBootBitmap(), InbvSetProgressBarCoordinates(), and InbvUpdateProgressBar().