BeforeFilterAttachToVolume Event

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

Syntax

virtual int FireBeforeFilterAttachToVolume(CBFilterBeforeFilterAttachToVolumeEventParams *e);
typedef struct {
const char *VolumeName;
int SkipVolume;
int ResultCode; int reserved; } CBFilterBeforeFilterAttachToVolumeEventParams;
virtual INT FireBeforeFilterAttachToVolume(CBFilterBeforeFilterAttachToVolumeEventParams *e);
typedef struct {
LPCWSTR VolumeName;
BOOL SkipVolume;
INT ResultCode; INT reserved; } CBFilterBeforeFilterAttachToVolumeEventParams;

Remarks

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 class'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 class'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++ Edition - Version 20.0 [Build 7543]