Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define VIRTUAL_STORAGE_TYPE_DEVICE_VHDSET 4
- // This flag causes a Vhd Set file to be opened without any virtual disk.
- OPEN_VIRTUAL_DISK_FLAG_VHDSET_FILE_ONLY = 0x00000040,
- part of enum _OPEN_VIRTUAL_DISK_FLAG
- // Flags for CreateVirtualDisk
- typedef enum _CREATE_VIRTUAL_DISK_FLAG
- {
- CREATE_VIRTUAL_DISK_FLAG_NONE = 0x0,
- // Pre-allocate all physical space necessary for the virtual
- // size of the disk (e.g. a fixed VHD).
- CREATE_VIRTUAL_DISK_FLAG_FULL_PHYSICAL_ALLOCATION = 0x1,
- // Take ownership of the source disk during create from source disk, to
- // insure the source disk does not change during the create operation. The
- // source disk must also already be offline or read-only (or both).
- // Ownership is released when create is done. This also has a side-effect
- // of disallowing concurrent create from same source disk. Create will fail
- // if ownership cannot be obtained or if the source disk is not already
- // offline or read-only. This flag is optional, but highly recommended for
- // creates from source disk. No effect for other types of create (no effect
- // for create from source VHD; no effect for create without SourcePath).
- CREATE_VIRTUAL_DISK_FLAG_PREVENT_WRITES_TO_SOURCE_DISK = 0x2,
- // Do not copy initial virtual disk metadata or block states from the
- // parent VHD; this is useful if the parent VHD is a stand-in file and the
- // real parent will be explicitly set later.
- CREATE_VIRTUAL_DISK_FLAG_DO_NOT_COPY_METADATA_FROM_PARENT = 0x4,
- // Create the backing storage disk.
- CREATE_VIRTUAL_DISK_FLAG_CREATE_BACKING_STORAGE = 0x8,
- // If set, the SourceLimitPath is an change tracking ID, and all data that has changed
- // since that change tracking ID will be copied from the source. If clear, the
- // SourceLimitPath is a VHD file path in the source VHD's chain, and
- // all data that is present in the children of that VHD in the chain
- // will be copied from the source.
- CREATE_VIRTUAL_DISK_FLAG_USE_CHANGE_TRACKING_SOURCE_LIMIT = 0x10,
- // If set and the parent VHD has change tracking enabled, the child will
- // have change tracking enabled and will recognize all change tracking
- // IDs that currently exist in the parent. If clear or if the parent VHD
- // does not have change tracking available, then change tracking will
- // not be enabled in the new VHD.
- CREATE_VIRTUAL_DISK_FLAG_PRESERVE_PARENT_CHANGE_TRACKING_STATE = 0x20,
- } CREATE_VIRTUAL_DISK_FLAG;
- #define CREATE_VIRTUAL_DISK_FLAG_USE_RCT_SOURCE_LIMIT CREATE_VIRTUAL_DISK_FLAG_USE_CHANGE_TRACKING_SOURCE_LIMIT
- typedef struct _QUERY_CHANGES_VIRTUAL_DISK_RANGE {
- ULONG64 ByteOffset;
- ULONG64 ByteLength;
- ULONG64 Reserved;
- } QUERY_CHANGES_VIRTUAL_DISK_RANGE, *PQUERY_CHANGES_VIRTUAL_DISK_RANGE;
- // Flags for QueryChangesVirtualDisk
- typedef enum _QUERY_CHANGES_VIRTUAL_DISK_FLAG
- {
- QUERY_CHANGES_VIRTUAL_DISK_FLAG_NONE = 0x00000000,
- } QUERY_CHANGES_VIRTUAL_DISK_FLAG;
- #ifdef DEFINE_ENUM_FLAG_OPERATORS
- DEFINE_ENUM_FLAG_OPERATORS(QUERY_CHANGES_VIRTUAL_DISK_FLAG);
- #endif
- typedef enum _TAKE_SNAPSHOT_VHDSET_FLAG
- {
- TAKE_SNAPSHOT_VHDSET_FLAG_NONE = 0x00000000,
- } TAKE_SNAPSHOT_VHDSET_FLAG, *PTAKE_SNAPSHOT_VHDSET_FLAG;
- #ifdef DEFINE_ENUM_FLAG_OPERATORS
- DEFINE_ENUM_FLAG_OPERATORS(TAKE_SNAPSHOT_VHDSET_FLAG);
- #endif
- typedef enum _TAKE_SNAPSHOT_VHDSET_VERSION
- {
- TAKE_SNAPSHOT_VHDSET_VERSION_UNSPECIFIED = 0,
- TAKE_SNAPSHOT_VHDSET_VERSION_1 = 1,
- } TAKE_SNAPSHOT_VHDSET_VERSION;
- typedef struct _TAKE_SNAPSHOT_VHDSET_PARAMETERS
- {
- TAKE_SNAPSHOT_VHDSET_VERSION Version;
- union
- {
- struct
- {
- GUID SnapshotId;
- } Version1;
- };
- } TAKE_SNAPSHOT_VHDSET_PARAMETERS, *PTAKE_SNAPSHOT_VHDSET_PARAMETERS;
- typedef enum _DELETE_SNAPSHOT_VHDSET_FLAG
- {
- DELETE_SNAPSHOT_VHDSET_FLAG_NONE = 0x00000000,
- DELETE_SNAPSHOT_VHDSET_FLAG_PERSIST_RCT = 0x00000001,
- } DELETE_SNAPSHOT_VHDSET_FLAG, *PDELETE_SNAPSHOT_VHDSET_FLAG;
- #ifdef DEFINE_ENUM_FLAG_OPERATORS
- DEFINE_ENUM_FLAG_OPERATORS(DELETE_SNAPSHOT_VHDSET_FLAG);
- #endif
- typedef enum _DELETE_SNAPSHOT_VHDSET_VERSION
- {
- DELETE_SNAPSHOT_VHDSET_VERSION_UNSPECIFIED = 0,
- DELETE_SNAPSHOT_VHDSET_VERSION_1 = 1,
- } DELETE_SNAPSHOT_VHDSET_VERSION;
- typedef struct _DELETE_SNAPSHOT_VHDSET_PARAMETERS
- {
- DELETE_SNAPSHOT_VHDSET_VERSION Version;
- union
- {
- struct
- {
- GUID SnapshotId;
- } Version1;
- };
- } DELETE_SNAPSHOT_VHDSET_PARAMETERS, *PDELETE_SNAPSHOT_VHDSET_PARAMETERS;
- #if (NTDDI_VERSION >= NTDDI_WINTHRESHOLD)
- DWORD
- WINAPI
- QueryChangesVirtualDisk (
- _In_ HANDLE VirtualDiskHandle,
- _In_ PCWSTR ChangeTrackingId,
- _In_ ULONG64 ByteOffset,
- _In_ ULONG64 ByteLength,
- _In_ QUERY_CHANGES_VIRTUAL_DISK_FLAG Flags,
- _Out_writes_to_(*RangeCount, *RangeCount) PQUERY_CHANGES_VIRTUAL_DISK_RANGE Ranges,
- _Inout_ PULONG RangeCount,
- _Out_ PULONG64 ProcessedLength
- );
- DWORD
- WINAPI
- TakeSnapshotVhdSet (
- _In_ HANDLE VirtualDiskHandle,
- _In_ const PTAKE_SNAPSHOT_VHDSET_PARAMETERS Parameters,
- _In_ TAKE_SNAPSHOT_VHDSET_FLAG Flags
- );
- DWORD
- WINAPI
- DeleteSnapshotVhdSet (
- _In_ HANDLE VirtualDiskHandle,
- _In_ const PDELETE_SNAPSHOT_VHDSET_PARAMETERS Parameters,
- _In_ DELETE_SNAPSHOT_VHDSET_FLAG Flags
- );
- #endif // NTDDI_VERSION >= NTDDI_WINTHRESHOLD
- typedef enum _MODIFY_VHDSET_VERSION
- {
- MODIFY_VHDSET_UNSPECIFIED = 0,
- MODIFY_VHDSET_SNAPSHOT_PATH = 1,
- MODIFY_VHDSET_REMOVE_SNAPSHOT = 2,
- MODIFY_VHDSET_DEFAULT_SNAPSHOT_PATH = 3,
- } MODIFY_VHDSET_VERSION, *PMODIFY_VHDSET_VERSION;
- typedef enum _MODIFY_VHDSET_FLAG
- {
- MODIFY_VHDSET_FLAG_NONE = 0x00000000,
- } MODIFY_VHDSET_FLAG, *PMODIFY_VHDSET_FLAG;
- #ifdef DEFINE_ENUM_FLAG_OPERATORS
- DEFINE_ENUM_FLAG_OPERATORS(MODIFY_VHDSET_FLAG);
- #endif
- typedef struct _MODIFY_VHDSET_PARAMETERS
- {
- MODIFY_VHDSET_VERSION Version;
- union
- {
- struct
- {
- GUID SnapshotId;
- PCWSTR SnapshotFilePath;
- } SnapshotPath;
- GUID SnapshotId;
- PCWSTR DefaultFilePath;
- };
- } MODIFY_VHDSET_PARAMETERS, *PMODIFY_VHDSET_PARAMETERS;
- #if (NTDDI_VERSION >= NTDDI_WINTHRESHOLD)
- DWORD
- WINAPI
- ModifyVhdSet (
- _In_ HANDLE VirtualDiskHandle,
- _In_ const PMODIFY_VHDSET_PARAMETERS Parameters,
- _In_ MODIFY_VHDSET_FLAG Flags
- );
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement