ReactOS 0.4.16-dev-823-g9a093ec
partlist.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _PARTLIST_UI
 

Typedefs

typedef struct _PARTLIST_UI PARTLIST_UI
 
typedef struct _PARTLIST_UIPPARTLIST_UI
 

Functions

VOID GetPartitionTypeString (IN PPARTENTRY PartEntry, OUT PSTR strBuffer, IN ULONG cchBuffer)
 
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 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)
 
VOID DrawPartitionList (IN PPARTLIST_UI ListUi)
 
VOID ScrollUpDownPartitionList (_In_ PPARTLIST_UI ListUi, _In_ BOOLEAN Direction)
 

Typedef Documentation

◆ PARTLIST_UI

◆ PPARTLIST_UI

Function Documentation

◆ DiskDescription()

VOID DiskDescription ( IN PDISKENTRY  DiskEntry,
OUT PSTR  strBuffer,
IN SIZE_T  cchBuffer 
)

Definition at line 279 of file partlist.c.

283{
284 ULONGLONG DiskSize;
285 PCSTR Unit;
286
287 /* Get the disk size */
288 DiskSize = GetDiskSizeInBytes(DiskEntry);
289 PrettifySize1(&DiskSize, &Unit);
290
291 //
292 // FIXME: We *MUST* use TXTSETUP.SIF strings from section "DiskDriverMap" !!
293 //
294 if (DiskEntry->DriverName.Length > 0)
295 {
298 DiskSize,
299 Unit,
300 DiskEntry->DiskNumber,
301 DiskEntry->Port,
302 DiskEntry->Bus,
303 DiskEntry->Id,
304 &DiskEntry->DriverName,
305 DiskEntry->DiskStyle == PARTITION_STYLE_MBR ? "MBR" :
306 DiskEntry->DiskStyle == PARTITION_STYLE_GPT ? "GPT" :
307 "RAW");
308 }
309 else
310 {
313 DiskSize,
314 Unit,
315 DiskEntry->DiskNumber,
316 DiskEntry->Port,
317 DiskEntry->Bus,
318 DiskEntry->Id,
319 DiskEntry->DiskStyle == PARTITION_STYLE_MBR ? "MBR" :
320 DiskEntry->DiskStyle == PARTITION_STYLE_GPT ? "GPT" :
321 "RAW");
322 }
323}
static DWORD cchBuffer
Definition: fusion.c:85
Unit
Definition: gdiplusenums.h:26
#define GetDiskSizeInBytes(DiskEntry)
Definition: partlist.h:257
@ PARTITION_STYLE_GPT
Definition: imports.h:202
@ PARTITION_STYLE_MBR
Definition: imports.h:201
NTSTRSAFEVAPI RtlStringCchPrintfA(_Out_writes_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, _In_ size_t cchDest, _In_ _Printf_format_string_ NTSTRSAFE_PCSTR pszFormat,...)
Definition: ntstrsafe.h:1085
VOID PrettifySize1(IN OUT PULONGLONG Size, OUT PCSTR *Unit)
Definition: partlist.c:74
const char * PCSTR
Definition: typedefs.h:52
uint64_t ULONGLONG
Definition: typedefs.h:67
PCSTR MUIGetString(ULONG Number)
Definition: mui.c:251
#define STRING_HDDINFO2
Definition: mui.h:177
#define STRING_HDDINFO1
Definition: mui.h:176

Referenced by ChangeSystemPartitionPage(), CheckFileSystemPage(), CreatePartitionPage(), DeletePartitionPage(), FormatPartitionPage(), PrintDiskData(), and SelectFileSystemPage().

◆ DrawPartitionList()

VOID DrawPartitionList ( IN PPARTLIST_UI  ListUi)

Definition at line 560 of file partlist.c.

