2 * Copyright 2017 Louis Lenders
3 * Copyright 2018 Gijs Vermeulen
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20 #ifndef __WINE_VIRTDISK_DLL_H
21 #define __WINE_VIRTDISK_DLL_H
27 #define VIRTUAL_STORAGE_TYPE_DEVICE_UNKNOWN 0
28 #define VIRTUAL_STORAGE_TYPE_DEVICE_ISO 1
29 #define VIRTUAL_STORAGE_TYPE_DEVICE_VHD 2
31 typedef enum _ATTACH_VIRTUAL_DISK_FLAG
{
32 ATTACH_VIRTUAL_DISK_FLAG_NONE
= 0x00,
33 ATTACH_VIRTUAL_DISK_FLAG_READ_ONLY
= 0x01,
34 ATTACH_VIRTUAL_DISK_FLAG_NO_DRIVE_LETTER
= 0x02,
35 ATTACH_VIRTUAL_DISK_FLAG_PERMANENT_LIFETIME
= 0x04,
36 ATTACH_VIRTUAL_DISK_FLAG_NO_LOCAL_HOST
= 0x08,
37 ATTACH_VIRTUAL_DISK_FLAG_NO_SECURITY_DESCRIPTOR
= 0x10
38 } ATTACH_VIRTUAL_DISK_FLAG
;
40 typedef enum _ATTACH_VIRTUAL_DISK_VERSION
{
41 ATTACH_VIRTUAL_DISK_VERSION_UNSPECIFIED
,
42 ATTACH_VIRTUAL_DISK_VERSION_1
43 } ATTACH_VIRTUAL_DISK_VERSION
;
45 typedef enum _COMPACT_VIRTUAL_DISK_FLAG
{
46 COMPACT_VIRTUAL_DISK_FLAG_NONE
= 0x00,
47 COMPACT_VIRTUAL_DISK_FLAG_NO_ZERO_SCAN
= 0x01,
48 COMPACT_VIRTUAL_DISK_FLAG_NO_BLOCK_MOVES
= 0x02
49 } COMPACT_VIRTUAL_DISK_FLAG
;
51 typedef enum _COMPACT_VIRTUAL_DISK_VERSION
{
52 COMPACT_VIRTUAL_DISK_VERSION_UNSPECIFIED
,
53 COMPACT_VIRTUAL_DISK_VERSION_1
54 } COMPACT_VIRTUAL_DISK_VERSION
;
56 typedef enum _DEPENDENT_DISK_FLAG
58 DEPENDENT_DISK_FLAG_NONE
= 0x00000000,
59 DEPENDENT_DISK_FLAG_MULT_BACKING_FILES
= 0x00000001,
60 DEPENDENT_DISK_FLAG_FULLY_ALLOCATED
= 0x00000002,
61 DEPENDENT_DISK_FLAG_READ_ONLY
= 0x00000004,
62 DEPENDENT_DISK_FLAG_REMOTE
= 0x00000008,
63 DEPENDENT_DISK_FLAG_SYSTEM_VOLUME
= 0x00000010,
64 DEPENDENT_DISK_FLAG_SYSTEM_VOLUME_PARENT
= 0x00000020,
65 DEPENDENT_DISK_FLAG_REMOVABLE
= 0x00000040,
66 DEPENDENT_DISK_FLAG_NO_DRIVE_LETTER
= 0x00000080,
67 DEPENDENT_DISK_FLAG_PARENT
= 0x00000100,
68 DEPENDENT_DISK_FLAG_NO_HOST_DISK
= 0x00000200,
69 DEPENDENT_DISK_FLAG_PERMANENT_LIFETIME
= 0x00000400
70 } DEPENDENT_DISK_FLAG
;
72 typedef enum _EXPAND_VIRTUAL_DISK_VERSION
{
73 EXPAND_VIRTUAL_DISK_VERSION_UNSPECIFIED
,
74 EXPAND_VIRTUAL_DISK_VERSION_1
75 } EXPAND_VIRTUAL_DISK_VERSION
;
77 typedef enum _DETACH_VIRTUAL_DISK_FLAG
{
78 DETACH_VIRTUAL_DISK_FLAG_NONE
= 0x00000000
79 } DETACH_VIRTUAL_DISK_FLAG
;
81 typedef enum _EXPAND_VIRTUAL_DISK_FLAG
{
82 EXPAND_VIRTUAL_DISK_FLAG_NONE
= 0x00000000
83 } EXPAND_VIRTUAL_DISK_FLAG
;
85 typedef enum _GET_STORAGE_DEPENDENCY_FLAG
87 GET_STORAGE_DEPENDENCY_FLAG_NONE
= 0x00,
88 GET_STORAGE_DEPENDENCY_FLAG_HOST_VOLUMES
= 0x01,
89 GET_STORAGE_DEPENDENCY_FLAG_DISK_HANDLE
= 0x02
90 } GET_STORAGE_DEPENDENCY_FLAG
;
92 typedef enum _MIRROR_VIRTUAL_DISK_FLAG
{
93 MIRROR_VIRTUAL_DISK_FLAG_NONE
= 0x00,
94 MIRROR_VIRTUAL_DISK_FLAG_EXISTING_FILE
= 0x01
95 } MIRROR_VIRTUAL_DISK_FLAG
;
97 typedef enum _MIRROR_VIRTUAL_DISK_VERSION
{
98 MIRROR_VIRTUAL_DISK_VERSION_UNSPECIFIED
,
99 MIRROR_VIRTUAL_DISK_VERSION_1
100 } MIRROR_VIRTUAL_DISK_VERSION
;
102 typedef enum _MERGE_VIRTUAL_DISK_FLAG
{
103 MERGE_VIRTUAL_DISK_FLAG_NONE
= 0x00000000
104 } MERGE_VIRTUAL_DISK_FLAG
;
106 typedef enum _STORAGE_DEPENDENCY_INFO_VERSION
108 STORAGE_DEPENDENCY_INFO_VERSION_UNSPECIFIED
= 0x0,
109 STORAGE_DEPENDENCY_INFO_VERSION_1
= 0x1,
110 STORAGE_DEPENDENCY_INFO_VERSION_2
= 0x2
111 } STORAGE_DEPENDENCY_INFO_VERSION
;
113 typedef enum _VIRTUAL_DISK_ACCESS_MASK
{
114 VIRTUAL_DISK_ACCESS_NONE
= 0x00000000,
115 VIRTUAL_DISK_ACCESS_ATTACH_RO
= 0x00010000,
116 VIRTUAL_DISK_ACCESS_ATTACH_RW
= 0x00020000,
117 VIRTUAL_DISK_ACCESS_DETACH
= 0x00040000,
118 VIRTUAL_DISK_ACCESS_GET_INFO
= 0x00080000,
119 VIRTUAL_DISK_ACCESS_CREATE
= 0x00100000,
120 VIRTUAL_DISK_ACCESS_METAOPS
= 0x00200000,
121 VIRTUAL_DISK_ACCESS_READ
= 0x000d0000,
122 VIRTUAL_DISK_ACCESS_ALL
= 0x003f0000,
123 VIRTUAL_DISK_ACCESS_WRITABLE
= 0x00320000
124 } VIRTUAL_DISK_ACCESS_MASK
;
126 typedef struct _VIRTUAL_STORAGE_TYPE
130 } VIRTUAL_STORAGE_TYPE
, *PVIRTUAL_STORAGE_TYPE
;
132 typedef struct _ATTACH_VIRTUAL_DISK_PARAMETERS
{
133 ATTACH_VIRTUAL_DISK_VERSION Version
;
134 __C89_NAMELESS
union {
139 } ATTACH_VIRTUAL_DISK_PARAMETERS
, *PATTACH_VIRTUAL_DISK_PARAMETERS
;
141 typedef struct _COMPACT_VIRTUAL_DISK_PARAMETERS
{
142 COMPACT_VIRTUAL_DISK_VERSION Version
;
143 __C89_NAMELESS
union {
148 } COMPACT_VIRTUAL_DISK_PARAMETERS
, *PCOMPACT_VIRTUAL_DISK_PARAMETERS
;
150 typedef struct _EXPAND_VIRTUAL_DISK_PARAMETERS
{
151 EXPAND_VIRTUAL_DISK_VERSION Version
;
152 __C89_NAMELESS
union {
157 } EXPAND_VIRTUAL_DISK_PARAMETERS
, *PEXPAND_VIRTUAL_DISK_PARAMETERS
;
159 typedef struct _STORAGE_DEPENDENCY_INFO_TYPE_1
161 DEPENDENT_DISK_FLAG DependencyTypeFlags
;
162 ULONG ProviderSpecificFlags
;
163 VIRTUAL_STORAGE_TYPE VirtualStorageType
;
164 } STORAGE_DEPENDENCY_INFO_TYPE_1
, *PSTORAGE_DEPENDENCY_INFO_TYPE_1
;
166 typedef struct _STORAGE_DEPENDENCY_INFO_TYPE_2
168 DEPENDENT_DISK_FLAG DependencyTypeFlags
;
169 ULONG ProviderSpecificFlags
;
170 VIRTUAL_STORAGE_TYPE VirtualStorageType
;
172 PWSTR DependencyDeviceName
;
173 PWSTR HostVolumeName
;
174 PWSTR DependentVolumeName
;
175 PWSTR DependentVolumeRelativePath
;
176 } STORAGE_DEPENDENCY_INFO_TYPE_2
, *PSTORAGE_DEPENDENCY_INFO_TYPE_2
;
178 typedef struct _STORAGE_DEPENDENCY_INFO
180 STORAGE_DEPENDENCY_INFO_VERSION Version
;
182 #if !defined(__WINESRC__) && (defined(_MSC_EXTENSIONS) || ((defined(__GNUC__) && __GNUC__ >= 3)))
185 STORAGE_DEPENDENCY_INFO_TYPE_1 Version1Entries
[];
186 STORAGE_DEPENDENCY_INFO_TYPE_2 Version2Entries
[];
187 } __C89_NAMELESSUNIONNAME
;
189 } STORAGE_DEPENDENCY_INFO
, *PSTORAGE_DEPENDENCY_INFO
;
191 typedef struct _VIRTUAL_DISK_PROGRESS
{
192 DWORD OperationStatus
;
193 ULONGLONG CurrentValue
;
194 ULONGLONG CompletionValue
;
195 } VIRTUAL_DISK_PROGRESS
, *PVIRTUAL_DISK_PROGRESS
;
197 DWORD WINAPI
GetStorageDependencyInformation(HANDLE obj
, GET_STORAGE_DEPENDENCY_FLAG flags
, ULONG size
, STORAGE_DEPENDENCY_INFO
*info
, ULONG
*used
);
203 #endif /* __WINE_VIRTDISK_DLL_H */