ifndef __REQUIRED_RPCNDR_H_VERSION__
__REQUIRED_RPCNDR_H_VERSION__ equ 500
endif
ifndef __REQUIRED_RPCSAL_H_VERSION__
__REQUIRED_RPCSAL_H_VERSION__ equ 100
endif

include rpc.inc
include rpcndr.inc

ifndef __RPCNDR_H_VERSION__
.err<this stub requires an updated version of rpcndr.inc>
endif

ifndef __vdssys_h__
define __vdssys_h__

include wtypes.inc
include oaidl.inc
include winapifamily.inc

if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
if (WINVER GE _WIN32_WINNT_WIN7)
if defined(VDS_MIDL_PASS)
PWSTR			typedef LPWSTR
PCWSTR			typedef LPCWSTR
ACCESS_MASK		typedef DWORD
PSECURITY_DESCRIPTOR	typedef PVOID
LPOVERLAPPED		typedef PVOID
PULONG			typedef ptr ULONG
PHANDLE			typedef ptr HANDLE

VIRTUAL_STORAGE_TYPE	STRUC
DeviceId		ULONG ?
VendorId		GUID <>
VIRTUAL_STORAGE_TYPE	ENDS
PVIRTUAL_STORAGE_TYPE	typedef ptr VIRTUAL_STORAGE_TYPE

OPEN_VIRTUAL_DISK_VERSION typedef SDWORD
OPEN_VIRTUAL_DISK_VERSION_UNSPECIFIED equ 0
OPEN_VIRTUAL_DISK_VERSION_1 equ 1
OPEN_VIRTUAL_DISK_VERSION_2 equ 2

OPEN_VIRTUAL_DISK_PARAMETERS STRUC
Version			OPEN_VIRTUAL_DISK_VERSION ?
UNION
 STRUC
  RWDepth		ULONG ?
 ENDS
 STRUC
  GetInfoOnly		BOOL ?
  ReadOnly		BOOL ?
  ResiliencyGuid	GUID <>
 ENDS
ENDS
OPEN_VIRTUAL_DISK_PARAMETERS ENDS
POPEN_VIRTUAL_DISK_PARAMETERS typedef ptr OPEN_VIRTUAL_DISK_PARAMETERS

VIRTUAL_DISK_ACCESS_MASK typedef SDWORD
VIRTUAL_DISK_ACCESS_NONE equ 0
VIRTUAL_DISK_ACCESS_ATTACH_RO equ 0x10000
VIRTUAL_DISK_ACCESS_ATTACH_RW equ 0x20000
VIRTUAL_DISK_ACCESS_DETACH equ 0x40000
VIRTUAL_DISK_ACCESS_GET_INFO equ 0x80000
VIRTUAL_DISK_ACCESS_CREATE equ 0x100000
VIRTUAL_DISK_ACCESS_METAOPS equ 0x200000
VIRTUAL_DISK_ACCESS_READ equ 0xd0000
VIRTUAL_DISK_ACCESS_ALL equ 0x3f0000
VIRTUAL_DISK_ACCESS_WRITABLE equ 0x320000

OPEN_VIRTUAL_DISK_FLAG	typedef SDWORD
OPEN_VIRTUAL_DISK_FLAG_NONE equ 0
OPEN_VIRTUAL_DISK_FLAG_NO_PARENTS equ 0x1
OPEN_VIRTUAL_DISK_FLAG_BLANK_FILE equ 0x2
OPEN_VIRTUAL_DISK_FLAG_BOOT_DRIVE equ 0x4
OPEN_VIRTUAL_DISK_FLAG_CACHED_IO equ 0x8
OPEN_VIRTUAL_DISK_FLAG_CUSTOM_DIFF_CHAIN equ 0x10
OPEN_VIRTUAL_DISK_FLAG_PARENT_CACHED_IO equ 0x20

OpenVirtualDisk proto WINAPI :PVIRTUAL_STORAGE_TYPE, :PCWSTR, :VIRTUAL_DISK_ACCESS_MASK, :OPEN_VIRTUAL_DISK_FLAG, :POPEN_VIRTUAL_DISK_PARAMETERS, :PHANDLE

