2011-09-24 10:33:33 +00:00
|
|
|
/*
|
|
|
|
* PROJECT: ReactOS DiskPart
|
|
|
|
* LICENSE: GPL - See COPYING in the top level directory
|
|
|
|
* FILE: base/system/diskpart/detail.c
|
2016-10-01 22:58:21 +00:00
|
|
|
* PURPOSE: Manages all the partitions of the OS in an interactive way.
|
2011-09-24 10:33:33 +00:00
|
|
|
* PROGRAMMERS: Lee Schroeder
|
|
|
|
*/
|
2014-01-13 13:07:50 +00:00
|
|
|
|
2011-09-24 10:33:33 +00:00
|
|
|
#include "diskpart.h"
|
|
|
|
|
2022-03-27 22:25:34 +00:00
|
|
|
#define NDEBUG
|
|
|
|
#include <debug.h>
|
|
|
|
|
|
|
|
/* FUNCTIONS ******************************************************************/
|
|
|
|
|
2022-05-15 10:27:53 +00:00
|
|
|
BOOL
|
2022-03-27 22:25:34 +00:00
|
|
|
DetailDisk(
|
|
|
|
INT argc,
|
2022-05-15 10:27:53 +00:00
|
|
|
PWSTR *argv)
|
2011-09-24 10:33:33 +00:00
|
|
|
{
|
2022-03-27 22:25:34 +00:00
|
|
|
DPRINT("DetailDisk()\n");
|
|
|
|
|
|
|
|
if (argc > 2)
|
|
|
|
{
|
|
|
|
ConResPuts(StdErr, IDS_ERROR_INVALID_ARGS);
|
2022-05-15 10:27:53 +00:00
|
|
|
return TRUE;
|
2022-03-27 22:25:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (CurrentDisk == NULL)
|
|
|
|
{
|
|
|
|
ConResPuts(StdOut, IDS_SELECT_NO_DISK);
|
2022-05-15 10:27:53 +00:00
|
|
|
return TRUE;
|
2022-03-27 22:25:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* TODO: Print more disk details */
|
|
|
|
ConPuts(StdOut, L"\n");
|
|
|
|
ConResPrintf(StdOut, IDS_DETAIL_INFO_DISK_ID, CurrentDisk->LayoutBuffer->Signature);
|
|
|
|
ConResPrintf(StdOut, IDS_DETAIL_INFO_PATH, CurrentDisk->PathId);
|
|
|
|
ConResPrintf(StdOut, IDS_DETAIL_INFO_TARGET, CurrentDisk->TargetId);
|
|
|
|
ConResPrintf(StdOut, IDS_DETAIL_INFO_LUN_ID, CurrentDisk->Lun);
|
|
|
|
ConPuts(StdOut, L"\n");
|
2022-05-15 10:27:53 +00:00
|
|
|
|
|
|
|
return TRUE;
|
2022-03-27 22:25:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2022-05-15 10:27:53 +00:00
|
|
|
BOOL
|
2022-03-27 22:25:34 +00:00
|
|
|
DetailPartition(
|
|
|
|
INT argc,
|
2022-05-15 10:27:53 +00:00
|
|
|
PWSTR *argv)
|
2022-03-27 22:25:34 +00:00
|
|
|
{
|
|
|
|
PPARTENTRY PartEntry;
|
|
|
|
ULONGLONG PartOffset;
|
|
|
|
|
|
|
|
DPRINT("DetailPartition()\n");
|
|
|
|
|
|
|
|
if (argc > 2)
|
|
|
|
{
|
|
|
|
ConResPuts(StdErr, IDS_ERROR_INVALID_ARGS);
|
2022-05-15 10:27:53 +00:00
|
|
|
return TRUE;
|
2022-03-27 22:25:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (CurrentDisk == NULL)
|
|
|
|
{
|
|
|
|
ConResPuts(StdOut, IDS_SELECT_PARTITION_NO_DISK);
|
2022-05-15 10:27:53 +00:00
|
|
|
return TRUE;
|
2022-03-27 22:25:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (CurrentPartition == NULL)
|
|
|
|
{
|
|
|
|
ConResPuts(StdOut, IDS_SELECT_NO_PARTITION);
|
2022-05-15 10:27:53 +00:00
|
|
|
return TRUE;
|
2022-03-27 22:25:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
PartEntry = CurrentPartition;
|
|
|
|
PartOffset = PartEntry->StartSector.QuadPart * CurrentDisk->BytesPerSector;
|
|
|
|
|
|
|
|
/* TODO: Print more partition details */
|
|
|
|
ConPuts(StdOut, L"\n");
|
|
|
|
ConResPrintf(StdOut, IDS_DETAIL_PARTITION_NUMBER, PartEntry->PartitionNumber);
|
|
|
|
ConResPrintf(StdOut, IDS_DETAIL_PARTITION_TYPE, PartEntry->PartitionType);
|
|
|
|
ConResPrintf(StdOut, IDS_DETAIL_PARTITION_HIDDEN, "");
|
|
|
|
ConResPrintf(StdOut, IDS_DETAIL_PARTITION_ACTIVE, PartEntry->BootIndicator ? L"Yes" : L"No");
|
|
|
|
ConResPrintf(StdOut, IDS_DETAIL_PARTITION_OFFSET, PartOffset);
|
|
|
|
ConPuts(StdOut, L"\n");
|
2022-05-15 10:27:53 +00:00
|
|
|
|
|
|
|
return TRUE;
|
2022-03-27 22:25:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2022-05-15 10:27:53 +00:00
|
|
|
BOOL
|
2022-03-27 22:25:34 +00:00
|
|
|
DetailVolume(
|
|
|
|
INT argc,
|
2022-05-15 10:27:53 +00:00
|
|
|
PWSTR *argv)
|
2022-03-27 22:25:34 +00:00
|
|
|
{
|
|
|
|
DPRINT("DetailVolume()\n");
|
|
|
|
|
|
|
|
if (argc > 2)
|
|
|
|
{
|
|
|
|
ConResPuts(StdErr, IDS_ERROR_INVALID_ARGS);
|
2022-05-15 10:27:53 +00:00
|
|
|
return TRUE;
|
2022-03-27 22:25:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (CurrentVolume == NULL)
|
|
|
|
{
|
|
|
|
ConResPuts(StdOut, IDS_SELECT_NO_VOLUME);
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2022-05-15 10:27:53 +00:00
|
|
|
/* TODO: Print volume details */
|
2022-03-27 22:25:34 +00:00
|
|
|
|
2011-09-24 10:33:33 +00:00
|
|
|
return TRUE;
|
|
|
|
}
|