[NTOS:INBV] Fix hardcoded values (#2840)

This commit is contained in:
Yaroslav Kibysh 2020-05-24 20:37:47 +03:00 committed by GitHub
parent de0ce9dd02
commit 93aa5801dc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 6 deletions

View file

@ -84,6 +84,7 @@ BOOLEAN InbvBootDriverInstalled = FALSE;
static BOOLEAN InbvDisplayDebugStrings = FALSE; static BOOLEAN InbvDisplayDebugStrings = FALSE;
static INBV_DISPLAY_STRING_FILTER InbvDisplayFilter = NULL; static INBV_DISPLAY_STRING_FILTER InbvDisplayFilter = NULL;
static ULONG ProgressBarLeft = 0, ProgressBarTop = 0; static ULONG ProgressBarLeft = 0, ProgressBarTop = 0;
static ULONG ProgressBarWidth = 0, ProgressBarHeight = 0;
static BOOLEAN ShowProgressBar = FALSE; static BOOLEAN ShowProgressBar = FALSE;
static INBV_PROGRESS_STATE InbvProgressState; static INBV_PROGRESS_STATE InbvProgressState;
static BT_PROGRESS_INDICATOR InbvProgressIndicator = {0, 25, 0}; static BT_PROGRESS_INDICATOR InbvProgressIndicator = {0, 25, 0};
@ -769,7 +770,7 @@ InbvUpdateProgressBar(IN ULONG Progress)
{ {
/* Compute fill count */ /* Compute fill count */
BoundedProgress = (InbvProgressState.Floor / 100) + Progress; BoundedProgress = (InbvProgressState.Floor / 100) + Progress;
FillCount = 121 * (InbvProgressState.Bias * BoundedProgress) / 1000000; FillCount = ProgressBarWidth * (InbvProgressState.Bias * BoundedProgress) / 1000000;
/* Acquire the lock */ /* Acquire the lock */
InbvAcquireLock(); InbvAcquireLock();
@ -778,7 +779,7 @@ InbvUpdateProgressBar(IN ULONG Progress)
VidSolidColorFill(ProgressBarLeft, VidSolidColorFill(ProgressBarLeft,
ProgressBarTop, ProgressBarTop,
ProgressBarLeft + FillCount, ProgressBarLeft + FillCount,
ProgressBarTop + 12, ProgressBarTop + ProgressBarHeight,
BV_COLOR_WHITE); BV_COLOR_WHITE);
/* Release the lock */ /* Release the lock */
@ -847,11 +848,15 @@ INIT_FUNCTION
VOID VOID
NTAPI NTAPI
InbvSetProgressBarCoordinates(IN ULONG Left, InbvSetProgressBarCoordinates(IN ULONG Left,
IN ULONG Top) IN ULONG Top,
IN ULONG Width,
IN ULONG Height)
{ {
/* Update the coordinates */ /* Update the coordinates */
ProgressBarLeft = Left; ProgressBarLeft = Left;
ProgressBarTop = Top; ProgressBarTop = Top;
ProgressBarWidth = Width;
ProgressBarHeight = Height;
/* Enable the progress bar */ /* Enable the progress bar */
ShowProgressBar = TRUE; ShowProgressBar = TRUE;
@ -1236,7 +1241,10 @@ DisplayBootBitmap(IN BOOLEAN TextMode)
#endif #endif
/* Set progress bar coordinates and display it */ /* Set progress bar coordinates and display it */
InbvSetProgressBarCoordinates(VID_PROGRESS_BAR_LEFT, VID_PROGRESS_BAR_TOP); InbvSetProgressBarCoordinates(VID_PROGRESS_BAR_LEFT,
VID_PROGRESS_BAR_TOP,
VID_PROGRESS_BAR_WIDTH,
VID_PROGRESS_BAR_HEIGHT);
#ifdef REACTOS_SKUS #ifdef REACTOS_SKUS
/* Check for non-workstation products */ /* Check for non-workstation products */

View file

@ -11,6 +11,8 @@
#define VID_PROGRESS_BAR_LEFT 259 #define VID_PROGRESS_BAR_LEFT 259
#define VID_PROGRESS_BAR_TOP 352 #define VID_PROGRESS_BAR_TOP 352
#define VID_PROGRESS_BAR_WIDTH 121
#define VID_PROGRESS_BAR_HEIGHT 12
/* 16px space between shutdown logo and message */ /* 16px space between shutdown logo and message */
#define VID_SHUTDOWN_LOGO_LEFT 225 #define VID_SHUTDOWN_LOGO_LEFT 225