562{
563 PPARTLIST List = ListUi->List;
564 PLIST_ENTRY Entry, Entry2;
565 PDISKENTRY DiskEntry;
566 PPARTENTRY PartEntry = NULL;
567 COORD coPos;
568 ULONG Written;
571 SHORT i;
572 SHORT CurrentDiskLine;
573 SHORT CurrentPartLine;
574 SHORT LastLine;
575 BOOLEAN CurrentPartLineFound = FALSE;
576 BOOLEAN CurrentDiskLineFound = FALSE;
577
578 Width = ListUi->Right - ListUi->Left - 1;
579 Height = ListUi->Bottom - ListUi->Top - 2;
580
581 /* Calculate the line of the current disk and partition */
582 CurrentDiskLine = 0;
583 CurrentPartLine = 0;
584 LastLine = 0;
585
586 for (Entry = List->DiskListHead.Flink;
587 Entry != &List->DiskListHead;
588 Entry = Entry->Flink)
589 {
590 DiskEntry = CONTAINING_RECORD(Entry, DISKENTRY, ListEntry);
591
592 LastLine += 2;
593 if (CurrentPartLineFound == FALSE)
594 {
595 CurrentPartLine += 2;
596 }
597
598 for (Entry2 = DiskEntry->PrimaryPartListHead.Flink;
599 Entry2 != &DiskEntry->PrimaryPartListHead;
600 Entry2 = Entry2->Flink)
601 {
602 PartEntry = CONTAINING_RECORD(Entry2, PARTENTRY, ListEntry);
603 if (PartEntry == ListUi->CurrentPartition)
604 {
605 CurrentPartLineFound = TRUE;
606 }
607
608 if (CurrentPartLineFound == FALSE)
609 {
610 CurrentPartLine++;
611 }
612
613 LastLine++;
614 }
615
616 if (CurrentPartLineFound == FALSE)
617 {
618 for (Entry2 = DiskEntry->LogicalPartListHead.Flink;
619 Entry2 != &DiskEntry->LogicalPartListHead;
620 Entry2 = Entry2->Flink)
621 {
622 PartEntry = CONTAINING_RECORD(Entry2, PARTENTRY, ListEntry);
623 if (PartEntry == ListUi->CurrentPartition)
624 {
625 CurrentPartLineFound = TRUE;
626 }
627
628 if (CurrentPartLineFound == FALSE)
629 {
630 CurrentPartLine++;
631 }
632
633 LastLine++;
634 }
635 }
636
637 if (DiskEntry == ListUi->CurrentDisk)
638 {
639 CurrentDiskLineFound = TRUE;
640 }
641
642 if (Entry->Flink != &List->DiskListHead)
643 {
644 if (CurrentDiskLineFound == FALSE)
645 {
646 CurrentPartLine++;
647 CurrentDiskLine = CurrentPartLine;
648 }
649
650 LastLine++;
651 }
652 else
653 {
654 LastLine--;
655 }
656 }
657
658 /* If it possible, make the disk name visible */
659 if (CurrentPartLine < ListUi->Offset)
660 {
661 ListUi->Offset = CurrentPartLine;
662 }
663 else if (CurrentPartLine - ListUi->Offset > Height)
664 {
665 ListUi->Offset = CurrentPartLine - Height;
666 }
667
668 if (CurrentDiskLine < ListUi->Offset && CurrentPartLine - CurrentDiskLine < Height)
669 {
670 ListUi->Offset = CurrentDiskLine;
671 }
672
673 /* Draw upper left corner */
674 coPos.X = ListUi->Left;
675 coPos.Y = ListUi->Top;
677 CharUpperLeftCorner, // '+',
678 1,
679 coPos,
680 &Written);
681
682 /* Draw upper edge */
683 coPos.X = ListUi->Left + 1;
684 coPos.Y = ListUi->Top;
685 if (ListUi->Offset == 0)
686 {
688 CharHorizontalLine, // '-',
689 Width,
690 coPos,
691 &Written);
692 }
693 else
694 {
696 CharHorizontalLine, // '-',
697 Width - 4,
698 coPos,
699 &Written);
700 {
701 CHAR szBuff[] = "(.)"; // "(up)"
702 szBuff[1] = CharUpArrow;
703 coPos.X = ListUi->Right - 5;
705 szBuff,
706 3,
707 coPos,
708 &Written);
709 }
710 coPos.X = ListUi->Right - 2;
712 CharHorizontalLine, // '-',
713 2,
714 coPos,
715 &Written);
716 }
717
718 /* Draw upper right corner */
719 coPos.X = ListUi->Right;
720 coPos.Y = ListUi->Top;
722 CharUpperRightCorner, // '+',
723 1,
724 coPos,
725 &Written);
726
727 /* Draw left and right edge */
728 for (i = ListUi->Top + 1; i < ListUi->Bottom; i++)
729 {
730 coPos.X = ListUi->Left;
731 coPos.Y = i;
733 CharVerticalLine, // '|',
734 1,
735 coPos,
736 &Written);
737
738 coPos.X = ListUi->Right;
740 CharVerticalLine, //'|',
741 1,
742 coPos,
743 &Written);
744 }
745
746 /* Draw lower left corner */
747 coPos.X = ListUi->Left;
748 coPos.Y = ListUi->Bottom;
750 CharLowerLeftCorner, // '+',
751 1,
752 coPos,
753 &Written);
754
755 /* Draw lower edge */
756 coPos.X = ListUi->Left + 1;
757 coPos.Y = ListUi->Bottom;
758 if (LastLine - ListUi->Offset <= Height)
759 {
761 CharHorizontalLine, // '-',
762 Width,
763 coPos,
764 &Written);
765 }
766 else
767 {
769 CharHorizontalLine, // '-',
770 Width - 4,
771 coPos,
772 &Written);
773 {
774 CHAR szBuff[] = "(.)"; // "(down)"
775 szBuff[1] = CharDownArrow;
776 coPos.X = ListUi->Right - 5;
778 szBuff,
779 3,
780 coPos,
781 &Written);
782 }
783 coPos.X = ListUi->Right - 2;
785 CharHorizontalLine, // '-',
786 2,
787 coPos,
788 &Written);
789 }
790
791 /* Draw lower right corner */
792 coPos.X = ListUi->Right;
793 coPos.Y = ListUi->Bottom;
795 CharLowerRightCorner, // '+',
796 1,
797 coPos,
798 &Written);
799
800 /* Print list entries */
801 ListUi->Line = -ListUi->Offset;
802
803 for (Entry = List->DiskListHead.Flink;
804 Entry != &List->DiskListHead;
805 Entry = Entry->Flink)
806 {
807 DiskEntry = CONTAINING_RECORD(Entry, DISKENTRY, ListEntry);
808
809 /* Print disk entry */
810 PrintDiskData(ListUi, DiskEntry);
811 }
812}
unsigned char BOOLEAN
BOOL WINAPI WriteConsoleOutputCharacterA(HANDLE hConsoleOutput, IN LPCSTR lpCharacter, IN DWORD nLength, IN COORD dwWriteCoord, OUT LPDWORD lpNumberOfCharsWritten)
Definition: console.c:407
BOOL WINAPI FillConsoleOutputCharacterA(IN HANDLE hConsoleOutput, IN CHAR cCharacter, IN DWORD nLength, IN COORD dwWriteCoord, OUT LPDWORD lpNumberOfCharsWritten)
Definition: console.c:560
static LPHIST_ENTRY Bottom
Definition: history.c:54
HANDLE StdOutput
Definition: consup.c:37
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
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
Definition: glfuncs.h:248
_In_ ULONG _In_ ULONG Offset
Definition: ntddpcm.h:101
short SHORT
Definition: pedump.c:59
unsigned short USHORT
Definition: pedump.c:61
static VOID PrintDiskData(IN PPARTLIST_UI ListUi, IN PDISKENTRY DiskEntry)
Definition: partlist.c:479
base of all file and directory entries
Definition: entries.h:83
Definition: bl.h:1338
ULONG Y
Definition: bl.h:1340
ULONG X
Definition: bl.h:1339
LIST_ENTRY LogicalPartListHead
Definition: partlist.h:150
LIST_ENTRY PrimaryPartListHead
Definition: partlist.h:149
Definition: typedefs.h:120
struct _LIST_ENTRY * Flink
Definition: typedefs.h:121
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
uint32_t ULONG
Definition: typedefs.h:59
_In_ HFONT _Out_ PUINT _Out_ PUINT Width
Definition: font.h:89
_In_ HFONT _Out_ PUINT Height
Definition: font.h:88
CHAR CharHorizontalLine
Definition: mui.c:39
CHAR CharUpperRightCorner
Definition: mui.c:42
CHAR CharDownArrow
Definition: mui.c:38
CHAR CharLowerRightCorner
Definition: mui.c:44
CHAR CharUpperLeftCorner
Definition: mui.c:41
CHAR CharVerticalLine
Definition: mui.c:40
CHAR CharLowerLeftCorner
Definition: mui.c:43
CHAR CharUpArrow
Definition: mui.c:37
_Must_inspect_result_ _In_ WDFCMRESLIST List
Definition: wdfresource.h:550
char CHAR
Definition: xmlstorage.h:175

