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

Go to the source code of this file.

Functions

INIT_FUNCTION 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)
 
INIT_FUNCTION VOID NTAPI InbvIndicateProgress (VOID)
 
INIT_FUNCTION VOID NTAPI InbvSetProgressBarSubset (_In_ ULONG Floor, _In_ ULONG Ceiling)
 
INIT_FUNCTION VOID NTAPI InbvUpdateProgressBar (IN ULONG Progress)
 
INIT_FUNCTION VOID NTAPI InbvRotBarInit (VOID)
 
INIT_FUNCTION VOID NTAPI DisplayBootBitmap (IN BOOLEAN TextMode)
 
INIT_FUNCTION VOID NTAPI DisplayFilter (IN PCHAR *String)
 
INIT_FUNCTION 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()

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
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
static VOID BootLogoFadeIn(VOID)
Definition: inbv.c:206
#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: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
#define FALSE
Definition: types.h:117
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
Status
Definition: gdiplustypes.h:24
#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
#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 ( IN PCHAR String)

◆ 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
#define FALSE
Definition: types.h:117
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().

◆ 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:470
static INBV_DISPLAY_STATE InbvDisplayState
Definition: inbv.c:82
BOOLEAN InbvBootDriverInstalled
Definition: inbv.c:83

Referenced by BitBltPalette(), 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:1173
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
#define FALSE
Definition: types.h:117
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().

◆ 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().

◆ 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:54
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:256
#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:227
#define FALSE
Definition: types.h:117
ULONG PortNumber
Definition: storport.c:18
static WCHAR Address[46]
Definition: ping.c:68
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
CPPORT Port[4]
Definition: inbvport.c:16
NTSTATUS NTAPI CpInitialize(IN PCPPORT Port, IN PUCHAR Address, IN ULONG BaudRate)
Definition: cport.c:88

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:256
#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:306
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 }
smooth NULL
Definition: ftsmooth.c:416
CPPORT Port[4]
Definition: inbvport.c:16
PUCHAR Address
Definition: cportlib.h:29

Referenced by HdlspEnableTerminal().

◆ 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().

◆ InbvSetProgressBarSubset()

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

◆ 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().

Variable Documentation

◆ InbvBootDriverInstalled