23 WCHAR szUnitBuffer[8];
55 swprintf(pszOutBuffer,
L"%4I64u %-2s", ullSize, szUnitBuffer);
58 L"%4I64u %-2s", ullSize, szUnitBuffer);
73 SectorCount = DiskEntry->EndSector.QuadPart - DiskEntry->StartSector.QuadPart + 1;
75 Entry = DiskEntry->PrimaryPartListHead.Flink;
76 while (
Entry != &DiskEntry->PrimaryPartListHead)
89 Entry = DiskEntry->LogicalPartListHead.Flink;
90 while (
Entry != &DiskEntry->LogicalPartListHead)
104 SectorCount = DiskEntry->EndSector.QuadPart - DiskEntry->StartSector.QuadPart + 1;
106 Entry = DiskEntry->PrimaryPartListHead.Flink;
107 while (
Entry != &DiskEntry->PrimaryPartListHead)
132 WCHAR szDiskSizeBuffer[8];
133 WCHAR szFreeSizeBuffer[8];
138 DiskSize = DiskEntry->SectorCount.QuadPart *
151 DiskEntry->DiskNumber,
198 ULONG PartNumber = 1;
200 WCHAR szPartitionTypeBuffer[40];
201 WCHAR szSizeBuffer[8];
202 WCHAR szOffsetBuffer[8];
218 bPartitionFound =
TRUE;
230 bPartitionFound =
TRUE;
236 if (bPartitionFound ==
FALSE)
266 szPartitionTypeBuffer,
ARRAYSIZE(szPartitionTypeBuffer));
271 szPartitionTypeBuffer,
294 szPartitionTypeBuffer,
ARRAYSIZE(szPartitionTypeBuffer));
298 szPartitionTypeBuffer,
344 szPartitionTypeBuffer,
ARRAYSIZE(szPartitionTypeBuffer));
349 szPartitionTypeBuffer,
368 WCHAR szVolumeTypeBuffer[30];
369 WCHAR szInfoBuffer[16];
370 WCHAR szSizeBuffer[8];
373 switch (VolumeEntry->VolumeType)
398 if (VolumeEntry->IsSystem)
400 else if (VolumeEntry->IsBoot)
405 VolumeEntry->VolumeNumber,
406 VolumeEntry->DriveLetter,
407 (VolumeEntry->pszLabel) ? VolumeEntry->pszLabel :
L"",
408 (VolumeEntry->pszFilesystem) ? VolumeEntry->pszFilesystem :
L"",
449 ConPuts(
StdOut,
L"The LIST VDISK command is not implemented yet!\n");
void ConPuts(FILE *fp, LPCWSTR psz)
void ConResPrintf(FILE *fp, UINT nID,...)
void ConResPuts(FILE *fp, UINT nID)
EXIT_CODE ListPartition(_In_ INT argc, _In_ PWSTR *argv)
EXIT_CODE ListVolume(_In_ INT argc, _In_ PWSTR *argv)
EXIT_CODE ListVirtualDisk(_In_ INT argc, _In_ PWSTR *argv)
EXIT_CODE ListDisk(_In_ INT argc, _In_ PWSTR *argv)
static ULONGLONG GetFreeDiskSize(_In_ PDISKENTRY DiskEntry)
VOID PrintDisk(_In_ PDISKENTRY DiskEntry)
static VOID PrintSize(_In_ ULONGLONG ullSize, _Out_ PWSTR pszOutBuffer, _In_ ULONG ulOutBufferSize)
VOID PrintVolume(_In_ PVOLENTRY VolumeEntry)
#define IDS_PARTITION_TYPE_EXTENDED
#define IDS_VOLUME_TYPE_DVD
#define IDS_PARTITION_TYPE_UNKNOWN
#define IDS_LIST_DISK_LINE
#define IDS_LIST_PARTITION_NO_DISK
#define IDS_VOLUME_TYPE_REMOVABLE
#define IDS_LIST_DISK_HEAD
#define IDS_PARTITION_TYPE_LOGICAL
#define IDS_LIST_VOLUME_LINE
#define IDS_LIST_VOLUME_HEAD
#define IDS_STATUS_ONLINE
#define IDS_LIST_DISK_FORMAT
#define IDS_PARTITION_TYPE_SYSTEM
#define IDS_LIST_PARTITION_HEAD
#define IDS_VOLUME_TYPE_PARTITION
#define IDS_PARTITION_TYPE_PRIMARY
#define IDS_PARTITION_TYPE_UNUSED
#define IDS_PARTITION_TYPE_RESERVED
#define IDS_LIST_PARTITION_LINE
#define IDS_LIST_VOLUME_FORMAT
#define IDS_VOLUME_TYPE_UNKNOWN
#define IDS_LIST_PARTITION_NONE
#define IDS_LIST_PARTITION_FORMAT
#define PARTITION_ENTRY_UNUSED
LIST_ENTRY VolumeListHead
enum _EXIT_CODE EXIT_CODE
INT WINAPI DECLSPEC_HOTPATCH LoadStringW(HINSTANCE instance, UINT resource_id, LPWSTR buffer, INT buflen)
#define IsContainerPartition(PartitionType)
#define IsEqualGUID(rguid1, rguid2)
ULONGLONG RoundingDivide(IN ULONGLONG Dividend, IN ULONGLONG Divisor)
STRSAFEAPI StringCchPrintfW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszFormat,...)
base of all file and directory entries
LIST_ENTRY LogicalPartListHead
LIST_ENTRY PrimaryPartListHead
struct _LIST_ENTRY * Flink
ULARGE_INTEGER SectorCount
ULARGE_INTEGER StartSector
#define CONTAINING_RECORD(address, type, field)
static PPARTENTRY CurrentPartition