From b0571d1c2ef8bbc44a2a80878e08c258ceb7e662 Mon Sep 17 00:00:00 2001 From: Rafal Harabien Date: Wed, 15 Jun 2011 12:53:32 +0000 Subject: [PATCH] [NTOSKRNL] - Disable displaying string by bootvid after successful kernel phase 1 initialization, so there won't be graphical glitches at the top of screen if system has screen debugging enabled - Make screen black right after phase 1 initialization finish instead of waiting 5 seconds. It removes black rectangle which appeared for me in explorer. - Initialize some global variables in inbv.c (it was done by compiler before) svn path=/trunk/; revision=52244 --- reactos/ntoskrnl/ex/init.c | 15 +++++----- reactos/ntoskrnl/inbv/inbv.c | 8 ++--- reactos/ntoskrnl/io/iomgr/iomgr.c | 50 ++++++++++++++++++++++++++----- 3 files changed, 54 insertions(+), 19 deletions(-) diff --git a/reactos/ntoskrnl/ex/init.c b/reactos/ntoskrnl/ex/init.c index d197e9d6283..032623d7ed0 100644 --- a/reactos/ntoskrnl/ex/init.c +++ b/reactos/ntoskrnl/ex/init.c @@ -1313,7 +1313,7 @@ Phase1InitializationDiscard(IN PVOID Context) size_t Remaining; PRTL_USER_PROCESS_INFORMATION ProcessInfo; KEY_VALUE_PARTIAL_INFORMATION KeyPartialInfo; - UNICODE_STRING KeyName, DebugString; + UNICODE_STRING KeyName; OBJECT_ATTRIBUTES ObjectAttributes; HANDLE KeyHandle, OptionHandle; PRTL_USER_PROCESS_PARAMETERS ProcessParameters = NULL; @@ -1925,18 +1925,19 @@ Phase1InitializationDiscard(IN PVOID Context) /* Update progress bar */ InbvUpdateProgressBar(100); - /* Allow strings to be displayed */ - InbvEnableDisplayString(TRUE); + /* Disallow strings to be displayed */ + InbvEnableDisplayString(FALSE); - /* Wait 5 seconds for it to initialize */ + /* Clean the screen */ + if (InbvBootDriverInstalled) FinalizeBootLogo(); + + /* Wait 5 seconds for initial process to initialize */ Timeout.QuadPart = Int32x32To64(5, -10000000); Status = ZwWaitForSingleObject(ProcessInfo->ProcessHandle, FALSE, &Timeout); - if (InbvBootDriverInstalled) FinalizeBootLogo(); if (Status == STATUS_SUCCESS) { /* Failed, display error */ - RtlInitUnicodeString(&DebugString, L"INIT: Session Manager terminated."); - ZwDisplayString(&DebugString); + DPRINT1("INIT: Session Manager terminated.\n"); /* Bugcheck the system if SMSS couldn't initialize */ KeBugCheck(SESSION5_INITIALIZATION_FAILED); diff --git a/reactos/ntoskrnl/inbv/inbv.c b/reactos/ntoskrnl/inbv/inbv.c index 98aff194e3f..cde6b2a829d 100644 --- a/reactos/ntoskrnl/inbv/inbv.c +++ b/reactos/ntoskrnl/inbv/inbv.c @@ -10,16 +10,16 @@ KSPIN_LOCK BootDriverLock; KIRQL InbvOldIrql; INBV_DISPLAY_STATE InbvDisplayState; -BOOLEAN InbvBootDriverInstalled; -BOOLEAN InbvDisplayDebugStrings; +BOOLEAN InbvBootDriverInstalled = FALSE; +BOOLEAN InbvDisplayDebugStrings = FALSE; INBV_DISPLAY_STRING_FILTER InbvDisplayFilter; ULONG ProgressBarLeft, ProgressBarTop; -BOOLEAN ShowProgressBar; +BOOLEAN ShowProgressBar = FALSE; INBV_PROGRESS_STATE InbvProgressState; INBV_RESET_DISPLAY_PARAMETERS InbvResetDisplayParameters; ULONG ResourceCount; PUCHAR ResourceList[64]; -BOOLEAN SysThreadCreated; +BOOLEAN SysThreadCreated = FALSE; ROT_BAR_TYPE RotBarSelection; ULONG PltRotBarStatus; BT_PROGRESS_INDICATOR InbvProgressIndicator = {0, 25, 0}; diff --git a/reactos/ntoskrnl/io/iomgr/iomgr.c b/reactos/ntoskrnl/io/iomgr/iomgr.c index 65acfdf1ccb..c390029ebe7 100644 --- a/reactos/ntoskrnl/io/iomgr/iomgr.c +++ b/reactos/ntoskrnl/io/iomgr/iomgr.c @@ -480,10 +480,18 @@ IoInitSystem(IN PLOADER_PARAMETER_BLOCK LoaderBlock) KeSetTimerEx(&IopTimer, ExpireTime, 1000, &IopTimerDpc); /* Create Object Types */ - if (!IopCreateObjectTypes()) return FALSE; + if (!IopCreateObjectTypes()) + { + DPRINT1("IopCreateObjectTypes failed!\n"); + return FALSE; + } /* Create Object Directories */ - if (!IopCreateRootDirectories()) return FALSE; + if (!IopCreateRootDirectories()) + { + DPRINT1("IopCreateRootDirectories failed!\n"); + return FALSE; + } /* Initialize PnP manager */ IopInitializePlugPlayServices(); @@ -511,10 +519,19 @@ IoInitSystem(IN PLOADER_PARAMETER_BLOCK LoaderBlock) IopLoaderBlock = NULL; /* Create ARC names for boot devices */ - if (!NT_SUCCESS(IopCreateArcNames(LoaderBlock))) return FALSE; + Status = IopCreateArcNames(LoaderBlock); + if (!NT_SUCCESS(Status)) + { + DPRINT1("IopCreateArcNames failed: %lx\n", Status); + return FALSE; + } /* Mark the system boot partition */ - if (!IopMarkBootPartition(LoaderBlock)) return FALSE; + if (!IopMarkBootPartition(LoaderBlock)) + { + DPRINT1("IopMarkBootPartition failed!\n"); + return FALSE; + } /* Initialize PnP root relations */ IopEnumerateDevice(IopRootDeviceNode->PhysicalDeviceObject); @@ -539,7 +556,11 @@ IoInitSystem(IN PLOADER_PARAMETER_BLOCK LoaderBlock) /* Convert SystemRoot from ARC to NT path */ Status = IopReassignSystemRoot(LoaderBlock, &NtBootPath); - if (!NT_SUCCESS(Status)) return FALSE; + if (!NT_SUCCESS(Status)) + { + DPRINT1("IopReassignSystemRoot failed: %lx\n", Status); + return FALSE; + } /* Set the ANSI_STRING for the root path */ RootString.MaximumLength = NtSystemRoot.MaximumLength / sizeof(WCHAR); @@ -550,7 +571,11 @@ IoInitSystem(IN PLOADER_PARAMETER_BLOCK LoaderBlock) /* Convert the path into the ANSI_STRING */ Status = RtlUnicodeStringToAnsiString(&RootString, &NtSystemRoot, FALSE); - if (!NT_SUCCESS(Status)) return FALSE; + if (!NT_SUCCESS(Status)) + { + DPRINT1("RtlUnicodeStringToAnsiString failed: %lx\n", Status); + return FALSE; + } /* Assign drive letters */ IoAssignDriveLetters(LoaderBlock, @@ -560,10 +585,19 @@ IoInitSystem(IN PLOADER_PARAMETER_BLOCK LoaderBlock) /* Update system root */ Status = RtlAnsiStringToUnicodeString(&NtSystemRoot, &RootString, FALSE); - if (!NT_SUCCESS(Status)) return FALSE; + if (!NT_SUCCESS(Status)) + { + DPRINT1("RtlAnsiStringToUnicodeString failed: %lx\n", Status); + return FALSE; + } /* Load the System DLL and its Entrypoints */ - if (!NT_SUCCESS(PsLocateSystemDll())) return FALSE; + Status = PsLocateSystemDll(); + if (!NT_SUCCESS(Status)) + { + DPRINT1("PsLocateSystemDll failed: %lx\n", Status); + return FALSE; + } /* Return success */ return TRUE;