# Vault 7: Projects

This publication series is about specific projects related to the Vault 7 main publication.

### Protego

# MLA -- File I/O Library

- 1
- 2
…
- 63
- 64
- 65
- 66
- 67
…
- 82
- 83

FILEIO_DiskPropertiesGet(&disk_properties, 'A');
} while (disk_properties.properties_status == FILEIO_GET_PROPERTIES_STILL_WORKING);
results.disk_format - contains the format of the drive. Valid results are FAT12(1), FAT16(2), or FAT32(3).
results.sector_size - the sector size of the mounted drive. Valid values are 512, 1024, 2048, and 4096.
results.sectors_per_cluster - the number sectors per cluster.
results.total_clusters - the number of total clusters on the drive. This can be used to calculate the total disk size
(total_clusters * sectors_per_cluster * sector_size = total size of drive in bytes)
results.free_clusters - the number of free (unallocated) clusters on the drive. This can be used to calculate the total free disk
size (free_clusters * sectors_per_cluster * sector_size = total size of drive in bytes)
Remarks
PIC24F size estimates: Flash - 400 bytes (-Os setting)
PIC24F speed estimates: Search takes approximately 7 seconds per Gigabyte of drive space. Speed will vary based on the
number of sectors per cluster and the sector size.
Preconditions
1) ALLOW_GET_FILEIO_DRIVE_PROPERTIES must be defined in FSconfig.h 2) a FS_FILEIO_DRIVE_PROPERTIES
object must be created before the function is called 3) the new_request member of the FS_FILEIO_DRIVE_PROPERTIES
object must be set before calling the function for the first time. This will start a new search. 4) this function should not be
called while there is a file open. Close all files before calling this function.
Parameters
Parameters Description
properties a pointer to a FS_FILEIO_DRIVE_PROPERTIES object
where the results should be stored.
Return Values
Return Values Description
the following possible values
FILEIO_GET_PROPERTIES_NO_ERRORS operation completed without error. Results are in the
properties object passed into the function.
FILEIO_GET_PROPERTIES_DRIVE_NOT_MOUNTED there is no mounted disk. Results in properties object is not
valid
FILEIO_GET_PROPERTIES_CLUSTER_FAILURE there was a failure trying to read a cluster from the drive. The
results in the properties object is a partial result up until the
point of the failure.
FILEIO_GET_PROPERTIES_STILL_WORKING the search for free sectors is still in process. Continue calling
this function with the same properties pointer until either the
function completes or until the partial results meets the
application needs. The properties object contains the partial
results of the search and can be used by the application.
Function
void FILEIO_DrivePropertiesGet()
1.7.1.3.31 FILEIO_LongFileNameGet Function
Obtains the long file name of a file found by the FILEIO_Find function.
File
fileio_lfn.h
Syntax
int FILEIO_LongFileNameGet(FILEIO_SEARCH_RECORD * record, uint16_t * buffer, uint16_t
1.7 Library Interface MLA - File I/O Library Help File I/O Layer
65

- 1
- 2
…
- 63
- 64
- 65
- 66
- 67
…
- 82
- 83