CREATE_VIRTUAL_DISK_VERSION typedef SDWORD
CREATE_VIRTUAL_DISK_VERSION_UNSPECIFIED equ 0
CREATE_VIRTUAL_DISK_VERSION_1 equ 1
CREATE_VIRTUAL_DISK_VERSION_2 equ 2

CREATE_VIRTUAL_DISK_PARAMETERS STRUC
Version			CREATE_VIRTUAL_DISK_VERSION ?
UNION
 STRUC Version1
  UniqueId		GUID <>
  MaximumSize		ULONGLONG ?
  BlockSizeInBytes	ULONG ?
  SectorSizeInBytes	ULONG ?
  ParentPath		PCWSTR ?
  SourcePath		PCWSTR ?
 ENDS
 STRUC Version2
  UniqueId		GUID <>
  MaximumSize		ULONGLONG ?
  BlockSizeInBytes	ULONG ?
  SectorSizeInBytes	ULONG ?
  PhysicalSectorSizeInBytes ULONG ?
  ParentPath		PCWSTR ?
  SourcePath		PCWSTR ?
  OpenFlags		OPEN_VIRTUAL_DISK_FLAG ?
  ParentVirtualStorageType VIRTUAL_STORAGE_TYPE ?
  SourceVirtualStorageType VIRTUAL_STORAGE_TYPE ?
  ResiliencyGuid	GUID <>
 ENDS
ENDS
CREATE_VIRTUAL_DISK_PARAMETERS ENDS

PCREATE_VIRTUAL_DISK_PARAMETERS typedef ptr CREATE_VIRTUAL_DISK_PARAMETERS

CREATE_VIRTUAL_DISK_FLAG typedef SDWORD
CREATE_VIRTUAL_DISK_FLAG_NONE equ 0
CREATE_VIRTUAL_DISK_FLAG_FULL_PHYSICAL_ALLOCATION equ 0x1
CREATE_VIRTUAL_DISK_FLAG_PREVENT_WRITES_TO_SOURCE_DISK equ 0x2
CREATE_VIRTUAL_DISK_FLAG_DO_NOT_COPY_METADATA_FROM_PARENT equ 0x4

CreateVirtualDisk proto WINAPI :PVIRTUAL_STORAGE_TYPE, :PCWSTR, :VIRTUAL_DISK_ACCESS_MASK, :PSECURITY_DESCRIPTOR, :CREATE_VIRTUAL_DISK_FLAG, :ULONG, :PCREATE_VIRTUAL_DISK_PARAMETERS, :LPOVERLAPPED, :PHANDLE

ATTACH_VIRTUAL_DISK_VERSION typedef SDWORD
ATTACH_VIRTUAL_DISK_VERSION_UNSPECIFIED equ 0
ATTACH_VIRTUAL_DISK_VERSION_1 equ 1

ATTACH_VIRTUAL_DISK_PARAMETERS STRUC
Version			ATTACH_VIRTUAL_DISK_VERSION ?
UNION
 STRUC
  Reserved		ULONG ?
 ENDS
ENDS
ATTACH_VIRTUAL_DISK_PARAMETERS ENDS

PATTACH_VIRTUAL_DISK_PARAMETERS typedef ptr ATTACH_VIRTUAL_DISK_PARAMETERS

ATTACH_VIRTUAL_DISK_FLAG typedef SDWORD
ATTACH_VIRTUAL_DISK_FLAG_NONE equ 0
ATTACH_VIRTUAL_DISK_FLAG_READ_ONLY equ 0x1
ATTACH_VIRTUAL_DISK_FLAG_NO_DRIVE_LETTER equ 0x2
ATTACH_VIRTUAL_DISK_FLAG_PERMANENT_LIFETIME equ 0x4
ATTACH_VIRTUAL_DISK_FLAG_NO_LOCAL_HOST equ 0x8

AttachVirtualDisk proto WINAPI :HANDLE, :PSECURITY_DESCRIPTOR, :ATTACH_VIRTUAL_DISK_FLAG, :ULONG, :PATTACH_VIRTUAL_DISK_PARAMETERS, :LPOVERLAPPED

DETACH_VIRTUAL_DISK_FLAG typedef SDWORD
DETACH_VIRTUAL_DISK_FLAG_NONE equ 0

