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

OnSetEndOfFileC event/delegate/callback


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

CallbackFilter     See also    


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


    property OnSetEndOfFileC : TCbFltSetEndOfFileEventC;
    TCbFltSetEndOfFileEventC = procedure(Sender : TObject; FileName: TCBString; var EndOfFile: Int64; var UserContext: pointer; var ProcessRequest: boolean) of object;
    type TCBString = {$ifdef UNICODE}UnicodeString{$else}WideString{$endif};

[C++ (Lib)]
    typedef void (*CbFltSetEndOfFileEventC)(CallbackFilter* Sender, LPWSTR FileName, __int64* EndOfFile, PVOID* UserContext, LPBOOL ProcessRequest);

[C++ (VCL)]
    typedef void __fastcall (__closure *TCbFltSetEndOfFileEventC)(System::TObject* Sender, TCBString FileName, __int64 &EndOfFile, void* &UserContext, bool &ProcessRequest);

[C++ (.NET)]
    public delegate void CbFltSetEndOfFileEventC(CallbackFilter^ Sender, String^ FileName, Int64% EndOfFile, IntPtr% UserContext, bool% ProcessRequest);

    delegate void CbFltSetEndOfFileEventC(CallbackFilter^ Sender, string FileName, ref long EndOfFile, ref IntPtr UserContext, ref bool ProcessRequest);

    Delegate Sub CbFltSetEndOfFileEventC(ByVal Sender As CallbackFilter, ByVal FileName As String, ByRef EndOfFile As Long, ByRef UserContext As IntPtr, ByRef ProcessRequest As Boolean)


  • Sender - reference to the class that called the delegate/event handler
  • FileName - name of the file
  • EndOfFile - new size of the file
  • UserContext - the placeholder for the application-defined data
  • ProcessRequest - specifies, whether the request must be passed further to the underlying filters and the file system


This callback is called when the OS or the application needs to change the size 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 CallbackFilter.

See also

OnGetFileSizesC     OnSetEndOfFileN    

Back to top