From d5e9cb0dd8d51b06cf05742109b237846675d041 Mon Sep 17 00:00:00 2001 From: Rafal Harabien Date: Tue, 21 Jun 2011 15:53:02 +0000 Subject: [PATCH] [NTOSKRNL] - Display boot blue bitmap when native application or kernel calls NtDisplayString with string displaying enabled - Fix drawing order in Phase1InitializationDiscard svn path=/trunk/; revision=52404 --- reactos/ntoskrnl/ex/init.c | 23 ++++++++++------------- reactos/ntoskrnl/inbv/inbv.c | 21 ++++++++++++++++++--- reactos/ntoskrnl/include/internal/inbv.h | 8 +++++++- 3 files changed, 35 insertions(+), 17 deletions(-) diff --git a/reactos/ntoskrnl/ex/init.c b/reactos/ntoskrnl/ex/init.c index 06f32396173..ab2283d58aa 100644 --- a/reactos/ntoskrnl/ex/init.c +++ b/reactos/ntoskrnl/ex/init.c @@ -1904,33 +1904,30 @@ Phase1InitializationDiscard(IN PVOID Context) /* Initialize Power Subsystem in Phase 1*/ if (!PoInitSystem(1)) KeBugCheck(INTERNAL_POWER_ERROR); + /* Update progress bar */ + InbvUpdateProgressBar(90); + /* Initialize the Process Manager at Phase 1 */ if (!PsInitSystem(LoaderBlock)) KeBugCheck(PROCESS1_INITIALIZATION_FAILED); - /* Update progress bar */ - InbvUpdateProgressBar(85); - /* Make sure nobody touches the loader block again */ if (LoaderBlock == KeLoaderBlock) KeLoaderBlock = NULL; LoaderBlock = Context = NULL; /* Update progress bar */ - InbvUpdateProgressBar(90); + InbvUpdateProgressBar(100); + + /* Clean the screen */ + if (InbvBootDriverInstalled) FinalizeBootLogo(); + + /* Allow strings to be displayed */ + InbvEnableDisplayString(TRUE); /* Launch initial process */ DPRINT1("Free non-cache pages: %lx\n", MmAvailablePages + MiMemoryConsumers[MC_CACHE].PagesUsed); ProcessInfo = &InitBuffer->ProcessInfo; ExpLoadInitialProcess(InitBuffer, &ProcessParameters, &Environment); - /* Clean the screen */ - if (InbvBootDriverInstalled) FinalizeBootLogo(); - - /* Update progress bar */ - InbvUpdateProgressBar(100); - - /* Allow strings to be displayed */ - InbvEnableDisplayString(TRUE); - /* Wait 5 seconds for initial process to initialize */ Timeout.QuadPart = Int32x32To64(5, -10000000); Status = ZwWaitForSingleObject(ProcessInfo->ProcessHandle, FALSE, &Timeout); diff --git a/reactos/ntoskrnl/inbv/inbv.c b/reactos/ntoskrnl/inbv/inbv.c index cde6b2a829d..e9de92a5876 100644 --- a/reactos/ntoskrnl/inbv/inbv.c +++ b/reactos/ntoskrnl/inbv/inbv.c @@ -576,7 +576,7 @@ NtDisplayString(IN PUNICODE_STRING DisplayString) VOID NTAPI INIT_FUNCTION -DisplayBootBitmap(IN BOOLEAN SosMode) +DisplayBootBitmap(IN BOOLEAN TextMode) { PVOID Header, Band, Text, Screen; ROT_BAR_TYPE TempRotBarSelection = RB_UNSPECIFIED; @@ -591,9 +591,9 @@ DisplayBootBitmap(IN BOOLEAN SosMode) InbvReleaseLock(); } - /* Check if this is SOS mode */ + /* Check if this is text mode */ ShowProgressBar = FALSE; - if (SosMode) + if (TextMode) { /* Check if this is a server OS */ if (SharedUserData->NtProductType == NtProductWinNt) @@ -696,6 +696,9 @@ DisplayBootBitmap(IN BOOLEAN SosMode) /* Draw the progress bar bit */ // if (Bar) InbvBitBlt(Bar, 0, 0); + + /* Set filter which will draw text display if needed */ + InbvInstallDisplayStringFilter(DisplayFilter); } /* Do we have a system thread? */ @@ -709,6 +712,18 @@ DisplayBootBitmap(IN BOOLEAN SosMode) } } +VOID +NTAPI +INIT_FUNCTION +DisplayFilter(PCHAR *String) +{ + /* Remove the filter */ + InbvInstallDisplayStringFilter(NULL); + + /* Draw text screen */ + DisplayBootBitmap(TRUE); +} + VOID NTAPI INIT_FUNCTION diff --git a/reactos/ntoskrnl/include/internal/inbv.h b/reactos/ntoskrnl/include/internal/inbv.h index 9d9e737e690..d8446aa2305 100644 --- a/reactos/ntoskrnl/include/internal/inbv.h +++ b/reactos/ntoskrnl/include/internal/inbv.h @@ -42,7 +42,13 @@ InbvEnableBootDriver( VOID NTAPI DisplayBootBitmap( - IN BOOLEAN SosMode + IN BOOLEAN TextMode +); + +VOID +NTAPI +DisplayFilter( + IN PCHAR *String ); VOID