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
12 /* INCLUDES ******************************************************************/
17 #define WIN32_NO_STATUS
26 #define NTOS_MODE_USER
27 #include <ndk/exfuncs.h>
28 #include <ndk/iofuncs.h>
29 #include <ndk/obfuncs.h>
30 #include <ndk/psfuncs.h>
31 #include <ndk/rtlfuncs.h>
32 #include <ndk/umfuncs.h>
35 #define NTOS_MODE_USER
36 #include <ndk/cmfuncs.h>
37 #include <ndk/exfuncs.h>
38 #include <ndk/iofuncs.h>
39 #include <ndk/kefuncs.h>
40 #include <ndk/mmfuncs.h>
41 #include <ndk/obfuncs.h>
42 #include <ndk/psfuncs.h>
43 #include <ndk/rtlfuncs.h>
44 #include <ndk/setypes.h>
45 #include <ndk/umfuncs.h>
49 /* DEFINES *******************************************************************/
51 typedef struct _COMMAND
54 BOOL (*func
)(INT
, WCHAR
**);
59 extern COMMAND cmds
[];
61 /* NOERR codes for the program */
62 //#define ERROR_NONE 0
63 //#define ERROR_FATAL 1
64 //#define ERROR_CMD_ARG 2
65 //#define ERROR_FILE 3
66 //#define ERROR_SERVICE 4
67 //#define ERROR_SYNTAX 5
69 #define MAX_STRING_SIZE 1024
70 #define MAX_ARGS_COUNT 256
73 typedef enum _FORMATSTATE
80 } FORMATSTATE
, *PFORMATSTATE
;
82 typedef struct _PARTENTRY
86 struct _DISKENTRY
*DiskEntry
;
88 ULARGE_INTEGER StartSector
;
89 ULARGE_INTEGER SectorCount
;
91 BOOLEAN BootIndicator
;
94 ULONG PartitionNumber
;
99 CHAR FileSystemName
[9];
101 BOOLEAN LogicalPartition
;
103 /* Partition is partitioned disk space */
104 BOOLEAN IsPartitioned
;
106 /* Partition is new. Table does not exist on disk yet */
109 /* Partition was created automatically. */
112 FORMATSTATE FormatState
;
114 /* Partition must be checked */
117 struct _FILE_SYSTEM_ITEM
*FileSystem
;
118 } PARTENTRY
, *PPARTENTRY
;
121 typedef struct _BIOSDISKENTRY
123 LIST_ENTRY ListEntry
;
128 CM_DISK_GEOMETRY_DEVICE_DATA DiskGeometry
;
129 CM_INT13_DRIVE_PARAMETER Int13DiskData
;
130 } BIOSDISKENTRY
, *PBIOSDISKENTRY
;
133 typedef struct _DISKENTRY
135 LIST_ENTRY ListEntry
;
138 ULONG TracksPerCylinder
;
139 ULONG SectorsPerTrack
;
140 ULONG BytesPerSector
;
142 ULARGE_INTEGER SectorCount
;
143 ULONG SectorAlignment
;
144 ULONG CylinderAlignment
;
147 ULONG BiosDiskNumber
;
156 /* Has the partition list been modified? */
160 BOOLEAN NoMbr
; /* MBR is absent */
162 UNICODE_STRING DriverName
;
164 PDRIVE_LAYOUT_INFORMATION LayoutBuffer
;
166 PPARTENTRY ExtendedPartition
;
168 LIST_ENTRY PrimaryPartListHead
;
169 LIST_ENTRY LogicalPartListHead
;
171 } DISKENTRY
, *PDISKENTRY
;
174 /* GLOBAL VARIABLES ***********************************************************/
176 extern LIST_ENTRY DiskListHead
;
177 extern LIST_ENTRY BiosDiskListHead
;
179 extern PDISKENTRY CurrentDisk
;
180 extern PPARTENTRY CurrentPartition
;
182 /* PROTOTYPES *****************************************************************/
185 BOOL
active_main(INT argc
, LPWSTR
*argv
);
188 BOOL
add_main(INT argc
, LPWSTR
*argv
);
191 BOOL
assign_main(INT argc
, LPWSTR
*argv
);
194 BOOL
attach_main(INT argc
, LPWSTR
*argv
);
197 BOOL
attributes_main(INT argc
, LPWSTR
*argv
);
200 BOOL
automount_main(INT argc
, LPWSTR
*argv
);
203 BOOL
break_main(INT argc
, LPWSTR
*argv
);
206 BOOL
clean_main(INT argc
, LPWSTR
*argv
);
209 BOOL
compact_main(INT argc
, LPWSTR
*argv
);
212 BOOL
convert_main(INT argc
, LPWSTR
*argv
);
215 BOOL
create_main(INT argc
, LPWSTR
*argv
);
218 BOOL
delete_main(INT argc
, LPWSTR
*argv
);
221 BOOL
detach_main(INT argc
, LPWSTR
*argv
);
224 BOOL
detail_main(INT argc
, LPWSTR
*argv
);
229 BOOL
expand_main(INT argc
, LPWSTR
*argv
);
232 BOOL
extend_main(INT argc
, LPWSTR
*argv
);
235 BOOL
filesystems_main(INT argc
, LPWSTR
*argv
);
238 BOOL
format_main(INT argc
, LPWSTR
*argv
);
241 BOOL
gpt_main(INT argc
, LPWSTR
*argv
);
244 BOOL
help_main(INT argc
, LPWSTR
*argv
);
245 VOID
help_cmdlist(VOID
);
248 BOOL
import_main(INT argc
, LPWSTR
*argv
);
251 BOOL
inactive_main(INT argc
, LPWSTR
*argv
);
254 BOOL
InterpretScript(LPWSTR line
);
255 BOOL
InterpretCmd(INT argc
, LPWSTR
*argv
);
256 VOID
InterpretMain(VOID
);
259 BOOL
list_main(INT argc
, LPWSTR
*argv
);
262 BOOL
merge_main(INT argc
, LPWSTR
*argv
);
265 BOOL
offline_main(INT argc
, LPWSTR
*argv
);
268 BOOL
online_main(INT argc
, LPWSTR
*argv
);
272 CreatePartitionList(VOID
);
275 DestroyPartitionList(VOID
);
278 BOOL
recover_main(INT argc
, LPWSTR
*argv
);
281 BOOL
remove_main(INT argc
, LPWSTR
*argv
);
284 BOOL
repair_main(INT argc
, LPWSTR
*argv
);
287 BOOL
rescan_main(INT argc
, LPWSTR
*argv
);
290 BOOL
retain_main(INT argc
, LPWSTR
*argv
);
293 BOOL
san_main(INT argc
, LPWSTR
*argv
);
296 BOOL
select_main(INT argc
, LPWSTR
*argv
);
299 BOOL
setid_main(INT argc
, LPWSTR
*argv
);
302 BOOL
shrink_main(INT argc
, LPWSTR
*argv
);
305 BOOL
uniqueid_main(INT argc
, LPWSTR
*argv
);
307 #endif /* DISKPART_H */