54 &PartEntry->PartitionType);
65 if ((
cchBuffer > 0) && (*strBuffer ==
'\0'))
69 PartEntry->PartitionType);
80 if (DiskSize >= 10 *
GB)
104 if (PartSize >= 10 *
GB)
111 if (PartSize >= 10 *
MB)
135 PVOLINFO VolInfo = (PartEntry->Volume ? &PartEntry->Volume->Info :
NULL);
141 if (PartEntry->IsPartitioned ==
FALSE)
147 PartEntry->LogicalPartition ?
" " :
"",
188 PartEntry->BootIndicator ?
'*' :
' ',
189 PartEntry->LogicalPartition ?
" " :
"",
190 PartEntry->PartitionNumber);
199 size_t cchLabelSize = 0;
206 cchLabelSize = cchBufferSize - cchLabelSize;
207 cchBufferSize -= cchLabelSize;
217 25 -
min(cchLabelSize, 25),
222 CHAR PartTypeString[32];
259 "%*s%6I64u %s (%6I64u %s %s)",
294 if (DiskEntry->DriverName.Length > 0)
300 DiskEntry->DiskNumber,
304 &DiskEntry->DriverName,
315 DiskEntry->DiskNumber,
344 ListUi->Right = Right;
355 ListUi->CurrentDisk =
NULL;
356 ListUi->CurrentPartition =
NULL;
363 if (!
IsListEmpty(&ListUi->CurrentDisk->PrimaryPartListHead))
365 ListUi->CurrentPartition =
CONTAINING_RECORD(ListUi->CurrentDisk->PrimaryPartListHead.Flink,
377 ASSERT(CurrentEntry->DiskEntry->PartList ==
List);
379 ListUi->CurrentPartition = CurrentEntry;
380 ListUi->CurrentDisk = CurrentEntry->DiskEntry;
394 Width = ListUi->Right - ListUi->Left - 1;
395 Height = ListUi->Bottom - ListUi->Top - 2;
397 coPos.
X = ListUi->Left + 1;
398 coPos.
Y = ListUi->Top + 1 + ListUi->Line;
400 if (ListUi->Line >= 0 && ListUi->Line <=
Height)
430 CHAR LineBuffer[100];
434 Width = ListUi->Right - ListUi->Left - 1;
435 Height = ListUi->Bottom - ListUi->Top - 2;
437 coPos.
X = ListUi->Left + 1;
438 coPos.
Y = ListUi->Top + 1 + ListUi->Line;
440 Attribute = (ListUi->CurrentDisk == DiskEntry &&
441 ListUi->CurrentPartition == PartEntry) ?
445 if (ListUi->Line >= 0 && ListUi->Line <=
Height)
455 if (ListUi->Line >= 0 && ListUi->Line <=
Height)
465 if (ListUi->Line >= 0 && ListUi->Line <=
Height)
483 PPARTENTRY PrimaryPartEntry, LogicalPartEntry;
489 CHAR LineBuffer[100];
493 Width = ListUi->Right - ListUi->Left - 1;
494 Height = ListUi->Bottom - ListUi->Top - 2;
496 coPos.
X = ListUi->Left + 1;
497 coPos.
Y = ListUi->Top + 1 + ListUi->Line;
499 if (ListUi->Line >= 0 && ListUi->Line <=
Height)
515 if (ListUi->Line >= 0 && ListUi->Line <=
Height)
530 for (PrimaryEntry = DiskEntry->PrimaryPartListHead.
Flink;
531 PrimaryEntry != &DiskEntry->PrimaryPartListHead;
532 PrimaryEntry = PrimaryEntry->
Flink)
542 for (LogicalEntry = DiskEntry->LogicalPartListHead.
Flink;
543 LogicalEntry != &DiskEntry->LogicalPartListHead;
544 LogicalEntry = LogicalEntry->
Flink)
572 SHORT CurrentDiskLine;
573 SHORT CurrentPartLine;
578 Width = ListUi->Right - ListUi->Left - 1;
579 Height = ListUi->Bottom - ListUi->Top - 2;
593 if (CurrentPartLineFound ==
FALSE)
595 CurrentPartLine += 2;
600 Entry2 = Entry2->
Flink)
603 if (PartEntry == ListUi->CurrentPartition)
605 CurrentPartLineFound =
TRUE;
608 if (CurrentPartLineFound ==
FALSE)
616 if (CurrentPartLineFound ==
FALSE)
620 Entry2 = Entry2->
Flink)
623 if (PartEntry == ListUi->CurrentPartition)
625 CurrentPartLineFound =
TRUE;
628 if (CurrentPartLineFound ==
FALSE)
637 if (DiskEntry == ListUi->CurrentDisk)
639 CurrentDiskLineFound =
TRUE;
644 if (CurrentDiskLineFound ==
FALSE)
647 CurrentDiskLine = CurrentPartLine;
659 if (CurrentPartLine < ListUi->
Offset)
661 ListUi->Offset = CurrentPartLine;
663 else if (CurrentPartLine - ListUi->Offset >
Height)
665 ListUi->Offset = CurrentPartLine -
Height;
668 if (CurrentDiskLine < ListUi->
Offset && CurrentPartLine - CurrentDiskLine <
Height)
670 ListUi->Offset = CurrentDiskLine;
674 coPos.
X = ListUi->Left;
675 coPos.
Y = ListUi->Top;
683 coPos.
X = ListUi->Left + 1;
684 coPos.
Y = ListUi->Top;
685 if (ListUi->Offset == 0)
701 CHAR szBuff[] =
"(.)";
703 coPos.
X = ListUi->Right - 5;
710 coPos.
X = ListUi->Right - 2;
719 coPos.
X = ListUi->Right;
720 coPos.
Y = ListUi->Top;
728 for (
i = ListUi->Top + 1; i < ListUi->
Bottom;
i++)
730 coPos.
X = ListUi->Left;
738 coPos.
X = ListUi->Right;
747 coPos.
X = ListUi->Left;
748 coPos.
Y = ListUi->Bottom;
756 coPos.
X = ListUi->Left + 1;
757 coPos.
Y = ListUi->Bottom;
758 if (LastLine - ListUi->Offset <=
Height)
774 CHAR szBuff[] =
"(.)";
776 coPos.
X = ListUi->Right - 5;
783 coPos.
X = ListUi->Right - 2;
792 coPos.
X = ListUi->Right;
793 coPos.
Y = ListUi->Bottom;
801 ListUi->Line = -ListUi->Offset;
828 ListUi->CurrentPartition = PartEntry;
829 ListUi->CurrentDisk = PartEntry->
DiskEntry;
ACPI_SIZE strlen(const char *String)
PCSTR NTAPI LookupPartitionTypeString(_In_ PARTITION_STYLE PartitionStyle, _In_ PVOID PartitionType)
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