IoctlHandle *Init(int handle) Returns a pointer to a new object of type IoctlHandle, returns NULL is specified handle is invalid. Specified handle becomes the current handle. New object is guaranteed to be correctly initialized.IoctlHandle *Init(const char *path) Returns a pointer to a new object of type IoctlHandle, returns NULL if specified path is invalid or filename does not exist. Handle of opened file/device becomes current handle. New object is guaranteed to be correctly initialized.
int isFile(void) Returns non-zero result if current handle is associated with a file.
int isDevice(void) Returns non-zero result if current handle is associated with a character device.
unsigned handleInfo(void) Returns information word for current handle.
int readHandle(void) Returns current handle in use by the object, passed originally to Init(int) or opened by Init(char *).
int inputStatus(void) Returns input status for current handle, non-zero (-1) if device or file is ready for input.
int outputStatus(void) Returns output status for current (device) handle, non-zero (-1) if device is ready for output. Not applicable for files.
int isRemote(void) Returns non-zero if current handle refers to a file or device located on a remote computer. Should not normally be used by applications.
class IoctlBlock
IoctlBlock *Init(int drive) Returns a pointer to a new object of type IoctlBlock, returns NULL is specified (1-based) drive is invalid. Specified drive becomes current (block) device. New object guaranteed to be correctly initialized.unsigned driveInfo(void) Returns information word for current device.
int currentDrive(void) Returns 1-based number of current device in use by the object.
int readIoctl(unsigned *count, void *buffer) Receive control data from device driver associated with the current device. Assigns number of characters actually received to count argument. Returns zero on success, or DOS error value if not.
int sendIoctl(unsigned *count, void *buffer) Send control data to device driver associated with the current device. Assigns number of characters actually sent to count argument. Returns zero on successful, or DOS error value if not.
int isRemote(void) Returns non-zero if current device is located on a remote computer.
int isRemovable(void) Returns non-zero if current device contains removable storage media, such as a floppy disk drive, or if device is remote.
int checkAlias(void) Returns the active drive alias (if any) assigned to the current device, zero if no drive aliases have been assigned, or -1 on DOS error.
int nextAlias(int next) Set next active (logical) drive number for the current device and return active drive number, or return -1 on DOS error. Assumes prior call to function checkAlias. Specified drive# is 1-based.
int getParams(struct DEVICEPARAMS *data) Fills a DEVICEPARAMS structure with configuration data related to current device. Returns zero on success, or DOS error value.
int setParams(struct DEVICEPARAMS *data) Sets new configuration data for current device from specified DEVICEPARAMS structure. Returns zero on success, or DOS error value.
int readSectors(struct RWBLOCK *data) Read raw sectors from current device as specified in the RWBLOCK structure. Returns zero on success, or DOS error value.
int writeSectors(struct RWBLOCK *data) Write raw sectors to current device as specified in the RWBLOCK structure. Returns zero on success, or DOS error value.
int getAccessFlag(void) Returns media access flag for current device, zero if access is blocked or media is unformatted.
int setAccessFlag(int flag) Sets media access flag for current device, set to zero to block access to media. Returns new flag state for confirmation.
int formatTrack(int head, int cylinder) Formats and verifies a track on current device at specified head/cylinder location. Returns zero on success, or DOS error value.
int checkFormat(int head, int cylinder) Returns value indicating: presence of ROM support (0), no ROM support present (1), specified format combination is invalid (2), or no media present (3). See reference [2].
int verifyTrack(int head, int cylinder) Verify a track on the current device at specified track location. Returns zero on success, or DOS error value.
int getMediaID(struct MID *mid) Fills a structure of type MID with the volume label, serial number, and file system type for the current device. This data uniquely identifies the storage medium in use. Returns zero if no errors, or DOS error value if an error was encountered.
int setMediaID(struct MID *mid) Sets media ID data for the current device from the given MID structure. Returns zero if no errors, or DOS error value if an error was encountered.
int senseMediaType(struct MTYPE *mtype) Fills a structure of type MTYPE with data pertaining to media type for current device. Returns zero if no errors, or DOS error value if an error was encountered.
int checkFunction(block_cmd cmd) Determines whether the specified Generic Block IOCTL minor code is supported by the device driver for the current device. Function accepts all Generic Block IOCTL minor codes except the get/set access flag. This function is invalid for DOS versions < 5.0. Returns zero if function is supported, 1 or 2 if not supported, 3 if drive is invalid, or 4 if support cannot be determined or DOS version < 5.
class charHandle
charHandle *Init(const char *device) Returns a pointer to a new object of type charHandle, returns NULL if specified device is invalid or refers to a file. Handle of opened device becomes current handle. New object is guaranteed to be correctly initialized.int deviceCat(void) Returns category (Serial, Console, or Parallel) for current device handle.
unsigned setDeviceInfo(unsigned newinfo) Sets new information word for current device handle and returns new word for confirmation, or zero if a DOS error was detected.
int isCooked(void) Returns non-zero if current device handle is in ASCII (translated) mode.
int isRaw(void) Returns non-zero if current device handle is in binary (untranslated) mode.
int hasIoctlChar(void) Returns non-zero if device driver for current device handle supports send/receive IOCTL data, subfunctions 02h and 03h, implemented here by sendIoctl and readIoctl.
int deviceReadyIn(void) Convenience function related to IoctlHandle::inputStatus. Returns non-zero if device is ready for input.
int deviceReadyOut(void) Convenience function related to IoctlHandle::outputStatus. Returns non-zero if device is ready for output.
unsigned sendIoctl(unsigned *count, void *data) Sends control data to device driver associated with current device handle. Re-assigns number of characters actually sent to count argument. Returns 0 on success, or DOS error value if not.
unsigned readIoctl(unsigned *count, void *data) Receive control data from device driver associated with current device handle. Re-assigns number of characters actually received to count argument. Returns zero on success, or DOS error value if not.
unsigned busyCount(void) Returns value (iteration count) indicating number of times a device driver will attempt to send output to a printer device before concluding that the device is busy. Current handle must refer to a printer (LPT1-LPT3). Returns zero on error.
unsigned busyCount(unsigned count) Sets busy (iteration) count for a printer device driver and return new count for confirmation, or zero on error. Current handle must refer to a printer (LPTI-LPT3).
int getANSIdata(struct ANSIdata *data) Fills an ANSIdata struct with data pertaining to ANSI.SYS driver configuration. Current handle must refer to CON device and ANSI.SYS driver must be installed. Returns zero on success, -1 on error.
int setANSIdata(struct ANSIdata *data) Sets new ANSI.SYS driver configuration data from specified ANSIdata struct. Returns zero on success, -1 on error.
class fileHandle
fileHandle *Init(int handle) Returns a pointer to a new object of type fileHandle, returns NULL if specified handle is invalid or refers to a device. Specified handle becomes the current handle. New object is guaranteed to be correctly initialized.fileHandle *Init(const char *path) Returns a pointer to a new object of type IoctlHandle, returns NULL if specified path is invalid, filename does not exist, or is a device name. Handle of opened file/device becomes current handle. New object is guaranteed to be correctly initialized.
int fileEof(void) Convenience function related to IoctlHandle::inputStatus. Returns non-zero if file is currently at end-of-file.
int driveNumber(void) Returns zero-based drive number of disk on which the current (file) handle resides.