Hi, In my app I'm using: kernResult = IOServiceAddMatchingNotification( notificationObject, kIOFirstMatchNotification, IOServiceMatching(kIOUSBDeviceClassName), callback, handler, &mediaIteratorAdded ); while (IOIteratorNext(mediaIteratorAdded)); CFRunLoopAddSource(CFRunLoopGetCurrent(), IONotificationPortGetRunLoopSource(notificationObject), kCFRunLoopDefaultMode); CFRunLoopRun();
and running it in a separated POSIX thread. Whenever I insert a USB pen drive, my callback() is called, but somehow this prevents the USB drive from mounting as /dev/rdisk2 etc. I not only need the notification, which I'm getting but also need the device to be mounted. Subsequently even if I quit the program and then reinsert, it doesn't get mounted. I then have to restart the computer (with device inserted) to get it mounted. If I restart the computer and then insert the device, it doesn't get mounted. I'm using Leopard.
What gets wrong with the device? Please help.
Wishes, Nick
|