Rtnl2ControlDeviceSpecialFunction
Rtnl2ControlDeviceSpecialFunction controls a special function of a device.
Syntax
BOOL Rtnl2ControlDeviceSpecialFunction(
[in] RTNL2_HINTERFACE Interface,
[in] ULONG FunctionCode,
[in, out] VOID *pFunctionData,
[in] ULONG FunctionDataSize
);
Parameters
[in] Interface
A handle to the owning 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_NOT_READY |
The calling process has not called Rtnl2Init. |
|
ERROR_INVALID_PARAMETER |
One of the following conditions occurred:
|
|
ERROR_NOT_SUPPORTED |
One of the following conditions occurred:
|
|
ERROR_BUFFER_OVERFLOW |
The passed function data is too large. |
|
RTNL2_ERROR_SERIALIZED_COMMAND_TIMEOUT |
The NL2 process didn’t reply within an acceptable amount of time. |
|
RTNL2_ERROR_NO_MORE_COMMUNICATION |
Unable to communicate with the NL2 process. This might be because the NL2 process is no longer running, or because an application process thread was terminated during a previous call to an NL2 API function. |
Remarks
The allowed values for the FunctionCode parameter depend on the target driver. The value cannot be greater than or equal to 65536. If data is needed to control the function, the application must allocate an adequate buffer and pass it to the function. If the function returns a result, it is written to that same buffer.
Typically, the target driver specifies the data structures associated with each possible function code. The application allocates the data structure, populates the potential input fields, passes the data to the API function, and then extracts the potential output fields from the same data structure.
Characteristics
| Real-time | ||
|
Deterministic |
Depends on the target driver |
|
|
Shutdown-safe |
Depends on the target driver |
|
| Local memory usage | ||
|
Process |
External MSpace usage |
Internal MSpace usage |
|
System |
Depends on the target driver | Depends on the target driver |
|
NL2 process |
Depends on the target driver | Depends on the target driver |
|
Calling process |
Depends on the target driver | Depends on the target driver |
| Windows contiguous memory usage | ||
|
Usage |
Depends on the target driver |
|
Requirements
| Minimum supported version | Header | Library |
|---|---|---|
|
wRTOS 1.0 SDK |
Rtnl2Api.h |
Rtnl2Api.lib |
See Also: