cdf87f504af5bf0fe0d45f018563d02a138065ea
[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 FormatEx(
137 IN PWCHAR DriveRoot,
138 IN FMIFS_MEDIA_FLAG MediaFlag,
139 IN PWCHAR Format,
140 IN PWCHAR Label,
141 IN BOOLEAN QuickFormat,
142 IN ULONG ClusterSize,
143 IN PFMIFSCALLBACK Callback);
144
145 BOOLEAN NTAPI
146 QueryAvailableFileSystemFormat(
147 IN DWORD Index,
148 IN OUT PWCHAR FileSystem, /* FIXME: Probably one minimal size is mandatory, but which one? */
149 OUT UCHAR* Major,
150 OUT UCHAR* Minor,
151 OUT BOOLEAN* LatestVersion);
152
153 BOOL NTAPI
154 QueryDeviceInformation(
155 IN PWCHAR DriveRoot,
156 OUT ULONG* Buffer, /* That is probably some 4-bytes structure */
157 IN ULONG BufferSize); /* 4 */
158
159 BOOL NTAPI
160 QueryFileSystemName(
161 IN PWCHAR DriveRoot,
162 OUT PWCHAR FileSystem OPTIONAL, /* FIXME: Probably one minimal size is mandatory, but which one? */
163 OUT UCHAR* Unknown2 OPTIONAL, /* Always 0? */
164 OUT UCHAR* Unknown3 OPTIONAL, /* Always 0? */
165 OUT ULONG* Unknown4 OPTIONAL); /* Always 0? */
166
167 BOOLEAN NTAPI
168 QueryLatestFileSystemVersion(
169 IN PWCHAR FileSystem,
170 OUT UCHAR* Major OPTIONAL,
171 OUT UCHAR* Minor OPTIONAL);
172
173 BOOL NTAPI
174 QuerySupportedMedia(
175 IN PWCHAR DriveRoot,
176 OUT FMIFS_MEDIA_FLAG *CurrentMedia OPTIONAL,
177 IN ULONG Unknown3,
178 OUT PULONG Unknown4); /* Always 1? */
179
180 BOOL NTAPI
181 SetLabel(
182 IN PWCHAR DriveRoot,
183 IN PWCHAR Label);
184
185 /* Functions provided by u*.dll */
186
187 typedef NTSTATUS
188 (NTAPI *FORMATEX)(
189 IN PUNICODE_STRING DriveRoot,
190 IN FMIFS_MEDIA_FLAG MediaFlag,
191 IN PUNICODE_STRING Label,
192 IN BOOLEAN QuickFormat,
193 IN ULONG ClusterSize,
194 IN PFMIFSCALLBACK Callback);
195
196 typedef NTSTATUS
197 (NTAPI *CHKDSKEX)(
198 IN PUNICODE_STRING DriveRoot,
199 IN BOOLEAN FixErrors,
200 IN BOOLEAN Verbose,
201 IN BOOLEAN CheckOnlyIfDirty,
202 IN BOOLEAN ScanDrive,
203 IN PFMIFSCALLBACK Callback);
204
205 #ifdef __cplusplus
206 }
207 #endif // __cplusplus
208
209 #endif /* ndef _FMIFS_H */