Our product is using IOKit framework for monitoring USB device activities. We have used IOKit framework for getting the notification for USB plugin and un-plugins. With the macOS version 15.3 we are started seeing issue with it. When the notification is received during USB plugin/connection, we are unable to get IOUSBDeviceInterface object which will be used for further processing. Currently we are seeing the below error every time, while trying to create the IO plugin interface using IOCreatePlugInInterfaceForService API: create plugin Error: (0xe00002be): (iokit/common) resource shortage
Due to this the we are unable to proceed with the flow further and the entire flow is broken. These logics work fine in macOS version 15.2 and lower versions without any issues.
logic used:
USBDevice::initInterfaceInterfaceByIOService(io_service_t entry)
{
IOCFPlugInInterface** plugInInterface = NULL;
IOUSBInterfaceInterface** interface = NULL;
SInt32 score = 0;
mach_error_code err =
IOCreatePlugInInterfaceForService(entry, kIOUSBInterfaceUserClientTypeID, kIOCFPlugInInterfaceID, &plugInInterface, &score);
if ((err != 0) || (!plugInInterface)) {
os_log_error(OS_LOG_DEFAULT, "Unable to create plugin \n");
return nullptr;
}
auto result = (*plugInInterface)->QueryInterface(plugInInterface, CFUUIDGetUUIDBytes(kIOUSBInterfaceInterfaceID), (LPVOID*)&interface);
(*plugInInterface)->Release(plugInInterface);
if (result || !interface) {
os_log_error(OS_LOG_DEFAULT, "Unable to create interface \n");
return nullptr;
}
return interface;
}