ReactOS  0.4.15-dev-5455-g015cd25
bootanim.c File Reference
#include <ntoskrnl.h>
#include "inbv/logo.h"
Include dependency graph for bootanim.c:

Go to the source code of this file.

Classes

struct  tagRGBQUAD
 
struct  tagBITMAPINFOHEADER
 

Macros

#define MM_READONLY   1
 
#define MM_READWRITE   4
 
#define INBV_ROTBAR_IMPLEMENTED
 
#define ROT_BAR_DEFAULT_MODE   RB_PROGRESS_BAR
 
#define PALETTE_FADE_STEPS   12
 
#define PALETTE_FADE_TIME   (15 * 1000) /* 15 ms */
 

Typedefs

typedef enum _ROT_BAR_TYPE ROT_BAR_TYPE
 
typedef enum _BBLT_VERT_ALIGNMENT BBLT_VERT_ALIGNMENT
 
typedef enum _BBLT_HORZ_ALIGNMENT BBLT_HORZ_ALIGNMENT
 
typedef enum _ROT_BAR_STATUS ROT_BAR_STATUS
 
typedef struct tagRGBQUAD RGBQUAD
 
typedef struct tagRGBQUADLPRGBQUAD
 
typedef struct tagBITMAPINFOHEADER BITMAPINFOHEADER
 
typedef struct tagBITMAPINFOHEADERPBITMAPINFOHEADER
 

Enumerations

enum  _ROT_BAR_TYPE { RB_UNSPECIFIED, RB_SQUARE_CELLS, RB_PROGRESS_BAR }
 
enum  _BBLT_VERT_ALIGNMENT { AL_VERTICAL_TOP = 0, AL_VERTICAL_CENTER, AL_VERTICAL_BOTTOM }
 
enum  _BBLT_HORZ_ALIGNMENT { AL_HORIZONTAL_LEFT = 0, AL_HORIZONTAL_CENTER, AL_HORIZONTAL_RIGHT }
 
enum  _ROT_BAR_STATUS { RBS_FADEIN = 1, RBS_ANIMATE, RBS_STOP_ANIMATE, RBS_STATUS_MAX }
 

Functions

static VOID BootLogoFadeIn (VOID)
 
static VOID BitBltPalette (IN PVOID Image, IN BOOLEAN NoPalette, IN ULONG X, IN ULONG Y)
 
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)
 
BOOLEAN NTAPI BootAnimInitialize (_In_ PLOADER_PARAMETER_BLOCK LoaderBlock, _In_ ULONG Count)
 
VOID NTAPI BootAnimTickProgressBar (_In_ ULONG SubPercentTimes100)
 Ticks the progress bar. Used by InbvUpdateProgressBar() and related. More...
 
static VOID NTAPI InbvRotationThread (_In_ PVOID Context)
 
VOID NTAPI InbvRotBarInit (VOID)
 
static VOID NTAPI DisplayFilter (_Inout_ PCHAR *String)
 
VOID NTAPI DisplayBootBitmap (_In_ BOOLEAN TextMode)
 
VOID NTAPI FinalizeBootLogo (VOID)
 

Variables

ULONG ProgressBarLeft
 
ULONG ProgressBarTop
 
BOOLEAN ShowProgressBar
 
static BOOLEAN RotBarThreadActive = FALSE
 
static ROT_BAR_TYPE RotBarSelection = RB_UNSPECIFIED
 
static ROT_BAR_STATUS PltRotBarStatus = 0
 
static UCHAR RotBarBuffer [24 *9]
 
static UCHAR RotLineBuffer [SCREEN_WIDTH *6]
 
static RGBQUAD MainPalette [16]
 

Macro Definition Documentation

◆ INBV_ROTBAR_IMPLEMENTED

#define INBV_ROTBAR_IMPLEMENTED

Definition at line 58 of file bootanim.c.

◆ MM_READONLY

#define MM_READONLY   1

Definition at line 18 of file bootanim.c.

◆ MM_READWRITE

#define MM_READWRITE   4

Definition at line 19 of file bootanim.c.

◆ PALETTE_FADE_STEPS

#define PALETTE_FADE_STEPS   12

Definition at line 124 of file bootanim.c.

◆ PALETTE_FADE_TIME

#define PALETTE_FADE_TIME   (15 * 1000) /* 15 ms */

Definition at line 125 of file bootanim.c.

◆ ROT_BAR_DEFAULT_MODE

#define ROT_BAR_DEFAULT_MODE   RB_PROGRESS_BAR

Definition at line 67 of file bootanim.c.

Typedef Documentation

◆ BBLT_HORZ_ALIGNMENT

◆ BBLT_VERT_ALIGNMENT

◆ BITMAPINFOHEADER

◆ LPRGBQUAD

◆ PBITMAPINFOHEADER

◆ RGBQUAD

From include/psdk/wingdi.h and bootvid/precomp.h

◆ ROT_BAR_STATUS

◆ ROT_BAR_TYPE

Enumeration Type Documentation

◆ _BBLT_HORZ_ALIGNMENT

Enumerator
AL_HORIZONTAL_LEFT 
AL_HORIZONTAL_CENTER 
AL_HORIZONTAL_RIGHT 

