GetVolumeSize Event

Fires when the OS needs information about the virtual drive's capacity and free space.

Syntax

// CBFSGetVolumeSizeEventArgs carries the CBFS GetVolumeSize event's parameters.
type CBFSGetVolumeSizeEventArgs struct {...}

func (args *CBFSGetVolumeSizeEventArgs) TotalSectors() int64
func (args *CBFSGetVolumeSizeEventArgs) SetTotalSectors(value int64)
func (args *CBFSGetVolumeSizeEventArgs) AvailableSectors() int64
func (args *CBFSGetVolumeSizeEventArgs) SetAvailableSectors(value int64)
func (args *CBFSGetVolumeSizeEventArgs) ResultCode() int32
func (args *CBFSGetVolumeSizeEventArgs) SetResultCode(value int32)

// CBFSGetVolumeSizeEvent defines the signature of the CBFS GetVolumeSize event's handler function.
type CBFSGetVolumeSizeEvent func(sender *CBFS, args *CBFSGetVolumeSizeEventArgs)

func (obj *CBFS) GetOnGetVolumeSizeHandler() CBFSGetVolumeSizeEvent
func (obj *CBFS) SetOnGetVolumeSizeHandler(handlerFunc CBFSGetVolumeSizeEvent)

Remarks

This event fires anytime the OS needs to retrieve the virtual drive's total storage capacity and free space, measured in sectors. The virtual drive's sector size is defined by the SectorSize configuration setting.

To handle this event properly, applications must set TotalSectors to the total number of sectors on the drive, and set AvailableSectors to the number of sectors that are available to the OS for storing filesystem objects.

The minimum drive size accepted by Windows is 6144 bytes (based on a 3072-byte sector, 1 sector per cluster and 2 clusters per drive). However, the component adjusts the minimum size to be at least 16 sectors (49152 bytes) to ensure compatibility with possible changes in future Windows updates.

The ResultCode parameter will always be 0 when the event is fired. If the event cannot be handled in a "successful" manner for some reason (e.g., a resource isn't available, security checks failed, etc.), set it to a non-zero value to report an appropriate error. Please refer to the Error Reporting and Handling topic for more information.

Copyright (c) 2022 Callback Technologies, Inc. - All rights reserved.
CBFS Connect 2020 Go Edition - Version 20.0 [Build 8348]