<div class="content" name="GetDiskObject" uuid="68821984-0f1e-4949-ac5f-cc2c829ee6c5"><p>The GetDiskObject method<a id="Appendix_A_Target_75"></a><a aria-label="Product behavior note 75" href="6b2552ee-ba27-409f-99a8-18841573327a#Appendix_A_75" data-linktype="relative-path">&lt;75&gt;</a> returns
the disk for the given PnP Device ID string.</p><dl>
<dd>
<div><pre> HRESULT GetDiskObject(
   [in, string] LPCWSTR pwszDeviceID,
   [out] IUnknown** ppDiskUnk
 );
</pre></div>
</dd></dl><p><b>pwszDeviceID: </b>The null-terminated Unicode
device path that the operating system uses to identify the device for the disk.</p><p><b>ppDiskUnk: </b>A pointer to a variable that
receives an <b>IUnknown</b> interface pointer. Callers MUST release the
interface pointer when it is no longer needed by calling the <b>IUnknown::Release</b>
method.</p><p><b>Return Values: </b>The method MUST return zero or
a non-error <a href="8eef5d42-22d7-4302-aed9-12face91505a#gt_799103ab-b3cb-4eab-8c55-322821b2b235" data-linktype="relative-path">HRESULT</a>, as
specified in <a href="../ms-erref/1bc92ddf-b79e-413c-bbaa-99a5281a6c90" data-linktype="relative-path">[MS-ERREF]</a>,
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 <a href="5102cc53-3143-4268-ba4c-6ea39e999ab4" data-linktype="relative-path">2.2.3</a>.</p><p>When the server receives this message, it MUST validate the
following parameters: </p><ul><li><p><span><span> 
</span></span>Verify that pwszDeviceID is not NULL.</p>
</li><li><p><span><span> 
</span></span>Verify that ppDiskUnk is not NULL.</p>
</li></ul><p>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 <i>ppDiskUnk</i> 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.</p></div>