Referenced by ScrollUpDownPartitionList().

◆ GetPartitionTypeString()

VOID GetPartitionTypeString ( IN PPARTENTRY  PartEntry,
OUT PSTR  strBuffer,
IN ULONG  cchBuffer 
)

Definition at line 881 of file drivepage.c.

885{
886 if (PartEntry->PartitionType == PARTITION_ENTRY_UNUSED)
887 {
888 StringCchCopyA(strBuffer, cchBuffer,
889 "Unused" /* MUIGetString(STRING_FORMATUNUSED) */);
890 }
891 // else if (PartEntry == PartEntry->DiskEntry->ExtendedPartition)
892 else if (IsContainerPartition(PartEntry->PartitionType))
893 {
894 StringCchCopyA(strBuffer, cchBuffer,
895 "Extended Partition" /* MUIGetString(STRING_EXTENDED_PARTITION) */);
896 }
897 else
898 {
899 /* Do the table lookup */
900 PCSTR Description = LookupPartitionTypeString(PartEntry->DiskEntry->DiskStyle,
901 &PartEntry->PartitionType);
902 if (Description)
903 {
905 return;
906 }
907
908 /* We are here because the partition type is unknown */
909 if (cchBuffer > 0) *strBuffer = '\0';
910 }
911
912 if ((cchBuffer > 0) && (*strBuffer == '\0'))
913 {
914 StringCchPrintfA(strBuffer, cchBuffer,
915 // MUIGetString(STRING_PARTTYPE),
916 "Type 0x%02x",
917 PartEntry->PartitionType);
918 }
919}
PCSTR NTAPI LookupPartitionTypeString(_In_ PARTITION_STYLE PartitionStyle, _In_ PVOID PartitionType)
Definition: partinfo.c:804
#define PARTITION_ENTRY_UNUSED
Definition: disk.h:87
static const WCHAR Description[]
Definition: oid.c:1266
#define IsContainerPartition(PartitionType)
Definition: ntdddisk.h:321
STRSAFEAPI StringCchCopyA(STRSAFE_LPSTR pszDest, size_t cchDest, STRSAFE_LPCSTR pszSrc)
Definition: strsafe.h:145
STRSAFEAPI StringCchPrintfA(STRSAFE_LPSTR pszDest, size_t cchDest, STRSAFE_LPCSTR pszFormat,...)
Definition: strsafe.h:520

