* Enable partition formatting code.
svn path=/trunk/; revision=5653
NTSTATUS
-InstallMBRBootCodeToDisk(PWSTR SrcPath,
- PWSTR RootPath)
+InstallMbrCodeToDisk (PWSTR SrcPath,
+ PWSTR RootPath)
{
OBJECT_ATTRIBUTES ObjectAttributes;
IO_STATUS_BLOCK IoStatusBlock;
}
/* 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 */
RtlFreeHeap(ProcessHeap, 0, OrigBootSector);
* along with this program; if not, write to the Free Software
* 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
* PROJECT: ReactOS text-mode setup
* FILE: subsys/system/usetup/bootsup.h
NTSTATUS
InstallMBRBootCodeToDisk(PWSTR SrcPath,
- PWSTR RootPath);
+ PWSTR RootPath);
NTSTATUS
InstallFat16BootCodeToDisk(PWSTR SrcPath,
* along with this program; if not, write to the Free Software
* 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
* PROJECT: ReactOS text-mode setup
* FILE: subsys/system/usetup/format.c
VfatInitialize();
- Status = VfatFormat(DriveRoot,
- 0, // MediaFlag
- NULL, // Label
- TRUE, // QuickFormat
- 0, // ClusterSize
- NULL); // Callback
- DPRINT("VfatFormat() status 0x%.08x\n", Status);
+ Status = VfatFormat (DriveRoot,
+ 0, // MediaFlag
+ NULL, // Label
+ TRUE, // QuickFormat
+ 0, // ClusterSize
+ NULL); // Callback
+ DPRINT1("VfatFormat() status 0x%.08x\n", Status);
VfatCleanup();
* along with this program; if not, write to the Free Software
* 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
* PROJECT: ReactOS text-mode setup
* FILE: subsys/system/usetup/partlist.c
WCHAR KeyName[32];
NTSTATUS Status;
-#if 0
- RtlCreateUnicodeString (&DiskEntry->DriverName,
- L"atapi");
-#endif
-
- RtlInitUnicodeString(&DiskEntry->DriverName,
- NULL);
+ RtlInitUnicodeString (&DiskEntry->DriverName,
+ NULL);
- swprintf(KeyName,
- L"\\Scsi\\Scsi Port %lu",
- DiskEntry->Port);
+ swprintf (KeyName,
+ L"\\Scsi\\Scsi Port %lu",
+ DiskEntry->Port);
- RtlZeroMemory(&QueryTable,
- sizeof(QueryTable));
+ RtlZeroMemory (&QueryTable,
+ sizeof(QueryTable));
QueryTable[0].Name = L"Driver";
QueryTable[0].Flags = RTL_QUERY_REGISTRY_DIRECT;
QueryTable[0].EntryContext = &DiskEntry->DriverName;
- Status = RtlQueryRegistryValues(RTL_REGISTRY_DEVICEMAP,
- KeyName,
- QueryTable,
- NULL,
- NULL);
- if (!NT_SUCCESS(Status))
+ Status = RtlQueryRegistryValues (RTL_REGISTRY_DEVICEMAP,
+ KeyName,
+ QueryTable,
+ NULL,
+ NULL);
+ if (!NT_SUCCESS (Status))
{
- DPRINT1("RtlQueryRegistryValues() failed (Status %lx)\n", Status);
+ DPRINT1 ("RtlQueryRegistryValues() failed (Status %lx)\n", Status);
}
}
PartEntry->DriveLetter = 0;
if (PartEntry->Unpartitioned == FALSE &&
- !IsContainerPartition(PartEntry->PartInfo[0].PartitionType))
+ !IsContainerPartition (PartEntry->PartInfo[0].PartitionType))
{
- if (IsRecognizedPartition(PartEntry->PartInfo[0].PartitionType) ||
+ if (IsRecognizedPartition (PartEntry->PartInfo[0].PartitionType) ||
(PartEntry->PartInfo[0].PartitionType == PARTITION_ENTRY_UNUSED &&
PartEntry->PartInfo[0].PartitionLength.QuadPart != 0LL))
{
PartEntry->DriveLetter = 0;
if (PartEntry->Unpartitioned == FALSE &&
- !IsContainerPartition(PartEntry->PartInfo[0].PartitionType))
+ !IsContainerPartition (PartEntry->PartInfo[0].PartitionType))
{
- if (IsRecognizedPartition(PartEntry->PartInfo[0].PartitionType) ||
+ if (IsRecognizedPartition (PartEntry->PartInfo[0].PartitionType) ||
(PartEntry->PartInfo[0].PartitionType == PARTITION_ENTRY_UNUSED &&
PartEntry->PartInfo[0].PartitionLength.QuadPart != 0LL))
{
{
for (i = 0; i < 4; i++)
{
- if (IsContainerPartition(PartEntry->PartInfo[i].PartitionType))
+ if (IsContainerPartition (PartEntry->PartInfo[i].PartitionType))
{
PartEntry->PartInfo[i].PartitionNumber = 0;
}
for (j = 0; j < 4; j++)
{
- if ((!IsContainerPartition(PartEntry->PartInfo[j].PartitionType)) &&
+ if ((!IsContainerPartition (PartEntry->PartInfo[j].PartitionType)) &&
(PartEntry->PartInfo[j].PartitionType != PARTITION_ENTRY_UNUSED ||
PartEntry->PartInfo[j].PartitionLength.QuadPart != 0LL))
{
0,
&DiskGeometry,
sizeof(DISK_GEOMETRY));
- if (!NT_SUCCESS(Status))
+ if (!NT_SUCCESS (Status))
{
return;
}
DiskEntry->SectorsPerTrack = DiskGeometry.SectorsPerTrack;
DiskEntry->BytesPerSector = DiskGeometry.BytesPerSector;
- DPRINT("Cylinders %d\n", DiskEntry->Cylinders);
- DPRINT("TracksPerCylinder %d\n", DiskEntry->TracksPerCylinder);
- DPRINT("SectorsPerTrack %d\n", DiskEntry->SectorsPerTrack);
- DPRINT("BytesPerSector %d\n", DiskEntry->BytesPerSector);
+ DPRINT ("Cylinders %d\n", DiskEntry->Cylinders);
+ DPRINT ("TracksPerCylinder %d\n", DiskEntry->TracksPerCylinder);
+ DPRINT ("SectorsPerTrack %d\n", DiskEntry->SectorsPerTrack);
+ DPRINT ("BytesPerSector %d\n", DiskEntry->BytesPerSector);
DiskEntry->DiskSize =
DiskGeometry.Cylinders.QuadPart *
if (List == NULL)
return NULL;
-// List->Left = 0;
-// List->Top = 0;
-// List->Right = 0;
-// List->Bottom = 0;
List->Left = Left;
List->Top = Top;
List->Right = Right;
PDISKENTRY DiskEntry;
PPARTENTRY PartEntry;
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 */
while (!IsListEmpty (&List->DiskListHead))
Unit = "KB";
}
- sprintf(LineBuffer,
- " Unpartitioned space %6I64u %s",
- PartSize,
- Unit);
+ sprintf (LineBuffer,
+ " Unpartitioned space %6I64u %s",
+ PartSize,
+ Unit);
}
else
{
-
/* Determine partition type */
PartType = NULL;
if (PartEntry->New == TRUE)
Attribute = (List->CurrentDisk == DiskEntry &&
List->CurrentPartition == PartEntry) ? 0x71 : 0x17;
- FillConsoleOutputCharacter(' ',
- Width,
- coPos,
- &Written);
+ FillConsoleOutputCharacter (' ',
+ Width,
+ coPos,
+ &Written);
coPos.X += 4;
Width -= 8;
- FillConsoleOutputAttribute(Attribute,
- Width,
- coPos,
- &Written);
+ FillConsoleOutputAttribute (Attribute,
+ Width,
+ coPos,
+ &Written);
coPos.X++;
Width -= 2;
- WriteConsoleOutputCharacters(LineBuffer,
- min(strlen(LineBuffer), Width),
- coPos);
+ WriteConsoleOutputCharacters (LineBuffer,
+ min (strlen (LineBuffer), Width),
+ coPos);
List->Line++;
}
if (DiskEntry->DriverName.Length > 0)
{
- sprintf(LineBuffer,
- "%6I64u %s Harddisk %lu (Port=%hu, Bus=%hu, Id=%hu) on %wZ",
- DiskSize,
- Unit,
- DiskEntry->DiskNumber,
- DiskEntry->Port,
- DiskEntry->Bus,
- DiskEntry->Id,
- &DiskEntry->DriverName);
+ sprintf (LineBuffer,
+ "%6I64u %s Harddisk %lu (Port=%hu, Bus=%hu, Id=%hu) on %wZ",
+ DiskSize,
+ Unit,
+ DiskEntry->DiskNumber,
+ DiskEntry->Port,
+ DiskEntry->Bus,
+ DiskEntry->Id,
+ &DiskEntry->DriverName);
}
else
{
- sprintf(LineBuffer,
- "%6I64u %s Harddisk %lu (Port=%hu, Bus=%hu, Id=%hu)",
- DiskSize,
- Unit,
- DiskEntry->DiskNumber,
- DiskEntry->Port,
- DiskEntry->Bus,
- DiskEntry->Id);
+ sprintf (LineBuffer,
+ "%6I64u %s Harddisk %lu (Port=%hu, Bus=%hu, Id=%hu)",
+ DiskSize,
+ Unit,
+ DiskEntry->DiskNumber,
+ DiskEntry->Port,
+ DiskEntry->Bus,
+ DiskEntry->Id);
}
- FillConsoleOutputAttribute(0x17,
- Width,
- coPos,
- &Written);
+ FillConsoleOutputAttribute (0x17,
+ Width,
+ coPos,
+ &Written);
- FillConsoleOutputCharacter(' ',
- Width,
- coPos,
- &Written);
+ FillConsoleOutputCharacter (' ',
+ Width,
+ coPos,
+ &Written);
coPos.X++;
- WriteConsoleOutputCharacters(LineBuffer,
- min(strlen(LineBuffer), Width - 2),
- coPos);
+ WriteConsoleOutputCharacters (LineBuffer,
+ min (strlen (LineBuffer), Width - 2),
+ coPos);
List->Line++;
/* Print separator line */
- PrintEmptyLine(List);
+ PrintEmptyLine (List);
/* Print partition lines*/
Entry = DiskEntry->PartListHead.Flink;
}
/* Print separator line */
- PrintEmptyLine(List);
+ PrintEmptyLine (List);
}
/* draw upper left corner */
coPos.X = List->Left;
coPos.Y = List->Top;
- FillConsoleOutputCharacter(0xDA, // '+',
- 1,
- coPos,
- &Written);
+ FillConsoleOutputCharacter (0xDA, // '+',
+ 1,
+ coPos,
+ &Written);
/* draw upper edge */
coPos.X = List->Left + 1;
coPos.Y = List->Top;
- FillConsoleOutputCharacter(0xC4, // '-',
- List->Right - List->Left - 1,
- coPos,
- &Written);
+ FillConsoleOutputCharacter (0xC4, // '-',
+ List->Right - List->Left - 1,
+ coPos,
+ &Written);
/* draw upper right corner */
coPos.X = List->Right;
coPos.Y = List->Top;
- FillConsoleOutputCharacter(0xBF, // '+',
- 1,
- coPos,
- &Written);
+ FillConsoleOutputCharacter (0xBF, // '+',
+ 1,
+ coPos,
+ &Written);
/* draw left and right edge */
for (i = List->Top + 1; i < List->Bottom; i++)
{
coPos.X = List->Left;
coPos.Y = i;
- FillConsoleOutputCharacter(0xB3, // '|',
- 1,
- coPos,
- &Written);
+ FillConsoleOutputCharacter (0xB3, // '|',
+ 1,
+ coPos,
+ &Written);
coPos.X = List->Right;
- FillConsoleOutputCharacter(0xB3, //'|',
- 1,
- coPos,
- &Written);
+ FillConsoleOutputCharacter (0xB3, //'|',
+ 1,
+ coPos,
+ &Written);
}
/* draw lower left corner */
coPos.X = List->Left;
coPos.Y = List->Bottom;
- FillConsoleOutputCharacter(0xC0, // '+',
- 1,
- coPos,
- &Written);
+ FillConsoleOutputCharacter (0xC0, // '+',
+ 1,
+ coPos,
+ &Written);
/* draw lower edge */
coPos.X = List->Left + 1;
coPos.Y = List->Bottom;
- FillConsoleOutputCharacter(0xC4, // '-',
- List->Right - List->Left - 1,
- coPos,
- &Written);
+ FillConsoleOutputCharacter (0xC4, // '-',
+ List->Right - List->Left - 1,
+ coPos,
+ &Written);
/* draw lower right corner */
coPos.X = List->Right;
coPos.Y = List->Bottom;
- FillConsoleOutputCharacter(0xD9, // '+',
- 1,
- coPos,
- &Written);
+ FillConsoleOutputCharacter (0xD9, // '+',
+ 1,
+ coPos,
+ &Written);
/* print list entries */
List->Line = 0;
VOID
-GetActiveBootPartition (PPARTLIST List,
- PDISKENTRY *DiskEntry,
- PPARTENTRY *PartEntry)
+SetActiveBootPartition (PPARTLIST List)
{
- PDISKENTRY LocalDiskEntry;
- PPARTENTRY LocalPartEntry;
- PLIST_ENTRY Entry;
- ULONG i;
-
- *DiskEntry = NULL;
- *PartEntry = NULL;
+ PDISKENTRY DiskEntry;
+ PPARTENTRY PartEntry;
/* Check for empty disk list */
if (IsListEmpty (&List->DiskListHead))
- return;
+ {
+ List->ActiveBootDisk = NULL;
+ List->ActiveBootPartition = NULL;
+ return;
+ }
- /* Get first disk entry from the disk list */
- Entry = List->DiskListHead.Flink;
- LocalDiskEntry = CONTAINING_RECORD (Entry, DISKENTRY, ListEntry);
+ DiskEntry = CONTAINING_RECORD (List->DiskListHead.Flink,
+ DISKENTRY,
+ ListEntry);
/* Check for empty partition list */
- if (IsListEmpty (&LocalDiskEntry->PartListHead))
- return;
-
- /* Search for active partition */
- Entry = LocalDiskEntry->PartListHead.Flink;
- while (Entry != &LocalDiskEntry->PartListHead)
+ if (IsListEmpty (&DiskEntry->PartListHead))
{
- LocalPartEntry = CONTAINING_RECORD (Entry, PARTENTRY, ListEntry);
+ List->ActiveBootDisk = NULL;
+ List->ActiveBootPartition = NULL;
+ return;
+ }
- if (LocalPartEntry->PartInfo[0].BootIndicator)
- {
- *DiskEntry = LocalDiskEntry;
- *PartEntry = LocalPartEntry;
- return;
- }
+ PartEntry = CONTAINING_RECORD (DiskEntry->PartListHead.Flink,
+ PARTENTRY,
+ ListEntry);
- Entry = Entry->Flink;
+ /* 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;
}
BOOLEAN
WritePartitionsToDisk (PPARTLIST List)
{
-#if 0
PDRIVE_LAYOUT_INFORMATION DriveLayout;
OBJECT_ATTRIBUTES ObjectAttributes;
IO_STATUS_BLOCK Iosb;
DriveLayoutSize,
NULL,
0);
- NtClose (FileHandle);
if (!NT_SUCCESS (Status))
{
DPRINT1 ("NtDeviceIoControlFile() failed (Status %lx)\n", Status);
+ NtClose (FileHandle);
return FALSE;
}
RtlFreeHeap (ProcessHeap,
0,
DriveLayout);
+
+ /* FIXME: Install MBR code */
+
+ NtClose (FileHandle);
}
}
Entry1 = Entry1->Flink;
}
-#endif
return TRUE;
}
* along with this program; if not, write to the Free Software
* 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
* PROJECT: ReactOS text-mode setup
* FILE: subsys/system/usetup/partlist.h
PDISKENTRY CurrentDisk;
PPARTENTRY CurrentPartition;
-#if 0
- /* Not used yet! */
PDISKENTRY ActiveBootDisk;
PPARTENTRY ActiveBootPartition;
-#endif
LIST_ENTRY DiskListHead;
ScrollUpPartitionList (PPARTLIST List);
VOID
-GetActiveBootPartition(PPARTLIST List,
- PDISKENTRY *DiskEntry,
- PPARTENTRY *PartEntry);
+SetActiveBootPartition (PPARTLIST List);
VOID
CreateNewPartition (PPARTLIST List,
static PPARTLIST PartitionList = NULL;
-static PDISKENTRY ActiveBootDisk = NULL;
-static PPARTENTRY ActiveBootPartition = NULL;
-
static PFILE_SYSTEM_LIST FileSystemList = NULL;
static PAGE_NUMBER
SelectPartitionPage(PINPUT_RECORD Ir)
{
- WCHAR PathBuffer[MAX_PATH];
SHORT xScreen;
SHORT yScreen;
SetStatusText(" Please wait...");
- RtlFreeUnicodeString(&DestinationPath);
- RtlFreeUnicodeString(&DestinationRootPath);
-
GetScreenSize(&xScreen, &yScreen);
if (PartitionList == NULL)
CreateNewPartition (PartitionList,
0ULL,
TRUE);
-
- /* FIXME: Update drive letters and partition numbers */
-
- 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;
- }
+ return SELECT_FILE_SYSTEM_PAGE;
}
else if (Ir->Event.KeyEvent.wVirtualKeyCode == VK_C) /* C */
{
{
PDISKENTRY DiskEntry;
PPARTENTRY PartEntry;
-// BOOLEAN ForceFormat;
ULONGLONG DiskSize;
ULONGLONG PartSize;
PCHAR DiskUnit;
SetTextXY(8, 21, "\x07 Press ENTER to format the partition.");
SetTextXY(8, 23, "\x07 Press ESC to select another partition.");
-// ForceFormat = (PartEntry->PartInfo[0].PartitionType == PARTITION_ENTRY_UNUSED);
-
if (FileSystemList == NULL)
{
-// FileSystemList = CreateFileSystemList (6, 26, ForceFormat, FsFat);
FileSystemList = CreateFileSystemList (6, 26, PartEntry->New, FsFat);
if (FileSystemList == NULL)
{
}
else if (Ir->Event.KeyEvent.wVirtualKeyCode == VK_RETURN) /* ENTER */
{
-#if 0
if (FileSystemList->CurrentFileSystem == FsKeep)
{
return CHECK_FILE_SYSTEM_PAGE;
{
return FORMAT_PARTITION_PAGE;
}
-#endif
- return FORMAT_PARTITION_PAGE;
}
}
static ULONG
FormatPartitionPage (PINPUT_RECORD Ir)
{
+ WCHAR PathBuffer[MAX_PATH];
PDISKENTRY DiskEntry;
PPARTENTRY PartEntry;
PLIST_ENTRY Entry;
-// NTSTATUS Status;
-
+ NTSTATUS Status;
+//#ifndef NDEBUG
ULONG Line;
ULONG i;
+//#endif
SetTextXY(6, 8, "Format partition");
return QUIT_PAGE;
}
-//#if 0
+//#ifndef NDEBUG
PrintTextXY (6, 12,
"Disk: %I64u Cylinder: %I64u Track: %I64u",
DiskEntry->DiskSize,
}
//#endif
+ SetActiveBootPartition (PartitionList);
+
if (WritePartitionsToDisk (PartitionList) == FALSE)
{
DPRINT ("WritePartitionsToDisk() failed\n");
}
}
- 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)
{
case FsFat:
Status = FormatPartition (&DestinationRootPath);
if (!NT_SUCCESS (Status))
{
- DPRINT1("FormatPartition() failed with status 0x%.08x\n", Status);
+ DPRINT1 ("FormatPartition() failed with status 0x%.08x\n", Status);
/* FIXME: show an error dialog */
return QUIT_PAGE;
}
return QUIT_PAGE;
}
+ SetStatusText (" Done. Press any key ...");
+ ConInKey(Ir);
+
+#if 0
return INSTALL_DIRECTORY_PAGE;
#endif
static ULONG
CheckFileSystemPage(PINPUT_RECORD Ir)
{
+ WCHAR PathBuffer[MAX_PATH];
+
SetTextXY(6, 8, "Check file system");
SetTextXY(6, 10, "At present, ReactOS can not check file systems.");
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)
{
ConInKey(Ir);
}
#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");
PopupError("The active partition is unused (invalid).\n",
}
}
- if (ActiveBootPartition->PartInfo[0].PartitionType == 0x0A)
+ if (PartitionList->ActiveBootPartition->PartInfo[0].PartitionType == 0x0A)
{
/* OS/2 boot manager partition */
DPRINT1("Found OS/2 boot manager partition\n");
}
}
}
- else if (ActiveBootPartition->PartInfo[0].PartitionType == 0x83)
+ else if (PartitionList->ActiveBootPartition->PartInfo[0].PartitionType == 0x83)
{
/* Linux ext2 partition */
DPRINT1("Found Linux ext2 partition\n");
}
}
}
- else if (ActiveBootPartition->PartInfo[0].PartitionType == PARTITION_IFS)
+ else if (PartitionList->ActiveBootPartition->PartInfo[0].PartitionType == PARTITION_IFS)
{
/* NTFS partition */
DPRINT1("Found NTFS partition\n");
}
}
}
- else if ((ActiveBootPartition->PartInfo[0].PartitionType == PARTITION_FAT_12) ||
- (ActiveBootPartition->PartInfo[0].PartitionType == PARTITION_FAT_16) ||
- (ActiveBootPartition->PartInfo[0].PartitionType == PARTITION_HUGE) ||
- (ActiveBootPartition->PartInfo[0].PartitionType == PARTITION_XINT13) ||
- (ActiveBootPartition->PartInfo[0].PartitionType == PARTITION_FAT32) ||
- (ActiveBootPartition->PartInfo[0].PartitionType == PARTITION_FAT32_XINT13))
+ else if ((PartitionList->ActiveBootPartition->PartInfo[0].PartitionType == PARTITION_FAT_12) ||
+ (PartitionList->ActiveBootPartition->PartInfo[0].PartitionType == PARTITION_FAT_16) ||
+ (PartitionList->ActiveBootPartition->PartInfo[0].PartitionType == PARTITION_HUGE) ||
+ (PartitionList->ActiveBootPartition->PartInfo[0].PartitionType == PARTITION_XINT13) ||
+ (PartitionList->ActiveBootPartition->PartInfo[0].PartitionType == PARTITION_FAT32) ||
+ (PartitionList->ActiveBootPartition->PartInfo[0].PartitionType == PARTITION_FAT32_XINT13))
{
/* FAT or FAT32 partition */
DPRINT1("System path: '%wZ'\n", &SystemRootPath);
}
/* Install new bootcode */
- if ((ActiveBootPartition->PartInfo[0].PartitionType == PARTITION_FAT32) ||
- (ActiveBootPartition->PartInfo[0].PartitionType == PARTITION_FAT32_XINT13))
+ if ((PartitionList->ActiveBootPartition->PartInfo[0].PartitionType == PARTITION_FAT32) ||
+ (PartitionList->ActiveBootPartition->PartInfo[0].PartitionType == PARTITION_FAT32_XINT13))
{
/* Install FAT32 bootcode */
wcscpy(SrcPath, SourceRootPath.Buffer);
}
/* Install new bootsector */
- if ((ActiveBootPartition->PartInfo[0].PartitionType == PARTITION_FAT32) ||
- (ActiveBootPartition->PartInfo[0].PartitionType == PARTITION_FAT32_XINT13))
+ if ((PartitionList->ActiveBootPartition->PartInfo[0].PartitionType == PARTITION_FAT32) ||
+ (PartitionList->ActiveBootPartition->PartInfo[0].PartitionType == PARTITION_FAT32_XINT13))
{
wcscpy(SrcPath, SourceRootPath.Buffer);
wcscat(SrcPath, L"\\loader\\fat32.bin");
}
/* Install new bootsector */
- if ((ActiveBootPartition->PartInfo[0].PartitionType == PARTITION_FAT32) ||
- (ActiveBootPartition->PartInfo[0].PartitionType == PARTITION_FAT32_XINT13))
+ if ((PartitionList->ActiveBootPartition->PartInfo[0].PartitionType == PARTITION_FAT32) ||
+ (PartitionList->ActiveBootPartition->PartInfo[0].PartitionType == PARTITION_FAT32_XINT13))
{
wcscpy(SrcPath, SourceRootPath.Buffer);
wcscat(SrcPath, L"\\loader\\fat32.bin");