ReactOS  0.4.15-dev-3728-ga92304f
inbv.h File Reference
#include "bootvid/bootvid.h"
Include dependency graph for inbv.h:

Go to the source code of this file.

Functions

BOOLEAN NTAPI InbvDriverInitialize (IN PLOADER_PARAMETER_BLOCK LoaderBlock, IN ULONG Count)
 
PUCHAR NTAPI InbvGetResourceAddress (IN ULONG ResourceNumber)
 
VOID NTAPI InbvBitBlt (IN PUCHAR Buffer, IN ULONG X, IN ULONG Y)
 
VOID NTAPI InbvIndicateProgress (VOID)
 
VOID NTAPI InbvSetProgressBarSubset (_In_ ULONG Floor, _In_ ULONG Ceiling)
 
VOID NTAPI InbvUpdateProgressBar (IN ULONG Progress)
 
VOID NTAPI InbvRotBarInit (VOID)
 
VOID NTAPI DisplayBootBitmap (IN BOOLEAN TextMode)
 
VOID NTAPI DisplayFilter (IN PCHAR *String)
 
VOID NTAPI FinalizeBootLogo (VOID)
 
VOID NTAPI InbvPortEnableFifo (IN ULONG PortId, IN BOOLEAN Enable)
 
BOOLEAN NTAPI InbvPortPollOnly (IN ULONG PortId)
 
BOOLEAN NTAPI InbvPortGetByte (IN ULONG PortId, OUT PUCHAR Byte)
 
VOID NTAPI InbvPortPutByte (IN ULONG PortId, IN UCHAR Byte)
 
VOID NTAPI InbvPortTerminate (IN ULONG PortId)
 
BOOLEAN NTAPI InbvPortInitialize (IN ULONG BaudRate, IN ULONG PortNumber, IN PUCHAR PortAddress, OUT PULONG PortId, IN BOOLEAN IsMMIODevice)
 

Variables

BOOLEAN InbvBootDriverInstalled
 

Function Documentation

◆ DisplayBootBitmap()

VOID NTAPI DisplayBootBitmap ( IN BOOLEAN  TextMode)

Definition at line 1087 of file inbv.c.

