OnReparseFileName event/delegate/callback


Pascal    C++ (Lib)    C++ (VCL)    C++ (.NET)    C#    VB.NET   

CBFSFilter     See also    


This callback is called after the reparse rule is applied, but before the request goes further.


    property OnReparseFileName : TCBFSFltReparseFileNameEvent;
    TCBFSFltReparseFileNameEvent = procedure(Sender : TObject; FileName: TCBString; DesiredAccess : ACCESS_MASK; ReparsedFileName: TCBString; var NewFileName: TCBString; var NewFileNameLength : LongWord; var UseNewFileName : Boolean ) of Object;
    type TCBString = {$ifdef UNICODE}UnicodeString{$else}WideString{$endif};

[C++ (Lib)]
    typedef void (*CBFSFltReparseFileNameEvent)(CBFSFilter* Sender, LPCWSTR FileName, ACCESS_MASK DesiredAccess, LPCWSTR ReparsedFileName, LPWSTR NewFileName, PDWORD NewFileNameLength, PBOOL UseNewFileName );

[C++ (VCL)]
    typedef void __fastcall (__closure *TCBFSFltReparseFileNameEvent)(System::TObject* Sender, TCBString FileName, ACCESS_MASK DesiredAccess, TCBString ReparsedFileName, TCBString &NewFileName, unsigned long *NewFileNameLength, bool &UseNewFileName );

[C++ (.NET)]
    public delegate void CBFSFltReparseFileNameEvent(CBFSFilter^ Sender, String^ FileName, ACCESS_MASK DesiredAccess, String^ ReparsedFileName, String^ %NewFileName, UIn32% NewFileNameLength, bool% UseNewFileName );

    delegate void CBFSFltReparseFileNameEvent(CBFSFilter Sender, string FileName, ACCESS_MASK DesiredAccess, string ReparsedFileName, ref string NewFileName, ref UIn32 NewFileNameLength, ref bool UseNewFileName );

    Delegate Sub CBFSFltReparseFileNameEvent(ByVal Sender As CBFSFilter, ByVal FileName As String, ByVal DesiredAccess As ACCESS_MASK, ByVal ReparsedFileName As String, ByRef NewFileName As String, ByRef NewFileNameLength As UInt32, ByRef UseNewFileName As Boolean)


  • Sender - reference to the class that called the delegate/event handler
  • FileName - old name of the file
  • DesiredAccess - the combination of flags specified in DesiredAccess parameter in a file create/open request
  • ReparsedFileName - name of the file, created by applying the reparse rule
  • NewFileName - new name of the file
  • NewFileNameLength - the length of the new filename (1024 characters max.)
  • UseNewFileName - specifies, whether the name, specified in callback / event handler must be used.


This callback is called right after the reparse rule, set with AddReparseRule, is applied and before the request goes further. Using this callback you can alter the new file name or revert it to the old name.

If you pass your own file name in NewFileName parameter, set UseNewFileName parameter to true. If you want ReparsedFileName to be used, set UseNewFileName to false.

DesiredAccessis passed as they were specified in the call to CreateFile() Windows API function. For more details check MSDN library shipped with your development tool and also available online.

Error handling

See Error handling topic for detailed information about how to report errors, which occur in the event handlers, back to CBFSFilter.

See also