Author: ekohl
Date: Sun Jun 21 08:55:43 2015
New Revision: 68226
URL:
http://svn.reactos.org/svn/reactos?rev=68226&view=rev
Log:
[USETUP]
UpdateDiskLayout:
- Set the proper HiddenSectors value.
- Fix counting the PartitonaNumber.
UpdatePartitionNumbers() has become obsolete. Remove it.
Modified:
trunk/reactos/base/setup/usetup/partlist.c
Modified: trunk/reactos/base/setup/usetup/partlist.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/partlist…
==============================================================================
--- trunk/reactos/base/setup/usetup/partlist.c [iso-8859-1] (original)
+++ trunk/reactos/base/setup/usetup/partlist.c [iso-8859-1] Sun Jun 21 08:55:43 2015
@@ -206,52 +206,6 @@
}
-static
-VOID
-UpdatePartitionNumbers(
- PDISKENTRY DiskEntry)
-{
- PPARTENTRY PartEntry;
- PLIST_ENTRY Entry;
-// ULONG PartitionNumber = 1;
- ULONG PartitionIndex = 0;
-
- Entry = DiskEntry->PrimaryPartListHead.Flink;
- while (Entry != &DiskEntry->PrimaryPartListHead)
- {
- PartEntry = CONTAINING_RECORD(Entry,
- PARTENTRY,
- ListEntry);
-
- if (PartEntry->IsPartitioned == FALSE)
- {
-// PartEntry->PartitionNumber = 0;
- PartEntry->PartitionIndex = (ULONG)-1;
- }
- else
- {
- if (IsContainerPartition(PartEntry->PartitionType))
- {
-// PartEntry->PartitionNumber = 0;
- }
- else if (PartEntry->PartitionType == PARTITION_ENTRY_UNUSED &&
- PartEntry->SectorCount.QuadPart == 0ULL)
- {
-// PartEntry->PartitionNumber = 0;
- }
- else
- {
-// PartEntry->PartitionNumber = PartitionNumber++;
- }
-
- PartEntry->PartitionIndex = PartitionIndex++;
- }
-
- Entry = Entry->Flink;
- }
-}
-
-
NTSTATUS
NTAPI
DiskIdentifierQueryRoutine(
@@ -2297,7 +2251,7 @@
PartitionInfo->StartingOffset.QuadPart =
PartEntry->StartSector.QuadPart * DiskEntry->BytesPerSector;
PartitionInfo->PartitionLength.QuadPart =
PartEntry->SectorCount.QuadPart * DiskEntry->BytesPerSector;
- PartitionInfo->HiddenSectors = 0;
+ PartitionInfo->HiddenSectors = PartEntry->StartSector.LowPart;
PartitionInfo->PartitionNumber =
(!IsContainerPartition(PartEntry->PartitionType)) ? PartitionNumber : 0;
PartitionInfo->PartitionType = PartEntry->PartitionType;
PartitionInfo->BootIndicator = PartEntry->BootIndicator;
@@ -2306,13 +2260,10 @@
PartEntry->PartitionNumber = PartitionNumber;
PartEntry->PartitionIndex = Index;
-
+ }
+
+ if (!IsContainerPartition(PartEntry->PartitionType))
PartitionNumber++;
- }
- else if (!IsEmptyLayoutEntry(PartitionInfo))
- {
- PartitionNumber++;
- }
Index++;
}
@@ -2480,8 +2431,6 @@
DiskEntry->Dirty = TRUE;
- UpdatePartitionNumbers(DiskEntry);
-
AssignDriveLetters(List);
}
@@ -2624,8 +2573,6 @@
UpdateDiskLayout(DiskEntry);
DiskEntry->Dirty = TRUE;
-
- UpdatePartitionNumbers(DiskEntry);
AssignDriveLetters(List);
}
@@ -2712,8 +2659,6 @@
DiskEntry->Dirty = TRUE;
- UpdatePartitionNumbers(DiskEntry);
-
AssignDriveLetters(List);
}
@@ -2822,8 +2767,6 @@
UpdateDiskLayout(DiskEntry);
DiskEntry->Dirty = TRUE;
-
- UpdatePartitionNumbers(DiskEntry);
AssignDriveLetters(List);
}