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 RTFDeviceIoControl
RTFDeviceIoControl can be used to access driver specific functions:
int RTFDeviceIoControl(const char * DeviceName,
UINT ControlCode,
void * Buffer,
UINT Length);
ParametersDriveNamePointer to a physical disk name (e.g., "\\.\X" or "\\.\PHYSICALDRIVEx").
ControlCodeControl code which defines the function to be performed. See below for details.
BufferIf the function requires data to be exchanged, this parameter points to it.
LengthLength in bytes of the data buffer pointed to by parameter Buffer. If Buffer is NULL, this parameter must be zero.
return valueIf the function succeeds, it returns a ControlCode dependent positive value or RTF_NO_ERROR. If it fails, the return value is a negative error code.
Currently, the following ControlCode values are defined:
ControlCode |
Meaning |
RTF_IOC_CD_ENQUIRE |
The state of a CD/DVD tray is enquired. This code is only valid for CD-ROM or DVD drives on an IDE, AHCI or USB port. If the tray is open, the function returns RTF_IOC_CD_OPEN. If it is closed, RTF_IOC_CD_CLOSE is returned. Parameters Buffer and Length are ignored. |
RTF_IOC_CD_OPEN |
The CD/DVD tray is opened/ejected. This code is only valid for CD-ROM or DVD drives on an IDE, AHCI or USB port. On success, the function returns RTF_NO_ERROR. Parameters Buffer and Length are ignored. |
RTF_IOC_CD_CLOSE |
The CD/DVD tray is closed. This code is only valid for CD-ROM or DVD drives on an IDE, AHCI or USB port. On success, the function returns RTF_NO_ERROR. Parameters Buffer and Length are ignored. |
RTF_IOC_FLUSH_CACHE |
The disk's internal write cache is flushed. Parameters Buffer and Length are ignored. This function is only supported by the IDE and AHCI drivers. |
For RTFiles-32 used under RTTarget-32, Win32 API function DeviceIoControl() can also be used to operated a CD/DVD tray using control codes IOCTL_STORAGE_EJECT_MEDIA and IOCTL_STORAGE_LOAD_MEDIA.
Function RTFGetDeviceIndex
Function RTFPartitionSectors
|