On Time RTOS-32 Documentation
Welcome
RTTarget-32
RTKernel-32
RTFiles-32
RTFiles-32 Programming Manual
RTFiles-32 Reference Manual
Introduction
General File I/O
Information about Files
File Attributes
Directories
Finding Files
File Name Operations
Disk and Volume Management
Function RTFResetDisk
Function RTFGetDiskInfoEx
Function RTFGetPartitionInfo
Function RTFSetVolumeLabel
Function RTFFormat
Function RTFFormatExFAT
Function RTFCheckDisk
Function RTFCheckDiskBufferSize
Function RTFCreateMasterBootRecord
Function RTFSplitPartition
Function RTFCreateGPTPartition
Function RTFSplitGPTPartition
Function RTFCreateBackupGPT
Function RTFCreateBootSector
Function RTFGetDeviceIndex
Function RTFDeviceIoControl
Function RTFPartitionSectors
Function RTFPartitionStart
Miscellaneous File Functions
Raw I/O Functions
Functions for Debugging
Device Dependent Functions
Obsolete Functions
Disk Device Driver API
MTD Device Driver API
RTFiles-32 Error Codes
Code Page Reference
RTIP-32
RTPEG-32
RTUSB-32
|
Function RTFGetPartitionInfo
RTFGetPartitionInfo returns information about a partition or physical disk:
int RTFGetPartitionInfo(const char * DriveName,
RTFPartitionInfo * PartitionInfo);
ParametersDriveNameMust be a valid file name (for example, a root directory such as "C:\"), a logical drive name ("\\.\C:"), or a physical disk name ("\\.\PHYSICALDRIVE0"). If the name refers to a physical disk file, the returned partition information applies to the whole disk, not just a single logical drive.
PartitionInfoMust point to a structure RTFPartitionInfo declared in Rtfiles.h:
typedef struct {
RTFPartitionRecord Partition;
RTFSector PartitionSector;
int PhysicalDiskIndex;
UINT BytesPerSector;
BYTE MediaDescriptor;
BYTE Reserved;
short DeviceListIndex;
} RTFPartitionInfo;
return valueIf the function succeeds, the return value is RTF_NO_ERROR and the structure is filled as described below. If the function fails, the return value is a negative error code.
Value |
Meaning |
Partition |
This field contains information about the location and size of the partition. For floppy disks, physical disks, and CDs, RTFiles-32 will create a fake partition record describing the whole disk. Functions RTFPartitionSectors and RTFPartitionStart may be used to read data from this field. |
PartitionSector |
The physical sector number of the hosting device containing the partition table containing the above partition record. This value will be 0 for all primary partitions. The value is undefined for physical disks. |
PhysicalDiskIndex |
The index of the physical disk device hosting this partition, or -1 for a floppy disk. The first hard disk in the system has index 0. |
BytesPerSector |
The sector size of the disk. |
MediaDescriptor |
The media byte of the hosting device. This value will be F8h for hard disks and some other value read from the boot sector for floppies. If this value is 0, RTFiles-32 was unable to determine the media descriptor. This situation can occur when the boot sector of a floppy disk is unreadable. |
DeviceListIndex |
The zero-based index of the device hosting the partition in RTFiles-32's device list. This value can also be enquired through function RTFGetDeviceIndex. RTFGetDeviceIndex has the advantage that it does not need to access this disk and can thus succeed even if no media is in the drive. |
Function RTFGetDiskInfoEx
Function RTFSetVolumeLabel
|