1088 {
1089  PVOID BootCopy = NULL, BootProgress = NULL, BootLogo = NULL, Header = NULL, Footer = NULL;
1090 
1091 #ifdef INBV_ROTBAR_IMPLEMENTED
1092  UCHAR Buffer[24 * 9];
1093  PVOID Bar = NULL, LineBmp = NULL;
1094  ROT_BAR_TYPE TempRotBarSelection = RB_UNSPECIFIED;
1095  NTSTATUS Status;
1096  HANDLE ThreadHandle = NULL;
1097 #endif
1098 
1099 #ifdef REACTOS_SKUS
1100  PVOID Text = NULL;
1101 #endif
1102 
1103 #ifdef INBV_ROTBAR_IMPLEMENTED
1104  /* Check if the animation thread has already been created */
1105  if (RotBarThreadActive)
1106  {
1107  /* Yes, just reset the progress bar but keep the thread alive */
1108  InbvAcquireLock();
1110  InbvReleaseLock();
1111  }
1112 #endif
1113 
1115 
1116  /* Check if this is text mode */
1117  if (TextMode)
1118  {
1119  /*
1120  * Make the kernel resource section temporarily writable,
1121  * as we are going to change the bitmaps' palette in place.
1122  */
1124 
1125  /* Check the type of the OS: workstation or server */
1126  if (SharedUserData->NtProductType == NtProductWinNt)
1127  {
1128  /* Workstation; set colors */
1132 
1133  /* Get resources */
1136  }
1137  else
1138  {
1139  /* Server; set colors */
1143 
1144  /* Get resources */
1147  }
1148 
1149  /* Set the scrolling region */
1152 
1153  /* Make sure we have resources */
1154  if (Header && Footer)
1155  {
1156  /* BitBlt them on the screen */
1157  BitBltAligned(Footer,
1158  TRUE,
1161  0, 0, 0, 59);
1163  FALSE,
1166  0, 0, 0, 0);
1167  }
1168 
1169  /* Restore the kernel resource section protection to be read-only */
1171  }
1172  else
1173  {
1174  /* Is the boot driver installed? */
1175  if (!InbvBootDriverInstalled) return;
1176 
1177  /*
1178  * Make the kernel resource section temporarily writable,
1179  * as we are going to change the bitmaps' palette in place.
1180  */
1182 
1183  /* Load boot screen logo */
1185 
1186 #ifdef REACTOS_SKUS
1187  Text = NULL;
1188  if (SharedUserData->NtProductType == NtProductWinNt)
1189  {
1190 #ifdef INBV_ROTBAR_IMPLEMENTED
1191  /* Workstation product, use appropriate status bar color */
1193 #endif
1194  }
1195  else
1196  {
1197  /* Display correct branding based on server suite */
1199  {
1200  /* Storage Server Edition */
1202  }
1203  else if (ExVerifySuite(ComputeServer))
1204  {
1205  /* Compute Cluster Edition */
1207  }
1208  else
1209  {
1210  /* Normal edition */
1212  }
1213 
1214 #ifdef INBV_ROTBAR_IMPLEMENTED
1215  /* Server product, use appropriate status bar color */
1217 #endif
1218  }
1219 #else
1220  /* Use default status bar */
1222 #endif
1223 
1224  /* Make sure we have a logo */
1225  if (BootLogo)
1226  {
1227  /* Save the main image palette for implementing the fade-in effect */
1228  PBITMAPINFOHEADER BitmapInfoHeader = BootLogo;
1229  LPRGBQUAD Palette = (LPRGBQUAD)((PUCHAR)BootLogo + BitmapInfoHeader->biSize);
1230  RtlCopyMemory(MainPalette, Palette, sizeof(MainPalette));
1231 
1232  /* Draw the logo at the center of the screen */
1234  TRUE,
1237  0, 0, 0, 34);
1238 
1239 #ifdef INBV_ROTBAR_IMPLEMENTED
1240  /* Choose progress bar */
1241  TempRotBarSelection = ROT_BAR_DEFAULT_MODE;
1242 #endif
1243 
1244  /* Set progress bar coordinates and display it */
1249 
1250 #ifdef REACTOS_SKUS
1251  /* Check for non-workstation products */
1252  if (SharedUserData->NtProductType != NtProductWinNt)
1253  {
1254  /* Overwrite part of the logo for a server product */
1256  VID_SKU_SAVE_AREA_TOP, 7, 7, 8);
1260  VID_SKU_SAVE_AREA_TOP, 7, 7, 8);
1261 
1262  /* In setup mode, you haven't selected a SKU yet */
1263  if (ExpInTextModeSetup) Text = NULL;
1264  }
1265 #endif
1266  }
1267 
1268  /* Load and draw progress bar bitmap */
1269  BootProgress = InbvGetResourceAddress(IDB_PROGRESS_BAR);
1270  BitBltAligned(BootProgress,
1271  TRUE,
1274  0, 118, 0, 0);
1275 
1276  /* Load and draw copyright text bitmap */
1278  BitBltAligned(BootCopy,
1279  TRUE,
1282  22, 0, 0, 20);
1283 
1284 #ifdef REACTOS_SKUS
1285  /* Draw the SKU text if it exits */
1286  if (Text)
1288 #endif
1289 
1290 #ifdef INBV_ROTBAR_IMPLEMENTED
1291  if ((TempRotBarSelection == RB_SQUARE_CELLS) && Bar)
1292  {
1293  /* Save previous screen pixels to buffer */
1294  InbvScreenToBufferBlt(Buffer, 0, 0, 22, 9, 24);
1295  /* Draw the progress bar bit */
1296  BitBltPalette(Bar, TRUE, 0, 0);
1297  /* Store it in global buffer */
1298  InbvScreenToBufferBlt(RotBarBuffer, 0, 0, 22, 9, 24);
1299  /* Restore screen pixels */
1300  InbvBufferToScreenBlt(Buffer, 0, 0, 22, 9, 24);
1301  }
1302 
1303  /*
1304  * Add a rotating bottom horizontal bar when using a progress bar,
1305  * to show that ReactOS can be still alive when the bar does not
1306  * appear to progress.
1307  */
1308  if (TempRotBarSelection == RB_PROGRESS_BAR)
1309  {
1311  if (LineBmp)
1312  {
1313  /* Draw the line and store it in global buffer */
1314  BitBltPalette(LineBmp, TRUE, 0, SCREEN_HEIGHT-6);
1316  }
1317  }
1318  else
1319  {
1320  /* Hide the simple progress bar if not used */
1322  }
1323 #endif
1324 
1325  /* Restore the kernel resource section protection to be read-only */
1327 
1328  /* Display the boot logo and fade it in */
1329  BootLogoFadeIn();
1330 
1331 #ifdef INBV_ROTBAR_IMPLEMENTED
1332  if (!RotBarThreadActive && TempRotBarSelection != RB_UNSPECIFIED)
1333  {
1334  /* Start the animation thread */
1335  Status = PsCreateSystemThread(&ThreadHandle,
1336  0,
1337  NULL,
1338  NULL,
1339  NULL,
1341  NULL);
1342  if (NT_SUCCESS(Status))
1343  {
1344  /* The thread has started, close the handle as we don't need it */
1346  ObCloseHandle(ThreadHandle, KernelMode);
1347  }
1348  }
1349 #endif
1350 
1351  /* Set filter which will draw text display if needed */
1353  }
1354 
1355 #ifdef INBV_ROTBAR_IMPLEMENTED
1356  /* Do we have the animation thread? */
1357  if (RotBarThreadActive)
1358  {
1359  /* We do, initialize the progress bar */
1360  InbvAcquireLock();
1361  RotBarSelection = TempRotBarSelection;
1362  InbvRotBarInit();
1363  InbvReleaseLock();
1364  }
1365 #endif
1366 }
VOID NTAPI InbvScreenToBufferBlt(OUT PUCHAR Buffer, IN ULONG X, IN ULONG Y, IN ULONG Width, IN ULONG Height, IN ULONG Delta)
Definition: inbv.c:827
VOID NTAPI InbvRotBarInit(VOID)
Definition: inbv.c:1077
#define IDB_SERVER_FOOTER
Definition: resource.h:25
static VOID BootLogoFadeIn(VOID)
Definition: inbv.c:202
#define TRUE
Definition: types.h:120
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:788
#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:712
#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:115
VOID NTAPI InbvSetProgressBarCoordinates(IN ULONG Left, IN ULONG Top, IN ULONG Width, IN ULONG Height)
Definition: inbv.c:846
static UCHAR RotLineBuffer[SCREEN_WIDTH *6]
Definition: inbv.c:116
VOID NTAPI InbvReleaseLock(VOID)
Definition: inbv.c:477
BOOLEAN BootLogo
Definition: winldr.c:35
#define VID_SKU_TEXT_TOP
Definition: logo.h:32
#define FALSE
Definition: types.h:117
Definition: Header.h:8
#define IDB_PROGRESS_BAR
Definition: resource.h:43
void Bar(void)
Definition: terminate.cpp:70
#define IDB_SERVER_LOGO
Definition: resource.h:23
BOOLEAN NTAPI MmChangeKernelResourceSectionProtection(IN ULONG_PTR ProtectionMask)
Definition: sysldr.c:2293
#define VID_SCROLL_AREA_LEFT
Definition: logo.h:7
VOID NTAPI InbvAcquireLock(VOID)
Definition: inbv.c:455
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:688
#define VID_PROGRESS_BAR_LEFT
Definition: logo.h:12
#define IDB_STORAGE_SERVER
Definition: resource.h:37
Status
Definition: gdiplustypes.h:24
#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:985
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define ROT_BAR_DEFAULT_MODE
Definition: inbv.c:95
#define VID_SKU_AREA_RIGHT
Definition: logo.h:25
#define BV_COLOR_CYAN
Definition: display.h:21
VOID NTAPI DisplayFilter(PCHAR *String)
Definition: inbv.c:1371
#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:3378
#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:113
#define VID_PROGRESS_BAR_HEIGHT
Definition: logo.h:15
#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:287
#define VID_SKU_TEXT_LEFT
Definition: logo.h:31
#define IDB_WKSTA_FOOTER
Definition: resource.h:18
static BOOLEAN RotBarThreadActive
Definition: inbv.c:112
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
#define NULL
Definition: types.h:112
VOID NTAPI InbvInstallDisplayStringFilter(IN INBV_DISPLAY_STRING_FILTER Filter)
Definition: inbv.c:618
#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
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
PUCHAR NTAPI InbvGetResourceAddress(IN ULONG ResourceNumber)
Definition: inbv.c:901
BOOLEAN InbvBootDriverInstalled
Definition: inbv.c:79
VOID NTAPI InbvSetScrollRegion(IN ULONG Left, IN ULONG Top, IN ULONG Right, IN ULONG Bottom)
Definition: inbv.c:677
#define BV_COLOR_RED
Definition: display.h:16
static RGBQUAD MainPalette[16]
Definition: inbv.c:170
#define IDB_CLUSTER_SERVER
Definition: resource.h:38
static BOOLEAN ShowProgressBar
Definition: inbv.c:84
#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:255
struct tagRGBQUAD * LPRGBQUAD

