Discuss this help topic in CBFS Forum

OnSetFileSecurity event/delegate/callback

Filter:

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

CallbackFileSystem     See also    

Overview

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

Declaration

[Pascal]
    property OnSetFileSecurity : TCbFSetFileSecurityEvent;
    TCbFSetFileSecurityEvent = procedure( Sender : TObject; FileInfo: TCbFsFileInfo; HandleInfo: TCbFsHandleInfo; SecurityInformation: SECURITY_INFORMATION; SecurityDescriptor: PSECURITY_DESCRIPTOR; Length: DWORD ) of object;

[C++ (Lib)]
    void (__stdcall *CbFSetFileSecurityEvent)(void* Sender, CbFsFileInfo* FileInfo, CbFsHandleInfo* HandleInfo, SECURITY_INFORMATION SecurityInformation, PSECURITY_DESCRIPTOR SecurityDescriptor, DWORD Length );

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

[C++ (.NET)]
    public __delegate void CbFSetFileSecurityEvent( CallbackFileSystem^ Sender, CbFsFileInfo^ FileInfo, CbFsHandleInfo^ HandleInfo, UInt32 SecurityInformation, IntPtr SecurityDescriptor, UInt32 Length );

[C#]
    public void CbFSetFileSecurityEvent( CallbackFileSystem Sender, CbFsFileInfo FileInfo, CbFsHandleInfo HandleInfo, UInt32 SecurityInformation, IntPtr SecurityDescriptor, UInt32 Length );

[VB.NET]
    Sub CbFSetFileSecurityEvent( ByVal Sender As CallbackFileSystem, ByVal FileInfo As CbFsFileInfo, ByVal HandleInfo As CbFsHandleInfo, ByVal SecurityInformation As UInt32, ByVal SecurityDescriptor As IntPtr, ByVal Length As UInt32 )

[Java]
    void ICbFsFileSecurityEvents.onSetFileSecurity( CallbackFileSystem sender, CbFsFileInfo fileInfo, CbFsHandleInfo 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 Callback File System.

See also

OnGetFileSecurity    

Discuss this help topic in CBFS Forum