- Formatting fixes only.
[DISKPART]
- Fix a confusion CylinderAlignment vs. SectorAlignment.
- Formatting fixes.

svn path=/trunk/; revision=70820
This commit is contained in:
Hermès Bélusca-Maïto 2016-02-29 20:58:32 +00:00
parent 2f26a4a9e9
commit 679011f92d
3 changed files with 42 additions and 74 deletions

View file

@ -572,9 +572,9 @@ CheckUnattendedSetup(VOID)
}
/* search for LocaleID in the 'Unattend' section*/
if (SetupFindFirstLineW (UnattendInf, L"Unattend", L"LocaleID", &Context))
if (SetupFindFirstLineW(UnattendInf, L"Unattend", L"LocaleID", &Context))
{
if (INF_GetData (&Context, NULL, &Value))
if (INF_GetData(&Context, NULL, &Value))
{
LONG Id = wcstol(Value, NULL, 16);
swprintf(LocaleID,L"%08lx", Id);
@ -666,7 +666,7 @@ LanguagePage(PINPUT_RECORD Ir)
xScreen - 3,
yScreen - 3);
ScrollToPositionGenericList (LanguageList, GetDefaultLanguageIndex());
ScrollToPositionGenericList(LanguageList, GetDefaultLanguageIndex());
MUIDisplayPage(LANGUAGE_PAGE);
@ -677,7 +677,7 @@ LanguagePage(PINPUT_RECORD Ir)
if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
(Ir->Event.KeyEvent.wVirtualKeyCode == VK_DOWN)) /* DOWN */
{
ScrollDownGenericList (LanguageList);
ScrollDownGenericList(LanguageList);
RefreshPage = TRUE;
}
else if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
@ -1327,7 +1327,7 @@ HandleGenericList(PGENERIC_LIST GenericList,
ScrollUpGenericList(GenericList);
}
else if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
(Ir->Event.KeyEvent.wVirtualKeyCode == VK_NEXT)) /* PAGE DOWN */
(Ir->Event.KeyEvent.wVirtualKeyCode == VK_NEXT)) /* PAGE DOWN */
{
ScrollPageDownGenericList(GenericList);
}
@ -1337,7 +1337,7 @@ HandleGenericList(PGENERIC_LIST GenericList,
ScrollPageUpGenericList(GenericList);
}
else if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
(Ir->Event.KeyEvent.wVirtualKeyCode == VK_F3)) /* F3 */
(Ir->Event.KeyEvent.wVirtualKeyCode == VK_F3)) /* F3 */
{
if (ConfirmQuit(Ir) == TRUE)
return QUIT_PAGE;
@ -1530,7 +1530,7 @@ SelectPartitionPage(PINPUT_RECORD Ir)
/* FIXME: show an error dialog */
return QUIT_PAGE;
}
else if (IsListEmpty (&PartitionList->DiskListHead))
else if (IsListEmpty(&PartitionList->DiskListHead))
{
MUIDisplayError(ERROR_NO_HDD, Ir, POPUP_WAIT_ENTER);
return QUIT_PAGE;
@ -1966,10 +1966,8 @@ CreatePrimaryPartitionPage(PINPUT_RECORD Ir)
if (Quit == TRUE)
{
if (ConfirmQuit (Ir) == TRUE)
{
if (ConfirmQuit(Ir) == TRUE)
return QUIT_PAGE;
}
}
else if (Cancel == TRUE)
{
@ -2123,10 +2121,8 @@ CreateExtendedPartitionPage(PINPUT_RECORD Ir)
if (Quit == TRUE)
{
if (ConfirmQuit (Ir) == TRUE)
{
if (ConfirmQuit(Ir) == TRUE)
return QUIT_PAGE;
}
}
else if (Cancel == TRUE)
{
@ -2279,10 +2275,8 @@ CreateLogicalPartitionPage(PINPUT_RECORD Ir)
if (Quit == TRUE)
{
if (ConfirmQuit (Ir) == TRUE)
{
if (ConfirmQuit(Ir) == TRUE)
return QUIT_PAGE;
}
}
else if (Cancel == TRUE)
{
@ -2357,9 +2351,7 @@ ConfirmDeleteSystemPartitionPage(PINPUT_RECORD Ir)
(Ir->Event.KeyEvent.wVirtualKeyCode == VK_F3)) /* F3 */
{
if (ConfirmQuit(Ir) == TRUE)
{
return QUIT_PAGE;
}
break;
}
@ -2502,9 +2494,7 @@ DeletePartitionPage(PINPUT_RECORD Ir)
(Ir->Event.KeyEvent.wVirtualKeyCode == VK_F3)) /* F3 */
{
if (ConfirmQuit(Ir) == TRUE)
{
return QUIT_PAGE;
}
break;
}
@ -2801,9 +2791,7 @@ SelectFileSystemPage(PINPUT_RECORD Ir)
(Ir->Event.KeyEvent.wVirtualKeyCode == VK_F3)) /* F3 */
{
if (ConfirmQuit(Ir) == TRUE)
{
return QUIT_PAGE;
}
break;
}
@ -2896,9 +2884,7 @@ FormatPartitionPage(PINPUT_RECORD Ir)
(Ir->Event.KeyEvent.wVirtualKeyCode == VK_F3)) /* F3 */
{
if (ConfirmQuit(Ir) == TRUE)
{
return QUIT_PAGE;
}
break;
}
@ -2973,6 +2959,7 @@ FormatPartitionPage(PINPUT_RECORD Ir)
#endif
else if (!PartEntry->FileSystem->FormatFunc)
{
/* FIXME: show an error dialog */
return QUIT_PAGE;
}
@ -3708,11 +3695,12 @@ PrepareCopyPage(PINPUT_RECORD Ir)
if (SetupFileQueue == NULL)
{
MUIDisplayError(ERROR_COPY_QUEUE, Ir, POPUP_WAIT_ENTER);
return(QUIT_PAGE);
return QUIT_PAGE;
}
if (!PrepareCopyPageInfFile(SetupInf, NULL, Ir))
{
/* FIXME: show an error dialog */
return QUIT_PAGE;
}
@ -3775,6 +3763,7 @@ PrepareCopyPage(PINPUT_RECORD Ir)
if (!PrepareCopyPageInfFile(InfHandle, KeyValue, Ir))
{
/* FIXME: show an error dialog */
return QUIT_PAGE;
}
#endif
@ -4008,20 +3997,20 @@ RegistryPage(PINPUT_RECORD Ir)
do
{
INF_GetDataField (&InfContext, 0, &Action);
INF_GetDataField (&InfContext, 1, &File);
INF_GetDataField (&InfContext, 2, &Section);
INF_GetDataField(&InfContext, 0, &Action);
INF_GetDataField(&InfContext, 1, &File);
INF_GetDataField(&InfContext, 2, &Section);
DPRINT("Action: %S File: %S Section %S\n", Action, File, Section);
if (Action == NULL)
break; // Hackfix
if (!_wcsicmp (Action, L"AddReg"))
if (!_wcsicmp(Action, L"AddReg"))
{
Delete = FALSE;
}
else if (!_wcsicmp (Action, L"DelReg"))
else if (!_wcsicmp(Action, L"DelReg"))
{
Delete = TRUE;
}
@ -4420,7 +4409,7 @@ BootLoaderHarddiskMbrPage(PINPUT_RECORD Ir)
Status = InstallMbrBootCodeToDisk(SourceMbrPathBuffer,
DestinationDevicePathBuffer);
if (!NT_SUCCESS (Status))
if (!NT_SUCCESS(Status))
{
DPRINT1("InstallMbrBootCodeToDisk() failed (Status %lx)\n",
Status);
@ -4452,14 +4441,14 @@ QuitPage(PINPUT_RECORD Ir)
/* Destroy partition list */
if (PartitionList != NULL)
{
DestroyPartitionList (PartitionList);
DestroyPartitionList(PartitionList);
PartitionList = NULL;
}
/* Destroy filesystem list */
if (FileSystemList != NULL)
{
DestroyFileSystemList (FileSystemList);
DestroyFileSystemList(FileSystemList);
FileSystemList = NULL;
}

View file

@ -484,7 +484,7 @@ SystemConfigurationDataQueryRoutine(
ULONG i;
if (ValueType != REG_FULL_RESOURCE_DESCRIPTOR ||
ValueLength < sizeof (CM_FULL_RESOURCE_DESCRIPTOR))
ValueLength < sizeof(CM_FULL_RESOURCE_DESCRIPTOR))
return STATUS_UNSUCCESSFUL;
FullResourceDescriptor = (PCM_FULL_RESOURCE_DESCRIPTOR)ValueData;
@ -502,7 +502,8 @@ SystemConfigurationDataQueryRoutine(
FullResourceDescriptor->PartialResourceList.PartialDescriptors[i].u.DeviceSpecificData.DataSize % sizeof(CM_INT13_DRIVE_PARAMETER) != 0)
continue;
*Int13Drives = (CM_INT13_DRIVE_PARAMETER*) RtlAllocateHeap(ProcessHeap, 0, FullResourceDescriptor->PartialResourceList.PartialDescriptors[i].u.DeviceSpecificData.DataSize);
*Int13Drives = (CM_INT13_DRIVE_PARAMETER*)RtlAllocateHeap(ProcessHeap, 0,
FullResourceDescriptor->PartialResourceList.PartialDescriptors[i].u.DeviceSpecificData.DataSize);
if (*Int13Drives == NULL)
return STATUS_NO_MEMORY;
@ -598,7 +599,7 @@ EnumerateBiosDiskEntries(
DiskCount = 0;
while (1)
{
BiosDiskEntry = (BIOSDISKENTRY*) RtlAllocateHeap(ProcessHeap, HEAP_ZERO_MEMORY, sizeof(BIOSDISKENTRY));
BiosDiskEntry = (BIOSDISKENTRY*)RtlAllocateHeap(ProcessHeap, HEAP_ZERO_MEMORY, sizeof(BIOSDISKENTRY));
if (BiosDiskEntry == NULL)
{
break;
@ -1181,9 +1182,7 @@ AddDiskToList(
NULL);
if (!NT_SUCCESS(Status))
{
RtlFreeHeap(ProcessHeap,
0,
Mbr);
RtlFreeHeap(ProcessHeap, 0, Mbr);
DPRINT1("NtReadFile failed, status=%x\n", Status);
return;
}
@ -1220,12 +1219,10 @@ AddDiskToList(
DiskEntry->NoMbr = FALSE;
/* Free Mbr sector buffer */
RtlFreeHeap(ProcessHeap,
0,
Mbr);
RtlFreeHeap(ProcessHeap, 0, Mbr);
ListEntry = List->BiosDiskListHead.Flink;
while(ListEntry != &List->BiosDiskListHead)
while (ListEntry != &List->BiosDiskListHead)
{
BiosDiskEntry = CONTAINING_RECORD(ListEntry, BIOSDISKENTRY, ListEntry);
/* FIXME:
@ -1383,18 +1380,12 @@ AddDiskToList(
{
for (i = 0; i < 4; i++)
{
AddPartitionToDisk(DiskNumber,
DiskEntry,
i,
FALSE);
AddPartitionToDisk(DiskNumber, DiskEntry, i, FALSE);
}
for (i = 4; i < DiskEntry->LayoutBuffer->PartitionCount; i += 4)
{
AddPartitionToDisk(DiskNumber,
DiskEntry,
i,
TRUE);
AddPartitionToDisk(DiskNumber, DiskEntry, i, TRUE);
}
}
@ -1481,9 +1472,7 @@ CreatePartitionList(
FILE_SYNCHRONOUS_IO_NONALERT);
if (NT_SUCCESS(Status))
{
AddDiskToList(FileHandle,
DiskNumber,
List);
AddDiskToList(FileHandle, DiskNumber, List);
NtClose(FileHandle);
}
@ -1566,8 +1555,8 @@ DestroyPartitionList(
RtlFreeHeap(ProcessHeap, 0, DiskEntry);
}
/* release the bios disk info */
while(!IsListEmpty(&List->BiosDiskListHead))
/* Release the bios disk info */
while (!IsListEmpty(&List->BiosDiskListHead))
{
Entry = RemoveHeadList(&List->BiosDiskListHead);
BiosDiskEntry = CONTAINING_RECORD(Entry, BIOSDISKENTRY, ListEntry);
@ -1861,7 +1850,7 @@ PrintDiskData(
/* Print separator line */
PrintEmptyLine(List);
/* Print partition lines*/
/* Print partition lines */
PrimaryEntry = DiskEntry->PrimaryPartListHead.Flink;
while (PrimaryEntry != &DiskEntry->PrimaryPartListHead)
{
@ -3053,11 +3042,8 @@ DeleteCurrentPartition(
/* Adjust unpartitioned disk space entries */
/* Get pointer to previous and next unpartitioned entries */
PrevPartEntry = GetPrevUnpartitionedEntry(DiskEntry,
PartEntry);
NextPartEntry = GetNextUnpartitionedEntry(DiskEntry,
PartEntry);
PrevPartEntry = GetPrevUnpartitionedEntry(DiskEntry, PartEntry);
NextPartEntry = GetNextUnpartitionedEntry(DiskEntry, PartEntry);
if (PrevPartEntry != NULL && NextPartEntry != NULL)
{

View file

@ -604,7 +604,7 @@ ScanForUnpartitionedDiskSpace(
{
LastUnusedSectorCount = AlignDown(DiskEntry->SectorCount.QuadPart - (LastStartSector + LastSectorCount), DiskEntry->SectorAlignment);
if (LastUnusedSectorCount >= (ULONGLONG)DiskEntry->CylinderAlignment)
if (LastUnusedSectorCount >= (ULONGLONG)DiskEntry->SectorAlignment)
{
DPRINT1("Unpartitioned disk space: %I64u sectors\n", LastUnusedSectorCount);
@ -1036,18 +1036,12 @@ AddDiskToList(
{
for (i = 0; i < 4; i++)
{
AddPartitionToDisk(DiskNumber,
DiskEntry,
i,
FALSE);
AddPartitionToDisk(DiskNumber, DiskEntry, i, FALSE);
}
for (i = 4; i < DiskEntry->LayoutBuffer->PartitionCount; i += 4)
{
AddPartitionToDisk(DiskNumber,
DiskEntry,
i,
TRUE);
AddPartitionToDisk(DiskNumber, DiskEntry, i, TRUE);
}
}
@ -1114,8 +1108,7 @@ CreatePartitionList(VOID)
FILE_SYNCHRONOUS_IO_NONALERT);
if (NT_SUCCESS(Status))
{
AddDiskToList(FileHandle,
DiskNumber);
AddDiskToList(FileHandle, DiskNumber);
NtClose(FileHandle);
}
@ -1177,7 +1170,7 @@ DestroyPartitionList(VOID)
}
/* Release the bios disk info */
while(!IsListEmpty(&BiosDiskListHead))
while (!IsListEmpty(&BiosDiskListHead))
{
Entry = RemoveHeadList(&BiosDiskListHead);
BiosDiskEntry = CONTAINING_RECORD(Entry, BIOSDISKENTRY, ListEntry);