Fires to allow file access to be dynamically redirected another location.
type TReparseFileNameEvent = procedure ( Sender: TObject; const FileName: String; DesiredAccess: Integer; const ReparsedFileName: String; var NewFileName: String; var ResultCode: Integer ) of Object;
property OnReparseFileName: TReparseFileNameEvent read FOnReparseFileName write FOnReparseFileName;
Applications can use this event to dynamically redirect access to the file or directory specified by FileName to another location.
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.