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

OnPostGetFileSizesC event/delegate/callback


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

CallbackFilter     See also    


This callback is called after the OS or the application requests actual and/or allocation size of the file.


    property OnPostGetFileSizesC : TCbFltPostGetFileSizesEventC;
    TCbFltPostGetFileSizesEventC = procedure(Sender : TObject; FileName: TCBString; var EndOfFile: Int64; var AllocationSize: Int64; Status : DWORD; var UserContext: pointer) of object;
    type TCBString = {$ifdef UNICODE}UnicodeString{$else}WideString{$endif};

[C++ (Lib)]
    typedef void (*CbFltPostGetFileSizesEventC)(CallbackFilter* Sender, LPWSTR FileName, __int64* EndOfFile, __int64* AllocationSize, LONG Status, PVOID* UserContext);

[C++ (VCL)]
    typedef void __fastcall (__closure *TCbFltPostGetFileSizesEventC)(System::TObject* Sender, TCBString FileName, __int64 &EndOfFile, __int64 &AllocationSize, DWORD Status, void* &UserContext);

[C++ (.NET)]
    public delegate void CbFltPostGetFileSizesEventC(CallbackFilter^ Sender, String^ FileName, Int64% EndOfFile, Int64% AllocationSize, Int32 Status, IntPtr% UserContext);

    delegate void CbFltPostGetFileSizesEventC(CallbackFilter^ Sender, string FileName, ref long EndOfFile, ref long AllocationSize, Int32 Status, ref IntPtr UserContext);

    Delegate Sub CbFltPostGetFileSizesEventC(ByVal Sender As CallbackFilter, ByVal FileName As String, ByRef EndOfFile As Long, ByRef AllocationSize As Long, ByVal Status As Int32, ByRef UserContext As IntPtr)


  • Sender - reference to the class that called the delegate/event handler
  • FileName - name of the file
  • EndOfFile - size of the file
  • AllocationSize - allocation size of the file
  • UserContext - the placeholder for the application-defined data
  • Status - status code of the completed operation


This callback is called when the OS or the application needs to get the size (either actual data size or allocation size) of the file after the request was processed by the file system. You can alter one or both sizes if you provide "fake" contents of the file.
Read more about contexts.

See also

OnGetFileSizesN     OnSetFileSizeC    

Back to top