mirror of
https://github.com/reactos/reactos.git
synced 2025-02-23 17:05:46 +00:00
[FORMATTING]
No code changes! svn path=/trunk/; revision=63168
This commit is contained in:
parent
2ed05c2f8f
commit
921ed79298
2 changed files with 2677 additions and 2578 deletions
|
@ -33,8 +33,10 @@
|
|||
|
||||
/* FUNCTIONS ****************************************************************/
|
||||
|
||||
static VOID
|
||||
GetDriverName (PDISKENTRY DiskEntry)
|
||||
static
|
||||
VOID
|
||||
GetDriverName(
|
||||
PDISKENTRY DiskEntry)
|
||||
{
|
||||
RTL_QUERY_REGISTRY_TABLE QueryTable[2];
|
||||
WCHAR KeyName[32];
|
||||
|
@ -66,8 +68,10 @@ GetDriverName (PDISKENTRY DiskEntry)
|
|||
}
|
||||
|
||||
|
||||
static VOID
|
||||
AssignDriverLetters (PPARTLIST List)
|
||||
static
|
||||
VOID
|
||||
AssignDriverLetters(
|
||||
PPARTLIST List)
|
||||
{
|
||||
PDISKENTRY DiskEntry;
|
||||
PPARTENTRY PartEntry;
|
||||
|
@ -161,8 +165,10 @@ AssignDriverLetters (PPARTLIST List)
|
|||
}
|
||||
|
||||
|
||||
static VOID
|
||||
UpdatePartitionNumbers (PDISKENTRY DiskEntry)
|
||||
static
|
||||
VOID
|
||||
UpdatePartitionNumbers(
|
||||
PDISKENTRY DiskEntry)
|
||||
{
|
||||
PPARTENTRY PartEntry;
|
||||
PLIST_ENTRY Entry;
|
||||
|
@ -210,8 +216,10 @@ UpdatePartitionNumbers (PDISKENTRY DiskEntry)
|
|||
}
|
||||
|
||||
|
||||
static VOID
|
||||
AddPartitionToList (ULONG DiskNumber,
|
||||
static
|
||||
VOID
|
||||
AddPartitionToList(
|
||||
ULONG DiskNumber,
|
||||
PDISKENTRY DiskEntry,
|
||||
DRIVE_LAYOUT_INFORMATION *LayoutBuffer)
|
||||
{
|
||||
|
@ -229,6 +237,7 @@ AddPartitionToList (ULONG DiskNumber,
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (j >= 4)
|
||||
{
|
||||
continue;
|
||||
|
@ -320,8 +329,10 @@ AddPartitionToList (ULONG DiskNumber,
|
|||
}
|
||||
|
||||
|
||||
static VOID
|
||||
ScanForUnpartitionedDiskSpace (PDISKENTRY DiskEntry)
|
||||
static
|
||||
VOID
|
||||
ScanForUnpartitionedDiskSpace(
|
||||
PDISKENTRY DiskEntry)
|
||||
{
|
||||
ULONGLONG LastStartingOffset;
|
||||
ULONGLONG LastPartitionLength;
|
||||
|
@ -445,9 +456,11 @@ ScanForUnpartitionedDiskSpace (PDISKENTRY DiskEntry)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
DiskIdentifierQueryRoutine(PWSTR ValueName,
|
||||
DiskIdentifierQueryRoutine(
|
||||
PWSTR ValueName,
|
||||
ULONG ValueType,
|
||||
PVOID ValueData,
|
||||
ULONG ValueLength,
|
||||
|
@ -469,12 +482,15 @@ DiskIdentifierQueryRoutine(PWSTR ValueName,
|
|||
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
return STATUS_UNSUCCESSFUL;
|
||||
}
|
||||
|
||||
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
DiskConfigurationDataQueryRoutine(PWSTR ValueName,
|
||||
DiskConfigurationDataQueryRoutine(
|
||||
PWSTR ValueName,
|
||||
ULONG ValueType,
|
||||
PVOID ValueData,
|
||||
ULONG ValueLength,
|
||||
|
@ -491,10 +507,13 @@ DiskConfigurationDataQueryRoutine(PWSTR ValueName,
|
|||
return STATUS_UNSUCCESSFUL;
|
||||
|
||||
FullResourceDescriptor = (PCM_FULL_RESOURCE_DESCRIPTOR)ValueData;
|
||||
|
||||
/* Hm. Version and Revision are not set on Microsoft Windows XP... */
|
||||
/*if (FullResourceDescriptor->PartialResourceList.Version != 1 ||
|
||||
#if 0
|
||||
if (FullResourceDescriptor->PartialResourceList.Version != 1 ||
|
||||
FullResourceDescriptor->PartialResourceList.Revision != 1)
|
||||
return STATUS_UNSUCCESSFUL;*/
|
||||
return STATUS_UNSUCCESSFUL;
|
||||
#endif
|
||||
|
||||
for (i = 0; i < FullResourceDescriptor->PartialResourceList.Count; i++)
|
||||
{
|
||||
|
@ -507,12 +526,15 @@ DiskConfigurationDataQueryRoutine(PWSTR ValueName,
|
|||
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
return STATUS_UNSUCCESSFUL;
|
||||
}
|
||||
|
||||
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
SystemConfigurationDataQueryRoutine(PWSTR ValueName,
|
||||
SystemConfigurationDataQueryRoutine(
|
||||
PWSTR ValueName,
|
||||
ULONG ValueType,
|
||||
PVOID ValueData,
|
||||
ULONG ValueLength,
|
||||
|
@ -528,10 +550,13 @@ SystemConfigurationDataQueryRoutine(PWSTR ValueName,
|
|||
return STATUS_UNSUCCESSFUL;
|
||||
|
||||
FullResourceDescriptor = (PCM_FULL_RESOURCE_DESCRIPTOR)ValueData;
|
||||
|
||||
/* Hm. Version and Revision are not set on Microsoft Windows XP... */
|
||||
/*if (FullResourceDescriptor->PartialResourceList.Version != 1 ||
|
||||
#if 0
|
||||
if (FullResourceDescriptor->PartialResourceList.Version != 1 ||
|
||||
FullResourceDescriptor->PartialResourceList.Revision != 1)
|
||||
return STATUS_UNSUCCESSFUL;*/
|
||||
return STATUS_UNSUCCESSFUL;
|
||||
#endif
|
||||
|
||||
for (i = 0; i < FullResourceDescriptor->PartialResourceList.Count; i++)
|
||||
{
|
||||
|
@ -542,17 +567,22 @@ SystemConfigurationDataQueryRoutine(PWSTR ValueName,
|
|||
*Int13Drives = (CM_INT13_DRIVE_PARAMETER*) RtlAllocateHeap(ProcessHeap, 0, FullResourceDescriptor->PartialResourceList.PartialDescriptors[i].u.DeviceSpecificData.DataSize);
|
||||
if (*Int13Drives == NULL)
|
||||
return STATUS_NO_MEMORY;
|
||||
|
||||
memcpy(*Int13Drives,
|
||||
&FullResourceDescriptor->PartialResourceList.PartialDescriptors[i + 1],
|
||||
FullResourceDescriptor->PartialResourceList.PartialDescriptors[i].u.DeviceSpecificData.DataSize);
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
return STATUS_UNSUCCESSFUL;
|
||||
}
|
||||
|
||||
|
||||
#define ROOT_NAME L"\\Registry\\Machine\\HARDWARE\\DESCRIPTION\\System\\MultifunctionAdapter"
|
||||
|
||||
static VOID
|
||||
EnumerateBiosDiskEntries(PPARTLIST PartList)
|
||||
EnumerateBiosDiskEntries(
|
||||
PPARTLIST PartList)
|
||||
{
|
||||
RTL_QUERY_REGISTRY_TABLE QueryTable[3];
|
||||
WCHAR Name[120];
|
||||
|
@ -626,6 +656,7 @@ EnumerateBiosDiskEntries(PPARTLIST PartList)
|
|||
QueryTable[0].QueryRoutine = DiskIdentifierQueryRoutine;
|
||||
QueryTable[1].Name = L"Configuration Data";
|
||||
QueryTable[1].QueryRoutine = DiskConfigurationDataQueryRoutine;
|
||||
|
||||
DiskCount = 0;
|
||||
while (1)
|
||||
{
|
||||
|
@ -634,6 +665,7 @@ EnumerateBiosDiskEntries(PPARTLIST PartList)
|
|||
{
|
||||
break;
|
||||
}
|
||||
|
||||
swprintf(Name, L"%s\\%lu\\DiskController\\0\\DiskPeripheral\\%lu", ROOT_NAME, AdapterCount, DiskCount);
|
||||
Status = RtlQueryRegistryValues(RTL_REGISTRY_ABSOLUTE,
|
||||
Name,
|
||||
|
@ -645,6 +677,7 @@ EnumerateBiosDiskEntries(PPARTLIST PartList)
|
|||
RtlFreeHeap(ProcessHeap, 0, BiosDiskEntry);
|
||||
break;
|
||||
}
|
||||
|
||||
BiosDiskEntry->DiskNumber = DiskCount;
|
||||
BiosDiskEntry->Recognized = FALSE;
|
||||
|
||||
|
@ -657,7 +690,6 @@ EnumerateBiosDiskEntries(PPARTLIST PartList)
|
|||
DPRINT1("Didn't find int13 drive datas for disk %u\n", DiskCount);
|
||||
}
|
||||
|
||||
|
||||
InsertTailList(&PartList->BiosDiskListHead, &BiosDiskEntry->ListEntry);
|
||||
|
||||
DPRINT("DiskNumber: %lu\n", BiosDiskEntry->DiskNumber);
|
||||
|
@ -675,17 +707,23 @@ EnumerateBiosDiskEntries(PPARTLIST PartList)
|
|||
DiskCount++;
|
||||
}
|
||||
}
|
||||
|
||||
RtlFreeHeap(ProcessHeap, 0, Int13Drives);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
AdapterCount++;
|
||||
}
|
||||
|
||||
RtlFreeHeap(ProcessHeap, 0, Int13Drives);
|
||||
}
|
||||
|
||||
static VOID
|
||||
AddDiskToList (HANDLE FileHandle,
|
||||
|
||||
static
|
||||
VOID
|
||||
AddDiskToList(
|
||||
HANDLE FileHandle,
|
||||
ULONG DiskNumber,
|
||||
PPARTLIST List)
|
||||
{
|
||||
|
@ -745,7 +783,6 @@ AddDiskToList (HANDLE FileHandle,
|
|||
Mbr = (PARTITION_SECTOR*)RtlAllocateHeap(ProcessHeap,
|
||||
0,
|
||||
DiskGeometry.BytesPerSector);
|
||||
|
||||
if (Mbr == NULL)
|
||||
{
|
||||
return;
|
||||
|
@ -924,7 +961,8 @@ AddDiskToList (HANDLE FileHandle,
|
|||
|
||||
|
||||
PPARTLIST
|
||||
CreatePartitionList (SHORT Left,
|
||||
CreatePartitionList(
|
||||
SHORT Left,
|
||||
SHORT Top,
|
||||
SHORT Right,
|
||||
SHORT Bottom)
|
||||
|
@ -1020,8 +1058,7 @@ CreatePartitionList (SHORT Left,
|
|||
}
|
||||
else
|
||||
{
|
||||
List->CurrentDisk =
|
||||
CONTAINING_RECORD (List->DiskListHead.Flink,
|
||||
List->CurrentDisk = CONTAINING_RECORD(List->DiskListHead.Flink,
|
||||
DISKENTRY,
|
||||
ListEntry);
|
||||
|
||||
|
@ -1032,8 +1069,7 @@ CreatePartitionList (SHORT Left,
|
|||
}
|
||||
else
|
||||
{
|
||||
List->CurrentPartition =
|
||||
CONTAINING_RECORD (List->CurrentDisk->PartListHead.Flink,
|
||||
List->CurrentPartition = CONTAINING_RECORD(List->CurrentDisk->PartListHead.Flink,
|
||||
PARTENTRY,
|
||||
ListEntry);
|
||||
List->CurrentPartitionNumber = 0;
|
||||
|
@ -1045,7 +1081,8 @@ CreatePartitionList (SHORT Left,
|
|||
|
||||
|
||||
VOID
|
||||
DestroyPartitionList (PPARTLIST List)
|
||||
DestroyPartitionList(
|
||||
PPARTLIST List)
|
||||
{
|
||||
PDISKENTRY DiskEntry;
|
||||
PBIOSDISKENTRY BiosDiskEntry;
|
||||
|
@ -1090,8 +1127,10 @@ DestroyPartitionList (PPARTLIST List)
|
|||
}
|
||||
|
||||
|
||||
static VOID
|
||||
PrintEmptyLine (PPARTLIST List)
|
||||
static
|
||||
VOID
|
||||
PrintEmptyLine(
|
||||
PPARTLIST List)
|
||||
{
|
||||
COORD coPos;
|
||||
DWORD Written;
|
||||
|
@ -1101,7 +1140,6 @@ PrintEmptyLine (PPARTLIST List)
|
|||
Width = List->Right - List->Left - 1;
|
||||
Height = List->Bottom - List->Top - 2;
|
||||
|
||||
|
||||
coPos.X = List->Left + 1;
|
||||
coPos.Y = List->Top + 1 + List->Line;
|
||||
|
||||
|
@ -1119,12 +1157,15 @@ PrintEmptyLine (PPARTLIST List)
|
|||
coPos,
|
||||
&Written);
|
||||
}
|
||||
|
||||
List->Line++;
|
||||
}
|
||||
|
||||
|
||||
static VOID
|
||||
PrintPartitionData (PPARTLIST List,
|
||||
static
|
||||
VOID
|
||||
PrintPartitionData(
|
||||
PPARTLIST List,
|
||||
PDISKENTRY DiskEntry,
|
||||
PPARTENTRY PartEntry,
|
||||
ULONG PartNumber)
|
||||
|
@ -1134,7 +1175,6 @@ PrintPartitionData (PPARTLIST List,
|
|||
DWORD Written;
|
||||
USHORT Width;
|
||||
USHORT Height;
|
||||
|
||||
LARGE_INTEGER PartSize;
|
||||
PCHAR Unit;
|
||||
UCHAR Attribute;
|
||||
|
@ -1143,7 +1183,6 @@ PrintPartitionData (PPARTLIST List,
|
|||
Width = List->Right - List->Left - 1;
|
||||
Height = List->Bottom - List->Top - 2;
|
||||
|
||||
|
||||
coPos.X = List->Left + 1;
|
||||
coPos.Y = List->Top + 1 + List->Line;
|
||||
|
||||
|
@ -1280,12 +1319,15 @@ PrintPartitionData (PPARTLIST List,
|
|||
coPos,
|
||||
&Written);
|
||||
}
|
||||
|
||||
List->Line++;
|
||||
}
|
||||
|
||||
|
||||
static VOID
|
||||
PrintDiskData (PPARTLIST List,
|
||||
static
|
||||
VOID
|
||||
PrintDiskData(
|
||||
PPARTLIST List,
|
||||
PDISKENTRY DiskEntry)
|
||||
{
|
||||
PPARTENTRY PartEntry;
|
||||
|
@ -1302,7 +1344,6 @@ PrintDiskData (PPARTLIST List,
|
|||
Width = List->Right - List->Left - 1;
|
||||
Height = List->Bottom - List->Top - 2;
|
||||
|
||||
|
||||
coPos.X = List->Left + 1;
|
||||
coPos.Y = List->Top + 1 + List->Line;
|
||||
|
||||
|
@ -1344,6 +1385,7 @@ PrintDiskData (PPARTLIST List,
|
|||
DiskEntry->Bus,
|
||||
DiskEntry->Id);
|
||||
}
|
||||
|
||||
if (List->Line >= 0 && List->Line <= Height)
|
||||
{
|
||||
FillConsoleOutputAttribute(StdOutput,
|
||||
|
@ -1368,6 +1410,7 @@ PrintDiskData (PPARTLIST List,
|
|||
coPos,
|
||||
&Written);
|
||||
}
|
||||
|
||||
List->Line++;
|
||||
|
||||
/* Print separator line */
|
||||
|
@ -1410,7 +1453,8 @@ PrintDiskData (PPARTLIST List,
|
|||
|
||||
|
||||
VOID
|
||||
DrawPartitionList (PPARTLIST List)
|
||||
DrawPartitionList(
|
||||
PPARTLIST List)
|
||||
{
|
||||
PLIST_ENTRY Entry, Entry2;
|
||||
PDISKENTRY DiskEntry;
|
||||
|
@ -1428,15 +1472,18 @@ DrawPartitionList (PPARTLIST List)
|
|||
CurrentDiskLine = 0;
|
||||
CurrentPartLine = 0;
|
||||
LastLine = 0;
|
||||
|
||||
Entry = List->DiskListHead.Flink;
|
||||
while (Entry != &List->DiskListHead)
|
||||
{
|
||||
DiskEntry = CONTAINING_RECORD(Entry, DISKENTRY, ListEntry);
|
||||
|
||||
LastLine += 2;
|
||||
if (CurrentPartLineFound == FALSE)
|
||||
{
|
||||
CurrentPartLine += 2;
|
||||
}
|
||||
|
||||
Entry2 = DiskEntry->PartListHead.Flink;
|
||||
while (Entry2 != &DiskEntry->PartListHead)
|
||||
{
|
||||
|
@ -1445,17 +1492,21 @@ DrawPartitionList (PPARTLIST List)
|
|||
{
|
||||
CurrentPartLineFound = TRUE;
|
||||
}
|
||||
|
||||
Entry2 = Entry2->Flink;
|
||||
if (CurrentPartLineFound == FALSE)
|
||||
{
|
||||
CurrentPartLine++;
|
||||
}
|
||||
|
||||
LastLine++;
|
||||
}
|
||||
|
||||
if (DiskEntry == List->CurrentDisk)
|
||||
{
|
||||
CurrentDiskLineFound = TRUE;
|
||||
}
|
||||
|
||||
Entry = Entry->Flink;
|
||||
if (Entry != &List->DiskListHead)
|
||||
{
|
||||
|
@ -1464,6 +1515,7 @@ DrawPartitionList (PPARTLIST List)
|
|||
CurrentPartLine ++;
|
||||
CurrentDiskLine = CurrentPartLine;
|
||||
}
|
||||
|
||||
LastLine++;
|
||||
}
|
||||
else
|
||||
|
@ -1481,12 +1533,12 @@ DrawPartitionList (PPARTLIST List)
|
|||
{
|
||||
List->Offset = CurrentPartLine - (List->Bottom - List->Top - 2);
|
||||
}
|
||||
|
||||
if (CurrentDiskLine < List->Offset && CurrentPartLine - CurrentDiskLine < List->Bottom - List->Top - 2)
|
||||
{
|
||||
List->Offset = CurrentDiskLine;
|
||||
}
|
||||
|
||||
|
||||
/* draw upper left corner */
|
||||
coPos.X = List->Left;
|
||||
coPos.Y = List->Top;
|
||||
|
@ -1624,7 +1676,10 @@ DrawPartitionList (PPARTLIST List)
|
|||
|
||||
|
||||
DWORD
|
||||
SelectPartition(PPARTLIST List, ULONG DiskNumber, ULONG PartitionNumber)
|
||||
SelectPartition(
|
||||
PPARTLIST List,
|
||||
ULONG DiskNumber,
|
||||
ULONG PartitionNumber)
|
||||
{
|
||||
PDISKENTRY DiskEntry;
|
||||
PPARTENTRY PartEntry;
|
||||
|
@ -1660,18 +1715,23 @@ SelectPartition(PPARTLIST List, ULONG DiskNumber, ULONG PartitionNumber)
|
|||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
Entry2 = Entry2->Flink;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
Entry1 = Entry1->Flink;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
VOID
|
||||
ScrollDownPartitionList (PPARTLIST List)
|
||||
ScrollDownPartitionList(
|
||||
PPARTLIST List)
|
||||
{
|
||||
PDISKENTRY DiskEntry;
|
||||
PPARTENTRY PartEntry;
|
||||
|
@ -1721,6 +1781,7 @@ ScrollDownPartitionList (PPARTLIST List)
|
|||
DrawPartitionList(List);
|
||||
return;
|
||||
}
|
||||
|
||||
Entry2 = Entry2->Flink;
|
||||
}
|
||||
}
|
||||
|
@ -1757,7 +1818,8 @@ ScrollDownPartitionList (PPARTLIST List)
|
|||
|
||||
|
||||
VOID
|
||||
ScrollUpPartitionList (PPARTLIST List)
|
||||
ScrollUpPartitionList(
|
||||
PPARTLIST List)
|
||||
{
|
||||
PDISKENTRY DiskEntry;
|
||||
PPARTENTRY PartEntry;
|
||||
|
@ -1816,6 +1878,7 @@ ScrollUpPartitionList (PPARTLIST List)
|
|||
DrawPartitionList(List);
|
||||
return;
|
||||
}
|
||||
|
||||
Entry2 = Entry2->Blink;
|
||||
}
|
||||
}
|
||||
|
@ -1863,8 +1926,10 @@ ScrollUpPartitionList (PPARTLIST List)
|
|||
}
|
||||
|
||||
|
||||
static PPARTENTRY
|
||||
GetPrevPartitionedEntry (PDISKENTRY DiskEntry,
|
||||
static
|
||||
PPARTENTRY
|
||||
GetPrevPartitionedEntry(
|
||||
PDISKENTRY DiskEntry,
|
||||
PPARTENTRY CurrentEntry)
|
||||
{
|
||||
PPARTENTRY PrevEntry;
|
||||
|
@ -1889,8 +1954,10 @@ GetPrevPartitionedEntry (PDISKENTRY DiskEntry,
|
|||
}
|
||||
|
||||
|
||||
static PPARTENTRY
|
||||
GetNextPartitionedEntry (PDISKENTRY DiskEntry,
|
||||
static
|
||||
PPARTENTRY
|
||||
GetNextPartitionedEntry(
|
||||
PDISKENTRY DiskEntry,
|
||||
PPARTENTRY CurrentEntry)
|
||||
{
|
||||
PPARTENTRY NextEntry;
|
||||
|
@ -1915,8 +1982,10 @@ GetNextPartitionedEntry (PDISKENTRY DiskEntry,
|
|||
}
|
||||
|
||||
|
||||
static PPARTENTRY
|
||||
GetPrevUnpartitionedEntry (PDISKENTRY DiskEntry,
|
||||
static
|
||||
PPARTENTRY
|
||||
GetPrevUnpartitionedEntry(
|
||||
PDISKENTRY DiskEntry,
|
||||
PPARTENTRY PartEntry)
|
||||
{
|
||||
PPARTENTRY PrevPartEntry;
|
||||
|
@ -1934,8 +2003,10 @@ GetPrevUnpartitionedEntry (PDISKENTRY DiskEntry,
|
|||
}
|
||||
|
||||
|
||||
static PPARTENTRY
|
||||
GetNextUnpartitionedEntry (PDISKENTRY DiskEntry,
|
||||
static
|
||||
PPARTENTRY
|
||||
GetNextUnpartitionedEntry(
|
||||
PDISKENTRY DiskEntry,
|
||||
PPARTENTRY PartEntry)
|
||||
{
|
||||
PPARTENTRY NextPartEntry;
|
||||
|
@ -1954,7 +2025,8 @@ GetNextUnpartitionedEntry (PDISKENTRY DiskEntry,
|
|||
|
||||
|
||||
VOID
|
||||
CreateNewPartition (PPARTLIST List,
|
||||
CreateNewPartition(
|
||||
PPARTLIST List,
|
||||
ULONGLONG PartitionSize,
|
||||
BOOLEAN AutoCreate)
|
||||
{
|
||||
|
@ -2126,7 +2198,6 @@ CreateNewPartition (PPARTLIST List,
|
|||
NewPartEntry->PartInfo[1].RewritePartition = TRUE;
|
||||
|
||||
/* Update previous container partition data */
|
||||
|
||||
PrevPartEntry->PartInfo[1].StartingOffset.QuadPart =
|
||||
NewPartEntry->PartInfo[0].StartingOffset.QuadPart - DiskEntry->TrackSize;
|
||||
PrevPartEntry->PartInfo[1].HiddenSectors =
|
||||
|
@ -2201,7 +2272,8 @@ CreateNewPartition (PPARTLIST List,
|
|||
|
||||
|
||||
VOID
|
||||
DeleteCurrentPartition (PPARTLIST List)
|
||||
DeleteCurrentPartition(
|
||||
PPARTLIST List)
|
||||
{
|
||||
PDISKENTRY DiskEntry;
|
||||
PPARTENTRY PartEntry;
|
||||
|
@ -2354,7 +2426,8 @@ DeleteCurrentPartition (PPARTLIST List)
|
|||
|
||||
|
||||
VOID
|
||||
CheckActiveBootPartition (PPARTLIST List)
|
||||
CheckActiveBootPartition(
|
||||
PPARTLIST List)
|
||||
{
|
||||
PDISKENTRY DiskEntry;
|
||||
PPARTENTRY PartEntry;
|
||||
|
@ -2447,6 +2520,7 @@ CheckActiveBootPartition (PPARTLIST List)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Go to the next one */
|
||||
ListEntry = ListEntry->Flink;
|
||||
}
|
||||
|
@ -2454,7 +2528,8 @@ CheckActiveBootPartition (PPARTLIST List)
|
|||
|
||||
|
||||
BOOLEAN
|
||||
CheckForLinuxFdiskPartitions (PPARTLIST List)
|
||||
CheckForLinuxFdiskPartitions(
|
||||
PPARTLIST List)
|
||||
{
|
||||
PDISKENTRY DiskEntry;
|
||||
PPARTENTRY PartEntry;
|
||||
|
@ -2507,7 +2582,8 @@ CheckForLinuxFdiskPartitions (PPARTLIST List)
|
|||
|
||||
|
||||
BOOLEAN
|
||||
WritePartitionsToDisk (PPARTLIST List)
|
||||
WritePartitionsToDisk(
|
||||
PPARTLIST List)
|
||||
{
|
||||
PDRIVE_LAYOUT_INFORMATION DriveLayout;
|
||||
OBJECT_ATTRIBUTES ObjectAttributes;
|
||||
|
@ -2541,6 +2617,7 @@ WritePartitionsToDisk (PPARTLIST List)
|
|||
{
|
||||
/* Count partitioned entries */
|
||||
PartitionCount = 0;
|
||||
|
||||
Entry2 = DiskEntry1->PartListHead.Flink;
|
||||
while (Entry2 != &DiskEntry1->PartListHead)
|
||||
{
|
||||
|
@ -2554,6 +2631,7 @@ WritePartitionsToDisk (PPARTLIST List)
|
|||
|
||||
Entry2 = Entry2->Flink;
|
||||
}
|
||||
|
||||
if (PartitionCount == 0)
|
||||
{
|
||||
DriveLayoutSize = sizeof (DRIVE_LAYOUT_INFORMATION) +
|
||||
|
@ -2564,6 +2642,7 @@ WritePartitionsToDisk (PPARTLIST List)
|
|||
DriveLayoutSize = sizeof (DRIVE_LAYOUT_INFORMATION) +
|
||||
((PartitionCount - 1) * sizeof (PARTITION_INFORMATION));
|
||||
}
|
||||
|
||||
DriveLayout = (PDRIVE_LAYOUT_INFORMATION)RtlAllocateHeap(ProcessHeap,
|
||||
0,
|
||||
DriveLayoutSize);
|
||||
|
@ -2588,8 +2667,8 @@ WritePartitionsToDisk (PPARTLIST List)
|
|||
else
|
||||
{
|
||||
DriveLayout->PartitionCount = PartitionCount;
|
||||
|
||||
Index = 0;
|
||||
|
||||
Entry2 = DiskEntry1->PartListHead.Flink;
|
||||
while (Entry2 != &DiskEntry1->PartListHead)
|
||||
{
|
||||
|
@ -2607,6 +2686,7 @@ WritePartitionsToDisk (PPARTLIST List)
|
|||
Entry2 = Entry2->Flink;
|
||||
}
|
||||
}
|
||||
|
||||
if (DiskEntry1->Signature == 0)
|
||||
{
|
||||
LARGE_INTEGER SystemTime;
|
||||
|
@ -2643,8 +2723,10 @@ WritePartitionsToDisk (PPARTLIST List)
|
|||
{
|
||||
break;
|
||||
}
|
||||
|
||||
Entry2 = Entry2->Flink;
|
||||
}
|
||||
|
||||
if (Entry2 == &List->DiskListHead)
|
||||
{
|
||||
break;
|
||||
|
@ -2653,12 +2735,10 @@ WritePartitionsToDisk (PPARTLIST List)
|
|||
|
||||
/* set one partition entry to dirty, this will update the signature */
|
||||
DriveLayout->PartitionEntry[0].RewritePartition = TRUE;
|
||||
|
||||
}
|
||||
|
||||
DriveLayout->Signature = DiskEntry1->Signature;
|
||||
|
||||
|
||||
swprintf(DstPath,
|
||||
L"\\Device\\Harddisk%d\\Partition0",
|
||||
DiskEntry1->DiskNumber);
|
||||
|
@ -2676,7 +2756,6 @@ WritePartitionsToDisk (PPARTLIST List)
|
|||
&Iosb,
|
||||
0,
|
||||
FILE_SYNCHRONOUS_IO_NONALERT);
|
||||
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
DPRINT1("NtOpenFile() failed (Status %lx)\n", Status);
|
||||
|
@ -2713,7 +2792,10 @@ WritePartitionsToDisk (PPARTLIST List)
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL SetMountedDeviceValues(PPARTLIST List)
|
||||
|
||||
BOOL
|
||||
SetMountedDeviceValues(
|
||||
PPARTLIST List)
|
||||
{
|
||||
PLIST_ENTRY Entry1, Entry2;
|
||||
PDISKENTRY DiskEntry;
|
||||
|
@ -2742,20 +2824,23 @@ BOOL SetMountedDeviceValues(PPARTLIST List)
|
|||
{
|
||||
if (PartEntry->DriveLetter[i])
|
||||
{
|
||||
if (!SetMountedDeviceValue(PartEntry->DriveLetter[i], DiskEntry->Signature, PartEntry->PartInfo[i].StartingOffset))
|
||||
if (!SetMountedDeviceValue(PartEntry->DriveLetter[i],
|
||||
DiskEntry->Signature,
|
||||
PartEntry->PartInfo[i].StartingOffset))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Entry2 = Entry2->Flink;
|
||||
}
|
||||
|
||||
Entry1 = Entry1->Flink;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* EOF */
|
||||
|
|
|
@ -181,44 +181,58 @@ typedef struct
|
|||
} BIOS_DISK, *PBIOS_DISK;
|
||||
|
||||
PPARTLIST
|
||||
CreatePartitionList (SHORT Left,
|
||||
CreatePartitionList(
|
||||
SHORT Left,
|
||||
SHORT Top,
|
||||
SHORT Right,
|
||||
SHORT Bottom);
|
||||
|
||||
VOID
|
||||
DestroyPartitionList (PPARTLIST List);
|
||||
DestroyPartitionList(
|
||||
PPARTLIST List);
|
||||
|
||||
VOID
|
||||
DrawPartitionList (PPARTLIST List);
|
||||
DrawPartitionList(
|
||||
PPARTLIST List);
|
||||
|
||||
DWORD
|
||||
SelectPartition(PPARTLIST List, ULONG DiskNumber, ULONG PartitionNumber);
|
||||
SelectPartition(
|
||||
PPARTLIST List,
|
||||
ULONG DiskNumber,
|
||||
ULONG PartitionNumber);
|
||||
|
||||
BOOL
|
||||
SetMountedDeviceValues(PPARTLIST List);
|
||||
SetMountedDeviceValues(
|
||||
PPARTLIST List);
|
||||
|
||||
VOID
|
||||
ScrollDownPartitionList (PPARTLIST List);
|
||||
ScrollDownPartitionList(
|
||||
PPARTLIST List);
|
||||
|
||||
VOID
|
||||
ScrollUpPartitionList (PPARTLIST List);
|
||||
ScrollUpPartitionList(
|
||||
PPARTLIST List);
|
||||
|
||||
VOID
|
||||
CreateNewPartition (PPARTLIST List,
|
||||
CreateNewPartition(
|
||||
PPARTLIST List,
|
||||
ULONGLONG PartitionSize,
|
||||
BOOLEAN AutoCreate);
|
||||
|
||||
VOID
|
||||
DeleteCurrentPartition (PPARTLIST List);
|
||||
DeleteCurrentPartition(
|
||||
PPARTLIST List);
|
||||
|
||||
VOID
|
||||
CheckActiveBootPartition (PPARTLIST List);
|
||||
CheckActiveBootPartition(
|
||||
PPARTLIST List);
|
||||
|
||||
BOOLEAN
|
||||
CheckForLinuxFdiskPartitions (PPARTLIST List);
|
||||
CheckForLinuxFdiskPartitions(
|
||||
PPARTLIST List);
|
||||
|
||||
BOOLEAN
|
||||
WritePartitionsToDisk (PPARTLIST List);
|
||||
WritePartitionsToDisk(
|
||||
PPARTLIST List);
|
||||
|
||||
/* EOF */
|
||||
|
|
Loading…
Reference in a new issue