Discuss this help topic in CBFS Forum

OnGetVolumeSize event/delegate/callback

Filter:

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

CallbackFileSystem     See also    

Overview

The event is fired when the OS needs to get information about the storage (disk) size and free space.

Declaration

[Pascal]
    property OnGetVolumeSize : TCbFsGetVolumeSizeEvent;
    TCbFsGetVolumeSizeEvent = procedure( Sender : TObject; var TotalAllocationUnits: Int64; var AvailableAllocationUnits: Int64 ) of object;

[C++ (Lib)]
    void (__stdcall *CbFsGetVolumeSizeEvent)(void* Sender, __int64 & TotalAllocationUnits, __int64 & AvailableAllocationUnits );

[C++ (VCL)]
    typedef void (__closure *TCbFsGetVolumeSizeEvent)( System::TObject* Sender, __int64 & TotalAllocationUnits, __int64 & AvailableAllocationUnits );

[C++ (.NET)]
    public __delegate void CbFsGetVolumeSizeEvent( CallbackFileSystem^ Sender, Int64% TotalAllocationUnits, Int64% AvailableAllocationUnits );

[C#]
    public void CbFsGetVolumeSizeEvent( CallbackFileSystem Sender, ref Int64 TotalAllocationUnits, ref Int64 AvailableAllocationUnits );

[VB.NET]
    Sub CbFsGetVolumeSizeEvent( ByVal Sender As CallbackFileSystem, ByRef TotalAllocationUnits As Long, ByRef AvailableAllocationUnits As Long )

[Java]
    void ICbFsVolumeEvents.onGetVolumeSize( CallbackFileSystem sender, longRef totalAllocationUnits, longRef availableAllocationUnits );

Parameters

  • Sender - reference to the class that called the delegate/event handler.
  • TotalAllocationUnits - the event handler must place the total number of the allocation units (sectors) on device to this parameter
  • AvailableAllocationUnits - the event handler must place the number of available (free) allocation units (sectors) on device to this parameter

Description

This event is fired when the OS wants to obtain information about the size and available space on the disk. Minimal size of the volume accepted by Windows is 6144 bytes (based on 3072-byte sector, 1 sector per cluster and 2 clusters per storage), however CBFS adjusts the size to be at least 16 sectors to ensure compatibility with possible changes in future versions of Windows.

Error handling

See Error handling topic for detailed information about how to report errors, which occur in the event handlers, back to Callback File System.

See also

OnGetVolumeLabel    

Discuss this help topic in CBFS Forum