3.4.5.2.2.3 IVdsAsync::QueryStatus (Opnum 5)

The QueryStatus method retrieves the status of the asynchronous operation.

 HRESULT QueryStatus(
   [out] HRESULT* pHrResult,
   [out] unsigned long* pulPercentCompleted
 );

pHrResult: A pointer to a variable that receives the HRESULT that signals the current state of the asynchronous operation.

pulPercentCompleted: A pointer to a variable that receives the completion percentage of the asynchronous operation. If the asynchronous operation is in progress, the value MUST be between 0 and 99. If the operation has finished, the value MUST be 100. If the progress of the operation cannot be estimated, the value MUST be 0.

Return Values: The method MUST return zero or a non-error HRESULT (as specified in [MS-ERREF]) to indicate success or return an implementation-specific nonzero error code to indicate failure. For the HRESULT values predefined by the Virtual Disk Service Remote Protocol, see section 2.2.3.

When the server receives this message, it MUST validate the following parameters:

  • Verify that pHrResult is not NULL.

  • Verify that pulPercentCompleted is not NULL.

The server MUST perform the following:

  • Set the pHrResult output parameter based on the return code for the asynchronous operation. If the asynchronous operation is still in progress, this parameter MUST be set to VDS_E_OPERATION_PENDING (HRESULT of 0x00042409).

  • Set the pulPercentCompleted output parameter based on the completion percentage of the asynchronous operation.

  • Return an HRESULT that indicates success or failure for the QueryStatus method.