The Eject method ejects the media in the drive.
HRESULT Eject();
This method has no parameters.
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 perform the following:
Attempt to eject the media in the removable media drive.
For each callback object that is registered in the list of callback objects, call the callback object's IVdsAdviseSink::OnNotify (Opnum 3) method with a VDS_NOTIFICATION structure with the following attributes:
objectType member is VDS_NTT_VOLUME.
Volume member is a VDS_VOLUME_NOTIFICATION with the following attributes:
ulEvent is VDS_NF_VOLUME_MODIFY.
volumeId is the VDS_OBJECT_ID of the volume object corresponding to the removable media drive.
plexId is NULL GUID, but it is not relevant when ulEvent is VDS_NF_VOLUME_MODIFY.
ulPercentCompleted is from 0-100 and is implementation-specific; however, it is not relevant when ulEvent is VDS_NF_VOLUME_MODIFY.
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's IVdsAdviseSink::OnNotify method by using a VDS_NOTIFICATION structure that has the following attributes:
objectType member is VDS_NTT_DISK.
Disk member is VDS_DISK_NOTIFICATION that has the following attributes:
ulEvent is VDS_NF_DISK_MODIFY.
diskId is the VDS_OBJECT_ID of the disk object corresponding to the removable media drive.
Return an HRESULT indicating failure or success.