1 | /**
|
---|
2 | * This file has no copyright assigned and is placed in the Public Domain.
|
---|
3 | * This file is part of the mingw-w64 runtime package.
|
---|
4 | * No warranty is given; refer to the file DISCLAIMER.PD within this package.
|
---|
5 | */
|
---|
6 | #ifndef _INC_VIRTDISK
|
---|
7 | #define _INC_VIRTDISK
|
---|
8 |
|
---|
9 | #if (_WIN32_WINNT >= 0x0601)
|
---|
10 | #ifdef __cplusplus
|
---|
11 | extern "C" {
|
---|
12 | #endif
|
---|
13 |
|
---|
14 | #define VIRTDISKAPI DECLSPEC_IMPORT
|
---|
15 |
|
---|
16 | #define VIRTUAL_STORAGE_TYPE_DEVICE_UNKNOWN 0
|
---|
17 | #define VIRTUAL_STORAGE_TYPE_DEVICE_ISO 1
|
---|
18 | #define VIRTUAL_STORAGE_TYPE_DEVICE_VHD 2
|
---|
19 | #if (_WIN32_WINNT >= 0x0A00)
|
---|
20 | #define VIRTUAL_STORAGE_TYPE_DEVICE_VHDX 3
|
---|
21 | #endif /* _WIN32_WINNT >= 0x0A00 */
|
---|
22 |
|
---|
23 | typedef enum _ATTACH_VIRTUAL_DISK_FLAG {
|
---|
24 | ATTACH_VIRTUAL_DISK_FLAG_NONE = 0x00000000,
|
---|
25 | ATTACH_VIRTUAL_DISK_FLAG_READ_ONLY = 0x00000001,
|
---|
26 | ATTACH_VIRTUAL_DISK_FLAG_NO_DRIVE_LETTER = 0x00000002,
|
---|
27 | ATTACH_VIRTUAL_DISK_FLAG_PERMANENT_LIFETIME = 0x00000004,
|
---|
28 | ATTACH_VIRTUAL_DISK_FLAG_NO_LOCAL_HOST = 0x00000008
|
---|
29 | } ATTACH_VIRTUAL_DISK_FLAG;
|
---|
30 |
|
---|
31 | typedef enum _ATTACH_VIRTUAL_DISK_VERSION {
|
---|
32 | ATTACH_VIRTUAL_DISK_VERSION_UNSPECIFIED = 0,
|
---|
33 | ATTACH_VIRTUAL_DISK_VERSION_1 = 1
|
---|
34 | } ATTACH_VIRTUAL_DISK_VERSION;
|
---|
35 |
|
---|
36 | typedef enum _COMPACT_VIRTUAL_DISK_FLAG {
|
---|
37 | COMPACT_VIRTUAL_DISK_FLAG_NONE = 0x00000000
|
---|
38 | } COMPACT_VIRTUAL_DISK_FLAG;
|
---|
39 |
|
---|
40 | typedef enum _COMPACT_VIRTUAL_DISK_VERSION {
|
---|
41 | COMPACT_VIRTUAL_DISK_VERSION_UNSPECIFIED = 0,
|
---|
42 | COMPACT_VIRTUAL_DISK_VERSION_1 = 1
|
---|
43 | } COMPACT_VIRTUAL_DISK_VERSION;
|
---|
44 |
|
---|
45 | typedef enum _CREATE_VIRTUAL_DISK_FLAG {
|
---|
46 | CREATE_VIRTUAL_DISK_FLAG_NONE = 0x00000000,
|
---|
47 | CREATE_VIRTUAL_DISK_FLAG_FULL_PHYSICAL_ALLOCATION = 0x00000001
|
---|
48 | #if (_WIN32_WINNT >= 0x0602)
|
---|
49 | ,
|
---|
50 | CREATE_VIRTUAL_DISK_FLAG_PREVENT_WRITES_TO_SOURCE_DISK = 0x2,
|
---|
51 | CREATE_VIRTUAL_DISK_FLAG_DO_NOT_COPY_METADATA_FROM_PARENT = 0x4
|
---|
52 | #endif /* _WIN32_WINNT >= 0x0602 */
|
---|
53 | } CREATE_VIRTUAL_DISK_FLAG;
|
---|
54 |
|
---|
55 | typedef enum _CREATE_VIRTUAL_DISK_VERSION {
|
---|
56 | CREATE_VIRTUAL_DISK_VERSION_UNSPECIFIED = 0,
|
---|
57 | CREATE_VIRTUAL_DISK_VERSION_1 = 1
|
---|
58 | #if (_WIN32_WINNT >= 0x0602)
|
---|
59 | ,
|
---|
60 | CREATE_VIRTUAL_DISK_VERSION_2 = 2
|
---|
61 | #endif /* _WIN32_WINNT >= 0x0602 */
|
---|
62 | } CREATE_VIRTUAL_DISK_VERSION;
|
---|
63 |
|
---|
64 | typedef enum _DEPENDENT_DISK_FLAG {
|
---|
65 | DEPENDENT_DISK_FLAG_NONE = 0x00000000,
|
---|
66 | DEPENDENT_DISK_FLAG_MULT_BACKING_FILES = 0x00000001,
|
---|
67 | DEPENDENT_DISK_FLAG_FULLY_ALLOCATED = 0x00000002,
|
---|
68 | DEPENDENT_DISK_FLAG_READ_ONLY = 0x00000004,
|
---|
69 | DEPENDENT_DISK_FLAG_REMOTE = 0x00000008,
|
---|
70 | DEPENDENT_DISK_FLAG_SYSTEM_VOLUME = 0x00000010,
|
---|
71 | DEPENDENT_DISK_FLAG_SYSTEM_VOLUME_PARENT = 0x00000020,
|
---|
72 | DEPENDENT_DISK_FLAG_REMOVABLE = 0x00000040,
|
---|
73 | DEPENDENT_DISK_FLAG_NO_DRIVE_LETTER = 0x00000080,
|
---|
74 | DEPENDENT_DISK_FLAG_PARENT = 0x00000100,
|
---|
75 | DEPENDENT_DISK_FLAG_NO_HOST_DISK = 0x00000200,
|
---|
76 | DEPENDENT_DISK_FLAG_PERMANENT_LIFETIME = 0x00000400
|
---|
77 | } DEPENDENT_DISK_FLAG;
|
---|
78 |
|
---|
79 | typedef enum _EXPAND_VIRTUAL_DISK_VERSION {
|
---|
80 | EXPAND_VIRTUAL_DISK_VERSION_UNSPECIFIED = 0,
|
---|
81 | EXPAND_VIRTUAL_DISK_VERSION_1 = 1
|
---|
82 | } EXPAND_VIRTUAL_DISK_VERSION;
|
---|
83 |
|
---|
84 | typedef enum _DETACH_VIRTUAL_DISK_FLAG {
|
---|
85 | DETACH_VIRTUAL_DISK_FLAG_NONE = 0x00000000
|
---|
86 | } DETACH_VIRTUAL_DISK_FLAG;
|
---|
87 |
|
---|
88 | typedef enum _EXPAND_VIRTUAL_DISK_FLAG {
|
---|
89 | EXPAND_VIRTUAL_DISK_FLAG_NONE = 0x00000000
|
---|
90 | } EXPAND_VIRTUAL_DISK_FLAG;
|
---|
91 |
|
---|
92 | typedef enum _GET_STORAGE_DEPENDENCY_FLAG {
|
---|
93 | GET_STORAGE_DEPENDENCY_FLAG_NONE = 0x00000000,
|
---|
94 | GET_STORAGE_DEPENDENCY_FLAG_HOST_VOLUMES = 0x00000001,
|
---|
95 | GET_STORAGE_DEPENDENCY_FLAG_DISK_HANDLE = 0x00000002
|
---|
96 | } GET_STORAGE_DEPENDENCY_FLAG;
|
---|
97 |
|
---|
98 | typedef enum _GET_VIRTUAL_DISK_INFO_VERSION {
|
---|
99 | GET_VIRTUAL_DISK_INFO_UNSPECIFIED = 0,
|
---|
100 | GET_VIRTUAL_DISK_INFO_SIZE = 1,
|
---|
101 | GET_VIRTUAL_DISK_INFO_IDENTIFIER = 2,
|
---|
102 | GET_VIRTUAL_DISK_INFO_PARENT_LOCATION = 3,
|
---|
103 | GET_VIRTUAL_DISK_INFO_PARENT_IDENTIFIER = 4,
|
---|
104 | GET_VIRTUAL_DISK_INFO_PARENT_TIMESTAMP = 5,
|
---|
105 | GET_VIRTUAL_DISK_INFO_VIRTUAL_STORAGE_TYPE = 6,
|
---|
106 | GET_VIRTUAL_DISK_INFO_PROVIDER_SUBTYPE = 7
|
---|
107 | #if (_WIN32_WINNT >= 0x0602)
|
---|
108 | ,
|
---|
109 | GET_VIRTUAL_DISK_INFO_IS_4K_ALIGNED = 8,
|
---|
110 | GET_VIRTUAL_DISK_INFO_PHYSICAL_DISK = 9,
|
---|
111 | GET_VIRTUAL_DISK_INFO_VHD_PHYSICAL_SECTOR_SIZE = 10,
|
---|
112 | GET_VIRTUAL_DISK_INFO_SMALLEST_SAFE_VIRTUAL_SIZE = 11,
|
---|
113 | GET_VIRTUAL_DISK_INFO_FRAGMENTATION = 12
|
---|
114 | #endif /* _WIN32_WINNT >= 0x0602 */
|
---|
115 | #if (_WIN32_WINNT >= 0x0603)
|
---|
116 | ,
|
---|
117 | GET_VIRTUAL_DISK_INFO_IS_LOADED = 13,
|
---|
118 | GET_VIRTUAL_DISK_INFO_VIRTUAL_DISK_ID = 14
|
---|
119 | #endif /* _WIN32_WINNT >= 0x0603 */
|
---|
120 | #if (_WIN32_WINNT >= 0x0A00)
|
---|
121 | ,
|
---|
122 | GET_VIRTUAL_DISK_INFO_CHANGE_TRACKING_STATE = 15
|
---|
123 | #endif /* _WIN32_WINNT >= 0x0A00 */
|
---|
124 | } GET_VIRTUAL_DISK_INFO_VERSION;
|
---|
125 |
|
---|
126 | typedef enum _MIRROR_VIRTUAL_DISK_FLAG {
|
---|
127 | MIRROR_VIRTUAL_DISK_FLAG_NONE = 0x00000000,
|
---|
128 | MIRROR_VIRTUAL_DISK_FLAG_EXISTING_FILE = 0x00000001
|
---|
129 | } MIRROR_VIRTUAL_DISK_FLAG;
|
---|
130 |
|
---|
131 | typedef enum _MIRROR_VIRTUAL_DISK_VERSION {
|
---|
132 | MIRROR_VIRTUAL_DISK_VERSION_UNSPECIFIED = 0,
|
---|
133 | MIRROR_VIRTUAL_DISK_VERSION_1 = 1
|
---|
134 | } MIRROR_VIRTUAL_DISK_VERSION;
|
---|
135 |
|
---|
136 | typedef enum _MERGE_VIRTUAL_DISK_FLAG {
|
---|
137 | MERGE_VIRTUAL_DISK_FLAG_NONE = 0x00000000
|
---|
138 | } MERGE_VIRTUAL_DISK_FLAG;
|
---|
139 |
|
---|
140 | typedef enum _MERGE_VIRTUAL_DISK_VERSION {
|
---|
141 | MERGE_VIRTUAL_DISK_VERSION_UNSPECIFIED = 0,
|
---|
142 | MERGE_VIRTUAL_DISK_VERSION_1 = 1
|
---|
143 | #if (_WIN32_WINNT >= 0x0602)
|
---|
144 | ,
|
---|
145 | MERGE_VIRTUAL_DISK_VERSION_2 = 2
|
---|
146 | #endif /* _WIN32_WINNT >= 0x0A00 */
|
---|
147 | } MERGE_VIRTUAL_DISK_VERSION;
|
---|
148 |
|
---|
149 | typedef enum _OPEN_VIRTUAL_DISK_FLAG {
|
---|
150 | OPEN_VIRTUAL_DISK_FLAG_NONE = 0x00000000,
|
---|
151 | OPEN_VIRTUAL_DISK_FLAG_NO_PARENTS = 0x00000001,
|
---|
152 | OPEN_VIRTUAL_DISK_FLAG_BLANK_FILE = 0x00000002,
|
---|
153 | OPEN_VIRTUAL_DISK_FLAG_BOOT_DRIVE = 0x00000004
|
---|
154 | #if (_WIN32_WINNT >= 0x0602)
|
---|
155 | ,
|
---|
156 | OPEN_VIRTUAL_DISK_FLAG_CACHED_IO = 0x00000008,
|
---|
157 | OPEN_VIRTUAL_DISK_FLAG_CUSTOM_DIFF_CHAIN = 0x00000010
|
---|
158 | #endif /* _WIN32_WINNT >= 0x0602 */
|
---|
159 | } OPEN_VIRTUAL_DISK_FLAG;
|
---|
160 |
|
---|
161 | typedef enum _OPEN_VIRTUAL_DISK_VERSION {
|
---|
162 | OPEN_VIRTUAL_DISK_VERSION_UNSPECIFIED = 0,
|
---|
163 | OPEN_VIRTUAL_DISK_VERSION_1 = 1
|
---|
164 | #if (_WIN32_WINNT >= 0x0602)
|
---|
165 | ,
|
---|
166 | OPEN_VIRTUAL_DISK_VERSION_2 = 2
|
---|
167 | #endif /* _WIN32_WINNT >= 0x0602 */
|
---|
168 | } OPEN_VIRTUAL_DISK_VERSION;
|
---|
169 |
|
---|
170 | typedef enum _SET_VIRTUAL_DISK_INFO_VERSION {
|
---|
171 | SET_VIRTUAL_DISK_INFO_UNSPECIFIED = 0,
|
---|
172 | SET_VIRTUAL_DISK_INFO_PARENT_PATH = 1,
|
---|
173 | SET_VIRTUAL_DISK_INFO_IDENTIFIER = 2
|
---|
174 | #if (_WIN32_WINNT >= 0x0602)
|
---|
175 | ,
|
---|
176 | SET_VIRTUAL_DISK_INFO_PARENT_PATH_WITH_DEPTH = 3,
|
---|
177 | SET_VIRTUAL_DISK_INFO_PHYSICAL_SECTOR_SIZE = 4
|
---|
178 | #endif /* (_WIN32_WINNT >= 0x0602) */
|
---|
179 | #if (_WIN32_WINNT >= 0x0603)
|
---|
180 | ,
|
---|
181 | SET_VIRTUAL_DISK_INFO_VIRTUAL_DISK_ID = 5
|
---|
182 | #endif /* (_WIN32_WINNT >= 0x0603) */
|
---|
183 | #if (_WIN32_WINNT >= 0x0A00)
|
---|
184 | ,
|
---|
185 | SET_VIRTUAL_DISK_INFO_CHANGE_TRACKING_STATE = 6,
|
---|
186 | SET_VIRTUAL_DISK_INFO_PARENT_LOCATOR = 7
|
---|
187 | #endif /* (_WIN32_WINNT >= 0x0A00) */
|
---|
188 | } SET_VIRTUAL_DISK_INFO_VERSION;
|
---|
189 |
|
---|
190 | typedef enum _STORAGE_DEPENDENCY_INFO_VERSION {
|
---|
191 | STORAGE_DEPENDENCY_INFO_VERSION_UNSPECIFIED = 0,
|
---|
192 | STORAGE_DEPENDENCY_INFO_VERSION_1 = 1,
|
---|
193 | STORAGE_DEPENDENCY_INFO_VERSION_2 = 2
|
---|
194 | } STORAGE_DEPENDENCY_INFO_VERSION;
|
---|
195 |
|
---|
196 | typedef enum _VIRTUAL_DISK_ACCESS_MASK {
|
---|
197 | VIRTUAL_DISK_ACCESS_NONE = 0x00000000,
|
---|
198 | VIRTUAL_DISK_ACCESS_ATTACH_RO = 0x00010000,
|
---|
199 | VIRTUAL_DISK_ACCESS_ATTACH_RW = 0x00020000,
|
---|
200 | VIRTUAL_DISK_ACCESS_DETACH = 0x00040000,
|
---|
201 | VIRTUAL_DISK_ACCESS_GET_INFO = 0x00080000,
|
---|
202 | VIRTUAL_DISK_ACCESS_CREATE = 0x00100000,
|
---|
203 | VIRTUAL_DISK_ACCESS_METAOPS = 0x00200000,
|
---|
204 | VIRTUAL_DISK_ACCESS_READ = 0x000d0000,
|
---|
205 | VIRTUAL_DISK_ACCESS_ALL = 0x003f0000,
|
---|
206 | VIRTUAL_DISK_ACCESS_WRITABLE = 0x00320000
|
---|
207 | } VIRTUAL_DISK_ACCESS_MASK;
|
---|
208 |
|
---|
209 | #if (_WIN32_WINNT >= 0x0602)
|
---|
210 |
|
---|
211 | typedef enum _RESIZE_VIRTUAL_DISK_FLAG {
|
---|
212 | RESIZE_VIRTUAL_DISK_FLAG_NONE = 0x0,
|
---|
213 | RESIZE_VIRTUAL_DISK_FLAG_ALLOW_UNSAFE_VIRTUAL_SIZE = 0x1,
|
---|
214 | RESIZE_VIRTUAL_DISK_FLAG_RESIZE_TO_SMALLEST_SAFE_VIRTUAL_SIZE = 0x2
|
---|
215 | } RESIZE_VIRTUAL_DISK_FLAG;
|
---|
216 |
|
---|
217 | typedef enum _RESIZE_VIRTUAL_DISK_VERSION {
|
---|
218 | RESIZE_VIRTUAL_DISK_VERSION_UNSPECIFIED = 0,
|
---|
219 | RESIZE_VIRTUAL_DISK_VERSION_1 = 1
|
---|
220 | } RESIZE_VIRTUAL_DISK_VERSION;
|
---|
221 |
|
---|
222 | #endif /* (_WIN32_WINNT >= 0x0602) */
|
---|
223 | #if (_WIN32_WINNT >= 0x0A00)
|
---|
224 |
|
---|
225 | typedef enum _APPLY_SNAPSHOT_VHDSET_FLAG {
|
---|
226 | APPLY_SNAPSHOT_VHDSET_FLAG_NONE = 0x00000000,
|
---|
227 | APPLY_SNAPSHOT_VHDSET_FLAG_WRITEABLE = 0x00000001
|
---|
228 | } APPLY_SNAPSHOT_VHDSET_FLAG, *PAPPLY_SNAPSHOT_VHDSET_FLAG;
|
---|
229 |
|
---|
230 | typedef enum _APPLY_SNAPSHOT_VHDSET_VERSION {
|
---|
231 | APPLY_SNAPSHOT_VHDSET_VERSION_UNSPECIFIED = 0,
|
---|
232 | APPLY_SNAPSHOT_VHDSET_VERSION_1 = 1
|
---|
233 | } APPLY_SNAPSHOT_VHDSET_VERSION;
|
---|
234 |
|
---|
235 | typedef enum _DELETE_SNAPSHOT_VHDSET_FLAG {
|
---|
236 | DELETE_SNAPSHOT_VHDSET_FLAG_NONE = 0x00000000,
|
---|
237 | DELETE_SNAPSHOT_VHDSET_FLAG_PERSIST_RCT = 0x00000001
|
---|
238 | } DELETE_SNAPSHOT_VHDSET_FLAG, *PDELETE_SNAPSHOT_VHDSET_FLAG;
|
---|
239 |
|
---|
240 | typedef enum _DELETE_SNAPSHOT_VHDSET_VERSION {
|
---|
241 | DELETE_SNAPSHOT_VHDSET_VERSION_UNSPECIFIED = 0x00000000,
|
---|
242 | DELETE_SNAPSHOT_VHDSET_VERSION_1 = 0x00000001
|
---|
243 | } DELETE_SNAPSHOT_VHDSET_VERSION, *PDELETE_SNAPSHOT_VHDSET_VERSION;
|
---|
244 |
|
---|
245 | typedef enum _MODIFY_VHDSET_FLAG {
|
---|
246 | MODIFY_VHDSET_FLAG_NONE = 0x00000000
|
---|
247 | } MODIFY_VHDSET_FLAG, *PMODIFY_VHDSET_FLAG;
|
---|
248 |
|
---|
249 | typedef enum _MODIFY_VHDSET_VERSION {
|
---|
250 | MODIFY_VHDSET_UNSPECIFIED = 0,
|
---|
251 | MODIFY_VHDSET_SNAPSHOT_PATH = 1,
|
---|
252 | MODIFY_VHDSET_REMOVE_SNAPSHOT = 2,
|
---|
253 | MODIFY_VHDSET_DEFAULT_SNAPSHOT_PATH = 3
|
---|
254 | } MODIFY_VHDSET_VERSION, *PMODIFY_VHDSET_VERSION;
|
---|
255 |
|
---|
256 | typedef enum _QUERY_CHANGES_VIRTUAL_DISK_FLAG {
|
---|
257 | QUERY_CHANGES_VIRTUAL_DISK_FLAG_NONE = 0x00000000
|
---|
258 | } QUERY_CHANGES_VIRTUAL_DISK_FLAG;
|
---|
259 |
|
---|
260 | typedef enum _TAKE_SNAPSHOT_VHDSET_FLAG {
|
---|
261 | TAKE_SNAPSHOT_VHDSET_FLAG_NONE = 0x00000000
|
---|
262 | } TAKE_SNAPSHOT_VHDSET_FLAG, *PTAKE_SNAPSHOT_VHDSET_FLAG;
|
---|
263 |
|
---|
264 | typedef enum _TAKE_SNAPSHOT_VHDSET_VERSION {
|
---|
265 | TAKE_SNAPSHOT_VHDSET_VERSION_UNSPECIFIED = 0,
|
---|
266 | TAKE_SNAPSHOT_VHDSET_VERSION_1 = 1
|
---|
267 | } TAKE_SNAPSHOT_VHDSET_VERSION;
|
---|
268 |
|
---|
269 | #endif /* _WIN32_WINNT >= 0x0A00 */
|
---|
270 |
|
---|
271 | typedef struct _VIRTUAL_STORAGE_TYPE {
|
---|
272 | ULONG DeviceId;
|
---|
273 | GUID VendorId;
|
---|
274 | } VIRTUAL_STORAGE_TYPE, *PVIRTUAL_STORAGE_TYPE;
|
---|
275 |
|
---|
276 | typedef struct _ATTACH_VIRTUAL_DISK_PARAMETERS {
|
---|
277 | ATTACH_VIRTUAL_DISK_VERSION Version;
|
---|
278 | __C89_NAMELESS union {
|
---|
279 | struct {
|
---|
280 | ULONG Reserved;
|
---|
281 | } Version1;
|
---|
282 | } DUMMYUNIONNAME;
|
---|
283 | } ATTACH_VIRTUAL_DISK_PARAMETERS, *PATTACH_VIRTUAL_DISK_PARAMETERS;
|
---|
284 |
|
---|
285 | typedef struct _COMPACT_VIRTUAL_DISK_PARAMETERS {
|
---|
286 | COMPACT_VIRTUAL_DISK_VERSION Version;
|
---|
287 | __C89_NAMELESS union {
|
---|
288 | struct {
|
---|
289 | ULONG Reserved;
|
---|
290 | } Version1;
|
---|
291 | } DUMMYUNIONNAME;
|
---|
292 | } COMPACT_VIRTUAL_DISK_PARAMETERS, *PCOMPACT_VIRTUAL_DISK_PARAMETERS;
|
---|
293 |
|
---|
294 | typedef struct _CREATE_VIRTUAL_DISK_PARAMETERS {
|
---|
295 | CREATE_VIRTUAL_DISK_VERSION Version;
|
---|
296 | __C89_NAMELESS union {
|
---|
297 | struct {
|
---|
298 | GUID UniqueId;
|
---|
299 | ULONGLONG MaximumSize;
|
---|
300 | ULONG BlockSizeInBytes;
|
---|
301 | ULONG SectorSizeInBytes;
|
---|
302 | PCWSTR ParentPath;
|
---|
303 | PCWSTR SourcePath;
|
---|
304 | } Version1;
|
---|
305 | #if (_WIN32_WINNT >= 0x0602)
|
---|
306 | struct {
|
---|
307 | GUID UniqueId;
|
---|
308 | ULONGLONG MaximumSize;
|
---|
309 | ULONG BlockSizeInBytes;
|
---|
310 | ULONG SectorSizeInBytes;
|
---|
311 | PCWSTR ParentPath;
|
---|
312 | PCWSTR SourcePath;
|
---|
313 | OPEN_VIRTUAL_DISK_FLAG OpenFlags;
|
---|
314 | VIRTUAL_STORAGE_TYPE ParentVirtualStorageType;
|
---|
315 | VIRTUAL_STORAGE_TYPE SourceVirtualStorageType;
|
---|
316 | GUID ResiliencyGuid;
|
---|
317 | } Version2;
|
---|
318 | #endif /* _WIN32_WINNT >= 0x0602 */
|
---|
319 | } DUMMYUNIONNAME;
|
---|
320 | } CREATE_VIRTUAL_DISK_PARAMETERS, *PCREATE_VIRTUAL_DISK_PARAMETERS;
|
---|
321 |
|
---|
322 | typedef struct _EXPAND_VIRTUAL_DISK_PARAMETERS {
|
---|
323 | EXPAND_VIRTUAL_DISK_VERSION Version;
|
---|
324 | __C89_NAMELESS union {
|
---|
325 | struct {
|
---|
326 | ULONGLONG NewSize;
|
---|
327 | } Version1;
|
---|
328 | } DUMMYUNIONNAME;
|
---|
329 | } EXPAND_VIRTUAL_DISK_PARAMETERS, *PEXPAND_VIRTUAL_DISK_PARAMETERS;
|
---|
330 |
|
---|
331 | typedef struct _GET_VIRTUAL_DISK_INFO {
|
---|
332 | GET_VIRTUAL_DISK_INFO_VERSION Version;
|
---|
333 | __C89_NAMELESS union {
|
---|
334 | struct {
|
---|
335 | ULONGLONG VirtualSize;
|
---|
336 | ULONGLONG PhysicalSize;
|
---|
337 | ULONG BlockSize;
|
---|
338 | ULONG SectorSize;
|
---|
339 | } Size;
|
---|
340 | GUID Identifier;
|
---|
341 | struct {
|
---|
342 | WINBOOL ParentResolved;
|
---|
343 | WCHAR ParentLocationBuffer[1];
|
---|
344 | } ParentLocation;
|
---|
345 | GUID ParentIdentifier;
|
---|
346 | ULONG ParentTimestamp;
|
---|
347 | VIRTUAL_STORAGE_TYPE VirtualStorageType;
|
---|
348 | ULONG ProviderSubtype;
|
---|
349 | #if (_WIN32_WINNT >= 0x0602)
|
---|
350 | WINBOOL Is4kAligned;
|
---|
351 | WINBOOL IsLoaded;
|
---|
352 | struct {
|
---|
353 | ULONG LogicalSectorSize;
|
---|
354 | ULONG PhysicalSectorSize;
|
---|
355 | WINBOOL IsRemote;
|
---|
356 | } PhysicalDisk;
|
---|
357 | ULONG VhdPhysicalSectorSize;
|
---|
358 | ULONGLONG SmallestSafeVirtualSize;
|
---|
359 | ULONG FragmentationPercentage;
|
---|
360 | #endif /* _WIN32_WINNT >= 0x0602 */
|
---|
361 | #if (_WIN32_WINNT >= 0x0603)
|
---|
362 | GUID VirtualDiskId;
|
---|
363 | struct {
|
---|
364 | WINBOOL Enabled;
|
---|
365 | WINBOOL NewerChanges;
|
---|
366 | WCHAR MostRecentId[1];
|
---|
367 | } ChangeTrackingState;
|
---|
368 | #endif /* _WIN32_WINNT >= 0x0603 */
|
---|
369 | } DUMMYUNIONNAME;
|
---|
370 | } GET_VIRTUAL_DISK_INFO, *PGET_VIRTUAL_DISK_INFO;
|
---|
371 |
|
---|
372 | typedef struct _MERGE_VIRTUAL_DISK_PARAMETERS {
|
---|
373 | MERGE_VIRTUAL_DISK_VERSION Version;
|
---|
374 | __C89_NAMELESS union {
|
---|
375 | struct {
|
---|
376 | ULONG MergeDepth;
|
---|
377 | } Version1;
|
---|
378 | #if (_WIN32_WINNT >= 0x0602)
|
---|
379 | struct {
|
---|
380 | ULONG MergeSourceDepth;
|
---|
381 | ULONG MergeTargetDepth;
|
---|
382 | } Version2;
|
---|
383 | #endif /* _WIN32_WINNT >= 0x0602 */
|
---|
384 | } DUMMYUNIONNAME;
|
---|
385 | } MERGE_VIRTUAL_DISK_PARAMETERS, *PMERGE_VIRTUAL_DISK_PARAMETERS;
|
---|
386 |
|
---|
387 | typedef struct _OPEN_VIRTUAL_DISK_PARAMETERS {
|
---|
388 | OPEN_VIRTUAL_DISK_VERSION Version;
|
---|
389 | __C89_NAMELESS union {
|
---|
390 | struct {
|
---|
391 | ULONG RWDepth;
|
---|
392 | } Version1;
|
---|
393 | #if (_WIN32_WINNT >= 0x0602)
|
---|
394 | struct {
|
---|
395 | WINBOOL GetInfoOnly;
|
---|
396 | WINBOOL ReadOnly;
|
---|
397 | GUID ResiliencyGuid;
|
---|
398 | } Version2;
|
---|
399 | #endif /* _WIN32_WINNT >= 0x0602 */
|
---|
400 | } DUMMYUNIONNAME;
|
---|
401 | } OPEN_VIRTUAL_DISK_PARAMETERS, *POPEN_VIRTUAL_DISK_PARAMETERS;
|
---|
402 |
|
---|
403 | typedef struct _SET_VIRTUAL_DISK_INFO {
|
---|
404 | SET_VIRTUAL_DISK_INFO_VERSION Version;
|
---|
405 | __C89_NAMELESS union {
|
---|
406 | PCWSTR ParentFilePath;
|
---|
407 | GUID UniqueIdentifier;
|
---|
408 | #if (_WIN32_WINNT >= 0x0602)
|
---|
409 | struct {
|
---|
410 | ULONG ChildDepth;
|
---|
411 | PCWSTR ParentFilePath;
|
---|
412 | } ParentPathWithDepthInfo;
|
---|
413 | ULONG VhdPhysicalSectorSize;
|
---|
414 | GUID VirtualDiskId;
|
---|
415 | #endif /* _WIN32_WINNT >= 0x0602 */
|
---|
416 | #if (_WIN32_WINNT >= 0x0603)
|
---|
417 | WINBOOL ChangeTrackingEnabled;
|
---|
418 | struct {
|
---|
419 | GUID LinkageId;
|
---|
420 | PCWSTR ParentFilePath;
|
---|
421 | } ParentLocator;
|
---|
422 | #endif /* _WIN32_WINNT >= 0x0603 */
|
---|
423 | } DUMMYUNIONNAME;
|
---|
424 | } SET_VIRTUAL_DISK_INFO, *PSET_VIRTUAL_DISK_INFO;
|
---|
425 |
|
---|
426 | typedef struct _STORAGE_DEPENDENCY_INFO_TYPE_1 {
|
---|
427 | DEPENDENT_DISK_FLAG DependencyTypeFlags;
|
---|
428 | ULONG ProviderSpecificFlags;
|
---|
429 | VIRTUAL_STORAGE_TYPE VirtualStorageType;
|
---|
430 | } STORAGE_DEPENDENCY_INFO_TYPE_1, *PSTORAGE_DEPENDENCY_INFO_TYPE_1;
|
---|
431 |
|
---|
432 | typedef struct _STORAGE_DEPENDENCY_INFO_TYPE_2 {
|
---|
433 | DEPENDENT_DISK_FLAG DependencyTypeFlags;
|
---|
434 | ULONG ProviderSpecificFlags;
|
---|
435 | VIRTUAL_STORAGE_TYPE VirtualStorageType;
|
---|
436 | ULONG AncestorLevel;
|
---|
437 | PWSTR DependencyDeviceName;
|
---|
438 | PWSTR HostVolumeName;
|
---|
439 | PWSTR DependentVolumeName;
|
---|
440 | PWSTR DependentVolumeRelativePath;
|
---|
441 | } STORAGE_DEPENDENCY_INFO_TYPE_2, *PSTORAGE_DEPENDENCY_INFO_TYPE_2;
|
---|
442 |
|
---|
443 | /* Fixme: Suppress GCC errors about "error: flexible array member in union" */
|
---|
444 |
|
---|
445 | typedef struct _STORAGE_DEPENDENCY_INFO {
|
---|
446 | STORAGE_DEPENDENCY_INFO_VERSION Version;
|
---|
447 | ULONG NumberEntries;
|
---|
448 | __C89_NAMELESS union {
|
---|
449 | STORAGE_DEPENDENCY_INFO_TYPE_1 Version1Entries[1];
|
---|
450 | STORAGE_DEPENDENCY_INFO_TYPE_2 Version2Entries[1];
|
---|
451 | } DUMMYUNIONNAME;
|
---|
452 | } STORAGE_DEPENDENCY_INFO, *PSTORAGE_DEPENDENCY_INFO;
|
---|
453 |
|
---|
454 | typedef struct _VIRTUAL_DISK_PROGRESS {
|
---|
455 | DWORD OperationStatus;
|
---|
456 | ULONGLONG CurrentValue;
|
---|
457 | ULONGLONG CompletionValue;
|
---|
458 | } VIRTUAL_DISK_PROGRESS, *PVIRTUAL_DISK_PROGRESS;
|
---|
459 |
|
---|
460 | #if (_WIN32_WINNT >= 0x0602)
|
---|
461 |
|
---|
462 | typedef struct _MIRROR_VIRTUAL_DISK_PARAMETERS {
|
---|
463 | MIRROR_VIRTUAL_DISK_VERSION Version;
|
---|
464 | __C89_NAMELESS union {
|
---|
465 | struct {
|
---|
466 | PCWSTR MirrorVirtualDiskPath;
|
---|
467 | } Version1;
|
---|
468 | } DUMMYUNIONNAME;
|
---|
469 | } MIRROR_VIRTUAL_DISK_PARAMETERS, *PMIRROR_VIRTUAL_DISK_PARAMETERS;
|
---|
470 |
|
---|
471 | typedef struct _RESIZE_VIRTUAL_DISK_PARAMETERS {
|
---|
472 | RESIZE_VIRTUAL_DISK_VERSION Version;
|
---|
473 | __C89_NAMELESS union {
|
---|
474 | struct {
|
---|
475 | ULONGLONG NewSize;
|
---|
476 | } Version1;
|
---|
477 | } DUMMYUNIONNAME;
|
---|
478 | } RESIZE_VIRTUAL_DISK_PARAMETERS, *PRESIZE_VIRTUAL_DISK_PARAMETERS;
|
---|
479 |
|
---|
480 | #endif /* _WIN32_WINNT >= 0x0602 */
|
---|
481 |
|
---|
482 | #if (_WIN32_WINNT >= 0x0A00)
|
---|
483 |
|
---|
484 | typedef struct _APPLY_SNAPSHOT_VHDSET_PARAMETERS {
|
---|
485 | APPLY_SNAPSHOT_VHDSET_VERSION Version;
|
---|
486 | __C89_NAMELESS union {
|
---|
487 | struct {
|
---|
488 | GUID SnapshotId;
|
---|
489 | GUID LeafSnapshotId;
|
---|
490 | } Version1;
|
---|
491 | } DUMMYUNIONNAME;
|
---|
492 | } APPLY_SNAPSHOT_VHDSET_PARAMETERS, *PAPPLY_SNAPSHOT_VHDSET_PARAMETERS;
|
---|
493 |
|
---|
494 | typedef struct _DELETE_SNAPSHOT_VHDSET_PARAMETERS {
|
---|
495 | DELETE_SNAPSHOT_VHDSET_VERSION Version;
|
---|
496 | __C89_NAMELESS union {
|
---|
497 | struct {
|
---|
498 | GUID SnapshotId;
|
---|
499 | } Version1;
|
---|
500 | } DUMMYUNIONNAME;
|
---|
501 | } DELETE_SNAPSHOT_VHDSET_PARAMETERS, *PDELETE_SNAPSHOT_VHDSET_PARAMETERS;
|
---|
502 |
|
---|
503 | typedef struct _MODIFY_VHDSET_PARAMETERS {
|
---|
504 | MODIFY_VHDSET_VERSION Version;
|
---|
505 | __C89_NAMELESS union {
|
---|
506 | struct {
|
---|
507 | GUID SnapshotId;
|
---|
508 | PCWSTR SnapshotFilePath;
|
---|
509 | } SnapshotPath;
|
---|
510 | GUID SnapshotId;
|
---|
511 | PCWSTR DefaultFilePath;
|
---|
512 | } DUMMYUNIONNAME;
|
---|
513 | } MODIFY_VHDSET_PARAMETERS, *PMODIFY_VHDSET_PARAMETERS;
|
---|
514 |
|
---|
515 | typedef struct _QUERY_CHANGES_VIRTUAL_DISK_RANGE {
|
---|
516 | ULONG64 ByteOffset;
|
---|
517 | ULONG64 ByteLength;
|
---|
518 | ULONG64 Reserved;
|
---|
519 | } QUERY_CHANGES_VIRTUAL_DISK_RANGE, *PQUERY_CHANGES_VIRTUAL_DISK_RANGE;
|
---|
520 |
|
---|
521 | typedef struct _TAKE_SNAPSHOT_VHDSET_PARAMETERS {
|
---|
522 | TAKE_SNAPSHOT_VHDSET_VERSION Version;
|
---|
523 | __C89_NAMELESS union {
|
---|
524 | struct {
|
---|
525 | GUID SnapshotId;
|
---|
526 | } Version1;
|
---|
527 | } DUMMYUNIONNAME;
|
---|
528 | } TAKE_SNAPSHOT_VHDSET_PARAMETERS, *PTAKE_SNAPSHOT_VHDSET_PARAMETERS;
|
---|
529 |
|
---|
530 | #endif /* _WIN32_WINNT >= 0x0A00 */
|
---|
531 |
|
---|
532 | DEFINE_GUID(VIRTUAL_STORAGE_TYPE_VENDOR_UNKNOWN,0x00000000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
|
---|
533 | DEFINE_GUID(VIRTUAL_STORAGE_TYPE_VENDOR_MICROSOFT,0xEC984AEC,0xA0F9,0x47e9,0x90,0x1F,0x71,0x41,0x5A,0x66,0x34,0x5B);
|
---|
534 |
|
---|
535 | VIRTDISKAPI DWORD WINAPI AttachVirtualDisk(HANDLE VirtualDiskHandle, PSECURITY_DESCRIPTOR SecurityDescriptor, ATTACH_VIRTUAL_DISK_FLAG Flags, ULONG ProviderSpecificFlags, PATTACH_VIRTUAL_DISK_PARAMETERS Parameters, LPOVERLAPPED Overlapped);
|
---|
536 | VIRTDISKAPI DWORD WINAPI CompactVirtualDisk(HANDLE VirtualDiskHandle, COMPACT_VIRTUAL_DISK_FLAG Flags, PCOMPACT_VIRTUAL_DISK_PARAMETERS Parameters, LPOVERLAPPED Overlapped);
|
---|
537 | VIRTDISKAPI DWORD WINAPI CreateVirtualDisk(PVIRTUAL_STORAGE_TYPE VirtualStorageType, PCWSTR Path, VIRTUAL_DISK_ACCESS_MASK VirtualDiskAccessMask, PSECURITY_DESCRIPTOR SecurityDescriptor, CREATE_VIRTUAL_DISK_FLAG Flags, ULONG ProviderSpecificFlags, PCREATE_VIRTUAL_DISK_PARAMETERS Parameters, LPOVERLAPPED Overlapped, PHANDLE Handle);
|
---|
538 | VIRTDISKAPI DWORD WINAPI DetachVirtualDisk(HANDLE VirtualDiskHandle, DETACH_VIRTUAL_DISK_FLAG Flags, ULONG ProviderSpecificFlags);
|
---|
539 | VIRTDISKAPI DWORD WINAPI ExpandVirtualDisk(HANDLE VirtualDiskHandle, EXPAND_VIRTUAL_DISK_FLAG Flags, PEXPAND_VIRTUAL_DISK_PARAMETERS Parameters, LPOVERLAPPED Overlapped);
|
---|
540 | VIRTDISKAPI DWORD WINAPI GetStorageDependencyInformation(HANDLE ObjectHandle, GET_STORAGE_DEPENDENCY_FLAG Flags, ULONG StorageDependencyInfoSize, PSTORAGE_DEPENDENCY_INFO StorageDependencyInfo, PULONG SizeUsed);
|
---|
541 | VIRTDISKAPI DWORD WINAPI GetVirtualDiskInformation(HANDLE VirtualDiskHandle, PULONG VirtualDiskInfoSize, PGET_VIRTUAL_DISK_INFO VirtualDiskInfo, PULONG SizeUsed);
|
---|
542 | VIRTDISKAPI DWORD WINAPI GetVirtualDiskOperationProgress(HANDLE VirtualDiskHandle, LPOVERLAPPED Overlapped, PVIRTUAL_DISK_PROGRESS Progress);
|
---|
543 | VIRTDISKAPI DWORD WINAPI GetVirtualDiskPhysicalPath(HANDLE VirtualDiskHandle, PULONG DiskPathSizeInBytes, PWSTR DiskPath);
|
---|
544 | VIRTDISKAPI DWORD WINAPI MergeVirtualDisk(HANDLE VirtualDiskHandle, MERGE_VIRTUAL_DISK_FLAG Flags, PMERGE_VIRTUAL_DISK_PARAMETERS Parameters, LPOVERLAPPED Overlapped);
|
---|
545 | VIRTDISKAPI DWORD WINAPI OpenVirtualDisk(PVIRTUAL_STORAGE_TYPE VirtualStorageType, PCWSTR Path, VIRTUAL_DISK_ACCESS_MASK VirtualDiskAccessMask, OPEN_VIRTUAL_DISK_FLAG Flags, POPEN_VIRTUAL_DISK_PARAMETERS Parameters, PHANDLE Handle);
|
---|
546 | VIRTDISKAPI DWORD WINAPI SetVirtualDiskInformation(HANDLE VirtualDiskHandle, PSET_VIRTUAL_DISK_INFO VirtualDiskInfo);
|
---|
547 |
|
---|
548 | #if (_WIN32_WINNT >= 0x0602)
|
---|
549 |
|
---|
550 | VIRTDISKAPI DWORD WINAPI AddVirtualDiskParent(HANDLE VirtualDiskHandle, PCWSTR ParentPath);
|
---|
551 | VIRTDISKAPI DWORD WINAPI BreakMirrorVirtualDisk(HANDLE VirtualDiskHandle);
|
---|
552 | VIRTDISKAPI DWORD WINAPI DeleteVirtualDiskMetadata(HANDLE VirtualDiskHandle, LPGUID Item);
|
---|
553 | VIRTDISKAPI DWORD WINAPI EnumerateVirtualDiskMetadata(HANDLE VirtualDiskHandle, PULONG NumberOfItems, GUID *Items);
|
---|
554 | VIRTDISKAPI DWORD WINAPI GetVirtualDiskMetadata(HANDLE VirtualDiskHandle, LPGUID Item, PULONG MetaDataSize, PVOID MetaData);
|
---|
555 | VIRTDISKAPI DWORD WINAPI MirrorVirtualDisk(HANDLE VirtualDiskHandle, MIRROR_VIRTUAL_DISK_FLAG Flags, PMIRROR_VIRTUAL_DISK_PARAMETERS Parameters, LPOVERLAPPED Overlapped);
|
---|
556 | VIRTDISKAPI DWORD WINAPI ResizeVirtualDisk(HANDLE VirtualDiskHandle, RESIZE_VIRTUAL_DISK_FLAG Flags, PRESIZE_VIRTUAL_DISK_PARAMETERS Parameters, LPOVERLAPPED Overlapped);
|
---|
557 | VIRTDISKAPI DWORD WINAPI SetVirtualDiskMetadata(HANDLE VirtualDiskHandle, LPGUID Item, ULONG MetaDataSize, PVOID MetaData);
|
---|
558 |
|
---|
559 | #endif /* _WIN32_WINNT >= 0x0602 */
|
---|
560 |
|
---|
561 | #if (_WIN32_WINNT >= 0x0A00)
|
---|
562 |
|
---|
563 | VIRTDISKAPI DWORD WINAPI ApplySnapshotVhdSet(HANDLE VirtualDiskHandle, const PAPPLY_SNAPSHOT_VHDSET_PARAMETERS Parameters, APPLY_SNAPSHOT_VHDSET_FLAG Flags);
|
---|
564 | VIRTDISKAPI DWORD WINAPI DeleteSnapshotVhdSet(HANDLE VirtualDiskHandle, const PDELETE_SNAPSHOT_VHDSET_PARAMETERS Parameters, DELETE_SNAPSHOT_VHDSET_FLAG Flags);
|
---|
565 | VIRTDISKAPI DWORD WINAPI ModifyVhdSet(HANDLE VirtualDiskHandle, const PMODIFY_VHDSET_PARAMETERS Parameters, MODIFY_VHDSET_FLAG Flags);
|
---|
566 | VIRTDISKAPI DWORD WINAPI QueryChangesVirtualDisk(HANDLE VirtualDiskHandle, PCWSTR ChangeTrackingId, ULONG64 ByteOffset, ULONG64 ByteLength, QUERY_CHANGES_VIRTUAL_DISK_FLAG Flags, PQUERY_CHANGES_VIRTUAL_DISK_RANGE Ranges, PULONG RangeCount, PULONG64 ProcessedLength);
|
---|
567 | VIRTDISKAPI WINAPI DWORD TakeSnapshotVhdSet(HANDLE VirtualDiskHandle, const PTAKE_SNAPSHOT_VHDSET_PARAMETERS Parameters, TAKE_SNAPSHOT_VHDSET_FLAG Flags);
|
---|
568 |
|
---|
569 | #endif /* _WIN32_WINNT >= 0x0A00 */
|
---|
570 | #ifdef __cplusplus
|
---|
571 | }
|
---|
572 | #endif
|
---|
573 | #endif /*(_WIN32_WINNT >= 0x0601)*/
|
---|
574 | #endif /*_INC_VIRTDISK*/
|
---|