mirror of
https://github.com/reactos/reactos.git
synced 2025-01-07 14:51:00 +00:00
[USETUP]
- Implement mandatory filesystem selection, formatting and filesystem checks for all new partitons. - Implement optional filesystem selection, formatting and filesystem checks for formatted boot and install partitions. - Enable installing ReactOS on primary partitions other than the first one. Usetup will install Freeloader on the first (or active) partition (aka boot partition) and install ReactOS on the chosen partition (aka install partition). svn path=/trunk/; revision=68112
This commit is contained in:
parent
55ee8217db
commit
76e910579c
29 changed files with 510 additions and 85 deletions
|
@ -35,7 +35,7 @@
|
|||
VOID
|
||||
FS_AddProvider(
|
||||
IN OUT PFILE_SYSTEM_LIST List,
|
||||
IN LPCWSTR FileSystem,
|
||||
IN LPCWSTR FileSystemName,
|
||||
IN FORMATEX FormatFunc,
|
||||
IN CHKDSKEX ChkdskFunc)
|
||||
{
|
||||
|
@ -45,7 +45,7 @@ FS_AddProvider(
|
|||
if (!Item)
|
||||
return;
|
||||
|
||||
Item->FileSystem = FileSystem;
|
||||
Item->FileSystemName = FileSystemName;
|
||||
Item->FormatFunc = FormatFunc;
|
||||
Item->ChkdskFunc = ChkdskFunc;
|
||||
Item->QuickFormat = TRUE;
|
||||
|
@ -58,7 +58,7 @@ FS_AddProvider(
|
|||
if (!Item)
|
||||
return;
|
||||
|
||||
Item->FileSystem = FileSystem;
|
||||
Item->FileSystemName = FileSystemName;
|
||||
Item->FormatFunc = FormatFunc;
|
||||
Item->ChkdskFunc = ChkdskFunc;
|
||||
Item->QuickFormat = FALSE;
|
||||
|
@ -99,7 +99,7 @@ CreateFileSystemList(
|
|||
while (ListEntry != &List->ListHead)
|
||||
{
|
||||
Item = CONTAINING_RECORD(ListEntry, FILE_SYSTEM_ITEM, ListEntry);
|
||||
if (Item->FileSystem && wcscmp(ForceFileSystem, Item->FileSystem) == 0)
|
||||
if (Item->FileSystemName && wcscmp(ForceFileSystem, Item->FileSystemName) == 0)
|
||||
{
|
||||
List->Selected = Item;
|
||||
break;
|
||||
|
@ -163,12 +163,12 @@ DrawFileSystemList(
|
|||
coPos,
|
||||
&Written);
|
||||
|
||||
if (Item->FileSystem)
|
||||
if (Item->FileSystemName)
|
||||
{
|
||||
if (Item->QuickFormat)
|
||||
snprintf(Buffer, sizeof(Buffer), MUIGetString(STRING_FORMATDISK1), Item->FileSystem);
|
||||
snprintf(Buffer, sizeof(Buffer), MUIGetString(STRING_FORMATDISK1), Item->FileSystemName);
|
||||
else
|
||||
snprintf(Buffer, sizeof(Buffer), MUIGetString(STRING_FORMATDISK2), Item->FileSystem);
|
||||
snprintf(Buffer, sizeof(Buffer), MUIGetString(STRING_FORMATDISK2), Item->FileSystemName);
|
||||
}
|
||||
else
|
||||
snprintf(Buffer, sizeof(Buffer), MUIGetString(STRING_KEEPFORMAT));
|
||||
|
@ -210,4 +210,26 @@ ScrollUpFileSystemList(
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
PFILE_SYSTEM_ITEM
|
||||
GetFileSystemByName(
|
||||
IN PFILE_SYSTEM_LIST List,
|
||||
IN LPWSTR FileSystemName)
|
||||
{
|
||||
PLIST_ENTRY ListEntry;
|
||||
PFILE_SYSTEM_ITEM Item;
|
||||
|
||||
ListEntry = List->ListHead.Flink;
|
||||
while (ListEntry != &List->ListHead)
|
||||
{
|
||||
Item = CONTAINING_RECORD(ListEntry, FILE_SYSTEM_ITEM, ListEntry);
|
||||
if (Item->FileSystemName && wcsicmp(FileSystemName, Item->FileSystemName) == 0)
|
||||
return Item;
|
||||
|
||||
ListEntry = ListEntry->Flink;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
typedef struct _FILE_SYSTEM_ITEM
|
||||
{
|
||||
LIST_ENTRY ListEntry;
|
||||
LPCWSTR FileSystem; /* Not owned by the item */
|
||||
LPCWSTR FileSystemName; /* Not owned by the item */
|
||||
FORMATEX FormatFunc;
|
||||
CHKDSKEX ChkdskFunc;
|
||||
BOOLEAN QuickFormat;
|
||||
|
@ -48,7 +48,7 @@ typedef struct _FILE_SYSTEM_LIST
|
|||
VOID
|
||||
FS_AddProvider(
|
||||
IN OUT PFILE_SYSTEM_LIST List,
|
||||
IN LPCWSTR FileSystem,
|
||||
IN LPCWSTR FileSystemName,
|
||||
IN FORMATEX FormatFunc,
|
||||
IN CHKDSKEX ChkdskFunc);
|
||||
|
||||
|
@ -75,4 +75,9 @@ VOID
|
|||
ScrollUpFileSystemList(
|
||||
IN PFILE_SYSTEM_LIST List);
|
||||
|
||||
PFILE_SYSTEM_ITEM
|
||||
GetFileSystemByName(
|
||||
IN PFILE_SYSTEM_LIST List,
|
||||
IN LPWSTR FileSystemName);
|
||||
|
||||
/* EOF */
|
||||
|
|
|
@ -2418,6 +2418,8 @@ SelectFileSystemPage(PINPUT_RECORD Ir)
|
|||
PCHAR PartUnit;
|
||||
PCHAR PartType;
|
||||
|
||||
DPRINT("SelectFileSystemPage()\n");
|
||||
|
||||
if (PartitionList == NULL ||
|
||||
PartitionList->CurrentDisk == NULL ||
|
||||
PartitionList->CurrentPartition == NULL)
|
||||
|
@ -2426,8 +2428,90 @@ SelectFileSystemPage(PINPUT_RECORD Ir)
|
|||
return QUIT_PAGE;
|
||||
}
|
||||
|
||||
DiskEntry = PartitionList->CurrentDisk;
|
||||
PartEntry = PartitionList->CurrentPartition;
|
||||
/* Find or set the active partition */
|
||||
CheckActiveBootPartition(PartitionList);
|
||||
|
||||
if (PartitionList->BootDisk == NULL ||
|
||||
PartitionList->BootPartition == NULL)
|
||||
{
|
||||
/* FIXME: show an error dialog */
|
||||
return QUIT_PAGE;
|
||||
}
|
||||
|
||||
switch (PartitionList->FormatState)
|
||||
{
|
||||
case Start:
|
||||
if (PartitionList->CurrentPartition != PartitionList->BootPartition)
|
||||
{
|
||||
PartitionList->TempDisk = PartitionList->BootDisk;
|
||||
PartitionList->TempPartition = PartitionList->BootPartition;
|
||||
PartitionList->TempPartition->NeedsCheck = TRUE;
|
||||
|
||||
PartitionList->FormatState = FormatSystemPartition;
|
||||
DPRINT1("FormatState: Start --> FormatSystemPartition\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
PartitionList->TempDisk = PartitionList->CurrentDisk;
|
||||
PartitionList->TempPartition = PartitionList->CurrentPartition;
|
||||
PartitionList->TempPartition->NeedsCheck = TRUE;
|
||||
|
||||
PartitionList->FormatState = FormatInstallPartition;
|
||||
DPRINT1("FormatState: Start --> FormatInstallPartition\n");
|
||||
}
|
||||
break;
|
||||
|
||||
case FormatSystemPartition:
|
||||
PartitionList->TempDisk = PartitionList->CurrentDisk;
|
||||
PartitionList->TempPartition = PartitionList->CurrentPartition;
|
||||
PartitionList->TempPartition->NeedsCheck = TRUE;
|
||||
|
||||
PartitionList->FormatState = FormatInstallPartition;
|
||||
DPRINT1("FormatState: FormatSystemPartition --> FormatInstallPartition\n");
|
||||
break;
|
||||
|
||||
case FormatInstallPartition:
|
||||
if (GetNextUnformattedPartition(PartitionList,
|
||||
&PartitionList->TempDisk,
|
||||
&PartitionList->TempPartition))
|
||||
{
|
||||
PartitionList->FormatState = FormatOtherPartition;
|
||||
PartitionList->TempPartition->NeedsCheck = TRUE;
|
||||
DPRINT1("FormatState: FormatInstallPartition --> FormatOtherPartition\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
PartitionList->FormatState = FormatDone;
|
||||
DPRINT1("FormatState: FormatInstallPartition --> FormatDone\n");
|
||||
return CHECK_FILE_SYSTEM_PAGE;
|
||||
}
|
||||
break;
|
||||
|
||||
case FormatOtherPartition:
|
||||
if (GetNextUnformattedPartition(PartitionList,
|
||||
&PartitionList->TempDisk,
|
||||
&PartitionList->TempPartition))
|
||||
{
|
||||
PartitionList->FormatState = FormatOtherPartition;
|
||||
PartitionList->TempPartition->NeedsCheck = TRUE;
|
||||
DPRINT1("FormatState: FormatOtherPartition --> FormatOtherPartition\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
PartitionList->FormatState = FormatDone;
|
||||
DPRINT1("FormatState: FormatOtherPartition --> FormatDone\n");
|
||||
return CHECK_FILE_SYSTEM_PAGE;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
DPRINT1("FormatState: Invalid value %ld\n", PartitionList->FormatState);
|
||||
/* FIXME: show an error dialog */
|
||||
return QUIT_PAGE;
|
||||
}
|
||||
|
||||
DiskEntry = PartitionList->TempDisk;
|
||||
PartEntry = PartitionList->TempPartition;
|
||||
|
||||
/* adjust disk size */
|
||||
DiskSize = DiskEntry->SectorCount.QuadPart * DiskEntry->BytesPerSector;
|
||||
|
@ -2513,7 +2597,24 @@ SelectFileSystemPage(PINPUT_RECORD Ir)
|
|||
}
|
||||
else if (PartEntry->New == TRUE)
|
||||
{
|
||||
CONSOLE_SetTextXY(6, 8, MUIGetString(STRING_NONFORMATTEDPART));
|
||||
switch (PartitionList->FormatState)
|
||||
{
|
||||
case FormatSystemPartition:
|
||||
CONSOLE_SetTextXY(6, 8, MUIGetString(STRING_NONFORMATTEDSYSTEMPART));
|
||||
break;
|
||||
|
||||
case FormatInstallPartition:
|
||||
CONSOLE_SetTextXY(6, 8, MUIGetString(STRING_NONFORMATTEDPART));
|
||||
break;
|
||||
|
||||
case FormatOtherPartition:
|
||||
CONSOLE_SetTextXY(6, 8, MUIGetString(STRING_NONFORMATTEDOTHERPART));
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
CONSOLE_SetTextXY(6, 10, MUIGetString(STRING_PARTFORMAT));
|
||||
}
|
||||
else
|
||||
|
@ -2577,6 +2678,8 @@ SelectFileSystemPage(PINPUT_RECORD Ir)
|
|||
{
|
||||
if (UnattendFormatPartition)
|
||||
{
|
||||
PartEntry->FileSystem = GetFileSystemByName(FileSystemList,
|
||||
L"FAT");
|
||||
return FORMAT_PARTITION_PAGE;
|
||||
}
|
||||
|
||||
|
@ -2616,10 +2719,11 @@ SelectFileSystemPage(PINPUT_RECORD Ir)
|
|||
{
|
||||
if (!FileSystemList->Selected->FormatFunc)
|
||||
{
|
||||
return CHECK_FILE_SYSTEM_PAGE;
|
||||
return SELECT_FILE_SYSTEM_PAGE;
|
||||
}
|
||||
else
|
||||
{
|
||||
PartEntry->FileSystem = FileSystemList->Selected;
|
||||
return FORMAT_PARTITION_PAGE;
|
||||
}
|
||||
}
|
||||
|
@ -2632,6 +2736,7 @@ SelectFileSystemPage(PINPUT_RECORD Ir)
|
|||
static ULONG
|
||||
FormatPartitionPage(PINPUT_RECORD Ir)
|
||||
{
|
||||
UNICODE_STRING PartitionRootPath;
|
||||
WCHAR PathBuffer[MAX_PATH];
|
||||
PDISKENTRY DiskEntry;
|
||||
PPARTENTRY PartEntry;
|
||||
|
@ -2643,18 +2748,20 @@ FormatPartitionPage(PINPUT_RECORD Ir)
|
|||
PLIST_ENTRY Entry;
|
||||
#endif
|
||||
|
||||
DPRINT("FormatPartitionPage()\n");
|
||||
|
||||
MUIDisplayPage(FORMAT_PARTITION_PAGE);
|
||||
|
||||
if (PartitionList == NULL ||
|
||||
PartitionList->CurrentDisk == NULL ||
|
||||
PartitionList->CurrentPartition == NULL)
|
||||
PartitionList->TempDisk == NULL ||
|
||||
PartitionList->TempPartition == NULL)
|
||||
{
|
||||
/* FIXME: show an error dialog */
|
||||
return QUIT_PAGE;
|
||||
}
|
||||
|
||||
DiskEntry = PartitionList->CurrentDisk;
|
||||
PartEntry = PartitionList->CurrentPartition;
|
||||
DiskEntry = PartitionList->TempDisk;
|
||||
PartEntry = PartitionList->TempPartition;
|
||||
|
||||
while (TRUE)
|
||||
{
|
||||
|
@ -2677,7 +2784,7 @@ FormatPartitionPage(PINPUT_RECORD Ir)
|
|||
{
|
||||
CONSOLE_SetStatusText(MUIGetString(STRING_PLEASEWAIT));
|
||||
|
||||
if (wcscmp(FileSystemList->Selected->FileSystem, L"FAT") == 0)
|
||||
if (wcscmp(PartEntry->FileSystem->FileSystemName, L"FAT") == 0)
|
||||
{
|
||||
if (PartEntry->SectorCount.QuadPart < 8192)
|
||||
{
|
||||
|
@ -2720,17 +2827,24 @@ FormatPartitionPage(PINPUT_RECORD Ir)
|
|||
}
|
||||
}
|
||||
|
||||
DiskEntry->Dirty = TRUE;
|
||||
DiskEntry->LayoutBuffer->PartitionEntry[PartEntry->PartitionIndex].PartitionType = PartEntry->PartitionType;
|
||||
DiskEntry->LayoutBuffer->PartitionEntry[PartEntry->PartitionIndex].RewritePartition = TRUE;
|
||||
}
|
||||
#if 0
|
||||
else if (wcscmp(FileSystemList->Selected->FileSystem, L"EXT2") == 0)
|
||||
else if (wcscmp(PartEntry->FileSystem->FileSystemName, L"EXT2") == 0)
|
||||
{
|
||||
PartEntry->PartitionType = PARTITION_EXT2;
|
||||
|
||||
DiskEntry->Dirty = TRUE;
|
||||
DiskEntry->LayoutBuffer->PartitionEntry[PartEntry->PartitionIndex].PartitionType = PartEntry->PartitionType;
|
||||
DiskEntry->LayoutBuffer->PartitionEntry[PartEntry->PartitionIndex].RewritePartition = TRUE;
|
||||
}
|
||||
#endif
|
||||
else if (!FileSystemList->Selected->FormatFunc)
|
||||
else if (!PartEntry->FileSystem->FormatFunc)
|
||||
{
|
||||
return QUIT_PAGE;
|
||||
}
|
||||
|
||||
#ifndef NDEBUG
|
||||
CONSOLE_PrintTextXY(6, 12,
|
||||
|
@ -2740,7 +2854,7 @@ FormatPartitionPage(PINPUT_RECORD Ir)
|
|||
DiskEntry->TrackSize);
|
||||
|
||||
Line = 13;
|
||||
DiskEntry = PartitionList->CurrentDisk;
|
||||
DiskEntry = PartitionList->TempDisk;
|
||||
Entry = DiskEntry->PartListHead.Flink;
|
||||
|
||||
while (Entry != &DiskEntry->PrimaryPartListHead)
|
||||
|
@ -2765,11 +2879,9 @@ FormatPartitionPage(PINPUT_RECORD Ir)
|
|||
}
|
||||
|
||||
/* Restore the old entry */
|
||||
PartEntry = PartitionList->CurrentPartition;
|
||||
PartEntry = PartitionList->TempPartition;
|
||||
#endif
|
||||
|
||||
CheckActiveBootPartition(PartitionList);
|
||||
|
||||
if (WritePartitionsToDisk(PartitionList) == FALSE)
|
||||
{
|
||||
DPRINT("WritePartitionsToDisk() failed\n");
|
||||
|
@ -2777,20 +2889,19 @@ FormatPartitionPage(PINPUT_RECORD Ir)
|
|||
return QUIT_PAGE;
|
||||
}
|
||||
|
||||
/* Set DestinationRootPath */
|
||||
RtlFreeUnicodeString(&DestinationRootPath);
|
||||
/* Set PartitionRootPath */
|
||||
swprintf(PathBuffer,
|
||||
L"\\Device\\Harddisk%lu\\Partition%lu",
|
||||
PartitionList->CurrentDisk->DiskNumber,
|
||||
PartitionList->CurrentPartition->PartitionNumber);
|
||||
RtlCreateUnicodeString(&DestinationRootPath,
|
||||
PathBuffer);
|
||||
DPRINT("DestinationRootPath: %wZ\n", &DestinationRootPath);
|
||||
DiskEntry->DiskNumber,
|
||||
PartEntry->PartitionNumber);
|
||||
RtlInitUnicodeString(&PartitionRootPath,
|
||||
PathBuffer);
|
||||
DPRINT("PartitionRootPath: %wZ\n", &PartitionRootPath);
|
||||
|
||||
if (FileSystemList->Selected->FormatFunc)
|
||||
if (PartEntry->FileSystem->FormatFunc)
|
||||
{
|
||||
Status = FormatPartition(&DestinationRootPath,
|
||||
FileSystemList->Selected);
|
||||
Status = FormatPartition(&PartitionRootPath,
|
||||
PartEntry->FileSystem);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
DPRINT1("FormatPartition() failed with status 0x%08lx\n", Status);
|
||||
|
@ -2799,7 +2910,6 @@ FormatPartitionPage(PINPUT_RECORD Ir)
|
|||
}
|
||||
|
||||
PartEntry->New = FALSE;
|
||||
|
||||
}
|
||||
|
||||
#ifndef NDEBUG
|
||||
|
@ -2807,9 +2917,7 @@ FormatPartitionPage(PINPUT_RECORD Ir)
|
|||
CONSOLE_ConInKey(Ir);
|
||||
#endif
|
||||
|
||||
DestroyFileSystemList(FileSystemList);
|
||||
FileSystemList = NULL;
|
||||
return INSTALL_DIRECTORY_PAGE;
|
||||
return SELECT_FILE_SYSTEM_PAGE;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2821,35 +2929,76 @@ static ULONG
|
|||
CheckFileSystemPage(PINPUT_RECORD Ir)
|
||||
{
|
||||
PFILE_SYSTEM_ITEM CurrentFileSystem;
|
||||
UNICODE_STRING PartitionRootPath;
|
||||
WCHAR PathBuffer[MAX_PATH];
|
||||
CHAR Buffer[MAX_PATH];
|
||||
LPWSTR FileSystemName = NULL;
|
||||
PDISKENTRY DiskEntry;
|
||||
PPARTENTRY PartEntry;
|
||||
NTSTATUS Status;
|
||||
|
||||
/* FIXME: code duplicated in FormatPartitionPage */
|
||||
/* Set DestinationRootPath */
|
||||
RtlFreeUnicodeString(&DestinationRootPath);
|
||||
if (PartitionList == NULL)
|
||||
{
|
||||
/* FIXME: show an error dialog */
|
||||
return QUIT_PAGE;
|
||||
}
|
||||
|
||||
if (!GetNextUncheckedPartition(PartitionList,
|
||||
&DiskEntry,
|
||||
&PartEntry))
|
||||
{
|
||||
return INSTALL_DIRECTORY_PAGE;
|
||||
}
|
||||
|
||||
/* Set PartitionRootPath */
|
||||
swprintf(PathBuffer,
|
||||
L"\\Device\\Harddisk%lu\\Partition%lu",
|
||||
PartitionList->CurrentDisk->DiskNumber,
|
||||
PartitionList->CurrentPartition->PartitionNumber);
|
||||
RtlCreateUnicodeString(&DestinationRootPath, PathBuffer);
|
||||
DPRINT("DestinationRootPath: %wZ\n", &DestinationRootPath);
|
||||
DiskEntry->DiskNumber,
|
||||
PartEntry->PartitionNumber);
|
||||
RtlInitUnicodeString(&PartitionRootPath, PathBuffer);
|
||||
DPRINT("PartitionRootPath: %wZ\n", &PartitionRootPath);
|
||||
|
||||
CONSOLE_SetTextXY(6, 8, MUIGetString(STRING_CHECKINGPART));
|
||||
|
||||
CONSOLE_SetStatusText(MUIGetString(STRING_PLEASEWAIT));
|
||||
|
||||
/* WRONG: first filesystem is not necesseraly the one of the current partition! */
|
||||
CurrentFileSystem = CONTAINING_RECORD(FileSystemList->ListHead.Flink, FILE_SYSTEM_ITEM, ListEntry);
|
||||
CurrentFileSystem = PartEntry->FileSystem;
|
||||
if (CurrentFileSystem->FileSystemName == NULL)
|
||||
{
|
||||
if ((PartEntry->PartitionType == PARTITION_FAT_12) ||
|
||||
(PartEntry->PartitionType == PARTITION_FAT_16) ||
|
||||
(PartEntry->PartitionType == PARTITION_HUGE) ||
|
||||
(PartEntry->PartitionType == PARTITION_XINT13))
|
||||
{
|
||||
FileSystemName = L"FAT";
|
||||
}
|
||||
else if ((PartEntry->PartitionType == PARTITION_FAT32) ||
|
||||
(PartEntry->PartitionType == PARTITION_FAT32_XINT13))
|
||||
{
|
||||
FileSystemName = L"FAT32";
|
||||
}
|
||||
else if (PartEntry->PartitionType == PARTITION_EXT2)
|
||||
{
|
||||
FileSystemName = L"EXT2";
|
||||
}
|
||||
else if (PartEntry->PartitionType == PARTITION_IFS)
|
||||
{
|
||||
FileSystemName = L"NTFS"; /* FIXME: Not quite correct! */
|
||||
}
|
||||
|
||||
if (!CurrentFileSystem->ChkdskFunc)
|
||||
if (FileSystemName != NULL)
|
||||
CurrentFileSystem = GetFileSystemByName(FileSystemList,
|
||||
FileSystemName);
|
||||
}
|
||||
|
||||
if (CurrentFileSystem == NULL || CurrentFileSystem->ChkdskFunc == NULL)
|
||||
{
|
||||
sprintf(Buffer,
|
||||
"Setup is currently unable to check a partition formatted in %S.\n"
|
||||
"\n"
|
||||
" \x07 Press ENTER to continue Setup.\n"
|
||||
" \x07 Press F3 to quit Setup.",
|
||||
CurrentFileSystem->FileSystem);
|
||||
CurrentFileSystem->FileSystemName);
|
||||
|
||||
PopupError(Buffer,
|
||||
MUIGetString(STRING_QUITCONTINUE),
|
||||
|
@ -2869,13 +3018,14 @@ CheckFileSystemPage(PINPUT_RECORD Ir)
|
|||
}
|
||||
else if (Ir->Event.KeyEvent.uChar.AsciiChar == VK_RETURN) /* ENTER */
|
||||
{
|
||||
return INSTALL_DIRECTORY_PAGE;
|
||||
PartEntry->NeedsCheck = FALSE;
|
||||
return CHECK_FILE_SYSTEM_PAGE;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Status = ChkdskPartition(&DestinationRootPath, CurrentFileSystem);
|
||||
Status = ChkdskPartition(&PartitionRootPath, CurrentFileSystem);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
DPRINT("ChkdskPartition() failed with status 0x%08lx\n", Status);
|
||||
|
@ -2889,7 +3039,8 @@ CheckFileSystemPage(PINPUT_RECORD Ir)
|
|||
return QUIT_PAGE;
|
||||
}
|
||||
|
||||
return INSTALL_DIRECTORY_PAGE;
|
||||
PartEntry->NeedsCheck = FALSE;
|
||||
return CHECK_FILE_SYSTEM_PAGE;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2906,6 +3057,15 @@ InstallDirectoryPage1(PWCHAR InstallDir,
|
|||
RtlCreateUnicodeString(&InstallPath,
|
||||
InstallDir);
|
||||
|
||||
/* Create 'DestinationRootPath' string */
|
||||
RtlFreeUnicodeString(&DestinationRootPath);
|
||||
swprintf(PathBuffer,
|
||||
L"\\Device\\Harddisk%lu\\Partition%lu",
|
||||
DiskEntry->DiskNumber,
|
||||
PartEntry->PartitionNumber);
|
||||
RtlCreateUnicodeString(&DestinationRootPath, PathBuffer);
|
||||
DPRINT("DestinationRootPath: %wZ\n", &DestinationRootPath);
|
||||
|
||||
/* Create 'DestinationPath' string */
|
||||
RtlFreeUnicodeString(&DestinationPath);
|
||||
wcscpy(PathBuffer, DestinationRootPath.Buffer);
|
||||
|
@ -2941,6 +3101,10 @@ InstallDirectoryPage(PINPUT_RECORD Ir)
|
|||
WCHAR InstallDir[51];
|
||||
ULONG Length;
|
||||
|
||||
/* We do not need the filsystem list any more */
|
||||
DestroyFileSystemList(FileSystemList);
|
||||
FileSystemList = NULL;
|
||||
|
||||
if (PartitionList == NULL ||
|
||||
PartitionList->CurrentDisk == NULL ||
|
||||
PartitionList->CurrentPartition == NULL)
|
||||
|
@ -3760,27 +3924,16 @@ BootLoaderPage(PINPUT_RECORD Ir)
|
|||
|
||||
CONSOLE_SetStatusText(MUIGetString(STRING_PLEASEWAIT));
|
||||
|
||||
/* Find or set the active partition */
|
||||
CheckActiveBootPartition(PartitionList);
|
||||
|
||||
/* Update the partition table because we may have changed the active partition */
|
||||
if (WritePartitionsToDisk(PartitionList) == FALSE)
|
||||
{
|
||||
DPRINT("WritePartitionsToDisk() failed\n");
|
||||
MUIDisplayError(ERROR_WRITE_PTABLE, Ir, POPUP_WAIT_ENTER);
|
||||
return QUIT_PAGE;
|
||||
}
|
||||
|
||||
RtlFreeUnicodeString(&SystemRootPath);
|
||||
swprintf(PathBuffer,
|
||||
L"\\Device\\Harddisk%lu\\Partition%lu",
|
||||
PartitionList->ActiveBootDisk->DiskNumber,
|
||||
PartitionList->ActiveBootPartition->PartitionNumber);
|
||||
PartitionList->BootDisk->DiskNumber,
|
||||
PartitionList->BootPartition->PartitionNumber);
|
||||
RtlCreateUnicodeString(&SystemRootPath,
|
||||
PathBuffer);
|
||||
DPRINT("SystemRootPath: %wZ\n", &SystemRootPath);
|
||||
|
||||
PartitionType = PartitionList->ActiveBootPartition->PartitionType;
|
||||
PartitionType = PartitionList->BootPartition->PartitionType;
|
||||
|
||||
if (IsUnattendedSetup)
|
||||
{
|
||||
|
@ -3958,13 +4111,14 @@ BootLoaderFloppyPage(PINPUT_RECORD Ir)
|
|||
return BOOT_LOADER_FLOPPY_PAGE;
|
||||
}
|
||||
|
||||
|
||||
static PAGE_NUMBER
|
||||
BootLoaderHarddiskVbrPage(PINPUT_RECORD Ir)
|
||||
{
|
||||
UCHAR PartitionType;
|
||||
NTSTATUS Status;
|
||||
|
||||
PartitionType = PartitionList->ActiveBootPartition->PartitionType;
|
||||
PartitionType = PartitionList->BootPartition->PartitionType;
|
||||
|
||||
Status = InstallVBRToPartition(&SystemRootPath,
|
||||
&SourceRootPath,
|
||||
|
@ -3979,6 +4133,7 @@ BootLoaderHarddiskVbrPage(PINPUT_RECORD Ir)
|
|||
return SUCCESS_PAGE;
|
||||
}
|
||||
|
||||
|
||||
static PAGE_NUMBER
|
||||
BootLoaderHarddiskMbrPage(PINPUT_RECORD Ir)
|
||||
{
|
||||
|
@ -3988,7 +4143,7 @@ BootLoaderHarddiskMbrPage(PINPUT_RECORD Ir)
|
|||
WCHAR SourceMbrPathBuffer[MAX_PATH];
|
||||
|
||||
/* Step 1: Write the VBR */
|
||||
PartitionType = PartitionList->ActiveBootPartition->PartitionType;
|
||||
PartitionType = PartitionList->BootPartition->PartitionType;
|
||||
|
||||
Status = InstallVBRToPartition(&SystemRootPath,
|
||||
&SourceRootPath,
|
||||
|
@ -4003,7 +4158,7 @@ BootLoaderHarddiskMbrPage(PINPUT_RECORD Ir)
|
|||
/* Step 2: Write the MBR */
|
||||
swprintf(DestinationDevicePathBuffer,
|
||||
L"\\Device\\Harddisk%d\\Partition0",
|
||||
PartitionList->ActiveBootDisk->DiskNumber);
|
||||
PartitionList->BootDisk->DiskNumber);
|
||||
|
||||
wcscpy(SourceMbrPathBuffer, SourceRootPath.Buffer);
|
||||
wcscat(SourceMbrPathBuffer, L"\\loader\\dosmbr.bin");
|
||||
|
|
|
@ -1669,6 +1669,10 @@ MUI_STRING bgBGStrings[] =
|
|||
"<EFBFBD>।á⮨ ä®à¬ â¨à ¥ ¤ï« ."},
|
||||
{STRING_NONFORMATTEDPART,
|
||||
"ˆ§¡à «¨ á⥠¤ á«®¦¨â¥ <20>¥ ªâŽ‘ ®¢ ¨«¨ ¥à §¯à¥¤¥«¥ ¤ï«."},
|
||||
{STRING_NONFORMATTEDSYSTEMPART,
|
||||
"The system partition is not formatted yet."},
|
||||
{STRING_NONFORMATTEDOTHERPART,
|
||||
"The new partition is not formatted yet."},
|
||||
{STRING_INSTALLONPART,
|
||||
"‘« £ ¥ <20>¥ ªâŽ‘ ¢êàåã ¤ï«"},
|
||||
{STRING_CHECKINGPART,
|
||||
|
|
|
@ -1653,6 +1653,10 @@ MUI_STRING bnBDStrings[] =
|
|||
"This Partition will be formatted next."},
|
||||
{STRING_NONFORMATTEDPART,
|
||||
"You chose to install ReactOS on a new or unformatted Partition."},
|
||||
{STRING_NONFORMATTEDSYSTEMPART,
|
||||
"The system partition is not formatted yet."},
|
||||
{STRING_NONFORMATTEDOTHERPART,
|
||||
"The new partition is not formatted yet."},
|
||||
{STRING_INSTALLONPART,
|
||||
"Setup installs ReactOS onto Partition"},
|
||||
{STRING_CHECKINGPART,
|
||||
|
|
|
@ -1662,6 +1662,10 @@ MUI_STRING csCZStrings[] =
|
|||
"Tento oddĄl bude zform tov n."},
|
||||
{STRING_NONFORMATTEDPART,
|
||||
"Zvolili jste instalaci ReactOS na nově nebo nezform tovaně oddĄl."},
|
||||
{STRING_NONFORMATTEDSYSTEMPART,
|
||||
"The system partition is not formatted yet."},
|
||||
{STRING_NONFORMATTEDOTHERPART,
|
||||
"The new partition is not formatted yet."},
|
||||
{STRING_INSTALLONPART,
|
||||
"Instalace nakopĄruje ReactOS na oddĄl"},
|
||||
{STRING_CHECKINGPART,
|
||||
|
|
|
@ -1658,6 +1658,10 @@ MUI_STRING deDEStrings[] =
|
|||
"Diese Partition wird als n„chstes formatiert."},
|
||||
{STRING_NONFORMATTEDPART,
|
||||
"Sie wollen ReactOS auf einer neuen/unformatierten Partition installieren."},
|
||||
{STRING_NONFORMATTEDSYSTEMPART,
|
||||
"The system partition is not formatted yet."},
|
||||
{STRING_NONFORMATTEDOTHERPART,
|
||||
"The new partition is not formatted yet."},
|
||||
{STRING_INSTALLONPART,
|
||||
"ReactOS wird auf dieser Partition installiert."},
|
||||
{STRING_CHECKINGPART,
|
||||
|
|
|
@ -1679,6 +1679,10 @@ MUI_STRING elGRStrings[] =
|
|||
"€¬«æ «¦ Partition Ÿ˜ › ˜£¦¨àŸœå £œ«á."},
|
||||
{STRING_NONFORMATTEDPART,
|
||||
"„§ ¢â¥˜«œ ¤˜ œš¡˜«˜©«ã©œ«œ «¦ ReactOS ©œ ⤘ ¤â¦ ã £ž › ˜£¦¨à£â¤¦ Partition."},
|
||||
{STRING_NONFORMATTEDSYSTEMPART,
|
||||
"The system partition is not formatted yet."},
|
||||
{STRING_NONFORMATTEDOTHERPART,
|
||||
"The new partition is not formatted yet."},
|
||||
{STRING_INSTALLONPART,
|
||||
"Setup install ReactOS onto Partition"},
|
||||
{STRING_CHECKINGPART,
|
||||
|
|
|
@ -1653,6 +1653,10 @@ MUI_STRING enUSStrings[] =
|
|||
"This Partition will be formatted next."},
|
||||
{STRING_NONFORMATTEDPART,
|
||||
"You chose to install ReactOS on a new or unformatted Partition."},
|
||||
{STRING_NONFORMATTEDSYSTEMPART,
|
||||
"The system partition is not formatted yet."},
|
||||
{STRING_NONFORMATTEDOTHERPART,
|
||||
"The new partition is not formatted yet."},
|
||||
{STRING_INSTALLONPART,
|
||||
"Setup installs ReactOS onto Partition"},
|
||||
{STRING_CHECKINGPART,
|
||||
|
|
|
@ -1661,6 +1661,10 @@ MUI_STRING esESStrings[] =
|
|||
"A continuaci¢n se formatear esta partici¢n."},
|
||||
{STRING_NONFORMATTEDPART,
|
||||
"Ha elegido instalar ReactOS en una nueva partici¢n o en una partici¢n sin formato."},
|
||||
{STRING_NONFORMATTEDSYSTEMPART,
|
||||
"The system partition is not formatted yet."},
|
||||
{STRING_NONFORMATTEDOTHERPART,
|
||||
"The new partition is not formatted yet."},
|
||||
{STRING_INSTALLONPART,
|
||||
"El instalador est instalando ReactOS en la partici¢n"},
|
||||
{STRING_CHECKINGPART,
|
||||
|
|
|
@ -1654,6 +1654,10 @@ MUI_STRING etEEStrings[] =
|
|||
"J„rgmisena vormindatakse seda partitsiooni."},
|
||||
{STRING_NONFORMATTEDPART,
|
||||
"Oled valinud ReactOSi paigaldamise uuele väi vormindamata partitsioonile."},
|
||||
{STRING_NONFORMATTEDSYSTEMPART,
|
||||
"The system partition is not formatted yet."},
|
||||
{STRING_NONFORMATTEDOTHERPART,
|
||||
"The new partition is not formatted yet."},
|
||||
{STRING_INSTALLONPART,
|
||||
"ReactOS paigaldatakse partitsioonile"},
|
||||
{STRING_CHECKINGPART,
|
||||
|
|
|
@ -1667,6 +1667,10 @@ MUI_STRING frFRStrings[] =
|
|||
"Cette Partition sera ensuite format‚e."},
|
||||
{STRING_NONFORMATTEDPART,
|
||||
"Vous avez choisi d'installer ReactOS sur une nouvelle partition."},
|
||||
{STRING_NONFORMATTEDSYSTEMPART,
|
||||
"The system partition is not formatted yet."},
|
||||
{STRING_NONFORMATTEDOTHERPART,
|
||||
"The new partition is not formatted yet."},
|
||||
{STRING_INSTALLONPART,
|
||||
"Setup installe ReactOS sur la partition"},
|
||||
{STRING_CHECKINGPART,
|
||||
|
|
|
@ -1655,6 +1655,10 @@ MUI_STRING heILStrings[] =
|
|||
"This Partition will be formatted next."},
|
||||
{STRING_NONFORMATTEDPART,
|
||||
"You chose to install ReactOS on a new or unformatted Partition."},
|
||||
{STRING_NONFORMATTEDSYSTEMPART,
|
||||
"The system partition is not formatted yet."},
|
||||
{STRING_NONFORMATTEDOTHERPART,
|
||||
"The new partition is not formatted yet."},
|
||||
{STRING_INSTALLONPART,
|
||||
"Setup installs ReactOS onto Partition"},
|
||||
{STRING_CHECKINGPART,
|
||||
|
|
|
@ -1658,6 +1658,10 @@ MUI_STRING itITStrings[] =
|
|||
"Questa partizione sar… formattata successivamente."},
|
||||
{STRING_NONFORMATTEDPART,
|
||||
"Avete scelto di installare ReactOS su una partizione nuova o non formattata."},
|
||||
{STRING_NONFORMATTEDSYSTEMPART,
|
||||
"The system partition is not formatted yet."},
|
||||
{STRING_NONFORMATTEDOTHERPART,
|
||||
"The new partition is not formatted yet."},
|
||||
{STRING_INSTALLONPART,
|
||||
"Setup installer… ReactOS sulla partitione"},
|
||||
{STRING_CHECKINGPART,
|
||||
|
|
|
@ -1657,6 +1657,10 @@ MUI_STRING jaJPStrings[] =
|
|||
"ºÉ Ê߰è¼®ÝÊ Â·ÞÉ Ã¼ÞÝÃÞ Ì«°Ï¯Ä »ÚϽ¡"},
|
||||
{STRING_NONFORMATTEDPART,
|
||||
"ReactOS¦ ¼Ý· ÏÀÊ ÐÌ«°Ï¯ÄÉ Ê߰è¼®ÝÆ ²Ý½Ä°Ù½Ù ºÄ¶Þ ¾ÝÀ¸ »ÚϼÀ¡"},
|
||||
{STRING_NONFORMATTEDSYSTEMPART,
|
||||
"The system partition is not formatted yet."},
|
||||
{STRING_NONFORMATTEDOTHERPART,
|
||||
"The new partition is not formatted yet."},
|
||||
{STRING_INSTALLONPART,
|
||||
"¾¯Ä±¯ÌßÊ ReactOS¦ Ê߰è¼®Ý ¼Þ®³Æ ²Ý½Ä°Ù¼Ï½¡"},
|
||||
{STRING_CHECKINGPART,
|
||||
|
|
|
@ -1664,6 +1664,10 @@ MUI_STRING ltLTStrings[] =
|
|||
"This Partition will be formatted next."},
|
||||
{STRING_NONFORMATTEDPART,
|
||||
"You chose to install ReactOS on a new or unformatted Partition."},
|
||||
{STRING_NONFORMATTEDSYSTEMPART,
|
||||
"The system partition is not formatted yet."},
|
||||
{STRING_NONFORMATTEDOTHERPART,
|
||||
"The new partition is not formatted yet."},
|
||||
{STRING_INSTALLONPART,
|
||||
"Setup installs ReactOS onto Partition"},
|
||||
{STRING_CHECKINGPART,
|
||||
|
|
|
@ -1702,6 +1702,10 @@ MUI_STRING nlNLStrings[] =
|
|||
"Deze partitie zal vervolgens geformatteerd worden."},
|
||||
{STRING_NONFORMATTEDPART,
|
||||
"U wilt ReactOS installeren op een nieuwe of ongeformatteerde partitie."},
|
||||
{STRING_NONFORMATTEDSYSTEMPART,
|
||||
"The system partition is not formatted yet."},
|
||||
{STRING_NONFORMATTEDOTHERPART,
|
||||
"The new partition is not formatted yet."},
|
||||
{STRING_INSTALLONPART,
|
||||
"Setup installeert ReactOS op Partitie"},
|
||||
{STRING_CHECKINGPART,
|
||||
|
|
|
@ -1664,6 +1664,10 @@ MUI_STRING plPLStrings[] =
|
|||
"Nast©pujĄca partycja zostanie sformatowana."},
|
||||
{STRING_NONFORMATTEDPART,
|
||||
"Moľesz zainstalowa† ReactOS na nowej lub niesformatowanej partycji."},
|
||||
{STRING_NONFORMATTEDSYSTEMPART,
|
||||
"The system partition is not formatted yet."},
|
||||
{STRING_NONFORMATTEDOTHERPART,
|
||||
"The new partition is not formatted yet."},
|
||||
{STRING_INSTALLONPART,
|
||||
"Instalator kopiuje pliki systemu na wybranĄ partycj©."},
|
||||
{STRING_CHECKINGPART,
|
||||
|
|
|
@ -1693,6 +1693,10 @@ MUI_STRING ptBRStrings[] =
|
|||
"Esta parti‡Æo ser formatada logo em seguida."},
|
||||
{STRING_NONFORMATTEDPART,
|
||||
"Vocˆ solicitou instalar o ReactOS em uma parti‡Æo nova ou sem formato."},
|
||||
{STRING_NONFORMATTEDSYSTEMPART,
|
||||
"The system partition is not formatted yet."},
|
||||
{STRING_NONFORMATTEDOTHERPART,
|
||||
"The new partition is not formatted yet."},
|
||||
{STRING_INSTALLONPART,
|
||||
"O instalador instala o ReactOS na parti‡Æo"},
|
||||
{STRING_CHECKINGPART,
|
||||
|
|
|
@ -1730,6 +1730,10 @@ MUI_STRING roROStrings[] =
|
|||
"AceastÇ partiîie urmeazÇ sÇ fie formatatÇ."},
|
||||
{STRING_NONFORMATTEDPART,
|
||||
"Alegeîi sÇ instalaîi ReactOS pe partiîie nouÇ sau neformatatÇ."},
|
||||
{STRING_NONFORMATTEDSYSTEMPART,
|
||||
"The system partition is not formatted yet."},
|
||||
{STRING_NONFORMATTEDOTHERPART,
|
||||
"The new partition is not formatted yet."},
|
||||
{STRING_INSTALLONPART,
|
||||
"ReactOS va fi instalat pe partiîia"},
|
||||
{STRING_CHECKINGPART,
|
||||
|
|
|
@ -1655,6 +1655,10 @@ MUI_STRING ruRUStrings[] =
|
|||
"<EFBFBD>â®â à §¤¥« ¡ã¤¥â ®âä®à¬ â¨à®¢ ¤ «¥¥."},
|
||||
{STRING_NONFORMATTEDPART,
|
||||
"‚ë ¢ë¡à «¨ ãáâ ®¢ªã ReactOS ®¢ë© ¥®âä®à¬ â¨à®¢ ë© à §¤¥«."},
|
||||
{STRING_NONFORMATTEDSYSTEMPART,
|
||||
"The system partition is not formatted yet."},
|
||||
{STRING_NONFORMATTEDOTHERPART,
|
||||
"The new partition is not formatted yet."},
|
||||
{STRING_INSTALLONPART,
|
||||
"ReactOS ãáâ ¢«¨¢ ¥âáï à §¤¥«:"},
|
||||
{STRING_CHECKINGPART,
|
||||
|
|
|
@ -1668,6 +1668,10 @@ MUI_STRING skSKStrings[] =
|
|||
"T to oblasœ sa bude form tovaœ ako Ôalçia."},
|
||||
{STRING_NONFORMATTEDPART,
|
||||
"Zvolili ste inçtal ciu syst‚mu ReactOS na nov£ alebo nenaform tovan£ oblasœ."},
|
||||
{STRING_NONFORMATTEDSYSTEMPART,
|
||||
"The system partition is not formatted yet."},
|
||||
{STRING_NONFORMATTEDOTHERPART,
|
||||
"The new partition is not formatted yet."},
|
||||
{STRING_INSTALLONPART,
|
||||
"Inçtal tor nainçtaluje syst‚m ReactOS na oblasœ"},
|
||||
{STRING_CHECKINGPART,
|
||||
|
|
|
@ -1660,6 +1660,10 @@ MUI_STRING sqALStrings[] =
|
|||
"Ky particion do t‰ formatohet tani."},
|
||||
{STRING_NONFORMATTEDPART,
|
||||
"Ju zgjodh‰t ReactOS p‰r tu instaluar n‰ nj‰ particion t'ri t‰ paformatuar."},
|
||||
{STRING_NONFORMATTEDSYSTEMPART,
|
||||
"The system partition is not formatted yet."},
|
||||
{STRING_NONFORMATTEDOTHERPART,
|
||||
"The new partition is not formatted yet."},
|
||||
{STRING_INSTALLONPART,
|
||||
"Instalimi i ReactOS ne Particion"},
|
||||
{STRING_CHECKINGPART,
|
||||
|
|
|
@ -1663,6 +1663,10 @@ MUI_STRING svSEStrings[] =
|
|||
"Denna Partition kommer att bli formaterad h„rn„st."},
|
||||
{STRING_NONFORMATTEDPART,
|
||||
"Du valde att installera ReactOS p† en oformaterad partition."},
|
||||
{STRING_NONFORMATTEDSYSTEMPART,
|
||||
"The system partition is not formatted yet."},
|
||||
{STRING_NONFORMATTEDOTHERPART,
|
||||
"The new partition is not formatted yet."},
|
||||
{STRING_INSTALLONPART,
|
||||
"Setup installerar ReactOS till Partitionen"},
|
||||
{STRING_CHECKINGPART,
|
||||
|
|
|
@ -1641,6 +1641,10 @@ MUI_STRING trTRStrings[] =
|
|||
"Bu b”l<E2809D>m ileride bi‡imlendirilecektir."},
|
||||
{STRING_NONFORMATTEDPART,
|
||||
"ReactOS'u yeni ya da bi‡imlendirilmemiŸ bir b”l<E2809D>me kurmay<61> se‡tiniz."},
|
||||
{STRING_NONFORMATTEDSYSTEMPART,
|
||||
"The system partition is not formatted yet."},
|
||||
{STRING_NONFORMATTEDOTHERPART,
|
||||
"The new partition is not formatted yet."},
|
||||
{STRING_INSTALLONPART,
|
||||
"Kur, ReactOS'u b”l<E2809D>m <20>zerine kurar."},
|
||||
{STRING_CHECKINGPART,
|
||||
|
|
|
@ -1663,6 +1663,10 @@ MUI_STRING ukUAStrings[] =
|
|||
"–¥© ஧¤i« ¡ã¤¥ ¢i¤ä®à¬ ⮢ ®."},
|
||||
{STRING_NONFORMATTEDPART,
|
||||
"‚¨ ¢¨¡à «¨ ¢áâ ®¢«¥ï ReactOS ®¢¨© ¡® ¥ä®à¬ ⮢ ¨© ஧¤i«."},
|
||||
{STRING_NONFORMATTEDSYSTEMPART,
|
||||
"The system partition is not formatted yet."},
|
||||
{STRING_NONFORMATTEDOTHERPART,
|
||||
"The new partition is not formatted yet."},
|
||||
{STRING_INSTALLONPART,
|
||||
"ReactOS ¢áâ ®¢«îóâìáï ஧¤i«"},
|
||||
{STRING_CHECKINGPART,
|
||||
|
|
|
@ -111,6 +111,8 @@ MUIGetString(
|
|||
#define STRING_CREATEPARTITION 7
|
||||
#define STRING_PARTFORMAT 8
|
||||
#define STRING_NONFORMATTEDPART 9
|
||||
#define STRING_NONFORMATTEDSYSTEMPART 62
|
||||
#define STRING_NONFORMATTEDOTHERPART 63
|
||||
#define STRING_INSTALLONPART 10
|
||||
#define STRING_CHECKINGPART 11
|
||||
#define STRING_QUITCONTINUE 12
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
#define NDEBUG
|
||||
#include <debug.h>
|
||||
|
||||
#define DUMP_PARTITION_TABLE
|
||||
//#define DUMP_PARTITION_TABLE
|
||||
|
||||
/* FUNCTIONS ****************************************************************/
|
||||
|
||||
|
@ -47,7 +47,7 @@ DumpPartitionTable(
|
|||
for (i = 0; i < DiskEntry->LayoutBuffer->PartitionCount; i++)
|
||||
{
|
||||
PartitionInfo = &DiskEntry->LayoutBuffer->PartitionEntry[i];
|
||||
DPRINT("\n%lu: %12I64u %12I64u %10lu %2lu %2x %c %c\n",
|
||||
DPRINT1("\n%lu: %12I64u %12I64u %10lu %2lu %2x %c %c\n",
|
||||
i,
|
||||
PartitionInfo->StartingOffset.QuadPart,
|
||||
PartitionInfo->PartitionLength.QuadPart,
|
||||
|
@ -1274,6 +1274,13 @@ CreatePartitionList(
|
|||
List->CurrentDisk = NULL;
|
||||
List->CurrentPartition = NULL;
|
||||
|
||||
List->BootDisk = NULL;
|
||||
List->BootPartition = NULL;
|
||||
|
||||
List->TempDisk = NULL;
|
||||
List->TempPartition = NULL;
|
||||
List->FormatState = Start;
|
||||
|
||||
InitializeListHead(&List->DiskListHead);
|
||||
InitializeListHead(&List->BiosDiskListHead);
|
||||
|
||||
|
@ -2739,14 +2746,14 @@ CheckActiveBootPartition(
|
|||
/* Check for empty disk list */
|
||||
if (IsListEmpty (&List->DiskListHead))
|
||||
{
|
||||
List->ActiveBootDisk = NULL;
|
||||
List->ActiveBootPartition = NULL;
|
||||
List->BootDisk = NULL;
|
||||
List->BootPartition = NULL;
|
||||
return;
|
||||
}
|
||||
|
||||
#if 0
|
||||
if (List->ActiveBootDisk != NULL &&
|
||||
List->ActiveBootPartition != NULL)
|
||||
if (List->BootDisk != NULL &&
|
||||
List->BootPartition != NULL)
|
||||
{
|
||||
/* We already have an active boot partition */
|
||||
return;
|
||||
|
@ -2759,8 +2766,8 @@ CheckActiveBootPartition(
|
|||
/* Check for empty partition list */
|
||||
if (IsListEmpty (&DiskEntry->PrimaryPartListHead))
|
||||
{
|
||||
List->ActiveBootDisk = NULL;
|
||||
List->ActiveBootPartition = NULL;
|
||||
List->BootDisk = NULL;
|
||||
List->BootPartition = NULL;
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -2778,15 +2785,15 @@ CheckActiveBootPartition(
|
|||
DiskEntry->Dirty = TRUE;
|
||||
|
||||
/* FIXME: Might be incorrect if partitions were created by Linux FDISK */
|
||||
List->ActiveBootDisk = DiskEntry;
|
||||
List->ActiveBootPartition = PartEntry;
|
||||
List->BootDisk = DiskEntry;
|
||||
List->BootPartition = PartEntry;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/* Disk is not new, scan all partitions to find a bootable one */
|
||||
List->ActiveBootDisk = NULL;
|
||||
List->ActiveBootPartition = NULL;
|
||||
List->BootDisk = NULL;
|
||||
List->BootPartition = NULL;
|
||||
|
||||
ListEntry = DiskEntry->PrimaryPartListHead.Flink;
|
||||
while (ListEntry != &DiskEntry->PrimaryPartListHead)
|
||||
|
@ -2802,8 +2809,8 @@ CheckActiveBootPartition(
|
|||
PartEntry->BootIndicator)
|
||||
{
|
||||
/* Yes, we found it */
|
||||
List->ActiveBootDisk = DiskEntry;
|
||||
List->ActiveBootPartition = PartEntry;
|
||||
List->BootDisk = DiskEntry;
|
||||
List->BootPartition = PartEntry;
|
||||
|
||||
DPRINT("Found bootable partition disk %d, drive letter %c\n",
|
||||
DiskEntry->DiskNumber, PartEntry->DriveLetter);
|
||||
|
@ -3104,4 +3111,114 @@ LogicalPartitionCreationChecks(
|
|||
return ERROR_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
BOOL
|
||||
GetNextUnformattedPartition(
|
||||
IN PPARTLIST List,
|
||||
OUT PDISKENTRY *pDiskEntry,
|
||||
OUT PPARTENTRY *pPartEntry)
|
||||
{
|
||||
PLIST_ENTRY Entry1, Entry2;
|
||||
PDISKENTRY DiskEntry;
|
||||
PPARTENTRY PartEntry;
|
||||
|
||||
Entry1 = List->DiskListHead.Flink;
|
||||
while (Entry1 != &List->DiskListHead)
|
||||
{
|
||||
DiskEntry = CONTAINING_RECORD(Entry1,
|
||||
DISKENTRY,
|
||||
ListEntry);
|
||||
|
||||
Entry2 = DiskEntry->PrimaryPartListHead.Flink;
|
||||
while (Entry2 != &DiskEntry->PrimaryPartListHead)
|
||||
{
|
||||
PartEntry = CONTAINING_RECORD(Entry2, PARTENTRY, ListEntry);
|
||||
if (PartEntry->IsPartitioned && PartEntry->New)
|
||||
{
|
||||
*pDiskEntry = DiskEntry;
|
||||
*pPartEntry = PartEntry;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
Entry2 = Entry2->Flink;
|
||||
}
|
||||
|
||||
Entry2 = DiskEntry->LogicalPartListHead.Flink;
|
||||
while (Entry2 != &DiskEntry->LogicalPartListHead)
|
||||
{
|
||||
PartEntry = CONTAINING_RECORD(Entry2, PARTENTRY, ListEntry);
|
||||
if (PartEntry->IsPartitioned && PartEntry->New)
|
||||
{
|
||||
*pDiskEntry = DiskEntry;
|
||||
*pPartEntry = PartEntry;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
Entry2 = Entry2->Flink;
|
||||
}
|
||||
|
||||
Entry1 = Entry1->Flink;
|
||||
}
|
||||
|
||||
*pDiskEntry = NULL;
|
||||
*pPartEntry = NULL;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
BOOL
|
||||
GetNextUncheckedPartition(
|
||||
IN PPARTLIST List,
|
||||
OUT PDISKENTRY *pDiskEntry,
|
||||
OUT PPARTENTRY *pPartEntry)
|
||||
{
|
||||
PLIST_ENTRY Entry1, Entry2;
|
||||
PDISKENTRY DiskEntry;
|
||||
PPARTENTRY PartEntry;
|
||||
|
||||
Entry1 = List->DiskListHead.Flink;
|
||||
while (Entry1 != &List->DiskListHead)
|
||||
{
|
||||
DiskEntry = CONTAINING_RECORD(Entry1,
|
||||
DISKENTRY,
|
||||
ListEntry);
|
||||
|
||||
Entry2 = DiskEntry->PrimaryPartListHead.Flink;
|
||||
while (Entry2 != &DiskEntry->PrimaryPartListHead)
|
||||
{
|
||||
PartEntry = CONTAINING_RECORD(Entry2, PARTENTRY, ListEntry);
|
||||
if (PartEntry->NeedsCheck == TRUE)
|
||||
{
|
||||
*pDiskEntry = DiskEntry;
|
||||
*pPartEntry = PartEntry;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
Entry2 = Entry2->Flink;
|
||||
}
|
||||
|
||||
Entry2 = DiskEntry->LogicalPartListHead.Flink;
|
||||
while (Entry2 != &DiskEntry->LogicalPartListHead)
|
||||
{
|
||||
PartEntry = CONTAINING_RECORD(Entry2, PARTENTRY, ListEntry);
|
||||
if (PartEntry->NeedsCheck == TRUE)
|
||||
{
|
||||
*pDiskEntry = DiskEntry;
|
||||
*pPartEntry = PartEntry;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
Entry2 = Entry2->Flink;
|
||||
}
|
||||
|
||||
Entry1 = Entry1->Flink;
|
||||
}
|
||||
|
||||
*pDiskEntry = NULL;
|
||||
*pPartEntry = NULL;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
|
|
@ -37,6 +37,18 @@ typedef enum _FORMATSTATE
|
|||
Formatted
|
||||
} FORMATSTATE, *PFORMATSTATE;
|
||||
|
||||
typedef enum _FORMATMACHINESTATE
|
||||
{
|
||||
Start,
|
||||
FormatSystemPartition,
|
||||
FormatInstallPartition,
|
||||
FormatOtherPartition,
|
||||
FormatDone,
|
||||
CheckSystemPartition,
|
||||
CheckInstallPartition,
|
||||
CheckOtherPartition,
|
||||
CheckDone
|
||||
} FORMATMACHINESTATE, *PFORMATMACHINESTATE;
|
||||
|
||||
typedef struct _PARTENTRY
|
||||
{
|
||||
|
@ -70,6 +82,10 @@ typedef struct _PARTENTRY
|
|||
|
||||
FORMATSTATE FormatState;
|
||||
|
||||
/* Partition must be checked */
|
||||
BOOLEAN NeedsCheck;
|
||||
|
||||
struct _FILE_SYSTEM_ITEM *FileSystem;
|
||||
} PARTENTRY, *PPARTENTRY;
|
||||
|
||||
|
||||
|
@ -141,8 +157,12 @@ typedef struct _PARTLIST
|
|||
PDISKENTRY CurrentDisk;
|
||||
PPARTENTRY CurrentPartition;
|
||||
|
||||
PDISKENTRY ActiveBootDisk;
|
||||
PPARTENTRY ActiveBootPartition;
|
||||
PDISKENTRY BootDisk;
|
||||
PPARTENTRY BootPartition;
|
||||
|
||||
PDISKENTRY TempDisk;
|
||||
PPARTENTRY TempPartition;
|
||||
FORMATMACHINESTATE FormatState;
|
||||
|
||||
LIST_ENTRY DiskListHead;
|
||||
LIST_ENTRY BiosDiskListHead;
|
||||
|
@ -263,4 +283,16 @@ ULONG
|
|||
LogicalPartitionCreationChecks(
|
||||
IN PPARTLIST List);
|
||||
|
||||
BOOL
|
||||
GetNextUnformattedPartition(
|
||||
IN PPARTLIST List,
|
||||
OUT PDISKENTRY *pDiskEntry,
|
||||
OUT PPARTENTRY *pPartEntry);
|
||||
|
||||
BOOL
|
||||
GetNextUncheckedPartition(
|
||||
IN PPARTLIST List,
|
||||
OUT PDISKENTRY *pDiskEntry,
|
||||
OUT PPARTENTRY *pPartEntry);
|
||||
|
||||
/* EOF */
|
||||
|
|
Loading…
Reference in a new issue