Referenced by DisplayFilter(), and Phase1InitializationDiscard().

◆ DisplayFilter()

VOID NTAPI DisplayFilter ( IN PCHAR String)

◆ FinalizeBootLogo()

VOID NTAPI FinalizeBootLogo ( VOID  )

Definition at line 1395 of file inbv.c.

1396 {
1397  /* Acquire lock and check the display state */
1398  InbvAcquireLock();
1400  {
1401  /* Clear the screen */
1403  }
1404 
1405  /* Reset progress bar and lock */
1406 #ifdef INBV_ROTBAR_IMPLEMENTED
1409 #endif
1410  InbvReleaseLock();
1411 }
INBV_DISPLAY_STATE NTAPI InbvGetDisplayState(VOID)
Definition: inbv.c:557
#define SCREEN_WIDTH
Definition: pc98video.c:27
VOID NTAPI InbvReleaseLock(VOID)
Definition: inbv.c:477
#define FALSE
Definition: types.h:117
VOID NTAPI InbvAcquireLock(VOID)
Definition: inbv.c:455
static ROT_BAR_STATUS PltRotBarStatus
Definition: inbv.c:114
#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:112
#define BV_COLOR_BLACK
Definition: display.h:15

Referenced by Phase1InitializationDiscard().

◆ InbvBitBlt()

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

