https://git.reactos.org/?p=reactos.git;a=commitdiff;h=93aa5801dcfa36ab9dbeb0...
commit 93aa5801dcfa36ab9dbeb0c3b1adbf96072dd436 Author: Yaroslav Kibysh yanet.prod@gmail.com AuthorDate: Sun May 24 20:37:47 2020 +0300 Commit: GitHub noreply@github.com CommitDate: Sun May 24 19:37:47 2020 +0200
[NTOS:INBV] Fix hardcoded values (#2840) --- ntoskrnl/inbv/inbv.c | 20 ++++++++++++++------ ntoskrnl/inbv/logo.h | 2 ++ 2 files changed, 16 insertions(+), 6 deletions(-)
diff --git a/ntoskrnl/inbv/inbv.c b/ntoskrnl/inbv/inbv.c index 8613f7a3b14..6757f71b3bc 100644 --- a/ntoskrnl/inbv/inbv.c +++ b/ntoskrnl/inbv/inbv.c @@ -84,6 +84,7 @@ BOOLEAN InbvBootDriverInstalled = FALSE; static BOOLEAN InbvDisplayDebugStrings = FALSE; static INBV_DISPLAY_STRING_FILTER InbvDisplayFilter = NULL; static ULONG ProgressBarLeft = 0, ProgressBarTop = 0; +static ULONG ProgressBarWidth = 0, ProgressBarHeight = 0; static BOOLEAN ShowProgressBar = FALSE; static INBV_PROGRESS_STATE InbvProgressState; static BT_PROGRESS_INDICATOR InbvProgressIndicator = {0, 25, 0}; @@ -769,7 +770,7 @@ InbvUpdateProgressBar(IN ULONG Progress) { /* Compute fill count */ BoundedProgress = (InbvProgressState.Floor / 100) + Progress; - FillCount = 121 * (InbvProgressState.Bias * BoundedProgress) / 1000000; + FillCount = ProgressBarWidth * (InbvProgressState.Bias * BoundedProgress) / 1000000;
/* Acquire the lock */ InbvAcquireLock(); @@ -778,7 +779,7 @@ InbvUpdateProgressBar(IN ULONG Progress) VidSolidColorFill(ProgressBarLeft, ProgressBarTop, ProgressBarLeft + FillCount, - ProgressBarTop + 12, + ProgressBarTop + ProgressBarHeight, BV_COLOR_WHITE);
/* Release the lock */ @@ -847,11 +848,15 @@ INIT_FUNCTION VOID NTAPI InbvSetProgressBarCoordinates(IN ULONG Left, - IN ULONG Top) + IN ULONG Top, + IN ULONG Width, + IN ULONG Height) { /* Update the coordinates */ - ProgressBarLeft = Left; - ProgressBarTop = Top; + ProgressBarLeft = Left; + ProgressBarTop = Top; + ProgressBarWidth = Width; + ProgressBarHeight = Height;
/* Enable the progress bar */ ShowProgressBar = TRUE; @@ -1236,7 +1241,10 @@ DisplayBootBitmap(IN BOOLEAN TextMode) #endif
/* 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 /* Check for non-workstation products */ diff --git a/ntoskrnl/inbv/logo.h b/ntoskrnl/inbv/logo.h index c18d1efeea7..caecbf3dd4f 100644 --- a/ntoskrnl/inbv/logo.h +++ b/ntoskrnl/inbv/logo.h @@ -11,6 +11,8 @@
#define VID_PROGRESS_BAR_LEFT 259 #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 */ #define VID_SHUTDOWN_LOGO_LEFT 225