IVdsServiceSw::GetDiskObject (Opnum 3)

The GetDiskObject method<75> returns the disk for the given PnP Device ID string.

 HRESULT GetDiskObject(
   [in, string] LPCWSTR pwszDeviceID,
   [out] IUnknown** ppDiskUnk

pwszDeviceID: The null-terminated Unicode device path that the operating system uses to identify the device for the disk.

ppDiskUnk: A pointer to a variable that receives an IUnknown 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 pwszDeviceID is not NULL.

  • Verify that ppDiskUnk is not NULL.

The server MUST find the cached disk object that corresponds to the passed in unique PNP Device ID string. If the disk object is found, the server MUST set the ppDiskUnk to point to it, and return S_OK. If the corresponding disk object is not found, the server MUST return VDS_E_OBJECT_NOT_FOUND.