Definition at line 806 of file inbv.c.

809 {
810  /* Check if we're installed and we own it */
813  {
814  /* Acquire the lock */
815  InbvAcquireLock();
816 
817  /* Do the blit */
818  VidBitBlt(Buffer, X, Y);
819 
820  /* Release the lock */
821  InbvReleaseLock();
822  }
823 }
#define Y(I)
VOID NTAPI InbvReleaseLock(VOID)
Definition: inbv.c:477
VOID NTAPI InbvAcquireLock(VOID)
Definition: inbv.c:455
Definition: bufpool.h:45
VOID NTAPI VidBitBlt(_In_ PUCHAR Buffer, _In_ ULONG Left, _In_ ULONG Top)
Definition: common.c:470
static INBV_DISPLAY_STATE InbvDisplayState
Definition: inbv.c:78
BOOLEAN InbvBootDriverInstalled
Definition: inbv.c:79

Referenced by BitBltPalette(), and PopShutdownHandler().

◆ InbvDriverInitialize()

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

Definition at line 414 of file inbv.c.

416 {
417  PCHAR CommandLine;
418  BOOLEAN ResetMode = FALSE; // By default do not reset the video mode
419  ULONG i;
420 
421  /* Quit if we're already installed */
422  if (InbvBootDriverInstalled) return TRUE;
423 
424  /* Initialize the lock and check the current display state */
427  {
428  /* Reset the video mode in case we do not have a custom boot logo */
429  CommandLine = (LoaderBlock->LoadOptions ? _strupr(LoaderBlock->LoadOptions) : NULL);
430  ResetMode = (CommandLine == NULL) || (strstr(CommandLine, "BOOTLOGO") == NULL);
431  }
432 
433  /* Initialize the video */
436  {
437  /* Find bitmap resources in the kernel */
439  for (i = 1; i <= ResourceCount; i++)
440  {
441  /* Do the lookup */
442  ResourceList[i] = FindBitmapResource(LoaderBlock, i);
443  }
444 
445  /* Set the progress bar ranges */
446  InbvSetProgressBarSubset(0, 100);
447  }
448 
449  /* Return install state */
451 }
signed char * PCHAR
Definition: retypes.h:7
VOID NTAPI InbvSetProgressBarSubset(IN ULONG Floor, IN ULONG Ceiling)
Definition: inbv.c:864
#define TRUE
Definition: types.h:120
char * strstr(char *String1, char *String2)
Definition: utclib.c:653
_Must_inspect_result_ _In_ WDFIORESREQLIST _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFIORESLIST * ResourceList
Definition: wdfresource.h:304
PVOID NTAPI FindBitmapResource(IN PLOADER_PARAMETER_BLOCK LoaderBlock, IN ULONG ResourceId)
Definition: inbv.c:349
#define FALSE
Definition: types.h:117
FORCEINLINE VOID KeInitializeSpinLock(_Out_ PKSPIN_LOCK SpinLock)
Definition: kefuncs.h:238
unsigned char BOOLEAN
int Count
Definition: noreturn.cpp:7
static ULONG ResourceCount
Definition: inbv.c:88
_CRTIMP char *__cdecl _strupr(_Inout_z_ char *_String)
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
#define RTL_NUMBER_OF(x)
Definition: RtlRegistry.c:12
#define min(a, b)
Definition: monoChain.cc:55
#define NULL
Definition: types.h:112
static INBV_DISPLAY_STATE InbvDisplayState
Definition: inbv.c:78
unsigned int ULONG
Definition: retypes.h:1
static KSPIN_LOCK BootDriverLock
Definition: inbv.c:76
BOOLEAN InbvBootDriverInstalled
Definition: inbv.c:79

