Control over registry operations in Windows and .NET applications

OnReparseFileName event/delegate/callback


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

CallbackRegistry     See also    


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


    property OnReparseFileName : TCbFltReparseFileNameEvent;
    TCbFltReparseFileNameEvent = procedure(Sender : TObject; FileName: TCBString; 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 (*CbFltReparseFileNameEvent)(CallbackRegistry* Sender, LPCWSTR FileName, LPCWSTR ReparsedFileName, LPWSTR NewFileName, PDWORD NewFileNameLength, PBOOL UseNewFileName );

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

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

    delegate void CbFltReparseFileNameEvent(CallbackRegistry Sender, string FileName, string ReparsedFileName, ref string NewFileName, ref UIn32 NewFileNameLength, ref bool UseNewFileName );

    Delegate Sub CbFltReparseFileNameEvent(ByVal Sender As CallbackRegistry, ByVal FileName As String, 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
  • 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.

Error handling

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

See also


Back to top