- Check for command line validity in some places.
- Correctly set the number of bitmap resources. Spotted by Thomas. CORE-6781

svn path=/trunk/; revision=66475
This commit is contained in:
Hermès Bélusca-Maïto 2015-02-27 01:39:49 +00:00
parent 74900e380b
commit 2fe77c41bd
2 changed files with 12 additions and 12 deletions

View file

@ -1377,13 +1377,13 @@ Phase1InitializationDiscard(IN PVOID Context)
if (!HalInitSystem(1, LoaderBlock)) KeBugCheck(HAL1_INITIALIZATION_FAILED); if (!HalInitSystem(1, LoaderBlock)) KeBugCheck(HAL1_INITIALIZATION_FAILED);
/* Get the command line and upcase it */ /* Get the command line and upcase it */
CommandLine = _strupr(LoaderBlock->LoadOptions); CommandLine = (LoaderBlock->LoadOptions ? _strupr(LoaderBlock->LoadOptions) : NULL);
/* Check if GUI Boot is enabled */ /* Check if GUI Boot is enabled */
NoGuiBoot = (strstr(CommandLine, "NOGUIBOOT")) ? TRUE: FALSE; NoGuiBoot = (CommandLine && strstr(CommandLine, "NOGUIBOOT") != NULL);
/* Get the SOS setting */ /* Get the SOS setting */
SosEnabled = strstr(CommandLine, "SOS") ? TRUE: FALSE; SosEnabled = (CommandLine && strstr(CommandLine, "SOS") != NULL);
/* Setup the boot driver */ /* Setup the boot driver */
InbvEnableBootDriver(!NoGuiBoot); InbvEnableBootDriver(!NoGuiBoot);
@ -1406,11 +1406,11 @@ Phase1InitializationDiscard(IN PVOID Context)
} }
/* Check if this is LiveCD (WinPE) mode */ /* Check if this is LiveCD (WinPE) mode */
if (strstr(CommandLine, "MININT")) if (CommandLine && strstr(CommandLine, "MININT") != NULL)
{ {
/* Setup WinPE Settings */ /* Setup WinPE Settings */
InitIsWinPEMode = TRUE; InitIsWinPEMode = TRUE;
InitWinPEModeType |= (strstr(CommandLine, "INRAM")) ? 0x80000000 : 1; InitWinPEModeType |= (strstr(CommandLine, "INRAM") != NULL) ? 0x80000000 : 0x00000001;
} }
/* Get the kernel's load entry */ /* Get the kernel's load entry */

View file

@ -40,8 +40,8 @@ static BOOLEAN ShowProgressBar = FALSE;
static INBV_PROGRESS_STATE InbvProgressState; static INBV_PROGRESS_STATE InbvProgressState;
static BT_PROGRESS_INDICATOR InbvProgressIndicator = {0, 25, 0}; static BT_PROGRESS_INDICATOR InbvProgressIndicator = {0, 25, 0};
static INBV_RESET_DISPLAY_PARAMETERS InbvResetDisplayParameters; static INBV_RESET_DISPLAY_PARAMETERS InbvResetDisplayParameters;
static ULONG ResourceCount; static ULONG ResourceCount = 0;
static PUCHAR ResourceList[IDB_CLUSTER_SERVER + 1]; // The first entry in the table is the NULL pointer static PUCHAR ResourceList[1 + IDB_CLUSTER_SERVER]; // First entry == NULL, followed by 'ResourceCount' entries.
#ifdef INBV_ROTBAR_IMPLEMENTED #ifdef INBV_ROTBAR_IMPLEMENTED
static BOOLEAN RotBarThreadActive = FALSE; static BOOLEAN RotBarThreadActive = FALSE;
@ -174,14 +174,14 @@ BootLogoFadeIn(VOID)
VidBitBlt(PaletteBitmapBuffer, 0, 0); VidBitBlt(PaletteBitmapBuffer, 0, 0);
/* Wait for a bit. */ /* Wait for a bit */
KeStallExecutionProcessor(PALETTE_FADE_TIME); KeStallExecutionProcessor(PALETTE_FADE_TIME);
} }
/* Release the lock */ /* Release the lock */
InbvReleaseLock(); InbvReleaseLock();
/* Wait for a bit. */ /* Wait for a bit */
KeStallExecutionProcessor(PALETTE_FADE_TIME); KeStallExecutionProcessor(PALETTE_FADE_TIME);
} }
} }
@ -271,8 +271,8 @@ InbvDriverInitialize(IN PLOADER_PARAMETER_BLOCK LoaderBlock,
if (InbvDisplayState == INBV_DISPLAY_STATE_OWNED) if (InbvDisplayState == INBV_DISPLAY_STATE_OWNED)
{ {
/* Check if we have a custom boot logo */ /* Check if we have a custom boot logo */
CommandLine = _strupr(LoaderBlock->LoadOptions); CommandLine = (LoaderBlock->LoadOptions ? _strupr(LoaderBlock->LoadOptions) : NULL);
CustomLogo = strstr(CommandLine, "BOOTLOGO") ? TRUE: FALSE; CustomLogo = (CommandLine && strstr(CommandLine, "BOOTLOGO") != NULL);
} }
/* Initialize the video */ /* Initialize the video */
@ -283,7 +283,7 @@ InbvDriverInitialize(IN PLOADER_PARAMETER_BLOCK LoaderBlock,
VidResetDisplay(CustomLogo); VidResetDisplay(CustomLogo);
/* Find bitmap resources in the kernel */ /* Find bitmap resources in the kernel */
ResourceCount = min(Count, RTL_NUMBER_OF(ResourceList)); ResourceCount = min(Count, RTL_NUMBER_OF(ResourceList) - 1);
for (i = 1; i <= ResourceCount; i++) for (i = 1; i <= ResourceCount; i++)
{ {
/* Do the lookup */ /* Do the lookup */