VIRTUAL_DISK_PROGRESS structure (virtdisk.h)

Contains the progress and result data for the current virtual hard disk (VHD) operation, used by the GetVirtualDiskOperationProgress function.

Syntax

typedef struct _VIRTUAL_DISK_PROGRESS {
  DWORD     OperationStatus;
  ULONGLONG CurrentValue;
  ULONGLONG CompletionValue;
} VIRTUAL_DISK_PROGRESS, *PVIRTUAL_DISK_PROGRESS;

Members

OperationStatus

A system error code status value, this member will be ERROR_IO_PENDING if the operation is still in progress; otherwise, the value is the result code of the completed operation.

CurrentValue

The current progress of the operation, used in conjunction with the CompletionValue member.

This value is meaningful only if OperationStatus is ERROR_IO_PENDING.

CompletionValue

The value that the CurrentValue member would be if the operation were complete.

This value is meaningful only if OperationStatus is ERROR_IO_PENDING.

Remarks

The CurrentValue and CompletionValue members are intended to be used for calculating a percentage value, and the specific numeric values of each are not significant in any way. Only the result of the following calculation is meaningful: CurrentValue divided by CompletionValue multiplied by 100 equals percent complete, up to and including 100 percent, even when OperationStatus is still returning ERROR_IO_PENDING. This percentage is not always guaranteed to increase with subsequent calls to the GetVirtualDiskOperationProgress function, and may decrease. These decreased percentages may be safely ignored if progress tracking is desired to be only in the positive by locally storing the current maximum percentage.

The CurrentValue and CompletionValue members can vary in subsequent calls to the GetVirtualDiskOperationProgress function, so they must be used together at the same time from the same call. That is, it is not valid to save either of them locally and then make another call to the GetVirtualDiskOperationProgress function expecting to use either of the previous values with the other value from the more recent call.

The OperationStatus member is the indicator of completion, not the percent-complete calculation described previously. As long as this data member is returning with an ERROR_IO_PENDING status code, the I/O operation is not yet complete.

Requirements

Requirement Value
Minimum supported client Windows 7
Minimum supported server Windows Server 2008 R2
Header virtdisk.h

See also

About VHD

GetVirtualDiskOperationProgress

VHD Reference