EldoS
 Table of Contents >  OnFileRead event/delegate/callback
Navigation
Web site
Support
Table Of Contents
Send comments on this topic

OnFileRead event/delegate/callback

Filter:

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

SolFSStorage     See also    

Overview

This event is fired when SolFS wants to read the data from the storage.

Declaration

[Pascal]
    TSolFSReadFileEvent = procedure( Sender : TObject; FileHandle : THandle; Buffer : Pointer; Count : LongWord; var Result : LongInt) of object;

[DLL]
    typedef Error (__stdcall *SolFSReadFileFunc)( LongWord UserData, void* Buffer, unsigned long Count, Handle FileHandle);

[C++ (DLL/Lib)]
    typedef Error (__stdcall *SolFSReadFileFunc)( LongWord UserData, void* Buffer, unsigned long Count, Handle FileHandle);

[C++ (VCL)]
    typedef void (__closure *TSolFSReadFileEvent)( System::TObject* Sender, Handle FileHandle, void* Buffer, unsigned long Count, Error& Result);

[C++ (.NET)]
    public __delegate void SolFSReadFileEvent( SolFSStorage* Sender, UInt32 FileHandle, unsigned char Buffer __gc[], unsigned long Count, Int32 __gc &Result);

[C#]
    public void SolFSReadFileEvent( SolFS.SolFSStorage Sender, uint FileHandle, uchar[] Buffer, ulong Count, ref int Result);

[VB.NET]
    Sub SolFSReadFileEvent( 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, from which the data is to be read.
  • Buffer - a reference to the buffer where application should store the data read from the file.
  • Count - the number of bytes to be read
  • Result - out parameter (return value for DLL) where the application places the result of the operation. 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 read the data from the storage. Reading is always performed in chunks having size of multiple of storage page size. The position, from which to start reading, is determined by file pointer, which is adjusted using OnFileSeek event.
Read operation is successful only when Count bytes have been read. Otherwise the application must return non-zero error code in Result parameter.

See also

Information about callbacks (Driver Edition only)     OnFileSeek     OnFileWrite    

Contact Us | Subscribe | Terms of Use | Trademarks | Privacy Statement
Copyright (c) 1998-2008, EldoS Corporation