RtndControlDeviceSpecialFunction
RtndControlDeviceSpecialFunction controls a special function of a device.
Syntax
BOOL RtndControlDeviceSpecialFunction(
[in] ULONG_PTR RtndInterfaceId,
[in] ULONG FunctionCode,
[in, out] VOID *pFunctionData,
[in] ULONG FunctionDataSize
);
Parameters
[in] Interface
The number or pointer, returned by RtndManageInterface, used to identify the interface
[in] FunctionCode
The code that identifies the function to control.
[in, out] pFunctionData
The address of a buffer containing the function data.
[in] FunctionDataSize
The size, in bytes, of the buffer.
Return Value
If the function succeeds, it returns TRUE. If the function fails, it returns FALSE. Call GetLastError to obtain an error code.
Possible error codes:
| Error code | Meaning |
|---|---|
|
ERROR_INVALID_PARAMETER |
The passed function data doesn’t have the expected size determined by the passed FunctionCode. |
|
ERROR_IO_DEVICE |
An unexpected error occurred while trying to access the device. |
|
ERROR_NOT_SUPPORTED |
The passed FunctionCode is not one of the codes exposed by this driver. |
Remarks
This function is always called from the main thread of the NL2 process.
The values allowed for the FunctionCode parameter are driver dependent. They must not be greater than or equal to 65536.
The driver must verify that the passed FunctionCode corresponds to an existing function and return ERROR_NOT_SUPPORTED if it doesn’t. Also, the driver must verify that the passed FunctionDataSize is correct for the specified function and return ERROR_INVALID_PARAMETER if it isn’t.
Once the above verifications are complete, the driver must perform the requested action based on the function code and function data and write the results directly into the function data buffer.
Typically, a driver should define a data structure for each function code and share both the function codes and the data type definitions with the application.
Characteristics
| Real-time | ||
|
Deterministic |
Not required |
|
|
Shutdown-safe |
Not required |
|
| Local memory usage | ||
|
Process |
External MSpace usage |
Internal MSpace usage |
|
System |
Allowed | Allowed |
|
NL2 process |
Allowed | Allowed |
|
Calling process |
Allowed | Allowed |
| Windows contiguous memory usage | ||
|
Usage |
Allowed |
|
Requirements
| Minimum supported version | Header |
|---|---|
|
wRTOS 1.0 SDK |
Rtnd.h |
See Also: