Device IO API.
More...
Go to the source code of this file.
|
| typedef void | devio_backend_t |
| | Catchall device IO backend type.
|
| |
|
typedef char | device_service_t[0x4c] |
| |
|
| devio_descriptor_t * | CreateFile (const char *pathname, unsigned int access, unsigned int shmode, void *secattr, unsigned int on_noentry, unsigned int flags, void *template_file) |
| | Open or create a file/device by its pathname.
|
| |
| bool | ReadFile (devio_descriptor_t *devfd, void *buf, size_t size, size_t *actual_size, void *overlapped) |
| | Read/receive data from a device IO descriptor.
|
| |
| bool | WriteFile (devio_descriptor_t *devfd, const void *buf, size_t size, size_t *actual_size, void *overlapped) |
| | Write/send data to a device IO descriptor.
|
| |
| bool | DeviceIoControl (devio_descriptor_t *devfd, int request, const void *in, int inlen, void *out, int outlen, int *retlen, void *overlapped) |
| | Send an IOCTL request to a device IO descriptor devfd.
|
| |
| bool | CloseHandle (devio_descriptor_t *devfd) |
| | Close a device IO descriptor.
|
| |
◆ DEVIO_DESC_INVALID
Invalid descriptor.
This is usually returned by CreateFile() when an error occurred.
◆ DEVIO_DESC_MAGIC
| #define DEVIO_DESC_MAGIC (0x48435842u) |
Magic for device IO descriptor.
The value is ASCII "BXCH".
◆ devio_backend_t
Catchall device IO backend type.
- Todo:
- Add more details.
◆ CloseHandle()
Close a device IO descriptor.
Analogous to the Windows CloseHandle() API.
- Syscall Number
0x102ad
- Parameters
-
| devfd | Descriptor to close. |
- Return values
-
| true | The operation was completed successfully. |
| false | The operation failed with error. |
◆ CreateFile()
| devio_descriptor_t * CreateFile |
( |
const char * |
pathname, |
|
|
unsigned int |
access, |
|
|
unsigned int |
shmode, |
|
|
void * |
secattr, |
|
|
unsigned int |
on_noentry, |
|
|
unsigned int |
flags, |
|
|
void * |
template_file |
|
) |
| |
|
extern |
Open or create a file/device by its pathname.
Analogous to the Windows CreateFile() API.
- Todo:
- Documentation on accepted arguments are mostly based on speculations at this moment. More details and through verifications needed.
- Syscall Number
0x102a7
- Parameters
-
| pathname | DOS 8.3 path to the file to be opened. |
| access | Access flags. |
| shmode | File sharing mode. (?) |
| secattr | Seems to be ignored. |
| on_noentry | Behavior when entry does not exist. (?) |
| flags | Flags and attributes of the file. (?) |
| template_file | Seems to be ignored. |
- Returns
- Device IO descriptor.
◆ DeviceIoControl()
| bool DeviceIoControl |
( |
devio_descriptor_t * |
devfd, |
|
|
int |
request, |
|
|
const void * |
in, |
|
|
int |
inlen, |
|
|
void * |
out, |
|
|
int |
outlen, |
|
|
int * |
retlen, |
|
|
void * |
overlapped |
|
) |
| |
|
extern |
Send an IOCTL request to a device IO descriptor devfd.
Analogous to the Windows DeviceIoControl() API.
- Syscall Number
0x102ac
- Parameters
-
| devfd | Device IO descriptor. |
| request | IOCTL request type. |
| in | The input buffer, or NULL if not applicable. |
| inlen | The size of the input buffer in bytes. |
| out | The output buffer, or NULL if not applicable. |
| outlen | The size of the output buffer in bytes. |
| retlen | The size of returned data (if applicable). |
| overlapped | Probably ignored. |
- Return values
-
| true | The operation was completed successfully. |
| false | The operation failed with error. |
◆ ReadFile()
| bool ReadFile |
( |
devio_descriptor_t * |
devfd, |
|
|
void * |
buf, |
|
|
size_t |
size, |
|
|
size_t * |
actual_size, |
|
|
void * |
overlapped |
|
) |
| |
|
extern |
Read/receive data from a device IO descriptor.
Analogous to the Windows ReadFile() API.
- Syscall Number
0x102a9
- Parameters
-
| devfd | The device IO descriptor. |
| [out] | buf | Buffer to hold data read from the descriptor. |
| size | Number of bytes to read. |
| [out] | actual_size | Number of bytes actually read. |
| overlapped | Reserved. |
- Return values
-
| true | The operation was completed successfully. |
| false | The operation failed with error. |
◆ WriteFile()
| bool WriteFile |
( |
devio_descriptor_t * |
devfd, |
|
|
const void * |
buf, |
|
|
size_t |
size, |
|
|
size_t * |
actual_size, |
|
|
void * |
overlapped |
|
) |
| |
|
extern |
Write/send data to a device IO descriptor.
Analogous to the Windows WriteFile() API.
- Syscall Number
0x102aa
- Parameters
-
| devfd | The device IO descriptor. |
| [in] | buf | Buffer to hold data to be written to the descriptor. |
| size | Number of bytes to write. |
| [out] | actual_size | Number of bytes actually written. |
| overlapped | Reserved. |
- Return values
-
| true | The operation was completed successfully. |
| false | The operation failed with error. |