Author: hbelusca
Date: Wed May 17 23:37:07 2017
New Revision: 74573
URL:
http://svn.reactos.org/svn/reactos?rev=74573&view=rev
Log:
[USETUP]: Consolidate the PartList module of the setuplib.
- The 'FORMATMACHINESTATE FormatState' machine-state and the
'TempPartition' members of the partition list structure is purely a USETUP
convenience, so remove them from the PARTLIST structure and move them back into USETUP.
- Attempt to recognize the filesystem (set the 'FileSystem' member of PARTENTRY)
of partitions we are adding into the PARTLIST list.
- Fix the return value of the SelectPartition function, which is by the way completely
broken (it doesn't do what it is supposed to do; alternatively its naming is
completely wrong...).
Modified:
branches/setup_improvements/base/setup/lib/partlist.c
branches/setup_improvements/base/setup/lib/partlist.h
branches/setup_improvements/base/setup/usetup/partlist.h
Modified: branches/setup_improvements/base/setup/lib/partlist.c
URL:
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/l…
==============================================================================
--- branches/setup_improvements/base/setup/lib/partlist.c [iso-8859-1] (original)
+++ branches/setup_improvements/base/setup/lib/partlist.c [iso-8859-1] Wed May 17 23:37:07
2017
@@ -488,17 +488,18 @@
PPARTENTRY PartEntry;
PartitionInfo = &DiskEntry->LayoutBuffer->PartitionEntry[PartitionIndex];
+
if (PartitionInfo->PartitionType == PARTITION_ENTRY_UNUSED ||
(LogicalPartition == TRUE &&
IsContainerPartition(PartitionInfo->PartitionType)))
+ {
return;
+ }
PartEntry = RtlAllocateHeap(ProcessHeap,
HEAP_ZERO_MEMORY,
sizeof(PARTENTRY));
if (PartEntry == NULL)
- {
return;
- }
PartEntry->DiskEntry = DiskEntry;
@@ -522,12 +523,10 @@
if (LogicalPartition == FALSE && DiskEntry->ExtendedPartition ==
NULL)
DiskEntry->ExtendedPartition = PartEntry;
}
-#if 0
else if (IsRecognizedPartition(PartEntry->PartitionType))
{
- // FIXME FIXME! We should completely rework how we get this
'FileSystemList' available...
- PartEntry->FileSystem = GetFileSystem(/*FileSystemList,*/ PartEntry);
- if (!PartEntry->FileSystem)
+ PartEntry->FileSystem = GetFileSystem(PartEntry);
+ if (PartEntry->FileSystem)
PartEntry->FormatState = Preformatted;
else
PartEntry->FormatState = Unformatted;
@@ -535,63 +534,7 @@
}
else
{
- /* Unknown partition, so unknown partition format (may or may not be actually
formatted) */
- PartEntry->FormatState = UnknownFormat;
- }
-#endif
- else if ((PartEntry->PartitionType == PARTITION_FAT_12) ||
- (PartEntry->PartitionType == PARTITION_FAT_16) ||
- (PartEntry->PartitionType == PARTITION_HUGE) ||
- (PartEntry->PartitionType == PARTITION_XINT13) ||
- (PartEntry->PartitionType == PARTITION_FAT32) ||
- (PartEntry->PartitionType == PARTITION_FAT32_XINT13))
- {
-#if 0
- if (CheckFatFormat())
- {
- PartEntry->FormatState = Preformatted;
- }
- else
- {
- PartEntry->FormatState = Unformatted;
- }
-#endif
- PartEntry->FormatState = Preformatted;
- }
- else if (PartEntry->PartitionType == PARTITION_EXT2)
- {
-#if 0
- if (CheckExt2Format())
- {
- PartEntry->FormatState = Preformatted;
- }
- else
- {
- PartEntry->FormatState = Unformatted;
- }
-#endif
- PartEntry->FormatState = Preformatted;
- }
- else if (PartEntry->PartitionType == PARTITION_IFS)
- {
-#if 0
- if (CheckNtfsFormat())
- {
- PartEntry->FormatState = Preformatted;
- }
- else if (CheckHpfsFormat())
- {
- PartEntry->FormatState = Preformatted;
- }
- else
- {
- PartEntry->FormatState = Unformatted;
- }
-#endif
- PartEntry->FormatState = Preformatted;
- }
- else
- {
+ /* Unknown partition, hence unknown partition format (may or may not be actually
formatted) */
PartEntry->FormatState = UnknownFormat;
}
@@ -1256,9 +1199,6 @@
List->SystemPartition = NULL;
List->OriginalSystemPartition = NULL;
- List->TempPartition = NULL;
- List->FormatState = Start;
-
InitializeListHead(&List->DiskListHead);
InitializeListHead(&List->BiosDiskListHead);
@@ -1392,7 +1332,10 @@
RtlFreeHeap(ProcessHeap, 0, List);
}
-ULONG
+//
+// FIXME: This function is COMPLETELY BROKEN!!!!
+//
+BOOLEAN
SelectPartition(
IN PPARTLIST List,
IN ULONG DiskNumber,
@@ -2392,9 +2335,7 @@
VOID
CheckActiveSystemPartition(
- IN PPARTLIST List // ,
- // IN PFILE_SYSTEM_LIST FileSystemList /* Needed for checking the FS of the candidate
system partition */
- )
+ IN PPARTLIST List)
{
PDISKENTRY DiskEntry;
PPARTENTRY PartEntry;
@@ -2571,7 +2512,7 @@
* NOTE also that for those architectures looking for a
* partition boot indicator is insufficient.
*/
- FileSystem = GetFileSystem(/*FileSystemList,*/ List->OriginalSystemPartition);
+ FileSystem = GetFileSystem(List->OriginalSystemPartition);
if (FileSystem == NULL)
{
DPRINT1("System partition %lu in disk %lu with no FS?!\n",
@@ -2580,7 +2521,7 @@
goto FindAndUseAlternativeSystemPartition;
}
// HACK: WARNING: We cannot write on this FS yet!
- // See fslist.c:GetFileSystem()
+ // See fsutil.c:GetFileSystem()
if (List->OriginalSystemPartition->PartitionType == PARTITION_EXT2 ||
List->OriginalSystemPartition->PartitionType == PARTITION_IFS)
{
Modified: branches/setup_improvements/base/setup/lib/partlist.h
URL:
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/l…
==============================================================================
--- branches/setup_improvements/base/setup/lib/partlist.h [iso-8859-1] (original)
+++ branches/setup_improvements/base/setup/lib/partlist.h [iso-8859-1] Wed May 17 23:37:07
2017
@@ -16,19 +16,6 @@
Preformatted,
Formatted
} FORMATSTATE, *PFORMATSTATE;
-
-typedef enum _FORMATMACHINESTATE
-{
- Start,
- FormatSystemPartition,
- FormatInstallPartition,
- FormatOtherPartition,
- FormatDone,
- CheckSystemPartition,
- CheckInstallPartition,
- CheckOtherPartition,
- CheckDone
-} FORMATMACHINESTATE, *PFORMATMACHINESTATE;
struct _FILE_SYSTEM;
@@ -165,9 +152,6 @@
*/
PPARTENTRY OriginalSystemPartition;
- PPARTENTRY TempPartition;
- FORMATMACHINESTATE FormatState;
-
LIST_ENTRY DiskListHead;
LIST_ENTRY BiosDiskListHead;
@@ -236,7 +220,7 @@
DestroyPartitionList(
IN PPARTLIST List);
-ULONG
+BOOLEAN
SelectPartition(
IN PPARTLIST List,
IN ULONG DiskNumber,
@@ -273,9 +257,7 @@
VOID
CheckActiveSystemPartition(
- IN PPARTLIST List // ,
- // IN PFILE_SYSTEM_LIST FileSystemList /* Needed for checking the FS of the candidate
system partition */
- );
+ IN PPARTLIST List);
BOOLEAN
WritePartitionsToDisk(
Modified: branches/setup_improvements/base/setup/usetup/partlist.h
URL:
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/u…
==============================================================================
--- branches/setup_improvements/base/setup/usetup/partlist.h [iso-8859-1] (original)
+++ branches/setup_improvements/base/setup/usetup/partlist.h [iso-8859-1] Wed May 17
23:37:07 2017
@@ -27,7 +27,6 @@
#include "../lib/partlist.h"
-#if 0
typedef enum _FORMATMACHINESTATE
{
Start,
@@ -40,7 +39,6 @@
CheckOtherPartition,
CheckDone
} FORMATMACHINESTATE, *PFORMATMACHINESTATE;
-#endif
typedef struct _PARTLIST_UI
{