DetachVirtualDisk proto WINAPI :HANDLE, :DETACH_VIRTUAL_DISK_FLAG, :ULONG
GetVirtualDiskPhysicalPath proto WINAPI :HANDLE, :PULONG, :PWSTR
GetAllAttachedVirtualDiskPhysicalPaths proto WINAPI :PULONG, :PWSTR

DEPENDENT_DISK_FLAG	typedef SDWORD
DEPENDENT_DISK_FLAG_NONE equ 0
DEPENDENT_DISK_FLAG_MULT_BACKING_FILES equ 0x1
DEPENDENT_DISK_FLAG_FULLY_ALLOCATED equ 0x2
DEPENDENT_DISK_FLAG_READ_ONLY equ 0x4
DEPENDENT_DISK_FLAG_REMOTE equ 0x8
DEPENDENT_DISK_FLAG_SYSTEM_VOLUME equ 0x10
DEPENDENT_DISK_FLAG_SYSTEM_VOLUME_PARENT equ 0x20
DEPENDENT_DISK_FLAG_REMOVABLE equ 0x40
DEPENDENT_DISK_FLAG_NO_DRIVE_LETTER equ 0x80
DEPENDENT_DISK_FLAG_PARENT equ 0x100
DEPENDENT_DISK_FLAG_NO_HOST_DISK equ 0x200
DEPENDENT_DISK_FLAG_PERMANENT_LIFETIME equ 0x400

STORAGE_DEPENDENCY_INFO_VERSION typedef SDWORD
STORAGE_DEPENDENCY_INFO_VERSION_UNSPECIFIED equ 0
STORAGE_DEPENDENCY_INFO_VERSION_1 equ 1
STORAGE_DEPENDENCY_INFO_VERSION_2 equ 2

STORAGE_DEPENDENCY_INFO_TYPE_1 STRUC
DependencyTypeFlags	DEPENDENT_DISK_FLAG ?
ProviderSpecificFlags	ULONG ?
VirtualStorageType	VIRTUAL_STORAGE_TYPE ?
STORAGE_DEPENDENCY_INFO_TYPE_1 ENDS
PSTORAGE_DEPENDENCY_INFO_TYPE_1 typedef ptr STORAGE_DEPENDENCY_INFO_TYPE_1

STORAGE_DEPENDENCY_INFO_TYPE_2 STRUC
DependencyTypeFlags	DEPENDENT_DISK_FLAG ?
ProviderSpecificFlags	ULONG ?
VirtualStorageType	VIRTUAL_STORAGE_TYPE ?
AncestorLevel		ULONG ?
DependencyDeviceName	PWSTR ?
HostVolumeName		PWSTR ?
DependentVolumeName	PWSTR ?
DependentVolumeRelativePath PWSTR ?
STORAGE_DEPENDENCY_INFO_TYPE_2 ENDS
PSTORAGE_DEPENDENCY_INFO_TYPE_2 typedef ptr STORAGE_DEPENDENCY_INFO_TYPE_2

STORAGE_DEPENDENCY_INFO STRUC
Version			STORAGE_DEPENDENCY_INFO_VERSION ?
NumberEntries		ULONG ?
UNION
 Version1Entries	STORAGE_DEPENDENCY_INFO_TYPE_1 1 dup(?)
 Version2Entries	STORAGE_DEPENDENCY_INFO_TYPE_2 1 dup(?)
ENDS
STORAGE_DEPENDENCY_INFO ENDS

PSTORAGE_DEPENDENCY_INFO typedef ptr STORAGE_DEPENDENCY_INFO

GET_STORAGE_DEPENDENCY_FLAG typedef SDWORD
GET_STORAGE_DEPENDENCY_FLAG_NONE equ 0
GET_STORAGE_DEPENDENCY_FLAG_HOST_VOLUMES equ 0x1
GET_STORAGE_DEPENDENCY_FLAG_DISK_HANDLE equ 0x2

GetStorageDependencyInformation proto WINAPI :HANDLE, :GET_STORAGE_DEPENDENCY_FLAG, :ULONG, :PSTORAGE_DEPENDENCY_INFO, :PULONG

