OnPostWriteFileC event/delegate/callback

Filter:

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

CBFSFilter     See also    

Overview

This callback is called when the OS needs to write the data from the open file or volume.

Declaration

[Pascal]
    property OnPostWriteFileC : TCBFSFltPostWriteFileEventC;
    TCBFSFltPostWriteFileEventC = procedure(Sender : TObject; FileName: TCBString; Position: Int64; var Buffer; BytesToWrite: LongWord; Direction: LongWord; Status : DWORD; var FileContext: pointer; var HandleContext: pointer) of object;
    type TCBString = {$ifdef UNICODE}UnicodeString{$else}WideString{$endif};

[C++ (Lib)]
    typedef void (*CBFSFltPostWriteFileEventC)(CBFSFilter* Sender, LPWSTR FileName, __int64 Position, PVOID Buffer, DWORD BytesToWrite, CBFSFltDataFlow Direction, LONG Status, PVOID* FileContext, PVOID* HandleContext);

[C++ (VCL)]
    typedef void __fastcall (__closure *TCBFSFltPostWriteFileEventC)(System::TObject* Sender, TCBString FileName, __int64 Position, void *Buffer, unsigned BytesToWrite, unsigned Direction, DWORD Status, void* *FileContext, void* *HandleContext);

[C++ (.NET)]
    public delegate void CBFSFltPostWriteFileEventC(CBFSFilter^ Sender, String^ FileName, Int64 Position, IntPtr Buffer, Int32 BytesToWrite, CBFSFltDataFlow Direction, Int32 Status, IntPtr% FileContext, IntPtr% HandleContext);

[C#]
    delegate void CBFSFltPostWriteFileEventC(CBFSFilter^ Sender, string FileName, long Position, IntPtr Buffer, Int32 BytesToWrite, CBFSFltDataFlow Direction, Int32 Status, ref IntPtr FileContext, ref IntPtr HandleContext);

[VB.NET]
    Delegate Sub CBFSFltPostWriteFileEventC(ByVal Sender As CBFSFilter, ByVal FileName As String, ByVal Position As Long, ByVal Buffer As IntPtr, ByVal BytesToWrite As Int32, ByVal Direction As CBFSFltDataFlow, ByVal Status As Int32, ByRef FileContext As IntPtr, ByRef HandleContext as IntPtr)

Parameters

  • Sender - reference to the class that called the delegate/event handler
  • FileName - contains the name of the file
  • Position - the starting position to write the file data to
  • Buffer - the buffer to put the write data
  • BytesToWrite - the number of bytes to write from the file. The Buffer contains not more space, than this value.
  • Direction - specifies the direction of the data fllow (see below)
  • Status - status code of the completed operation
  • FileContext - the placeholder for the application-defined data, common to all concurrent file operations on the file
  • HandleContext - the placeholder for the application-defined data, local to each opened file handle

Values of CBFSFltDataFlow

Description

This callback event is fired when the OS writes the data to the open file or volume, after the request has been passed to the underlying file system. To have a copy of the data that was written, access the data in the provided buffer.

To report the failure and cancel writing operation you need to throw an instance of ECBFSFilterError.

Read more about contexts.

Attention: HandleContext can be empty, if the operation is performed by the cache manager or memory manager. In these situation, the operation is not associated with any particular handle.

See also

OnWriteFileC     OnWriteFileN