[ros-diffs] [hbelusca] 57859: [NTOSKRNL] Do the fading if we are in a valid state.

hbelusca at svn.reactos.org hbelusca at svn.reactos.org
Sun Dec 9 22:15:42 UTC 2012


Author: hbelusca
Date: Sun Dec  9 22:15:42 2012
New Revision: 57859

URL: http://svn.reactos.org/svn/reactos?rev=57859&view=rev
Log:
[NTOSKRNL]
Do the fading if we are in a valid state.

Modified:
    trunk/reactos/ntoskrnl/inbv/inbv.c

Modified: trunk/reactos/ntoskrnl/inbv/inbv.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/inbv/inbv.c?rev=57859&r1=57858&r2=57859&view=diff
==============================================================================
--- trunk/reactos/ntoskrnl/inbv/inbv.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/inbv/inbv.c [iso-8859-1] Sun Dec  9 22:15:42 2012
@@ -61,6 +61,12 @@
 } BITMAPINFOHEADER, *PBITMAPINFOHEADER;
 /****************************/
 
+//
+// Needed prototypes
+//
+VOID NTAPI InbvAcquireLock(VOID);
+VOID NTAPI InbvReleaseLock(VOID);
+
 static VOID
 NTAPI
 BootImageFadeIn(VOID)
@@ -74,41 +80,51 @@
 
     Interval.QuadPart = -PALETTE_FADE_TIME;
 
-    /*
-     * Build a bitmap containing the fade in palette. The palette entries
-     * are then processed in a loop and set using VidBitBlt function.
-     */
-    ClrUsed = sizeof(_MainPalette) / sizeof(_MainPalette[0]);
-    RtlZeroMemory(PaletteBitmap, sizeof(BITMAPINFOHEADER));
-    PaletteBitmap->biSize = sizeof(BITMAPINFOHEADER);
-    PaletteBitmap->biBitCount = 4; 
-    PaletteBitmap->biClrUsed = ClrUsed;
-
-    /*
-     * Main animation loop.
-     */
-    for (Iteration = 0; Iteration <= PALETTE_FADE_STEPS; ++Iteration)
-    {
-        for (Index = 0; Index < ClrUsed; Index++)
-        {
-            Palette[Index].rgbRed =
-                _MainPalette[Index].rgbRed * Iteration / PALETTE_FADE_STEPS;
-            Palette[Index].rgbGreen =
-                _MainPalette[Index].rgbGreen * Iteration / PALETTE_FADE_STEPS;
-            Palette[Index].rgbBlue =
-                _MainPalette[Index].rgbBlue * Iteration / PALETTE_FADE_STEPS;
-        }
-
-        VidBitBlt(PaletteBitmapBuffer, 0, 0);
+    /* Check if we're installed and we own it */
+    if ((InbvBootDriverInstalled) &&
+        (InbvDisplayState == INBV_DISPLAY_STATE_OWNED))
+    {
+        /* Acquire the lock */
+        InbvAcquireLock();
+
+        /*
+         * Build a bitmap containing the fade in palette. The palette entries
+         * are then processed in a loop and set using VidBitBlt function.
+         */
+        ClrUsed = sizeof(_MainPalette) / sizeof(_MainPalette[0]);
+        RtlZeroMemory(PaletteBitmap, sizeof(BITMAPINFOHEADER));
+        PaletteBitmap->biSize = sizeof(BITMAPINFOHEADER);
+        PaletteBitmap->biBitCount = 4; 
+        PaletteBitmap->biClrUsed = ClrUsed;
+
+        /*
+         * Main animation loop.
+         */
+        for (Iteration = 0; Iteration <= PALETTE_FADE_STEPS; ++Iteration)
+        {
+            for (Index = 0; Index < ClrUsed; Index++)
+            {
+                Palette[Index].rgbRed =
+                    _MainPalette[Index].rgbRed * Iteration / PALETTE_FADE_STEPS;
+                Palette[Index].rgbGreen =
+                    _MainPalette[Index].rgbGreen * Iteration / PALETTE_FADE_STEPS;
+                Palette[Index].rgbBlue =
+                    _MainPalette[Index].rgbBlue * Iteration / PALETTE_FADE_STEPS;
+            }
+
+            VidBitBlt(PaletteBitmapBuffer, 0, 0);
+
+            /* Wait for a bit. */
+            KeDelayExecutionThread(KernelMode, FALSE, &Interval);
+        }
+
+        /* Release the lock */
+        InbvReleaseLock();
 
         /* Wait for a bit. */
         KeDelayExecutionThread(KernelMode, FALSE, &Interval);
     }
-
-    /* Wait for a bit. */
-    KeDelayExecutionThread(KernelMode, FALSE, &Interval);
-}
-
+}
 
 /* FUNCTIONS *****************************************************************/
 




More information about the Ros-diffs mailing list