GET_VIRTUAL_DISK_INFO_VERSION typedef SDWORD
GET_VIRTUAL_DISK_INFO_UNSPECIFIED equ 0
GET_VIRTUAL_DISK_INFO_SIZE equ 1
GET_VIRTUAL_DISK_INFO_IDENTIFIER equ 2
GET_VIRTUAL_DISK_INFO_PARENT_LOCATION equ 3
GET_VIRTUAL_DISK_INFO_PARENT_IDENTIFIER equ 4
GET_VIRTUAL_DISK_INFO_PARENT_TIMESTAMP equ 5
GET_VIRTUAL_DISK_INFO_VIRTUAL_STORAGE_TYPE equ 6
GET_VIRTUAL_DISK_INFO_PROVIDER_SUBTYPE equ 7
GET_VIRTUAL_DISK_INFO_IS_4K_ALIGNED equ 8
GET_VIRTUAL_DISK_INFO_PHYSICAL_DISK equ 9
GET_VIRTUAL_DISK_INFO_VHD_PHYSICAL_SECTOR_SIZE equ 10
GET_VIRTUAL_DISK_INFO_SMALLEST_SAFE_VIRTUAL_SIZE equ 11
GET_VIRTUAL_DISK_INFO_FRAGMENTATION equ 12
GET_VIRTUAL_DISK_INFO_IS_LOADED equ 13
GET_VIRTUAL_DISK_INFO_VIRTUAL_DISK_ID equ 14

GET_VIRTUAL_DISK_INFO	STRUC
Version			GET_VIRTUAL_DISK_INFO_VERSION ?
UNION
 STRUC Size
  VirtualSize		ULONGLONG ?
  PhysicalSize		ULONGLONG ?
  BlockSize		ULONG ?
  SectorSize		ULONG ?
 ENDS
 Identifier		GUID <>
 STRUC ParentLocation
  ParentResolved	BOOL ?
  ParentLocationBuffer	WCHAR 1 dup(?)
 ENDS
 ParentIdentifier	GUID <>
 ParentTimestamp	ULONG ?
 VirtualStorageType	VIRTUAL_STORAGE_TYPE ?
 ProviderSubtype	ULONG ?
 Is4kAligned		BOOL ?
 IsLoaded		BOOL ?
 STRUC PhysicalDisk
  LogicalSectorSize	ULONG ?
  PhysicalSectorSize	ULONG ?
  IsRemote		BOOL ?
 ENDS
 VhdPhysicalSectorSize	ULONG ?
 SmallestSafeVirtualSize ULONGLONG ?
 FragmentationPercentage ULONG ?
 VirtualDiskId		GUID <>
ENDS
GET_VIRTUAL_DISK_INFO	ENDS
PGET_VIRTUAL_DISK_INFO	typedef ptr GET_VIRTUAL_DISK_INFO

GetVirtualDiskInformation proto WINAPI :HANDLE, :PULONG, :PGET_VIRTUAL_DISK_INFO, :PULONG

SET_VIRTUAL_DISK_INFO_VERSION typedef SDWORD
SET_VIRTUAL_DISK_INFO_UNSPECIFIED equ 0
SET_VIRTUAL_DISK_INFO_PARENT_PATH equ 1
SET_VIRTUAL_DISK_INFO_IDENTIFIER equ 2
SET_VIRTUAL_DISK_INFO_PARENT_PATH_WITH_DEPTH equ 3
SET_VIRTUAL_DISK_INFO_PHYSICAL_SECTOR_SIZE equ 4
SET_VIRTUAL_DISK_INFO_VIRTUAL_DISK_ID equ 5

SET_VIRTUAL_DISK_INFO	STRUC
Version			SET_VIRTUAL_DISK_INFO_VERSION ?
UNION
 ParentFilePath		PCWSTR ?
 UniqueIdentifier	GUID <>
 STRUC ParentPathWithDepthInfo
  ChildDepth		ULONG ?
  ParentFilePath	PCWSTR ?
 ENDS
 VhdPhysicalSectorSize	ULONG ?
 VirtualDiskId		GUID <>
ENDS
SET_VIRTUAL_DISK_INFO	ENDS

PSET_VIRTUAL_DISK_INFO	typedef ptr SET_VIRTUAL_DISK_INFO