Definition at line 48 of file bootanim.c.

◆ _BBLT_VERT_ALIGNMENT

Enumerator
AL_VERTICAL_TOP 
AL_VERTICAL_CENTER 
AL_VERTICAL_BOTTOM 

Definition at line 41 of file bootanim.c.

42 {
43  AL_VERTICAL_TOP = 0,
enum _BBLT_VERT_ALIGNMENT BBLT_VERT_ALIGNMENT

◆ _ROT_BAR_STATUS

Enumerator
RBS_FADEIN 
RBS_ANIMATE 
RBS_STOP_ANIMATE 
RBS_STATUS_MAX 

Definition at line 76 of file bootanim.c.

77 {
78  RBS_FADEIN = 1,
enum _ROT_BAR_STATUS ROT_BAR_STATUS

◆ _ROT_BAR_TYPE

Enumerator
RB_UNSPECIFIED 
RB_SQUARE_CELLS 
RB_PROGRESS_BAR 

Definition at line 31 of file bootanim.c.

32 {
36 } ROT_BAR_TYPE;
enum _ROT_BAR_TYPE ROT_BAR_TYPE

Function Documentation

◆ BitBltAligned()

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 
)
static

Definition at line 213 of file bootanim.c.

222 {
223  PBITMAPINFOHEADER BitmapInfoHeader = Image;
224  ULONG X, Y;
225 
226  /* Calculate X */
227  switch (HorizontalAlignment)
228  {
229  case AL_HORIZONTAL_LEFT:
230  X = MarginLeft - MarginRight;
231  break;
232 
234  X = MarginLeft - MarginRight + (SCREEN_WIDTH - BitmapInfoHeader->biWidth + 1) / 2;
235  break;
236 
237  case AL_HORIZONTAL_RIGHT:
238  X = MarginLeft - MarginRight + SCREEN_WIDTH - BitmapInfoHeader->biWidth;
239  break;
240 
241  default:
242  /* Unknown */
243  return;
244  }
245 
246  /* Calculate Y */
247  switch (VerticalAlignment)
248  {
249  case AL_VERTICAL_TOP:
250  Y = MarginTop - MarginBottom;
251  break;
252 
253  case AL_VERTICAL_CENTER:
254  Y = MarginTop - MarginBottom + (SCREEN_HEIGHT - BitmapInfoHeader->biHeight + 1) / 2;
255  break;
256 
257  case AL_VERTICAL_BOTTOM:
258  Y = MarginTop - MarginBottom + SCREEN_HEIGHT - BitmapInfoHeader->biHeight;
259  break;
260 
261  default:
262  /* Unknown */
263  return;
264  }
265 
266  /* Finally draw the image */
267  BitBltPalette(Image, NoPalette, X, Y);
268 }
#define Y(I)
#define SCREEN_WIDTH
Definition: pc98video.c:27
static PWSTR Image
Definition: pageheap.c:13
static VOID BitBltPalette(IN PVOID Image, IN BOOLEAN NoPalette, IN ULONG X, IN ULONG Y)
Definition: bootanim.c:181
#define SCREEN_HEIGHT
Definition: pc98video.c:28
unsigned int ULONG
Definition: retypes.h:1
#define X(b, s)

Referenced by DisplayBootBitmap().

◆ BitBltPalette()

static VOID BitBltPalette ( IN PVOID  Image,
IN BOOLEAN  NoPalette,
IN ULONG  X,
IN ULONG  Y 
)
static

Definition at line 181 of file bootanim.c.

186 {
187  LPRGBQUAD Palette;
188  RGBQUAD OrigPalette[RTL_NUMBER_OF(MainPalette)];
189 
190  /* If requested, remove the palette from the image */
191  if (NoPalette)
192  {
193  /* Get bitmap header and palette */
194  PBITMAPINFOHEADER BitmapInfoHeader = Image;
195  Palette = (LPRGBQUAD)((PUCHAR)Image + BitmapInfoHeader->biSize);
196 
197  /* Save the image original palette and remove palette information */
198  RtlCopyMemory(OrigPalette, Palette, sizeof(OrigPalette));
199  RtlZeroMemory(Palette, sizeof(OrigPalette));
200  }
201 
202  /* Draw the image */
203  InbvBitBlt(Image, X, Y);
204 
205  /* Restore the image original palette */
206  if (NoPalette)
207  {
208  RtlCopyMemory(Palette, OrigPalette, sizeof(OrigPalette));
209  }
210 }
#define Y(I)
unsigned char * PUCHAR
Definition: retypes.h:3
static PWSTR Image
Definition: pageheap.c:13
ULONG RGBQUAD
Definition: precomp.h:50
struct tagRGBQUAD * LPRGBQUAD
VOID NTAPI InbvBitBlt(_In_ PUCHAR Buffer, _In_ ULONG X, _In_ ULONG Y)
Definition: inbv.c:530
#define RTL_NUMBER_OF(x)
Definition: RtlRegistry.c:12
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
static RGBQUAD MainPalette[16]
Definition: bootanim.c:122

Referenced by BitBltAligned(), and DisplayBootBitmap().

◆ BootAnimInitialize()

BOOLEAN NTAPI BootAnimInitialize ( _In_ PLOADER_PARAMETER_BLOCK  LoaderBlock,
_In_ ULONG  Count 
)

Definition at line 275 of file bootanim.c.

278 {
279 #if 0
280  ULONG i;
281 
282  /* Quit if we're already installed */
283  if (InbvBootDriverInstalled) return TRUE;
284 
285  /* Find bitmap resources in the kernel */
287  for (i = 1; i <= ResourceCount; i++)
288  {
289  /* Do the lookup */
290  ResourceList[i] = FindBitmapResource(LoaderBlock, i);
291  }
292 
293  /* Set the progress bar ranges */
294  InbvSetProgressBarSubset(0, 100);
295 #endif
296 
297  /* Return install state */
298  return TRUE;
299 }
#define TRUE
Definition: types.h:120
_Must_inspect_result_ _In_ WDFIORESREQLIST _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFIORESLIST * ResourceList
Definition: wdfresource.h:304
static PVOID FindBitmapResource(_In_ PLOADER_PARAMETER_BLOCK LoaderBlock, _In_ ULONG ResourceId)
Definition: inbv.c:97
int Count
Definition: noreturn.cpp:7
VOID NTAPI InbvSetProgressBarSubset(_In_ ULONG Floor, _In_ ULONG Ceiling)
Specifies a progress percentage sub-range. Further calls to InbvIndicateProgress() or InbvUpdateProgr...
Definition: inbv.c:663
static ULONG ResourceCount
Definition: inbv.c:50
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 RTL_NUMBER_OF(x)
Definition: RtlRegistry.c:12
#define min(a, b)
Definition: monoChain.cc:55
unsigned int ULONG
Definition: retypes.h:1
BOOLEAN InbvBootDriverInstalled
Definition: inbv.c:39

◆ BootAnimTickProgressBar()

VOID NTAPI BootAnimTickProgressBar ( _In_ ULONG  SubPercentTimes100)

Ticks the progress bar. Used by InbvUpdateProgressBar() and related.

Parameters
[in]SubPercentTimes100The progress percentage, scaled up by 100.
Returns
None.

Definition at line 312 of file bootanim.c.

314 {
315  ULONG FillCount;
316 
317  /* Make sure the progress bar is enabled, that we own and are installed */
321 
322  /* Compute fill count */
323  FillCount = VID_PROGRESS_BAR_WIDTH * SubPercentTimes100 / (100 * 100);
324 
325  /* Acquire the lock */
326  InbvAcquireLock();
327 
328  /* Fill the progress bar */
331  ProgressBarLeft + FillCount,
334 
335  /* Release the lock */
336  InbvReleaseLock();
337 }
INBV_DISPLAY_STATE NTAPI InbvGetDisplayState(VOID)
Definition: inbv.c:323
#define BV_COLOR_WHITE
Definition: display.h:30
VOID NTAPI InbvReleaseLock(VOID)
Definition: inbv.c:241
VOID NTAPI InbvAcquireLock(VOID)
Definition: inbv.c:219
ULONG ProgressBarTop
Definition: inbv.c:45
#define ASSERT(a)
Definition: mode.c:44
BOOLEAN ShowProgressBar
Definition: inbv.c:46
VOID NTAPI VidSolidColorFill(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Right, _In_ ULONG Bottom, _In_ UCHAR Color)
Definition: bootvid.c:274
#define VID_PROGRESS_BAR_HEIGHT
Definition: logo.h:22
ULONG ProgressBarLeft
Definition: inbv.c:45
#define VID_PROGRESS_BAR_WIDTH
Definition: logo.h:21
unsigned int ULONG
Definition: retypes.h:1
BOOLEAN InbvBootDriverInstalled
Definition: inbv.c:39

Referenced by InbvUpdateProgressBar().

◆ BootLogoFadeIn()

static VOID BootLogoFadeIn ( VOID  )
static

Definition at line 128 of file bootanim.c.

129 {
130  UCHAR PaletteBitmapBuffer[sizeof(BITMAPINFOHEADER) + sizeof(MainPalette)];
131  PBITMAPINFOHEADER PaletteBitmap = (PBITMAPINFOHEADER)PaletteBitmapBuffer;
132  LPRGBQUAD Palette = (LPRGBQUAD)(PaletteBitmapBuffer + sizeof(BITMAPINFOHEADER));
133  ULONG Iteration, Index, ClrUsed;
134 
135  LARGE_INTEGER Delay;
136  Delay.QuadPart = -(PALETTE_FADE_TIME * 10);
137 
138  /* Check if we are installed and we own the display */
141  {
142  return;
143  }
144 
145  /*
146  * Build a bitmap containing the fade-in palette. The palette entries
147  * are then processed in a loop and set using VidBitBlt function.
148  */
149  ClrUsed = RTL_NUMBER_OF(MainPalette);
150  RtlZeroMemory(PaletteBitmap, sizeof(BITMAPINFOHEADER));
151  PaletteBitmap->biSize = sizeof(BITMAPINFOHEADER);
152  PaletteBitmap->biBitCount = 4;
153  PaletteBitmap->biClrUsed = ClrUsed;
154 
155  /*
156  * Main animation loop.
157  */
158  for (Iteration = 0; Iteration <= PALETTE_FADE_STEPS; ++Iteration)
159  {
160  for (Index = 0; Index < ClrUsed; Index++)
161  {
162  Palette[Index].rgbRed = (UCHAR)
163  (MainPalette[Index].rgbRed * Iteration / PALETTE_FADE_STEPS);
164  Palette[Index].rgbGreen = (UCHAR)
165  (MainPalette[Index].rgbGreen * Iteration / PALETTE_FADE_STEPS);
166  Palette[Index].rgbBlue = (UCHAR)
167  (MainPalette[Index].rgbBlue * Iteration / PALETTE_FADE_STEPS);
168  }
169 
170  /* Do the animation */
171  InbvAcquireLock();
172  VidBitBlt(PaletteBitmapBuffer, 0, 0);
173  InbvReleaseLock();
174 
175  /* Wait for a bit */
177  }
178 }
INBV_DISPLAY_STATE NTAPI InbvGetDisplayState(VOID)
Definition: inbv.c:323
USHORT biBitCount
Definition: precomp.h:37
struct tagBITMAPINFOHEADER * PBITMAPINFOHEADER
UCHAR rgbBlue
Definition: bootanim.c:97
UCHAR rgbGreen
Definition: bootanim.c:98
VOID NTAPI InbvReleaseLock(VOID)
Definition: inbv.c:241
UCHAR rgbRed
Definition: bootanim.c:99
#define FALSE
Definition: types.h:117
NTSTATUS NTAPI KeDelayExecutionThread(IN KPROCESSOR_MODE WaitMode, IN BOOLEAN Alertable, IN PLARGE_INTEGER Interval OPTIONAL)
Definition: wait.c:283
VOID NTAPI InbvAcquireLock(VOID)
Definition: inbv.c:219
struct tagRGBQUAD * LPRGBQUAD
VOID NTAPI VidBitBlt(_In_ PUCHAR Buffer, _In_ ULONG Left, _In_ ULONG Top)
Definition: common.c:470
_In_ WDFCOLLECTION _In_ ULONG Index
unsigned char UCHAR
Definition: xmlstorage.h:181
struct tagBITMAPINFOHEADER BITMAPINFOHEADER
#define PALETTE_FADE_TIME
Definition: bootanim.c:125
#define RTL_NUMBER_OF(x)
Definition: RtlRegistry.c:12
#define PALETTE_FADE_STEPS
Definition: bootanim.c:124
unsigned int ULONG
Definition: retypes.h:1
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
BOOLEAN InbvBootDriverInstalled
Definition: inbv.c:39
static RGBQUAD MainPalette[16]
Definition: bootanim.c:122
LONGLONG QuadPart
Definition: typedefs.h:114

Referenced by DisplayBootBitmap().

◆ DisplayBootBitmap()

VOID NTAPI DisplayBootBitmap ( _In_ BOOLEAN  TextMode)

Definition at line 471 of file bootanim.c.

473 {
474  PVOID BootCopy = NULL, BootProgress = NULL, BootLogo = NULL, Header = NULL, Footer = NULL;
475 
476 #ifdef INBV_ROTBAR_IMPLEMENTED
477  UCHAR Buffer[24 * 9];
478  PVOID Bar = NULL, LineBmp = NULL;
479  ROT_BAR_TYPE TempRotBarSelection = RB_UNSPECIFIED;
481  HANDLE ThreadHandle = NULL;
482 #endif
483 
484 #ifdef REACTOS_SKUS
485  PVOID Text = NULL;
486 #endif
487 
488 #ifdef INBV_ROTBAR_IMPLEMENTED
489  /* Check if the animation thread has already been created */
490  if (RotBarThreadActive)
491  {
492  /* Yes, just reset the progress bar but keep the thread alive */
493  InbvAcquireLock();
495  InbvReleaseLock();
496  }
497 #endif
498 
500 
501  /* Check if this is text mode */
502  if (TextMode)
503  {
504  /*
505  * Make the kernel resource section temporarily writable,
506  * as we are going to change the bitmaps' palette in place.
507  */
509 
510  /* Check the type of the OS: workstation or server */
511  if (SharedUserData->NtProductType == NtProductWinNt)
512  {
513  /* Workstation; set colors */
517 
518  /* Get resources */
521  }
522  else
523  {
524  /* Server; set colors */
528 
529  /* Get resources */
532  }
533 
534  /* Set the scrolling region */
537 
538  /* Make sure we have resources */
539  if (Header && Footer)
540  {
541  /* BitBlt them on the screen */
542  BitBltAligned(Footer,
543  TRUE,
546  0, 0, 0, 59);
548  FALSE,
551  0, 0, 0, 0);
552  }
553 
554  /* Restore the kernel resource section protection to be read-only */
556  }
557  else
558  {
559  /* Is the boot driver installed? */
560  if (!InbvBootDriverInstalled) return;
561 
562  /*
563  * Make the kernel resource section temporarily writable,
564  * as we are going to change the bitmaps' palette in place.
565  */
567 
568  /* Load boot screen logo */
570 
571 #ifdef REACTOS_SKUS
572  Text = NULL;
573  if (SharedUserData->NtProductType == NtProductWinNt)
574  {
575 #ifdef INBV_ROTBAR_IMPLEMENTED
576  /* Workstation product, use appropriate status bar color */
578 #endif
579  }
580  else
581  {
582  /* Display correct branding based on server suite */
584  {
585  /* Storage Server Edition */
587  }
588  else if (ExVerifySuite(ComputeServer))
589  {
590  /* Compute Cluster Edition */
592  }
593  else
594  {
595  /* Normal edition */
597  }
598 
599 #ifdef INBV_ROTBAR_IMPLEMENTED
600  /* Server product, use appropriate status bar color */
602 #endif
603  }
604 #else
605  /* Use default status bar */
607 #endif
608 
609  /* Make sure we have a logo */
610  if (BootLogo)
611  {
612  /* Save the main image palette for implementing the fade-in effect */
613  PBITMAPINFOHEADER BitmapInfoHeader = BootLogo;
614  LPRGBQUAD Palette = (LPRGBQUAD)((PUCHAR)BootLogo + BitmapInfoHeader->biSize);
615  RtlCopyMemory(MainPalette, Palette, sizeof(MainPalette));
616 
617  /* Draw the logo at the center of the screen */
619  TRUE,
622  0, 0, 0, 34);
623 
624 #ifdef INBV_ROTBAR_IMPLEMENTED
625  /* Choose progress bar */
626  TempRotBarSelection = ROT_BAR_DEFAULT_MODE;
627 #endif
628 
629  /* Set progress bar coordinates and display it */
632 
633 #ifdef REACTOS_SKUS
634  /* Check for non-workstation products */
635  if (SharedUserData->NtProductType != NtProductWinNt)
636  {
637  /* Overwrite part of the logo for a server product */
639  VID_SKU_SAVE_AREA_TOP, 7, 7, 8);
643  VID_SKU_SAVE_AREA_TOP, 7, 7, 8);
644 
645  /* In setup mode, you haven't selected a SKU yet */
647  }
648 #endif
649  }
650 
651  /* Load and draw progress bar bitmap */
653  BitBltAligned(BootProgress,
654  TRUE,
657  0, 118, 0, 0);
658 
659  /* Load and draw copyright text bitmap */
661  BitBltAligned(BootCopy,
662  TRUE,
665  22, 0, 0, 20);
666 
667 #ifdef REACTOS_SKUS
668  /* Draw the SKU text if it exits */
669  if (Text)
671 #endif
672 
673 #ifdef INBV_ROTBAR_IMPLEMENTED
674  if ((TempRotBarSelection == RB_SQUARE_CELLS) && Bar)
675  {
676  /* Save previous screen pixels to buffer */
677  InbvScreenToBufferBlt(Buffer, 0, 0, 22, 9, 24);
678  /* Draw the progress bar bit */
679  BitBltPalette(Bar, TRUE, 0, 0);
680  /* Store it in global buffer */
681  InbvScreenToBufferBlt(RotBarBuffer, 0, 0, 22, 9, 24);
682  /* Restore screen pixels */
683  InbvBufferToScreenBlt(Buffer, 0, 0, 22, 9, 24);
684  }
685 
686  /*
687  * Add a rotating bottom horizontal bar when using a progress bar,
688  * to show that ReactOS can be still alive when the bar does not
689  * appear to progress.
690  */
691  if (TempRotBarSelection == RB_PROGRESS_BAR)
692  {
694  if (LineBmp)
695  {
696  /* Draw the line and store it in global buffer */
697  BitBltPalette(LineBmp, TRUE, 0, SCREEN_HEIGHT-6);
699  }
700  }
701  else
702  {
703  /* Hide the simple progress bar if not used */
705  }
706 #endif
707 
708  /* Restore the kernel resource section protection to be read-only */
710 
711  /* Display the boot logo and fade it in */
712  BootLogoFadeIn();
713 
714 #ifdef INBV_ROTBAR_IMPLEMENTED
715  if (!RotBarThreadActive && TempRotBarSelection != RB_UNSPECIFIED)
716  {
717  /* Start the animation thread */
718  Status = PsCreateSystemThread(&ThreadHandle,
719  0,
720  NULL,
721  NULL,
722  NULL,
724  NULL);
725  if (NT_SUCCESS(Status))
726  {
727  /* The thread has started, close the handle as we don't need it */
729  ObCloseHandle(ThreadHandle, KernelMode);
730  }
731  }
732 #endif
733 
734  /* Set filter which will draw text display if needed */
736  }
737 
738 #ifdef INBV_ROTBAR_IMPLEMENTED
739  /* Do we have the animation thread? */
740  if (RotBarThreadActive)
741  {
742  /* We do, initialize the progress bar */
743  InbvAcquireLock();
744  RotBarSelection = TempRotBarSelection;
745  InbvRotBarInit();
746  InbvReleaseLock();
747  }
748 #endif
749 }
#define IDB_SERVER_FOOTER
Definition: resource.h:25
VOID NTAPI InbvSetScrollRegion(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Right, _In_ ULONG Bottom)
Definition: inbv.c:447
#define TRUE
Definition: types.h:120
static ROT_BAR_TYPE RotBarSelection
Definition: bootanim.c:85
unsigned char * PUCHAR
Definition: retypes.h:3
VOID NTAPI InbvBufferToScreenBlt(_In_ PUCHAR Buffer, _In_ ULONG X, _In_ ULONG Y, _In_ ULONG Width, _In_ ULONG Height, _In_ ULONG Delta)
Definition: inbv.c:552
LONG NTSTATUS
Definition: precomp.h:26
#define SCREEN_WIDTH
Definition: pc98video.c:27
#define VID_SKU_SAVE_AREA_LEFT
Definition: logo.h:35
#define VID_FOOTER_BG_TOP
Definition: logo.h:41
#define VID_SCROLL_AREA_BOTTOM
Definition: logo.h:17
#define MM_READWRITE
Definition: bootanim.c:19
#define BV_COLOR_WHITE
Definition: display.h:30
static UCHAR RotBarBuffer[24 *9]
Definition: bootanim.c:87
#define VID_SKU_AREA_LEFT
Definition: logo.h:30
#define VID_SCROLL_AREA_TOP
Definition: logo.h:15
static VOID NTAPI DisplayFilter(_Inout_ PCHAR *String)
Definition: bootanim.c:446
#define VID_SKU_AREA_BOTTOM
Definition: logo.h:33
BOOLEAN NTAPI ExVerifySuite(SUITE_TYPE SuiteType)
Definition: sysinfo.c:377
VOID NTAPI InbvReleaseLock(VOID)
Definition: inbv.c:241
BOOLEAN BootLogo
Definition: winldr.c:35
#define VID_SKU_TEXT_TOP
Definition: logo.h:39
#define FALSE
Definition: types.h:117
Definition: Header.h:8
enum _ROT_BAR_TYPE ROT_BAR_TYPE
#define IDB_PROGRESS_BAR
Definition: resource.h:43
void Bar(void)
Definition: terminate.cpp:70
#define IDB_SERVER_LOGO
Definition: resource.h:23
BOOLEAN NTAPI MmChangeKernelResourceSectionProtection(IN ULONG_PTR ProtectionMask)
Definition: sysldr.c:2280
#define VID_SCROLL_AREA_LEFT
Definition: logo.h:14
VOID NTAPI InbvInstallDisplayStringFilter(_In_ INBV_DISPLAY_STRING_FILTER DisplayFilter)
Definition: inbv.c:386
VOID NTAPI InbvAcquireLock(VOID)
Definition: inbv.c:219
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: bootanim.c:213
Definition: bufpool.h:45
static VOID BitBltPalette(IN PVOID Image, IN BOOLEAN NoPalette, IN ULONG X, IN ULONG Y)
Definition: bootanim.c:181
#define IDB_COPYRIGHT
Definition: resource.h:44
#define IDB_LOGO_DEFAULT
Definition: resource.h:15
#define VID_PROGRESS_BAR_LEFT
Definition: logo.h:19
#define IDB_STORAGE_SERVER
Definition: resource.h:37
Status
Definition: gdiplustypes.h:24
#define SCREEN_HEIGHT
Definition: pc98video.c:28
#define IDB_BAR_DEFAULT
Definition: resource.h:14
static VOID NTAPI InbvRotationThread(_In_ PVOID Context)
Definition: bootanim.c:343
struct tagRGBQUAD * LPRGBQUAD
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
BOOLEAN ShowProgressBar
Definition: inbv.c:46
PUCHAR NTAPI InbvGetResourceAddress(_In_ ULONG ResourceNumber)
Definition: inbv.c:162
#define VID_SKU_AREA_RIGHT
Definition: logo.h:32
static BOOLEAN RotBarThreadActive
Definition: bootanim.c:84
#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:3379
#define BV_COLOR_LIGHT_CYAN
Definition: display.h:29
VOID NTAPI InbvSolidColorFill(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Right, _In_ ULONG Bottom, _In_ ULONG Color)
Definition: inbv.c:484
#define VID_PROGRESS_BAR_TOP
Definition: logo.h:20
#define VID_SCROLL_AREA_RIGHT
Definition: logo.h:16
BOOLEAN ExpInTextModeSetup
Definition: init.c:69
#define VID_SKU_TEXT_LEFT
Definition: logo.h:38
#define IDB_WKSTA_FOOTER
Definition: resource.h:18
NTSTATUS NTAPI PsCreateSystemThread(OUT PHANDLE ThreadHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes, IN HANDLE ProcessHandle, IN PCLIENT_ID ClientId, IN PKSTART_ROUTINE StartRoutine, IN PVOID StartContext)
Definition: thread.c:602
#define NULL
Definition: types.h:112
#define BV_COLOR_BLACK
Definition: display.h:15
#define VID_SKU_AREA_TOP
Definition: logo.h:31
#define VID_SKU_SAVE_AREA_TOP
Definition: logo.h:36
VOID NTAPI InbvRotBarInit(VOID)
Definition: bootanim.c:435
#define IDB_ROTATING_LINE
Definition: resource.h:42
#define IDB_BAR_WKSTA
Definition: resource.h:20
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
static UCHAR RotLineBuffer[SCREEN_WIDTH *6]
Definition: bootanim.c:88
BOOLEAN InbvBootDriverInstalled
Definition: inbv.c:39
#define BV_COLOR_RED
Definition: display.h:16
VOID NTAPI InbvScreenToBufferBlt(_Out_ PUCHAR Buffer, _In_ ULONG X, _In_ ULONG Y, _In_ ULONG Width, _In_ ULONG Height, _In_ ULONG Delta)
Definition: inbv.c:571
#define MM_READONLY
Definition: bootanim.c:18
#define ROT_BAR_DEFAULT_MODE
Definition: bootanim.c:67
VOID NTAPI InbvSetTextColor(_In_ ULONG Color)
Definition: inbv.c:459
#define IDB_CLUSTER_SERVER
Definition: resource.h:38
static RGBQUAD MainPalette[16]
Definition: bootanim.c:122
static VOID BootLogoFadeIn(VOID)
Definition: bootanim.c:128
#define IDB_WKSTA_HEADER
Definition: resource.h:17
char * Text
Definition: combotst.c:136
#define IDB_SERVER_HEADER
Definition: resource.h:24
VOID NTAPI InbvSetProgressBarCoordinates(_In_ ULONG Left, _In_ ULONG Top)
Sets the screen coordinates of the loading progress bar and enable it.
Definition: inbv.c:600