Referenced by Phase1InitializationDiscard().

◆ InbvGetResourceAddress()

PUCHAR NTAPI InbvGetResourceAddress ( IN ULONG  ResourceNumber)

Definition at line 901 of file inbv.c.

902 {
903  /* Validate the resource number */
904  if (ResourceNumber > ResourceCount) return NULL;
905 
906  /* Return the address */
907  return ResourceList[ResourceNumber];
908 }
_Must_inspect_result_ _In_ WDFIORESREQLIST _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFIORESLIST * ResourceList
Definition: wdfresource.h:304
static ULONG ResourceCount
Definition: inbv.c:88
#define NULL
Definition: types.h:112

Referenced by DisplayBootBitmap(), and PopShutdownHandler().

◆ InbvIndicateProgress()

VOID NTAPI InbvIndicateProgress ( VOID  )

Definition at line 880 of file inbv.c.

881 {
882  ULONG Percentage;
883 
884  /* Increase progress */
886 
887  /* Compute new percentage */
888  Percentage = min(100 * InbvProgressIndicator.Count /
890  99);
891  if (Percentage != InbvProgressIndicator.Percentage)
892  {
893  /* Percentage has moved, update the progress bar */
894  InbvProgressIndicator.Percentage = Percentage;
895  InbvUpdateProgressBar(Percentage);
896  }
897 }
static BT_PROGRESS_INDICATOR InbvProgressIndicator
Definition: inbv.c:86
VOID NTAPI InbvUpdateProgressBar(IN ULONG Progress)
Definition: inbv.c:758
#define min(a, b)
Definition: monoChain.cc:55
unsigned int ULONG
Definition: retypes.h:1

Referenced by IopInitializeBuiltinDriver(), and IopInitializeSystemDrivers().

◆ InbvPortEnableFifo()

VOID NTAPI InbvPortEnableFifo ( IN ULONG  PortId,
IN BOOLEAN  Enable 
)

Definition at line 56 of file inbvport.c.

58 {
59  /* Set FIFO as requested */
60  CpEnableFifo(Port[PortId].Address, Enable);
61 }
_In_ ULONGLONG _In_ ULONGLONG _In_ BOOLEAN Enable
Definition: ntddpcm.h:140
static WCHAR Address[46]
Definition: ping.c:68
VOID NTAPI CpEnableFifo(IN PUCHAR Address, IN BOOLEAN Enable)
Definition: cport.c:51
CPPORT Port[4]
Definition: inbvport.c:16

Referenced by HdlspEnableTerminal().

◆ InbvPortGetByte()

BOOLEAN NTAPI InbvPortGetByte ( IN ULONG  PortId,
OUT PUCHAR  Byte 
)

Definition at line 38 of file inbvport.c.