SetVirtualDiskInformation proto WINAPI :HANDLE, :PSET_VIRTUAL_DISK_INFO
EnumerateVirtualDiskMetadata proto WINAPI :HANDLE, :PULONG, :ptr
GetVirtualDiskMetadata proto WINAPI :HANDLE, :ptr, :PULONG, :ptr
SetVirtualDiskMetadata proto WINAPI :HANDLE, :ptr, :ULONG, :ptr
DeleteVirtualDiskMetadata proto WINAPI :HANDLE, :ptr

VIRTUAL_DISK_PROGRESS	STRUC
OperationStatus		dd ?
CurrentValue		ULONGLONG ?
CompletionValue		ULONGLONG ?
VIRTUAL_DISK_PROGRESS	ENDS

PVIRTUAL_DISK_PROGRESS	typedef ptr VIRTUAL_DISK_PROGRESS

GetVirtualDiskOperationProgress proto WINAPI :HANDLE, :LPOVERLAPPED, :PVIRTUAL_DISK_PROGRESS

COMPACT_VIRTUAL_DISK_VERSION typedef SDWORD
COMPACT_VIRTUAL_DISK_VERSION_UNSPECIFIED equ 0
COMPACT_VIRTUAL_DISK_VERSION_1 equ 1

COMPACT_VIRTUAL_DISK_PARAMETERS STRUC
Version			COMPACT_VIRTUAL_DISK_VERSION ?
UNION
 STRUC Version1
  Reserved		ULONG ?
 ENDS
ENDS
COMPACT_VIRTUAL_DISK_PARAMETERS ENDS

PCOMPACT_VIRTUAL_DISK_PARAMETERS typedef ptr COMPACT_VIRTUAL_DISK_PARAMETERS

COMPACT_VIRTUAL_DISK_FLAG typedef SDWORD
COMPACT_VIRTUAL_DISK_FLAG_NONE equ 0
COMPACT_VIRTUAL_DISK_FLAG_NO_ZERO_SCAN equ 0x1
COMPACT_VIRTUAL_DISK_FLAG_NO_BLOCK_MOVES equ 0x2

CompactVirtualDisk proto WINAPI :HANDLE, :COMPACT_VIRTUAL_DISK_FLAG, :PCOMPACT_VIRTUAL_DISK_PARAMETERS, :LPOVERLAPPED

MERGE_VIRTUAL_DISK_VERSION typedef SDWORD
MERGE_VIRTUAL_DISK_VERSION_UNSPECIFIED equ 0
MERGE_VIRTUAL_DISK_VERSION_1 equ 1
MERGE_VIRTUAL_DISK_VERSION_2 equ 2

MERGE_VIRTUAL_DISK_PARAMETERS STRUC
Version			MERGE_VIRTUAL_DISK_VERSION ?
UNION
 STRUC Version1
  MergeDepth		ULONG ?
 ENDS
 STRUC Version2
  MergeSourceDepth	ULONG ?
  MergeTargetDepth	ULONG ?
 ENDS
ENDS
MERGE_VIRTUAL_DISK_PARAMETERS ENDS

PMERGE_VIRTUAL_DISK_PARAMETERS typedef ptr MERGE_VIRTUAL_DISK_PARAMETERS

MERGE_VIRTUAL_DISK_FLAG typedef SDWORD
MERGE_VIRTUAL_DISK_FLAG_NONE equ 0

MergeVirtualDisk proto WINAPI :HANDLE, :MERGE_VIRTUAL_DISK_FLAG, :PMERGE_VIRTUAL_DISK_PARAMETERS, :LPOVERLAPPED

EXPAND_VIRTUAL_DISK_VERSION typedef SDWORD
EXPAND_VIRTUAL_DISK_VERSION_UNSPECIFIED equ 0
EXPAND_VIRTUAL_DISK_VERSION_1 equ 1

EXPAND_VIRTUAL_DISK_PARAMETERS STRUC
Version			EXPAND_VIRTUAL_DISK_VERSION ?
UNION
 STRUC Version1
  NewSize		ULONGLONG ?
 ENDS
ENDS
EXPAND_VIRTUAL_DISK_PARAMETERS ENDS

