<div class="content"><p> </p><p>The DeleteAccessPath method removes the access <span><a href="8eef5d42-22d7-4302-aed9-12face91505a#gt_2cd71385-2d9c-4ab8-bf4a-7b258816d613" data-linktype="relative-path">path</a></span>
from the current <span><a href="8eef5d42-22d7-4302-aed9-12face91505a#gt_9a876829-33a1-4f0b-8b81-8552b7e5561c" data-linktype="relative-path">volume</a></span>.</p><dl>
<dd>
<div><pre> HRESULT DeleteAccessPath(
   [in, max_is(MAX_PATH - 1), string] 
     WCHAR* pwszPath,
   [in] long bForce
 );
</pre></div>
</dd></dl><p><b>pwszPath: </b>A Unicode string indicating the
access path, for example, &#34;C:\myfolder\mydocuments&#34;.</p><p><b>bForce: </b>A Boolean that determines whether an
access is deleted unconditionally, even if the volume is in use. This parameter
is meaningful only when the access path is a <span><a href="8eef5d42-22d7-4302-aed9-12face91505a#gt_1b153cd0-e3f3-4383-bc66-d5ad482c9766" data-linktype="relative-path">drive letter</a></span>.</p><p><b>Return Values: </b>The method MUST return zero or
a non-error <span><a href="8eef5d42-22d7-4302-aed9-12face91505a#gt_799103ab-b3cb-4eab-8c55-322821b2b235" data-linktype="relative-path">HRESULT</a></span> (as
specified in <span><a href="../ms-erref/1bc92ddf-b79e-413c-bbaa-99a5281a6c90" data-linktype="relative-path">[MS-ERREF]</a></span>)
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 <span><a href="5102cc53-3143-4268-ba4c-6ea39e999ab4" data-linktype="relative-path">2.2.3</a></span>.</p><p>When the server receives this message, it MUST validate the
following parameters:</p><ul><li><p><span><span> 
</span></span>Verify that <b>pwszPath</b> is not NULL.</p>
</li><li><p><span><span> 
</span></span>Verify that the access path that <b>pwszPath</b> specifies is an
access point to the volume.</p>
</li></ul><p>The server MUST then perform the following in sequence:<a id="Appendix_A_Target_132"></a><a aria-label="Product behavior note 132" href="6b2552ee-ba27-409f-99a8-18841573327a#Appendix_A_132" data-linktype="relative-path">&lt;132&gt;</a></p><ul><li><p><span><span> 
</span></span>Attempt to get exclusive access to the volume. If the server
fails to get exclusive access to the volume, and the <i>bForce</i> parameter is
not set to a non-zero value, then the server MUST return VDS_E_DEVICE_IN_USE.</p>
</li><li><p><span><span> 
</span></span>Delete the access point from the volume.</p>
</li><li><p><span><span> 
</span></span>If the server determines that a mount point was removed from the
volume, for each callback object that is registered in the list of callback
objects, the server MUST call the callback object&#39;s <span><a href="04a70bf6-208d-463a-b0a4-cc96e198ded1" data-linktype="relative-path">IVdsAdviseSink::OnNotify()</a></span>
method by using a <span><a href="4f29057f-ab32-4a3d-9fcb-00ba3457cb42" data-linktype="relative-path">VDS_NOTIFICATION</a></span>
structure that has the following attributes:</p>
<ul><li><p><span><span>  </span></span><b>objectType</b>
member is VDS_NTT_MOUNT_POINT.</p>
</li><li><p><span><span>  </span></span><b>MountPoint</b>
member is a <span><a href="f794c202-0975-48bd-b5e4-55a6c76579e1" data-linktype="relative-path">VDS_MOUNT_POINT_NOTIFICATION</a></span>
with the following attributes:</p>
<ul><li><p><span><span> 
</span></span><b>ulEvent</b> is VDS_NF_MOUNT_POINTS_CHANGE.</p>
</li><li><p><span><span> 
</span></span><b>volumeId</b> is the <span><a href="9186f1ce-04de-4df2-a8cf-3925a02fcd47" data-linktype="relative-path">VDS_OBJECT_ID</a></span> of
the volume object whose mount point was removed.</p>
</li></ul></li></ul></li><li><p><span><span> 
</span></span>If the server determines that a drive letter was removed from the
volume, for each callback object that is registered in the list of callback
objects, the server MUST call the callback object&#39;s IVdsAdviseSink::OnNotify()
method by using a VDS_NOTIFICATION structure that has the following attributes:</p>
<ul><li><p><span><span>  </span></span><b>objectType</b>
member is VDS_NTT_DRIVE_LETTER.</p>
</li><li><p><span><span>  </span></span><b>Letter</b>
member is a <span><a href="c3e2078f-0a6d-4a58-97f4-3940bada14b3" data-linktype="relative-path">VDS_DRIVE_LETTER_NOTIFICATION</a></span>
that has the following attributes:</p>
<ul><li><p><span><span> 
</span></span><b>ulEvent</b> is VDS_NF_DRIVE_LETTER_FREE.</p>
</li><li><p><span><span> 
</span></span><b>wcLetter</b> is the drive letter that was removed from the
volume.</p>
</li><li><p><span><span> 
</span></span><b>volumeId</b> is the VDS_OBJECT_ID of the volume object whose
drive letter was removed.</p>
</li></ul></li></ul></li><li><p><span><span> 
</span></span>Return an HRESULT indicating failure or success.</p>
</li></ul></div>