40 {
41  /* Read a byte from the port */
42  return CpGetByte(&Port[PortId], Byte, TRUE, FALSE) == CP_GET_SUCCESS;
43 }
#define TRUE
Definition: types.h:120
USHORT NTAPI CpGetByte(IN PCPPORT Port, OUT PUCHAR Byte, IN BOOLEAN Wait, IN BOOLEAN Poll)
Definition: cport.c:253
#define FALSE
Definition: types.h:117
CPPORT Port[4]
Definition: inbvport.c:16
#define CP_GET_SUCCESS
Definition: cportlib.h:18
unsigned char Byte
Definition: zlib.h:37

Referenced by HdlspDispatch().

◆ InbvPortInitialize()

BOOLEAN NTAPI InbvPortInitialize ( IN ULONG  BaudRate,
IN ULONG  PortNumber,
IN PUCHAR  PortAddress,
OUT PULONG  PortId,
IN BOOLEAN  IsMMIODevice 
)

Definition at line 73 of file inbvport.c.

78 {
79  /* Not yet supported */
80  ASSERT(IsMMIODevice == FALSE);
81 
82 #if defined(SARCH_PC98)
83  /* Set default baud rate */
84  if (BaudRate == 0) BaudRate = 9600;
85 
86  /* Check if port or address given */
87  if (PortNumber)
88  {
89  /* Pick correct address for port */
90  if (!PortAddress)
91  {
92  if (PortNumber == 1)
93  {
94  PortAddress = (PUCHAR)0x30;
95  }
96  else
97  {
98  PortAddress = (PUCHAR)0x238;
99  PortNumber = 2;
100  }
101  }
102  }
103  else
104  {
105  /* Pick correct port for address */
106  PortAddress = (PUCHAR)0x30;
107  if (CpDoesPortExist(PortAddress))
108  {
109  PortNumber = 1;
110  }
111  else
112  {
113  PortAddress = (PUCHAR)0x238;
114  if (!CpDoesPortExist(PortAddress))
115  return FALSE;
116 
117  PortNumber = 2;
118  }
119  }
120 #else
121  /* Set default baud rate */
122  if (BaudRate == 0) BaudRate = 19200;
123 
124  /* Check if port or address given */
125  if (PortNumber)
126  {
127  /* Pick correct address for port */
128  if (!PortAddress)
129  {
130  switch (PortNumber)
131  {
132  case 1:
133  PortAddress = (PUCHAR)0x3F8;
134  break;
135 
136  case 2:
137  PortAddress = (PUCHAR)0x2F8;
138  break;
139 
140  case 3:
141  PortAddress = (PUCHAR)0x3E8;
142  break;
143 
144  default:
145  PortNumber = 4;
146  PortAddress = (PUCHAR)0x2E8;
147  }
148  }
149  }
150  else
151  {
152  /* Pick correct port for address */
153  PortAddress = (PUCHAR)0x2F8;
154  if (CpDoesPortExist(PortAddress))
155  {
156  PortNumber = 2;
157  }
158  else
159  {
160  PortAddress = (PUCHAR)0x3F8;
161  if (!CpDoesPortExist(PortAddress)) return FALSE;
162  PortNumber = 1;
163  }
164  }
165 #endif
166 
167  /* Initialize the port unless it's already up, and then return it */
168  if (Port[PortNumber - 1].Address) return FALSE;
169 
170  CpInitialize(&Port[PortNumber - 1], PortAddress, BaudRate);
171  *PortId = PortNumber - 1;
172 
173  return TRUE;
174 }
#define TRUE
Definition: types.h:120
unsigned char * PUCHAR
Definition: retypes.h:3
BOOLEAN NTAPI CpDoesPortExist(IN PUCHAR Address)
Definition: cport.c:224
#define FALSE
Definition: types.h:117
ULONG PortNumber
Definition: storport.c:18
static WCHAR Address[46]
Definition: ping.c:68
#define ASSERT(a)
Definition: mode.c:44
CPPORT Port[4]
Definition: inbvport.c:16
NTSTATUS NTAPI CpInitialize(IN PCPPORT Port, IN PUCHAR Address, IN ULONG BaudRate)
Definition: cport.c:85

Referenced by HdlspEnableTerminal().

◆ InbvPortPollOnly()

