Hi,
I've got iokit based class, that have IOUserClientClass which connected by user-space process using IOServiceGetMatchingService function.
my code looks roughly like this :
KextManagerLoadKextWithURL(driverPath, NULL); // load the driver
classToMatch = IOServiceMatching(MY_USERCLIENT_CLASS);
do {
CFRetain(classToMatch); // to be released by IOServiceGetMatchingService
serviceObject = IOServiceGetMatchingService(kIOMasterPortDefault, classToMatch);
if (!serviceObject) {
os_log_info(g_logger, "Waiting for driver to become available");
sleep(1);
}
} while (!serviceObject)
IOServiceGetMatchingService(kIOMasterPortDefault, classToMatch); // connect the driver using Client class
However, while trying to deploy the product in 10.13.4, I keep failing IOServiceGetMatchingService method, and only after restart it succeed.
Perhaps there's any way to debug the issue (I don't see anything unusual in the log console.)