72 if (IsEqualPartitionType(PartEntry->PartitionType,
87 if ((
cchBuffer > 0) && (*strBuffer ==
'\0'))
91 PartEntry->PartitionType);
102 if (DiskSize >= 10 *
GB)
126 if (PartSize >= 10 *
GB)
133 if (PartSize >= 10 *
MB)
157 PVOLINFO VolInfo = (PartEntry->Volume ? &PartEntry->Volume->Info :
NULL);
163 if (PartEntry->IsPartitioned ==
FALSE)
169 PartEntry->LogicalPartition ?
" " :
"",
210 PartEntry->BootIndicator ?
'*' :
' ',
211 PartEntry->LogicalPartition ?
" " :
"",
212 PartEntry->PartitionNumber);
221 size_t cchLabelSize = 0;
228 cchLabelSize = cchBufferSize - cchLabelSize;
229 cchBufferSize -= cchLabelSize;
239 25 -
min(cchLabelSize, 25),
244 CHAR PartTypeString[32];
281 "%*s%6I64u %s (%6I64u %s %s)",
316 if (DiskEntry->DriverName.Length > 0)
322 DiskEntry->DiskNumber,
326 &DiskEntry->DriverName,
337 DiskEntry->DiskNumber,
366 ListUi->Right = Right;
377 ListUi->CurrentDisk =
NULL;
378 ListUi->CurrentPartition =
NULL;
385 if (!
IsListEmpty(&ListUi->CurrentDisk->PrimaryPartListHead))
387 ListUi->CurrentPartition =
CONTAINING_RECORD(ListUi->CurrentDisk->PrimaryPartListHead.Flink,
399 ASSERT(CurrentEntry->DiskEntry->PartList ==
List);
401 ListUi->CurrentPartition = CurrentEntry;
402 ListUi->CurrentDisk = CurrentEntry->DiskEntry;
416 Width = ListUi->Right - ListUi->Left - 1;
417 Height = ListUi->Bottom - ListUi->Top - 2;
419 coPos.
X = ListUi->Left + 1;
420 coPos.
Y = ListUi->Top + 1 + ListUi->Line;
422 if (ListUi->Line >= 0 && ListUi->Line <=
Height)
452 CHAR LineBuffer[100];
456 Width = ListUi->Right - ListUi->Left - 1;
457 Height = ListUi->Bottom - ListUi->Top - 2;
459 coPos.
X = ListUi->Left + 1;
460 coPos.
Y = ListUi->Top + 1 + ListUi->Line;
462 Attribute = (ListUi->CurrentDisk == DiskEntry &&
463 ListUi->CurrentPartition == PartEntry) ?
467 if (ListUi->Line >= 0 && ListUi->Line <=
Height)
477 if (ListUi->Line >= 0 && ListUi->Line <=
Height)
487 if (ListUi->Line >= 0 && ListUi->Line <=
Height)
505 PPARTENTRY PrimaryPartEntry, LogicalPartEntry;
511 CHAR LineBuffer[100];
515 Width = ListUi->Right - ListUi->Left - 1;
516 Height = ListUi->Bottom - ListUi->Top - 2;
518 coPos.
X = ListUi->Left + 1;
519 coPos.
Y = ListUi->Top + 1 + ListUi->Line;
521 if (ListUi->Line >= 0 && ListUi->Line <=
Height)
537 if (ListUi->Line >= 0 && ListUi->Line <=
Height)
552 for (PrimaryEntry = DiskEntry->PrimaryPartListHead.
Flink;
553 PrimaryEntry != &DiskEntry->PrimaryPartListHead;
554 PrimaryEntry = PrimaryEntry->
Flink)
564 for (LogicalEntry = DiskEntry->LogicalPartListHead.
Flink;
565 LogicalEntry != &DiskEntry->LogicalPartListHead;
566 LogicalEntry = LogicalEntry->
Flink)
594 SHORT CurrentDiskLine;
595 SHORT CurrentPartLine;
600 Width = ListUi->Right - ListUi->Left - 1;
601 Height = ListUi->Bottom - ListUi->Top - 2;
615 if (CurrentPartLineFound ==
FALSE)
617 CurrentPartLine += 2;
622 Entry2 = Entry2->
Flink)
625 if (PartEntry == ListUi->CurrentPartition)
627 CurrentPartLineFound =
TRUE;
630 if (CurrentPartLineFound ==
FALSE)
638 if (CurrentPartLineFound ==
FALSE)
642 Entry2 = Entry2->
Flink)
645 if (PartEntry == ListUi->CurrentPartition)
647 CurrentPartLineFound =
TRUE;
650 if (CurrentPartLineFound ==
FALSE)
659 if (DiskEntry == ListUi->CurrentDisk)
661 CurrentDiskLineFound =
TRUE;
666 if (CurrentDiskLineFound ==
FALSE)
669 CurrentDiskLine = CurrentPartLine;
681 if (CurrentPartLine < ListUi->
Offset)
683 ListUi->Offset = CurrentPartLine;
685 else if (CurrentPartLine - ListUi->Offset >
Height)
687 ListUi->Offset = CurrentPartLine -
Height;
690 if (CurrentDiskLine < ListUi->
Offset && CurrentPartLine - CurrentDiskLine <
Height)
692 ListUi->Offset = CurrentDiskLine;
696 coPos.
X = ListUi->Left;
697 coPos.
Y = ListUi->Top;
705 coPos.
X = ListUi->Left + 1;
706 coPos.
Y = ListUi->Top;
707 if (ListUi->Offset == 0)
723 CHAR szBuff[] =
"(.)";
725 coPos.
X = ListUi->Right - 5;
732 coPos.
X = ListUi->Right - 2;
741 coPos.
X = ListUi->Right;
742 coPos.
Y = ListUi->Top;
750 for (
i = ListUi->Top + 1; i < ListUi->
Bottom;
i++)
752 coPos.
X = ListUi->Left;
760 coPos.
X = ListUi->Right;
769 coPos.
X = ListUi->Left;
770 coPos.
Y = ListUi->Bottom;
778 coPos.
X = ListUi->Left + 1;
779 coPos.
Y = ListUi->Bottom;
780 if (LastLine - ListUi->Offset <=
Height)
796 CHAR szBuff[] =
"(.)";
798 coPos.
X = ListUi->Right - 5;
805 coPos.
X = ListUi->Right - 2;
814 coPos.
X = ListUi->Right;
815 coPos.
Y = ListUi->Bottom;
823 ListUi->Line = -ListUi->Offset;
850 ListUi->CurrentPartition = PartEntry;
851 ListUi->CurrentDisk = PartEntry->
DiskEntry;
ACPI_SIZE strlen(const char *String)
const GPT_PARTITION_TYPE GptPartitionTypes[NUM_GPT_PARTITION_TYPES]
const MBR_PARTITION_TYPE MbrPartitionTypes[NUM_MBR_PARTITION_TYPES]
BOOL WINAPI WriteConsoleOutputCharacterA(HANDLE hConsoleOutput, IN LPCSTR lpCharacter, IN DWORD nLength, IN COORD dwWriteCoord, OUT LPDWORD lpNumberOfCharsWritten)
BOOL WINAPI FillConsoleOutputCharacterA(IN HANDLE hConsoleOutput, IN CHAR cCharacter, IN DWORD nLength, IN COORD dwWriteCoord, OUT LPDWORD lpNumberOfCharsWritten)
BOOL WINAPI FillConsoleOutputAttribute(IN HANDLE hConsoleOutput, IN WORD wAttribute, IN DWORD nLength, IN COORD dwWriteCoord, OUT LPDWORD lpNumberOfAttrsWritten)
static LPHIST_ENTRY Bottom
#define PARTITION_ENTRY_UNUSED
static const WCHAR Description[]
#define IsListEmpty(ListHead)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
#define GetDiskSizeInBytes(DiskEntry)
#define GetPartEntrySizeInBytes(PartEntry)
__GNU_EXTENSION typedef unsigned __int64 * PULONGLONG
#define IsContainerPartition(PartitionType)
_In_ ULONG _In_ ULONG Offset
NTSTRSAFEAPI RtlStringCchCopyA(_Out_writes_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, _In_ size_t cchDest, _In_ NTSTRSAFE_PCSTR pszSrc)
NTSTRSAFEVAPI RtlStringCchPrintfA(_Out_writes_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, _In_ size_t cchDest, _In_ _Printf_format_string_ NTSTRSAFE_PCSTR pszFormat,...)
NTSTRSAFEVAPI RtlStringCchPrintfExA(_Out_writes_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, _In_ size_t cchDest, _Outptr_opt_result_buffer_(*pcchRemaining) NTSTRSAFE_PSTR *ppszDestEnd, _Out_opt_ size_t *pcchRemaining, _In_ STRSAFE_DWORD dwFlags, _In_ _Printf_format_string_ NTSTRSAFE_PCSTR pszFormat,...)
ULONGLONG RoundingDivide(IN ULONGLONG Dividend, IN ULONGLONG Divisor)
PPARTENTRY NTAPI GetPrevPartition(IN PPARTLIST List, IN PPARTENTRY CurrentPart OPTIONAL)
PPARTENTRY NTAPI GetNextPartition(IN PPARTLIST List, IN PPARTENTRY CurrentPart OPTIONAL)
VOID ScrollUpDownPartitionList(_In_ PPARTLIST_UI ListUi, _In_ BOOLEAN Direction)
VOID PartitionDescription(IN PPARTENTRY PartEntry, OUT PSTR strBuffer, IN SIZE_T cchBuffer)
VOID DiskDescription(IN PDISKENTRY DiskEntry, OUT PSTR strBuffer, IN SIZE_T cchBuffer)
VOID PrettifySize1(IN OUT PULONGLONG Size, OUT PCSTR *Unit)
static VOID PrintDiskData(IN PPARTLIST_UI ListUi, IN PDISKENTRY DiskEntry)
VOID GetPartitionTypeString(IN PPARTENTRY PartEntry, OUT PSTR strBuffer, IN ULONG cchBuffer)
VOID DrawPartitionList(IN PPARTLIST_UI ListUi)
static VOID PrintEmptyLine(IN PPARTLIST_UI ListUi)
VOID PrettifySize2(IN OUT PULONGLONG Size, OUT PCSTR *Unit)
static VOID PrintPartitionData(IN PPARTLIST_UI ListUi, IN PDISKENTRY DiskEntry, IN PPARTENTRY PartEntry)
VOID InitPartitionListUi(IN OUT PPARTLIST_UI ListUi, IN PPARTLIST List, IN PPARTENTRY CurrentEntry OPTIONAL, IN SHORT Left, IN SHORT Top, IN SHORT Right, IN SHORT Bottom)
PULONG MinorVersion OPTIONAL
base of all file and directory entries
LIST_ENTRY LogicalPartListHead
LIST_ENTRY PrimaryPartListHead
struct _LIST_ENTRY * Flink
struct _DISKENTRY * DiskEntry
WCHAR FileSystem[MAX_PATH+1]
#define CONTAINING_RECORD(address, type, field)
_In_ HFONT _Out_ PUINT _Out_ PUINT Width
_In_ HFONT _Out_ PUINT Height
CHAR CharUpperRightCorner
CHAR CharLowerRightCorner
PCSTR MUIGetString(ULONG Number)
#define STRING_FORMATUNUSED
#define STRING_FORMATUNKNOWN
#define STRING_UNFORMATTED
#define STRING_EXTENDED_PARTITION
#define IsFormatted(VolInfo)
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
WDF_EXTERN_C_START typedef _In_ WDFDEVICE _In_ WDFCONTEXT _In_ WDF_DMA_DIRECTION Direction
_Must_inspect_result_ _In_ WDFCMRESLIST List