BOOLEAN NTAPI InbvPortPollOnly ( IN ULONG  PortId)

Definition at line 28 of file inbvport.c.

29 {
30  UCHAR Dummy;
31 
32  /* Poll a byte from the port */
33  return CpGetByte(&Port[PortId], &Dummy, FALSE, TRUE) == CP_GET_SUCCESS;
34 }
#define TRUE
Definition: types.h:120
USHORT NTAPI CpGetByte(IN PCPPORT Port, OUT PUCHAR Byte, IN BOOLEAN Wait, IN BOOLEAN Poll)
Definition: cport.c:253
#define FALSE
Definition: types.h:117
unsigned char UCHAR
Definition: xmlstorage.h:181
CPPORT Port[4]
Definition: inbvport.c:16
#define CP_GET_SUCCESS
Definition: cportlib.h:18

Referenced by HdlspDispatch().

◆ InbvPortPutByte()

VOID NTAPI InbvPortPutByte ( IN ULONG  PortId,
IN UCHAR  Byte 
)

Definition at line 47 of file inbvport.c.

49 {
50  /* Send the byte */
51  CpPutByte(&Port[PortId], Byte);
52 }
VOID NTAPI CpPutByte(IN PCPPORT Port, IN UCHAR Byte)
Definition: cport.c:303
CPPORT Port[4]
Definition: inbvport.c:16
unsigned char Byte
Definition: zlib.h:37

Referenced by HdlspPutData(), and HdlspSendStringAtBaud().

◆ InbvPortTerminate()

VOID NTAPI InbvPortTerminate ( IN ULONG  PortId)

Definition at line 65 of file inbvport.c.

66 {
67  /* The port is now available */
68  Port[PortId].Address = NULL;
69 }
CPPORT Port[4]
Definition: inbvport.c:16
PUCHAR Address
Definition: cportlib.h:29
#define NULL
Definition: types.h:112

Referenced by HdlspEnableTerminal().

◆ InbvRotBarInit()

VOID NTAPI InbvRotBarInit ( VOID  )

Definition at line 1077 of file inbv.c.

1078 {
1080  /* Perform other initialization if needed */
1081 }
static ROT_BAR_STATUS PltRotBarStatus
Definition: inbv.c:114

Referenced by DisplayBootBitmap().

◆ InbvSetProgressBarSubset()

VOID NTAPI InbvSetProgressBarSubset ( _In_ ULONG  Floor,
_In_ ULONG  Ceiling 
)

◆ InbvUpdateProgressBar()

VOID NTAPI InbvUpdateProgressBar ( IN ULONG  Progress)

Definition at line 758 of file inbv.c.

759 {
760  ULONG FillCount, BoundedProgress;
761 
762  /* Make sure the progress bar is enabled, that we own and are installed */
763  if (ShowProgressBar &&
766  {
767  /* Compute fill count */
768  BoundedProgress = (InbvProgressState.Floor / 100) + Progress;
769  FillCount = ProgressBarWidth * (InbvProgressState.Bias * BoundedProgress) / 1000000;
770 
771  /* Acquire the lock */
772  InbvAcquireLock();
773 
774  /* Fill the progress bar */
777  ProgressBarLeft + FillCount,
780 
781  /* Release the lock */
782  InbvReleaseLock();
783  }
784 }
static ULONG ProgressBarHeight
Definition: inbv.c:83
#define BV_COLOR_WHITE
Definition: display.h:30
static ULONG ProgressBarWidth
Definition: inbv.c:83
VOID NTAPI InbvReleaseLock(VOID)
Definition: inbv.c:477
VOID NTAPI InbvAcquireLock(VOID)
Definition: inbv.c:455
static ULONG ProgressBarLeft
Definition: inbv.c:82
static INBV_PROGRESS_STATE InbvProgressState
Definition: inbv.c:85
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:78
unsigned int ULONG
Definition: retypes.h:1
static ULONG ProgressBarTop
Definition: inbv.c:82
BOOLEAN InbvBootDriverInstalled
Definition: inbv.c:79
static BOOLEAN ShowProgressBar
Definition: inbv.c:84

Referenced by InbvIndicateProgress(), and Phase1InitializationDiscard().

Variable Documentation

◆ InbvBootDriverInstalled