ReparseFileName Event

Fires to allow file access to be dynamically redirected another location.

Syntax

ANSI (Cross Platform)
virtual int FireReparseFileName(CBFilterReparseFileNameEventParams *e);
typedef struct {
const char *FileName;
int DesiredAccess;
const char *ReparsedFileName;
char *NewFileName; int lenNewFileName;
int ResultCode; int reserved; } CBFilterReparseFileNameEventParams; Unicode (Windows) virtual INT FireReparseFileName(CBFilterReparseFileNameEventParams *e);
typedef struct {
LPCWSTR FileName;
INT DesiredAccess;
LPCWSTR ReparsedFileName;
LPWSTR NewFileName; INT lenNewFileName;
INT ResultCode; INT reserved; } CBFilterReparseFileNameEventParams;
#define EID_CBFILTER_REPARSEFILENAME 85

virtual INT CBFSFILTER_CALL FireReparseFileName(LPWSTR &lpszFileName, INT &iDesiredAccess, LPWSTR &lpszReparsedFileName, LPWSTR &lpNewFileName, INT &lenNewFileName, INT &iResultCode);

Remarks

Applications can use this event to dynamically redirect access to the file or directory specified by FileName to another location.

Applications only need to handle this event if they've added a standard filter rule that includes the FS_CE_REPARSE_FILENAME flag.

The DesiredAccess parameter reflects the value that was passed for the similarly-named parameter of the Windows API's CreateFile function. Please refer to Microsoft's documentation for more information.

The ReparsedFileName parameter reflects the default redirection destination. If the specified file or directory matches an existing reparse rule, this parameter's value is generated based on said rule; otherwise, this parameter will reflect the same value as FileName.

The NewFileName parameter specifies an application-defined redirection destination. This parameter's value, if set, must be less than 1024 characters in length. Note that the value must be copied to NewFileName; set lenNewFileName to the length of the copied string (measured in char/wchar_t, not including terminating nulls).

If the application sets NewFileName to a non-empty value, it will be used as the redirection destination. Otherwise, the value reflected by ReparseFileName will be used as the redirection destination.

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) 2022 Callback Technologies, Inc. - All rights reserved.
CBFS Filter 2020 C++ Edition - Version 20.0 [Build 8317]