IVdsVdProvider::GetDiskFromVDisk (Opnum 6)

The GetDiskFromVDisk method returns an IVdsDisk (section interface pointer for a virtual disk given an IVdsVDisk (section interface pointer.

 HRESULT GetDiskFromVDisk(
   [in] IVdsVDisk* pVDisk,
   [out] IVdsDisk** ppDisk

pVDisk: The IVdsVDisk interface pointer for the virtual disk.

ppDisk: Pointer to a variable that receives an IVdsDisk interface pointer. Callers MUST release the interface pointer when it is no longer needed by calling the IUnknown::Release method.

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 pVDisk is not NULL.

  • Verify that ppDisk is not NULL.

The server MUST find the cached disk object that corresponds to the passed in virtual disk. If the disk object is found, the server MUST set ppDisk to point to it, and return an S_OK. If the corresponding disk object is not found, the server MUST return the HRESULT error VDS_E_OBJECT_NOT_FOUND. Note that the virtual disk MUST be attached.