Referenced by DisplayFilter(), and Phase1InitializationDiscard().

◆ DisplayFilter()

static VOID NTAPI DisplayFilter ( _Inout_ PCHAR String)
static

Definition at line 446 of file bootanim.c.

448 {
449  /* Windows hack to skip first dots displayed by AUTOCHK */
450  static BOOLEAN DotHack = TRUE;
451 
452  /* If "." is given set *String to empty string */
453  if (DotHack && strcmp(*String, ".") == 0)
454  *String = "";
455 
456  if (**String)
457  {
458  /* Remove the filter */
460 
461  DotHack = FALSE;
462 
463  /* Draw text screen */
465  }
466 }
#define TRUE
Definition: types.h:120
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFSTRING String
Definition: wdfdevice.h:2430
#define FALSE
Definition: types.h:117
unsigned char BOOLEAN
VOID NTAPI InbvInstallDisplayStringFilter(_In_ INBV_DISPLAY_STRING_FILTER DisplayFilter)
Definition: inbv.c:386
VOID NTAPI DisplayBootBitmap(_In_ BOOLEAN TextMode)
Definition: bootanim.c:471
#define NULL
Definition: types.h:112
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469

Referenced by DisplayBootBitmap(), and InbvInstallDisplayStringFilter().

◆ FinalizeBootLogo()

