typedef enum _VIRTUAL_DISK_ACCESS_MASK {
  VIRTUAL_DISK_ACCESS_NONE,
  VIRTUAL_DISK_ACCESS_ATTACH_RO,
  VIRTUAL_DISK_ACCESS_ATTACH_RW,
  VIRTUAL_DISK_ACCESS_DETACH,
  VIRTUAL_DISK_ACCESS_GET_INFO,
  VIRTUAL_DISK_ACCESS_CREATE,
  VIRTUAL_DISK_ACCESS_METAOPS,
  VIRTUAL_DISK_ACCESS_READ,
  VIRTUAL_DISK_ACCESS_ALL,
  VIRTUAL_DISK_ACCESS_WRITABLE
} VIRTUAL_DISK_ACCESS_MASK;


typedef enum _OPEN_VIRTUAL_DISK_FLAG {
  OPEN_VIRTUAL_DISK_FLAG_NONE,
  OPEN_VIRTUAL_DISK_FLAG_NO_PARENTS,
  OPEN_VIRTUAL_DISK_FLAG_BLANK_FILE,
  OPEN_VIRTUAL_DISK_FLAG_BOOT_DRIVE,
  OPEN_VIRTUAL_DISK_FLAG_CACHED_IO,
  OPEN_VIRTUAL_DISK_FLAG_CUSTOM_DIFF_CHAIN,
  OPEN_VIRTUAL_DISK_FLAG_PARENT_CACHED_IO,
  OPEN_VIRTUAL_DISK_FLAG_VHDSET_FILE_ONLY,
  OPEN_VIRTUAL_DISK_FLAG_IGNORE_RELATIVE_PARENT_LOCATOR,
  OPEN_VIRTUAL_DISK_FLAG_NO_WRITE_HARDENING
} OPEN_VIRTUAL_DISK_FLAG;

typedef enum _ATTACH_VIRTUAL_DISK_FLAG {
  ATTACH_VIRTUAL_DISK_FLAG_NONE,
  ATTACH_VIRTUAL_DISK_FLAG_READ_ONLY,
  ATTACH_VIRTUAL_DISK_FLAG_NO_DRIVE_LETTER,
  ATTACH_VIRTUAL_DISK_FLAG_PERMANENT_LIFETIME,
  ATTACH_VIRTUAL_DISK_FLAG_NO_LOCAL_HOST,
  ATTACH_VIRTUAL_DISK_FLAG_NO_SECURITY_DESCRIPTOR,
  ATTACH_VIRTUAL_DISK_FLAG_BYPASS_DEFAULT_ENCRYPTION_POLICY,
  ATTACH_VIRTUAL_DISK_FLAG_NON_PNP,
  ATTACH_VIRTUAL_DISK_FLAG_RESTRICTED_RANGE,
  ATTACH_VIRTUAL_DISK_FLAG_SINGLE_PARTITION,
  ATTACH_VIRTUAL_DISK_FLAG_REGISTER_VOLUME
} ATTACH_VIRTUAL_DISK_FLAG;

typedef enum _OPEN_VIRTUAL_DISK_VERSION {
  OPEN_VIRTUAL_DISK_VERSION_UNSPECIFIED,
  OPEN_VIRTUAL_DISK_VERSION_1,
  OPEN_VIRTUAL_DISK_VERSION_2,
  OPEN_VIRTUAL_DISK_VERSION_3
} OPEN_VIRTUAL_DISK_VERSION;

typedef enum _ATTACH_VIRTUAL_DISK_VERSION {
  ATTACH_VIRTUAL_DISK_VERSION_UNSPECIFIED,
  ATTACH_VIRTUAL_DISK_VERSION_1,
  ATTACH_VIRTUAL_DISK_VERSION_2
} ATTACH_VIRTUAL_DISK_VERSION;

typedef struct _VIRTUAL_STORAGE_TYPE {
  ULONG DeviceId;
  GUID  VendorId;
} VIRTUAL_STORAGE_TYPE, *PVIRTUAL_STORAGE_TYPE;


typedef struct _OPEN_VIRTUAL_DISK_PARAMETERS {
  OPEN_VIRTUAL_DISK_VERSION Version;
  union {
    struct {
      ULONG RWDepth;
    } Version1;
    struct {
      BOOL GetInfoOnly;
      BOOL ReadOnly;
      GUID ResiliencyGuid;
    } Version2;
    struct {
      BOOL GetInfoOnly;
      BOOL ReadOnly;
      GUID ResiliencyGuid;
      GUID SnapshotId;
    } Version3;
  };
} OPEN_VIRTUAL_DISK_PARAMETERS, *POPEN_VIRTUAL_DISK_PARAMETERS;


typedef struct _ATTACH_VIRTUAL_DISK_PARAMETERS {
  ATTACH_VIRTUAL_DISK_VERSION Version;
  union {
    struct {
      ULONG Reserved;
    } Version1;
    struct {
      ULONGLONG RestrictedOffset;
      ULONGLONG RestrictedLength;
    } Version2;
  };
} ATTACH_VIRTUAL_DISK_PARAMETERS, *PATTACH_VIRTUAL_DISK_PARAMETERS;