QueryChangesVirtualDisk function (virtdisk.h)

Retrieves information about changes to the specified areas of a virtual hard disk (VHD) that are tracked by resilient change tracking (RCT).

Syntax

DWORD QueryChangesVirtualDisk(
  [in]      HANDLE                            VirtualDiskHandle,
  [in]      PCWSTR                            ChangeTrackingId,
  [in]      ULONG64                           ByteOffset,
  [in]      ULONG64                           ByteLength,
  [in]      QUERY_CHANGES_VIRTUAL_DISK_FLAG   Flags,
  [out]     PQUERY_CHANGES_VIRTUAL_DISK_RANGE Ranges,
  [in, out] PULONG                            RangeCount,
  [out]     PULONG64                          ProcessedLength
);

Parameters

[in] VirtualDiskHandle

A handle to the open VHD, which must have been opened using the VIRTUAL_DISK_ACCESS_GET_INFO flag set in the VirtualDiskAccessMask parameter to the OpenVirtualDisk function. For information on how to open a VHD, see the OpenVirtualDisk function.

[in] ChangeTrackingId

A pointer to a string that specifies the change tracking identifier for the change that identifies the state of the virtual disk that you want to use as the basis of comparison to determine whether the specified area of the VHD has changed.

[in] ByteOffset

An unsigned long integer that specifies the distance from the start of the VHD to the beginning of the area of the VHD that you want to check for changes, in bytes.

[in] ByteLength

An unsigned long integer that specifies the length of the area of the VHD that you want to check for changes, in bytes.

[in] Flags

Reserved. Set to QUERY_CHANGES_VIRTUAL_DISK_FLAG_NONE.

[out] Ranges

An array of QUERY_CHANGES_VIRTUAL_DISK_RANGE structures that indicates the areas of the virtual disk within the area that the ByteOffset and ByteLength parameters specify that have changed since the change tracking identifier that the ChangeTrackingId parameter specifies was sealed.

[in, out] RangeCount

An address of an unsigned long integer. On input, the value indicates the number of QUERY_CHANGES_VIRTUAL_DISK_RANGE structures that the array that the Ranges parameter points to can hold. On output, the value contains the number of QUERY_CHANGES_VIRTUAL_DISK_RANGE structures that the method placed in the array.

[out] ProcessedLength

A pointer to an unsigned long integer that indicates the total number of bytes that the method processed, which indicates for how much of the area that the BytesLength parameter specifies that changes were captured in the available space of the array that the Ranges parameter specifies.

Return value

The status of the request.

If the function succeeds, the return value is ERROR_SUCCESS and the Ranges parameter contains the requested information.

If the function fails, the return value is an error code. For more information, see System Error Codes.

Requirements

Requirement Value
Minimum supported client Windows 10 [desktop apps only]
Minimum supported server Windows Server 2016
Target Platform Windows
Header virtdisk.h
Library VirtDisk.lib
DLL VirtDisk.dll

See also

About VHD

QUERY_CHANGES_VIRTUAL_DISK_RANGE

VHD Reference