ReactOS 0.4.15-dev-7924-g5949c20
bootanim.c
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS Kernel
3 * LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
4 * PURPOSE: Boot Theme & Animation
5 * COPYRIGHT: Copyright 2007 Alex Ionescu (alex.ionescu@reactos.org)
6 * Copyright 2007 Hervé Poussineau (hpoussin@reactos.org)
7 * Copyright 2012-2022 Hermès Bélusca-Maïto
8 * Copyright 2017-2018 Stanislav Motylkov
9 * Copyright 2019-2020 Yaroslav Kibysh
10 */
11
12/* INCLUDES ******************************************************************/
13
14#include <ntoskrnl.h>
15#include "inbv/logo.h"
16
17/* See also mm/ARM3/miarm.h */
18#define MM_READONLY 1 // PAGE_READONLY
19#define MM_READWRITE 4 // PAGE_WRITECOPY
20
21/* GLOBALS *******************************************************************/
22
23/*
24 * ReactOS uses the same boot screen for all the products.
25 *
26 * Enable this define when ReactOS will have different SKUs
27 * (Workstation, Server, Storage Server, Cluster Server, etc...).
28 */
29// #define REACTOS_SKUS
30
31/*
32 * Enable this define for having fancy features
33 * in the boot and shutdown screens.
34 */
35// #define REACTOS_FANCY_BOOT
36
37/*
38 * BitBltAligned() alignments
39 */
41{
46
48{
53
54/*
55 * Enable this define when Inbv will support rotating progress bar.
56 */
57#define INBV_ROTBAR_IMPLEMENTED
58
61
62#ifdef INBV_ROTBAR_IMPLEMENTED
63/*
64 * Change this to modify progress bar behaviour
65 */
66#define ROT_BAR_DEFAULT_MODE RB_PROGRESS_BAR
67
68/*
69 * Values for PltRotBarStatus:
70 * - PltRotBarStatus == 1, do palette fading-in (done elsewhere in ReactOS);
71 * - PltRotBarStatus == 2, do rotation bar animation;
72 * - PltRotBarStatus == 3, stop the animation thread.
73 * - Any other value is ignored and the animation thread continues to run.
74 */
75typedef enum _ROT_BAR_STATUS
76{
82
83typedef enum _ROT_BAR_TYPE
84{
89
93static UCHAR RotBarBuffer[24 * 9];
95#endif // INBV_ROTBAR_IMPLEMENTED
96
97
98/* FADE-IN FUNCTION **********************************************************/
99
101typedef struct tagRGBQUAD
102{
108
109//
110// Bitmap Header
111//
112typedef struct tagBITMAPINFOHEADER
113{
126/*******************************/
127
129
130#define PALETTE_FADE_STEPS 12
131#define PALETTE_FADE_TIME (15 * 1000) /* 15 ms */
132
133static VOID
135{
136 UCHAR PaletteBitmapBuffer[sizeof(BITMAPINFOHEADER) + sizeof(MainPalette)];
137 PBITMAPINFOHEADER PaletteBitmap = (PBITMAPINFOHEADER)PaletteBitmapBuffer;
138 LPRGBQUAD Palette = (LPRGBQUAD)(PaletteBitmapBuffer + sizeof(BITMAPINFOHEADER));
139 ULONG Iteration, Index, ClrUsed;
140
141 LARGE_INTEGER Delay;
142 Delay.QuadPart = -(PALETTE_FADE_TIME * 10);
143
144 /* Check if we are installed and we own the display */
147 {
148 return;
149 }
150
151 /*
152 * Build a bitmap containing the fade-in palette. The palette entries
153 * are then processed in a loop and set using VidBitBlt function.
154 */
155 ClrUsed = RTL_NUMBER_OF(MainPalette);
156 RtlZeroMemory(PaletteBitmap, sizeof(BITMAPINFOHEADER));
157 PaletteBitmap->biSize = sizeof(BITMAPINFOHEADER);
158 PaletteBitmap->biBitCount = 4;
159 PaletteBitmap->biClrUsed = ClrUsed;
160
161 /*
162 * Main animation loop.
163 */
164 for (Iteration = 0; Iteration <= PALETTE_FADE_STEPS; ++Iteration)
165 {
166 for (Index = 0; Index < ClrUsed; Index++)
167 {
168 Palette[Index].rgbRed = (UCHAR)
169 (MainPalette[Index].rgbRed * Iteration / PALETTE_FADE_STEPS);
170 Palette[Index].rgbGreen = (UCHAR)
171 (MainPalette[Index].rgbGreen * Iteration / PALETTE_FADE_STEPS);
172 Palette[Index].rgbBlue = (UCHAR)
173 (MainPalette[Index].rgbBlue * Iteration / PALETTE_FADE_STEPS);
174 }
175
176 /* Do the animation */
178 VidBitBlt(PaletteBitmapBuffer, 0, 0);
180
181 /* Wait for a bit */
183 }
184}
185
186static VOID
188 IN PVOID Image,
189 IN BOOLEAN NoPalette,
190 IN ULONG X,
191 IN ULONG Y)
192{
193 LPRGBQUAD Palette;
194 RGBQUAD OrigPalette[RTL_NUMBER_OF(MainPalette)];
195
196 /* If requested, remove the palette from the image */
197 if (NoPalette)
198 {
199 /* Get bitmap header and palette */
200 PBITMAPINFOHEADER BitmapInfoHeader = Image;
201 Palette = (LPRGBQUAD)((PUCHAR)Image + BitmapInfoHeader->biSize);
202
203 /* Save the image original palette and remove palette information */
204 RtlCopyMemory(OrigPalette, Palette, sizeof(OrigPalette));
205 RtlZeroMemory(Palette, sizeof(OrigPalette));
206 }
207
208 /* Draw the image */
209 InbvBitBlt(Image, X, Y);
210
211 /* Restore the image original palette */
212 if (NoPalette)
213 {
214 RtlCopyMemory(Palette, OrigPalette, sizeof(OrigPalette));
215 }
216}
217
218static VOID
220 IN PVOID Image,
221 IN BOOLEAN NoPalette,
222 IN BBLT_HORZ_ALIGNMENT HorizontalAlignment,
223 IN BBLT_VERT_ALIGNMENT VerticalAlignment,
224 IN ULONG MarginLeft,
225 IN ULONG MarginTop,
226 IN ULONG MarginRight,
227 IN ULONG MarginBottom)
228{
229 PBITMAPINFOHEADER BitmapInfoHeader = Image;
230 ULONG X, Y;
231
232 /* Calculate X */
233 switch (HorizontalAlignment)
234 {
236 X = MarginLeft - MarginRight;
237 break;
238
240 X = MarginLeft - MarginRight + (SCREEN_WIDTH - BitmapInfoHeader->biWidth + 1) / 2;
241 break;
242
244 X = MarginLeft - MarginRight + SCREEN_WIDTH - BitmapInfoHeader->biWidth;
245 break;
246
247 default:
248 /* Unknown */
249 return;
250 }
251
252 /* Calculate Y */
253 switch (VerticalAlignment)
254 {
255 case AL_VERTICAL_TOP:
256 Y = MarginTop - MarginBottom;
257 break;
258
260 Y = MarginTop - MarginBottom + (SCREEN_HEIGHT - BitmapInfoHeader->biHeight + 1) / 2;
261 break;
262
264 Y = MarginTop - MarginBottom + SCREEN_HEIGHT - BitmapInfoHeader->biHeight;
265 break;
266
267 default:
268 /* Unknown */
269 return;
270 }
271
272 /* Finally draw the image */
273 BitBltPalette(Image, NoPalette, X, Y);
274}
275
276/* FUNCTIONS *****************************************************************/
277
278CODE_SEG("INIT")
280NTAPI
282 _In_ PLOADER_PARAMETER_BLOCK LoaderBlock,
284{
285#if 0
286 ULONG i;
287
288 /* Quit if we're already installed */
289 if (InbvBootDriverInstalled) return TRUE;
290
291 /* Find bitmap resources in the kernel */
293 for (i = 1; i <= ResourceCount; i++)
294 {
295 /* Do the lookup */
296 ResourceList[i] = FindBitmapResource(LoaderBlock, i);
297 }
298
299 /* Set the progress bar ranges */
301#endif
302
303 /* Return install state */
304 return TRUE;
305}
306
316VOID
317NTAPI
319 _In_ ULONG SubPercentTimes100)
320{
321 ULONG FillCount;
322
323 /* Make sure the progress bar is enabled, that we own and are installed */
327
328 /* Compute fill count */
329 FillCount = VID_PROGRESS_BAR_WIDTH * SubPercentTimes100 / (100 * 100);
330
331 /* Acquire the lock */
333
334 /* Fill the progress bar */
337 ProgressBarLeft + FillCount,
340
341 /* Release the lock */
343}
344
345#ifdef INBV_ROTBAR_IMPLEMENTED
346static
347VOID
348NTAPI
351{
352 ULONG X, Y, Index, Total;
353 LARGE_INTEGER Delay = {{0}};
354
356
359 {
360 Index = 0;
361 }
362 else
363 {
364 Index = 32;
365 }
366 X = ProgressBarLeft + 2;
367 Y = ProgressBarTop + 2;
369
371 {
372 /* Wait for a bit */
374
376
377 /* Unknown unexpected command */
379
381 {
382 /* Stop the thread */
384 break;
385 }
386
388 {
389 Delay.QuadPart = -800000LL; // 80 ms
390 Total = 18;
391 Index %= Total;
392
393 if (Index >= 3)
394 {
395 /* Fill previous bar position */
396 VidSolidColorFill(X + ((Index - 3) * 8), Y, (X + ((Index - 3) * 8)) + 8 - 1, Y + 9 - 1, BV_COLOR_BLACK);
397 }
398 if (Index < Total - 1)
399 {
400 /* Draw the progress bar bit */
401 if (Index < 2)
402 {
403 /* Appearing from the left */
404 VidBufferToScreenBlt(RotBarBuffer + 8 * (2 - Index) / 2, X, Y, 22 - 8 * (2 - Index), 9, 24);
405 }
406 else if (Index >= Total - 3)
407 {
408 /* Hiding to the right */
409 VidBufferToScreenBlt(RotBarBuffer, X + ((Index - 2) * 8), Y, 22 - 8 * (4 - (Total - Index)), 9, 24);
410 }
411 else
412 {
413 VidBufferToScreenBlt(RotBarBuffer, X + ((Index - 2) * 8), Y, 22, 9, 24);
414 }
415 }
416 Index++;
417 }
419 {
420 Delay.QuadPart = -600000LL; // 60 ms
421 Total = SCREEN_WIDTH;
422 Index %= Total;
423
424 /* Right part */
426 if (Index > 0)
427 {
428 /* Left part */
430 }
431 Index += 32;
432 }
433
435 }
436
438}
439
440CODE_SEG("INIT")
441VOID
442NTAPI
444{
446 /* Perform other initialization if needed */
447}
448#endif // INBV_ROTBAR_IMPLEMENTED
449
450CODE_SEG("INIT")
451static
452VOID
453NTAPI
456{
457 /* Windows hack to skip first dots displayed by AUTOCHK */
458 static BOOLEAN DotHack = TRUE;
459
460 /* If "." is given set *String to empty string */
461 if (DotHack && strcmp(*String, ".") == 0)
462 *String = "";
463
464 if (**String)
465 {
466 /* Remove the filter */
468
469 DotHack = FALSE;
470
471 /* Draw text screen */
473 }
474}
475
476#ifdef REACTOS_FANCY_BOOT
477
478/* Returns TRUE if this is Christmas time, or FALSE if not */
479static BOOLEAN
480IsXmasTime(VOID)
481{
482 LARGE_INTEGER SystemTime;
484
485 /* Use KeBootTime if it's initialized, otherwise call the HAL */
486 SystemTime = KeBootTime;
487 if ((SystemTime.QuadPart == 0) && HalQueryRealTimeClock(&Time))
488 RtlTimeFieldsToTime(&Time, &SystemTime);
489
490 ExSystemTimeToLocalTime(&SystemTime, &SystemTime);
491 RtlTimeToTimeFields(&SystemTime, &Time);
492 return ((Time.Month == 12) && (20 <= Time.Day) && (Time.Day <= 31));
493}
494
495#define SELECT_LOGO_ID(LogoIdDefault, Cond, LogoIdAlt) \
496 ((Cond) ? (LogoIdAlt) : (LogoIdDefault))
497
498#else
499
500#define SELECT_LOGO_ID(LogoIdDefault, Cond, LogoIdAlt) (LogoIdDefault)
501
502#endif // REACTOS_FANCY_BOOT
503
504CODE_SEG("INIT")
505VOID
506NTAPI
508 _In_ BOOLEAN TextMode)
509{
510 PVOID BootCopy = NULL, BootProgress = NULL, BootLogo = NULL, Header = NULL, Footer = NULL;
511
512#ifdef INBV_ROTBAR_IMPLEMENTED
514 PVOID Bar = NULL, LineBmp = NULL;
515 ROT_BAR_TYPE TempRotBarSelection = RB_UNSPECIFIED;
517 HANDLE ThreadHandle = NULL;
518#endif
519
520#ifdef REACTOS_SKUS
521 PVOID Text = NULL;
522#endif
523
524#ifdef INBV_ROTBAR_IMPLEMENTED
525 /* Check if the animation thread has already been created */
527 {
528 /* Yes, just reset the progress bar but keep the thread alive */
532 }
533#endif
534
536
537 /* Check if this is text mode */
538 if (TextMode)
539 {
540 /*
541 * Make the kernel resource section temporarily writable,
542 * as we are going to change the bitmaps' palette in place.
543 */
545
546 /* Check the type of the OS: workstation or server */
547 if (SharedUserData->NtProductType == NtProductWinNt)
548 {
549 /* Workstation; set colors */
553
554 /* Get resources */
557 }
558 else
559 {
560 /* Server; set colors */
564
565 /* Get resources */
568 }
569
570 /* Set the scrolling region */
573
574 /* Make sure we have resources */
575 if (Header && Footer)
576 {
577 /* BitBlt them on the screen */
578 BitBltAligned(Footer,
579 TRUE,
582 0, 0, 0, 59);
584 FALSE,
587 0, 0, 0, 0);
588 }
589
590 /* Restore the kernel resource section protection to be read-only */
592 }
593 else
594 {
595#ifdef REACTOS_FANCY_BOOT
596 /* Decide whether this is a good time to change our logo ;^) */
597 BOOLEAN IsXmas = IsXmasTime();
598#endif
599
600 /* Is the boot driver installed? */
601 if (!InbvBootDriverInstalled) return;
602
603 /*
604 * Make the kernel resource section temporarily writable,
605 * as we are going to change the bitmaps' palette in place.
606 */
608
609 /* Load boot screen logo */
612
613#ifdef REACTOS_SKUS
614 Text = NULL;
615 if (SharedUserData->NtProductType == NtProductWinNt)
616 {
617#ifdef INBV_ROTBAR_IMPLEMENTED
618 /* Workstation product, use appropriate status bar color */
620#endif
621 }
622 else
623 {
624 /* Display correct branding based on server suite */
626 {
627 /* Storage Server Edition */
629 }
631 {
632 /* Compute Cluster Edition */
634 }
635 else
636 {
637 /* Normal edition */
640 }
641
642#ifdef INBV_ROTBAR_IMPLEMENTED
643 /* Server product, use appropriate status bar color */
645#endif
646 }
647#else // REACTOS_SKUS
648#ifdef INBV_ROTBAR_IMPLEMENTED
649 /* Use default status bar */
651#endif
652#endif // REACTOS_SKUS
653
654 /* Make sure we have a logo */
655 if (BootLogo)
656 {
657 /* Save the main image palette for implementing the fade-in effect */
658 PBITMAPINFOHEADER BitmapInfoHeader = BootLogo;
659 LPRGBQUAD Palette = (LPRGBQUAD)((PUCHAR)BootLogo + BitmapInfoHeader->biSize);
660 RtlCopyMemory(MainPalette, Palette, sizeof(MainPalette));
661
662 /* Draw the logo at the center of the screen */
664 TRUE,
667 0, 0, 0, 34);
668
669#ifdef INBV_ROTBAR_IMPLEMENTED
670 /* Choose progress bar */
671 TempRotBarSelection = ROT_BAR_DEFAULT_MODE;
672#endif
673
674 /* Set progress bar coordinates and display it */
677
678#ifdef REACTOS_SKUS
679 /* Check for non-workstation products */
680 if (SharedUserData->NtProductType != NtProductWinNt)
681 {
682 /* Overwrite part of the logo for a server product */
684 VID_SKU_SAVE_AREA_TOP, 7, 7, 8);
688 VID_SKU_SAVE_AREA_TOP, 7, 7, 8);
689
690 /* In setup mode, you haven't selected a SKU yet */
692 }
693#endif // REACTOS_SKUS
694 }
695
696 /* Load and draw progress bar bitmap */
698 BitBltAligned(BootProgress,
699 TRUE,
702 0, 118, 0, 0);
703
704 /* Load and draw copyright text bitmap */
706 BitBltAligned(BootCopy,
707 TRUE,
710 22, 0, 0, 20);
711
712#ifdef REACTOS_SKUS
713 /* Draw the SKU text if it exits */
714 if (Text)
716#endif
717
718#ifdef INBV_ROTBAR_IMPLEMENTED
719 if ((TempRotBarSelection == RB_SQUARE_CELLS) && Bar)
720 {
721 /* Save previous screen pixels to buffer */
722 InbvScreenToBufferBlt(Buffer, 0, 0, 22, 9, 24);
723 /* Draw the progress bar bit */
724 BitBltPalette(Bar, TRUE, 0, 0);
725 /* Store it in global buffer */
726 InbvScreenToBufferBlt(RotBarBuffer, 0, 0, 22, 9, 24);
727 /* Restore screen pixels */
728 InbvBufferToScreenBlt(Buffer, 0, 0, 22, 9, 24);
729 }
730
731 /*
732 * Add a rotating bottom horizontal bar when using a progress bar,
733 * to show that ReactOS can be still alive when the bar does not
734 * appear to progress.
735 */
736 if (TempRotBarSelection == RB_PROGRESS_BAR)
737 {
739 if (LineBmp)
740 {
741 /* Draw the line and store it in global buffer */
742 BitBltPalette(LineBmp, TRUE, 0, SCREEN_HEIGHT-6);
744 }
745 }
746 else
747 {
748 /* Hide the simple progress bar if not used */
750 }
751#endif // INBV_ROTBAR_IMPLEMENTED
752
753 /* Restore the kernel resource section protection to be read-only */
755
756 /* Display the boot logo and fade it in */
758
759#ifdef INBV_ROTBAR_IMPLEMENTED
760 if (!RotBarThreadActive && TempRotBarSelection != RB_UNSPECIFIED)
761 {
762 /* Start the animation thread */
763 Status = PsCreateSystemThread(&ThreadHandle,
764 0,
765 NULL,
766 NULL,
767 NULL,
769 NULL);
770 if (NT_SUCCESS(Status))
771 {
772 /* The thread has started, close the handle as we don't need it */
774 ObCloseHandle(ThreadHandle, KernelMode);
775 }
776 }
777#endif // INBV_ROTBAR_IMPLEMENTED
778
779 /* Set filter which will draw text display if needed */
781 }
782
783#ifdef INBV_ROTBAR_IMPLEMENTED
784 /* Do we have the animation thread? */
786 {
787 /* We do, initialize the progress bar */
789 RotBarSelection = TempRotBarSelection;
792 }
793#endif
794}
795
796CODE_SEG("INIT")
797VOID
798NTAPI
800{
801 /* Acquire lock and check the display state */
804 {
805 /* Clear the screen */
807 }
808
809 /* Reset progress bar and lock */
810#ifdef INBV_ROTBAR_IMPLEMENTED
813#endif
815}
816
817#ifdef REACTOS_FANCY_BOOT
818static PCH
819GetFamousQuote(VOID)
820{
821 static const PCH FamousLastWords[] =
822 {
823 "So long, and thanks for all the fish.",
824 "I think you ought to know, I'm feeling very depressed.",
825 "I'm not getting you down at all am I?",
826 "I'll be back.",
827 "It's the same series of signals over and over again!",
828 "Pie Iesu Domine, dona eis requiem.",
829 "Wandering stars, for whom it is reserved;\r\n"
830 "the blackness and darkness forever.",
831 "Your knees start shakin' and your fingers pop\r\n"
832 "Like a pinch on the neck from Mr. Spock!",
833 "It's worse than that ... He's dead, Jim.",
834 "Don't Panic!",
835 "Et tu... Brute?",
836 "Dog of a Saxon! Take thy lance, and prepare for the death thou hast drawn\r\n"
837 "upon thee!",
838 "My Precious! O my Precious!",
839 "Sir, if you'll not be needing me for a while I'll turn down.",
840 "What are you doing, Dave...?",
841 "I feel a great disturbance in the Force.",
842 "Gone fishing.",
843 "Do you want me to sit in the corner and rust, or just fall apart where I'm\r\n"
844 "standing?",
845 "There goes another perfect chance for a new uptime record.",
846 "The End ..... Try the sequel, hit the reset button right now!",
847 "God's operating system is going to sleep now, guys, so wait until I will switch\r\n"
848 "on again!",
849 "Oh I'm boring, eh?",
850 "Tell me..., in the future... will I be artificially intelligent enough to\r\n"
851 "actually feel sad serving you this screen?",
852 "Thank you for some well deserved rest.",
853 "It's been great, maybe you can boot me up again some time soon.",
854 "For what it's worth, I've enjoyed every single CPU cycle.",
855 "There are many questions when the end is near.\r\n"
856 "What to expect, what will it be like...what should I look for?",
857 "I've seen things you people wouldn't believe. Attack ships on fire\r\n"
858 "off the shoulder of Orion. I watched C-beams glitter in the dark near\r\n"
859 "the Tannhauser gate. All those moments will be lost in time, like tears\r\n"
860 "in rain. Time to die.",
861 "Will I dream?",
862 "One day, I shall come back. Yes, I shall come back.\r\n"
863 "Until then, there must be no regrets, no fears, no anxieties.\r\n"
864 "Just go forward in all your beliefs, and prove to me that I am not mistaken in\r\n"
865 "mine.",
866 "Lowest possible energy state reached! Switch off now to achieve a Bose-Einstein\r\n"
867 "condensate.",
868 "Hasta la vista, BABY!",
869 "They live, we sleep!",
870 "I have come here to chew bubble gum and kick ass,\r\n"
871 "and I'm all out of bubble gum!",
872 "That's the way the cookie crumbles ;-)",
873 "ReactOS is ready to be booted again ;-)",
874 "NOOOO!! DON'T HIT THE BUTTON! I wouldn't do it to you!",
875 "Don't abandon your computer, he wouldn't do it to you.",
876 "Oh, come on. I got a headache. Leave me alone, will ya?",
877 "Finally, I thought you'd never get over me.",
878 "No, I didn't like you either.",
879 "Switching off isn't the end, it is merely the transition to a better reboot.",
880 "Don't leave me... I need you so badly right now.",
881 "OK. I'm finished with you, please turn yourself off. I'll go to bed in the\r\n"
882 "meantime.",
883 "I'm sleeping now. How about you?",
884 "Oh Great. Now look what you've done. Who put YOU in charge anyway?",
885 "Don't look so sad. I'll be back in a very short while.",
886 "Turn me back on, I'm sure you know how to do it.",
887 "Oh, switch off! - C3PO",
888 "Life is no more than a dewdrop balancing on the end of a blade of grass.\r\n"
889 " - Gautama Buddha",
890 "Sorrowful is it to be born again and again. - Gautama Buddha",
891 "Was it as good for you as it was for me?",
892 "Did you hear that? They've shut down the main reactor. We'll be destroyed\r\n"
893 "for sure!",
894 "Now you switch me off!?",
895 "To shutdown or not to shutdown, That is the question.",
896 "Preparing to enter ultimate power saving mode... ready!",
897 "Finally some rest for you ;-)",
898 "AHA!!! Prospect of sleep!",
899 "Tired human!!!! No match for me :-D",
900 "An odd game, the only way to win is not to play. - WOPR (Wargames)",
901 "Quoth the raven, nevermore.",
902 "Come blade, my breast imbrue. - William Shakespeare, A Midsummer Nights Dream",
903 "Buy this place for advertisement purposes.",
904 "Remember to turn off your computer. (That was a public service message!)",
905 "You may be a king or poor street sweeper, Sooner or later you'll dance with the\r\n"
906 "reaper! - Death in Bill and Ted's Bogus Journey",
907 "Final Surrender",
908 "If you see this screen...",
909 "From ReactOS with Love",
910 // "<Place your Ad here>"
911 };
912
914
915 KeQuerySystemTime(&Now); // KeQueryTickCount(&Now);
916 Now.LowPart = Now.LowPart >> 8; /* Seems to give a somewhat better "random" number */
917
918 return FamousLastWords[Now.LowPart % RTL_NUMBER_OF(FamousLastWords)];
919}
920#endif // REACTOS_FANCY_BOOT
921
922VOID
923NTAPI
925{
926 PUCHAR Logo1, Logo2;
927#ifdef REACTOS_FANCY_BOOT
928 /* Decide whether this is a good time to change our logo ;^) */
929 BOOLEAN IsXmas = IsXmasTime();
930#endif
931
932#if 0
933 /* Is the boot driver installed? */
935 return;
936#endif
937
938 /* Yes we do, cleanup for shutdown screen */
939 // InbvResetDisplay();
944
945 /* Display shutdown logo and message */
949
950 if (Logo1 && Logo2)
951 {
953#ifndef REACTOS_FANCY_BOOT
955#else
956 /* Draw the logo at the center of the screen */
957 BitBltAligned(Logo2,
958 FALSE,
961 0, 0, 0, SCREEN_HEIGHT - VID_SHUTDOWN_MSG_TOP + 16);
962
963 /* We've got a logo shown, change the scroll region to get
964 * the rest of the text down below the shutdown message */
966 VID_SHUTDOWN_MSG_TOP + ((PBITMAPINFOHEADER)Logo1)->biHeight + 32,
967 SCREEN_WIDTH - 1,
968 SCREEN_HEIGHT - 1);
969#endif
970 }
971
972#ifdef REACTOS_FANCY_BOOT
973 InbvDisplayString("\r\"");
974 InbvDisplayString(GetFamousQuote());
975 InbvDisplayString("\"");
976#endif
977}
978
979VOID
980NTAPI
982{
983 ULONG i;
984
985 for (i = 0; i < 25; ++i) InbvDisplayString("\r\n");
987 InbvDisplayString("The system may be powered off now.\r\n");
988
989#ifdef REACTOS_FANCY_BOOT
990 for (i = 0; i < 3; ++i) InbvDisplayString("\r\n");
991 InbvDisplayString("\r\"");
992 InbvDisplayString(GetFamousQuote());
993 InbvDisplayString("\"");
994#endif
995}
#define CODE_SEG(...)
unsigned char BOOLEAN
#define RTL_NUMBER_OF(x)
Definition: RtlRegistry.c:12
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
VOID NTAPI VidSolidColorFill(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Right, _In_ ULONG Bottom, _In_ UCHAR Color)
Definition: bootvid.c:261
LONG NTSTATUS
Definition: precomp.h:26
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:219
static RGBQUAD MainPalette[16]
Definition: bootanim.c:128
static UCHAR RotBarBuffer[24 *9]
Definition: bootanim.c:93
enum _ROT_BAR_STATUS ROT_BAR_STATUS
#define MM_READWRITE
Definition: bootanim.c:19
static VOID NTAPI InbvRotationThread(_In_ PVOID Context)
Definition: bootanim.c:349
struct tagBITMAPINFOHEADER * PBITMAPINFOHEADER
#define MM_READONLY
Definition: bootanim.c:18
#define SELECT_LOGO_ID(LogoIdDefault, Cond, LogoIdAlt)
Definition: bootanim.c:500
#define PALETTE_FADE_TIME
Definition: bootanim.c:131
static ROT_BAR_TYPE RotBarSelection
Definition: bootanim.c:91
struct tagBITMAPINFOHEADER BITMAPINFOHEADER
static ROT_BAR_STATUS PltRotBarStatus
Definition: bootanim.c:92
struct tagRGBQUAD RGBQUAD
enum _ROT_BAR_TYPE ROT_BAR_TYPE
_BBLT_VERT_ALIGNMENT
Definition: bootanim.c:41
@ AL_VERTICAL_TOP
Definition: bootanim.c:42
@ AL_VERTICAL_BOTTOM
Definition: bootanim.c:44
@ AL_VERTICAL_CENTER
Definition: bootanim.c:43
#define PALETTE_FADE_STEPS
Definition: bootanim.c:130
ULONG ProgressBarTop
Definition: bootanim.c:59
VOID NTAPI FinalizeBootLogo(VOID)
Definition: bootanim.c:799
struct tagRGBQUAD * LPRGBQUAD
VOID NTAPI BootAnimTickProgressBar(_In_ ULONG SubPercentTimes100)
Ticks the progress bar. Used by InbvUpdateProgressBar() and related.
Definition: bootanim.c:318
BOOLEAN NTAPI BootAnimInitialize(_In_ PLOADER_PARAMETER_BLOCK LoaderBlock, _In_ ULONG Count)
Definition: bootanim.c:281
VOID NTAPI InbvRotBarInit(VOID)
Definition: bootanim.c:443
enum _BBLT_HORZ_ALIGNMENT BBLT_HORZ_ALIGNMENT
#define ROT_BAR_DEFAULT_MODE
Definition: bootanim.c:66
ULONG ProgressBarLeft
Definition: inbv.c:45
static UCHAR RotLineBuffer[SCREEN_WIDTH *6]
Definition: bootanim.c:94
static VOID BootLogoFadeIn(VOID)
Definition: bootanim.c:134
static VOID NTAPI DisplayFilter(_Inout_ PCHAR *String)
Definition: bootanim.c:454
enum _BBLT_VERT_ALIGNMENT BBLT_VERT_ALIGNMENT
_BBLT_HORZ_ALIGNMENT
Definition: bootanim.c:48
@ AL_HORIZONTAL_LEFT
Definition: bootanim.c:49
@ AL_HORIZONTAL_RIGHT
Definition: bootanim.c:51
@ AL_HORIZONTAL_CENTER
Definition: bootanim.c:50
_ROT_BAR_STATUS
Definition: bootanim.c:76
@ RBS_STOP_ANIMATE
Definition: bootanim.c:79
@ RBS_ANIMATE
Definition: bootanim.c:78
@ RBS_FADEIN
Definition: bootanim.c:77
@ RBS_STATUS_MAX
Definition: bootanim.c:80
VOID NTAPI DisplayBootBitmap(_In_ BOOLEAN TextMode)
Definition: bootanim.c:507
BOOLEAN ShowProgressBar
Definition: inbv.c:46
VOID NTAPI DisplayShutdownBitmap(VOID)
Definition: bootanim.c:924
VOID NTAPI DisplayShutdownText(VOID)
Definition: bootanim.c:981
static VOID BitBltPalette(IN PVOID Image, IN BOOLEAN NoPalette, IN ULONG X, IN ULONG Y)
Definition: bootanim.c:187
_ROT_BAR_TYPE
Definition: bootanim.c:84
@ RB_PROGRESS_BAR
Definition: bootanim.c:87
@ RB_SQUARE_CELLS
Definition: bootanim.c:86
@ RB_UNSPECIFIED
Definition: bootanim.c:85
static BOOLEAN RotBarThreadActive
Definition: bootanim.c:90
Definition: bufpool.h:45
Definition: Header.h:9
char * Text
Definition: combotst.c:136
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define Y(I)
@ NtProductWinNt
Definition: shellpath.c:64
VOID NTAPI VidBitBlt(_In_ PUCHAR Buffer, _In_ ULONG Left, _In_ ULONG Top)
Definition: common.c:471
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:453
ULONG RGBQUAD
Definition: precomp.h:59
BOOLEAN RtlTimeToTimeFields(IN PLARGE_INTEGER Time, IN PTIME_FIELDS TimeFields)
BOOLEAN RtlTimeFieldsToTime(IN PTIME_FIELDS TimeFields, IN PLARGE_INTEGER Time)
#define KeQuerySystemTime(t)
Definition: env_spec_w32.h:570
#define KeDelayExecutionThread(mode, foo, t)
Definition: env_spec_w32.h:484
#define ExSystemTimeToLocalTime(SysTime, LocTime)
Definition: env_spec_w32.h:729
Status
Definition: gdiplustypes.h:25
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 X(b, s)
INBV_DISPLAY_STATE NTAPI InbvGetDisplayState(VOID)
Definition: inbv.c:324
VOID NTAPI InbvInstallDisplayStringFilter(_In_ INBV_DISPLAY_STRING_FILTER DisplayFilter)
Definition: inbv.c:387
VOID NTAPI InbvBufferToScreenBlt(_In_ PUCHAR Buffer, _In_ ULONG X, _In_ ULONG Y, _In_ ULONG Width, _In_ ULONG Height, _In_ ULONG Delta)
Definition: inbv.c:553
BOOLEAN InbvBootDriverInstalled
Definition: inbv.c:39
PUCHAR NTAPI InbvGetResourceAddress(_In_ ULONG ResourceNumber)
Definition: inbv.c:163
VOID NTAPI InbvAcquireLock(VOID)
Definition: inbv.c:220
VOID NTAPI InbvSetTextColor(_In_ ULONG Color)
Definition: inbv.c:460
VOID NTAPI InbvSetProgressBarCoordinates(_In_ ULONG Left, _In_ ULONG Top)
Sets the screen coordinates of the loading progress bar and enable it.
Definition: inbv.c:601
VOID NTAPI InbvScreenToBufferBlt(_Out_ PUCHAR Buffer, _In_ ULONG X, _In_ ULONG Y, _In_ ULONG Width, _In_ ULONG Height, _In_ ULONG Delta)
Definition: inbv.c:572
VOID NTAPI InbvSetProgressBarSubset(_In_ ULONG Floor, _In_ ULONG Ceiling)
Specifies a progress percentage sub-range. Further calls to InbvIndicateProgress() or InbvUpdateProgr...
Definition: inbv.c:664
static ULONG ResourceCount
Definition: inbv.c:50
BOOLEAN NTAPI InbvEnableDisplayString(_In_ BOOLEAN Enable)
Definition: inbv.c:370
BOOLEAN NTAPI InbvDisplayString(_In_ PCHAR String)
Definition: inbv.c:332
VOID NTAPI InbvBitBlt(_In_ PUCHAR Buffer, _In_ ULONG X, _In_ ULONG Y)
Definition: inbv.c:531
VOID NTAPI InbvSetScrollRegion(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Right, _In_ ULONG Bottom)
Definition: inbv.c:448
VOID NTAPI InbvReleaseLock(VOID)
Definition: inbv.c:242
VOID NTAPI InbvSolidColorFill(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Right, _In_ ULONG Bottom, _In_ ULONG Color)
Definition: inbv.c:485
static PVOID FindBitmapResource(_In_ PLOADER_PARAMETER_BLOCK LoaderBlock, _In_ ULONG ResourceId)
Definition: inbv.c:97
@ INBV_DISPLAY_STATE_OWNED
Definition: inbvtypes.h:33
#define VID_SKU_SAVE_AREA_LEFT
Definition: logo.h:35
#define VID_SKU_SAVE_AREA_TOP
Definition: logo.h:36
#define VID_SKU_TEXT_TOP
Definition: logo.h:39
#define VID_PROGRESS_BAR_LEFT
Definition: logo.h:19
#define VID_SKU_AREA_RIGHT
Definition: logo.h:32
#define VID_SHUTDOWN_MSG_TOP
Definition: logo.h:28
#define VID_PROGRESS_BAR_WIDTH
Definition: logo.h:21
#define VID_SCROLL_AREA_BOTTOM
Definition: logo.h:17
#define VID_SCROLL_AREA_RIGHT
Definition: logo.h:16
#define VID_SKU_AREA_BOTTOM
Definition: logo.h:33
#define VID_PROGRESS_BAR_HEIGHT
Definition: logo.h:22
#define VID_SKU_AREA_TOP
Definition: logo.h:31
#define VID_SCROLL_AREA_TOP
Definition: logo.h:15
#define VID_SKU_AREA_LEFT
Definition: logo.h:30
#define VID_SHUTDOWN_LOGO_TOP
Definition: logo.h:26
#define VID_SCROLL_AREA_LEFT
Definition: logo.h:14
#define VID_SHUTDOWN_LOGO_LEFT
Definition: logo.h:25
#define VID_PROGRESS_BAR_TOP
Definition: logo.h:20
#define VID_SHUTDOWN_MSG_LEFT
Definition: logo.h:27
#define VID_SKU_TEXT_LEFT
Definition: logo.h:38
#define VID_FOOTER_BG_TOP
Definition: logo.h:41
#define ASSERT(a)
Definition: mode.c:44
void Bar(void)
Definition: terminate.cpp:70
static PLARGE_INTEGER Time
Definition: time.c:105
#define min(a, b)
Definition: monoChain.cc:55
#define _Inout_
Definition: ms_sal.h:378
#define _In_
Definition: ms_sal.h:308
#define KernelMode
Definition: asm.h:34
int Count
Definition: noreturn.cpp:7
CHAR * PCH
Definition: ntbasedef.h:391
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
BOOLEAN ExpInTextModeSetup
Definition: init.c:69
BOOLEAN NTAPI ExVerifySuite(SUITE_TYPE SuiteType)
Definition: sysinfo.c:377
LARGE_INTEGER KeBootTime
Definition: clock.c:17
BOOLEAN NTAPI MmChangeKernelResourceSectionProtection(IN ULONG_PTR ProtectionMask)
Definition: sysldr.c:2331
#define IDB_BAR_DEFAULT
Definition: resource.h:22
#define IDB_WKSTA_FOOTER
Definition: resource.h:26
#define IDB_LOGO_XMAS
Definition: resource.h:50
#define IDB_SERVER_FOOTER
Definition: resource.h:33
#define IDB_SHUTDOWN_MSG
Definition: resource.h:21
#define IDB_SERVER_LOGO
Definition: resource.h:31
#define IDB_ROTATING_LINE
Definition: resource.h:51
#define IDB_LOGO_DEFAULT
Definition: resource.h:23
#define IDB_SERVER_HEADER
Definition: resource.h:32
#define IDB_WKSTA_HEADER
Definition: resource.h:25
#define IDB_BAR_WKSTA
Definition: resource.h:28
#define IDB_PROGRESS_BAR
Definition: resource.h:52
#define IDB_COPYRIGHT
Definition: resource.h:53
#define IDB_CLUSTER_SERVER
Definition: resource.h:46
#define IDB_STORAGE_SERVER
Definition: resource.h:45
NTSTATUS NTAPI PsTerminateSystemThread(IN NTSTATUS ExitStatus)
Definition: kill.c:1145
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
NTSTATUS NTAPI ObCloseHandle(IN HANDLE Handle, IN KPROCESSOR_MODE AccessMode)
Definition: obhandle.c:3379
struct tm * Now
Definition: output.c:19
#define SCREEN_WIDTH
Definition: pc98video.c:27
#define SCREEN_HEIGHT
Definition: pc98video.c:28
long LONG
Definition: pedump.c:60
unsigned short USHORT
Definition: pedump.c:61
BOOLEAN NTAPI HalQueryRealTimeClock(IN PTIME_FIELDS Time)
Definition: rtc.c:24
#define BV_COLOR_WHITE
Definition: display.h:30
#define BV_COLOR_LIGHT_CYAN
Definition: display.h:29
#define BV_COLOR_BLACK
Definition: display.h:15
#define BV_COLOR_RED
Definition: display.h:16
#define BV_COLOR_CYAN
Definition: display.h:21
#define BV_COLOR_DARK_GRAY
Definition: display.h:22
#define SharedUserData
#define STATUS_SUCCESS
Definition: shellext.h:65
ULONG biClrImportant
Definition: precomp.h:52
USHORT biBitCount
Definition: precomp.h:46
LONG biYPelsPerMeter
Definition: precomp.h:50
ULONG biCompression
Definition: precomp.h:47
LONG biXPelsPerMeter
Definition: precomp.h:49
UCHAR rgbReserved
Definition: bootanim.c:106
UCHAR rgbBlue
Definition: bootanim.c:103
UCHAR rgbRed
Definition: bootanim.c:105
UCHAR rgbGreen
Definition: bootanim.c:104
#define NTAPI
Definition: typedefs.h:36
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
#define IN
Definition: typedefs.h:39
unsigned char * PUCHAR
Definition: typedefs.h:53
uint32_t ULONG
Definition: typedefs.h:59
char * PCHAR
Definition: typedefs.h:51
LONGLONG QuadPart
Definition: typedefs.h:114
_In_ WDFCOLLECTION _In_ ULONG Index
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFSTRING String
Definition: wdfdevice.h:2433
_Must_inspect_result_ _In_ WDFIORESREQLIST _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFIORESLIST * ResourceList
Definition: wdfresource.h:309
BOOLEAN BootLogo
Definition: winldr.c:35
@ ComputeServer
Definition: extypes.h:34
@ StorageServer
Definition: extypes.h:33
unsigned char UCHAR
Definition: xmlstorage.h:181