2003-08-11 18:50:12 +00:00
|
|
|
/* INCLUDES ******************************************************************/
|
|
|
|
|
2004-08-15 16:39:12 +00:00
|
|
|
#include <ntoskrnl.h>
|
2020-04-06 21:48:01 +00:00
|
|
|
|
2003-08-11 18:50:12 +00:00
|
|
|
#define NDEBUG
|
2007-02-03 20:30:32 +00:00
|
|
|
#include <debug.h>
|
2020-04-06 21:48:01 +00:00
|
|
|
|
|
|
|
#include "inbv/logo.h"
|
2005-11-28 23:25:31 +00:00
|
|
|
|
2019-06-11 19:27:25 +00:00
|
|
|
/* See also mm/ARM3/miarm.h */
|
|
|
|
#define MM_READONLY 1 // PAGE_READONLY
|
|
|
|
#define MM_READWRITE 4 // PAGE_WRITECOPY
|
|
|
|
|
2003-08-11 18:50:12 +00:00
|
|
|
/* GLOBALS *******************************************************************/
|
|
|
|
|
2015-02-26 01:59:05 +00:00
|
|
|
/*
|
|
|
|
* Enable this define if you want Inbv to use coloured headless mode.
|
|
|
|
*/
|
|
|
|
// #define INBV_HEADLESS_COLORS
|
|
|
|
|
|
|
|
/*
|
|
|
|
* ReactOS uses the same boot screen for all the products.
|
|
|
|
* Also it doesn't use a parallel system thread for the
|
|
|
|
* rotating "progress" bar.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Enable this define when ReactOS will have different SKUs
|
|
|
|
* (Workstation, Server, Storage Server, Cluster Server, etc...).
|
|
|
|
*/
|
|
|
|
// #define REACTOS_SKUS
|
|
|
|
|
2019-08-19 23:52:25 +00:00
|
|
|
typedef struct _INBV_PROGRESS_STATE
|
|
|
|
{
|
|
|
|
ULONG Floor;
|
|
|
|
ULONG Ceiling;
|
|
|
|
ULONG Bias;
|
|
|
|
} INBV_PROGRESS_STATE;
|
|
|
|
|
|
|
|
typedef struct _BT_PROGRESS_INDICATOR
|
|
|
|
{
|
|
|
|
ULONG Count;
|
|
|
|
ULONG Expected;
|
|
|
|
ULONG Percentage;
|
|
|
|
} BT_PROGRESS_INDICATOR, *PBT_PROGRESS_INDICATOR;
|
|
|
|
|
|
|
|
typedef enum _ROT_BAR_TYPE
|
|
|
|
{
|
|
|
|
RB_UNSPECIFIED,
|
|
|
|
RB_SQUARE_CELLS,
|
|
|
|
RB_PROGRESS_BAR
|
|
|
|
} ROT_BAR_TYPE;
|
|
|
|
|
2019-06-11 19:27:25 +00:00
|
|
|
/*
|
|
|
|
* BitBltAligned() alignments
|
|
|
|
*/
|
|
|
|
typedef enum _BBLT_VERT_ALIGNMENT
|
|
|
|
{
|
|
|
|
AL_VERTICAL_TOP = 0,
|
|
|
|
AL_VERTICAL_CENTER,
|
|
|
|
AL_VERTICAL_BOTTOM
|
|
|
|
} BBLT_VERT_ALIGNMENT;
|
|
|
|
|
|
|
|
typedef enum _BBLT_HORZ_ALIGNMENT
|
|
|
|
{
|
|
|
|
AL_HORIZONTAL_LEFT = 0,
|
|
|
|
AL_HORIZONTAL_CENTER,
|
|
|
|
AL_HORIZONTAL_RIGHT
|
|
|
|
} BBLT_HORZ_ALIGNMENT;
|
|
|
|
|
2015-02-26 01:59:05 +00:00
|
|
|
/*
|
|
|
|
* Enable this define when Inbv will support rotating progress bar.
|
|
|
|
*/
|
2017-12-14 12:49:15 +00:00
|
|
|
#define INBV_ROTBAR_IMPLEMENTED
|
2015-02-26 01:59:05 +00:00
|
|
|
|
|
|
|
static KSPIN_LOCK BootDriverLock;
|
|
|
|
static KIRQL InbvOldIrql;
|
2016-02-02 23:28:45 +00:00
|
|
|
static INBV_DISPLAY_STATE InbvDisplayState = INBV_DISPLAY_STATE_DISABLED;
|
2011-06-15 12:53:32 +00:00
|
|
|
BOOLEAN InbvBootDriverInstalled = FALSE;
|
2015-02-26 01:59:05 +00:00
|
|
|
static BOOLEAN InbvDisplayDebugStrings = FALSE;
|
2016-02-02 23:28:45 +00:00
|
|
|
static INBV_DISPLAY_STRING_FILTER InbvDisplayFilter = NULL;
|
|
|
|
static ULONG ProgressBarLeft = 0, ProgressBarTop = 0;
|
2020-05-24 17:37:47 +00:00
|
|
|
static ULONG ProgressBarWidth = 0, ProgressBarHeight = 0;
|
2015-02-26 01:59:05 +00:00
|
|
|
static BOOLEAN ShowProgressBar = FALSE;
|
|
|
|
static INBV_PROGRESS_STATE InbvProgressState;
|
|
|
|
static BT_PROGRESS_INDICATOR InbvProgressIndicator = {0, 25, 0};
|
2016-02-02 23:28:45 +00:00
|
|
|
static INBV_RESET_DISPLAY_PARAMETERS InbvResetDisplayParameters = NULL;
|
2015-02-27 01:39:49 +00:00
|
|
|
static ULONG ResourceCount = 0;
|
2017-12-14 12:49:15 +00:00
|
|
|
static PUCHAR ResourceList[1 + IDB_MAX_RESOURCE]; // First entry == NULL, followed by 'ResourceCount' entries.
|
2015-02-26 01:59:05 +00:00
|
|
|
|
|
|
|
#ifdef INBV_ROTBAR_IMPLEMENTED
|
2017-12-14 12:49:15 +00:00
|
|
|
/*
|
|
|
|
* Change this to modify progress bar behaviour
|
|
|
|
*/
|
|
|
|
#define ROT_BAR_DEFAULT_MODE RB_PROGRESS_BAR
|
2017-12-27 16:14:02 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Values for PltRotBarStatus:
|
|
|
|
* - PltRotBarStatus == 1, do palette fading-in (done elsewhere in ReactOS);
|
|
|
|
* - PltRotBarStatus == 2, do rotation bar animation;
|
|
|
|
* - PltRotBarStatus == 3, stop the animation thread.
|
|
|
|
* - Any other value is ignored and the animation thread continues to run.
|
|
|
|
*/
|
|
|
|
typedef enum _ROT_BAR_STATUS
|
|
|
|
{
|
|
|
|
RBS_FADEIN = 1,
|
|
|
|
RBS_ANIMATE,
|
|
|
|
RBS_STOP_ANIMATE,
|
|
|
|
RBS_STATUS_MAX
|
|
|
|
} ROT_BAR_STATUS;
|
|
|
|
|
2015-02-26 01:59:05 +00:00
|
|
|
static BOOLEAN RotBarThreadActive = FALSE;
|
2017-12-27 16:14:02 +00:00
|
|
|
static ROT_BAR_TYPE RotBarSelection = RB_UNSPECIFIED;
|
|
|
|
static ROT_BAR_STATUS PltRotBarStatus = 0;
|
2017-12-14 12:49:15 +00:00
|
|
|
static UCHAR RotBarBuffer[24 * 9];
|
2019-07-07 21:15:53 +00:00
|
|
|
static UCHAR RotLineBuffer[SCREEN_WIDTH * 6];
|
2015-02-26 01:59:05 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Headless terminal text colors
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifdef INBV_HEADLESS_COLORS
|
|
|
|
|
|
|
|
// Conversion table CGA to ANSI color index
|
|
|
|
static const UCHAR CGA_TO_ANSI_COLOR_TABLE[16] =
|
|
|
|
{
|
|
|
|
0, // Black
|
|
|
|
4, // Blue
|
|
|
|
2, // Green
|
|
|
|
6, // Cyan
|
|
|
|
1, // Red
|
|
|
|
5, // Magenta
|
|
|
|
3, // Brown/Yellow
|
|
|
|
7, // Grey/White
|
|
|
|
|
|
|
|
60, // Bright Black
|
|
|
|
64, // Bright Blue
|
|
|
|
62, // Bright Green
|
|
|
|
66, // Bright Cyan
|
|
|
|
61, // Bright Red
|
|
|
|
65, // Bright Magenta
|
|
|
|
63, // Bright Yellow
|
|
|
|
67 // Bright Grey (White)
|
|
|
|
};
|
|
|
|
|
|
|
|
#define CGA_TO_ANSI_COLOR(CgaColor) \
|
|
|
|
CGA_TO_ANSI_COLOR_TABLE[CgaColor & 0x0F]
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// Default colors: text in white, background in black
|
|
|
|
static ULONG InbvTerminalTextColor = 37;
|
|
|
|
static ULONG InbvTerminalBkgdColor = 40;
|
|
|
|
|
2003-08-24 12:08:16 +00:00
|
|
|
|
2012-12-09 21:43:51 +00:00
|
|
|
/* FADING FUNCTION ***********************************************************/
|
|
|
|
|
|
|
|
/** From include/psdk/wingdi.h **/
|
|
|
|
typedef struct tagRGBQUAD
|
|
|
|
{
|
|
|
|
UCHAR rgbBlue;
|
|
|
|
UCHAR rgbGreen;
|
|
|
|
UCHAR rgbRed;
|
|
|
|
UCHAR rgbReserved;
|
|
|
|
} RGBQUAD,*LPRGBQUAD;
|
|
|
|
/*******************************/
|
|
|
|
|
2015-02-26 01:59:05 +00:00
|
|
|
static RGBQUAD MainPalette[16];
|
2012-12-09 21:43:51 +00:00
|
|
|
|
2019-08-19 23:52:25 +00:00
|
|
|
#define PALETTE_FADE_STEPS 12
|
|
|
|
#define PALETTE_FADE_TIME (15 * 1000) /* 15 ms */
|
2012-12-09 21:43:51 +00:00
|
|
|
|
|
|
|
/** From bootvid/precomp.h **/
|
|
|
|
//
|
|
|
|
// Bitmap Header
|
|
|
|
//
|
|
|
|
typedef struct tagBITMAPINFOHEADER
|
|
|
|
{
|
|
|
|
ULONG biSize;
|
|
|
|
LONG biWidth;
|
|
|
|
LONG biHeight;
|
|
|
|
USHORT biPlanes;
|
|
|
|
USHORT biBitCount;
|
|
|
|
ULONG biCompression;
|
|
|
|
ULONG biSizeImage;
|
|
|
|
LONG biXPelsPerMeter;
|
|
|
|
LONG biYPelsPerMeter;
|
|
|
|
ULONG biClrUsed;
|
|
|
|
ULONG biClrImportant;
|
|
|
|
} BITMAPINFOHEADER, *PBITMAPINFOHEADER;
|
|
|
|
/****************************/
|
|
|
|
|
2012-12-09 22:15:42 +00:00
|
|
|
//
|
|
|
|
// Needed prototypes
|
|
|
|
//
|
|
|
|
VOID NTAPI InbvAcquireLock(VOID);
|
|
|
|
VOID NTAPI InbvReleaseLock(VOID);
|
|
|
|
|
2012-12-09 21:43:51 +00:00
|
|
|
static VOID
|
2015-02-26 01:59:05 +00:00
|
|
|
BootLogoFadeIn(VOID)
|
2012-12-09 21:43:51 +00:00
|
|
|
{
|
2015-02-26 01:59:05 +00:00
|
|
|
UCHAR PaletteBitmapBuffer[sizeof(BITMAPINFOHEADER) + sizeof(MainPalette)];
|
2012-12-09 21:43:51 +00:00
|
|
|
PBITMAPINFOHEADER PaletteBitmap = (PBITMAPINFOHEADER)PaletteBitmapBuffer;
|
|
|
|
LPRGBQUAD Palette = (LPRGBQUAD)(PaletteBitmapBuffer + sizeof(BITMAPINFOHEADER));
|
|
|
|
ULONG Iteration, Index, ClrUsed;
|
|
|
|
|
2017-12-27 16:14:02 +00:00
|
|
|
LARGE_INTEGER Delay;
|
2019-07-07 21:15:53 +00:00
|
|
|
Delay.QuadPart = -(PALETTE_FADE_TIME * 10);
|
2012-12-09 22:15:42 +00:00
|
|
|
|
2017-12-27 16:14:02 +00:00
|
|
|
/* Check if we are installed and we own the display */
|
|
|
|
if (!InbvBootDriverInstalled ||
|
|
|
|
(InbvDisplayState != INBV_DISPLAY_STATE_OWNED))
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
2012-12-09 22:15:42 +00:00
|
|
|
|
2017-12-27 16:14:02 +00:00
|
|
|
/*
|
|
|
|
* Build a bitmap containing the fade-in palette. The palette entries
|
|
|
|
* are then processed in a loop and set using VidBitBlt function.
|
|
|
|
*/
|
|
|
|
ClrUsed = RTL_NUMBER_OF(MainPalette);
|
|
|
|
RtlZeroMemory(PaletteBitmap, sizeof(BITMAPINFOHEADER));
|
|
|
|
PaletteBitmap->biSize = sizeof(BITMAPINFOHEADER);
|
|
|
|
PaletteBitmap->biBitCount = 4;
|
|
|
|
PaletteBitmap->biClrUsed = ClrUsed;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Main animation loop.
|
|
|
|
*/
|
|
|
|
for (Iteration = 0; Iteration <= PALETTE_FADE_STEPS; ++Iteration)
|
|
|
|
{
|
|
|
|
for (Index = 0; Index < ClrUsed; Index++)
|
2012-12-09 21:43:51 +00:00
|
|
|
{
|
2017-12-27 16:14:02 +00:00
|
|
|
Palette[Index].rgbRed = (UCHAR)
|
|
|
|
(MainPalette[Index].rgbRed * Iteration / PALETTE_FADE_STEPS);
|
|
|
|
Palette[Index].rgbGreen = (UCHAR)
|
|
|
|
(MainPalette[Index].rgbGreen * Iteration / PALETTE_FADE_STEPS);
|
|
|
|
Palette[Index].rgbBlue = (UCHAR)
|
|
|
|
(MainPalette[Index].rgbBlue * Iteration / PALETTE_FADE_STEPS);
|
2012-12-09 21:43:51 +00:00
|
|
|
}
|
|
|
|
|
2017-12-27 16:14:02 +00:00
|
|
|
/* Do the animation */
|
|
|
|
InbvAcquireLock();
|
|
|
|
VidBitBlt(PaletteBitmapBuffer, 0, 0);
|
2012-12-09 22:15:42 +00:00
|
|
|
InbvReleaseLock();
|
2012-12-09 21:43:51 +00:00
|
|
|
|
2015-02-27 01:39:49 +00:00
|
|
|
/* Wait for a bit */
|
2017-12-27 16:14:02 +00:00
|
|
|
KeDelayExecutionThread(KernelMode, FALSE, &Delay);
|
2012-12-09 21:43:51 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-06-11 19:27:25 +00:00
|
|
|
static VOID
|
|
|
|
BitBltPalette(
|
|
|
|
IN PVOID Image,
|
|
|
|
IN BOOLEAN NoPalette,
|
|
|
|
IN ULONG X,
|
|
|
|
IN ULONG Y)
|
|
|
|
{
|
|
|
|
LPRGBQUAD Palette;
|
|
|
|
RGBQUAD OrigPalette[RTL_NUMBER_OF(MainPalette)];
|
|
|
|
|
|
|
|
/* If requested, remove the palette from the image */
|
|
|
|
if (NoPalette)
|
|
|
|
{
|
|
|
|
/* Get bitmap header and palette */
|
|
|
|
PBITMAPINFOHEADER BitmapInfoHeader = Image;
|
|
|
|
Palette = (LPRGBQUAD)((PUCHAR)Image + BitmapInfoHeader->biSize);
|
|
|
|
|
|
|
|
/* Save the image original palette and remove palette information */
|
|
|
|
RtlCopyMemory(OrigPalette, Palette, sizeof(OrigPalette));
|
|
|
|
RtlZeroMemory(Palette, sizeof(OrigPalette));
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Draw the image */
|
|
|
|
InbvBitBlt(Image, X, Y);
|
|
|
|
|
|
|
|
/* Restore the image original palette */
|
|
|
|
if (NoPalette)
|
|
|
|
{
|
|
|
|
RtlCopyMemory(Palette, OrigPalette, sizeof(OrigPalette));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
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)
|
|
|
|
{
|
|
|
|
PBITMAPINFOHEADER BitmapInfoHeader = Image;
|
|
|
|
ULONG X, Y;
|
|
|
|
|
|
|
|
/* Calculate X */
|
|
|
|
switch (HorizontalAlignment)
|
|
|
|
{
|
|
|
|
case AL_HORIZONTAL_LEFT:
|
|
|
|
X = MarginLeft - MarginRight;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case AL_HORIZONTAL_CENTER:
|
|
|
|
X = MarginLeft - MarginRight + (SCREEN_WIDTH - BitmapInfoHeader->biWidth + 1) / 2;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case AL_HORIZONTAL_RIGHT:
|
|
|
|
X = MarginLeft - MarginRight + SCREEN_WIDTH - BitmapInfoHeader->biWidth;
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
/* Unknown */
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Calculate Y */
|
|
|
|
switch (VerticalAlignment)
|
|
|
|
{
|
|
|
|
case AL_VERTICAL_TOP:
|
|
|
|
Y = MarginTop - MarginBottom;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case AL_VERTICAL_CENTER:
|
|
|
|
Y = MarginTop - MarginBottom + (SCREEN_HEIGHT - BitmapInfoHeader->biHeight + 1) / 2;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case AL_VERTICAL_BOTTOM:
|
|
|
|
Y = MarginTop - MarginBottom + SCREEN_HEIGHT - BitmapInfoHeader->biHeight;
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
/* Unknown */
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Finally draw the image */
|
|
|
|
BitBltPalette(Image, NoPalette, X, Y);
|
|
|
|
}
|
|
|
|
|
2003-08-11 18:50:12 +00:00
|
|
|
/* FUNCTIONS *****************************************************************/
|
|
|
|
|
2020-10-06 19:44:01 +00:00
|
|
|
CODE_SEG("INIT")
|
2007-02-03 20:30:32 +00:00
|
|
|
PVOID
|
|
|
|
NTAPI
|
|
|
|
FindBitmapResource(IN PLOADER_PARAMETER_BLOCK LoaderBlock,
|
|
|
|
IN ULONG ResourceId)
|
2006-10-09 04:00:34 +00:00
|
|
|
{
|
2007-02-03 20:30:32 +00:00
|
|
|
UNICODE_STRING UpString = RTL_CONSTANT_STRING(L"ntoskrnl.exe");
|
|
|
|
UNICODE_STRING MpString = RTL_CONSTANT_STRING(L"ntkrnlmp.exe");
|
|
|
|
PLIST_ENTRY NextEntry, ListHead;
|
|
|
|
PLDR_DATA_TABLE_ENTRY LdrEntry;
|
|
|
|
PIMAGE_RESOURCE_DATA_ENTRY ResourceDataEntry;
|
|
|
|
LDR_RESOURCE_INFO ResourceInfo;
|
|
|
|
NTSTATUS Status;
|
|
|
|
PVOID Data = NULL;
|
|
|
|
|
|
|
|
/* Loop the driver list */
|
|
|
|
ListHead = &LoaderBlock->LoadOrderListHead;
|
|
|
|
NextEntry = ListHead->Flink;
|
|
|
|
while (NextEntry != ListHead)
|
|
|
|
{
|
|
|
|
/* Get the entry */
|
|
|
|
LdrEntry = CONTAINING_RECORD(NextEntry,
|
|
|
|
LDR_DATA_TABLE_ENTRY,
|
|
|
|
InLoadOrderLinks);
|
|
|
|
|
|
|
|
/* Check for a match */
|
2016-02-02 23:28:45 +00:00
|
|
|
if (RtlEqualUnicodeString(&LdrEntry->BaseDllName, &UpString, TRUE) ||
|
|
|
|
RtlEqualUnicodeString(&LdrEntry->BaseDllName, &MpString, TRUE))
|
2007-02-03 20:30:32 +00:00
|
|
|
{
|
|
|
|
/* Break out */
|
2006-10-09 04:00:34 +00:00
|
|
|
break;
|
2007-02-03 20:30:32 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Check if we found it */
|
|
|
|
if (NextEntry != ListHead)
|
|
|
|
{
|
|
|
|
/* Try to find the resource */
|
2016-02-02 23:28:45 +00:00
|
|
|
ResourceInfo.Type = 2; // RT_BITMAP;
|
2007-02-03 20:30:32 +00:00
|
|
|
ResourceInfo.Name = ResourceId;
|
|
|
|
ResourceInfo.Language = 0;
|
|
|
|
Status = LdrFindResource_U(LdrEntry->DllBase,
|
|
|
|
&ResourceInfo,
|
|
|
|
RESOURCE_DATA_LEVEL,
|
|
|
|
&ResourceDataEntry);
|
|
|
|
if (NT_SUCCESS(Status))
|
|
|
|
{
|
|
|
|
/* Access the resource */
|
2010-09-24 17:02:13 +00:00
|
|
|
ULONG Size = 0;
|
2007-02-03 20:30:32 +00:00
|
|
|
Status = LdrAccessResource(LdrEntry->DllBase,
|
|
|
|
ResourceDataEntry,
|
|
|
|
&Data,
|
2010-09-24 17:02:13 +00:00
|
|
|
&Size);
|
|
|
|
if ((Data) && (ResourceId < 3))
|
|
|
|
{
|
|
|
|
KiBugCheckData[4] ^= RtlComputeCrc32(0, Data, Size);
|
|
|
|
}
|
2007-02-03 20:30:32 +00:00
|
|
|
if (!NT_SUCCESS(Status)) Data = NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Return the pointer */
|
|
|
|
return Data;
|
2006-10-09 04:00:34 +00:00
|
|
|
}
|
|
|
|
|
2020-10-06 19:44:01 +00:00
|
|
|
CODE_SEG("INIT")
|
2007-02-03 20:30:32 +00:00
|
|
|
BOOLEAN
|
|
|
|
NTAPI
|
|
|
|
InbvDriverInitialize(IN PLOADER_PARAMETER_BLOCK LoaderBlock,
|
|
|
|
IN ULONG Count)
|
|
|
|
{
|
|
|
|
PCHAR CommandLine;
|
2016-02-02 23:28:45 +00:00
|
|
|
BOOLEAN ResetMode = FALSE; // By default do not reset the video mode
|
2007-02-03 20:30:32 +00:00
|
|
|
ULONG i;
|
|
|
|
|
|
|
|
/* Quit if we're already installed */
|
|
|
|
if (InbvBootDriverInstalled) return TRUE;
|
|
|
|
|
|
|
|
/* Initialize the lock and check the current display state */
|
|
|
|
KeInitializeSpinLock(&BootDriverLock);
|
|
|
|
if (InbvDisplayState == INBV_DISPLAY_STATE_OWNED)
|
|
|
|
{
|
2016-02-02 23:28:45 +00:00
|
|
|
/* Reset the video mode in case we do not have a custom boot logo */
|
2015-02-27 01:39:49 +00:00
|
|
|
CommandLine = (LoaderBlock->LoadOptions ? _strupr(LoaderBlock->LoadOptions) : NULL);
|
2016-02-02 23:28:45 +00:00
|
|
|
ResetMode = (CommandLine == NULL) || (strstr(CommandLine, "BOOTLOGO") == NULL);
|
2007-02-03 20:30:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Initialize the video */
|
2016-02-02 23:28:45 +00:00
|
|
|
InbvBootDriverInstalled = VidInitialize(ResetMode);
|
2007-02-03 20:30:32 +00:00
|
|
|
if (InbvBootDriverInstalled)
|
|
|
|
{
|
|
|
|
/* Find bitmap resources in the kernel */
|
2015-02-27 01:39:49 +00:00
|
|
|
ResourceCount = min(Count, RTL_NUMBER_OF(ResourceList) - 1);
|
2015-02-26 01:59:05 +00:00
|
|
|
for (i = 1; i <= ResourceCount; i++)
|
2007-02-03 20:30:32 +00:00
|
|
|
{
|
|
|
|
/* Do the lookup */
|
|
|
|
ResourceList[i] = FindBitmapResource(LoaderBlock, i);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Set the progress bar ranges */
|
|
|
|
InbvSetProgressBarSubset(0, 100);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Return install state */
|
|
|
|
return InbvBootDriverInstalled;
|
|
|
|
}
|
|
|
|
|
|
|
|
VOID
|
|
|
|
NTAPI
|
2006-10-09 04:00:34 +00:00
|
|
|
InbvAcquireLock(VOID)
|
|
|
|
{
|
2010-09-10 21:28:24 +00:00
|
|
|
KIRQL OldIrql;
|
|
|
|
|
|
|
|
/* Check if we're at dispatch level or lower */
|
|
|
|
OldIrql = KeGetCurrentIrql();
|
|
|
|
if (OldIrql <= DISPATCH_LEVEL)
|
2007-02-03 20:30:32 +00:00
|
|
|
{
|
2010-09-10 21:28:24 +00:00
|
|
|
/* Loop until the lock is free */
|
|
|
|
while (!KeTestSpinLock(&BootDriverLock));
|
|
|
|
|
2007-02-03 20:30:32 +00:00
|
|
|
/* Raise IRQL to dispatch level */
|
2010-09-10 21:28:24 +00:00
|
|
|
KeRaiseIrql(DISPATCH_LEVEL, &OldIrql);
|
2007-02-03 20:30:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Acquire the lock */
|
|
|
|
KiAcquireSpinLock(&BootDriverLock);
|
2010-09-10 21:28:24 +00:00
|
|
|
InbvOldIrql = OldIrql;
|
2006-10-09 04:00:34 +00:00
|
|
|
}
|
|
|
|
|
2007-02-03 20:30:32 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
2006-10-09 04:00:34 +00:00
|
|
|
InbvReleaseLock(VOID)
|
|
|
|
{
|
2010-09-10 21:28:24 +00:00
|
|
|
KIRQL OldIrql;
|
|
|
|
|
|
|
|
/* Capture the old IRQL */
|
|
|
|
OldIrql = InbvOldIrql;
|
|
|
|
|
2007-02-03 20:30:32 +00:00
|
|
|
/* Release the driver lock */
|
|
|
|
KiReleaseSpinLock(&BootDriverLock);
|
|
|
|
|
2010-09-10 21:28:24 +00:00
|
|
|
/* If we were at dispatch level or lower, restore the old IRQL */
|
|
|
|
if (InbvOldIrql <= DISPATCH_LEVEL) KeLowerIrql(OldIrql);
|
2006-10-09 04:00:34 +00:00
|
|
|
}
|
|
|
|
|
2007-02-03 20:30:32 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
2006-10-09 04:00:34 +00:00
|
|
|
InbvEnableBootDriver(IN BOOLEAN Enable)
|
|
|
|
{
|
2007-02-03 20:30:32 +00:00
|
|
|
/* Check if we're installed */
|
|
|
|
if (InbvBootDriverInstalled)
|
|
|
|
{
|
|
|
|
/* Check for lost state */
|
|
|
|
if (InbvDisplayState >= INBV_DISPLAY_STATE_LOST) return;
|
|
|
|
|
|
|
|
/* Acquire the lock */
|
|
|
|
InbvAcquireLock();
|
|
|
|
|
|
|
|
/* Cleanup the screen if we own it */
|
|
|
|
if (InbvDisplayState == INBV_DISPLAY_STATE_OWNED) VidCleanUp();
|
|
|
|
|
|
|
|
/* Set the new display state */
|
2015-02-26 01:59:05 +00:00
|
|
|
InbvDisplayState = Enable ? INBV_DISPLAY_STATE_OWNED :
|
2007-02-03 20:30:32 +00:00
|
|
|
INBV_DISPLAY_STATE_DISABLED;
|
|
|
|
|
|
|
|
/* Release the lock */
|
|
|
|
InbvReleaseLock();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* Set the new display state */
|
2015-02-26 01:59:05 +00:00
|
|
|
InbvDisplayState = Enable ? INBV_DISPLAY_STATE_OWNED :
|
2007-02-03 20:30:32 +00:00
|
|
|
INBV_DISPLAY_STATE_DISABLED;
|
|
|
|
}
|
2006-10-09 04:00:34 +00:00
|
|
|
}
|
|
|
|
|
2007-02-03 20:30:32 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
2003-08-11 18:50:12 +00:00
|
|
|
InbvAcquireDisplayOwnership(VOID)
|
|
|
|
{
|
2007-02-03 20:30:32 +00:00
|
|
|
/* Check if we have a callback and we're just acquiring it now */
|
|
|
|
if ((InbvResetDisplayParameters) &&
|
|
|
|
(InbvDisplayState == INBV_DISPLAY_STATE_LOST))
|
|
|
|
{
|
|
|
|
/* Call the callback */
|
|
|
|
InbvResetDisplayParameters(80, 50);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Acquire the display */
|
|
|
|
InbvDisplayState = INBV_DISPLAY_STATE_OWNED;
|
|
|
|
}
|
|
|
|
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
InbvSetDisplayOwnership(IN BOOLEAN DisplayOwned)
|
|
|
|
{
|
|
|
|
/* Set the new display state */
|
2015-02-26 01:59:05 +00:00
|
|
|
InbvDisplayState = DisplayOwned ? INBV_DISPLAY_STATE_OWNED :
|
2007-02-03 20:30:32 +00:00
|
|
|
INBV_DISPLAY_STATE_LOST;
|
2003-08-11 18:50:12 +00:00
|
|
|
}
|
|
|
|
|
2007-02-03 20:30:32 +00:00
|
|
|
BOOLEAN
|
|
|
|
NTAPI
|
2003-08-11 18:50:12 +00:00
|
|
|
InbvCheckDisplayOwnership(VOID)
|
|
|
|
{
|
2007-02-03 20:30:32 +00:00
|
|
|
/* Return if we own it or not */
|
|
|
|
return InbvDisplayState != INBV_DISPLAY_STATE_LOST;
|
|
|
|
}
|
|
|
|
|
|
|
|
INBV_DISPLAY_STATE
|
|
|
|
NTAPI
|
|
|
|
InbvGetDisplayState(VOID)
|
|
|
|
{
|
|
|
|
/* Return the actual state */
|
|
|
|
return InbvDisplayState;
|
2003-08-11 18:50:12 +00:00
|
|
|
}
|
|
|
|
|
2007-02-03 20:30:32 +00:00
|
|
|
BOOLEAN
|
|
|
|
NTAPI
|
2003-08-11 18:50:12 +00:00
|
|
|
InbvDisplayString(IN PCHAR String)
|
|
|
|
{
|
2007-02-03 20:30:32 +00:00
|
|
|
/* Make sure we own the display */
|
|
|
|
if (InbvDisplayState == INBV_DISPLAY_STATE_OWNED)
|
|
|
|
{
|
|
|
|
/* If we're not allowed, return success anyway */
|
|
|
|
if (!InbvDisplayDebugStrings) return TRUE;
|
2006-05-17 20:34:34 +00:00
|
|
|
|
2007-02-03 20:30:32 +00:00
|
|
|
/* Check if a filter is installed */
|
|
|
|
if (InbvDisplayFilter) InbvDisplayFilter(&String);
|
2006-05-17 20:34:34 +00:00
|
|
|
|
2007-02-03 20:30:32 +00:00
|
|
|
/* Acquire the lock */
|
|
|
|
InbvAcquireLock();
|
2003-08-11 18:50:12 +00:00
|
|
|
|
2007-02-03 20:30:32 +00:00
|
|
|
/* Make sure we're installed and display the string */
|
2014-08-31 23:00:29 +00:00
|
|
|
if (InbvBootDriverInstalled) VidDisplayString((PUCHAR)String);
|
2007-02-03 20:30:32 +00:00
|
|
|
|
2010-09-15 07:46:28 +00:00
|
|
|
/* Print the string on the EMS port */
|
2012-12-09 21:43:51 +00:00
|
|
|
HeadlessDispatch(HeadlessCmdPutString,
|
|
|
|
String,
|
|
|
|
strlen(String) + sizeof(ANSI_NULL),
|
|
|
|
NULL,
|
|
|
|
NULL);
|
2007-02-03 20:30:32 +00:00
|
|
|
|
|
|
|
/* Release the lock */
|
|
|
|
InbvReleaseLock();
|
2003-08-11 18:50:12 +00:00
|
|
|
|
2007-02-03 20:30:32 +00:00
|
|
|
/* All done */
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* We don't own it, fail */
|
|
|
|
return FALSE;
|
|
|
|
}
|
2005-02-01 16:40:23 +00:00
|
|
|
|
2007-02-03 20:30:32 +00:00
|
|
|
BOOLEAN
|
|
|
|
NTAPI
|
2003-08-11 18:50:12 +00:00
|
|
|
InbvEnableDisplayString(IN BOOLEAN Enable)
|
|
|
|
{
|
2007-02-03 20:30:32 +00:00
|
|
|
BOOLEAN OldSetting;
|
2003-08-11 18:50:12 +00:00
|
|
|
|
2007-02-03 20:30:32 +00:00
|
|
|
/* Get the old setting */
|
|
|
|
OldSetting = InbvDisplayDebugStrings;
|
2003-08-11 18:50:12 +00:00
|
|
|
|
2007-02-03 20:30:32 +00:00
|
|
|
/* Update it */
|
|
|
|
InbvDisplayDebugStrings = Enable;
|
|
|
|
|
|
|
|
/* Return the old setting */
|
|
|
|
return OldSetting;
|
2003-08-11 18:50:12 +00:00
|
|
|
}
|
|
|
|
|
2007-02-03 20:30:32 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
InbvInstallDisplayStringFilter(IN INBV_DISPLAY_STRING_FILTER Filter)
|
|
|
|
{
|
|
|
|
/* Save the filter */
|
|
|
|
InbvDisplayFilter = Filter;
|
|
|
|
}
|
2003-08-11 18:50:12 +00:00
|
|
|
|
2007-02-03 20:30:32 +00:00
|
|
|
BOOLEAN
|
|
|
|
NTAPI
|
2003-08-11 18:50:12 +00:00
|
|
|
InbvIsBootDriverInstalled(VOID)
|
|
|
|
{
|
2007-02-03 20:30:32 +00:00
|
|
|
/* Return driver state */
|
|
|
|
return InbvBootDriverInstalled;
|
2003-08-11 18:50:12 +00:00
|
|
|
}
|
|
|
|
|
2007-02-03 20:30:32 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
InbvNotifyDisplayOwnershipLost(IN INBV_RESET_DISPLAY_PARAMETERS Callback)
|
2003-08-11 18:50:12 +00:00
|
|
|
{
|
2007-02-03 20:30:32 +00:00
|
|
|
/* Check if we're installed */
|
|
|
|
if (InbvBootDriverInstalled)
|
|
|
|
{
|
|
|
|
/* Acquire the lock and cleanup if we own the screen */
|
|
|
|
InbvAcquireLock();
|
|
|
|
if (InbvDisplayState != INBV_DISPLAY_STATE_LOST) VidCleanUp();
|
|
|
|
|
|
|
|
/* Set the reset callback and display state */
|
|
|
|
InbvResetDisplayParameters = Callback;
|
|
|
|
InbvDisplayState = INBV_DISPLAY_STATE_LOST;
|
|
|
|
|
|
|
|
/* Release the lock */
|
|
|
|
InbvReleaseLock();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* Set the reset callback and display state */
|
|
|
|
InbvResetDisplayParameters = Callback;
|
|
|
|
InbvDisplayState = INBV_DISPLAY_STATE_LOST;
|
|
|
|
}
|
2003-08-11 18:50:12 +00:00
|
|
|
}
|
|
|
|
|
2007-02-03 20:30:32 +00:00
|
|
|
BOOLEAN
|
|
|
|
NTAPI
|
2003-08-11 18:50:12 +00:00
|
|
|
InbvResetDisplay(VOID)
|
|
|
|
{
|
2007-02-03 20:30:32 +00:00
|
|
|
/* Check if we're installed and we own it */
|
2015-02-26 01:59:05 +00:00
|
|
|
if (InbvBootDriverInstalled &&
|
2007-02-03 20:30:32 +00:00
|
|
|
(InbvDisplayState == INBV_DISPLAY_STATE_OWNED))
|
|
|
|
{
|
|
|
|
/* Do the reset */
|
|
|
|
VidResetDisplay(TRUE);
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Nothing to reset */
|
|
|
|
return FALSE;
|
2003-08-11 18:50:12 +00:00
|
|
|
}
|
|
|
|
|
2007-02-03 20:30:32 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
InbvSetScrollRegion(IN ULONG Left,
|
|
|
|
IN ULONG Top,
|
2014-08-31 23:00:29 +00:00
|
|
|
IN ULONG Right,
|
|
|
|
IN ULONG Bottom)
|
2003-08-11 18:50:12 +00:00
|
|
|
{
|
2007-02-03 20:30:32 +00:00
|
|
|
/* Just call bootvid */
|
2014-08-31 23:00:29 +00:00
|
|
|
VidSetScrollRegion(Left, Top, Right, Bottom);
|
2003-08-11 18:50:12 +00:00
|
|
|
}
|
|
|
|
|
2007-02-03 20:30:32 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
InbvSetTextColor(IN ULONG Color)
|
2003-08-11 18:50:12 +00:00
|
|
|
{
|
2015-02-26 01:59:05 +00:00
|
|
|
HEADLESS_CMD_SET_COLOR HeadlessSetColor;
|
|
|
|
|
|
|
|
/* Set color for EMS port */
|
|
|
|
#ifdef INBV_HEADLESS_COLORS
|
|
|
|
InbvTerminalTextColor = 30 + CGA_TO_ANSI_COLOR(Color);
|
|
|
|
#else
|
|
|
|
InbvTerminalTextColor = 37;
|
|
|
|
#endif
|
|
|
|
HeadlessSetColor.TextColor = InbvTerminalTextColor;
|
|
|
|
HeadlessSetColor.BkgdColor = InbvTerminalBkgdColor;
|
|
|
|
HeadlessDispatch(HeadlessCmdSetColor,
|
|
|
|
&HeadlessSetColor,
|
|
|
|
sizeof(HeadlessSetColor),
|
|
|
|
NULL,
|
|
|
|
NULL);
|
2003-08-11 18:50:12 +00:00
|
|
|
|
2007-02-03 20:30:32 +00:00
|
|
|
/* Update the text color */
|
|
|
|
VidSetTextColor(Color);
|
|
|
|
}
|
2003-08-11 18:50:12 +00:00
|
|
|
|
2007-02-03 20:30:32 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
InbvSolidColorFill(IN ULONG Left,
|
|
|
|
IN ULONG Top,
|
2014-08-31 23:00:29 +00:00
|
|
|
IN ULONG Right,
|
|
|
|
IN ULONG Bottom,
|
2007-02-03 20:30:32 +00:00
|
|
|
IN ULONG Color)
|
2003-08-11 18:50:12 +00:00
|
|
|
{
|
2015-02-26 01:59:05 +00:00
|
|
|
HEADLESS_CMD_SET_COLOR HeadlessSetColor;
|
|
|
|
|
2007-02-03 20:30:32 +00:00
|
|
|
/* Make sure we own it */
|
|
|
|
if (InbvDisplayState == INBV_DISPLAY_STATE_OWNED)
|
|
|
|
{
|
|
|
|
/* Acquire the lock */
|
|
|
|
InbvAcquireLock();
|
|
|
|
|
|
|
|
/* Check if we're installed */
|
|
|
|
if (InbvBootDriverInstalled)
|
|
|
|
{
|
|
|
|
/* Call bootvid */
|
2014-08-31 23:00:29 +00:00
|
|
|
VidSolidColorFill(Left, Top, Right, Bottom, (UCHAR)Color);
|
2007-02-03 20:30:32 +00:00
|
|
|
}
|
|
|
|
|
2015-02-26 01:59:05 +00:00
|
|
|
/* Set color for EMS port and clear display */
|
|
|
|
#ifdef INBV_HEADLESS_COLORS
|
|
|
|
InbvTerminalBkgdColor = 40 + CGA_TO_ANSI_COLOR(Color);
|
|
|
|
#else
|
|
|
|
InbvTerminalBkgdColor = 40;
|
|
|
|
#endif
|
|
|
|
HeadlessSetColor.TextColor = InbvTerminalTextColor;
|
|
|
|
HeadlessSetColor.BkgdColor = InbvTerminalBkgdColor;
|
|
|
|
HeadlessDispatch(HeadlessCmdSetColor,
|
|
|
|
&HeadlessSetColor,
|
|
|
|
sizeof(HeadlessSetColor),
|
|
|
|
NULL,
|
|
|
|
NULL);
|
|
|
|
HeadlessDispatch(HeadlessCmdClearDisplay,
|
|
|
|
NULL, 0,
|
|
|
|
NULL, NULL);
|
2007-02-03 20:30:32 +00:00
|
|
|
|
|
|
|
/* Release the lock */
|
|
|
|
InbvReleaseLock();
|
|
|
|
}
|
2003-08-11 18:50:12 +00:00
|
|
|
}
|
2005-01-07 06:54:27 +00:00
|
|
|
|
2020-10-06 19:44:01 +00:00
|
|
|
CODE_SEG("INIT")
|
2007-02-03 20:30:32 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
InbvUpdateProgressBar(IN ULONG Progress)
|
2006-10-09 04:00:34 +00:00
|
|
|
{
|
Patch for better boot logo/progress bar, fixed /SOS (debug) boot screen/output, removal of "funny" shutdown messages, addition of shutdown logo/screen, and misc:
[NTOS]: Add missing InbvIndicateProgress routine to update the progress bar while drivers are loading. Make boot and system driver initialization call it for each new driver. This updates the progress bar in the 25-75% range which was defined prior to IoInitSystem.
[NTOS]: Fix InbvUpdateProgressBar code to correctly handle the floor and ceiling.
[NTOS]: Remove shutdown "funny messages", do correct shutdown (should fix the ACPI shutdown issues) procedure. Display the shutdown screen on systems without ACPI (just like Windows does).
[NTOS]: Add a resource header with IDB_ definitions for all the embedded bitmaps, instead of using magic numbers and guessing which is which.
[NTOS]: Fix the boot logo initialization code as it was all wrong. 5 is the logo to be used during shutdown, for example, not the full logo background (which is supposed to be in 1, with a special palette that's faded in). Also handle server vs workstation scenarios.
[NTOS]: Booting in the new WinNT mode now correctly displays the blue background screen when in debug (/SOS) mode, and the header/footer also has the correct color, as does the separator band.
[DDK]: Add missing SUITE_TYPE definitions.
[NTOS]: Remove logo files that are simply not needed for ReactOS (Compute Cluster Edition, Tablet PC, etc...)
[NTOS]: Fix logo files (mostly) to have correct palettes. Note that 1.bmp is still quite different from Windows (no fade).
svn path=/trunk/; revision=45822
2010-03-04 06:26:11 +00:00
|
|
|
ULONG FillCount, BoundedProgress;
|
2007-02-03 20:30:32 +00:00
|
|
|
|
|
|
|
/* Make sure the progress bar is enabled, that we own and are installed */
|
2015-02-26 01:59:05 +00:00
|
|
|
if (ShowProgressBar &&
|
|
|
|
InbvBootDriverInstalled &&
|
2007-02-03 20:30:32 +00:00
|
|
|
(InbvDisplayState == INBV_DISPLAY_STATE_OWNED))
|
|
|
|
{
|
Patch for better boot logo/progress bar, fixed /SOS (debug) boot screen/output, removal of "funny" shutdown messages, addition of shutdown logo/screen, and misc:
[NTOS]: Add missing InbvIndicateProgress routine to update the progress bar while drivers are loading. Make boot and system driver initialization call it for each new driver. This updates the progress bar in the 25-75% range which was defined prior to IoInitSystem.
[NTOS]: Fix InbvUpdateProgressBar code to correctly handle the floor and ceiling.
[NTOS]: Remove shutdown "funny messages", do correct shutdown (should fix the ACPI shutdown issues) procedure. Display the shutdown screen on systems without ACPI (just like Windows does).
[NTOS]: Add a resource header with IDB_ definitions for all the embedded bitmaps, instead of using magic numbers and guessing which is which.
[NTOS]: Fix the boot logo initialization code as it was all wrong. 5 is the logo to be used during shutdown, for example, not the full logo background (which is supposed to be in 1, with a special palette that's faded in). Also handle server vs workstation scenarios.
[NTOS]: Booting in the new WinNT mode now correctly displays the blue background screen when in debug (/SOS) mode, and the header/footer also has the correct color, as does the separator band.
[DDK]: Add missing SUITE_TYPE definitions.
[NTOS]: Remove logo files that are simply not needed for ReactOS (Compute Cluster Edition, Tablet PC, etc...)
[NTOS]: Fix logo files (mostly) to have correct palettes. Note that 1.bmp is still quite different from Windows (no fade).
svn path=/trunk/; revision=45822
2010-03-04 06:26:11 +00:00
|
|
|
/* Compute fill count */
|
|
|
|
BoundedProgress = (InbvProgressState.Floor / 100) + Progress;
|
2020-05-24 17:37:47 +00:00
|
|
|
FillCount = ProgressBarWidth * (InbvProgressState.Bias * BoundedProgress) / 1000000;
|
2007-02-03 20:30:32 +00:00
|
|
|
|
2010-02-19 03:16:04 +00:00
|
|
|
/* Acquire the lock */
|
|
|
|
InbvAcquireLock();
|
|
|
|
|
|
|
|
/* Fill the progress bar */
|
|
|
|
VidSolidColorFill(ProgressBarLeft,
|
|
|
|
ProgressBarTop,
|
|
|
|
ProgressBarLeft + FillCount,
|
2020-05-24 17:37:47 +00:00
|
|
|
ProgressBarTop + ProgressBarHeight,
|
2020-05-09 14:20:57 +00:00
|
|
|
BV_COLOR_WHITE);
|
2010-02-19 03:16:04 +00:00
|
|
|
|
|
|
|
/* Release the lock */
|
|
|
|
InbvReleaseLock();
|
2007-02-03 20:30:32 +00:00
|
|
|
}
|
2006-10-09 04:00:34 +00:00
|
|
|
}
|
|
|
|
|
2007-02-03 20:30:32 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
InbvBufferToScreenBlt(IN PUCHAR Buffer,
|
|
|
|
IN ULONG X,
|
|
|
|
IN ULONG Y,
|
|
|
|
IN ULONG Width,
|
|
|
|
IN ULONG Height,
|
|
|
|
IN ULONG Delta)
|
|
|
|
{
|
|
|
|
/* Check if we're installed and we own it */
|
2015-02-26 01:59:05 +00:00
|
|
|
if (InbvBootDriverInstalled &&
|
2007-02-03 20:30:32 +00:00
|
|
|
(InbvDisplayState == INBV_DISPLAY_STATE_OWNED))
|
|
|
|
{
|
|
|
|
/* Do the blit */
|
|
|
|
VidBufferToScreenBlt(Buffer, X, Y, Width, Height, Delta);
|
|
|
|
}
|
|
|
|
}
|
2006-10-09 04:00:34 +00:00
|
|
|
|
2007-02-03 20:30:32 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
InbvBitBlt(IN PUCHAR Buffer,
|
|
|
|
IN ULONG X,
|
|
|
|
IN ULONG Y)
|
2006-10-09 04:00:34 +00:00
|
|
|
{
|
2007-02-03 20:30:32 +00:00
|
|
|
/* Check if we're installed and we own it */
|
2015-02-26 01:59:05 +00:00
|
|
|
if (InbvBootDriverInstalled &&
|
2007-02-03 20:30:32 +00:00
|
|
|
(InbvDisplayState == INBV_DISPLAY_STATE_OWNED))
|
|
|
|
{
|
|
|
|
/* Acquire the lock */
|
|
|
|
InbvAcquireLock();
|
|
|
|
|
|
|
|
/* Do the blit */
|
|
|
|
VidBitBlt(Buffer, X, Y);
|
|
|
|
|
|
|
|
/* Release the lock */
|
|
|
|
InbvReleaseLock();
|
|
|
|
}
|
2006-10-09 04:00:34 +00:00
|
|
|
}
|
|
|
|
|
2007-02-03 20:30:32 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
2020-05-09 14:20:57 +00:00
|
|
|
InbvScreenToBufferBlt(OUT PUCHAR Buffer,
|
2007-02-03 20:30:32 +00:00
|
|
|
IN ULONG X,
|
|
|
|
IN ULONG Y,
|
|
|
|
IN ULONG Width,
|
|
|
|
IN ULONG Height,
|
|
|
|
IN ULONG Delta)
|
|
|
|
{
|
|
|
|
/* Check if we're installed and we own it */
|
2015-02-26 01:59:05 +00:00
|
|
|
if (InbvBootDriverInstalled &&
|
2007-02-03 20:30:32 +00:00
|
|
|
(InbvDisplayState == INBV_DISPLAY_STATE_OWNED))
|
|
|
|
{
|
|
|
|
/* Do the blit */
|
|
|
|
VidScreenToBufferBlt(Buffer, X, Y, Width, Height, Delta);
|
|
|
|
}
|
|
|
|
}
|
2006-10-09 04:00:34 +00:00
|
|
|
|
2020-10-06 19:44:01 +00:00
|
|
|
CODE_SEG("INIT")
|
2007-02-03 20:30:32 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
InbvSetProgressBarCoordinates(IN ULONG Left,
|
2020-05-24 17:37:47 +00:00
|
|
|
IN ULONG Top,
|
|
|
|
IN ULONG Width,
|
|
|
|
IN ULONG Height)
|
2006-10-09 04:00:34 +00:00
|
|
|
{
|
2007-02-03 20:30:32 +00:00
|
|
|
/* Update the coordinates */
|
2020-05-24 17:37:47 +00:00
|
|
|
ProgressBarLeft = Left;
|
|
|
|
ProgressBarTop = Top;
|
|
|
|
ProgressBarWidth = Width;
|
|
|
|
ProgressBarHeight = Height;
|
2006-10-09 04:00:34 +00:00
|
|
|
|
2007-02-03 20:30:32 +00:00
|
|
|
/* Enable the progress bar */
|
|
|
|
ShowProgressBar = TRUE;
|
2006-10-09 04:00:34 +00:00
|
|
|
}
|
|
|
|
|
2020-10-06 19:44:01 +00:00
|
|
|
CODE_SEG("INIT")
|
2007-02-03 20:30:32 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
InbvSetProgressBarSubset(IN ULONG Floor,
|
|
|
|
IN ULONG Ceiling)
|
2006-10-09 04:00:34 +00:00
|
|
|
{
|
2007-02-03 20:30:32 +00:00
|
|
|
/* Sanity checks */
|
|
|
|
ASSERT(Floor < Ceiling);
|
|
|
|
ASSERT(Ceiling <= 100);
|
|
|
|
|
|
|
|
/* Update the progress bar state */
|
|
|
|
InbvProgressState.Floor = Floor * 100;
|
|
|
|
InbvProgressState.Ceiling = Ceiling * 100;
|
|
|
|
InbvProgressState.Bias = (Ceiling * 100) - Floor;
|
2006-10-09 04:00:34 +00:00
|
|
|
}
|
|
|
|
|
2020-10-06 19:44:01 +00:00
|
|
|
CODE_SEG("INIT")
|
Patch for better boot logo/progress bar, fixed /SOS (debug) boot screen/output, removal of "funny" shutdown messages, addition of shutdown logo/screen, and misc:
[NTOS]: Add missing InbvIndicateProgress routine to update the progress bar while drivers are loading. Make boot and system driver initialization call it for each new driver. This updates the progress bar in the 25-75% range which was defined prior to IoInitSystem.
[NTOS]: Fix InbvUpdateProgressBar code to correctly handle the floor and ceiling.
[NTOS]: Remove shutdown "funny messages", do correct shutdown (should fix the ACPI shutdown issues) procedure. Display the shutdown screen on systems without ACPI (just like Windows does).
[NTOS]: Add a resource header with IDB_ definitions for all the embedded bitmaps, instead of using magic numbers and guessing which is which.
[NTOS]: Fix the boot logo initialization code as it was all wrong. 5 is the logo to be used during shutdown, for example, not the full logo background (which is supposed to be in 1, with a special palette that's faded in). Also handle server vs workstation scenarios.
[NTOS]: Booting in the new WinNT mode now correctly displays the blue background screen when in debug (/SOS) mode, and the header/footer also has the correct color, as does the separator band.
[DDK]: Add missing SUITE_TYPE definitions.
[NTOS]: Remove logo files that are simply not needed for ReactOS (Compute Cluster Edition, Tablet PC, etc...)
[NTOS]: Fix logo files (mostly) to have correct palettes. Note that 1.bmp is still quite different from Windows (no fade).
svn path=/trunk/; revision=45822
2010-03-04 06:26:11 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
InbvIndicateProgress(VOID)
|
|
|
|
{
|
|
|
|
ULONG Percentage;
|
|
|
|
|
|
|
|
/* Increase progress */
|
|
|
|
InbvProgressIndicator.Count++;
|
|
|
|
|
|
|
|
/* Compute new percentage */
|
|
|
|
Percentage = min(100 * InbvProgressIndicator.Count /
|
|
|
|
InbvProgressIndicator.Expected,
|
|
|
|
99);
|
|
|
|
if (Percentage != InbvProgressIndicator.Percentage)
|
|
|
|
{
|
|
|
|
/* Percentage has moved, update the progress bar */
|
|
|
|
InbvProgressIndicator.Percentage = Percentage;
|
|
|
|
InbvUpdateProgressBar(Percentage);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-02-03 20:30:32 +00:00
|
|
|
PUCHAR
|
|
|
|
NTAPI
|
|
|
|
InbvGetResourceAddress(IN ULONG ResourceNumber)
|
2006-10-09 04:00:34 +00:00
|
|
|
{
|
2007-02-03 20:30:32 +00:00
|
|
|
/* Validate the resource number */
|
|
|
|
if (ResourceNumber > ResourceCount) return NULL;
|
2006-10-09 04:00:34 +00:00
|
|
|
|
2007-02-03 20:30:32 +00:00
|
|
|
/* Return the address */
|
2015-02-26 01:59:05 +00:00
|
|
|
return ResourceList[ResourceNumber];
|
2007-02-03 20:30:32 +00:00
|
|
|
}
|
2006-10-09 04:00:34 +00:00
|
|
|
|
2007-02-03 20:30:32 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
NtDisplayString(IN PUNICODE_STRING DisplayString)
|
2005-01-07 06:54:27 +00:00
|
|
|
{
|
2018-12-20 02:32:08 +00:00
|
|
|
NTSTATUS Status;
|
|
|
|
UNICODE_STRING CapturedString;
|
2007-02-03 20:30:32 +00:00
|
|
|
OEM_STRING OemString;
|
2018-12-20 23:33:56 +00:00
|
|
|
ULONG OemLength;
|
2018-12-20 02:32:08 +00:00
|
|
|
KPROCESSOR_MODE PreviousMode;
|
|
|
|
|
|
|
|
PAGED_CODE();
|
|
|
|
|
|
|
|
PreviousMode = ExGetPreviousMode();
|
|
|
|
|
|
|
|
/* We require the TCB privilege */
|
|
|
|
if (!SeSinglePrivilegeCheck(SeTcbPrivilege, PreviousMode))
|
|
|
|
return STATUS_PRIVILEGE_NOT_HELD;
|
|
|
|
|
|
|
|
/* Capture the string */
|
|
|
|
Status = ProbeAndCaptureUnicodeString(&CapturedString, PreviousMode, DisplayString);
|
|
|
|
if (!NT_SUCCESS(Status))
|
|
|
|
return Status;
|
|
|
|
|
|
|
|
/* Do not display the string if it is empty */
|
|
|
|
if (CapturedString.Length == 0 || CapturedString.Buffer == NULL)
|
|
|
|
{
|
|
|
|
Status = STATUS_SUCCESS;
|
|
|
|
goto Quit;
|
|
|
|
}
|
2005-01-07 06:54:27 +00:00
|
|
|
|
2018-12-20 02:32:08 +00:00
|
|
|
/*
|
|
|
|
* Convert the string since INBV understands only ANSI/OEM. Allocate the
|
|
|
|
* string buffer in non-paged pool because INBV passes it down to BOOTVID.
|
|
|
|
* We cannot perform the allocation using RtlUnicodeStringToOemString()
|
|
|
|
* since its allocator uses PagedPool.
|
|
|
|
*/
|
2018-12-20 23:33:56 +00:00
|
|
|
OemLength = RtlUnicodeStringToOemSize(&CapturedString);
|
|
|
|
if (OemLength > MAXUSHORT)
|
|
|
|
{
|
|
|
|
Status = STATUS_BUFFER_OVERFLOW;
|
|
|
|
goto Quit;
|
|
|
|
}
|
|
|
|
RtlInitEmptyAnsiString((PANSI_STRING)&OemString, NULL, (USHORT)OemLength);
|
|
|
|
OemString.Buffer = ExAllocatePoolWithTag(NonPagedPool, OemLength, TAG_OSTR);
|
2018-12-20 02:32:08 +00:00
|
|
|
if (OemString.Buffer == NULL)
|
|
|
|
{
|
|
|
|
Status = STATUS_NO_MEMORY;
|
|
|
|
goto Quit;
|
|
|
|
}
|
2021-06-17 15:49:40 +00:00
|
|
|
Status = RtlUnicodeStringToOemString(&OemString, &CapturedString, FALSE);
|
|
|
|
if (!NT_SUCCESS(Status))
|
|
|
|
{
|
|
|
|
ExFreePoolWithTag(OemString.Buffer, TAG_OSTR);
|
|
|
|
goto Quit;
|
|
|
|
}
|
2018-12-20 02:32:08 +00:00
|
|
|
|
|
|
|
/* Display the string */
|
2007-02-03 20:30:32 +00:00
|
|
|
InbvDisplayString(OemString.Buffer);
|
2005-01-07 06:54:27 +00:00
|
|
|
|
2018-12-20 02:32:08 +00:00
|
|
|
/* Free the string buffer */
|
|
|
|
ExFreePoolWithTag(OemString.Buffer, TAG_OSTR);
|
|
|
|
|
|
|
|
Status = STATUS_SUCCESS;
|
|
|
|
|
|
|
|
Quit:
|
|
|
|
/* Free the captured string */
|
|
|
|
ReleaseCapturedUnicodeString(&CapturedString, PreviousMode);
|
|
|
|
|
|
|
|
return Status;
|
2005-01-07 06:54:27 +00:00
|
|
|
}
|
2007-02-08 00:50:23 +00:00
|
|
|
|
2017-12-14 12:49:15 +00:00
|
|
|
#ifdef INBV_ROTBAR_IMPLEMENTED
|
|
|
|
static
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
InbvRotationThread(
|
|
|
|
_In_ PVOID Context)
|
|
|
|
{
|
|
|
|
ULONG X, Y, Index, Total;
|
|
|
|
LARGE_INTEGER Delay = {{0}};
|
|
|
|
|
|
|
|
InbvAcquireLock();
|
|
|
|
if (RotBarSelection == RB_SQUARE_CELLS)
|
|
|
|
{
|
|
|
|
Index = 0;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
Index = 32;
|
|
|
|
}
|
|
|
|
X = ProgressBarLeft + 2;
|
|
|
|
Y = ProgressBarTop + 2;
|
|
|
|
InbvReleaseLock();
|
|
|
|
|
|
|
|
while (InbvDisplayState == INBV_DISPLAY_STATE_OWNED)
|
|
|
|
{
|
|
|
|
/* Wait for a bit */
|
|
|
|
KeDelayExecutionThread(KernelMode, FALSE, &Delay);
|
|
|
|
|
|
|
|
InbvAcquireLock();
|
|
|
|
|
|
|
|
/* Unknown unexpected command */
|
2017-12-27 16:14:02 +00:00
|
|
|
ASSERT(PltRotBarStatus < RBS_STATUS_MAX);
|
2017-12-14 12:49:15 +00:00
|
|
|
|
2017-12-27 16:14:02 +00:00
|
|
|
if (PltRotBarStatus == RBS_STOP_ANIMATE)
|
2017-12-14 12:49:15 +00:00
|
|
|
{
|
|
|
|
/* Stop the thread */
|
|
|
|
InbvReleaseLock();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (RotBarSelection == RB_SQUARE_CELLS)
|
|
|
|
{
|
|
|
|
Delay.QuadPart = -800000; // 80 ms
|
|
|
|
Total = 18;
|
|
|
|
Index %= Total;
|
|
|
|
|
|
|
|
if (Index >= 3)
|
|
|
|
{
|
|
|
|
/* Fill previous bar position */
|
2020-05-09 14:20:57 +00:00
|
|
|
VidSolidColorFill(X + ((Index - 3) * 8), Y, (X + ((Index - 3) * 8)) + 8 - 1, Y + 9 - 1, BV_COLOR_BLACK);
|
2017-12-14 12:49:15 +00:00
|
|
|
}
|
|
|
|
if (Index < Total - 1)
|
|
|
|
{
|
|
|
|
/* Draw the progress bar bit */
|
|
|
|
if (Index < 2)
|
|
|
|
{
|
|
|
|
/* Appearing from the left */
|
|
|
|
VidBufferToScreenBlt(RotBarBuffer + 8 * (2 - Index) / 2, X, Y, 22 - 8 * (2 - Index), 9, 24);
|
|
|
|
}
|
|
|
|
else if (Index >= Total - 3)
|
|
|
|
{
|
|
|
|
/* Hiding to the right */
|
|
|
|
VidBufferToScreenBlt(RotBarBuffer, X + ((Index - 2) * 8), Y, 22 - 8 * (4 - (Total - Index)), 9, 24);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
VidBufferToScreenBlt(RotBarBuffer, X + ((Index - 2) * 8), Y, 22, 9, 24);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Index++;
|
|
|
|
}
|
|
|
|
else if (RotBarSelection == RB_PROGRESS_BAR)
|
|
|
|
{
|
|
|
|
Delay.QuadPart = -600000; // 60 ms
|
2019-07-07 21:15:53 +00:00
|
|
|
Total = SCREEN_WIDTH;
|
2017-12-14 12:49:15 +00:00
|
|
|
Index %= Total;
|
|
|
|
|
|
|
|
/* Right part */
|
2019-07-07 21:15:53 +00:00
|
|
|
VidBufferToScreenBlt(RotLineBuffer, Index, SCREEN_HEIGHT-6, SCREEN_WIDTH - Index, 6, SCREEN_WIDTH);
|
2017-12-14 12:49:15 +00:00
|
|
|
if (Index > 0)
|
|
|
|
{
|
|
|
|
/* Left part */
|
2019-07-07 21:15:53 +00:00
|
|
|
VidBufferToScreenBlt(RotLineBuffer + (SCREEN_WIDTH - Index) / 2, 0, SCREEN_HEIGHT-6, Index - 2, 6, SCREEN_WIDTH);
|
2017-12-14 12:49:15 +00:00
|
|
|
}
|
|
|
|
Index += 32;
|
|
|
|
}
|
|
|
|
|
|
|
|
InbvReleaseLock();
|
|
|
|
}
|
|
|
|
|
|
|
|
PsTerminateSystemThread(STATUS_SUCCESS);
|
|
|
|
}
|
|
|
|
|
2020-10-06 19:44:01 +00:00
|
|
|
CODE_SEG("INIT")
|
2017-12-14 12:49:15 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
InbvRotBarInit(VOID)
|
|
|
|
{
|
2017-12-27 16:14:02 +00:00
|
|
|
PltRotBarStatus = RBS_FADEIN;
|
|
|
|
/* Perform other initialization if needed */
|
2017-12-14 12:49:15 +00:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2020-10-06 19:44:01 +00:00
|
|
|
CODE_SEG("INIT")
|
2007-02-08 00:50:23 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
2011-06-21 15:53:02 +00:00
|
|
|
DisplayBootBitmap(IN BOOLEAN TextMode)
|
2007-02-08 00:50:23 +00:00
|
|
|
{
|
2019-08-19 23:52:25 +00:00
|
|
|
PVOID BootCopy = NULL, BootProgress = NULL, BootLogo = NULL, Header = NULL, Footer = NULL;
|
2012-12-09 21:43:51 +00:00
|
|
|
|
2015-02-26 01:59:05 +00:00
|
|
|
#ifdef INBV_ROTBAR_IMPLEMENTED
|
2017-12-14 12:49:15 +00:00
|
|
|
UCHAR Buffer[24 * 9];
|
|
|
|
PVOID Bar = NULL, LineBmp = NULL;
|
2007-02-08 00:50:23 +00:00
|
|
|
ROT_BAR_TYPE TempRotBarSelection = RB_UNSPECIFIED;
|
2017-12-14 12:49:15 +00:00
|
|
|
NTSTATUS Status;
|
|
|
|
HANDLE ThreadHandle = NULL;
|
2015-02-26 01:59:05 +00:00
|
|
|
#endif
|
2012-12-09 21:59:25 +00:00
|
|
|
|
2015-02-26 01:59:05 +00:00
|
|
|
#ifdef REACTOS_SKUS
|
|
|
|
PVOID Text = NULL;
|
2012-12-09 21:59:25 +00:00
|
|
|
#endif
|
2012-12-09 21:43:51 +00:00
|
|
|
|
2015-02-26 01:59:05 +00:00
|
|
|
#ifdef INBV_ROTBAR_IMPLEMENTED
|
2017-12-27 16:14:02 +00:00
|
|
|
/* Check if the animation thread has already been created */
|
2015-02-26 01:59:05 +00:00
|
|
|
if (RotBarThreadActive)
|
2007-02-08 00:50:23 +00:00
|
|
|
{
|
2017-12-27 16:14:02 +00:00
|
|
|
/* Yes, just reset the progress bar but keep the thread alive */
|
2017-12-24 15:54:48 +00:00
|
|
|
InbvAcquireLock();
|
|
|
|
RotBarSelection = RB_UNSPECIFIED;
|
|
|
|
InbvReleaseLock();
|
2007-02-08 00:50:23 +00:00
|
|
|
}
|
2015-02-26 01:59:05 +00:00
|
|
|
#endif
|
2007-02-08 00:50:23 +00:00
|
|
|
|
|
|
|
ShowProgressBar = FALSE;
|
2015-02-26 01:59:05 +00:00
|
|
|
|
|
|
|
/* Check if this is text mode */
|
2011-06-21 15:53:02 +00:00
|
|
|
if (TextMode)
|
2007-02-08 00:50:23 +00:00
|
|
|
{
|
2019-06-11 19:27:25 +00:00
|
|
|
/*
|
|
|
|
* Make the kernel resource section temporarily writable,
|
|
|
|
* as we are going to change the bitmaps' palette in place.
|
|
|
|
*/
|
|
|
|
MmChangeKernelResourceSectionProtection(MM_READWRITE);
|
|
|
|
|
2015-02-26 01:59:05 +00:00
|
|
|
/* Check the type of the OS: workstation or server */
|
2007-02-08 00:50:23 +00:00
|
|
|
if (SharedUserData->NtProductType == NtProductWinNt)
|
|
|
|
{
|
2015-02-26 01:59:05 +00:00
|
|
|
/* Workstation; set colors */
|
2020-05-09 14:20:57 +00:00
|
|
|
InbvSetTextColor(BV_COLOR_WHITE);
|
|
|
|
InbvSolidColorFill(0, 0, SCREEN_WIDTH-1, SCREEN_HEIGHT-1, BV_COLOR_DARK_GRAY);
|
|
|
|
InbvSolidColorFill(0, VID_FOOTER_BG_TOP, SCREEN_WIDTH-1, SCREEN_HEIGHT-1, BV_COLOR_RED);
|
2013-02-16 17:37:17 +00:00
|
|
|
|
2007-02-08 00:50:23 +00:00
|
|
|
/* Get resources */
|
2015-02-26 01:59:05 +00:00
|
|
|
Header = InbvGetResourceAddress(IDB_WKSTA_HEADER);
|
|
|
|
Footer = InbvGetResourceAddress(IDB_WKSTA_FOOTER);
|
2007-02-08 00:50:23 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-02-26 01:59:05 +00:00
|
|
|
/* Server; set colors */
|
2020-05-09 14:20:57 +00:00
|
|
|
InbvSetTextColor(BV_COLOR_LIGHT_CYAN);
|
|
|
|
InbvSolidColorFill(0, 0, SCREEN_WIDTH-1, SCREEN_HEIGHT-1, BV_COLOR_CYAN);
|
|
|
|
InbvSolidColorFill(0, VID_FOOTER_BG_TOP, SCREEN_WIDTH-1, SCREEN_HEIGHT-1, BV_COLOR_RED);
|
2007-02-08 00:50:23 +00:00
|
|
|
|
|
|
|
/* Get resources */
|
Patch for better boot logo/progress bar, fixed /SOS (debug) boot screen/output, removal of "funny" shutdown messages, addition of shutdown logo/screen, and misc:
[NTOS]: Add missing InbvIndicateProgress routine to update the progress bar while drivers are loading. Make boot and system driver initialization call it for each new driver. This updates the progress bar in the 25-75% range which was defined prior to IoInitSystem.
[NTOS]: Fix InbvUpdateProgressBar code to correctly handle the floor and ceiling.
[NTOS]: Remove shutdown "funny messages", do correct shutdown (should fix the ACPI shutdown issues) procedure. Display the shutdown screen on systems without ACPI (just like Windows does).
[NTOS]: Add a resource header with IDB_ definitions for all the embedded bitmaps, instead of using magic numbers and guessing which is which.
[NTOS]: Fix the boot logo initialization code as it was all wrong. 5 is the logo to be used during shutdown, for example, not the full logo background (which is supposed to be in 1, with a special palette that's faded in). Also handle server vs workstation scenarios.
[NTOS]: Booting in the new WinNT mode now correctly displays the blue background screen when in debug (/SOS) mode, and the header/footer also has the correct color, as does the separator band.
[DDK]: Add missing SUITE_TYPE definitions.
[NTOS]: Remove logo files that are simply not needed for ReactOS (Compute Cluster Edition, Tablet PC, etc...)
[NTOS]: Fix logo files (mostly) to have correct palettes. Note that 1.bmp is still quite different from Windows (no fade).
svn path=/trunk/; revision=45822
2010-03-04 06:26:11 +00:00
|
|
|
Header = InbvGetResourceAddress(IDB_SERVER_HEADER);
|
2015-02-26 01:59:05 +00:00
|
|
|
Footer = InbvGetResourceAddress(IDB_SERVER_FOOTER);
|
2007-02-08 00:50:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Set the scrolling region */
|
2020-04-06 21:48:01 +00:00
|
|
|
InbvSetScrollRegion(VID_SCROLL_AREA_LEFT, VID_SCROLL_AREA_TOP,
|
|
|
|
VID_SCROLL_AREA_RIGHT, VID_SCROLL_AREA_BOTTOM);
|
2007-02-08 00:50:23 +00:00
|
|
|
|
|
|
|
/* Make sure we have resources */
|
2015-02-26 01:59:05 +00:00
|
|
|
if (Header && Footer)
|
2007-02-08 00:50:23 +00:00
|
|
|
{
|
|
|
|
/* BitBlt them on the screen */
|
2019-06-11 19:27:25 +00:00
|
|
|
BitBltAligned(Footer,
|
|
|
|
TRUE,
|
|
|
|
AL_HORIZONTAL_CENTER,
|
|
|
|
AL_VERTICAL_BOTTOM,
|
|
|
|
0, 0, 0, 59);
|
|
|
|
BitBltAligned(Header,
|
|
|
|
FALSE,
|
|
|
|
AL_HORIZONTAL_CENTER,
|
|
|
|
AL_VERTICAL_TOP,
|
|
|
|
0, 0, 0, 0);
|
2007-02-08 00:50:23 +00:00
|
|
|
}
|
2019-06-11 19:27:25 +00:00
|
|
|
|
|
|
|
/* Restore the kernel resource section protection to be read-only */
|
|
|
|
MmChangeKernelResourceSectionProtection(MM_READONLY);
|
2007-02-08 00:50:23 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* Is the boot driver installed? */
|
|
|
|
if (!InbvBootDriverInstalled) return;
|
|
|
|
|
2019-06-11 19:27:25 +00:00
|
|
|
/*
|
|
|
|
* Make the kernel resource section temporarily writable,
|
|
|
|
* as we are going to change the bitmaps' palette in place.
|
|
|
|
*/
|
|
|
|
MmChangeKernelResourceSectionProtection(MM_READWRITE);
|
|
|
|
|
2019-08-19 23:52:25 +00:00
|
|
|
/* Load boot screen logo */
|
|
|
|
BootLogo = InbvGetResourceAddress(IDB_LOGO_DEFAULT);
|
2015-02-26 01:59:05 +00:00
|
|
|
|
|
|
|
#ifdef REACTOS_SKUS
|
|
|
|
Text = NULL;
|
Patch for better boot logo/progress bar, fixed /SOS (debug) boot screen/output, removal of "funny" shutdown messages, addition of shutdown logo/screen, and misc:
[NTOS]: Add missing InbvIndicateProgress routine to update the progress bar while drivers are loading. Make boot and system driver initialization call it for each new driver. This updates the progress bar in the 25-75% range which was defined prior to IoInitSystem.
[NTOS]: Fix InbvUpdateProgressBar code to correctly handle the floor and ceiling.
[NTOS]: Remove shutdown "funny messages", do correct shutdown (should fix the ACPI shutdown issues) procedure. Display the shutdown screen on systems without ACPI (just like Windows does).
[NTOS]: Add a resource header with IDB_ definitions for all the embedded bitmaps, instead of using magic numbers and guessing which is which.
[NTOS]: Fix the boot logo initialization code as it was all wrong. 5 is the logo to be used during shutdown, for example, not the full logo background (which is supposed to be in 1, with a special palette that's faded in). Also handle server vs workstation scenarios.
[NTOS]: Booting in the new WinNT mode now correctly displays the blue background screen when in debug (/SOS) mode, and the header/footer also has the correct color, as does the separator band.
[DDK]: Add missing SUITE_TYPE definitions.
[NTOS]: Remove logo files that are simply not needed for ReactOS (Compute Cluster Edition, Tablet PC, etc...)
[NTOS]: Fix logo files (mostly) to have correct palettes. Note that 1.bmp is still quite different from Windows (no fade).
svn path=/trunk/; revision=45822
2010-03-04 06:26:11 +00:00
|
|
|
if (SharedUserData->NtProductType == NtProductWinNt)
|
2007-10-16 10:40:17 +00:00
|
|
|
{
|
2015-02-26 01:59:05 +00:00
|
|
|
#ifdef INBV_ROTBAR_IMPLEMENTED
|
|
|
|
/* Workstation product, use appropriate status bar color */
|
|
|
|
Bar = InbvGetResourceAddress(IDB_BAR_WKSTA);
|
|
|
|
#endif
|
Patch for better boot logo/progress bar, fixed /SOS (debug) boot screen/output, removal of "funny" shutdown messages, addition of shutdown logo/screen, and misc:
[NTOS]: Add missing InbvIndicateProgress routine to update the progress bar while drivers are loading. Make boot and system driver initialization call it for each new driver. This updates the progress bar in the 25-75% range which was defined prior to IoInitSystem.
[NTOS]: Fix InbvUpdateProgressBar code to correctly handle the floor and ceiling.
[NTOS]: Remove shutdown "funny messages", do correct shutdown (should fix the ACPI shutdown issues) procedure. Display the shutdown screen on systems without ACPI (just like Windows does).
[NTOS]: Add a resource header with IDB_ definitions for all the embedded bitmaps, instead of using magic numbers and guessing which is which.
[NTOS]: Fix the boot logo initialization code as it was all wrong. 5 is the logo to be used during shutdown, for example, not the full logo background (which is supposed to be in 1, with a special palette that's faded in). Also handle server vs workstation scenarios.
[NTOS]: Booting in the new WinNT mode now correctly displays the blue background screen when in debug (/SOS) mode, and the header/footer also has the correct color, as does the separator band.
[DDK]: Add missing SUITE_TYPE definitions.
[NTOS]: Remove logo files that are simply not needed for ReactOS (Compute Cluster Edition, Tablet PC, etc...)
[NTOS]: Fix logo files (mostly) to have correct palettes. Note that 1.bmp is still quite different from Windows (no fade).
svn path=/trunk/; revision=45822
2010-03-04 06:26:11 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* Display correct branding based on server suite */
|
|
|
|
if (ExVerifySuite(StorageServer))
|
|
|
|
{
|
|
|
|
/* Storage Server Edition */
|
|
|
|
Text = InbvGetResourceAddress(IDB_STORAGE_SERVER);
|
|
|
|
}
|
|
|
|
else if (ExVerifySuite(ComputeServer))
|
|
|
|
{
|
|
|
|
/* Compute Cluster Edition */
|
|
|
|
Text = InbvGetResourceAddress(IDB_CLUSTER_SERVER);
|
|
|
|
}
|
2007-10-16 10:40:17 +00:00
|
|
|
else
|
Patch for better boot logo/progress bar, fixed /SOS (debug) boot screen/output, removal of "funny" shutdown messages, addition of shutdown logo/screen, and misc:
[NTOS]: Add missing InbvIndicateProgress routine to update the progress bar while drivers are loading. Make boot and system driver initialization call it for each new driver. This updates the progress bar in the 25-75% range which was defined prior to IoInitSystem.
[NTOS]: Fix InbvUpdateProgressBar code to correctly handle the floor and ceiling.
[NTOS]: Remove shutdown "funny messages", do correct shutdown (should fix the ACPI shutdown issues) procedure. Display the shutdown screen on systems without ACPI (just like Windows does).
[NTOS]: Add a resource header with IDB_ definitions for all the embedded bitmaps, instead of using magic numbers and guessing which is which.
[NTOS]: Fix the boot logo initialization code as it was all wrong. 5 is the logo to be used during shutdown, for example, not the full logo background (which is supposed to be in 1, with a special palette that's faded in). Also handle server vs workstation scenarios.
[NTOS]: Booting in the new WinNT mode now correctly displays the blue background screen when in debug (/SOS) mode, and the header/footer also has the correct color, as does the separator band.
[DDK]: Add missing SUITE_TYPE definitions.
[NTOS]: Remove logo files that are simply not needed for ReactOS (Compute Cluster Edition, Tablet PC, etc...)
[NTOS]: Fix logo files (mostly) to have correct palettes. Note that 1.bmp is still quite different from Windows (no fade).
svn path=/trunk/; revision=45822
2010-03-04 06:26:11 +00:00
|
|
|
{
|
|
|
|
/* Normal edition */
|
|
|
|
Text = InbvGetResourceAddress(IDB_SERVER_LOGO);
|
|
|
|
}
|
2013-02-16 17:37:17 +00:00
|
|
|
|
2015-02-26 01:59:05 +00:00
|
|
|
#ifdef INBV_ROTBAR_IMPLEMENTED
|
|
|
|
/* Server product, use appropriate status bar color */
|
2019-07-06 22:33:06 +00:00
|
|
|
Bar = InbvGetResourceAddress(IDB_BAR_DEFAULT);
|
2015-02-26 01:59:05 +00:00
|
|
|
#endif
|
Patch for better boot logo/progress bar, fixed /SOS (debug) boot screen/output, removal of "funny" shutdown messages, addition of shutdown logo/screen, and misc:
[NTOS]: Add missing InbvIndicateProgress routine to update the progress bar while drivers are loading. Make boot and system driver initialization call it for each new driver. This updates the progress bar in the 25-75% range which was defined prior to IoInitSystem.
[NTOS]: Fix InbvUpdateProgressBar code to correctly handle the floor and ceiling.
[NTOS]: Remove shutdown "funny messages", do correct shutdown (should fix the ACPI shutdown issues) procedure. Display the shutdown screen on systems without ACPI (just like Windows does).
[NTOS]: Add a resource header with IDB_ definitions for all the embedded bitmaps, instead of using magic numbers and guessing which is which.
[NTOS]: Fix the boot logo initialization code as it was all wrong. 5 is the logo to be used during shutdown, for example, not the full logo background (which is supposed to be in 1, with a special palette that's faded in). Also handle server vs workstation scenarios.
[NTOS]: Booting in the new WinNT mode now correctly displays the blue background screen when in debug (/SOS) mode, and the header/footer also has the correct color, as does the separator band.
[DDK]: Add missing SUITE_TYPE definitions.
[NTOS]: Remove logo files that are simply not needed for ReactOS (Compute Cluster Edition, Tablet PC, etc...)
[NTOS]: Fix logo files (mostly) to have correct palettes. Note that 1.bmp is still quite different from Windows (no fade).
svn path=/trunk/; revision=45822
2010-03-04 06:26:11 +00:00
|
|
|
}
|
2017-12-14 12:49:15 +00:00
|
|
|
#else
|
|
|
|
/* Use default status bar */
|
|
|
|
Bar = InbvGetResourceAddress(IDB_BAR_WKSTA);
|
2015-02-26 01:59:05 +00:00
|
|
|
#endif
|
2012-12-09 21:43:51 +00:00
|
|
|
|
2015-02-26 01:59:05 +00:00
|
|
|
/* Make sure we have a logo */
|
2019-08-19 23:52:25 +00:00
|
|
|
if (BootLogo)
|
Patch for better boot logo/progress bar, fixed /SOS (debug) boot screen/output, removal of "funny" shutdown messages, addition of shutdown logo/screen, and misc:
[NTOS]: Add missing InbvIndicateProgress routine to update the progress bar while drivers are loading. Make boot and system driver initialization call it for each new driver. This updates the progress bar in the 25-75% range which was defined prior to IoInitSystem.
[NTOS]: Fix InbvUpdateProgressBar code to correctly handle the floor and ceiling.
[NTOS]: Remove shutdown "funny messages", do correct shutdown (should fix the ACPI shutdown issues) procedure. Display the shutdown screen on systems without ACPI (just like Windows does).
[NTOS]: Add a resource header with IDB_ definitions for all the embedded bitmaps, instead of using magic numbers and guessing which is which.
[NTOS]: Fix the boot logo initialization code as it was all wrong. 5 is the logo to be used during shutdown, for example, not the full logo background (which is supposed to be in 1, with a special palette that's faded in). Also handle server vs workstation scenarios.
[NTOS]: Booting in the new WinNT mode now correctly displays the blue background screen when in debug (/SOS) mode, and the header/footer also has the correct color, as does the separator band.
[DDK]: Add missing SUITE_TYPE definitions.
[NTOS]: Remove logo files that are simply not needed for ReactOS (Compute Cluster Edition, Tablet PC, etc...)
[NTOS]: Fix logo files (mostly) to have correct palettes. Note that 1.bmp is still quite different from Windows (no fade).
svn path=/trunk/; revision=45822
2010-03-04 06:26:11 +00:00
|
|
|
{
|
2019-06-11 19:27:25 +00:00
|
|
|
/* Save the main image palette for implementing the fade-in effect */
|
2019-08-19 23:52:25 +00:00
|
|
|
PBITMAPINFOHEADER BitmapInfoHeader = BootLogo;
|
|
|
|
LPRGBQUAD Palette = (LPRGBQUAD)((PUCHAR)BootLogo + BitmapInfoHeader->biSize);
|
2015-02-26 01:59:05 +00:00
|
|
|
RtlCopyMemory(MainPalette, Palette, sizeof(MainPalette));
|
2012-12-09 21:43:51 +00:00
|
|
|
|
2019-08-19 23:52:25 +00:00
|
|
|
/* Draw the logo at the center of the screen */
|
|
|
|
BitBltAligned(BootLogo,
|
|
|
|
TRUE,
|
|
|
|
AL_HORIZONTAL_CENTER,
|
|
|
|
AL_VERTICAL_CENTER,
|
|
|
|
0, 0, 0, 34);
|
2010-02-19 03:16:04 +00:00
|
|
|
|
2015-02-26 01:59:05 +00:00
|
|
|
#ifdef INBV_ROTBAR_IMPLEMENTED
|
|
|
|
/* Choose progress bar */
|
2017-12-14 12:49:15 +00:00
|
|
|
TempRotBarSelection = ROT_BAR_DEFAULT_MODE;
|
2015-02-26 01:59:05 +00:00
|
|
|
#endif
|
|
|
|
|
2010-02-19 03:16:04 +00:00
|
|
|
/* Set progress bar coordinates and display it */
|
2020-05-24 17:37:47 +00:00
|
|
|
InbvSetProgressBarCoordinates(VID_PROGRESS_BAR_LEFT,
|
|
|
|
VID_PROGRESS_BAR_TOP,
|
|
|
|
VID_PROGRESS_BAR_WIDTH,
|
|
|
|
VID_PROGRESS_BAR_HEIGHT);
|
2012-12-09 21:43:51 +00:00
|
|
|
|
2015-02-26 01:59:05 +00:00
|
|
|
#ifdef REACTOS_SKUS
|
Patch for better boot logo/progress bar, fixed /SOS (debug) boot screen/output, removal of "funny" shutdown messages, addition of shutdown logo/screen, and misc:
[NTOS]: Add missing InbvIndicateProgress routine to update the progress bar while drivers are loading. Make boot and system driver initialization call it for each new driver. This updates the progress bar in the 25-75% range which was defined prior to IoInitSystem.
[NTOS]: Fix InbvUpdateProgressBar code to correctly handle the floor and ceiling.
[NTOS]: Remove shutdown "funny messages", do correct shutdown (should fix the ACPI shutdown issues) procedure. Display the shutdown screen on systems without ACPI (just like Windows does).
[NTOS]: Add a resource header with IDB_ definitions for all the embedded bitmaps, instead of using magic numbers and guessing which is which.
[NTOS]: Fix the boot logo initialization code as it was all wrong. 5 is the logo to be used during shutdown, for example, not the full logo background (which is supposed to be in 1, with a special palette that's faded in). Also handle server vs workstation scenarios.
[NTOS]: Booting in the new WinNT mode now correctly displays the blue background screen when in debug (/SOS) mode, and the header/footer also has the correct color, as does the separator band.
[DDK]: Add missing SUITE_TYPE definitions.
[NTOS]: Remove logo files that are simply not needed for ReactOS (Compute Cluster Edition, Tablet PC, etc...)
[NTOS]: Fix logo files (mostly) to have correct palettes. Note that 1.bmp is still quite different from Windows (no fade).
svn path=/trunk/; revision=45822
2010-03-04 06:26:11 +00:00
|
|
|
/* Check for non-workstation products */
|
|
|
|
if (SharedUserData->NtProductType != NtProductWinNt)
|
|
|
|
{
|
|
|
|
/* Overwrite part of the logo for a server product */
|
2020-04-06 21:48:01 +00:00
|
|
|
InbvScreenToBufferBlt(Buffer, VID_SKU_SAVE_AREA_LEFT,
|
|
|
|
VID_SKU_SAVE_AREA_TOP, 7, 7, 8);
|
|
|
|
InbvSolidColorFill(VID_SKU_AREA_LEFT, VID_SKU_AREA_TOP,
|
2020-05-09 14:20:57 +00:00
|
|
|
VID_SKU_AREA_RIGHT, VID_SKU_AREA_BOTTOM, BV_COLOR_BLACK);
|
2020-04-06 21:48:01 +00:00
|
|
|
InbvBufferToScreenBlt(Buffer, VID_SKU_SAVE_AREA_LEFT,
|
|
|
|
VID_SKU_SAVE_AREA_TOP, 7, 7, 8);
|
2013-02-16 17:37:17 +00:00
|
|
|
|
Patch for better boot logo/progress bar, fixed /SOS (debug) boot screen/output, removal of "funny" shutdown messages, addition of shutdown logo/screen, and misc:
[NTOS]: Add missing InbvIndicateProgress routine to update the progress bar while drivers are loading. Make boot and system driver initialization call it for each new driver. This updates the progress bar in the 25-75% range which was defined prior to IoInitSystem.
[NTOS]: Fix InbvUpdateProgressBar code to correctly handle the floor and ceiling.
[NTOS]: Remove shutdown "funny messages", do correct shutdown (should fix the ACPI shutdown issues) procedure. Display the shutdown screen on systems without ACPI (just like Windows does).
[NTOS]: Add a resource header with IDB_ definitions for all the embedded bitmaps, instead of using magic numbers and guessing which is which.
[NTOS]: Fix the boot logo initialization code as it was all wrong. 5 is the logo to be used during shutdown, for example, not the full logo background (which is supposed to be in 1, with a special palette that's faded in). Also handle server vs workstation scenarios.
[NTOS]: Booting in the new WinNT mode now correctly displays the blue background screen when in debug (/SOS) mode, and the header/footer also has the correct color, as does the separator band.
[DDK]: Add missing SUITE_TYPE definitions.
[NTOS]: Remove logo files that are simply not needed for ReactOS (Compute Cluster Edition, Tablet PC, etc...)
[NTOS]: Fix logo files (mostly) to have correct palettes. Note that 1.bmp is still quite different from Windows (no fade).
svn path=/trunk/; revision=45822
2010-03-04 06:26:11 +00:00
|
|
|
/* In setup mode, you haven't selected a SKU yet */
|
|
|
|
if (ExpInTextModeSetup) Text = NULL;
|
|
|
|
}
|
2012-12-09 21:43:51 +00:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2019-08-19 23:52:25 +00:00
|
|
|
/* Load and draw progress bar bitmap */
|
|
|
|
BootProgress = InbvGetResourceAddress(IDB_PROGRESS_BAR);
|
|
|
|
BitBltAligned(BootProgress,
|
|
|
|
TRUE,
|
|
|
|
AL_HORIZONTAL_CENTER,
|
|
|
|
AL_VERTICAL_CENTER,
|
|
|
|
0, 118, 0, 0);
|
|
|
|
|
|
|
|
/* Load and draw copyright text bitmap */
|
|
|
|
BootCopy = InbvGetResourceAddress(IDB_COPYRIGHT);
|
|
|
|
BitBltAligned(BootCopy,
|
|
|
|
TRUE,
|
|
|
|
AL_HORIZONTAL_LEFT,
|
|
|
|
AL_VERTICAL_BOTTOM,
|
|
|
|
22, 0, 0, 20);
|
|
|
|
|
2015-02-26 01:59:05 +00:00
|
|
|
#ifdef REACTOS_SKUS
|
2012-12-09 21:43:51 +00:00
|
|
|
/* Draw the SKU text if it exits */
|
2020-04-06 21:48:01 +00:00
|
|
|
if (Text)
|
|
|
|
BitBltPalette(Text, TRUE, VID_SKU_TEXT_LEFT, VID_SKU_TEXT_TOP);
|
2012-12-09 21:59:25 +00:00
|
|
|
#endif
|
2012-12-09 21:43:51 +00:00
|
|
|
|
2015-02-26 01:59:05 +00:00
|
|
|
#ifdef INBV_ROTBAR_IMPLEMENTED
|
2020-05-20 22:23:17 +00:00
|
|
|
if ((TempRotBarSelection == RB_SQUARE_CELLS) && Bar)
|
2017-12-14 12:49:15 +00:00
|
|
|
{
|
|
|
|
/* Save previous screen pixels to buffer */
|
|
|
|
InbvScreenToBufferBlt(Buffer, 0, 0, 22, 9, 24);
|
|
|
|
/* Draw the progress bar bit */
|
2020-05-20 22:23:17 +00:00
|
|
|
BitBltPalette(Bar, TRUE, 0, 0);
|
2017-12-14 12:49:15 +00:00
|
|
|
/* Store it in global buffer */
|
|
|
|
InbvScreenToBufferBlt(RotBarBuffer, 0, 0, 22, 9, 24);
|
|
|
|
/* Restore screen pixels */
|
|
|
|
InbvBufferToScreenBlt(Buffer, 0, 0, 22, 9, 24);
|
|
|
|
}
|
|
|
|
|
2017-12-27 16:14:02 +00:00
|
|
|
/*
|
|
|
|
* Add a rotating bottom horizontal bar when using a progress bar,
|
|
|
|
* to show that ReactOS can be still alive when the bar does not
|
|
|
|
* appear to progress.
|
|
|
|
*/
|
2017-12-14 12:49:15 +00:00
|
|
|
if (TempRotBarSelection == RB_PROGRESS_BAR)
|
|
|
|
{
|
|
|
|
LineBmp = InbvGetResourceAddress(IDB_ROTATING_LINE);
|
|
|
|
if (LineBmp)
|
|
|
|
{
|
|
|
|
/* Draw the line and store it in global buffer */
|
2019-07-07 21:15:53 +00:00
|
|
|
BitBltPalette(LineBmp, TRUE, 0, SCREEN_HEIGHT-6);
|
|
|
|
InbvScreenToBufferBlt(RotLineBuffer, 0, SCREEN_HEIGHT-6, SCREEN_WIDTH, 6, SCREEN_WIDTH);
|
2017-12-14 12:49:15 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* Hide the simple progress bar if not used */
|
|
|
|
ShowProgressBar = FALSE;
|
|
|
|
}
|
2015-02-26 01:59:05 +00:00
|
|
|
#endif
|
|
|
|
|
2019-06-11 19:27:25 +00:00
|
|
|
/* Restore the kernel resource section protection to be read-only */
|
|
|
|
MmChangeKernelResourceSectionProtection(MM_READONLY);
|
|
|
|
|
2015-02-26 01:59:05 +00:00
|
|
|
/* Display the boot logo and fade it in */
|
|
|
|
BootLogoFadeIn();
|
2012-12-09 21:43:51 +00:00
|
|
|
|
2017-12-14 12:49:15 +00:00
|
|
|
#ifdef INBV_ROTBAR_IMPLEMENTED
|
|
|
|
if (!RotBarThreadActive && TempRotBarSelection != RB_UNSPECIFIED)
|
|
|
|
{
|
|
|
|
/* Start the animation thread */
|
|
|
|
Status = PsCreateSystemThread(&ThreadHandle,
|
|
|
|
0,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
InbvRotationThread,
|
|
|
|
NULL);
|
|
|
|
if (NT_SUCCESS(Status))
|
|
|
|
{
|
2017-12-27 16:14:02 +00:00
|
|
|
/* The thread has started, close the handle as we don't need it */
|
2017-12-14 12:49:15 +00:00
|
|
|
RotBarThreadActive = TRUE;
|
|
|
|
ObCloseHandle(ThreadHandle, KernelMode);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2017-12-24 15:54:48 +00:00
|
|
|
/* Set filter which will draw text display if needed */
|
|
|
|
InbvInstallDisplayStringFilter(DisplayFilter);
|
|
|
|
}
|
2017-12-14 12:49:15 +00:00
|
|
|
|
2017-12-24 15:54:48 +00:00
|
|
|
#ifdef INBV_ROTBAR_IMPLEMENTED
|
2017-12-27 16:14:02 +00:00
|
|
|
/* Do we have the animation thread? */
|
2017-12-24 15:54:48 +00:00
|
|
|
if (RotBarThreadActive)
|
|
|
|
{
|
|
|
|
/* We do, initialize the progress bar */
|
2007-02-08 00:50:23 +00:00
|
|
|
InbvAcquireLock();
|
2017-12-24 15:54:48 +00:00
|
|
|
RotBarSelection = TempRotBarSelection;
|
2017-12-14 12:49:15 +00:00
|
|
|
InbvRotBarInit();
|
2007-02-08 00:50:23 +00:00
|
|
|
InbvReleaseLock();
|
2017-12-14 12:49:15 +00:00
|
|
|
}
|
2017-12-24 15:54:48 +00:00
|
|
|
#endif
|
2007-02-08 00:50:23 +00:00
|
|
|
}
|
|
|
|
|
2020-10-06 19:44:01 +00:00
|
|
|
CODE_SEG("INIT")
|
2011-06-21 15:53:02 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
DisplayFilter(PCHAR *String)
|
|
|
|
{
|
2011-06-21 22:15:48 +00:00
|
|
|
/* Windows hack to skip first dots */
|
|
|
|
static BOOLEAN DotHack = TRUE;
|
|
|
|
|
|
|
|
/* If "." is given set *String to empty string */
|
2019-06-11 19:27:25 +00:00
|
|
|
if (DotHack && strcmp(*String, ".") == 0)
|
2011-06-21 22:15:48 +00:00
|
|
|
*String = "";
|
|
|
|
|
2019-06-11 19:27:25 +00:00
|
|
|
if (**String)
|
2011-06-21 19:47:13 +00:00
|
|
|
{
|
|
|
|
/* Remove the filter */
|
|
|
|
InbvInstallDisplayStringFilter(NULL);
|
2013-02-16 17:37:17 +00:00
|
|
|
|
2011-06-21 22:15:48 +00:00
|
|
|
DotHack = FALSE;
|
2011-06-21 19:47:13 +00:00
|
|
|
|
|
|
|
/* Draw text screen */
|
|
|
|
DisplayBootBitmap(TRUE);
|
|
|
|
}
|
2011-06-21 15:53:02 +00:00
|
|
|
}
|
|
|
|
|
2020-10-06 19:44:01 +00:00
|
|
|
CODE_SEG("INIT")
|
2007-02-08 00:50:23 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
FinalizeBootLogo(VOID)
|
|
|
|
{
|
|
|
|
/* Acquire lock and check the display state */
|
|
|
|
InbvAcquireLock();
|
|
|
|
if (InbvGetDisplayState() == INBV_DISPLAY_STATE_OWNED)
|
|
|
|
{
|
|
|
|
/* Clear the screen */
|
2020-05-09 14:20:57 +00:00
|
|
|
VidSolidColorFill(0, 0, SCREEN_WIDTH-1, SCREEN_HEIGHT-1, BV_COLOR_BLACK);
|
2007-02-08 00:50:23 +00:00
|
|
|
}
|
2017-12-24 15:54:48 +00:00
|
|
|
|
|
|
|
/* Reset progress bar and lock */
|
|
|
|
#ifdef INBV_ROTBAR_IMPLEMENTED
|
2017-12-27 16:14:02 +00:00
|
|
|
PltRotBarStatus = RBS_STOP_ANIMATE;
|
2017-12-14 12:49:15 +00:00
|
|
|
RotBarThreadActive = FALSE;
|
2017-12-24 15:54:48 +00:00
|
|
|
#endif
|
2007-02-08 00:50:23 +00:00
|
|
|
InbvReleaseLock();
|
|
|
|
}
|