VOID NTAPI FinalizeBootLogo ( VOID  )

Definition at line 754 of file bootanim.c.

755 {
756  /* Acquire lock and check the display state */
757  InbvAcquireLock();
759  {
760  /* Clear the screen */
762  }
763 
764  /* Reset progress bar and lock */
765 #ifdef INBV_ROTBAR_IMPLEMENTED
768 #endif
769  InbvReleaseLock();
770 }
INBV_DISPLAY_STATE NTAPI InbvGetDisplayState(VOID)
Definition: inbv.c:323
#define SCREEN_WIDTH
Definition: pc98video.c:27
VOID NTAPI InbvReleaseLock(VOID)
Definition: inbv.c:241
#define FALSE
Definition: types.h:117
VOID NTAPI InbvAcquireLock(VOID)
Definition: inbv.c:219
#define SCREEN_HEIGHT
Definition: pc98video.c:28
static BOOLEAN RotBarThreadActive
Definition: bootanim.c:84
VOID NTAPI VidSolidColorFill(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Right, _In_ ULONG Bottom, _In_ UCHAR Color)
Definition: bootvid.c:274
#define BV_COLOR_BLACK
Definition: display.h:15
static ROT_BAR_STATUS PltRotBarStatus
Definition: bootanim.c:86

Referenced by Phase1InitializationDiscard().

