ReactOS 0.4.17-dev-1196-gb6224c3
diskpart.h
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS DiskPart
3 * LICENSE: GPL - See COPYING in the top level directory
4 * FILE: base/system/diskpart/diskpart.h
5 * PURPOSE: Manages all the partitions of the OS in an interactive way.
6 * PROGRAMMERS: Lee Schroeder
7 */
8
9#ifndef DISKPART_H
10#define DISKPART_H
11
12/* INCLUDES ******************************************************************/
13
14#include <stdio.h>
15#include <stdlib.h>
16
17#define WIN32_NO_STATUS
18#include <windef.h>
19#include <winbase.h>
20#include <winnls.h>
21#include <winreg.h>
22#include <wincon.h>
23#include <winioctl.h>
24#include <winuser.h>
25#include <ntsecapi.h>
26
27#include <errno.h>
28#include <strsafe.h>
29
30#include <conutils.h>
31
32/*
33#define NTOS_MODE_USER
34#include <ndk/exfuncs.h>
35#include <ndk/iofuncs.h>
36#include <ndk/obfuncs.h>
37#include <ndk/psfuncs.h>
38#include <ndk/rtlfuncs.h>
39#include <ndk/umfuncs.h>
40*/
41
42#define NTOS_MODE_USER
43#include <ndk/cmfuncs.h>
44#include <ndk/exfuncs.h>
45#include <ndk/iofuncs.h>
46#include <ndk/kefuncs.h>
47#include <ndk/mmfuncs.h>
48#include <ndk/obfuncs.h>
49#include <ndk/psfuncs.h>
50#include <ndk/rtlfuncs.h>
51#include <ndk/setypes.h>
52#include <ndk/umfuncs.h>
53
54#include <ntddscsi.h>
55#include <ntddstor.h>
56#include <mountmgr.h>
57
58#include <fmifs/fmifs.h>
59#include <guiddef.h>
60#include <diskguid.h>
61
62#include "resource.h"
63
64//#define DUMP_PARTITION_TABLE
65//#define DUMP_PARTITION_LIST
66
67/* DEFINES *******************************************************************/
68
69/* NOERR codes for the program */
70#undef EXIT_SUCCESS
71#undef EXIT_FAILURE
72
73typedef enum _EXIT_CODE
74{
81 EXIT_EXIT /* Only used by the exit command */
83
84typedef struct _COMMAND
85{
93
94extern COMMAND cmds[];
95
96#define MAX_STRING_SIZE 1024
97#define MAX_ARGS_COUNT 256
98
99
100typedef enum _FORMATSTATE
101{
108
109typedef enum _VOLUME_TYPE
110{
116
117typedef enum _VOLUME_STATUS
118{
125
127{
131
133{
138
139typedef struct _PARTENTRY
140{
142
143 struct _DISKENTRY *DiskEntry;
144
147
148 union
149 {
152 };
153
157
162
164
165 /* Partition is partitioned disk space */
167
168 /* Partition is new. Table does not exist on disk yet */
169 BOOLEAN New;
170
171 /* Partition was created automatically. */
173
174 /* Partition must be checked */
176
178
181
183
184
185typedef struct _BIOSDISKENTRY
186{
195
196
197typedef struct _DISKENTRY
198{
200
204
209
213
216
219// ULONG Signature;
220// ULONG Checksum;
221
223 USHORT Port;
227
228 /* Has the partition list been modified? */
230
233
235
236 PDRIVE_LAYOUT_INFORMATION_EX LayoutBuffer;
237
239
242
244
246
247typedef struct _VOLENTRY
248{
250
255
257
262
267
271
273
275
276#define SIZE_1KB (1024ULL)
277#define SIZE_10KB (10ULL * 1024ULL)
278#define SIZE_1MB (1024ULL * 1024ULL)
279#define SIZE_10MB (10ULL * 1024ULL * 1024ULL)
280#define SIZE_1GB (1024ULL * 1024ULL * 1024ULL)
281#define SIZE_10GB (10ULL * 1024ULL * 1024ULL * 1024ULL)
282#define SIZE_1TB (1024ULL * 1024ULL * 1024ULL * 1024ULL)
283#define SIZE_10TB (10ULL * 1024ULL * 1024ULL * 1024ULL * 1024ULL)
284
285
286/* GLOBAL VARIABLES ***********************************************************/
287
291
295
296/* PROTOTYPES *****************************************************************/
297
298/* active.c */
301 _In_ INT argc,
302 _In_ PWSTR *argv);
303
304/* add.c */
307 _In_ INT argc,
308 _In_ PWSTR *argv);
309
310/* assign.c */
313 _In_ INT argc,
314 _In_ PWSTR *argv);
315
316/* attach.c */
319 _In_ INT argc,
320 _In_ PWSTR *argv);
321
322/* attributes.h */
325 _In_ INT argc,
326 _In_ PWSTR *argv);
327
328/* automount.c */
331 _In_ INT argc,
332 _In_ PWSTR *argv);
333
334/* break.c */
337 _In_ INT argc,
338 _In_ PWSTR *argv);
339
340/* clean.c */
343 _In_ INT argc,
344 _In_ PWSTR *argv);
345
346/* compact.c */
349 _In_ INT argc,
350 _In_ PWSTR *argv);
351
352/* convert.c */
355 _In_ ULONG DiskNumber,
356 _In_ PCREATE_DISK DiskInfo);
357
360 _In_ INT argc,
361 _In_ PWSTR *argv);
362
365 _In_ INT argc,
366 _In_ PWSTR *argv);
367
368/* create.c */
371 _In_ INT argc,
372 _In_ PWSTR *argv);
373
376 _In_ INT argc,
377 _In_ PWSTR *argv);
378
381 _In_ INT argc,
382 _In_ PWSTR *argv);
383
386 _In_ INT argc,
387 _In_ PWSTR *argv);
388
391 _In_ INT argc,
392 _In_ PWSTR *argv);
393
394/* delete.c */
397 _In_ INT argc,
398 _In_ PWSTR *argv);
399
402 _In_ INT argc,
403 _In_ PWSTR *argv);
404
407 _In_ INT argc,
408 _In_ PWSTR *argv);
409
410
411/* detach.c */
414 _In_ INT argc,
415 _In_ PWSTR *argv);
416
417/* detail.c */
420 INT argc,
421 PWSTR *argv);
422
425 INT argc,
426 PWSTR *argv);
427
430 INT argc,
431 PWSTR *argv);
432
433/* diskpart.c */
434
435/* dump.c */
438 _In_ INT argc,
439 _In_ LPWSTR *argv);
440
443 _In_ INT argc,
444 _In_ LPWSTR *argv);
445
446
447/* expand.c */
450 _In_ INT argc,
451 _In_ PWSTR *argv);
452
453/* extend.c */
456 _In_ INT argc,
457 _In_ PWSTR *argv);
458
459/* filesystem.c */
462 _In_ INT argc,
463 _In_ PWSTR *argv);
464
465/* format.c */
468 _In_ INT argc,
469 _In_ PWSTR *argv);
470
471/* gpt.c */
474 _In_ INT argc,
475 _In_ PWSTR *argv);
476
477/* help.c */
480 _In_ INT argc,
481 _In_ PWSTR *argv);
482
483VOID
485
488 _In_ PCOMMAND pCommand);
489
490/* import. c */
493 _In_ INT argc,
494 _In_ PWSTR *argv);
495
496/* inactive.c */
499 _In_ INT argc,
500 _In_ PWSTR *argv);
501
502/* interpreter.c */
506
509 _In_ INT argc,
510 _In_ PWSTR *argv);
511
512VOID
514
515/* list.c */
518 INT argc,
519 PWSTR *argv);
520
523 INT argc,
524 PWSTR *argv);
525
528 INT argc,
529 PWSTR *argv);
530
533 INT argc,
534 PWSTR *argv);
535
536VOID
538 _In_ PDISKENTRY DiskEntry);
539
540VOID
542 _In_ PVOLENTRY VolumeEntry);
543
544/* merge.c */
547 _In_ INT argc,
548 _In_ PWSTR *argv);
549
550/* misc.c */
551BOOL
553 _In_ PWSTR pszDecString);
554
555BOOL
557 _In_ PWSTR pszHexString);
558
559WCHAR
561 _In_ PWSTR pszString);
562
563BOOL
565 _In_ PWSTR pszString,
566 _In_ PWSTR pszPrefix,
567 _Out_opt_ PWSTR *pszSuffix);
568
571 _In_ ULONGLONG Dividend,
573
574PWSTR
576 _In_ PWSTR pszInString);
577
578PWSTR
580 _In_ PWSTR pszInString);
581
582VOID
584 _Out_ GUID *pGuid);
585
586VOID
588 _Out_ PDWORD pSignature);
589
590VOID
592 _Out_ PWSTR pszBuffer,
593 _In_ GUID *pGuid);
594
595BOOL
597 _Out_ GUID *pGuid,
598 _In_ PWSTR pszString);
599
600VOID
602 _Out_ PWSTR pszBuffer,
603 _In_ INT cchBufferMax,
604 _In_ STORAGE_BUS_TYPE Bustype);
605
606/* mountmgr.h */
607BOOL
610
611BOOL
614
615BOOL
617
618BOOL
621 _In_ WCHAR DriveLetter);
622
623BOOL
626 _Out_ PWCHAR DriveLetter);
627
628BOOL
630 _In_ WCHAR DriveLetter);
631
632/* offline.c */
635 _In_ INT argc,
636 _In_ PWSTR *argv);
637
638/* online.c */
641 _In_ INT argc,
642 _In_ PWSTR *argv);
643
644/* partlist.c */
645#ifdef DUMP_PARTITION_TABLE
646VOID
647DumpPartitionTable(
648 _In_ PDISKENTRY DiskEntry);
649#endif
650
651#ifdef DUMP_PARTITION_LIST
652VOID
653DumpPartitionList(
654 _In_ PDISKENTRY DiskEntry);
655#endif
656
661
664
665VOID
667
670
671VOID
673
674VOID
676 _In_ PVOLENTRY VolumeEntry);
677
678VOID
680 PDISKENTRY DiskEntry);
681
682VOID
684 PDISKENTRY DiskEntry);
685
686VOID
689 _In_ PDISKENTRY DiskEntry);
690
693 _In_ PDISKENTRY DiskEntry);
694
697 _In_ PDISKENTRY DiskEntry);
698
699VOID
701 _In_ PDISKENTRY DiskEntry);
702
703VOID
705 _In_ PDISKENTRY DiskEntry,
706 _In_ BOOL DeleteEntry);
707
710 _In_ PPARTENTRY PartEntry);
711
714 _In_ PPARTENTRY PartEntry);
715
716ULONG
718 _In_ PDISKENTRY DiskEntry);
719
722 _In_ PPARTENTRY PartEntry);
723
726 _In_ PPARTENTRY PartEntry);
727
728VOID
730 _In_ PVOLENTRY VolumeEntry);
731
732
733/* recover.c */
736 _In_ INT argc,
737 _In_ PWSTR *argv);
738
739/* remove.c */
742 _In_ INT argc,
743 _In_ PWSTR *argv);
744
745/* repair.c */
748 _In_ INT argc,
749 _In_ PWSTR *argv);
750
751/* rescan.c */
754 _In_ INT argc,
755 _In_ PWSTR *argv);
756
757/* retain.c */
760 _In_ INT argc,
761 _In_ PWSTR *argv);
762
763/* san.c */
766 _In_ INT argc,
767 _In_ PWSTR *argv);
768
769/* select.c */
772 INT argc,
773 PWSTR *argv);
774
777 INT argc,
778 PWSTR *argv);
779
782 INT argc,
783 PWSTR *argv);
784/*
785EXIT_CODE
786SelectVirtualDisk(
787 INT argc,
788 PWSTR *argv);
789*/
790/* setid.c */
793 _In_ INT argc,
794 _In_ PWSTR *argv);
795
796/* shrink.c */
799 _In_ INT argc,
800 _In_ PWSTR *argv);
801
802/* uniqueid.c */
805 _In_ INT argc,
806 _In_ PWSTR *argv);
807
808#endif /* DISKPART_H */
unsigned char BOOLEAN
Definition: actypes.h:127
LONG NTSTATUS
Definition: precomp.h:26
VOID UpdateMbrDiskLayout(_In_ PDISKENTRY DiskEntry)
Definition: partlist.c:2731
VOID RemoveVolume(_In_ PVOLENTRY VolumeEntry)
Definition: partlist.c:3214
LIST_ENTRY VolumeListHead
Definition: partlist.c:73
VOID CreateGUID(_Out_ GUID *pGuid)
Definition: misc.c:170
ULONGLONG AlignDown(_In_ ULONGLONG Value, _In_ ULONG Alignment)
Definition: partlist.c:189
EXIT_CODE DetailPartition(INT argc, PWSTR *argv)
EXIT_CODE DumpDisk(_In_ INT argc, _In_ LPWSTR *argv)
Definition: dump.c:48
_VOLUME_TYPE
Definition: diskpart.h:110
@ VOLUME_TYPE_UNKNOWN
Definition: diskpart.h:114
@ VOLUME_TYPE_REMOVABLE
Definition: diskpart.h:113
@ VOLUME_TYPE_CDROM
Definition: diskpart.h:111
@ VOLUME_TYPE_PARTITION
Definition: diskpart.h:112
BOOL HasPrefix(_In_ PWSTR pszString, _In_ PWSTR pszPrefix, _Out_opt_ PWSTR *pszSuffix)
Definition: misc.c:76
enum _EXIT_CODE EXIT_CODE
BOOL GetAutomountState(_Out_ PBOOL State)
Definition: mountmgr.c:46
BOOL ScrubAutomount(VOID)
Definition: mountmgr.c:141
EXIT_CODE expand_main(_In_ INT argc, _In_ PWSTR *argv)
Definition: expand.c:12
EXIT_CODE recover_main(_In_ INT argc, _In_ PWSTR *argv)
Definition: recover.c:12
EXIT_CODE active_main(_In_ INT argc, _In_ PWSTR *argv)
Definition: active.c:16
LIST_ENTRY BiosDiskListHead
Definition: partlist.c:72
PPARTENTRY GetPrevUnpartitionedEntry(_In_ PPARTENTRY PartEntry)
Definition: partlist.c:2998
struct _VOLENTRY VOLENTRY
VOID PrintGUID(_Out_ PWSTR pszBuffer, _In_ GUID *pGuid)
Definition: misc.c:205
VOID UpdateGptDiskLayout(_In_ PDISKENTRY DiskEntry, _In_ BOOL DeleteEntry)
Definition: partlist.c:2908
EXIT_CODE DumpPartition(_In_ INT argc, _In_ LPWSTR *argv)
Definition: dump.c:146
EXIT_CODE automount_main(_In_ INT argc, _In_ PWSTR *argv)
Definition: automount.c:16
EXIT_CODE DeletePartition(_In_ INT argc, _In_ PWSTR *argv)
Definition: delete.c:274
EXIT_CODE setid_main(_In_ INT argc, _In_ PWSTR *argv)
Definition: setid.c:16
enum _FORMATSTATE FORMATSTATE
EXIT_CODE CreateMsrPartition(_In_ INT argc, _In_ PWSTR *argv)
Definition: create.c:653
EXIT_CODE filesystems_main(_In_ INT argc, _In_ PWSTR *argv)
Definition: filesystems.c:88
EXIT_CODE clean_main(_In_ INT argc, _In_ PWSTR *argv)
Definition: clean.c:16
enum _FORMATSTATE * PFORMATSTATE
EXIT_CODE remove_main(_In_ INT argc, _In_ PWSTR *argv)
Definition: remove.c:15
VOID DestroyVolumeList(VOID)
Definition: partlist.c:2267
EXIT_CODE offline_main(_In_ INT argc, _In_ PWSTR *argv)
Definition: offline.c:12
EXIT_CODE CreatePrimaryPartition(_In_ INT argc, _In_ PWSTR *argv)
Definition: create.c:977
EXIT_CODE repair_main(_In_ INT argc, _In_ PWSTR *argv)
Definition: repair.c:12
struct _MBR_PARTITION_DATA * PMBR_PARTITION_DATA
EXIT_CODE CreateEfiPartition(_In_ INT argc, _In_ PWSTR *argv)
Definition: create.c:102
NTSTATUS DismountVolume(_In_ PPARTENTRY PartEntry)
Definition: partlist.c:3056
WCHAR IsDriveLetter(_In_ PWSTR pszString)
Definition: misc.c:57
EXIT_CODE add_main(_In_ INT argc, _In_ PWSTR *argv)
Definition: add.c:12
EXIT_CODE gpt_main(_In_ INT argc, _In_ PWSTR *argv)
Definition: gpt.c:16
PDISKENTRY CurrentDisk
Definition: partlist.c:75
EXIT_CODE shrink_main(_In_ INT argc, _In_ PWSTR *argv)
Definition: shrink.c:12
struct _COMMAND * PCOMMAND
NTSTATUS CreateVolumeList(VOID)
Definition: partlist.c:2227
BOOL DeleteDriveLetter(_In_ WCHAR DriveLetter)
Definition: mountmgr.c:332
EXIT_CODE attributes_main(_In_ INT argc, _In_ PWSTR *argv)
Definition: attributes.c:12
EXIT_CODE DetailVolume(INT argc, PWSTR *argv)
EXIT_CODE merge_main(_In_ INT argc, _In_ PWSTR *argv)
Definition: merge.c:12
struct _VOLENTRY * PVOLENTRY
EXIT_CODE DeleteVolume(_In_ INT argc, _In_ PWSTR *argv)
Definition: delete.c:347
EXIT_CODE detach_main(_In_ INT argc, _In_ PWSTR *argv)
Definition: detach.c:12
VOID DestroyPartitionList(VOID)
Definition: partlist.c:1611
NTSTATUS WriteMbrPartitions(_In_ PDISKENTRY DiskEntry)
Definition: partlist.c:2403
EXIT_CODE retain_main(_In_ INT argc, _In_ PWSTR *argv)
Definition: retain.c:12
VOID ReadLayoutBuffer(_In_ HANDLE FileHandle, _In_ PDISKENTRY DiskEntry)
Definition: partlist.c:1065
struct _PARTENTRY * PPARTENTRY
struct _BIOSDISKENTRY * PBIOSDISKENTRY
@ UnknownFormat
Definition: diskpart.h:104
@ Preformatted
Definition: diskpart.h:105
@ Formatted
Definition: diskpart.h:106
@ Unformatted
Definition: diskpart.h:102
@ UnformattedOrDamaged
Definition: diskpart.h:103
LIST_ENTRY DiskListHead
Definition: partlist.c:71
EXIT_CODE DetailDisk(INT argc, PWSTR *argv)
enum _VOLUME_STATUS * PVOLUME_STATUS
EXIT_CODE compact_main(_In_ INT argc, _In_ PWSTR *argv)
Definition: compact.c:12
EXIT_CODE CreateExtendedPartition(_In_ INT argc, _In_ PWSTR *argv)
Definition: create.c:232
EXIT_CODE ListVolume(INT argc, PWSTR *argv)
EXIT_CODE import_main(_In_ INT argc, _In_ PWSTR *argv)
Definition: import.c:12
_VOLUME_STATUS
Definition: diskpart.h:118
@ VOLUME_STATUS_HEALTHY
Definition: diskpart.h:119
@ VOLUME_STATUS_NO_MEDIA
Definition: diskpart.h:121
@ VOLUME_STATUS_FAILED
Definition: diskpart.h:120
@ VOLUME_STATUS_REBUILD
Definition: diskpart.h:122
@ VOLUME_STATUS_UNUSABLE
Definition: diskpart.h:123
EXIT_CODE ListVirtualDisk(INT argc, PWSTR *argv)
EXIT_CODE InterpretCmd(_In_ INT argc, _In_ PWSTR *argv)
EXIT_CODE ConvertMBR(_In_ INT argc, _In_ PWSTR *argv)
Definition: convert.c:148
EXIT_CODE inactive_main(_In_ INT argc, _In_ PWSTR *argv)
Definition: inactive.c:16
enum _VOLUME_STATUS VOLUME_STATUS
EXIT_CODE DeleteDisk(_In_ INT argc, _In_ PWSTR *argv)
Definition: delete.c:28
EXIT_CODE format_main(_In_ INT argc, _In_ PWSTR *argv)
Definition: format.c:95
NTSTATUS CreateDisk(_In_ ULONG DiskNumber, _In_ PCREATE_DISK DiskInfo)
Definition: convert.c:15
struct _COMMAND COMMAND
EXIT_CODE attach_main(_In_ INT argc, _In_ PWSTR *argv)
Definition: attach.c:12
EXIT_CODE ListPartition(INT argc, PWSTR *argv)
EXIT_CODE ListDisk(INT argc, PWSTR *argv)
EXIT_CODE extend_main(_In_ INT argc, _In_ PWSTR *argv)
Definition: extend.c:12
NTSTATUS CreatePartitionList(VOID)
Definition: partlist.c:2043
struct _DISKENTRY DISKENTRY
VOID ScanForUnpartitionedMbrDiskSpace(PDISKENTRY DiskEntry)
Definition: partlist.c:660
enum _VOLUME_TYPE VOLUME_TYPE
EXIT_CODE break_main(_In_ INT argc, _In_ PWSTR *argv)
Definition: break.c:12
EXIT_CODE online_main(_In_ INT argc, _In_ PWSTR *argv)
Definition: online.c:12
EXIT_CODE san_main(_In_ INT argc, _In_ PWSTR *argv)
Definition: san.c:12
PVOLENTRY CurrentVolume
Definition: partlist.c:77
EXIT_CODE rescan_main(_In_ INT argc, _In_ PWSTR *argv)
Definition: rescan.c:12
struct _GPT_PARTITION_DATA * PGPT_PARTITION_DATA
EXIT_CODE assign_main(_In_ INT argc, _In_ PWSTR *argv)
Definition: assign.c:15
BOOL IsDecString(_In_ PWSTR pszDecString)
Definition: misc.c:14
PPARTENTRY CurrentPartition
Definition: partlist.c:76
NTSTATUS WriteGptPartitions(_In_ PDISKENTRY DiskEntry)
Definition: partlist.c:2527
PVOLENTRY GetVolumeFromPartition(_In_ PPARTENTRY PartEntry)
Definition: partlist.c:3177
BOOL SetAutomountState(_In_ BOOL bEnable)
Definition: mountmgr.c:90
EXIT_CODE SelectPartition(INT argc, PWSTR *argv)
VOID InterpretMain(VOID)
Definition: interpreter.c:232
BOOL IsHexString(_In_ PWSTR pszHexString)
Definition: misc.c:36
VOID PrintDisk(_In_ PDISKENTRY DiskEntry)
Definition: list.c:129
EXIT_CODE InterpretScript(_In_ LPWSTR line)
Definition: interpreter.c:183
_EXIT_CODE
Definition: diskpart.h:74
@ EXIT_SERVICE
Definition: diskpart.h:79
@ EXIT_FATAL
Definition: diskpart.h:76
@ EXIT_EXIT
Definition: diskpart.h:81
@ EXIT_FILE
Definition: diskpart.h:78
@ EXIT_CMD_ARG
Definition: diskpart.h:77
@ EXIT_SUCCESS
Definition: diskpart.h:75
@ EXIT_SYNTAX
Definition: diskpart.h:80
COMMAND cmds[]
Definition: main.c:21
EXIT_CODE CreateLogicalPartition(_In_ INT argc, _In_ PWSTR *argv)
Definition: create.c:445
EXIT_CODE HelpCommand(_In_ PCOMMAND pCommand)
VOID HelpCommandList(VOID)
Definition: help.c:16
enum _VOLUME_TYPE * PVOLUME_TYPE
struct _MBR_PARTITION_DATA MBR_PARTITION_DATA
struct _GPT_PARTITION_DATA GPT_PARTITION_DATA
PPARTENTRY GetNextUnpartitionedEntry(_In_ PPARTENTRY PartEntry)
Definition: partlist.c:3027
BOOL AssignNextDriveLetter(_In_ PWSTR DeviceName, _Out_ PWCHAR DriveLetter)
Definition: mountmgr.c:258
EXIT_CODE help_main(_In_ INT argc, _In_ PWSTR *argv)
Definition: help.c:121
EXIT_CODE ConvertGPT(_In_ INT argc, _In_ PWSTR *argv)
Definition: convert.c:88
BOOL AssignDriveLetter(_In_ PWSTR DeviceName, _In_ WCHAR DriveLetter)
Definition: mountmgr.c:181
VOID UpdateVolumeInfo(_In_ PVOLENTRY VolumeEntry)
Definition: partlist.c:2296
VOID ScanForUnpartitionedGptDiskSpace(PDISKENTRY DiskEntry)
Definition: partlist.c:921
ULONGLONG RoundingDivide(_In_ ULONGLONG Dividend, _In_ ULONGLONG Divisor)
Definition: misc.c:93
EXIT_CODE SelectVolume(INT argc, PWSTR *argv)
EXIT_CODE UniqueIdDisk(_In_ INT argc, _In_ PWSTR *argv)
Definition: uniqueid.c:17
EXIT_CODE SelectDisk(INT argc, PWSTR *argv)
PWSTR DuplicateQuotedString(_In_ PWSTR pszInString)
Definition: misc.c:102
VOID PrintBusType(_Out_ PWSTR pszBuffer, _In_ INT cchBufferMax, _In_ STORAGE_BUS_TYPE Bustype)
Definition: misc.c:313
struct _BIOSDISKENTRY BIOSDISKENTRY
VOID PrintVolume(_In_ PVOLENTRY VolumeEntry)
Definition: list.c:365
struct _DISKENTRY * PDISKENTRY
struct _PARTENTRY PARTENTRY
VOID CreateSignature(_Out_ PDWORD pSignature)
Definition: misc.c:186
BOOL StringToGUID(_Out_ GUID *pGuid, _In_ PWSTR pszString)
Definition: misc.c:245
#define MAX_PATH
Definition: compat.h:34
MonoAssembly int argc
Definition: metahost.c:107
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
_Must_inspect_result_ _In_opt_ PFLT_INSTANCE _Out_ PHANDLE FileHandle
Definition: fltkernel.h:1231
GLenum func
Definition: glext.h:6028
_FORMATSTATE
Definition: partlist.h:33
BOOL * PBOOL
Definition: minwindef.h:137
#define argv
Definition: mplay32.c:18
#define _Out_opt_
Definition: no_sal2.h:214
#define _Out_
Definition: no_sal2.h:160
#define _In_
Definition: no_sal2.h:158
short WCHAR
Definition: pedump.c:58
DWORD * PDWORD
Definition: pedump.c:68
unsigned short USHORT
Definition: pedump.c:61
char CHAR
Definition: pedump.c:57
#define INT
Definition: polytest.cpp:20
enum _STORAGE_BUS_TYPE STORAGE_BUS_TYPE
#define GetPrimaryPartitionCount(DiskEntry)
Definition: partlist.c:2592
#define DuplicateString(x)
Definition: stringutils.h:45
BOOLEAN Recognized
Definition: diskpart.h:191
LIST_ENTRY ListEntry
Definition: partlist.h:159
ULONG DiskNumber
Definition: partlist.h:162
ULONG Checksum
Definition: partlist.h:164
ULONG Signature
Definition: partlist.h:163
CM_DISK_GEOMETRY_DEVICE_DATA DiskGeometry
Definition: partlist.h:166
CM_INT13_DRIVE_PARAMETER Int13DiskData
Definition: partlist.h:167
Definition: main.c:15
INT help
Definition: diskpart.h:90
PWSTR cmd3
Definition: diskpart.h:88
DWORD help_detail
Definition: diskpart.h:91
PWSTR cmd2
Definition: diskpart.h:87
PWSTR cmd1
Definition: diskpart.h:86
ULARGE_INTEGER EndSector
Definition: diskpart.h:215
ULONG SectorAlignment
Definition: partlist.h:116
ULONG BiosDiskNumber
Definition: diskpart.h:218
PDRIVE_LAYOUT_INFORMATION_EX LayoutBuffer
Definition: diskpart.h:236
BOOL IsBoot
Definition: diskpart.h:243
ULARGE_INTEGER SectorCount
Definition: partlist.h:115
UNICODE_STRING DriverName
Definition: partlist.h:141
STORAGE_BUS_TYPE BusType
Definition: diskpart.h:203
ULONG SectorsPerTrack
Definition: partlist.h:112
USHORT TargetId
Definition: diskpart.h:225
PPARTENTRY ExtendedPartition
Definition: partlist.h:153
LIST_ENTRY LogicalPartListHead
Definition: partlist.h:150
BOOLEAN NewDisk
Definition: partlist.h:138
ULONG DiskNumber
Definition: partlist.h:129
ULONG BytesPerSector
Definition: partlist.h:113
USHORT PathId
Definition: diskpart.h:224
BOOLEAN BiosFound
Definition: partlist.h:120
PWSTR Location
Definition: diskpart.h:202
ULONGLONG Cylinders
Definition: partlist.h:110
USHORT Lun
Definition: diskpart.h:226
LIST_ENTRY ListEntry
Definition: partlist.h:101
BOOLEAN Dirty
Definition: partlist.h:136
ULARGE_INTEGER StartSector
Definition: diskpart.h:214
USHORT Port
Definition: partlist.h:131
DWORD PartitionStyle
Definition: diskpart.h:232
ULONG TracksPerCylinder
Definition: partlist.h:111
LIST_ENTRY PrimaryPartListHead
Definition: partlist.h:149
PWSTR Description
Definition: diskpart.h:201
ULONG CylinderAlignment
Definition: partlist.h:117
DWORD64 Attributes
Definition: diskpart.h:136
Definition: typedefs.h:120
BOOLEAN BootIndicator
Definition: diskpart.h:128
BOOLEAN IsPartitioned
Definition: partlist.h:82
BOOLEAN AutoCreate
Definition: diskpart.h:172
BOOLEAN New
Definition: partlist.h:85
BOOL IsBoot
Definition: diskpart.h:180
ULARGE_INTEGER SectorCount
Definition: partlist.h:70
CHAR VolumeLabel[17]
Definition: diskpart.h:159
struct _DISKENTRY * DiskEntry
Definition: partlist.h:66
BOOLEAN LogicalPartition
Definition: partlist.h:79
CHAR DriveLetter
Definition: diskpart.h:158
MBR_PARTITION_DATA Mbr
Definition: diskpart.h:150
FORMATSTATE FormatState
Definition: diskpart.h:161
GPT_PARTITION_DATA Gpt
Definition: diskpart.h:151
struct _FILE_SYSTEM_ITEM * FileSystem
Definition: diskpart.h:177
BOOL IsSystem
Definition: diskpart.h:179
ULONG OnDiskPartitionNumber
Definition: partlist.h:74
BOOLEAN NeedsCheck
Definition: diskpart.h:175
LIST_ENTRY ListEntry
Definition: partlist.h:63
ULONG PartitionNumber
Definition: partlist.h:75
ULARGE_INTEGER StartSector
Definition: partlist.h:69
ULONG PartitionIndex
Definition: partlist.h:76
CHAR FileSystemName[9]
Definition: diskpart.h:160
BOOL IsBoot
Definition: diskpart.h:269
ULARGE_INTEGER Size
Definition: diskpart.h:261
VOLUME_TYPE VolumeType
Definition: diskpart.h:260
PVOLUME_DISK_EXTENTS pExtents
Definition: diskpart.h:272
ULARGE_INTEGER TotalAllocationUnits
Definition: diskpart.h:263
ULONG VolumeNumber
Definition: diskpart.h:251
ULONG SectorsPerAllocationUnit
Definition: diskpart.h:265
ULARGE_INTEGER AvailableAllocationUnits
Definition: diskpart.h:264
BOOL IsSystem
Definition: diskpart.h:268
PWSTR pszFilesystem
Definition: diskpart.h:259
ULONG BytesPerSector
Definition: diskpart.h:266
VOLUME_STATUS VolumeStatus
Definition: diskpart.h:270
DWORD SerialNumber
Definition: diskpart.h:254
WCHAR VolumeName[MAX_PATH]
Definition: diskpart.h:252
LIST_ENTRY ListEntry
Entry in VolumesList or PendingUnmountVolumesList.
Definition: partlist.h:45
PWSTR pszLabel
Definition: diskpart.h:258
WCHAR DriveLetter
Definition: diskpart.h:256
Definition: parser.c:49
uint16_t * PWSTR
Definition: typedefs.h:56
unsigned char UCHAR
Definition: typedefs.h:53
uint16_t * LPWSTR
Definition: typedefs.h:56
uint64_t DWORD64
Definition: typedefs.h:67
int32_t INT
Definition: typedefs.h:58
uint64_t ULONGLONG
Definition: typedefs.h:67
uint16_t * PWCHAR
Definition: typedefs.h:56
uint32_t ULONG
Definition: typedefs.h:59
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_opt_ PCUNICODE_STRING DeviceName
Definition: wdfdevice.h:3281
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
Definition: wdfregistry.h:413
_In_ BOOL bEnable
Definition: winddi.h:3426
_In_ LARGE_INTEGER Divisor
Definition: rtlfuncs.h:3068