ReactOS  0.4.14-dev-41-g31d7680
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 <winreg.h>
21 #include <wincon.h>
22 
23 #include <conutils.h>
24 
25 /*
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>
33 */
34 
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>
46 
47 #include "resource.h"
48 
49 /* DEFINES *******************************************************************/
50 
51 typedef struct _COMMAND
52 {
54  BOOL (*func)(INT, WCHAR**);
57 } COMMAND, *PCOMMAND;
58 
59 extern COMMAND cmds[];
60 
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
68 
69 #define MAX_STRING_SIZE 1024
70 #define MAX_ARGS_COUNT 256
71 
72 
73 typedef enum _FORMATSTATE
74 {
81 
82 typedef struct _PARTENTRY
83 {
85 
86  struct _DISKENTRY *DiskEntry;
87 
90 
96 
100 
102 
103  /* Partition is partitioned disk space */
105 
106  /* Partition is new. Table does not exist on disk yet */
107  BOOLEAN New;
108 
109  /* Partition was created automatically. */
111 
113 
114  /* Partition must be checked */
116 
119 
120 
121 typedef struct _BIOSDISKENTRY
122 {
126  ULONG Checksum;
131 
132 
133 typedef struct _DISKENTRY
134 {
136 
141 
145 
148 // ULONG Signature;
149 // ULONG Checksum;
150 
152  USHORT Port;
153  USHORT Bus;
154  USHORT Id;
155 
156  /* Has the partition list been modified? */
157  BOOLEAN Dirty;
158 
160  BOOLEAN NoMbr; /* MBR is absent */
161 
163 
165 
167 
170 
172 
173 
174 /* GLOBAL VARIABLES ***********************************************************/
175 
176 extern LIST_ENTRY DiskListHead;
178 
179 extern PDISKENTRY CurrentDisk;
181 
182 /* PROTOTYPES *****************************************************************/
183 
184 /* active.c */
186 
187 /* add.c */
189 
190 /* assign.c */
192 
193 /* attach.c */
195 
196 /* attributes.h */
198 
199 /* automount.c */
201 
202 /* break.c */
204 
205 /* clean.c */
207 
208 /* compact.c */
210 
211 /* convert.c */
213 
214 /* create.c */
216 
217 /* delete.c */
219 
220 /* detach.c */
222 
223 /* detail.c */
225 
226 /* diskpart.c */
227 
228 /* expand.c */
230 
231 /* extend.c */
233 
234 /* filesystem.c */
236 
237 /* format.c */
239 
240 /* gpt.c */
242 
243 /* help.c */
246 
247 /* import. c */
249 
250 /* inactive.c */
252 
253 /* interpreter.c */
257 
258 /* list.c */
260 
261 /* merge.c */
263 
264 /* offline.c */
266 
267 /* online.c */
269 
270 /* partlist.c */
271 NTSTATUS
273 
274 VOID
276 
277 /* recover.c */
279 
280 /* remove.c */
282 
283 /* repair.c */
285 
286 /* rescan.c */
288 
289 /* retain.c */
291 
292 /* san.c */
294 
295 /* select.c */
297 
298 /* setid.c */
300 
301 /* shrink.c */
303 
304 /* uniqueid.c */
306 
307 #endif /* DISKPART_H */
LIST_ENTRY PrimaryPartListHead
Definition: partlist.h:124
GLenum func
Definition: glext.h:6028
PPARTENTRY CurrentPartition
Definition: partlist.c:74
BOOL filesystems_main(INT argc, LPWSTR *argv)
Definition: filesystems.c:11
static int argc
Definition: ServiceArgs.c:12
ULONG PartitionNumber
Definition: partlist.h:48
BOOL active_main(INT argc, LPWSTR *argv)
Definition: active.c:11
ULARGE_INTEGER StartSector
Definition: partlist.h:42
USHORT Id
Definition: partlist.h:108
BOOL setid_main(INT argc, LPWSTR *argv)
Definition: setid.c:11
BOOL shrink_main(INT argc, LPWSTR *argv)
Definition: shrink.c:11
BOOL attach_main(INT argc, LPWSTR *argv)
Definition: attach.c:11
WCHAR VolumeLabel[20]
Definition: partlist.h:52
VOID help_cmdlist(VOID)
Definition: help.c:15
ULONG CylinderAlignment
Definition: partlist.h:92
BOOL assign_main(INT argc, LPWSTR *argv)
Definition: assign.c:11
struct _PARTENTRY * PPARTENTRY
BOOL help_main(INT argc, LPWSTR *argv)
Definition: help.c:33
USHORT Bus
Definition: partlist.h:107
ULARGE_INTEGER SectorCount
Definition: partlist.h:43
ULONG Checksum
Definition: partlist.h:139
char CHAR
Definition: xmlstorage.h:175
struct _FILE_SYSTEM_ITEM * FileSystem
Definition: diskpart.h:117
BOOL format_main(INT argc, LPWSTR *argv)
Definition: format.c:11
ULONG Signature
Definition: partlist.h:138
LONG NTSTATUS
Definition: precomp.h:26
#define INT
Definition: polytest.cpp:20
BOOL recover_main(INT argc, LPWSTR *argv)
Definition: recover.c:11
enum _FORMATSTATE * PFORMATSTATE
ULONG DiskNumber
Definition: partlist.h:104
LIST_ENTRY BiosDiskListHead
Definition: partlist.c:71
PDISKENTRY CurrentDisk
Definition: partlist.c:73
struct _BIOSDISKENTRY * PBIOSDISKENTRY
BOOL rescan_main(INT argc, LPWSTR *argv)
Definition: rescan.c:11
#define argv
Definition: mplay32.c:18
#define BOOL
Definition: nt_native.h:43
int32_t INT
Definition: typedefs.h:56
BOOL detail_main(INT argc, LPWSTR *argv)
Definition: detail.c:11
struct _COMMAND * PCOMMAND
VOID InterpretMain(VOID)
Definition: interpreter.c:145
INT help_desc
Definition: diskpart.h:56
PPARTENTRY ExtendedPartition
Definition: partlist.h:128
BOOL attributes_main(INT argc, LPWSTR *argv)
Definition: attributes.c:11
LIST_ENTRY ListEntry
Definition: partlist.h:36
BOOLEAN LogicalPartition
Definition: partlist.h:56
COMMAND cmds[]
Definition: main.c:21
struct _DISKENTRY * PDISKENTRY
unsigned int BOOL
Definition: ntddk_ex.h:94
FORMATSTATE FormatState
Definition: partlist.h:54
enum _FORMATSTATE FORMATSTATE
BOOL break_main(INT argc, LPWSTR *argv)
Definition: break.c:11
BOOL InterpretScript(LPWSTR line)
Definition: interpreter.c:102
BOOLEAN Dirty
Definition: partlist.h:111
LPWSTR name
Definition: diskpart.h:53
unsigned char BOOLEAN
Definition: parser.c:48
BOOL add_main(INT argc, LPWSTR *argv)
Definition: add.c:11
ULARGE_INTEGER SectorCount
Definition: partlist.h:90
BOOLEAN AutoCreate
Definition: partlist.h:67
ULONG SectorAlignment
Definition: partlist.h:91
LIST_ENTRY DiskListHead
Definition: partlist.c:70
INT help
Definition: diskpart.h:55
BOOL uniqueid_main(INT argc, LPWSTR *argv)
Definition: uniqueid.c:11
UCHAR PartitionType
Definition: partlist.h:46
BOOLEAN BiosFound
Definition: partlist.h:95
struct _DISKENTRY * DiskEntry
Definition: partlist.h:39
ULONG BytesPerSector
Definition: partlist.h:88
struct _PARTENTRY PARTENTRY
__wchar_t WCHAR
Definition: xmlstorage.h:180
UNICODE_STRING DriverName
Definition: partlist.h:116
uint64_t ULONGLONG
Definition: typedefs.h:65
CM_DISK_GEOMETRY_DEVICE_DATA DiskGeometry
Definition: partlist.h:141
CHAR DriveLetter
Definition: diskpart.h:97
BOOL create_main(INT argc, LPWSTR *argv)
Definition: create.c:11
LIST_ENTRY ListEntry
Definition: partlist.h:76
BOOL InterpretCmd(INT argc, LPWSTR *argv)
BOOL select_main(INT argc, LPWSTR *argv)
Definition: select.c:161
unsigned char UCHAR
Definition: xmlstorage.h:181
BOOL delete_main(INT argc, LPWSTR *argv)
Definition: delete.c:11
BOOL inactive_main(INT argc, LPWSTR *argv)
Definition: inactive.c:11
ULONG SectorsPerTrack
Definition: partlist.h:87
BOOL list_main(INT argc, LPWSTR *argv)
Definition: list.c:235
struct _COMMAND COMMAND
ULONG BiosDiskNumber
Definition: diskpart.h:147
Definition: typedefs.h:117
BOOL automount_main(INT argc, LPWSTR *argv)
Definition: automount.c:11
ULONGLONG Cylinders
Definition: partlist.h:85
NTSTATUS CreatePartitionList(VOID)
Definition: partlist.c:2023
struct _DISKENTRY DISKENTRY
BOOLEAN New
Definition: partlist.h:64
BOOL remove_main(INT argc, LPWSTR *argv)
Definition: remove.c:11
BOOLEAN Recognized
Definition: diskpart.h:127
BOOLEAN NeedsCheck
Definition: partlist.h:70
BOOL compact_main(INT argc, LPWSTR *argv)
Definition: compact.c:11
BOOL convert_main(INT argc, LPWSTR *argv)
Definition: convert.c:11
enum _FORMATSTATE FORMATSTATE
LIST_ENTRY ListEntry
Definition: partlist.h:134
BOOL extend_main(INT argc, LPWSTR *argv)
Definition: extend.c:11
unsigned short USHORT
Definition: pedump.c:61
ULONG DiskNumber
Definition: partlist.h:137
BOOL retain_main(INT argc, LPWSTR *argv)
Definition: retain.c:11
BOOL import_main(INT argc, LPWSTR *argv)
Definition: import.c:11
USHORT Port
Definition: partlist.h:106
ULONG TracksPerCylinder
Definition: partlist.h:86
struct _BIOSDISKENTRY BIOSDISKENTRY
BOOL expand_main(INT argc, LPWSTR *argv)
Definition: expand.c:11
BOOL detach_main(INT argc, LPWSTR *argv)
Definition: detach.c:11
LIST_ENTRY LogicalPartListHead
Definition: partlist.h:125
BOOL offline_main(INT argc, LPWSTR *argv)
Definition: offline.c:11
BOOLEAN BootIndicator
Definition: partlist.h:45
BOOL online_main(INT argc, LPWSTR *argv)
Definition: online.c:11
BOOL repair_main(INT argc, LPWSTR *argv)
Definition: repair.c:11
unsigned int ULONG
Definition: retypes.h:1
_FORMATSTATE
Definition: partlist.h:25
BOOL merge_main(INT argc, LPWSTR *argv)
Definition: merge.c:11
CM_INT13_DRIVE_PARAMETER Int13DiskData
Definition: partlist.h:142
BOOL clean_main(INT argc, LPWSTR *argv)
Definition: clean.c:11
WCHAR * LPWSTR
Definition: xmlstorage.h:184
Definition: main.c:14
CHAR FileSystemName[9]
Definition: diskpart.h:99
PDRIVE_LAYOUT_INFORMATION LayoutBuffer
Definition: partlist.h:118
BOOLEAN NewDisk
Definition: partlist.h:113
BOOL gpt_main(INT argc, LPWSTR *argv)
Definition: gpt.c:11
BOOLEAN NoMbr
Definition: diskpart.h:160
BOOL san_main(INT argc, LPWSTR *argv)
Definition: san.c:11
VOID DestroyPartitionList(VOID)
Definition: partlist.c:1120
ULONG HiddenSectors
Definition: diskpart.h:93
BOOLEAN IsPartitioned
Definition: partlist.h:59
ULONG PartitionIndex
Definition: partlist.h:49