◆ InbvRotationThread()

static VOID NTAPI InbvRotationThread ( _In_ PVOID  Context)
static

Definition at line 343 of file bootanim.c.

345 {
346  ULONG X, Y, Index, Total;
347  LARGE_INTEGER Delay = {{0}};
348 
349  InbvAcquireLock();
351  {
352  Index = 0;
353  }
354  else
355  {
356  Index = 32;
357  }
358  X = ProgressBarLeft + 2;
359  Y = ProgressBarTop + 2;
360  InbvReleaseLock();
361 
363  {
364  /* Wait for a bit */
366 
367  InbvAcquireLock();
368 
369  /* Unknown unexpected command */
371 
373  {
374  /* Stop the thread */
375  InbvReleaseLock();
376  break;
377  }
378 
380  {
381  Delay.QuadPart = -800000; // 80 ms
382  Total = 18;
383  Index %= Total;
384 
385  if (Index >= 3)
386  {
387  /* Fill previous bar position */
388  VidSolidColorFill(X + ((Index - 3) * 8), Y, (X + ((Index - 3) * 8)) + 8 - 1, Y + 9 - 1, BV_COLOR_BLACK);
389  }
390  if (Index < Total - 1)
391  {
392  /* Draw the progress bar bit */
393  if (Index < 2)
394  {
395  /* Appearing from the left */
396  VidBufferToScreenBlt(RotBarBuffer + 8 * (2 - Index) / 2, X, Y, 22 - 8 * (2 - Index), 9, 24);
397  }
398  else if (Index >= Total - 3)
399  {
400  /* Hiding to the right */
401  VidBufferToScreenBlt(RotBarBuffer, X + ((Index - 2) * 8), Y, 22 - 8 * (4 - (Total - Index)), 9, 24);
402  }
403  else
404  {
405  VidBufferToScreenBlt(RotBarBuffer, X + ((Index - 2) * 8), Y, 22, 9, 24);
406  }
407  }
408  Index++;
409  }
410  else if (RotBarSelection == RB_PROGRESS_BAR)
411  {
412  Delay.QuadPart = -600000; // 60 ms
413  Total = SCREEN_WIDTH;
414  Index %= Total;
415 
416  /* Right part */
418  if (Index > 0)
419  {
420  /* Left part */
422  }
423  Index += 32;
424  }
425 
426  InbvReleaseLock();
427  }
428 
430 }
INBV_DISPLAY_STATE NTAPI InbvGetDisplayState(VOID)
Definition: inbv.c:323
#define Y(I)
static ROT_BAR_TYPE RotBarSelection
Definition: bootanim.c:85
#define SCREEN_WIDTH
Definition: pc98video.c:27
static UCHAR RotBarBuffer[24 *9]
Definition: bootanim.c:87
VOID NTAPI InbvReleaseLock(VOID)
Definition: inbv.c:241
#define FALSE
Definition: types.h:117
NTSTATUS NTAPI KeDelayExecutionThread(IN KPROCESSOR_MODE WaitMode, IN BOOLEAN Alertable, IN PLARGE_INTEGER Interval OPTIONAL)
Definition: wait.c:283
VOID NTAPI InbvAcquireLock(VOID)
Definition: inbv.c:219
#define SCREEN_HEIGHT
Definition: pc98video.c:28
ULONG ProgressBarTop
Definition: inbv.c:45
#define ASSERT(a)
Definition: mode.c:44
_In_ WDFCOLLECTION _In_ ULONG Index
VOID NTAPI VidSolidColorFill(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Right, _In_ ULONG Bottom, _In_ UCHAR Color)
Definition: bootvid.c:274
ULONG ProgressBarLeft
Definition: inbv.c:45
NTSTATUS NTAPI PsTerminateSystemThread(IN NTSTATUS ExitStatus)
Definition: kill.c:1148
#define BV_COLOR_BLACK
Definition: display.h:15
VOID NTAPI VidBufferToScreenBlt(_In_reads_bytes_(Delta *Height) PUCHAR Buffer, _In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Width, _In_ ULONG Height, _In_ ULONG Delta)
Definition: common.c:452
unsigned int ULONG
Definition: retypes.h:1
#define STATUS_SUCCESS
Definition: shellext.h:65
static UCHAR RotLineBuffer[SCREEN_WIDTH *6]
Definition: bootanim.c:88
static ROT_BAR_STATUS PltRotBarStatus
Definition: bootanim.c:86
#define X(b, s)
LONGLONG QuadPart
Definition: typedefs.h:114

