Example #1
1
VOID
NTAPI
PopShutdownHandler(VOID)
{
    PUCHAR Logo1, Logo2;
    ULONG i;

    /* Stop all interrupts */
    KeRaiseIrqlToDpcLevel();
    _disable();

    /* Do we have boot video */
    if (InbvIsBootDriverInstalled())
    {
        /* Yes we do, cleanup for shutdown screen */
        if (!InbvCheckDisplayOwnership()) InbvAcquireDisplayOwnership();
        InbvResetDisplay();
        InbvSolidColorFill(0, 0, 639, 479, 0);
        InbvEnableDisplayString(TRUE);
        InbvSetScrollRegion(0, 0, 639, 479);

        /* Display shutdown logo and message */
        Logo1 = InbvGetResourceAddress(IDB_SHUTDOWN_MSG);
        Logo2 = InbvGetResourceAddress(IDB_DEFAULT_LOGO);
        if ((Logo1) && (Logo2))
        {
            InbvBitBlt(Logo1, 220, 352);
            InbvBitBlt(Logo2, 222, 111);
        }
    }
    else
    {
        /* Do it in text-mode */
        for (i = 0; i < 25; i++) InbvDisplayString("\r\n");
        InbvDisplayString("                       ");
        InbvDisplayString("The system may be powered off now.\r\n");
    }

    /* Hang the system */
    for (;;) HalHaltSystem();
}
Example #2
1
VOID
NTAPI
INIT_FUNCTION
DisplayBootBitmap(IN BOOLEAN TextMode)
{
    PBITMAPINFOHEADER BitmapInfoHeader;
    LPRGBQUAD Palette;

    PVOID Header, Band, Text, Screen;
    ROT_BAR_TYPE TempRotBarSelection = RB_UNSPECIFIED;

#ifdef CORE_6781_resolved
    UCHAR Buffer[64];
#endif

    /* Check if the system thread has already been created */
    if (SysThreadCreated)
    {
        /* Reset the progress bar */
        InbvAcquireLock();
        RotBarSelection = RB_UNSPECIFIED;
        InbvReleaseLock();
    }

    /* Check if this is text mode */
    ShowProgressBar = FALSE;
    if (TextMode)
    {
        /* Check if this is a server OS */
        if (SharedUserData->NtProductType == NtProductWinNt)
        {
            /* It's not, set workstation settings */
            InbvSetTextColor(15);
            InbvSolidColorFill(0, 0, 639, 479, 7);
            InbvSolidColorFill(0, 421, 639, 479, 1);

            /* Get resources */
            Header = InbvGetResourceAddress(IDB_LOGO_HEADER);
            Band = InbvGetResourceAddress(IDB_LOGO_BAND);
        }
        else
        {
            /* Set server settings */
            InbvSetTextColor(14);
            InbvSolidColorFill(0, 0, 639, 479, 6);
            InbvSolidColorFill(0, 421, 639, 479, 1);

            /* Get resources */
            Header = InbvGetResourceAddress(IDB_SERVER_HEADER);
            Band = InbvGetResourceAddress(IDB_SERVER_BAND);
        }

        /* Set the scrolling region */
        InbvSetScrollRegion(32, 80, 631, 400);

        /* Make sure we have resources */
        if ((Header) && (Band))
        {
            /* BitBlt them on the screen */
            InbvBitBlt(Band, 0, 419);
            InbvBitBlt(Header, 0, 0);
        }
    }
    else
    {
        /* Is the boot driver installed? */
        Text = NULL;
        if (!InbvBootDriverInstalled) return;

        /* Load the standard boot screen */
        Screen = InbvGetResourceAddress(IDB_BOOT_LOGO);
        if (SharedUserData->NtProductType == NtProductWinNt)
        {
            /* Workstation product, display appropriate status bar color */
            InbvGetResourceAddress(IDB_BAR_PRO);
        }
        else
        {
            /* Display correct branding based on server suite */
            if (ExVerifySuite(StorageServer))
            {
                /* Storage Server Edition */
                Text = InbvGetResourceAddress(IDB_STORAGE_SERVER);
            }
            else if (ExVerifySuite(ComputeServer))
            {
                /* Compute Cluster Edition */
                Text = InbvGetResourceAddress(IDB_CLUSTER_SERVER);
            }
            else
            {
                /* Normal edition */
                Text = InbvGetResourceAddress(IDB_SERVER_LOGO);
            }

            /* Server product, display appropriate status bar color */
            InbvGetResourceAddress(IDB_BAR_SERVER);
        }

        /* Make sure we had a logo */
        if (Screen)
        {
            /* Choose progress bar */
            TempRotBarSelection = RB_SQUARE_CELLS;

            /*
             * Save the main image palette and replace it with black palette, so
             * we can do fade in effect later.
             */
            BitmapInfoHeader = (PBITMAPINFOHEADER)Screen;
            Palette = (LPRGBQUAD)((PUCHAR)Screen + BitmapInfoHeader->biSize);
            RtlCopyMemory(_MainPalette, Palette, sizeof(_MainPalette));
            RtlZeroMemory(Palette, sizeof(_MainPalette));

            /* Blit the background */
            InbvBitBlt(Screen, 0, 0);

            /* Set progress bar coordinates and display it */
            InbvSetProgressBarCoordinates(257, 352);

            /* Display the boot logo and fade it in */
            BootImageFadeIn();

#ifdef CORE_6781_resolved
            /* Check for non-workstation products */
            if (SharedUserData->NtProductType != NtProductWinNt)
            {
                /* Overwrite part of the logo for a server product */
                InbvScreenToBufferBlt(Buffer, 413, 237, 7, 7, 8);
                InbvSolidColorFill(418, 230, 454, 256, 0);
                InbvBufferToScreenBlt(Buffer, 413, 237, 7, 7, 8);

                /* In setup mode, you haven't selected a SKU yet */
                if (ExpInTextModeSetup) Text = NULL;
            }
#endif
        }

#ifdef CORE_6781_resolved
        /* Draw the SKU text if it exits */
        if (Text) InbvBitBlt(Text, 180, 121);
#else
        DBG_UNREFERENCED_LOCAL_VARIABLE(Text);
#endif

        /* 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? */
    if (SysThreadCreated)
    {
        /* We do, set the progress bar location */
        InbvAcquireLock();
        RotBarSelection = TempRotBarSelection;
        //InbvRotBarInit();
        InbvReleaseLock();
    }
}