3.4.5.2.17.5 IVdsVdProvider::GetVDiskFromDisk (Opnum 7)

The GetVDiskFromDisk method returns an IVdsVDisk (section 3.1.15.1) interface pointer for the virtual disk given an IVdsDisk (section 3.1.12.1) interface pointer.

 HRESULT GetVDiskFromDisk(
   [in] IVdsDisk* pDisk,
   [out] IVdsVDisk** ppVDisk
 );

pDisk: The IVdsDisk interface pointer to a disk.

ppVDisk: Pointer to a variable that receives an IVdsVDisk 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 pDisk is not NULL.

  • Verify that ppVDisk is not NULL.

The server MUST find the cached virtual disk object that corresponds to the passed in disk. If the virtual disk object is found, the server MUST set ppVDisk 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.