on_ejected Event

Fires when the media and virtual disk have been ejected.

Syntax

class CBDiskEjectedEventParams(object):
  @property
  def result_code() -> int: ...
  @result_code.setter
  def result_code(value) -> None: ...

# In class CBDisk:
@property
def on_ejected() -> Callable[[CBDiskEjectedEventParams], None]: ...
@on_ejected.setter
def on_ejected(event_hook: Callable[[CBDiskEjectedEventParams], None]) -> None: ...

Remarks

This event fires when a user has ejected the media and virtual disk using the Eject command in Windows Explorer.

For ejection via the system notification area (tray) to work correctly, the storage_type property must be set to STGT_DISK_PNP, and the storage_characteristics property must include ejection-related flags.

This event is optional; it is provided to give applications a chance to, e.g., free up resources associated with the virtual disk. Since the virtual disk has already been destroyed by the time this event fires, applications must not call unmount_media or delete_storage (the latter is called automatically with its ForceUnmount parameter set to True).

The ResultCode parameter will always be set to the result code returned by the automatic call to delete_storage. If the event cannot be handled in a "successful" manner for some reason (e.g., a resource isn't available, security checks failed, etc.), set it to a non-zero value to report an appropriate error. Please refer to the Error Reporting and Handling topic for more information.

 
 
Copyright (c) 2020 Callback Technologies, Inc. - All rights reserved.
CBFS Disk 2020 Python Edition - Version 20.0 [Build 7650]