3.4.5.2.2.2 IVdsAsync::Wait (Opnum 4)

The Wait method blocks and returns when the asynchronous operation has either finished successfully or failed.

 HRESULT Wait(
   [out] HRESULT* pHrResult,
   [out] VDS_ASYNC_OUTPUT* pAsyncOut
 );

pHrResult: A pointer to a variable which, if the Wait method successfully completes, receives the returned HRESULT.

pAsyncOut: A pointer to a VDS_ASYNC_OUTPUT structure that, if the asynchronous operation is successfully completed, receives extra information about the operation, if any information exists. Multiple methods from other interfaces also return async objects. Consult the method that returned the async object to determine what extra information to return, if any. If the asynchronous operation fails, pAsyncOut MAY be left as is without returning any value.

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.

The HRESULT that pHrResult references MUST return zero to indicate success, or an implementation-specific nonzero error code to indicate failure of the asynchronous operation that is associated with the IVdsAsync object.

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

  • Verify that pHrResult is not NULL.

  • Verify that pAsyncOut is not NULL.

The server MUST perform the following:

  • Wait for the asynchronous operation to complete.

  • If the server implements a maximum amount of time to wait for an asynchronous operation to complete, and that maximum time is exceeded, then the server MUST return VDS_E_TIMEOUT. The maximum amount of time is implementation-specific.

  • Set the pHrResult output parameter for the operation based on the return code for the asynchronous operation.

  • If the asynchronous operation has successfully completed, set the pAsyncOut output parameter fields based on the operation type. If the asynchronous operation has failed, this parameter can be left uninitialized.

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