CallbackRegistry

Control over registry operations in Windows and .NET applications

OnSetFileAttributesC event/delegate/callback

Filter:

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

CallbackRegistry     See also    

Overview

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

Declaration

[Pascal]
    property OnSetFileAttributesC : TCbFltSetFileAttributesEventC;
    TCbFltSetFileAttributesEventC = procedure(Sender : TObject; var FileName: TCBString; var CreationTime: TDateTime; var LastAccessTime: TDateTime; var LastWriteTime: TDateTime; var FileAttributes: DWORD; var UserContext: pointer; var ProcessRequest: boolean) of object;
    type TCBString = {$ifdef UNICODE}UnicodeString{$else}WideString{$endif};

[C++ (Lib)]
    typedef void (*CbFltSetFileAttributesEventC)(CallbackRegistry* Sender, LPWSTR FileName, PFILETIME CreationTime, PFILETIME LastAccessTime, PFILETIME LastWriteTime, DWORD *FileAttributes, PVOID* UserContext, LPBOOL RequestAccepted);

[C++ (VCL)]
    typedef void __fastcall (__closure *TCbFltSetFileAttributesEventC)(System::TObject* Sender, TCBString FileName, System::TDateTime &CreationTime, System::TDateTime &LastAccessTime, System::TDateTime &LastWriteTime, unsigned long &FileAttributes, void* &UserContext, bool &ProcessRequest);

[C++ (.NET)]
    public delegate void CbFltSetFileAttributesEventC(CallbackRegistry^ Sender, String^ FileName, DateTime% CreationTime, DateTime% LastAccessTime, DateTime% LastWriteTime, Int32% FileAttributes, IntPtr% UserContext, bool% ProcessRequest);

[C#]
    delegate void CbFltSetFileAttributesEventC(CallbackRegistry Sender, string FileName, ref DateTime CreationTime, ref DateTime LastAccessTime, ref DateTime LastWriteTime, ref Int32 FileAttributes, ref IntPtr UserContext, ref bool ProcessRequest);

[VB.NET]
    Delegate Sub CbFltSetFileAttributesEventC(ByVal Sender As CallbackRegistry, ByVal FileName As String, ByRef CreationTime As DateTime, ByRef LastAccessTime As DateTime, ByRef LastWriteTime As DateTime, ByRef FileAttributes As Int32, ByRef UserContext As IntPtr, ByRef ProcessRequest As Boolean)

Parameters

  • Sender - reference to the class that called the delegate/event handler
  • FileName - the name of the file
  • CreationTime - the time of the object creation. The value can be empty (zero in VCL, DateTime.MinValue in .NET) if the parameter is not set.
  • LastAccessTime - the time of the last access to the object. The value can be empty (zero in VCL, DateTime.MinValue in .NET) if the parameter is not set.
  • LastWriteTime - the time of the last modification to the object. The value can be empty (zero in VCL, DateTime.MinValue in .NET) if the parameter is not set.
  • FileAttributes - the attributes of the file
  • UserContext - the placeholder for the application-defined data
  • ProcessRequest (RequestAccepted) - 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 needs to change the times and/or the attributes of the open file.
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 CallbackRegistry.

See also

OnSetFileAttributesN    

Back to top