Couldn't pass IOConnectCallScalarMethod output greater than 16 elements

According to Communicating Between a DriverKit Extension and a Client App we can use IOConnectCallScalarMethod to send/get data to Driver.

We use unchecked variation of IOConnectCallScalarMethod to call method in our Driver from Client App. In a Driver's method we set arguments->scalarOutputCount greater than 16. However in a Client app outputCount equal to 16, so we can get only a portion of output.

Is 16 limit enforced by IOConnectCallScalarMethod implementation? How we can get more than 16? Should we use IOConnectCallStructMethod instead?

Answered by in 722007022

The max number of elements that can be passed to the "Scalar" arguments for IOConnectCallScalarMethod, IOConnectCallMethod, and friends is 16. If you need to pass more memory than 16 uint64s, please use the "Struct" arguments available for things like IOConnectCallStructMethod and IOConnectCallMethod.

Accepted Answer

The max number of elements that can be passed to the "Scalar" arguments for IOConnectCallScalarMethod, IOConnectCallMethod, and friends is 16. If you need to pass more memory than 16 uint64s, please use the "Struct" arguments available for things like IOConnectCallStructMethod and IOConnectCallMethod.

Couldn't pass IOConnectCallScalarMethod output greater than 16 elements
 
 
Q