ReparseFileName Event

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

Syntax

public event OnReparseFileNameHandler OnReparseFileName;

public delegate void OnReparseFileNameHandler(object sender, CbfilterReparseFileNameEventArgs e);

public class CbfilterReparseFileNameEventArgs : EventArgs {
  public string FileName { get; }
  public int DesiredAccess { get; }
  public string ReparsedFileName { get; }
  public string NewFileName { get; set; }
  public int ResultCode { get; set; }
}
Public Event OnReparseFileName As OnReparseFileNameHandler

Public Delegate Sub OnReparseFileNameHandler(sender As Object, e As CbfilterReparseFileNameEventArgs)

Public Class CbfilterReparseFileNameEventArgs Inherits EventArgs
  Public ReadOnly Property FileName As String
  Public ReadOnly Property DesiredAccess As Integer
  Public ReadOnly Property ReparsedFileName As String
  Public Property NewFileName As String
  Public Property ResultCode As Integer
End Class

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.

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 .NET Edition - Version 20.0 [Build 8317]