Ejected Event

Fires when the media and virtual drive have been ejected.

Syntax

// CBFSEjectedEventArgs carries the CBFS Ejected event's parameters.
type CBFSEjectedEventArgs struct {...}

func (args *CBFSEjectedEventArgs) ResultCode() int32
func (args *CBFSEjectedEventArgs) SetResultCode(value int32)

// CBFSEjectedEvent defines the signature of the CBFS Ejected event's handler function.
type CBFSEjectedEvent func(sender *CBFS, args *CBFSEjectedEventArgs)

func (obj *CBFS) GetOnEjectedHandler() CBFSEjectedEvent
func (obj *CBFS) SetOnEjectedHandler(handlerFunc CBFSEjectedEvent)

Remarks

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

For ejection via the system notification area (tray) to work correctly, the StorageType property must be set to STGT_DISK_PNP, and the StorageCharacteristics 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 drive. Since the virtual drive has already been destroyed by the time this event fires, applications must not call UnmountMedia or DeleteStorage (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 DeleteStorage. 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) 2022 Callback Technologies, Inc. - All rights reserved.
CBFS Connect 2020 Go Edition - Version 20.0 [Build 8348]