Question

When trying to open the service for a driver (with a user client per the SimpleUserClient example) I am writing, IOServiceOpen returns 0x10000003 (MACH_SEND_INVALID_REQUEST):

mach_port_t machPort = mach_task_self();
kern_return_t kernResult;
io_service_t service;

classesToMatch = IOServiceNameMatching(DRIVER_NAME);

kernResult = IOServiceGetMatchingServices(kIOMasterPortDefault, classesToMatch, &iterator); 

while ((service = IOIteratorNext(iterator)) != IO_OBJECT_NULL){
    kernResult = IOServiceOpen(service, machPort, 0, &connect);

    if (kernResult != KERN_SUCCESS){
        //0x10000003 = MACH_SEND_INVALID_DEST causes a return false here
        fprintf(stderr, "IOServiceOpen returned 0x%08x - machPort is %lu\n"), kernResult, machPort);
        return false;
    }
}

Therefore, the service is never opened.

Was it helpful?

Solution

You need to add a dictionary entry to the driver personality to say what the user client class is called in the code:

IOUserClientClass:     com_MyCompany_driver_MyDriverUserClient
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top