* Write modified partition sectors to disk.

* Enable partition formatting code.

svn path=/trunk/; revision=5653
This commit is contained in:
Eric Kohl 2003-08-18 17:39:26 +00:00
parent c5cce225e2
commit c01dbcf16b
6 changed files with 234 additions and 269 deletions

View file

@ -922,7 +922,7 @@ CHECKPOINT1;
NTSTATUS NTSTATUS
InstallMBRBootCodeToDisk(PWSTR SrcPath, InstallMbrCodeToDisk (PWSTR SrcPath,
PWSTR RootPath) PWSTR RootPath)
{ {
OBJECT_ATTRIBUTES ObjectAttributes; OBJECT_ATTRIBUTES ObjectAttributes;
@ -1030,7 +1030,9 @@ InstallMBRBootCodeToDisk(PWSTR SrcPath,
} }
/* Copy partition table from old MBR to new */ /* Copy partition table from old MBR to new */
memcpy((NewBootSector + 446), (OrigBootSector + 446), 4*16 /* Length of partition table */); memcpy((NewBootSector + 446),
(OrigBootSector + 446),
4*16 /* Length of partition table */);
/* Free the original boot sector */ /* Free the original boot sector */
RtlFreeHeap(ProcessHeap, 0, OrigBootSector); RtlFreeHeap(ProcessHeap, 0, OrigBootSector);

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
/* $Id: bootsup.h,v 1.4 2003/04/05 15:36:34 chorns Exp $ /* $Id: bootsup.h,v 1.5 2003/08/18 17:39:26 ekohl Exp $
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS text-mode setup * PROJECT: ReactOS text-mode setup
* FILE: subsys/system/usetup/bootsup.h * FILE: subsys/system/usetup/bootsup.h

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
/* $Id: format.c,v 1.1 2003/04/28 19:44:13 chorns Exp $ /* $Id: format.c,v 1.2 2003/08/18 17:39:26 ekohl Exp $
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS text-mode setup * PROJECT: ReactOS text-mode setup
* FILE: subsys/system/usetup/format.c * FILE: subsys/system/usetup/format.c
@ -47,7 +47,7 @@ FormatPartition(PUNICODE_STRING DriveRoot)
TRUE, // QuickFormat TRUE, // QuickFormat
0, // ClusterSize 0, // ClusterSize
NULL); // Callback NULL); // Callback
DPRINT("VfatFormat() status 0x%.08x\n", Status); DPRINT1("VfatFormat() status 0x%.08x\n", Status);
VfatCleanup(); VfatCleanup();

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
/* $Id: partlist.c,v 1.17 2003/08/12 15:56:21 ekohl Exp $ /* $Id: partlist.c,v 1.18 2003/08/18 17:39:26 ekohl Exp $
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS text-mode setup * PROJECT: ReactOS text-mode setup
* FILE: subsys/system/usetup/partlist.c * FILE: subsys/system/usetup/partlist.c
@ -47,11 +47,6 @@ GetDriverName (PDISKENTRY DiskEntry)
WCHAR KeyName[32]; WCHAR KeyName[32];
NTSTATUS Status; NTSTATUS Status;
#if 0
RtlCreateUnicodeString (&DiskEntry->DriverName,
L"atapi");
#endif
RtlInitUnicodeString (&DiskEntry->DriverName, RtlInitUnicodeString (&DiskEntry->DriverName,
NULL); NULL);
@ -521,10 +516,6 @@ CreatePartitionList (SHORT Left,
if (List == NULL) if (List == NULL)
return NULL; return NULL;
// List->Left = 0;
// List->Top = 0;
// List->Right = 0;
// List->Bottom = 0;
List->Left = Left; List->Left = Left;
List->Top = Top; List->Top = Top;
List->Right = Right; List->Right = Right;
@ -621,26 +612,6 @@ DestroyPartitionList (PPARTLIST List)
PDISKENTRY DiskEntry; PDISKENTRY DiskEntry;
PPARTENTRY PartEntry; PPARTENTRY PartEntry;
PLIST_ENTRY Entry; PLIST_ENTRY Entry;
#if 0
COORD coPos;
USHORT Width;
/* clear occupied screen area */
coPos.X = List->Left;
Width = List->Right - List->Left + 1;
for (coPos.Y = List->Top; coPos.Y <= List->Bottom; coPos.Y++)
{
FillConsoleOutputAttribute(0x17,
Width,
coPos,
&i);
FillConsoleOutputCharacter(' ',
Width,
coPos,
&i);
}
#endif
/* Release disk and partition info */ /* Release disk and partition info */
while (!IsListEmpty (&List->DiskListHead)) while (!IsListEmpty (&List->DiskListHead))
@ -755,7 +726,6 @@ PrintPartitionData (PPARTLIST List,
} }
else else
{ {
/* Determine partition type */ /* Determine partition type */
PartType = NULL; PartType = NULL;
if (PartEntry->New == TRUE) if (PartEntry->New == TRUE)
@ -1166,45 +1136,49 @@ ScrollUpPartitionList (PPARTLIST List)
VOID VOID
GetActiveBootPartition (PPARTLIST List, SetActiveBootPartition (PPARTLIST List)
PDISKENTRY *DiskEntry,
PPARTENTRY *PartEntry)
{ {
PDISKENTRY LocalDiskEntry; PDISKENTRY DiskEntry;
PPARTENTRY LocalPartEntry; PPARTENTRY PartEntry;
PLIST_ENTRY Entry;
ULONG i;
*DiskEntry = NULL;
*PartEntry = NULL;
/* Check for empty disk list */ /* Check for empty disk list */
if (IsListEmpty (&List->DiskListHead)) if (IsListEmpty (&List->DiskListHead))
{
List->ActiveBootDisk = NULL;
List->ActiveBootPartition = NULL;
return; return;
}
/* Get first disk entry from the disk list */ DiskEntry = CONTAINING_RECORD (List->DiskListHead.Flink,
Entry = List->DiskListHead.Flink; DISKENTRY,
LocalDiskEntry = CONTAINING_RECORD (Entry, DISKENTRY, ListEntry); ListEntry);
/* Check for empty partition list */ /* Check for empty partition list */
if (IsListEmpty (&LocalDiskEntry->PartListHead)) if (IsListEmpty (&DiskEntry->PartListHead))
return;
/* Search for active partition */
Entry = LocalDiskEntry->PartListHead.Flink;
while (Entry != &LocalDiskEntry->PartListHead)
{ {
LocalPartEntry = CONTAINING_RECORD (Entry, PARTENTRY, ListEntry); List->ActiveBootDisk = NULL;
List->ActiveBootPartition = NULL;
if (LocalPartEntry->PartInfo[0].BootIndicator)
{
*DiskEntry = LocalDiskEntry;
*PartEntry = LocalPartEntry;
return; return;
} }
Entry = Entry->Flink; PartEntry = CONTAINING_RECORD (DiskEntry->PartListHead.Flink,
PARTENTRY,
ListEntry);
/* Set active boot partition 1 */
if (PartEntry->PartInfo[0].BootIndicator == FALSE &&
PartEntry->PartInfo[1].BootIndicator == FALSE &&
PartEntry->PartInfo[2].BootIndicator == FALSE &&
PartEntry->PartInfo[3].BootIndicator == FALSE)
{
PartEntry->PartInfo[0].BootIndicator == TRUE;
PartEntry->PartInfo[0].RewritePartition == TRUE;
DiskEntry->Modified = TRUE;
} }
/* FIXME: Might be incorrect if partitions were created by Linux FDISK */
List->ActiveBootDisk = DiskEntry;
List->ActiveBootPartition = PartEntry;
} }
@ -1661,7 +1635,6 @@ DeleteCurrentPartition (PPARTLIST List)
BOOLEAN BOOLEAN
WritePartitionsToDisk (PPARTLIST List) WritePartitionsToDisk (PPARTLIST List)
{ {
#if 0
PDRIVE_LAYOUT_INFORMATION DriveLayout; PDRIVE_LAYOUT_INFORMATION DriveLayout;
OBJECT_ATTRIBUTES ObjectAttributes; OBJECT_ATTRIBUTES ObjectAttributes;
IO_STATUS_BLOCK Iosb; IO_STATUS_BLOCK Iosb;
@ -1776,22 +1749,25 @@ WritePartitionsToDisk (PPARTLIST List)
DriveLayoutSize, DriveLayoutSize,
NULL, NULL,
0); 0);
NtClose (FileHandle);
if (!NT_SUCCESS (Status)) if (!NT_SUCCESS (Status))
{ {
DPRINT1 ("NtDeviceIoControlFile() failed (Status %lx)\n", Status); DPRINT1 ("NtDeviceIoControlFile() failed (Status %lx)\n", Status);
NtClose (FileHandle);
return FALSE; return FALSE;
} }
RtlFreeHeap (ProcessHeap, RtlFreeHeap (ProcessHeap,
0, 0,
DriveLayout); DriveLayout);
/* FIXME: Install MBR code */
NtClose (FileHandle);
} }
} }
Entry1 = Entry1->Flink; Entry1 = Entry1->Flink;
} }
#endif
return TRUE; return TRUE;
} }

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
/* $Id: partlist.h,v 1.17 2003/08/12 15:56:21 ekohl Exp $ /* $Id: partlist.h,v 1.18 2003/08/18 17:39:26 ekohl Exp $
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS text-mode setup * PROJECT: ReactOS text-mode setup
* FILE: subsys/system/usetup/partlist.h * FILE: subsys/system/usetup/partlist.h
@ -103,11 +103,8 @@ typedef struct _PARTLIST
PDISKENTRY CurrentDisk; PDISKENTRY CurrentDisk;
PPARTENTRY CurrentPartition; PPARTENTRY CurrentPartition;
#if 0
/* Not used yet! */
PDISKENTRY ActiveBootDisk; PDISKENTRY ActiveBootDisk;
PPARTENTRY ActiveBootPartition; PPARTENTRY ActiveBootPartition;
#endif
LIST_ENTRY DiskListHead; LIST_ENTRY DiskListHead;
@ -134,9 +131,7 @@ VOID
ScrollUpPartitionList (PPARTLIST List); ScrollUpPartitionList (PPARTLIST List);
VOID VOID
GetActiveBootPartition(PPARTLIST List, SetActiveBootPartition (PPARTLIST List);
PDISKENTRY *DiskEntry,
PPARTENTRY *PartEntry);
VOID VOID
CreateNewPartition (PPARTLIST List, CreateNewPartition (PPARTLIST List,

View file

@ -94,9 +94,6 @@ UNICODE_STRING SourceRootPath;
static PPARTLIST PartitionList = NULL; static PPARTLIST PartitionList = NULL;
static PDISKENTRY ActiveBootDisk = NULL;
static PPARTENTRY ActiveBootPartition = NULL;
static PFILE_SYSTEM_LIST FileSystemList = NULL; static PFILE_SYSTEM_LIST FileSystemList = NULL;
@ -677,7 +674,6 @@ InstallIntroPage(PINPUT_RECORD Ir)
static PAGE_NUMBER static PAGE_NUMBER
SelectPartitionPage(PINPUT_RECORD Ir) SelectPartitionPage(PINPUT_RECORD Ir)
{ {
WCHAR PathBuffer[MAX_PATH];
SHORT xScreen; SHORT xScreen;
SHORT yScreen; SHORT yScreen;
@ -691,9 +687,6 @@ SelectPartitionPage(PINPUT_RECORD Ir)
SetStatusText(" Please wait..."); SetStatusText(" Please wait...");
RtlFreeUnicodeString(&DestinationPath);
RtlFreeUnicodeString(&DestinationRootPath);
GetScreenSize(&xScreen, &yScreen); GetScreenSize(&xScreen, &yScreen);
if (PartitionList == NULL) if (PartitionList == NULL)
@ -755,55 +748,10 @@ SelectPartitionPage(PINPUT_RECORD Ir)
CreateNewPartition (PartitionList, CreateNewPartition (PartitionList,
0ULL, 0ULL,
TRUE); TRUE);
}
/* FIXME: Update drive letters and partition numbers */
return SELECT_FILE_SYSTEM_PAGE; return SELECT_FILE_SYSTEM_PAGE;
} }
else
{
RtlFreeUnicodeString (&DestinationRootPath);
swprintf (PathBuffer,
L"\\Device\\Harddisk%lu\\Partition%lu",
PartitionList->CurrentDisk->DiskNumber,
PartitionList->CurrentPartition->PartInfo[0].PartitionNumber);
RtlCreateUnicodeString (&DestinationRootPath,
PathBuffer);
GetActiveBootPartition (PartitionList,
&ActiveBootDisk,
&ActiveBootPartition);
RtlFreeUnicodeString (&SystemRootPath);
if (ActiveBootDisk != NULL && ActiveBootPartition != NULL)
{
swprintf (PathBuffer,
L"\\Device\\Harddisk%lu\\Partition%lu",
ActiveBootDisk->DiskNumber,
ActiveBootPartition->PartInfo[0].PartitionNumber);
}
else
{
/*
* FIXME:
* Check whether partition can be activated.
* We may have to force Disk0\Partition1.
* Mark partition active.
*/
swprintf (PathBuffer,
L"\\Device\\Harddisk%lu\\Partition%lu",
PartitionList->CurrentDisk->DiskNumber,
PartitionList->CurrentPartition->PartInfo[0].PartitionNumber);
}
RtlCreateUnicodeString (&SystemRootPath,
PathBuffer);
DPRINT ("DestinationRootPath: %wZ\n", &DestinationRootPath);
DPRINT ("SystemRootPath: %wZ\n", &SystemRootPath);
return SELECT_FILE_SYSTEM_PAGE;
}
}
else if (Ir->Event.KeyEvent.wVirtualKeyCode == VK_C) /* C */ else if (Ir->Event.KeyEvent.wVirtualKeyCode == VK_C) /* C */
{ {
if (PartitionList->CurrentPartition->Unpartitioned == FALSE) if (PartitionList->CurrentPartition->Unpartitioned == FALSE)
@ -1347,7 +1295,6 @@ SelectFileSystemPage (PINPUT_RECORD Ir)
{ {
PDISKENTRY DiskEntry; PDISKENTRY DiskEntry;
PPARTENTRY PartEntry; PPARTENTRY PartEntry;
// BOOLEAN ForceFormat;
ULONGLONG DiskSize; ULONGLONG DiskSize;
ULONGLONG PartSize; ULONGLONG PartSize;
PCHAR DiskUnit; PCHAR DiskUnit;
@ -1488,11 +1435,8 @@ SelectFileSystemPage (PINPUT_RECORD Ir)
SetTextXY(8, 21, "\x07 Press ENTER to format the partition."); SetTextXY(8, 21, "\x07 Press ENTER to format the partition.");
SetTextXY(8, 23, "\x07 Press ESC to select another partition."); SetTextXY(8, 23, "\x07 Press ESC to select another partition.");
// ForceFormat = (PartEntry->PartInfo[0].PartitionType == PARTITION_ENTRY_UNUSED);
if (FileSystemList == NULL) if (FileSystemList == NULL)
{ {
// FileSystemList = CreateFileSystemList (6, 26, ForceFormat, FsFat);
FileSystemList = CreateFileSystemList (6, 26, PartEntry->New, FsFat); FileSystemList = CreateFileSystemList (6, 26, PartEntry->New, FsFat);
if (FileSystemList == NULL) if (FileSystemList == NULL)
{ {
@ -1536,7 +1480,6 @@ SelectFileSystemPage (PINPUT_RECORD Ir)
} }
else if (Ir->Event.KeyEvent.wVirtualKeyCode == VK_RETURN) /* ENTER */ else if (Ir->Event.KeyEvent.wVirtualKeyCode == VK_RETURN) /* ENTER */
{ {
#if 0
if (FileSystemList->CurrentFileSystem == FsKeep) if (FileSystemList->CurrentFileSystem == FsKeep)
{ {
return CHECK_FILE_SYSTEM_PAGE; return CHECK_FILE_SYSTEM_PAGE;
@ -1545,8 +1488,6 @@ SelectFileSystemPage (PINPUT_RECORD Ir)
{ {
return FORMAT_PARTITION_PAGE; return FORMAT_PARTITION_PAGE;
} }
#endif
return FORMAT_PARTITION_PAGE;
} }
} }
@ -1557,14 +1498,16 @@ SelectFileSystemPage (PINPUT_RECORD Ir)
static ULONG static ULONG
FormatPartitionPage (PINPUT_RECORD Ir) FormatPartitionPage (PINPUT_RECORD Ir)
{ {
WCHAR PathBuffer[MAX_PATH];
PDISKENTRY DiskEntry; PDISKENTRY DiskEntry;
PPARTENTRY PartEntry; PPARTENTRY PartEntry;
PLIST_ENTRY Entry; PLIST_ENTRY Entry;
// NTSTATUS Status; NTSTATUS Status;
//#ifndef NDEBUG
ULONG Line; ULONG Line;
ULONG i; ULONG i;
//#endif
SetTextXY(6, 8, "Format partition"); SetTextXY(6, 8, "Format partition");
@ -1637,7 +1580,7 @@ FormatPartitionPage (PINPUT_RECORD Ir)
return QUIT_PAGE; return QUIT_PAGE;
} }
//#if 0 //#ifndef NDEBUG
PrintTextXY (6, 12, PrintTextXY (6, 12,
"Disk: %I64u Cylinder: %I64u Track: %I64u", "Disk: %I64u Cylinder: %I64u Track: %I64u",
DiskEntry->DiskSize, DiskEntry->DiskSize,
@ -1675,6 +1618,8 @@ FormatPartitionPage (PINPUT_RECORD Ir)
} }
//#endif //#endif
SetActiveBootPartition (PartitionList);
if (WritePartitionsToDisk (PartitionList) == FALSE) if (WritePartitionsToDisk (PartitionList) == FALSE)
{ {
DPRINT ("WritePartitionsToDisk() failed\n"); DPRINT ("WritePartitionsToDisk() failed\n");
@ -1693,10 +1638,29 @@ FormatPartitionPage (PINPUT_RECORD Ir)
} }
} }
SetStatusText (" Press any key ...");
ConInKey(Ir);
#if 0 /* Set DestinationRootPath */
RtlFreeUnicodeString (&DestinationRootPath);
swprintf (PathBuffer,
L"\\Device\\Harddisk%lu\\Partition%lu",
PartitionList->CurrentDisk->DiskNumber,
PartitionList->CurrentPartition->PartInfo[0].PartitionNumber);
RtlCreateUnicodeString (&DestinationRootPath,
PathBuffer);
DPRINT1 ("DestinationRootPath: %wZ\n", &DestinationRootPath);
/* Set SystemRootPath */
RtlFreeUnicodeString (&SystemRootPath);
swprintf (PathBuffer,
L"\\Device\\Harddisk%lu\\Partition%lu",
PartitionList->ActiveBootDisk->DiskNumber,
PartitionList->ActiveBootPartition->PartInfo[0].PartitionNumber);
RtlCreateUnicodeString (&SystemRootPath,
PathBuffer);
DPRINT1 ("SystemRootPath: %wZ\n", &SystemRootPath);
switch (FileSystemList->CurrentFileSystem) switch (FileSystemList->CurrentFileSystem)
{ {
case FsFat: case FsFat:
@ -1716,6 +1680,10 @@ FormatPartitionPage (PINPUT_RECORD Ir)
return QUIT_PAGE; return QUIT_PAGE;
} }
SetStatusText (" Done. Press any key ...");
ConInKey(Ir);
#if 0
return INSTALL_DIRECTORY_PAGE; return INSTALL_DIRECTORY_PAGE;
#endif #endif
@ -1730,6 +1698,8 @@ FormatPartitionPage (PINPUT_RECORD Ir)
static ULONG static ULONG
CheckFileSystemPage(PINPUT_RECORD Ir) CheckFileSystemPage(PINPUT_RECORD Ir)
{ {
WCHAR PathBuffer[MAX_PATH];
SetTextXY(6, 8, "Check file system"); SetTextXY(6, 8, "Check file system");
SetTextXY(6, 10, "At present, ReactOS can not check file systems."); SetTextXY(6, 10, "At present, ReactOS can not check file systems.");
@ -1739,6 +1709,28 @@ CheckFileSystemPage(PINPUT_RECORD Ir)
SetStatusText(" ENTER = Continue F3 = Quit"); SetStatusText(" ENTER = Continue F3 = Quit");
/* Set DestinationRootPath */
RtlFreeUnicodeString (&DestinationRootPath);
swprintf (PathBuffer,
L"\\Device\\Harddisk%lu\\Partition%lu",
PartitionList->CurrentDisk->DiskNumber,
PartitionList->CurrentPartition->PartInfo[0].PartitionNumber);
RtlCreateUnicodeString (&DestinationRootPath,
PathBuffer);
DPRINT1 ("DestinationRootPath: %wZ\n", &DestinationRootPath);
/* Set SystemRootPath */
RtlFreeUnicodeString (&SystemRootPath);
swprintf (PathBuffer,
L"\\Device\\Harddisk%lu\\Partition%lu",
PartitionList->ActiveBootDisk->DiskNumber,
PartitionList->ActiveBootPartition->PartInfo[0].PartitionNumber);
RtlCreateUnicodeString (&SystemRootPath,
PathBuffer);
DPRINT1 ("SystemRootPath: %wZ\n", &SystemRootPath);
while(TRUE) while(TRUE)
{ {
ConInKey(Ir); ConInKey(Ir);
@ -2367,7 +2359,7 @@ BootLoaderPage(PINPUT_RECORD Ir)
} }
#endif #endif
if (ActiveBootPartition->PartInfo[0].PartitionType == PARTITION_ENTRY_UNUSED) if (PartitionList->ActiveBootPartition->PartInfo[0].PartitionType == PARTITION_ENTRY_UNUSED)
{ {
DPRINT1("Error: active partition invalid (unused)\n"); DPRINT1("Error: active partition invalid (unused)\n");
PopupError("The active partition is unused (invalid).\n", PopupError("The active partition is unused (invalid).\n",
@ -2384,7 +2376,7 @@ BootLoaderPage(PINPUT_RECORD Ir)
} }
} }
if (ActiveBootPartition->PartInfo[0].PartitionType == 0x0A) if (PartitionList->ActiveBootPartition->PartInfo[0].PartitionType == 0x0A)
{ {
/* OS/2 boot manager partition */ /* OS/2 boot manager partition */
DPRINT1("Found OS/2 boot manager partition\n"); DPRINT1("Found OS/2 boot manager partition\n");
@ -2402,7 +2394,7 @@ BootLoaderPage(PINPUT_RECORD Ir)
} }
} }
} }
else if (ActiveBootPartition->PartInfo[0].PartitionType == 0x83) else if (PartitionList->ActiveBootPartition->PartInfo[0].PartitionType == 0x83)
{ {
/* Linux ext2 partition */ /* Linux ext2 partition */
DPRINT1("Found Linux ext2 partition\n"); DPRINT1("Found Linux ext2 partition\n");
@ -2420,7 +2412,7 @@ BootLoaderPage(PINPUT_RECORD Ir)
} }
} }
} }
else if (ActiveBootPartition->PartInfo[0].PartitionType == PARTITION_IFS) else if (PartitionList->ActiveBootPartition->PartInfo[0].PartitionType == PARTITION_IFS)
{ {
/* NTFS partition */ /* NTFS partition */
DPRINT1("Found NTFS partition\n"); DPRINT1("Found NTFS partition\n");
@ -2438,12 +2430,12 @@ BootLoaderPage(PINPUT_RECORD Ir)
} }
} }
} }
else if ((ActiveBootPartition->PartInfo[0].PartitionType == PARTITION_FAT_12) || else if ((PartitionList->ActiveBootPartition->PartInfo[0].PartitionType == PARTITION_FAT_12) ||
(ActiveBootPartition->PartInfo[0].PartitionType == PARTITION_FAT_16) || (PartitionList->ActiveBootPartition->PartInfo[0].PartitionType == PARTITION_FAT_16) ||
(ActiveBootPartition->PartInfo[0].PartitionType == PARTITION_HUGE) || (PartitionList->ActiveBootPartition->PartInfo[0].PartitionType == PARTITION_HUGE) ||
(ActiveBootPartition->PartInfo[0].PartitionType == PARTITION_XINT13) || (PartitionList->ActiveBootPartition->PartInfo[0].PartitionType == PARTITION_XINT13) ||
(ActiveBootPartition->PartInfo[0].PartitionType == PARTITION_FAT32) || (PartitionList->ActiveBootPartition->PartInfo[0].PartitionType == PARTITION_FAT32) ||
(ActiveBootPartition->PartInfo[0].PartitionType == PARTITION_FAT32_XINT13)) (PartitionList->ActiveBootPartition->PartInfo[0].PartitionType == PARTITION_FAT32_XINT13))
{ {
/* FAT or FAT32 partition */ /* FAT or FAT32 partition */
DPRINT1("System path: '%wZ'\n", &SystemRootPath); DPRINT1("System path: '%wZ'\n", &SystemRootPath);
@ -2507,8 +2499,8 @@ BootLoaderPage(PINPUT_RECORD Ir)
} }
/* Install new bootcode */ /* Install new bootcode */
if ((ActiveBootPartition->PartInfo[0].PartitionType == PARTITION_FAT32) || if ((PartitionList->ActiveBootPartition->PartInfo[0].PartitionType == PARTITION_FAT32) ||
(ActiveBootPartition->PartInfo[0].PartitionType == PARTITION_FAT32_XINT13)) (PartitionList->ActiveBootPartition->PartInfo[0].PartitionType == PARTITION_FAT32_XINT13))
{ {
/* Install FAT32 bootcode */ /* Install FAT32 bootcode */
wcscpy(SrcPath, SourceRootPath.Buffer); wcscpy(SrcPath, SourceRootPath.Buffer);
@ -2703,8 +2695,8 @@ BootLoaderPage(PINPUT_RECORD Ir)
} }
/* Install new bootsector */ /* Install new bootsector */
if ((ActiveBootPartition->PartInfo[0].PartitionType == PARTITION_FAT32) || if ((PartitionList->ActiveBootPartition->PartInfo[0].PartitionType == PARTITION_FAT32) ||
(ActiveBootPartition->PartInfo[0].PartitionType == PARTITION_FAT32_XINT13)) (PartitionList->ActiveBootPartition->PartInfo[0].PartitionType == PARTITION_FAT32_XINT13))
{ {
wcscpy(SrcPath, SourceRootPath.Buffer); wcscpy(SrcPath, SourceRootPath.Buffer);
wcscat(SrcPath, L"\\loader\\fat32.bin"); wcscat(SrcPath, L"\\loader\\fat32.bin");
@ -2864,8 +2856,8 @@ BootLoaderPage(PINPUT_RECORD Ir)
} }
/* Install new bootsector */ /* Install new bootsector */
if ((ActiveBootPartition->PartInfo[0].PartitionType == PARTITION_FAT32) || if ((PartitionList->ActiveBootPartition->PartInfo[0].PartitionType == PARTITION_FAT32) ||
(ActiveBootPartition->PartInfo[0].PartitionType == PARTITION_FAT32_XINT13)) (PartitionList->ActiveBootPartition->PartInfo[0].PartitionType == PARTITION_FAT32_XINT13))
{ {
wcscpy(SrcPath, SourceRootPath.Buffer); wcscpy(SrcPath, SourceRootPath.Buffer);
wcscat(SrcPath, L"\\loader\\fat32.bin"); wcscat(SrcPath, L"\\loader\\fat32.bin");