OnSetFileSecurity event/delegate/callback

Filter:

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

CBFSConnect     See also    

Overview

The event is fired when the OS wants to change file security attributes.

Declaration

[Pascal]
    property OnSetFileSecurity : TCBSetFileSecurityEvent;
    TCBSetFileSecurityEvent = procedure( Sender : TObject; FileInfo: TCBFileInfo; HandleInfo: TCBHandleInfo; SecurityInformation: SECURITY_INFORMATION; SecurityDescriptor: PSECURITY_DESCRIPTOR; Length: DWORD ) of object;

[C++ (Lib)]
    void (__stdcall *CBSetFileSecurityEvent)(void* Sender, CBFileInfo* FileInfo, CBHandleInfo* HandleInfo, SECURITY_INFORMATION SecurityInformation, PSECURITY_DESCRIPTOR SecurityDescriptor, DWORD Length );

[C++ (VCL)]
    typedef void (__closure *TCBSetFileSecurityEvent)( System::TObject* Sender, TCBFileInfo* FileInfo, TCBHandleInfo* HandleInfo, SECURITY_INFORMATION SecurityInformation, PSECURITY_DESCRIPTOR SecurityDescriptor, DWORD Length );

[C++ (.NET)]
    public __delegate void CBSetFileSecurityEvent( CBFSConnect^ Sender, CBFileInfo^ FileInfo, CBHandleInfo^ HandleInfo, UInt32 SecurityInformation, IntPtr SecurityDescriptor, UInt32 Length );

[C#]
    public void CBSetFileSecurityEvent( CBFSConnect Sender, CBFileInfo FileInfo, CBHandleInfo HandleInfo, UInt32 SecurityInformation, IntPtr SecurityDescriptor, UInt32 Length );

[VB.NET]
    Sub CBSetFileSecurityEvent( ByVal Sender As CBFSConnect, ByVal FileInfo As CBFileInfo, ByVal HandleInfo As CBHandleInfo, ByVal SecurityInformation As UInt32, ByVal SecurityDescriptor As IntPtr, ByVal Length As UInt32 )

[Java]
    void ICbFsFileSecurityEvents.onSetFileSecurity( CBFSConnect sender, CBFileInfo fileInfo, CBHandleInfo handleInfo, int securityInformation, byteArrayRef securityDescriptor, int length );

Parameters

  • Sender - reference to the class that called the delegate/event handler
  • FileInfo - contains the information about the file
  • HandleInfo - contains information about particular opened file or directory handle
  • 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

Description

This event is fired when the OS wants to change file security attributes. Use SecurityInformation parameter to find out, what exactly security information must be set. Detailed information about SECURITY_INFORMATION and SECURITY_DESCRIPTOR can be found in MSDN Library or Windows NT Platform SDK. The passed security descriptor is in the self-relative format, where all security information is stored in a contiguous block of memory. For details see MSDN for self-relative and absolute security descriptor formats.

The event is optional, i.e. you should not attach an event handler if you don't plan to handle the event and get/set file security.

Error handling

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

See also

OnGetFileSecurity