[FMIFS]
[reactos.git] / reactos / include / reactos / libs / fmifs / fmifs.h
1 #ifndef _FMIFS_H
2 #define _FMIFS_H
3 /*
4 * fmifs.h
5 *
6 * Copyright (c) 1998 Mark Russinovich
7 * Systems Internals
8 * http://www.sysinternals.com
9 *
10 * Typedefs and definitions for using chkdsk and formatex
11 * functions exported by the fmifs.dll library.
12 *
13 * ---
14 *
15 * 1999-02-18 (Emanuele Aliberti)
16 * Normalized function names.
17 *
18 * ---
19 *
20 * 2006-09-04 (Hervé Poussineau)
21 * Add some prototypes
22 *
23 */
24
25 #ifdef __cplusplus
26 extern "C" {
27 #endif // __cplusplus
28
29 /* Output command */
30 typedef struct
31 {
32 ULONG Lines;
33 PCHAR Output;
34 } TEXTOUTPUT, *PTEXTOUTPUT;
35
36 /* media flags */
37 typedef enum
38 {
39 FMIFS_UNKNOWN0,
40 FMIFS_UNKNOWN1,
41 FMIFS_UNKNOWN2,
42 FMIFS_UNKNOWN3,
43 FMIFS_UNKNOWN4,
44 FMIFS_UNKNOWN5,
45 FMIFS_UNKNOWN6,
46 FMIFS_UNKNOWN7,
47 FMIFS_FLOPPY,
48 FMIFS_UNKNOWN9,
49 FMIFS_UNKNOWN10,
50 FMIFS_REMOVABLE,
51 FMIFS_HARDDISK,
52 FMIFS_UNKNOWN13,
53 FMIFS_UNKNOWN14,
54 FMIFS_UNKNOWN15,
55 FMIFS_UNKNOWN16,
56 FMIFS_UNKNOWN17,
57 FMIFS_UNKNOWN18,
58 FMIFS_UNKNOWN19,
59 FMIFS_UNKNOWN20,
60 FMIFS_UNKNOWN21,
61 FMIFS_UNKNOWN22,
62 FMIFS_UNKNOWN23,
63 } FMIFS_MEDIA_FLAG;
64
65 /* Callback command types */
66 typedef enum
67 {
68 PROGRESS,
69 DONEWITHSTRUCTURE,
70 UNKNOWN2,
71 UNKNOWN3,
72 UNKNOWN4,
73 UNKNOWN5,
74 INSUFFICIENTRIGHTS,
75 FSNOTSUPPORTED,
76 VOLUMEINUSE,
77 UNKNOWN9,
78 UNKNOWNA,
79 DONE,
80 UNKNOWNC,
81 UNKNOWND,
82 OUTPUT,
83 STRUCTUREPROGRESS,
84 CLUSTERSIZETOOSMALL,
85 } CALLBACKCOMMAND;
86
87 /* FMIFS callback definition */
88 typedef BOOLEAN
89 (NTAPI* PFMIFSCALLBACK)(
90 IN CALLBACKCOMMAND Command,
91 IN ULONG SubAction,
92 IN PVOID ActionInfo);
93
94 /* Chkdsk command in FMIFS */
95 VOID NTAPI
96 Chkdsk(
97 IN PWCHAR DriveRoot,
98 IN PWCHAR Format,
99 IN BOOLEAN CorrectErrors,
100 IN BOOLEAN Verbose,
101 IN BOOLEAN CheckOnlyIfDirty,
102 IN BOOLEAN ScanDrive,
103 IN PVOID Unused2,
104 IN PVOID Unused3,
105 IN PFMIFSCALLBACK Callback);
106
107 /* ChkdskEx command in FMIFS (not in the original) */
108 VOID NTAPI
109 ChkdskEx(
110 IN PWCHAR DriveRoot,
111 IN PWCHAR Format,
112 IN BOOLEAN CorrectErrors,
113 IN BOOLEAN Verbose,
114 IN BOOLEAN CheckOnlyIfDirty,
115 IN BOOLEAN ScanDrive,
116 IN PVOID Unused2,
117 IN PVOID Unused3,
118 IN PFMIFSCALLBACK Callback);
119
120 FMIFS_MEDIA_FLAG NTAPI
121 ComputeFmMediaType(
122 IN ULONG MediaType);
123
124 /* DiskCopy command in FMIFS */
125 VOID NTAPI
126 DiskCopy(VOID);
127
128 /* Enable/Disable volume compression */
129 BOOLEAN NTAPI
130 EnableVolumeCompression(
131 IN PWCHAR DriveRoot,
132 IN USHORT Compression);
133
134 /* Format command in FMIFS */
135 VOID NTAPI
136 Format(
137 IN PWCHAR DriveRoot,
138 IN FMIFS_MEDIA_FLAG MediaFlag,
139 IN PWCHAR Format,
140 IN PWCHAR Label,
141 IN BOOLEAN QuickFormat,
142 IN PFMIFSCALLBACK Callback);
143
144 /* FormatEx command in FMIFS */
145 VOID NTAPI
146 FormatEx(
147 IN PWCHAR DriveRoot,
148 IN FMIFS_MEDIA_FLAG MediaFlag,
149 IN PWCHAR Format,
150 IN PWCHAR Label,
151 IN BOOLEAN QuickFormat,
152 IN ULONG ClusterSize,
153 IN PFMIFSCALLBACK Callback);
154
155 BOOLEAN NTAPI
156 QueryAvailableFileSystemFormat(
157 IN DWORD Index,
158 IN OUT PWCHAR FileSystem, /* FIXME: Probably one minimal size is mandatory, but which one? */
159 OUT UCHAR* Major,
160 OUT UCHAR* Minor,
161 OUT BOOLEAN* LatestVersion);
162
163 BOOL NTAPI
164 QueryDeviceInformation(
165 IN PWCHAR DriveRoot,
166 OUT ULONG* Buffer, /* That is probably some 4-bytes structure */
167 IN ULONG BufferSize); /* 4 */
168
169 BOOL NTAPI
170 QueryFileSystemName(
171 IN PWCHAR DriveRoot,
172 OUT PWCHAR FileSystem OPTIONAL, /* FIXME: Probably one minimal size is mandatory, but which one? */
173 OUT UCHAR* Unknown2 OPTIONAL, /* Always 0? */
174 OUT UCHAR* Unknown3 OPTIONAL, /* Always 0? */
175 OUT ULONG* Unknown4 OPTIONAL); /* Always 0? */
176
177 BOOLEAN NTAPI
178 QueryLatestFileSystemVersion(
179 IN PWCHAR FileSystem,
180 OUT UCHAR* Major OPTIONAL,
181 OUT UCHAR* Minor OPTIONAL);
182
183 BOOL NTAPI
184 QuerySupportedMedia(
185 IN PWCHAR DriveRoot,
186 OUT FMIFS_MEDIA_FLAG *CurrentMedia OPTIONAL,
187 IN ULONG Unknown3,
188 OUT PULONG Unknown4); /* Always 1? */
189
190 BOOL NTAPI
191 SetLabel(
192 IN PWCHAR DriveRoot,
193 IN PWCHAR Label);
194
195 /* Functions provided by u*.dll */
196
197 typedef NTSTATUS
198 (NTAPI *FORMATEX)(
199 IN PUNICODE_STRING DriveRoot,
200 IN FMIFS_MEDIA_FLAG MediaFlag,
201 IN PUNICODE_STRING Label,
202 IN BOOLEAN QuickFormat,
203 IN ULONG ClusterSize,
204 IN PFMIFSCALLBACK Callback);
205
206 typedef NTSTATUS
207 (NTAPI *CHKDSKEX)(
208 IN PUNICODE_STRING DriveRoot,
209 IN BOOLEAN FixErrors,
210 IN BOOLEAN Verbose,
211 IN BOOLEAN CheckOnlyIfDirty,
212 IN BOOLEAN ScanDrive,
213 IN PFMIFSCALLBACK Callback);
214
215 #ifdef __cplusplus
216 }
217 #endif // __cplusplus
218
219 #endif /* ndef _FMIFS_H */