PEXPAND_VIRTUAL_DISK_PARAMETERS typedef ptr EXPAND_VIRTUAL_DISK_PARAMETERS

EXPAND_VIRTUAL_DISK_FLAG typedef SDWORD
EXPAND_VIRTUAL_DISK_FLAG_NONE equ 0

ExpandVirtualDisk proto WINAPI :HANDLE, :EXPAND_VIRTUAL_DISK_FLAG, :PEXPAND_VIRTUAL_DISK_PARAMETERS, :LPOVERLAPPED

RESIZE_VIRTUAL_DISK_VERSION typedef SDWORD
RESIZE_VIRTUAL_DISK_VERSION_UNSPECIFIED equ 0
RESIZE_VIRTUAL_DISK_VERSION_1 equ 1

RESIZE_VIRTUAL_DISK_PARAMETERS STRUC
Version			RESIZE_VIRTUAL_DISK_VERSION ?
UNION
 STRUC Version1
  NewSize		 ULONGLONG ?
 ENDS
ENDS
RESIZE_VIRTUAL_DISK_PARAMETERS ENDS

PRESIZE_VIRTUAL_DISK_PARAMETERS typedef ptr RESIZE_VIRTUAL_DISK_PARAMETERS

RESIZE_VIRTUAL_DISK_FLAG typedef SDWORD
RESIZE_VIRTUAL_DISK_FLAG_NONE equ 0
RESIZE_VIRTUAL_DISK_FLAG_ALLOW_UNSAFE_VIRTUAL_SIZE equ 0x1
RESIZE_VIRTUAL_DISK_FLAG_RESIZE_TO_SMALLEST_SAFE_VIRTUAL_SIZE equ 0x2

ResizeVirtualDisk proto WINAPI :HANDLE, :RESIZE_VIRTUAL_DISK_FLAG, :PRESIZE_VIRTUAL_DISK_PARAMETERS, :LPOVERLAPPED

MIRROR_VIRTUAL_DISK_VERSION typedef SDWORD
MIRROR_VIRTUAL_DISK_VERSION_UNSPECIFIED equ 0
MIRROR_VIRTUAL_DISK_VERSION_1 equ 1

MIRROR_VIRTUAL_DISK_PARAMETERS STRUC
Version			MIRROR_VIRTUAL_DISK_VERSION ?
UNION
 STRUC Version1
  MirrorVirtualDiskPath	 PCWSTR ?
 ENDS
ENDS
MIRROR_VIRTUAL_DISK_PARAMETERS ENDS

PMIRROR_VIRTUAL_DISK_PARAMETERS typedef ptr MIRROR_VIRTUAL_DISK_PARAMETERS

MIRROR_VIRTUAL_DISK_FLAG typedef SDWORD
MIRROR_VIRTUAL_DISK_FLAG_NONE equ 0
MIRROR_VIRTUAL_DISK_FLAG_EXISTING_FILE equ 0x1

MirrorVirtualDisk proto WINAPI :HANDLE, :MIRROR_VIRTUAL_DISK_FLAG, :PMIRROR_VIRTUAL_DISK_PARAMETERS, :LPOVERLAPPED
BreakMirrorVirtualDisk proto WINAPI :HANDLE
AddVirtualDiskParent proto WINAPI :HANDLE, :PCWSTR

SURFACE_VIRTUAL_DISK_FLAG typedef SDWORD
SURFACE_VIRTUAL_DISK_FLAG_NONE equ 0
SURFACE_VIRTUAL_DISK_FLAG_READ_ONLY equ 0x1
SURFACE_VIRTUAL_DISK_FLAG_NO_DRIVE_LETTER equ 0x2
SURFACE_VIRTUAL_DISK_FLAG_PERMANENT_LIFETIME equ 0x4
SURFACE_VIRTUAL_DISK_FLAG_NO_LOCAL_HOST equ 0x8

UNSURFACE_VIRTUAL_DISK_FLAG typedef SDWORD
UNSURFACE_VIRTUAL_DISK_FLAG_NONE equ 0

else ;;defined(VDS_MIDL_PASS)
include virtdisk.inc
endif ;;defined(VDS_MIDL_PASS)
endif ;; _WIN32_WINNT_WIN7
endif ;; WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)

endif
