CallbackFilter

Instant control over file and folder operations in Windows and .NET applications

OnSetFileSecurityC event/delegate/callback

Filter:

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

CallbackFilter     See also    

Overview

This callback is called when the OS or the application needs to change the security attributes of the file.

Declaration

[Pascal]
    property OnSetFileSecurityC : TCbFltSetFileSecurityEventC;
    TCbFltSetFileSecurityEventC = procedure(Sender : TObject; FileName: TCBString; SecurityInformation: SECURITY_INFORMATION; SecurityDescriptor: PSECURITY_DESCRIPTOR; Length: DWORD; var ProcessRequest: boolean) of object;
    type TCBString = {$ifdef UNICODE}UnicodeString{$else}WideString{$endif};

[C++ (Lib)]
    typedef void (*CbFltSetFileSecurityEventC)(CallbackFilter* Sender, LPWSTR FileName, SECURITY_INFORMATION SecurityInformation, PSECURITY_DESCRIPTOR SecurityDescriptor, DWORD Length, LPBOOL ProcessRequest);

[C++ (VCL)]
    typedef void __fastcall (__closure *TCbFltSetFileSecurityEventC)(System::TObject* Sender, TCBString FileName, SECURITY_INFORMATION SecurityInformation, PSECURITY_DESCRIPTOR SecurityDescriptor, DWORD Length, bool &ProcessRequest);

[C++ (.NET)]
    public delegate void CbFltSetFileSecurityEventC(CallbackFilter^ Sender, String^ FileName, UInt32 SecurityInformation, IntPtr SecurityDescriptor, UInt32 Length, bool% ProcessRequest);

[C#]
    delegate void CbFltSetFileSecurityEventC(CallbackFilter Sender, string FileName, uint SecurityInformation, IntPtr SecurityDescriptor, uint Length, ref bool ProcessRequest);

[VB.NET]
    Delegate Sub CbFltSetFileSecurityEventC(ByVal Sender As CallbackFilter, ByVal FileName As String, ByVal uint SecurityInformation, ByVal IntPtr SecurityDescriptor, ByVal Length As UInt32, ByRef ProcessRequest As Boolean)

Parameters

  • Sender - reference to the class that called the delegate/event handler
  • FileName - the name of the file
  • SecurityInformation - a bit field, which specifies, what security information should be taken from SecurityDescriptor and set for the file
  • SecurityDescriptor - the reference to a variable-length data block, which starts as a structure (SECURITY_DESCRIPTOR) described in Platform SDK
  • Length - the length of the data, referenced by SecurityDescriptor parameter
  • ProcessRequest - specifies, whether the request must be passed further to the underlying filters and the file system

Description

This callback is called when the OS or the application wants to change file security attributes. Use SecurityInformation parameter to find out, what exactly security information will be set. Detailed information about SECURITY_INFORMATION and SECURITY_DESCRIPTOR can be found in MSDN Library or Windows NT Platform SDK.
Read more about contexts.

Error handling

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

See also

OnSetFileSecurityN    

Back to top