IOKit based kext is visible in kextstat but not in ioreg in 10.13.4

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.)

Replies

After further investigation, the problem seem to be connected to the core driver itself and not the client drivers.


Somehow, after I load the core driver which has IOProviderClass=IOResources, I cannot see it's instance, but only it's record in kextstat (which disappear after a while since it's unused).


However, from what i understand, IOResources dependant drivers should be up even without depedencies...