OnFileWrite event/delegate/callback
Filter:
Pascal DLL C++ (DLL/Lib) C++ (VCL) C++ (.NET) C# VB.NETOverview
This event is fired when SolFS wants to write the data to the storage.
Declaration
[Pascal]
TSolFSWriteFileEvent = procedure(
Sender : TObject;
FileHandle : THandle;
Buffer : Pointer;
Count : LongWord;
var Result : LongInt) of object;
[DLL]
typedef Error (__stdcall *SolFSWriteFileFunc)(
LongWord UserData,
void* Buffer,
unsigned long Count,
Handle FileHandle);
[C++ (DLL/Lib)]
typedef Error (__stdcall *SolFSWriteFileFunc)(
LongWord UserData,
void* Buffer,
unsigned long Count,
Handle FileHandle);
[C++ (VCL)]
typedef void (__closure *TSolFSWriteFileEvent)(
System::TObject* Sender,
Handle FileHandle,
void* Buffer,
unsigned long Count,
Error& Result);
[C++ (.NET)]
public __delegate void SolFSWriteFileEvent(
SolFSStorage* Sender,
UInt32 FileHandle,
unsigned char Buffer __gc[],
unsigned long Count,
Int32 __gc &Result);
[C#]
public void SolFSWriteFileEvent(
SolFS.SolFSStorage Sender,
uint FileHandle,
uchar[] Buffer,
ulong Count,
ref int Result);
[VB.NET]
Sub SolFSWriteFileEvent(
ByVal Sender As SolFS.SolFSStorage,
ByVal FileHandle As UInt32,
ByVal Buffer As Byte(),
ByVal Count As UInt32,
ByRef Result As Int32)
Parameters
- Sender - reference to the class that called the delegate/event handler.
- FileHandle - Handle to the storage to which the data is to be written.
- Buffer - a reference to the buffer wchich must be written to the file.
- Count - the number of bytes to be written
- Result - out parameter (return value for DLL) where you place operation result. If you are working with file system, Win32 error code is a good candidate for placing to Result parameter. Otherwise you can use any other error codes, just be sure that 0 means success.
- [DLL] UserData - application-defined parameter which is specified when creating the storage and passed back to callback function.
Description
This event is fired when SolFS wants to write the data to the storage.
Writing is always performed in chunks having size of multiple of storage page size.
The position, from which to start writing, is determined by file pointer, which is adjusted using OnFileSeek event.
Write operation is successful only when Count bytes have been written.
Otherwise the application must return non-zero error code in Result parameter.
See also
Information about callbacks (Driver Edition only) OnFileRead OnFileSeek
