VirtualBox

Changeset 2755 in vbox for trunk/src


Ignore:
Timestamp:
May 22, 2007 4:15:09 AM (18 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
21358
Message:

Added a little hack to make sure we catch newly attached devices.

Location:
trunk/src/VBox/Main
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/darwin/iokit.cpp

    r2607 r2755  
    201201    /** The attach notification iterator. */
    202202    io_iterator_t AttachIterator;
     203    /** The 2nd attach notification iterator. */
     204    io_iterator_t AttachIterator2;
    203205    /** The detach notificaiton iterator. */
    204206    io_iterator_t DetachIterator;
    205 
    206207} DARWINUSBNOTIFY, *PDARWINUSBNOTIFY;
    207208
     
    225226
    226227/**
    227  * Callback for the attach notifications.
     228 * Callback for the two attach notifications.
    228229 *
    229230 * @param   pvNotify        Our data.
     
    283284
    284285            /*
    285              * Create the notifcation callback.
     286             * Create the notifcation callbacks.
    286287             */
    287288            kern_return_t rc = IOServiceAddMatchingNotification(pNotify->NotifyPort,
     
    295296                darwinDrainIterator(pNotify->AttachIterator);
    296297                rc = IOServiceAddMatchingNotification(pNotify->NotifyPort,
    297                                                       kIOTerminatedNotification,
     298                                                      kIOMatchedNotification,
    298299                                                      IOServiceMatching(kIOUSBDeviceClassName),
    299                                                       darwinUSBDetachNotification,
     300                                                      darwinUSBAttachNotification,
    300301                                                      pNotify,
    301                                                       &pNotify->DetachIterator);
     302                                                      &pNotify->AttachIterator2);
    302303                if (rc == KERN_SUCCESS)
    303304                {
    304                     darwinDrainIterator(pNotify->DetachIterator);
    305                     return pNotify;
     305                    darwinDrainIterator(pNotify->AttachIterator2);
     306                    rc = IOServiceAddMatchingNotification(pNotify->NotifyPort,
     307                                                          kIOTerminatedNotification,
     308                                                          IOServiceMatching(kIOUSBDeviceClassName),
     309                                                          darwinUSBDetachNotification,
     310                                                          pNotify,
     311                                                          &pNotify->DetachIterator);
     312                    {
     313                        darwinDrainIterator(pNotify->DetachIterator);
     314                        return pNotify;
     315                    }
     316                    IOObjectRelease(pNotify->AttachIterator2);
    306317                }
    307318                IOObjectRelease(pNotify->AttachIterator);
     
    331342    IOObjectRelease(pNotify->AttachIterator);
    332343    pNotify->AttachIterator = NULL;
     344    IOObjectRelease(pNotify->AttachIterator2);
     345    pNotify->AttachIterator2 = NULL;
    333346    IOObjectRelease(pNotify->DetachIterator);
    334347    pNotify->DetachIterator = NULL;
  • trunk/src/VBox/Main/include/USBProxyService.h

    r2600 r2755  
    237237    /** The opaque value returned by DarwinSubscribeUSBNotifications. */
    238238    void *mNotifyOpaque;
     239    /** A hack to work around the problem with the usb device enumration
     240     * not including newly attached devices. */
     241    bool mWaitABitNextTime;
    239242};
    240243# endif /* __DARWIN__ */
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette