bring back progress bar for loading files

svn path=/trunk/; revision=51742
This commit is contained in:
Matthias Kupfer 2011-05-14 18:32:59 +00:00
parent 51edd28a7a
commit 75b8d216e2
2 changed files with 24 additions and 9 deletions

View file

@ -266,13 +266,6 @@ WinLdrLoadImage(IN PCHAR FileName,
LARGE_INTEGER Position;
ULONG i, BytesRead;
CHAR ProgressString[256];
/* Inform user we are loading files */
sprintf(ProgressString, "Loading %s...", strchr(FileName, '\\') + 1);
UiDrawBackdrop();
UiDrawProgressBarCenter(1, 100, ProgressString);
/* Open the image file */
Status = ArcOpen(FileName, OpenReadOnly, &FileId);
if (Status != ESUCCESS)

View file

@ -457,6 +457,8 @@ LoadAndBootWindows(PCSTR OperatingSystemName,
PVOID GdtIdt;
ULONG PcrBasePage=0;
ULONG TssBasePage=0;
// Progress bar
CHAR ProgressString[256];
// Open the operating system section
// specified in the .ini file
@ -464,7 +466,8 @@ LoadAndBootWindows(PCSTR OperatingSystemName,
UiDrawBackdrop();
UiDrawStatusText("Detecting Hardware...");
UiDrawProgressBarCenter(1, 100, "Loading NT...");
sprintf(ProgressString, "Loading NT...");
UiDrawProgressBarCenter(1, 100, ProgressString);
/* Read the system path is set in the .ini file */
if (!HasSection || !IniReadSettingByName(SectionId, "SystemPath", FullPath, sizeof(FullPath)))
@ -524,7 +527,7 @@ LoadAndBootWindows(PCSTR OperatingSystemName,
}
/* Let user know we started loading */
UiDrawStatusText("Loading...");
//UiDrawStatusText("Loading...");
/* append a backslash */
strcpy(BootPath, FullPath);
@ -545,6 +548,10 @@ LoadAndBootWindows(PCSTR OperatingSystemName,
UseRealHeap = TRUE;
LoaderBlock->ConfigurationRoot = MachHwDetect();
sprintf(ProgressString, "Loading system hive...");
UiDrawBackdrop();
UiDrawProgressBarCenter(15, 100, ProgressString);
/* Load Hive */
Status = WinLdrInitSystemHive(LoaderBlock, BootPath);
DPRINTM(DPRINT_WINDOWS, "SYSTEM hive loaded with status %d\n", Status);
@ -555,12 +562,18 @@ LoadAndBootWindows(PCSTR OperatingSystemName,
/* Load kernel */
strcpy(FileName, BootPath);
strcat(FileName, "SYSTEM32\\NTOSKRNL.EXE");
sprintf(ProgressString, "Loading %s...", strchr(FileName, '\\') + 1);
UiDrawBackdrop();
UiDrawProgressBarCenter(30, 100, ProgressString);
Status = WinLdrLoadImage(FileName, LoaderSystemCode, &NtosBase);
DPRINTM(DPRINT_WINDOWS, "Ntos loaded with status %d at %p\n", Status, NtosBase);
/* Load HAL */
strcpy(FileName, BootPath);
strcat(FileName, "SYSTEM32\\HAL.DLL");
sprintf(ProgressString, "Loading %s...", strchr(FileName, '\\') + 1);
UiDrawBackdrop();
UiDrawProgressBarCenter(45, 100, ProgressString);
Status = WinLdrLoadImage(FileName, LoaderHalCode, &HalBase);
DPRINTM(DPRINT_WINDOWS, "HAL loaded with status %d at %p\n", Status, HalBase);
@ -569,6 +582,9 @@ LoadAndBootWindows(PCSTR OperatingSystemName,
{
strcpy(FileName, BootPath);
strcat(FileName, "SYSTEM32\\KDCOM.DLL");
sprintf(ProgressString, "Loading %s...", strchr(FileName, '\\') + 1);
UiDrawBackdrop();
UiDrawProgressBarCenter(60, 100, ProgressString);
Status = WinLdrLoadImage(FileName, LoaderBootDriver, &KdComBase);
DPRINTM(DPRINT_WINDOWS, "KdCom loaded with status %d at %p\n", Status, KdComBase);
}
@ -592,11 +608,17 @@ LoadAndBootWindows(PCSTR OperatingSystemName,
if (KdComDTE)
WinLdrScanImportDescriptorTable(LoaderBlock, FileName, KdComDTE);
sprintf(ProgressString, "Loading NLS and OEM fonts...");
UiDrawBackdrop();
UiDrawProgressBarCenter(80, 100, ProgressString);
/* Load NLS data, OEM font, and prepare boot drivers list */
Status = WinLdrScanSystemHive(LoaderBlock, BootPath);
DPRINTM(DPRINT_WINDOWS, "SYSTEM hive scanned with status %d\n", Status);
/* Load boot drivers */
sprintf(ProgressString, "Loading boot drivers...");
UiDrawBackdrop();
UiDrawProgressBarCenter(100, 100, ProgressString);
Status = WinLdrLoadBootDrivers(LoaderBlock, BootPath);
DPRINTM(DPRINT_WINDOWS, "Boot drivers loaded with status %d\n", Status);