Referenced by PartitionDescription(), and PrintPartitionData().

◆ InitPartitionListUi()

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 
)

Definition at line 329 of file partlist.c.

337{
338 ListUi->List = List;
339 // ListUi->FirstShown = NULL;
340 // ListUi->LastShown = NULL;
341
342 ListUi->Left = Left;
343 ListUi->Top = Top;
344 ListUi->Right = Right;
345 ListUi->Bottom = Bottom;
346
347 ListUi->Line = 0;
348 ListUi->Offset = 0;
349
350 // ListUi->Redraw = TRUE;
351
352 /* Search for first usable disk and partition */
353 if (!CurrentEntry)
354 {
355 ListUi->CurrentDisk = NULL;
356 ListUi->CurrentPartition = NULL;
357
358 if (!IsListEmpty(&List->DiskListHead))
359 {
360 ListUi->CurrentDisk = CONTAINING_RECORD(List->DiskListHead.Flink,
361 DISKENTRY, ListEntry);
362
363 if (!IsListEmpty(&ListUi->CurrentDisk->PrimaryPartListHead))
364 {
365 ListUi->CurrentPartition = CONTAINING_RECORD(ListUi->CurrentDisk->PrimaryPartListHead.Flink,
366 PARTENTRY, ListEntry);
367 }
368 }
369 }
370 else
371 {
372 /*
373 * The CurrentEntry must belong to the associated partition list,
374 * and the latter must therefore not be empty.
375 */
376 ASSERT(!IsListEmpty(&List->DiskListHead));
377 ASSERT(CurrentEntry->DiskEntry->PartList == List);
378
379 ListUi->CurrentPartition = CurrentEntry;
380 ListUi->CurrentDisk = CurrentEntry->DiskEntry;
381 }
382}
static LPHIST_ENTRY Top
Definition: history.c:53
#define IsListEmpty(ListHead)
Definition: env_spec_w32.h:954
#define ASSERT(a)
Definition: mode.c:44

