ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

inbv.c
Go to the documentation of this file.
00001 /* INCLUDES ******************************************************************/
00002 
00003 #include <ntoskrnl.h>
00004 #define NDEBUG
00005 #include <debug.h>
00006 #include "bootvid/bootvid.h"
00007 
00008 /* GLOBALS *******************************************************************/
00009 
00010 KSPIN_LOCK BootDriverLock;
00011 KIRQL InbvOldIrql;
00012 INBV_DISPLAY_STATE InbvDisplayState;
00013 BOOLEAN InbvBootDriverInstalled = FALSE;
00014 BOOLEAN InbvDisplayDebugStrings = FALSE;
00015 INBV_DISPLAY_STRING_FILTER InbvDisplayFilter;
00016 ULONG ProgressBarLeft, ProgressBarTop;
00017 BOOLEAN ShowProgressBar = FALSE;
00018 INBV_PROGRESS_STATE InbvProgressState;
00019 INBV_RESET_DISPLAY_PARAMETERS InbvResetDisplayParameters;
00020 ULONG ResourceCount;
00021 PUCHAR ResourceList[64];
00022 BOOLEAN SysThreadCreated = FALSE;
00023 ROT_BAR_TYPE RotBarSelection;
00024 ULONG PltRotBarStatus;
00025 BT_PROGRESS_INDICATOR InbvProgressIndicator = {0, 25, 0};
00026 
00027 /* FUNCTIONS *****************************************************************/
00028 
00029 PVOID
00030 NTAPI
00031 INIT_FUNCTION
00032 FindBitmapResource(IN PLOADER_PARAMETER_BLOCK LoaderBlock,
00033                    IN ULONG ResourceId)
00034 {
00035     UNICODE_STRING UpString = RTL_CONSTANT_STRING(L"ntoskrnl.exe");
00036     UNICODE_STRING MpString = RTL_CONSTANT_STRING(L"ntkrnlmp.exe");
00037     PLIST_ENTRY NextEntry, ListHead;
00038     PLDR_DATA_TABLE_ENTRY LdrEntry;
00039     PIMAGE_RESOURCE_DATA_ENTRY ResourceDataEntry;
00040     LDR_RESOURCE_INFO ResourceInfo;
00041     NTSTATUS Status;
00042     PVOID Data = NULL;
00043 
00044     /* Loop the driver list */
00045     ListHead = &LoaderBlock->LoadOrderListHead;
00046     NextEntry = ListHead->Flink;
00047     while (NextEntry != ListHead)
00048     {
00049         /* Get the entry */
00050         LdrEntry = CONTAINING_RECORD(NextEntry,
00051                                      LDR_DATA_TABLE_ENTRY,
00052                                      InLoadOrderLinks);
00053 
00054         /* Check for a match */
00055         if ((RtlEqualUnicodeString(&LdrEntry->BaseDllName, &UpString, TRUE)) ||
00056             (RtlEqualUnicodeString(&LdrEntry->BaseDllName, &MpString, TRUE)))
00057         {
00058             /* Break out */
00059             break;
00060         }
00061     }
00062 
00063     /* Check if we found it */
00064     if (NextEntry != ListHead)
00065     {
00066         /* Try to find the resource */
00067         ResourceInfo.Type = 2; //RT_BITMAP;
00068         ResourceInfo.Name = ResourceId;
00069         ResourceInfo.Language = 0;
00070         Status = LdrFindResource_U(LdrEntry->DllBase,
00071                                    &ResourceInfo,
00072                                    RESOURCE_DATA_LEVEL,
00073                                    &ResourceDataEntry);
00074         if (NT_SUCCESS(Status))
00075         {
00076             /* Access the resource */
00077             ULONG Size = 0;
00078             Status = LdrAccessResource(LdrEntry->DllBase,
00079                                        ResourceDataEntry,
00080                                        &Data,
00081                                        &Size);
00082             if ((Data) && (ResourceId < 3))
00083             {
00084                 KiBugCheckData[4] ^= RtlComputeCrc32(0, Data, Size);
00085             }
00086             if (!NT_SUCCESS(Status)) Data = NULL;
00087         }
00088     }
00089 
00090     /* Return the pointer */
00091     return Data;
00092 }
00093 
00094 BOOLEAN
00095 NTAPI
00096 INIT_FUNCTION
00097 InbvDriverInitialize(IN PLOADER_PARAMETER_BLOCK LoaderBlock,
00098                      IN ULONG Count)
00099 {
00100     PCHAR CommandLine;
00101     BOOLEAN CustomLogo = FALSE;
00102     ULONG i;
00103 
00104     /* Quit if we're already installed */
00105     if (InbvBootDriverInstalled) return TRUE;
00106 
00107     /* Initialize the lock and check the current display state */
00108     KeInitializeSpinLock(&BootDriverLock);
00109     if (InbvDisplayState == INBV_DISPLAY_STATE_OWNED)
00110     {
00111         /* Check if we have a custom boot logo */
00112         CommandLine = _strupr(LoaderBlock->LoadOptions);
00113         CustomLogo = strstr(CommandLine, "BOOTLOGO") ? TRUE: FALSE;
00114     }
00115 
00116     /* Initialize the video */
00117     InbvBootDriverInstalled = VidInitialize(FALSE);
00118     if (InbvBootDriverInstalled)
00119     {
00120         /* Now reset the display, but only if there's a custom boot logo */
00121         VidResetDisplay(CustomLogo);
00122         
00123         /* Find bitmap resources in the kernel */
00124         ResourceCount = min(IDB_CLUSTER_SERVER, Count);
00125         for (i = 1; i <= Count; i++)
00126         {
00127             /* Do the lookup */
00128             ResourceList[i] = FindBitmapResource(LoaderBlock, i);
00129         }
00130 
00131         /* Set the progress bar ranges */
00132         InbvSetProgressBarSubset(0, 100);
00133     }
00134 
00135     /* Return install state */
00136     return InbvBootDriverInstalled;
00137 }
00138 
00139 VOID
00140 NTAPI
00141 InbvAcquireLock(VOID)
00142 {
00143     KIRQL OldIrql;
00144 
00145     /* Check if we're at dispatch level or lower */
00146     OldIrql = KeGetCurrentIrql();
00147     if (OldIrql <= DISPATCH_LEVEL)
00148     {
00149         /* Loop until the lock is free */
00150         while (!KeTestSpinLock(&BootDriverLock));
00151 
00152         /* Raise IRQL to dispatch level */
00153         KeRaiseIrql(DISPATCH_LEVEL, &OldIrql);
00154     }
00155 
00156     /* Acquire the lock */
00157     KiAcquireSpinLock(&BootDriverLock);
00158     InbvOldIrql = OldIrql;
00159 }
00160 
00161 VOID
00162 NTAPI
00163 InbvReleaseLock(VOID)
00164 {
00165     KIRQL OldIrql;
00166 
00167     /* Capture the old IRQL */
00168     OldIrql = InbvOldIrql;
00169 
00170     /* Release the driver lock */
00171     KiReleaseSpinLock(&BootDriverLock);
00172 
00173     /* If we were at dispatch level or lower, restore the old IRQL */
00174     if (InbvOldIrql <= DISPATCH_LEVEL) KeLowerIrql(OldIrql);
00175 }
00176 
00177 VOID
00178 NTAPI
00179 INIT_FUNCTION
00180 InbvEnableBootDriver(IN BOOLEAN Enable)
00181 {
00182     /* Check if we're installed */
00183     if (InbvBootDriverInstalled)
00184     {
00185         /* Check for lost state */
00186         if (InbvDisplayState >= INBV_DISPLAY_STATE_LOST) return;
00187 
00188         /* Acquire the lock */
00189         InbvAcquireLock();
00190 
00191         /* Cleanup the screen if we own it */
00192         if (InbvDisplayState == INBV_DISPLAY_STATE_OWNED) VidCleanUp();
00193 
00194         /* Set the new display state */
00195         InbvDisplayState = Enable ? INBV_DISPLAY_STATE_OWNED:
00196                                     INBV_DISPLAY_STATE_DISABLED;
00197 
00198         /* Release the lock */
00199         InbvReleaseLock();
00200     }
00201     else
00202     {
00203         /* Set the new display state */
00204         InbvDisplayState = Enable ? INBV_DISPLAY_STATE_OWNED:
00205                                     INBV_DISPLAY_STATE_DISABLED;
00206     }
00207 }
00208 
00209 VOID
00210 NTAPI
00211 InbvAcquireDisplayOwnership(VOID)
00212 {
00213     /* Check if we have a callback and we're just acquiring it now */
00214     if ((InbvResetDisplayParameters) &&
00215         (InbvDisplayState == INBV_DISPLAY_STATE_LOST))
00216     {
00217         /* Call the callback */
00218         InbvResetDisplayParameters(80, 50);
00219     }
00220 
00221     /* Acquire the display */
00222     InbvDisplayState = INBV_DISPLAY_STATE_OWNED;
00223 }
00224 
00225 VOID
00226 NTAPI
00227 InbvSetDisplayOwnership(IN BOOLEAN DisplayOwned)
00228 {
00229     /* Set the new display state */
00230     InbvDisplayState = DisplayOwned ? INBV_DISPLAY_STATE_OWNED:
00231                                       INBV_DISPLAY_STATE_LOST;
00232 }
00233 
00234 BOOLEAN
00235 NTAPI
00236 InbvCheckDisplayOwnership(VOID)
00237 {
00238     /* Return if we own it or not */
00239     return InbvDisplayState != INBV_DISPLAY_STATE_LOST;
00240 }
00241 
00242 INBV_DISPLAY_STATE
00243 NTAPI
00244 InbvGetDisplayState(VOID)
00245 {
00246     /* Return the actual state */
00247     return InbvDisplayState;
00248 }
00249 
00250 BOOLEAN
00251 NTAPI
00252 InbvDisplayString(IN PCHAR String)
00253 {
00254     /* Make sure we own the display */
00255     if (InbvDisplayState == INBV_DISPLAY_STATE_OWNED)
00256     {
00257         /* If we're not allowed, return success anyway */
00258         if (!InbvDisplayDebugStrings) return TRUE;
00259 
00260         /* Check if a filter is installed */
00261         if (InbvDisplayFilter) InbvDisplayFilter(&String);
00262 
00263         /* Acquire the lock */
00264         InbvAcquireLock();
00265 
00266         /* Make sure we're installed and display the string */
00267         if (InbvBootDriverInstalled) VidDisplayString((PUCHAR) String);
00268 
00269         /* Print the string on the EMS port */
00270         HeadlessDispatch(
00271             HeadlessCmdPutString,
00272             String,
00273             strlen(String) + sizeof(ANSI_NULL),
00274             NULL,
00275             NULL);
00276 
00277         /* Release the lock */
00278         InbvReleaseLock();
00279 
00280         /* All done */
00281         return TRUE;
00282     }
00283 
00284     /* We don't own it, fail */
00285     return FALSE;
00286 }
00287 
00288 BOOLEAN
00289 NTAPI
00290 InbvEnableDisplayString(IN BOOLEAN Enable)
00291 {
00292     BOOLEAN OldSetting;
00293 
00294     /* Get the old setting */
00295     OldSetting = InbvDisplayDebugStrings;
00296 
00297     /* Update it */
00298     InbvDisplayDebugStrings = Enable;
00299 
00300     /* Return the old setting */
00301     return OldSetting;
00302 }
00303 
00304 VOID
00305 NTAPI
00306 InbvInstallDisplayStringFilter(IN INBV_DISPLAY_STRING_FILTER Filter)
00307 {
00308     /* Save the filter */
00309     InbvDisplayFilter = Filter;
00310 }
00311 
00312 BOOLEAN
00313 NTAPI
00314 InbvIsBootDriverInstalled(VOID)
00315 {
00316     /* Return driver state */
00317     return InbvBootDriverInstalled;
00318 }
00319 
00320 VOID
00321 NTAPI
00322 InbvNotifyDisplayOwnershipLost(IN INBV_RESET_DISPLAY_PARAMETERS Callback)
00323 {
00324     /* Check if we're installed */
00325     if (InbvBootDriverInstalled)
00326     {
00327         /* Acquire the lock and cleanup if we own the screen */
00328         InbvAcquireLock();
00329         if (InbvDisplayState != INBV_DISPLAY_STATE_LOST) VidCleanUp();
00330 
00331         /* Set the reset callback and display state */
00332         InbvResetDisplayParameters = Callback;
00333         InbvDisplayState = INBV_DISPLAY_STATE_LOST;
00334 
00335         /* Release the lock */
00336         InbvReleaseLock();
00337     }
00338     else
00339     {
00340         /* Set the reset callback and display state */
00341         InbvResetDisplayParameters = Callback;
00342         InbvDisplayState = INBV_DISPLAY_STATE_LOST;
00343     }
00344 }
00345 
00346 BOOLEAN
00347 NTAPI
00348 InbvResetDisplay(VOID)
00349 {
00350     /* Check if we're installed and we own it */
00351     if ((InbvBootDriverInstalled) &&
00352         (InbvDisplayState == INBV_DISPLAY_STATE_OWNED))
00353     {
00354         /* Do the reset */
00355         VidResetDisplay(TRUE);
00356         return TRUE;
00357     }
00358 
00359     /* Nothing to reset */
00360     return FALSE;
00361 }
00362 
00363 VOID
00364 NTAPI
00365 InbvSetScrollRegion(IN ULONG Left,
00366                     IN ULONG Top,
00367                     IN ULONG Width,
00368                     IN ULONG Height)
00369 {
00370     /* Just call bootvid */
00371     VidSetScrollRegion(Left, Top, Width, Height);
00372 }
00373 
00374 VOID
00375 NTAPI
00376 InbvSetTextColor(IN ULONG Color)
00377 {
00378     /* FIXME: Headless */
00379 
00380     /* Update the text color */
00381     VidSetTextColor(Color);
00382 }
00383 
00384 VOID
00385 NTAPI
00386 InbvSolidColorFill(IN ULONG Left,
00387                    IN ULONG Top,
00388                    IN ULONG Width,
00389                    IN ULONG Height,
00390                    IN ULONG Color)
00391 {
00392     /* Make sure we own it */
00393     if (InbvDisplayState == INBV_DISPLAY_STATE_OWNED)
00394     {
00395         /* Acquire the lock */
00396         InbvAcquireLock();
00397 
00398         /* Check if we're installed */
00399         if (InbvBootDriverInstalled)
00400         {
00401             /* Call bootvid */
00402             VidSolidColorFill(Left, Top, Width, Height, (UCHAR)Color);
00403         }
00404 
00405         /* FIXME: Headless */
00406 
00407         /* Release the lock */
00408         InbvReleaseLock();
00409     }
00410 }
00411 
00412 VOID
00413 NTAPI
00414 INIT_FUNCTION
00415 InbvUpdateProgressBar(IN ULONG Progress)
00416 {
00417     ULONG FillCount, BoundedProgress;
00418 
00419     /* Make sure the progress bar is enabled, that we own and are installed */
00420     if ((ShowProgressBar) &&
00421         (InbvBootDriverInstalled) &&
00422         (InbvDisplayState == INBV_DISPLAY_STATE_OWNED))
00423     {
00424         /* Compute fill count */
00425         BoundedProgress = (InbvProgressState.Floor / 100) + Progress;
00426         FillCount = 121 * (InbvProgressState.Bias * BoundedProgress) / 1000000;
00427 
00428         /* Acquire the lock */
00429         InbvAcquireLock();
00430 
00431         /* Fill the progress bar */
00432         VidSolidColorFill(ProgressBarLeft,
00433                           ProgressBarTop,
00434                           ProgressBarLeft + FillCount,
00435                           ProgressBarTop + 12,
00436                           15);
00437 
00438         /* Release the lock */
00439         InbvReleaseLock();
00440     }
00441 }
00442 
00443 VOID
00444 NTAPI
00445 InbvBufferToScreenBlt(IN PUCHAR Buffer,
00446                       IN ULONG X,
00447                       IN ULONG Y,
00448                       IN ULONG Width,
00449                       IN ULONG Height,
00450                       IN ULONG Delta)
00451 {
00452     /* Check if we're installed and we own it */
00453     if ((InbvBootDriverInstalled) &&
00454         (InbvDisplayState == INBV_DISPLAY_STATE_OWNED))
00455     {
00456         /* Do the blit */
00457         VidBufferToScreenBlt(Buffer, X, Y, Width, Height, Delta);
00458     }
00459 }
00460 
00461 VOID
00462 NTAPI
00463 InbvBitBlt(IN PUCHAR Buffer,
00464            IN ULONG X,
00465            IN ULONG Y)
00466 {
00467     /* Check if we're installed and we own it */
00468     if ((InbvBootDriverInstalled) &&
00469         (InbvDisplayState == INBV_DISPLAY_STATE_OWNED))
00470     {
00471         /* Acquire the lock */
00472         InbvAcquireLock();
00473 
00474         /* Do the blit */
00475         VidBitBlt(Buffer, X, Y);
00476 
00477         /* Release the lock */
00478         InbvReleaseLock();
00479     }
00480 }
00481 
00482 VOID
00483 NTAPI
00484 InbvScreenToBufferBlt(IN PUCHAR Buffer,
00485                       IN ULONG X,
00486                       IN ULONG Y,
00487                       IN ULONG Width,
00488                       IN ULONG Height,
00489                       IN ULONG Delta)
00490 {
00491     /* Check if we're installed and we own it */
00492     if ((InbvBootDriverInstalled) &&
00493         (InbvDisplayState == INBV_DISPLAY_STATE_OWNED))
00494     {
00495         /* Do the blit */
00496         VidScreenToBufferBlt(Buffer, X, Y, Width, Height, Delta);
00497     }
00498 }
00499 
00500 VOID
00501 NTAPI
00502 InbvSetProgressBarCoordinates(IN ULONG Left,
00503                               IN ULONG Top)
00504 {
00505     /* Update the coordinates */
00506     ProgressBarLeft = Left;
00507     ProgressBarTop = Top;
00508 
00509     /* Enable the progress bar */
00510     ShowProgressBar = TRUE;
00511 }
00512 
00513 VOID
00514 NTAPI
00515 InbvSetProgressBarSubset(IN ULONG Floor,
00516                          IN ULONG Ceiling)
00517 {
00518     /* Sanity checks */
00519     ASSERT(Floor < Ceiling);
00520     ASSERT(Ceiling <= 100);
00521 
00522     /* Update the progress bar state */
00523     InbvProgressState.Floor = Floor * 100;
00524     InbvProgressState.Ceiling = Ceiling * 100;
00525     InbvProgressState.Bias = (Ceiling * 100) - Floor;
00526 }
00527 
00528 VOID
00529 NTAPI
00530 INIT_FUNCTION
00531 InbvIndicateProgress(VOID)
00532 {
00533     ULONG Percentage;
00534 
00535     /* Increase progress */
00536     InbvProgressIndicator.Count++;
00537 
00538     /* Compute new percentage */
00539     Percentage = min(100 * InbvProgressIndicator.Count /
00540                            InbvProgressIndicator.Expected,
00541                      99);
00542     if (Percentage != InbvProgressIndicator.Percentage)
00543     {
00544         /* Percentage has moved, update the progress bar */
00545         InbvProgressIndicator.Percentage = Percentage;
00546         InbvUpdateProgressBar(Percentage);
00547     }
00548 }
00549 
00550 PUCHAR
00551 NTAPI
00552 InbvGetResourceAddress(IN ULONG ResourceNumber)
00553 {
00554     /* Validate the resource number */
00555     if (ResourceNumber > ResourceCount) return NULL;
00556 
00557     /* Return the address */
00558     return ResourceList[ResourceNumber--];
00559 }
00560 
00561 NTSTATUS
00562 NTAPI
00563 NtDisplayString(IN PUNICODE_STRING DisplayString)
00564 {
00565     OEM_STRING OemString;
00566 
00567     /* Convert the string to OEM and display it */
00568     RtlUnicodeStringToOemString(&OemString, DisplayString, TRUE);
00569     InbvDisplayString(OemString.Buffer);
00570     RtlFreeOemString(&OemString);
00571 
00572     /* Return success */
00573     return STATUS_SUCCESS;
00574 }
00575 
00576 VOID
00577 NTAPI
00578 INIT_FUNCTION
00579 DisplayBootBitmap(IN BOOLEAN TextMode)
00580 {
00581     PVOID Header, Band, Text, Screen;
00582     ROT_BAR_TYPE TempRotBarSelection = RB_UNSPECIFIED;
00583     UCHAR Buffer[64];
00584     
00585     /* Check if the system thread has already been created */
00586     if (SysThreadCreated)
00587     {
00588         /* Reset the progress bar */
00589         InbvAcquireLock();
00590         RotBarSelection = RB_UNSPECIFIED;
00591         InbvReleaseLock();
00592     }
00593 
00594     /* Check if this is text mode */
00595     ShowProgressBar = FALSE;
00596     if (TextMode)
00597     {
00598         /* Check if this is a server OS */
00599         if (SharedUserData->NtProductType == NtProductWinNt)
00600         {
00601             /* It's not, set workstation settings */
00602             InbvSetTextColor(15);
00603             InbvSolidColorFill(0, 0, 639, 479, 7);
00604             InbvSolidColorFill(0, 421, 639, 479, 1);
00605             
00606             /* Get resources */
00607             Header = InbvGetResourceAddress(IDB_LOGO_HEADER);
00608             Band = InbvGetResourceAddress(IDB_LOGO_BAND);
00609         }
00610         else
00611         {
00612             /* Set server settings */
00613             InbvSetTextColor(14);
00614             InbvSolidColorFill(0, 0, 639, 479, 6);
00615             InbvSolidColorFill(0, 421, 639, 479, 1);
00616 
00617             /* Get resources */
00618             Header = InbvGetResourceAddress(IDB_SERVER_HEADER);
00619             Band = InbvGetResourceAddress(IDB_SERVER_BAND);
00620         }
00621 
00622         /* Set the scrolling region */
00623         InbvSetScrollRegion(32, 80, 631, 400);
00624 
00625         /* Make sure we have resources */
00626         if ((Header) && (Band))
00627         {
00628             /* BitBlt them on the screen */
00629             InbvBitBlt(Band, 0, 419);
00630             InbvBitBlt(Header, 0, 0);
00631         }
00632     }
00633     else
00634     {
00635         /* Is the boot driver installed? */
00636         Text = NULL;
00637         if (!InbvBootDriverInstalled) return;
00638 
00639         /* Load the standard boot screen */
00640         Screen = InbvGetResourceAddress(IDB_BOOT_LOGO);
00641         if (SharedUserData->NtProductType == NtProductWinNt)
00642         {
00643             /* Workstation product, display appropriate status bar color */
00644             InbvGetResourceAddress(IDB_BAR_PRO);
00645         }
00646         else
00647         {
00648             /* Display correct branding based on server suite */
00649             if (ExVerifySuite(StorageServer))
00650             {
00651                 /* Storage Server Edition */
00652                 Text = InbvGetResourceAddress(IDB_STORAGE_SERVER);
00653             }
00654             else if (ExVerifySuite(ComputeServer))
00655             {
00656                 /* Compute Cluster Edition */
00657                 Text = InbvGetResourceAddress(IDB_CLUSTER_SERVER);
00658             }
00659             else
00660             {
00661                 /* Normal edition */
00662                 Text = InbvGetResourceAddress(IDB_SERVER_LOGO);
00663             }
00664             
00665             /* Server product, display appropriate status bar color */
00666             InbvGetResourceAddress(IDB_BAR_SERVER);
00667         }
00668         
00669         /* Make sure we had a logo */
00670         if (Screen)
00671         {
00672             /* Choose progress bar */
00673             TempRotBarSelection = RB_SQUARE_CELLS;
00674 
00675             /* Blit the background */
00676             InbvBitBlt(Screen, 0, 0);
00677 
00678             /* Set progress bar coordinates and display it */
00679             InbvSetProgressBarCoordinates(257, 352);
00680             
00681             /* Check for non-workstation products */
00682             if (SharedUserData->NtProductType != NtProductWinNt)
00683             {
00684                 /* Overwrite part of the logo for a server product */
00685                 InbvScreenToBufferBlt(Buffer, 413, 237, 7, 7, 8);
00686                 InbvSolidColorFill(418, 230, 454, 256, 0);
00687                 InbvBufferToScreenBlt(Buffer, 413, 237, 7, 7, 8);
00688                 
00689                 /* In setup mode, you haven't selected a SKU yet */
00690                 if (ExpInTextModeSetup) Text = NULL;
00691             }
00692           }
00693           
00694           /* Draw the SKU text if it exits */
00695           if (Text) InbvBitBlt(Text, 180, 121);
00696           
00697           /* Draw the progress bar bit */
00698 //          if (Bar) InbvBitBlt(Bar, 0, 0);
00699 
00700           /* Set filter which will draw text display if needed */
00701           InbvInstallDisplayStringFilter(DisplayFilter);
00702     }
00703 
00704     /* Do we have a system thread? */
00705     if (SysThreadCreated)
00706     {
00707         /* We do, set the progress bar location */
00708         InbvAcquireLock();
00709         RotBarSelection = TempRotBarSelection;
00710         //InbvRotBarInit();
00711         InbvReleaseLock();
00712     }
00713 }
00714 
00715 VOID
00716 NTAPI
00717 INIT_FUNCTION
00718 DisplayFilter(PCHAR *String)
00719 {
00720     /* Windows hack to skip first dots */
00721     static BOOLEAN DotHack = TRUE;
00722 
00723     /* If "." is given set *String to empty string */
00724     if(DotHack && strcmp(*String, ".") == 0)
00725         *String = "";
00726 
00727     if(**String)
00728     {
00729         /* Remove the filter */
00730         InbvInstallDisplayStringFilter(NULL);
00731         
00732         DotHack = FALSE;
00733 
00734         /* Draw text screen */
00735         DisplayBootBitmap(TRUE);
00736     }
00737 }
00738 
00739 VOID
00740 NTAPI
00741 INIT_FUNCTION
00742 FinalizeBootLogo(VOID)
00743 {
00744     /* Acquire lock and check the display state */
00745     InbvAcquireLock();
00746     if (InbvGetDisplayState() == INBV_DISPLAY_STATE_OWNED)
00747     {
00748         /* Clear the screen */
00749         VidSolidColorFill(0, 0, 639, 479, 0);
00750     }
00751 
00752     /* Reset progress bar and lock */
00753     PltRotBarStatus = 3;
00754     InbvReleaseLock();
00755 }

Generated on Sun May 27 2012 04:37:12 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.