OnParentSize event/delegate/callback


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

SolFSStorage     See also    


This event is fired when CBFS Storage needs to know the amount of space available on the underlying media.

Not applicable


    TSolFSGetParentSizeEvent = procedure( Sender : TObject; FileHandle : THandle; var FreeSize : Int64; var Result : LongInt) of object;

[Plain C]
    typedef Error (__stdcall *SolFSGetParentSizeFunc)( LongWord UserData, LongLongWord *TotalSize, LongLongWord *CallerAvailableSize, LongLongWord *ActualAvailableSize, Handle FileHandle);

[C++ (DLL/Lib)]
    typedef Error (__stdcall *SolFSGetFileSizeFunc)( LongWord UserData, LongLongWord *Size, Handle FileHandle);

[C++ (VCL)]
    typedef void (__closure *TSolFSGetParentSizeEvent)( System::TObject* Sender, Handle FileHandle, LongLongWord *FreeSize, Error& Result);

[C++ (.NET)]
    public __delegate void SolFSParentSizeEvent( SolFSStorage* Sender, UInt32 FileHandle, LongLongWord __gc &FreeSize, Int32 __gc &Result);

    public void SolFSParentSizeEvent( SolFSStorage Sender, uint FileHandle, ref ulong FreeSize, ref int Result);

    Sub SolFSParentSizeEvent( ByVal Sender As SolFSStorage, ByVal FileHandle As UInt32, ByRef FreeSize As UInt64, ByRef Result As Int32)

    not applicable;


  • Sender - reference to the class that called the delegate/event handler.
  • FileHandle - Handle to the storage, whose size needs to be queried.
  • FreeSize - out parameter to which the application must place the free size on the underlying media.
  • 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.
  • [Plain C] CallerAvailableSize - put the same value as FreeSize to this parameter
  • [Plain C] ActualAvailableSize - put the same value as FreeSize to this parameter
  • [Plain C] UserData - application-defined parameter which is specified when creating the storage and passed back to callback function.


This event is fired when CBFS Storage needs to know available space on the underlying media. For file-based storages return the free space on the underlying drive. For memory-based storages return the amount of memory available to the process (of course, don't forget about memory needed for other application functions). For storages located on remote system you would need to request the remote system about available space.

The callback/event handler must be set before the storage is opened.

See also

Information about callbacks (Operating System edition only)     OnFileGetSize     OnFileSetSize