Referenced by DisplayBootBitmap().

◆ InbvRotBarInit()

VOID NTAPI InbvRotBarInit ( VOID  )

Definition at line 435 of file bootanim.c.

436 {
438  /* Perform other initialization if needed */
439 }
static ROT_BAR_STATUS PltRotBarStatus
Definition: bootanim.c:86

Referenced by DisplayBootBitmap().

Variable Documentation

◆ MainPalette

RGBQUAD MainPalette[16]
static

Definition at line 122 of file bootanim.c.

Referenced by BitBltPalette(), BootLogoFadeIn(), and DisplayBootBitmap().

◆ PltRotBarStatus

ROT_BAR_STATUS PltRotBarStatus = 0
static

Definition at line 86 of file bootanim.c.

Referenced by FinalizeBootLogo(), InbvRotationThread(), and InbvRotBarInit().

◆ ProgressBarLeft

ULONG ProgressBarLeft

◆ ProgressBarTop

ULONG ProgressBarTop

◆ RotBarBuffer

UCHAR RotBarBuffer[24 *9]
static

Definition at line 87 of file bootanim.c.

Referenced by DisplayBootBitmap(), and InbvRotationThread().

◆ RotBarSelection

ROT_BAR_TYPE RotBarSelection = RB_UNSPECIFIED
static

Definition at line 85 of file bootanim.c.

Referenced by DisplayBootBitmap(), and InbvRotationThread().

◆ RotBarThreadActive

BOOLEAN RotBarThreadActive = FALSE
static

Definition at line 84 of file bootanim.c.

Referenced by DisplayBootBitmap(), and FinalizeBootLogo().

◆ RotLineBuffer

UCHAR RotLineBuffer[SCREEN_WIDTH *6]
static

Definition at line 88 of file bootanim.c.

Referenced by DisplayBootBitmap(), and InbvRotationThread().

◆ ShowProgressBar