DeviceIoControl

Description:
Sends a control code directly to a specified device driver, causing the corresponding device to perform the corresponding operation.

Syntax:

BOOL WINAPI DeviceIoControl( __in HANDLE hDev, __in DWORD dwIoControlCode, __in_opt LPVOID lpInBuffer, __in DWORD nInBufferSize, __out_opt LPVOID lpOutBuffer, __in DWORD nOutBufferSize, __out_opt LPDWORD lpBytesReturned, __inout_opt LPOVERLAPPED lpOverlapped );

Parameters:

Parameter Description
hDev A handle to the device obtained by CreateFile.
dwIoControlCode The control code for the operation. This value identifies the specific operation to be performed and the type of device on which to perform it.
For a list of the control codes, see table "Supported control codes"
lpInBuffer A pointer to the input buffer that contains the data required to perform the operation. The format of this data depends on the value of the dwIoControlCode parameter.

This parameter can be NULL if dwIoControlCode specifies an operation that does not require input data.
nInBufferSize The size of the input buffer, in bytes.
lpOutBuffer A pointer to the output buffer that is to receive the data returned by the operation. The format of this data depends on the value of the dwIoControlCode parameter.

This parameter can be NULL if dwIoControlCode specifies an operation that does not return data.
nOutBufferSize The size of the output buffer, in bytes.
lpBytesReturned A pointer to a variable that receives the size of the data stored in the output buffer, in bytes.
lpOverlapped A pointer to an OVERLAPPED structure is required if the hDev parameter was opened with FILE_FLAG_OVERLAPPED, otherwise it can be NULL.
If hDev is opened with FILE_FLAG_OVERLAPPED, the lpOverlapped parameter must point to a valid and unique OVERLAPPED structure, otherwise the function can incorrectly report that the operation is complete.

Return Value:
If the operation completes successfully, the return value is nonzero.
If the operation fails or is pending, the return value is zero. To get extended error information, call GetLastError.

Possible errors are specific for corresponded control code (see table "Supported control codes" ).

Supported control codes:

Control code Description
IOCTL_FARC_GET_SWVERSION query the software version of the driver
IOCTL_FARC_GET_CARDID  query the manufacturer of the ARCNET adapter
IOCTL_FARC_INIT initialize the driver, join the network
IOCTL_FARC_GET_USEDDCB query the currently used DCB
IOCTL_FARC_GET_NETSTATE query the net state
IOCTL_FARC_GET_NEXTNODEID query the next-Node-ID of the ARCNET-controller
IOCTL_FARC_GET_INTERRUPTS query the interrupts occured since the initialization of the card
IOCTL_FARC_DEINIT deinitialization of the driver, disconnect from ARCNET
IOCTL_FARC_GET_RXSTATUS check out if any packets have been received since the last ReadFile
IOCTL_FARC_DISABLE_RECEIVE disable receiver of the ARCNET controller
IOCTL_FARC_ENABLE_RECEIVE reenable receiver of the ARCNET controller (after IOCTL_FARC_DISABLE_RECEIVE)
IOCTL_FARC_GET_EXTNODEID get the nodeid, that is set on the adapter
IOCTL_FARC_EXTND_FUNCTIONS set/get extended parameters (20019, 20022, 20020C only)
IOCTL_FARC_NETMAP_SETTINGS settings for netmap build
IOCTL_FARC_GET_NETMAP retrieve current netmap
IOCTL_FARC_GET_RESOURCE_USAGE retrieve info about usage of hardware resources (+5V, -12V)
IOCTL_FARC_SET_READ_TIMEOUT set timeout for ReadFile operations
IOCTL_FARC_GET_READ_TIMEOUT get (previously set) timeout for ReadFile operations
IOCTL_FARC_GET_HW_VERSIONS query the serial number of the hardware, hardware version and firmware version
IOCTL_FARC_ARC_TRANSMITTER_CTRL enable/disable the transmitter
IOCTL_FARC_GET_RECONS query reconfigurations detected by the controller
Back to Programming Guide Contact Copyright and Disclaimer