- Use a more complete list of partition type names for displaying the partition types in the list.
CORE-4043 #resolve
- HACK (for ChkDsk): Guess the filesystem type of the current partition, based on its partition type ID. This is hackish because partitions with the same ID can be formatted with different file systems (e.g.: Linux partition ID 0x83 can cover EXT2/3/4, ReiserFS, etc). Therefore do NOT use GetPartTypeStringFromPartitionType for that!! (see r68156 and r70283).

svn path=/trunk/; revision=70792
This commit is contained in:
Hermès Bélusca-Maïto 2016-02-27 20:49:17 +00:00
parent 9ddf12fef6
commit ad68f421d5
29 changed files with 271 additions and 133 deletions

View file

@ -2657,7 +2657,7 @@ InstallVBRToPartition(
break;
default:
DPRINT1("PartitionType 0x%02x unknown!\n", PartitionType);
DPRINT1("PartitionType 0x%02X unknown!\n", PartitionType);
break;
}

View file

@ -2398,9 +2398,7 @@ DeletePartitionPage(PINPUT_RECORD Ir)
MUIDisplayPage(DELETE_PARTITION_PAGE);
GetPartTypeStringFromPartitionTypeA(PartEntry->PartitionType,
PartType,
30);
GetPartTypeStringFromPartitionType(PartEntry->PartitionType, PartType, 30);
PartSize = PartEntry->SectorCount.QuadPart * DiskEntry->BytesPerSector;
#if 0
@ -2665,9 +2663,7 @@ SelectFileSystemPage(PINPUT_RECORD Ir)
}
/* adjust partition type */
GetPartTypeStringFromPartitionTypeA(PartEntry->PartitionType,
PartTypeString,
30);
GetPartTypeStringFromPartitionType(PartEntry->PartitionType, PartTypeString, 30);
if (PartEntry->AutoCreate == TRUE)
{
@ -3068,7 +3064,7 @@ CheckFileSystemPage(PINPUT_RECORD Ir)
UNICODE_STRING PartitionRootPath;
WCHAR PathBuffer[MAX_PATH];
CHAR Buffer[MAX_PATH];
WCHAR PartTypeString[32];
LPWSTR FileSystemName = NULL;
PDISKENTRY DiskEntry;
PPARTENTRY PartEntry;
NTSTATUS Status;
@ -3101,14 +3097,49 @@ CheckFileSystemPage(PINPUT_RECORD Ir)
CurrentFileSystem = PartEntry->FileSystem;
if (CurrentFileSystem == NULL || CurrentFileSystem->FileSystemName == NULL)
{
GetPartTypeStringFromPartitionTypeW(PartEntry->PartitionType, PartTypeString, 30);
DPRINT("PartTypeString: %S\n", PartTypeString);
if (PartTypeString != NULL)
CurrentFileSystem = GetFileSystemByName(FileSystemList,
PartTypeString);
/*
* Try to infer a preferred file system for this partition, given its ID.
*
* WARNING: This is partly a hack, since partitions with the same ID can
* be formatted with different file systems: for example, usual Linux
* partitions that are formatted in EXT2/3/4, ReiserFS, etc... have the
* same partition ID 0x83.
*
* The proper fix is to make a function that detects the existing FS
* from a given partition (not based on the partition ID).
* On the contrary, for unformatted partitions with a given ID, the
* following code is OK.
*/
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))
{
FileSystemName = L"FAT";
}
else if (PartEntry->PartitionType == PARTITION_EXT2)
{
// WARNING: See the warning above.
FileSystemName = L"EXT2";
}
else if (PartEntry->PartitionType == PARTITION_IFS)
{
// WARNING: See the warning above.
FileSystemName = L"NTFS"; /* FIXME: Not quite correct! */
}
DPRINT1("CheckFileSystemPage -- PartitionType: 0x%02X ; FileSystemName (guessed): %S\n",
PartEntry->PartitionType, FileSystemName);
if (FileSystemName != NULL)
CurrentFileSystem = GetFileSystemByName(FileSystemList,
FileSystemName);
}
DPRINT1("CheckFileSystemPage -- PartitionType: 0x%02X ; FileSystemName: %S\n",
PartEntry->PartitionType, (CurrentFileSystem ? CurrentFileSystem->FileSystemName : L"n/a"));
/* HACK: Do not try to check a partition with an unknown filesytem */
if (CurrentFileSystem == NULL)

View file