Referenced by SelectPartitionPage().

◆ PartitionDescription()

VOID PartitionDescription ( IN PPARTENTRY  PartEntry,
OUT PSTR  strBuffer,
IN SIZE_T  cchBuffer 
)

Definition at line 126 of file partlist.c.

130{
131 PSTR pBuffer = strBuffer;
132 size_t cchBufferSize = cchBuffer;
133 ULONGLONG PartSize;
134 PCSTR Unit;
135 PVOLINFO VolInfo = (PartEntry->Volume ? &PartEntry->Volume->Info : NULL);
136
137 /* Get the partition size */
138 PartSize = GetPartEntrySizeInBytes(PartEntry);
139 PrettifySize2(&PartSize, &Unit);
140
141 if (PartEntry->IsPartitioned == FALSE)
142 {
143 /* Unpartitioned space: Just display the description and size */
144 RtlStringCchPrintfExA(pBuffer, cchBufferSize,
145 &pBuffer, &cchBufferSize, 0,
146 " %s%-.30s",
147 PartEntry->LogicalPartition ? " " : "", // Optional indentation
149
150 RtlStringCchPrintfA(pBuffer, cchBufferSize,
151 "%*s%6I64u %s",
152 38 - min(strlen(strBuffer), 38), "", // Indentation
153 PartSize,
154 Unit);
155 return;
156 }
157
158//
159// NOTE: This could be done with the next case.
160//
161 if ((PartEntry->DiskEntry->DiskStyle == PARTITION_STYLE_MBR) &&
162 IsContainerPartition(PartEntry->PartitionType))
163 {
164 /* Extended partition container: Just display the partition's type and size */
165 RtlStringCchPrintfExA(pBuffer, cchBufferSize,
166 &pBuffer, &cchBufferSize, 0,
167 " %-.30s",
169
170 RtlStringCchPrintfA(pBuffer, cchBufferSize,
171 "%*s%6I64u %s",
172 38 - min(strlen(strBuffer), 38), "", // Indentation
173 PartSize,
174 Unit);
175 return;
176 }
177
178 /*
179 * Not an extended partition container.
180 */
181
182 /* Drive letter and partition number */
183 RtlStringCchPrintfExA(pBuffer, cchBufferSize,
184 &pBuffer, &cchBufferSize, 0,
185 "%c%c %c %s(%lu) ",
186 !(VolInfo && VolInfo->DriveLetter) ? '-' : (CHAR)VolInfo->DriveLetter,
187 !(VolInfo && VolInfo->DriveLetter) ? '-' : ':',
188 PartEntry->BootIndicator ? '*' : ' ',
189 PartEntry->LogicalPartition ? " " : "", // Optional indentation
190 PartEntry->PartitionNumber);
191
192 /*
193 * If the volume's file system is recognized, display the volume label
194 * (if any) and the file system name. Otherwise, display the partition
195 * type if it's not a new partition.
196 */
197 if (VolInfo && IsFormatted(VolInfo))
198 {
199 size_t cchLabelSize = 0;
200 if (*VolInfo->VolumeLabel)
201 {
202 RtlStringCchPrintfExA(pBuffer, cchBufferSize,
203 &pBuffer, &cchLabelSize, 0,
204 "\"%-.11S\" ",
205 VolInfo->VolumeLabel);
206 cchLabelSize = cchBufferSize - cchLabelSize; // Actual length of the label part.
207 cchBufferSize -= cchLabelSize; // And reset cchBufferSize to what it should be.
208 }
209
210 // TODO: Group this part together with the similar one
211 // from below once the strings are in the same encoding...
212 RtlStringCchPrintfExA(pBuffer, cchBufferSize,
213 &pBuffer, &cchBufferSize, 0,
214 "[%-.*S]",
215 /* The minimum length can be at most 11 since
216 * cchLabelSize can be at most == 11 + 3 == 14 */
217 25 - min(cchLabelSize, 25),
218 VolInfo->FileSystem);
219 }
220 else
221 {
222 CHAR PartTypeString[32];
223 PCSTR PartType = PartTypeString;
224
225 if (PartEntry->New)
226 {
227 /* Use this description if the partition is new (and thus, not formatted) */
229 }
230 else
231 {
232 /* If the partition is not new but its file system is not recognized
233 * (or is not formatted), use the partition type description. */
234 GetPartitionTypeString(PartEntry,
235 PartTypeString,
236 ARRAYSIZE(PartTypeString));
237 PartType = PartTypeString;
238 }
239 if (!PartType || !*PartType)
240 {
242 }
243
244 // TODO: Group this part together with the similar one
245 // from above once the strings are in the same encoding...
246 RtlStringCchPrintfExA(pBuffer, cchBufferSize,
247 &pBuffer, &cchBufferSize, 0,
248 "[%-.*s]",
249 25,
250 PartType);
251 }
252
253 /* Show the remaining free space only if a FS is mounted */
254 // FIXME: We don't support that yet!
255#if 0
256 if (VolInfo && *VolInfo->FileSystem)
257 {
258 RtlStringCchPrintfA(pBuffer, cchBufferSize,
259 "%*s%6I64u %s (%6I64u %s %s)",
260 38 - min(strlen(strBuffer), 38), "", // Indentation
261 PartSize,
262 Unit,
263 PartFreeSize,
264 Unit,
265 "free");
266 }
267 else
268#endif
269 {
270 RtlStringCchPrintfA(pBuffer, cchBufferSize,
271 "%*s%6I64u %s",
272 38 - min(strlen(strBuffer), 38), "", // Indentation
273 PartSize,
274 Unit);
275 }
276}
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
PartType
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
#define GetPartEntrySizeInBytes(PartEntry)
Definition: partlist.h:254
#define min(a, b)
Definition: monoChain.cc:55
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,...)
Definition: ntstrsafe.h:1218
PVOID pBuffer
VOID GetPartitionTypeString(IN PPARTENTRY PartEntry, OUT PSTR strBuffer, IN ULONG cchBuffer)
Definition: partlist.c:35
VOID PrettifySize2(IN OUT PULONGLONG Size, OUT PCSTR *Unit)
Definition: partlist.c:97
WCHAR VolumeLabel[20]
Definition: volutil.h:16
WCHAR FileSystem[MAX_PATH+1]
Definition: volutil.h:17
WCHAR DriveLetter
Definition: volutil.h:15
char * PSTR
Definition: typedefs.h:51
#define STRING_UNPSPACE
Definition: mui.h:178
#define STRING_FORMATUNKNOWN
Definition: mui.h:183
#define STRING_UNFORMATTED
Definition: mui.h:180
#define STRING_EXTENDED_PARTITION
Definition: mui.h:181
#define IsFormatted(VolInfo)
Definition: volutil.h:34

Referenced by ChangeSystemPartitionPage(), CheckFileSystemPage(), DeletePartitionPage(), FormatPartitionPage(), PrintPartitionData(), and SelectFileSystemPage().

◆ ScrollUpDownPartitionList()

VOID ScrollUpDownPartitionList ( _In_ PPARTLIST_UI  ListUi,
_In_ BOOLEAN  Direction 
)
Parameters
[in]DirectionTRUE or FALSE to scroll to the next (down) or previous (up) entry, respectively.

Definition at line 819 of file partlist.c.

822{
823 PPARTENTRY PartEntry =
825 : GetPrevPartition)(ListUi->List, ListUi->CurrentPartition);
826 if (PartEntry)
827 {
828 ListUi->CurrentPartition = PartEntry;
829 ListUi->CurrentDisk = PartEntry->DiskEntry;
830 DrawPartitionList(ListUi);
831 }
832}
PPARTENTRY NTAPI GetPrevPartition(IN PPARTLIST List, IN PPARTENTRY CurrentPart OPTIONAL)
Definition: partlist.c:2387
PPARTENTRY NTAPI GetNextPartition(IN PPARTLIST List, IN PPARTENTRY CurrentPart OPTIONAL)
Definition: partlist.c:2294
VOID DrawPartitionList(IN PPARTLIST_UI ListUi)
Definition: partlist.c:560
struct _DISKENTRY * DiskEntry
Definition: partlist.h:66
WDF_EXTERN_C_START typedef _In_ WDFDEVICE _In_ WDFCONTEXT _In_ WDF_DMA_DIRECTION Direction

Referenced by SelectPartitionPage().