Post

Replies

Boosts

Views

Activity

Reply to macOS15.3 IOCreatePlugInInterfaceForService returns e00002be.
Background Information: We have a macOS Program A which uses libusb-1.0.27 to access USB Token that comply with the USB Mass Storage protocol. To enable Program A to start automatically after macOS boots, its corresponding plist file has been placed in the /Library/LaunchDaemons directory. Problems: Program A works well on macOS versions prior to 15.3, and it can access USB Token normally. However, update to macOS 15.3, same program Start in a different way,the following abnormal situations have occurred,we try many times: A. Program A launched by launchd cannot access the USB device. Checking the logs reveals that the IOCreatePlugInInterfaceForService call in the darwin_claim_interface function returns the error code e00002be. B. Program A launched from the terminal command line with sudo privileges can access the USB device normally, and the return value of the IOCreatePlugInInterfaceForService call is 0. The simplified code is as follows: #import <Foundation/Foundation.h> #include "libusb.h" #define VENDOR_ID 0x1111 #define PRODUCT_ID 0x2222 int main(int argc, const char * argv[]) { @autoreleasepool { libusb_device_handle *dev_handle; libusb_context *ctx = NULL; int r; r = libusb_init(&ctx); if (r < 0) { return r ; } dev_handle = libusb_open_device_with_vid_pid(ctx, VENDOR_ID, PRODUCT_ID); if (dev_handle == NULL) { libusb_exit(ctx); return -1; } r = libusb_kernel_driver_active(dev_handle, 0); if (r == 1) { r = libusb_detach_kernel_driver(dev_handle, 0); } r = libusb_claim_interface(dev_handle, 0); if (r < 0) { libusb_close(dev_handle); libusb_exit(ctx); return r; } libusb_release_interface(dev_handle, 0); libusb_close(dev_handle); libusb_exit(ctx); } return 0; } libusb logs: darwin_capture_claim_interface dev_handle = 20008000 iface = 0 dev_handle->auto_detach_kernel_driver = 0 darwin_capture_claim_interface darwin_claim_interface darwin_claim_interface IOCreatePlugInInterfaceForService darwin_claim_interface IOCreatePlugInInterfaceForService kresult = e00002be darwin_claim_interface IOCreatePlugInInterfaceForService: out of resources darwin_capture_claim_interface darwin_claim_interface ret = -99
1w