CBFS Filter 2020 C++ Builder Edition

Questions / Feedback?

BeforeFilterAttachToVolume Event

Fires before the filter attaches to a newly-mounted filesystem volume.


typedef struct {
  String VolumeName;
  bool SkipVolume;
  int ResultCode;
} TcbfCBMonitorBeforeFilterAttachToVolumeEventParams;

typedef void __fastcall (__closure *TcbfCBMonitorBeforeFilterAttachToVolumeEvent)(System::TObject* Sender, TcbfCBMonitorBeforeFilterAttachToVolumeEventParams *e);

__property TcbfCBMonitorBeforeFilterAttachToVolumeEvent OnBeforeFilterAttachToVolume = { read=FOnBeforeFilterAttachToVolume, write=FOnBeforeFilterAttachToVolume };


This event fires before the filter attaches to the newly-mounted filesystem volume specified by VolumeName. Please refer to the FireVolumeEvents property for more information.

Applications only need to handle this event if the FireVolumeEvents property includes the FS_MOUNT_CONTROL flag.

The VolumeName parameter's value is always an NT native format in this event (unlike the other volume-related events, listed below, where its format depends on the ResolveNtDeviceToDriveLetter configuration setting). It is therefore recommended that applications add volume-specific rules, if desired, during the AfterFilterAttachToVolume event rather than this one. Applications can obtain additional information about a volume by retrieving its GUID using the GetVolumeGUID method, and then using that GUID to call various Windows API functions.

The SkipVolume parameter specifies whether the component's system driver should skip the specified volume (i.e., not attach the filter to it). Setting this parameter to true will cause all filesystem operations that target to volume to be completely ignored by the component's system driver, and will also prevent any of the following events from firing for the volume:

The ResultCode parameter will always be 0 when the event is fired. 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.

This event is fired synchronously; please refer to the Event Types topic for more information.

Copyright (c) 2020 Callback Technologies, Inc. - All rights reserved.
CBFS Filter 2020 C++ Builder Edition - Version 20.0 [Build 7543]