CallbackRegistry

Control over registry operations in Windows and .NET applications

OnEnumerateDirectoryN event/delegate/callback

Filter:

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

CallbackRegistry    

Overview

This notification callback is called during directory enumeration.

Declaration

[Pascal]
    property OnEnumerateDirectoryN : TCbFltEnumerateDirectoryEventN;
    TCbFltEnumerateDirectoryEventN = procedure(Sender : TObject; DirectoryName: WideString; FileName: WideString; CreationTime: TDateTime; LastAccessTime: TDateTime; LastWriteTime: TDateTime; EndOfFile: Int64; AllocationSize: Int64; FileId: Int64; FileAttributes: LongWord; Status : DWORD) of object;

[C++ (Lib)]
    typedef void (*CbFltEnumerateDirectoryEventN)(CallbackRegistry* Sender, LPCWSTR DirectoryName, LPCWSTR FileName, FILETIME CreationTime, FILETIME LastAccessTime, FILETIME LastWriteTime, __int64 EndOfFile, __int64 AllocationSize, __int64 FileId, DWORD FileAttributes, LONG Status);

[C++ (VCL)]
    typedef void __fastcall (__closure *TCbFltEnumerateDirectoryEventN)(System::TObject* Sender, TCBString DirectoryName, TCBString FileName, TDateTime CreationTime, TDateTime LastAccessTime, TDateTime LastWriteTime, __int64 EndOfFile, __int64 AllocationSize, __int64 FileId, unsigned long FileAttributes, DWORD Status);

[C++ (.NET)]
    public delegate void CbFltEnumerateDirectoryEventN(CallbackRegistry^ Sender, String^ DirectoryName, String^ FileName, DateTime CreationTime, DateTime LastAccessTime, DateTime LastWriteTime, Int64 EndOfFile, Int64 AllocationSize, Int64 FileId, UInt32 FileAttributes, Int32 Status);

[C#]
    delegate void CbFltEnumerateDirectoryEventN(CallbackRegistry Sender, string DirectoryName, string FileName, DateTime CreationTime, DateTime LastAccessTime, DateTime LastWriteTime, Int64 EndOfFile, Int64 AllocationSize, Int64 FileId, UInt32 FileAttributes, Int32 Status);

[VB.NET]
    Delegate Sub CbFltEnumerateDirectoryEventN(ByVal Sender As CallbackRegistry, ByVal DirectoryName As String, ByVal FileName As String, ByVal CreationTime As DateTime, ByVal LastAccessTime As DateTime, ByVal LastWriteTime As DateTime, ByVal EndOfFile As Int64, ByVal AllocationSize As Int64, ByVal FileId As Int64, ByVal FileAttributes As UInt32, ByVal Status As Int32)

Parameters

  • Sender - reference to the class that called the delegate/event handler
  • DirectoryName - contains the name of the directory, in which enumeration is done
  • FileName - the name of the found file or directory
  • CreationTime - the time of the object creation
  • LastAccessTime - the time of last access to the object
  • LastWriteTime - the time of last modification of the object
  • EndOfFile - the size of the file
  • AllocationSize - the size of the space, allocated for the file
  • FileId - the total number of the allocation units (clusters)
  • FileAttributes - the attributes of the file or directory
  • Status - status code of the completed operation

Description

This notification callback is called when the OS enumerates files and subdirectories in the given directory. The callback is called after it has been processed by the file system and passed back to the OS.

The application can use UserContext to store the reference to some information, identifying the file or directory (such as file/directory handle or database record ID or reference to the stream class etc). The value, set in the event handler, is later passed to all operations, related to this file, together with file/directory name and attributes. Read more about contexts.

Back to top