<div class="content" name="Eject" uuid="b8dfa5d0-54a1-4c2a-98dd-58d4808c7c6a"><p>The Eject method ejects the media in the drive. </p><dl>
<dd>
<div><pre> HRESULT Eject();
</pre></div>
</dd></dl><p>This method has no parameters.</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 perform the
following:</p><ul><li><p><span><span> 
</span></span>Attempt to eject the media in the <a href="8eef5d42-22d7-4302-aed9-12face91505a#gt_58aae236-0186-4ba1-a46b-f0a997e6c6f2" data-linktype="relative-path">removable media</a> drive.</p>
</li><li><p><span><span> 
</span></span>For each callback object that is registered in the list of callback
objects, call the callback object&#39;s IVdsAdviseSink::OnNotify (Opnum 3) method
with a <a href="4f29057f-ab32-4a3d-9fcb-00ba3457cb42" data-linktype="relative-path">VDS_NOTIFICATION</a>
structure with the following attributes:</p>
<ul><li><p><span><span>  </span></span><b>objectType</b>
member is VDS_NTT_VOLUME.</p>
</li><li><p><span><span>  </span></span><b>Volume</b>
member is a <a href="410540de-982d-4db1-991e-a73efed4e6f0" data-linktype="relative-path">VDS_VOLUME_NOTIFICATION</a>
with the following attributes:</p>
<ul><li><p><span><span> 
</span></span><b>ulEvent</b> is VDS_NF_VOLUME_MODIFY.</p>
</li><li><p><span><span> 
</span></span><b>volumeId</b> is the <a href="9186f1ce-04de-4df2-a8cf-3925a02fcd47" data-linktype="relative-path">VDS_OBJECT_ID</a> of the <a href="8eef5d42-22d7-4302-aed9-12face91505a#gt_9a876829-33a1-4f0b-8b81-8552b7e5561c" data-linktype="relative-path">volume</a> object corresponding
to the removable media drive.</p>
</li><li><p><span><span> 
</span></span><b>plexId</b> is <a href="8eef5d42-22d7-4302-aed9-12face91505a#gt_ba500a5b-8c29-467c-a335-0980c8b11304" data-linktype="relative-path">NULL GUID</a>, but it is not
relevant when ulEvent is VDS_NF_VOLUME_MODIFY.</p>
</li><li><p><span><span> 
</span></span><b>ulPercentCompleted</b> is from 0-100 and is
implementation-specific; however, it is not relevant when ulEvent is
VDS_NF_VOLUME_MODIFY.</p>
</li></ul></li></ul></li><li><p><span><span> 
</span></span>If media was present in the drive, for each callback object that
is registered in the list of callback objects, the server MUST call the
callback object&#39;s <a href="04a70bf6-208d-463a-b0a4-cc96e198ded1" data-linktype="relative-path">IVdsAdviseSink::OnNotify</a>
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_DISK.</p>
</li><li><p><span><span>  </span></span><b>Disk</b>
member is <a href="1478f791-1ebd-421c-ba87-5fd7493dafd1" data-linktype="relative-path">VDS_DISK_NOTIFICATION</a>
that has the following attributes:</p>
<ul><li><p><span><span> 
</span></span><b>ulEvent</b> is VDS_NF_DISK_MODIFY.</p>
</li><li><p><span><span> 
</span></span><b>diskId</b> is the VDS_OBJECT_ID of the <a href="8eef5d42-22d7-4302-aed9-12face91505a#gt_c4133b2a-a990-4042-ba44-7fda3090f118" data-linktype="relative-path">disk</a> object corresponding
to the removable media drive.</p>
</li></ul></li></ul></li><li><p><span><span> 
</span></span>Return an HRESULT indicating failure or success.</p>
</li></ul></div>