@ -1805,7 +1805,7 @@ MUI_STRING bgBGStrings[] =
{STRING_HDDINFOUNK1,
"%I64u %s â¢êठ¤¨áª %lu (ˆ§¢®¤=%hu, ˜¨­ =%hu, Ž“=%hu)."},
{STRING_HDDINFOUNK2,
" %c%c ¢¨¤ %lu %I64u %s"},
" %c%c ¢¨¤ 0x%02X %I64u %s"},
{STRING_HDINFOPARTDELETE,
"­  %I64u %s â¢êठ¤¨áª %lu (ˆ§¢®¤=%hu, ˜¨­ =%hu, Ž“=%hu) ­  %wZ."},
{STRING_HDDINFOUNK3,
@ -1813,7 +1813,7 @@ MUI_STRING bgBGStrings[] =
{STRING_HDINFOPARTZEROED,
"â¢êठ¤¨áª %lu (%I64u %s), ˆ§¢®¤=%hu, ˜¨­ =%hu, Ž“=%hu (%wZ)."},
{STRING_HDDINFOUNK4,
"%c%c ¢¨¤ %lu %I64u %s"},
"%c%c ¢¨¤ 0x%02X %I64u %s"},
{STRING_HDINFOPARTEXISTS,
"­  â¢êठ¤¨áª %lu (%I64u %s), ˆ§¢®¤=%hu, ˜¨­ =%hu, Ž“=%hu (%wZ)."},
{STRING_HDDINFOUNK5,

View file

@ -1790,7 +1790,7 @@ MUI_STRING bnBDStrings[] =
{STRING_HDDINFOUNK1,
"%I64u %s Harddisk %lu (Port=%hu, Bus=%hu, Id=%hu)."},
{STRING_HDDINFOUNK2,
" %c%c Type %lu %I64u %s"},
" %c%c Type 0x%02X %I64u %s"},
{STRING_HDINFOPARTDELETE,
"on %I64u %s Harddisk %lu (Port=%hu, Bus=%hu, Id=%hu) on %wZ."},
{STRING_HDDINFOUNK3,
@ -1798,7 +1798,7 @@ MUI_STRING bnBDStrings[] =
{STRING_HDINFOPARTZEROED,
"Harddisk %lu (%I64u %s), Port=%hu, Bus=%hu, Id=%hu (%wZ)."},
{STRING_HDDINFOUNK4,
"%c%c Type %lu %I64u %s"},
"%c%c Type 0x%02X %I64u %s"},
{STRING_HDINFOPARTEXISTS,
"on Harddisk %lu (%I64u %s), Port=%hu, Bus=%hu, Id=%hu (%wZ)."},
{STRING_HDDINFOUNK5,

View file

@ -1798,7 +1798,7 @@ MUI_STRING csCZStrings[] =
{STRING_HDDINFOUNK1,
"%I64u %s Harddisk %lu (Port=%hu, Bus=%hu, Id=%hu)."},
{STRING_HDDINFOUNK2,
" %c%c Typ %lu %I64u %s"},
" %c%c Typ 0x%02X %I64u %s"},
{STRING_HDINFOPARTDELETE,
"na %I64u %s Harddisk %lu (Port=%hu, Bus=%hu, Id=%hu) na %wZ."},
{STRING_HDDINFOUNK3,
@ -1806,7 +1806,7 @@ MUI_STRING csCZStrings[] =
{STRING_HDINFOPARTZEROED,
"Harddisk %lu (%I64u %s), Port=%hu, Bus=%hu, Id=%hu (%wZ)."},
{STRING_HDDINFOUNK4,
"%c%c Typ %lu %I64u %s"},
"%c%c Typ 0x%02X %I64u %s"},
{STRING_HDINFOPARTEXISTS,
"na harddisku %lu (%I64u %s), Port=%hu, Bus=%hu, Id=%hu (%wZ)."},
{STRING_HDDINFOUNK5,

View file

@ -1810,7 +1810,7 @@ MUI_STRING daDKStrings[] =
{STRING_HDDINFOUNK1,
"%I64u %s harddisk %lu (Port=%hu, Bus=%hu, Id=%hu)."},
{STRING_HDDINFOUNK2,
" %c%c type %lu %I64u %s"},
" %c%c type 0x%02X %I64u %s"},
{STRING_HDINFOPARTDELETE,
"p† %I64u %s harddisk %lu (Port=%hu, Bus=%hu, Id=%hu) p† %wZ."},
{STRING_HDDINFOUNK3,
@ -1818,7 +1818,7 @@ MUI_STRING daDKStrings[] =
{STRING_HDINFOPARTZEROED,
"Harddisk %lu (%I64u %s), Port=%hu, Bus=%hu, Id=%hu (%wZ)."},
{STRING_HDDINFOUNK4,
"%c%c type %lu %I64u %s"},
"%c%c type 0x%02X %I64u %s"},
{STRING_HDINFOPARTEXISTS,
"p† harddisk %lu (%I64u %s), Port=%hu, Bus=%hu, Id=%hu (%wZ)."},
{STRING_HDDINFOUNK5,

View file

@ -1794,7 +1794,7 @@ MUI_STRING deDEStrings[] =
{STRING_HDDINFOUNK1,
"%I64u %s Festplatte %lu (Port=%hu, Bus=%hu, Id=%hu)."},
{STRING_HDDINFOUNK2,
" %c%c Typ %lu %I64u %s"},
" %c%c Typ 0x%02X %I64u %s"},
{STRING_HDINFOPARTDELETE,
"auf %I64u %s Festplatte %lu (Port=%hu, Bus=%hu, Id=%hu) auf %wZ."},
{STRING_HDDINFOUNK3,
@ -1802,7 +1802,7 @@ MUI_STRING deDEStrings[] =
{STRING_HDINFOPARTZEROED,
"Festplatte %lu (%I64u %s), Port=%hu, Bus=%hu, Id=%hu (%wZ)."},
{STRING_HDDINFOUNK4,
"%c%c Typ %lu %I64u %s"},
"%c%c Typ 0x%02X %I64u %s"},
{STRING_HDINFOPARTEXISTS,
"auf Festplatte %lu (%I64u %s), Port=%hu, Bus=%hu, Id=%hu (%wZ)."},
{STRING_HDDINFOUNK5,

View file

@ -1809,7 +1809,7 @@ MUI_STRING elGRStrings[] =
{STRING_HDDINFOUNK1,
"%I64u %s ‘¡¢ž¨æª ›å©¡¦ª %lu (Port=%hu, Bus=%hu, Id=%hu)."},
{STRING_HDDINFOUNK2,
" %c%c Type %lu %I64u %s"},
" %c%c Type 0x%02X %I64u %s"},
{STRING_HDINFOPARTDELETE,
"on %I64u %s Harddisk %lu (Port=%hu, Bus=%hu, Id=%hu) on %wZ."},
{STRING_HDDINFOUNK3,
@ -1817,7 +1817,7 @@ MUI_STRING elGRStrings[] =
{STRING_HDINFOPARTZEROED,
"‘¡¢ž¨æª ›å©¡¦ª %lu (%I64u %s), Port=%hu, Bus=%hu, Id=%hu (%wZ)."},
{STRING_HDDINFOUNK4,
"%c%c Type %lu %I64u %s"},
"%c%c Type 0x%02X %I64u %s"},
{STRING_HDINFOPARTEXISTS,
"©«¦ ©¡¢ž¨æ ›å©¡¦ %lu (%I64u %s), Port=%hu, Bus=%hu, Id=%hu (%wZ)."},
{STRING_HDDINFOUNK5,

View file

@ -1790,7 +1790,7 @@ MUI_STRING enUSStrings[] =
{STRING_HDDINFOUNK1,
"%I64u %s Harddisk %lu (Port=%hu, Bus=%hu, Id=%hu)."},
{STRING_HDDINFOUNK2,
" %c%c Type %lu %I64u %s"},
" %c%c Type 0x%02X %I64u %s"},
{STRING_HDINFOPARTDELETE,
"on %I64u %s Harddisk %lu (Port=%hu, Bus=%hu, Id=%hu) on %wZ."},
{STRING_HDDINFOUNK3,
@ -1798,7 +1798,7 @@ MUI_STRING enUSStrings[] =
{STRING_HDINFOPARTZEROED,
"Harddisk %lu (%I64u %s), Port=%hu, Bus=%hu, Id=%hu (%wZ)."},
{STRING_HDDINFOUNK4,
"%c%c Type %lu %I64u %s"},
"%c%c Type 0x%02X %I64u %s"},
{STRING_HDINFOPARTEXISTS,
"on Harddisk %lu (%I64u %s), Port=%hu, Bus=%hu, Id=%hu (%wZ)."},
{STRING_HDDINFOUNK5,

View file

@ -1800,7 +1800,7 @@ MUI_STRING esESStrings[] =
{STRING_HDDINFOUNK1,
"%I64u %s Disco duro %lu (Port=%hu, Bus=%hu, Id=%hu)."},
{STRING_HDDINFOUNK2,
" %c%c Tipo %lu %I64u %s"},
" %c%c Tipo 0x%02X %I64u %s"},
{STRING_HDINFOPARTDELETE,
"en %I64u %s Disco duro %lu (Port=%hu, Bus=%hu, Id=%hu) en %wZ."},
{STRING_HDDINFOUNK3,
@ -1808,7 +1808,7 @@ MUI_STRING esESStrings[] =
{STRING_HDINFOPARTZEROED,
"Disco duro %lu (%I64u %s), Port=%hu, Bus=%hu, Id=%hu (%wZ)."},
{STRING_HDDINFOUNK4,
"%c%c Tipo %lu %I64u %s"},
"%c%c Tipo 0x%02X %I64u %s"},
{STRING_HDINFOPARTEXISTS,
"en Disco duro %lu (%I64u %s), Port=%hu, Bus=%hu, Id=%hu (%wZ)."},
{STRING_HDDINFOUNK5,

View file

@ -1790,7 +1790,7 @@ MUI_STRING etEEStrings[] =
{STRING_HDDINFOUNK1,
"%I64u %s Kävaketas %lu (Port=%hu, Siin=%hu, Id=%hu)."},
{STRING_HDDINFOUNK2,
" %c%c Type %lu %I64u %s"},
" %c%c Type 0x%02X %I64u %s"},
{STRING_HDINFOPARTDELETE,
"%I64u %s Kävaketas %lu (Port=%hu, Siin=%hu, Id=%hu) - %wZ."},
{STRING_HDDINFOUNK3,
@ -1798,7 +1798,7 @@ MUI_STRING etEEStrings[] =
{STRING_HDINFOPARTZEROED,
"Kävaketas %lu (%I64u %s), Port=%hu, Siin=%hu, Id=%hu (%wZ)."},
{STRING_HDDINFOUNK4,
"%c%c Type %lu %I64u %s"},
"%c%c Type 0x%02X %I64u %s"},
{STRING_HDINFOPARTEXISTS,
"Kävaketas %lu (%I64u %s), Port=%hu, Siin=%hu, Id=%hu (%wZ)."},
{STRING_HDDINFOUNK5,

View file

@ -1803,7 +1803,7 @@ MUI_STRING frFRStrings[] =
{STRING_HDDINFOUNK1,
"%I64u %s Disque dur %lu (Port=%hu, Bus=%hu, Id=%hu)."},
{STRING_HDDINFOUNK2,
" %c%c Type %lu %I64u %s"},
" %c%c Type 0x%02X %I64u %s"},
{STRING_HDINFOPARTDELETE,
"sur %I64u %s Disque dur %lu (Port=%hu, Bus=%hu, Id=%hu) sur %wZ."},
{STRING_HDDINFOUNK3,
@ -1811,7 +1811,7 @@ MUI_STRING frFRStrings[] =
{STRING_HDINFOPARTZEROED,
"Disque dur %lu (%I64u %s), Port=%hu, Bus=%hu, Id=%hu (%wZ)."},
{STRING_HDDINFOUNK4,
"%c%c Type %lu %I64u %s"},
"%c%c Type 0x%02X %I64u %s"},
{STRING_HDINFOPARTEXISTS,
"sur Disque dur %lu (%I64u %s), Port=%hu, Bus=%hu, Id=%hu (%wZ)."},
{STRING_HDDINFOUNK5,

View file

@ -1792,7 +1792,7 @@ MUI_STRING heILStrings[] =
{STRING_HDDINFOUNK1,
"%I64u %s Harddisk %lu (Port=%hu, Bus=%hu, Id=%hu)."},
{STRING_HDDINFOUNK2,
" %c%c Type %lu %I64u %s"},
" %c%c Type 0x%02X %I64u %s"},
{STRING_HDINFOPARTDELETE,
"on %I64u %s Harddisk %lu (Port=%hu, Bus=%hu, Id=%hu) on %wZ."},
{STRING_HDDINFOUNK3,
@ -1800,7 +1800,7 @@ MUI_STRING heILStrings[] =
{STRING_HDINFOPARTZEROED,
"Harddisk %lu (%I64u %s), Port=%hu, Bus=%hu, Id=%hu (%wZ)."},
{STRING_HDDINFOUNK4,
"%c%c Type %lu %I64u %s"},
"%c%c Type 0x%02X %I64u %s"},
{STRING_HDINFOPARTEXISTS,
"on Harddisk %lu (%I64u %s), Port=%hu, Bus=%hu, Id=%hu (%wZ)."},
{STRING_HDDINFOUNK5,

View file

@ -1800,7 +1800,7 @@ MUI_STRING itITStrings[] =
{STRING_HDDINFOUNK1,
"%I64u %s Harddisk %lu (Port=%hu, Bus=%hu, Id=%hu)."},
{STRING_HDDINFOUNK2,
" %c%c Tipo %lu %I64u %s"},
" %c%c Tipo 0x%02X %I64u %s"},
{STRING_HDINFOPARTDELETE,
"su %I64u %s Harddisk %lu (Port=%hu, Bus=%hu, Id=%hu) su %wZ."},
{STRING_HDDINFOUNK3,
@ -1808,7 +1808,7 @@ MUI_STRING itITStrings[] =
{STRING_HDINFOPARTZEROED,
"Harddisk %lu (%I64u %s), Port=%hu, Bus=%hu, Id=%hu (%wZ)."},
{STRING_HDDINFOUNK4,
"%c%c Tipo %lu %I64u %s"},
"%c%c Tipo 0x%02X %I64u %s"},
{STRING_HDINFOPARTEXISTS,
"su Harddisk %lu (%I64u %s), Port=%hu, Bus=%hu, Id=%hu (%wZ)."},
{STRING_HDDINFOUNK5,

View file

@ -1794,7 +1794,7 @@ MUI_STRING jaJPStrings[] =
{STRING_HDDINFOUNK1,
"%I64u %s Ê°ÄÞÃÞ¨½¸ %lu (Îß°Ä=%hu, ÊÞ½=%hu, Id=%hu)."},
{STRING_HDDINFOUNK2,
" %c%c 서侮 %lu %I64u %s"},
" %c%c 서侮 0x%02X %I64u %s"},
{STRING_HDINFOPARTDELETE,
"on %I64u %s Ê°ÄÞÃÞ¨½¸ %lu (Îß°Ä=%hu, ÊÞ½=%hu, Id=%hu) on %wZ."},
{STRING_HDDINFOUNK3,
@ -1802,7 +1802,7 @@ MUI_STRING jaJPStrings[] =
{STRING_HDINFOPARTZEROED,
"Ê°ÄÞÃÞ¨½¸ %lu (%I64u %s), Îß°Ä=%hu, ÊÞ½=%hu, Id=%hu (%wZ)."},
{STRING_HDDINFOUNK4,
"%c%c 서侮 %lu %I64u %s"},
"%c%c 서侮 0x%02X %I64u %s"},
{STRING_HDINFOPARTEXISTS,
"on Ê°ÄÞÃÞ¨½¸ %lu (%I64u %s), Îß°Ä=%hu, ÊÞ½=%hu, Id=%hu (%wZ)."},
{STRING_HDDINFOUNK5,

View file

@ -1800,7 +1800,7 @@ MUI_STRING ltLTStrings[] =
{STRING_HDDINFOUNK1,
"%I64u %s Harddisk %lu (Port=%hu, Bus=%hu, Id=%hu)."},
{STRING_HDDINFOUNK2,
" %c%c Type %lu %I64u %s"},
" %c%c Type 0x%02X %I64u %s"},
{STRING_HDINFOPARTDELETE,
"on %I64u %s Harddisk %lu (Port=%hu, Bus=%hu, Id=%hu) on %wZ."},
{STRING_HDDINFOUNK3,
@ -1808,7 +1808,7 @@ MUI_STRING ltLTStrings[] =
{STRING_HDINFOPARTZEROED,
"Harddisk %lu (%I64u %s), Port=%hu, Bus=%hu, Id=%hu (%wZ)."},
{STRING_HDDINFOUNK4,
"%c%c Type %lu %I64u %s"},
"%c%c Type 0x%02X %I64u %s"},
{STRING_HDINFOPARTEXISTS,
"on Harddisk %lu (%I64u %s), Port=%hu, Bus=%hu, Id=%hu (%wZ)."},
{STRING_HDDINFOUNK5,

View file

@ -1679,7 +1679,7 @@ MUI_STRING msMYStrings[] =
{STRING_HDDINFOUNK1,
"%I64u %s Harddisk %lu (Port=%hu, Bus=%hu, Id=%hu)."},
{STRING_HDDINFOUNK2,
" %c%c Type %lu %I64u %s"},
" %c%c Type 0x%02X %I64u %s"},
{STRING_HDINFOPARTDELETE,
"on %I64u %s Harddisk %lu (Port=%hu, Bus=%hu, Id=%hu) on %wZ."},
{STRING_HDDINFOUNK3,
@ -1687,7 +1687,7 @@ MUI_STRING msMYStrings[] =
{STRING_HDINFOPARTZEROED,
"Harddisk %lu (%I64u %s), Port=%hu, Bus=%hu, Id=%hu (%wZ)."},
{STRING_HDDINFOUNK4,
"%c%c Type %lu %I64u %s"},
"%c%c Type 0x%02X %I64u %s"},
{STRING_HDINFOPARTEXISTS,
"on Harddisk %lu (%I64u %s), Port=%hu, Bus=%hu, Id=%hu (%wZ)."},
{STRING_HDDINFOUNK5,

View file

@ -1832,7 +1832,7 @@ MUI_STRING nlNLStrings[] =
{STRING_HDDINFOUNK1,
"%I64u %s Schijf %lu (Poort=%hu, Bus=%hu, Id=%hu)."},
{STRING_HDDINFOUNK2,
" %c%c Type %lu %I64u %s"},
" %c%c Type 0x%02X %I64u %s"},
{STRING_HDINFOPARTDELETE,
"op %I64u %s Schijf %lu (Poort=%hu, Bus=%hu, Id=%hu) op %wZ."},
{STRING_HDDINFOUNK3,
@ -1840,7 +1840,7 @@ MUI_STRING nlNLStrings[] =
{STRING_HDINFOPARTZEROED,
"Schijf %lu (%I64u %s), Poort=%hu, Bus=%hu, Id=%hu (%wZ)."},
{STRING_HDDINFOUNK4,
"%c%c Type %lu %I64u %s"},
"%c%c Type 0x%02X %I64u %s"},
{STRING_HDINFOPARTEXISTS,
"op Schijf %lu (%I64u %s), Poort=%hu, Bus=%hu, Id=%hu (%wZ)."},
{STRING_HDDINFOUNK5,

View file

@ -1801,7 +1801,7 @@ MUI_STRING plPLStrings[] =
{STRING_HDDINFOUNK1,
"%I64u %s Dysk 02 Twardy %lu (Port=%hu, Szyna=%hu, Id=%hu)."},
{STRING_HDDINFOUNK2,
" %c%c 03Typ %lu %I64u %s"},
" %c%c 03Typ 0x%02X %I64u %s"},
{STRING_HDINFOPARTDELETE,
"na %I64u %s Dysku Twardym %lu (Port=%hu, Szyna=%hu, Id=%hu) na %wZ."},
{STRING_HDDINFOUNK3,
@ -1809,7 +1809,7 @@ MUI_STRING plPLStrings[] =
{STRING_HDINFOPARTZEROED,
"Dysk Twardy %lu (%I64u %s), Port=%hu, Szyna=%hu, Id=%hu (%wZ)."},
{STRING_HDDINFOUNK4,
"%c%c 07Typ %lu %I64u %s"},
"%c%c 07Typ 0x%02X %I64u %s"},
{STRING_HDINFOPARTEXISTS,
"na Dysku Twardym %lu (%I64u %s), Port=%hu, Szyna=%hu, Id=%hu (%wZ)."},
{STRING_HDDINFOUNK5,

View file

@ -1830,7 +1830,7 @@ MUI_STRING ptBRStrings[] =
{STRING_HDDINFOUNK1,
"%I64u %s Disco %lu (Porta=%hu, Barramento=%hu, Id=%hu)."},
{STRING_HDDINFOUNK2,
" %c%c Tipo %lu %I64u %s"},
" %c%c Tipo 0x%02X %I64u %s"},
{STRING_HDINFOPARTDELETE,
"em %I64u %s Disco %lu (Porta=%hu, Barramento=%hu, Id=%hu) em %wZ."},
{STRING_HDDINFOUNK3,
@ -1838,7 +1838,7 @@ MUI_STRING ptBRStrings[] =
{STRING_HDINFOPARTZEROED,
"Disco %lu (%I64u %s), Porta=%hu, Barramento=%hu, Id=%hu (%wZ)."},
{STRING_HDDINFOUNK4,
"%c%c Tipo %lu %I64u %s"},
"%c%c Tipo 0x%02X %I64u %s"},
{STRING_HDINFOPARTEXISTS,
"em Disco %lu (%I64u %s), Porta=%hu, Barramento=%hu, Id=%hu (%wZ)."},
{STRING_HDDINFOUNK5,

View file

@ -1861,7 +1861,7 @@ MUI_STRING roROStrings[] =
{STRING_HDDINFOUNK1,
"%I64u %s Discul %lu (Port=%hu, Magistrala=%hu, Id=%hu)."},
{STRING_HDDINFOUNK2,
" %c%c Tip %lu %I64u %s"},
" %c%c Tip 0x%02X %I64u %s"},
{STRING_HDINFOPARTDELETE,
"de pe %I64u %s Discul %lu (Port=%hu, Magistrala=%hu, Id=%hu) de tip %wZ."},
{STRING_HDDINFOUNK3,
@ -1869,7 +1869,7 @@ MUI_STRING roROStrings[] =
{STRING_HDINFOPARTZEROED,
"Discul %lu (%I64u %s), Port=%hu, Magistrala=%hu, Id=%hu (%wZ)."},
{STRING_HDDINFOUNK4,
"%c%c Tip %lu %I64u %s"},
"%c%c Tip 0x%02X %I64u %s"},
{STRING_HDINFOPARTEXISTS,
"de pe Discul %lu (%I64u %s), Port=%hu, Magistrala=%hu, Id=%hu (%wZ)."},
{STRING_HDDINFOUNK5,

View file

@ -1791,7 +1791,7 @@ MUI_STRING ruRUStrings[] =
{STRING_HDDINFOUNK1,
"%I64u %s †¥á⪨© ¤¨áª %lu (<28>®àâ=%hu, ˜¨­ =%hu, Id=%hu)."},
{STRING_HDDINFOUNK2,
" %c%c ‡ ¯¨áì %lu %I64u %s"},
" %c%c ‡ ¯¨áì 0x%02X %I64u %s"},
{STRING_HDINFOPARTDELETE,
"­  %I64u %s †¥á⪨© ¤¨áª %lu (<28>®àâ=%hu, ˜¨­ =%hu, Id=%hu) ­  %wZ."},
{STRING_HDDINFOUNK3,
@ -1799,7 +1799,7 @@ MUI_STRING ruRUStrings[] =
{STRING_HDINFOPARTZEROED,
"†¥á⪨© ¤¨áª %lu (%I64u %s), <20>®àâ=%hu, ˜¨­ =%hu, Id=%hu (%wZ)."},
{STRING_HDDINFOUNK4,
"%c%c ‡ ¯¨áì %lu %I64u %s"},
"%c%c ‡ ¯¨áì 0x%02X %I64u %s"},
{STRING_HDINFOPARTEXISTS,
"­  ¦¥á⪮¬ ¤¨áª¥ %lu (%I64u %s), <20>®àâ=%hu, ˜¨­ =%hu, Id=%hu (%wZ)."},
{STRING_HDDINFOUNK5,

View file

@ -1804,7 +1804,7 @@ MUI_STRING skSKStrings[] =
{STRING_HDDINFOUNK1,
"%I64u %s pevnì disk %lu (Port=%hu, Bus=%hu, Id=%hu)."},
{STRING_HDDINFOUNK2,
" %c%c typ %lu %I64u %s"},
" %c%c typ 0x%02X %I64u %s"},
{STRING_HDINFOPARTDELETE,
"na %I64u %s pevnom disku %lu (Port=%hu, Bus=%hu, Id=%hu) na %wZ."},
{STRING_HDDINFOUNK3,
@ -1812,7 +1812,7 @@ MUI_STRING skSKStrings[] =
{STRING_HDINFOPARTZEROED,
"pevnì disk %lu (%I64u %s), Port=%hu, Bus=%hu, Id=%hu (%wZ)."},
{STRING_HDDINFOUNK4,
"%c%c typ %lu %I64u %s"},
"%c%c typ 0x%02X %I64u %s"},
{STRING_HDINFOPARTEXISTS,
"na pevnom disku %lu (%I64u %s), Port=%hu, Bus=%hu, Id=%hu (%wZ)."},
{STRING_HDDINFOUNK5,

View file

@ -1797,7 +1797,7 @@ MUI_STRING sqALStrings[] =
{STRING_HDDINFOUNK1,
"%I64u %s Harddisku %lu (Port=%hu, Bus=%hu, Id=%hu)."},
{STRING_HDDINFOUNK2,
" %c%c Tipi %lu %I64u %s"},
" %c%c Tipi 0x%02X %I64u %s"},
{STRING_HDINFOPARTDELETE,
"on %I64u %s Harddisku %lu (Port=%hu, Bus=%hu, Id=%hu) on %wZ."},
{STRING_HDDINFOUNK3,
@ -1805,7 +1805,7 @@ MUI_STRING sqALStrings[] =
{STRING_HDINFOPARTZEROED,
"Harddisku %lu (%I64u %s), Port=%hu, Bus=%hu, Id=%hu (%wZ)."},
{STRING_HDDINFOUNK4,
"%c%c Tipi %lu %I64u %s"},
"%c%c Tipi 0x%02X %I64u %s"},
{STRING_HDINFOPARTEXISTS,
"on Harddisku %lu (%I64u %s), Port=%hu, Bus=%hu, Id=%hu (%wZ)."},
{STRING_HDDINFOUNK5,

View file

@ -1800,7 +1800,7 @@ MUI_STRING svSEStrings[] =
{STRING_HDDINFOUNK1,
"%I64u %s H†rddisk %lu (Port=%hu, Bus=%hu, Id=%hu)."},
{STRING_HDDINFOUNK2,
" %c%c Typ %lu %I64u %s"},
" %c%c Typ 0x%02X %I64u %s"},
{STRING_HDINFOPARTDELETE,
"on %I64u %s H†rddisk %lu (Port=%hu, Bus=%hu, Id=%hu) p† %wZ."},
{STRING_HDDINFOUNK3,
@ -1808,7 +1808,7 @@ MUI_STRING svSEStrings[] =
{STRING_HDINFOPARTZEROED,
"H†rddisk %lu (%I64u %s), Port=%hu, Bus=%hu, Id=%hu (%wZ)."},
{STRING_HDDINFOUNK4,
"%c%c Typ %lu %I64u %s"},
"%c%c Typ 0x%02X %I64u %s"},
{STRING_HDINFOPARTEXISTS,
"p† H†rddisk %lu (%I64u %s), Port=%hu, Bus=%hu, Id=%hu (%wZ)."},
{STRING_HDDINFOUNK5,

View file

@ -1771,7 +1771,7 @@ MUI_STRING trTRStrings[] =
{STRING_HDDINFOUNK1,
"%I64u %s Sƒbit Disk %lu (GiriŸ=%hu, Veriyolu=%hu, Kimlik=%hu)."},
{STRING_HDDINFOUNK2,
" %c%c T<>r %lu %I64u %s"},
" %c%c T<>r 0x%02X %I64u %s"},
{STRING_HDINFOPARTDELETE,
"šzerinde: %I64u %s Sƒbit Disk %lu (GiriŸ=%hu, Veriyolu=%hu, Kimlik=%hu), %wZ <20>zerinde."},
{STRING_HDDINFOUNK3,
@ -1779,7 +1779,7 @@ MUI_STRING trTRStrings[] =
{STRING_HDINFOPARTZEROED,
"Sƒbit Disk %lu (%I64u %s), GiriŸ=%hu, Veriyolu=%hu, Kimlik=%hu (%wZ)."},
{STRING_HDDINFOUNK4,
"%c%c T<>r %lu %I64u %s"},
"%c%c T<>r 0x%02X %I64u %s"},
{STRING_HDINFOPARTEXISTS,
"šzerinde: Sƒbit Disk %lu (%I64u %s), GiriŸ=%hu, Veriyolu=%hu, Kimlik=%hu (%wZ)."},
{STRING_HDDINFOUNK5,

View file

@ -1800,7 +1800,7 @@ MUI_STRING ukUAStrings[] =
{STRING_HDDINFOUNK1,
"%I64u %s †®àá⪨© ¤¨áª %lu (<28>®àâ=%hu, ˜¨­ =%hu, Id=%hu)."},
{STRING_HDDINFOUNK2,
" %c%c Type %lu %I64u %s"},
" %c%c Type 0x%02X %I64u %s"},
{STRING_HDINFOPARTDELETE,
"­  %I64u %s †®àá⪨© ¤¨áª %lu (<28>®àâ=%hu, ˜¨­ =%hu, Id=%hu) on %wZ."},
{STRING_HDDINFOUNK3,
@ -1808,7 +1808,7 @@ MUI_STRING ukUAStrings[] =
{STRING_HDINFOPARTZEROED,
"†®àá⪨© ¤¨áª %lu (%I64u %s), <20>®àâ=%hu, ˜¨­ =%hu, Id=%hu (%wZ)."},
{STRING_HDDINFOUNK4,
"%c%c Type %lu %I64u %s"},
"%c%c Type 0x%02X %I64u %s"},
{STRING_HDINFOPARTEXISTS,
"­  †®àá⪮¬ã ¤¨áªã %lu (%I64u %s), <20>®àâ=%hu, ˜¨­ =%hu, Id=%hu (%wZ)."},
{STRING_HDDINFOUNK5,

View file

@ -33,6 +33,179 @@
//#define DUMP_PARTITION_TABLE
/* HELPERS FOR PARTITION TYPES **********************************************/
typedef struct _PARTITION_TYPE
{
UCHAR Type;
PCHAR Description;
} PARTITION_TYPE, *PPARTITION_TYPE;
/*
* This partiton type list was ripped off the kernelDisk.c module from:
*
* Visopsys Operating System
* Copyright (C) 1998-2015 J. Andrew McLaughlin
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*
* See also https://en.wikipedia.org/wiki/Partition_type#List_of_partition_IDs
* and http://www.win.tue.nl/~aeb/partitions/partition_types-1.html
* for a complete list.
*/
/* This is a table for keeping known partition type codes and descriptions */
static PARTITION_TYPE PartitionTypes[] =
{
{ 0x00, "(Empty)" },
{ 0x01, "FAT12" },
{ 0x02, "XENIX root" },
{ 0x03, "XENIX /usr" },
{ 0x04, "FAT16 (small)" },
{ 0x05, "Extended" },
{ 0x06, "FAT16" },
{ 0x07, "NTFS/HPFS/exFAT" },
{ 0x08, "OS/2 or AIX boot" },
{ 0x09, "AIX data" },
{ 0x0A, "OS/2 Boot Manager" },
{ 0x0B, "FAT32" },
{ 0x0C, "FAT32 (LBA)" },
{ 0x0E, "FAT16 (LBA)" },
{ 0x0F, "Extended (LBA)" },
{ 0x11, "Hidden FAT12" },
{ 0x12, "FAT diagnostic" },
{ 0x14, "Hidden FAT16 (small)" },
{ 0x16, "Hidden FAT16" },
{ 0x17, "Hidden HPFS or NTFS" },
{ 0x1B, "Hidden FAT32" },
{ 0x1C, "Hidden FAT32 (LBA)" },
{ 0x1E, "Hidden FAT16 (LBA)" },
{ 0x35, "JFS" },
{ 0x39, "Plan 9" },
{ 0x3C, "PartitionMagic" },
{ 0x3D, "Hidden Netware" },
{ 0x41, "PowerPC PReP" },
{ 0x42, "Win2K dynamic extended" },
{ 0x43, "Old Linux" },
{ 0x44, "GoBack" },
{ 0x4D, "QNX4.x" },
{ 0x4D, "QNX4.x 2nd" },
{ 0x4D, "QNX4.x 3rd" },
{ 0x50, "Ontrack R/O" },
{ 0x51, "Ontrack R/W or Novell" },
{ 0x52, "CP/M" },
{ 0x63, "GNU HURD or UNIX SysV" },
{ 0x64, "Netware 2" },
{ 0x65, "Netware 3/4" },
{ 0x66, "Netware SMS" },
{ 0x67, "Novell" },
{ 0x68, "Novell" },
{ 0x69, "Netware 5+" },
{ 0x7E, "Veritas VxVM public" },
{ 0x7F, "Veritas VxVM private" },
{ 0x80, "Minix" },
{ 0x81, "Linux or Minix" },
{ 0x82, "Linux swap or Solaris" },
{ 0x83, "Linux" },
{ 0x84, "Hibernation" },
{ 0x85, "Linux extended" },
{ 0x86, "HPFS or NTFS mirrored" },
{ 0x87, "HPFS or NTFS mirrored" },
{ 0x8E, "Linux LVM" },
{ 0x93, "Hidden Linux" },
{ 0x9F, "BSD/OS" },
{ 0xA0, "Laptop hibernation" },
{ 0xA1, "Laptop hibernation" },
{ 0xA5, "BSD, NetBSD, FreeBSD" },
{ 0xA6, "OpenBSD" },
{ 0xA7, "NeXTSTEP" },
{ 0xA8, "OS-X UFS" },
{ 0xA9, "NetBSD" },
{ 0xAB, "OS-X boot" },
{ 0xAF, "OS-X HFS" },
{ 0xB6, "NT corrupt mirror" },
{ 0xB7, "BSDI" },
{ 0xB8, "BSDI swap" },
{ 0xBE, "Solaris 8 boot" },
{ 0xBF, "Solaris x86" },
{ 0xC0, "NTFT" },
{ 0xC1, "DR-DOS FAT12" },
{ 0xC2, "Hidden Linux" },
{ 0xC3, "Hidden Linux swap" },
{ 0xC4, "DR-DOS FAT16 (small)" },
{ 0xC5, "DR-DOS Extended" },
{ 0xC6, "DR-DOS FAT16" },
{ 0xC7, "HPFS mirrored" },
{ 0xCB, "DR-DOS FAT32" },
{ 0xCC, "DR-DOS FAT32 (LBA)" },
{ 0xCE, "DR-DOS FAT16 (LBA)" },
{ 0xD0, "MDOS" },
{ 0xD1, "MDOS FAT12" },
{ 0xD4, "MDOS FAT16 (small)" },
{ 0xD5, "MDOS Extended" },
{ 0xD6, "MDOS FAT16" },
{ 0xD8, "CP/M-86" },
{ 0xDF, "BootIt EMBRM(FAT16/32)" },
{ 0xEB, "BeOS BFS" },
{ 0xEE, "EFI GPT protective" },
{ 0xEF, "EFI filesystem" },
{ 0xF0, "Linux/PA-RISC boot" },
{ 0xF2, "DOS 3.3+ second" },
{ 0xFA, "Bochs" },
{ 0xFB, "VmWare" },
{ 0xFC, "VmWare swap" },
{ 0xFD, "Linux RAID" },
{ 0xFE, "NT hidden" },
};
VOID
GetPartTypeStringFromPartitionType(
UCHAR partitionType,
PCHAR strPartType,
DWORD cchPartType)
{
/* Determine partition type */
if (IsContainerPartition(partitionType))
{
StringCchCopy(strPartType, cchPartType, MUIGetString(STRING_EXTENDED_PARTITION));
}
else if (partitionType == PARTITION_ENTRY_UNUSED)
{
StringCchCopy(strPartType, cchPartType, MUIGetString(STRING_FORMATUNUSED));
}
else
{
UINT i;
/* Do the table lookup */
for (i = 0; i < ARRAYSIZE(PartitionTypes); i++)
{
if (partitionType == PartitionTypes[i].Type)
{
StringCchCopy(strPartType, cchPartType, PartitionTypes[i].Description);
return;
}
}
/* We are here because the partition type is unknown */
StringCchCopy(strPartType, cchPartType, MUIGetString(STRING_FORMATUNKNOWN));
}
}
/* FUNCTIONS ****************************************************************/
#ifdef DUMP_PARTITION_TABLE
@ -1448,66 +1621,6 @@ PrintEmptyLine(
}
VOID
GetPartTypeStringFromPartitionTypeW(
UCHAR partitionType,
PWCHAR strPartType,
DWORD cchPartType)
{
CHAR partTypeString[32];
GetPartTypeStringFromPartitionTypeA(partitionType,
partTypeString,
30);
mbstowcs(strPartType,
partTypeString,
(30 < cchPartType) ? 30 : cchPartType);
}
VOID
GetPartTypeStringFromPartitionTypeA(
UCHAR partitionType,
PCHAR strPartType,
DWORD cchPartType)
{
/* Determine partition type */
if ((partitionType == PARTITION_FAT_12) ||
(partitionType == PARTITION_FAT_16) ||
(partitionType == PARTITION_HUGE) ||
(partitionType == PARTITION_XINT13))
{
StringCchCopy(strPartType, cchPartType, "FAT");
}
else if ((partitionType == PARTITION_FAT32) ||
(partitionType == PARTITION_FAT32_XINT13))
{
StringCchCopy(strPartType, cchPartType, "FAT32");
}
else if (partitionType == PARTITION_EXT2)
{
StringCchCopy(strPartType, cchPartType, "EXT2");
}
else if (partitionType == PARTITION_IFS)
{
StringCchCopy(strPartType, cchPartType, "NTFS"); /* FIXME: Not quite correct! */
}
else if (IsContainerPartition(partitionType))
{
StringCchCopy(strPartType, cchPartType, MUIGetString(STRING_EXTENDED_PARTITION));
}
else if (partitionType == PARTITION_ENTRY_UNUSED)
{
StringCchCopy(strPartType, cchPartType, MUIGetString(STRING_FORMATUNUSED));
}
else
{
StringCchCopy(strPartType, cchPartType, MUIGetString(STRING_FORMATUNKNOWN));
}
}
static
VOID
PrintPartitionData(
@ -1572,7 +1685,7 @@ PrintPartitionData(
}
else if (PartEntry->IsPartitioned == TRUE)
{
GetPartTypeStringFromPartitionTypeA(PartEntry->PartitionType,
GetPartTypeStringFromPartitionType(PartEntry->PartitionType,
PartTypeString,
30);
PartType = PartTypeString;

View file

@ -291,15 +291,9 @@ GetNextUncheckedPartition(
OUT PPARTENTRY *pPartEntry);
VOID
GetPartTypeStringFromPartitionTypeA(
GetPartTypeStringFromPartitionType(
UCHAR partitionType,
PSTR strPartType,
DWORD cchPartType);
VOID
GetPartTypeStringFromPartitionTypeW(
UCHAR partitionType,
PWSTR strPartType,
PCHAR strPartType,
DWORD cchPartType);
/* EOF */