| 409 | } |
| 410 | |
| 411 | bool USBToolBox::matchingCallback(OSDictionary* matchingDict, IOService* newService, IONotifier* notifier) { |
| 412 | DEBUGLOGPROV("controller callback start"); |
| 413 | newService->retain(); |
| 414 | // These actions are synchronized with invocations of the notification handler, so removing a notification request will guarantee the handler is not being executed. |
| 415 | notifier->remove(); |
| 416 | mergeProperties(newService); |
| 417 | // addMatchingNotification does not consume a reference on the matching dictionary when the notification is removed, unlike addNotification. |
| 418 | // Should never be null, but better safe than sorry. |
| 419 | OSSafeReleaseNULL(matchingDict); |
| 420 | |
| 421 | SYSTEMLOGPROV("Controller notifier callback finished, goodbye!"); |
| 422 | terminate(); |
| 423 | return true; |
| 424 | } |
| 425 | |
| 426 | bool USBToolBox::_matchingCallback(void* target, void* matchingDict, IOService* newService, IONotifier* notifier) { |
| 427 | return static_cast<USBToolBox*>(target)->matchingCallback(static_cast<OSDictionary*>(matchingDict), newService, notifier); |