OnGetVolumeSize event/delegate/callback


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

CBFSConnect     See also    


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


    property OnGetVolumeSize : TCBGetVolumeSizeEvent;
    TCBGetVolumeSizeEvent = procedure( Sender : TObject; var TotalAllocationUnits: Int64; var AvailableAllocationUnits: Int64 ) of object;

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

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

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

    public void CBGetVolumeSizeEvent( CBFSConnect Sender, ref Int64 TotalAllocationUnits, ref Int64 AvailableAllocationUnits );

    Sub CBGetVolumeSizeEvent( ByVal Sender As CBFSConnect, ByRef TotalAllocationUnits As Long, ByRef AvailableAllocationUnits As Long )

    void ICbFsVolumeEvents.onGetVolumeSize( CBFSConnect sender, longRef totalAllocationUnits, longRef availableAllocationUnits );


  • 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


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 CBFS Connect.

See also