| Previous | Next |
| kIOReturnNotPrivileged | kIOReturnLockedRead |
kIOReturnBadArgument
Validate the API contract before the hardware
kIOReturnBadArgument identifies an invalid argument. The rejected input can be a scalar, structure length, address, count, selector-dependent field, object state, or combination of values. It is therefore usually a caller-contract failure, not evidence that the target device is disconnected or broken.
Capture the request exactly at the API boundary. In particular, a structure with the right C type can still be invalid when its version, size, reserved fields, count, or associated buffer range does not match the active interface. This result is also distinct from kIOReturnBadMessageID and from the more specific alignment error reported by kIOReturnNotAligned.
Checks that narrow it down
- Verify every input range, byte count, pointer lifetime, and selector-specific precondition.
- Confirm that request and response structures match the headers and SDK used to build the caller.
- Log field values and lengths in a redacted, reproducible form before the call.
- Test the minimal documented request, then add optional fields one at a time.
References
Looking for a different code? Search another status or error code.
