VirtualBox

Changeset 8484 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Apr 30, 2008 12:12:33 AM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
30356
Message:

Darwin USB fixes.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/HostImpl.cpp

    r8475 r8484  
    14811481 *  to the new locking scheme).
    14821482 */
    1483 HRESULT Host::detachAllUSBDevices (SessionMachine *aMachine, BOOL aDone)
     1483HRESULT Host::detachAllUSBDevices (SessionMachine *aMachine, BOOL aDone, bool aAbnormal)
    14841484{
    14851485    AutoWriteLock alock (this);
     
    15001500             */
    15011501            bool fRunFilters = false;
    1502             HRESULT hrc = device->onDetachFromVM(aMachine, aDone, &fRunFilters);
     1502            HRESULT hrc = device->onDetachFromVM(aMachine, aDone, &fRunFilters, aAbnormal);
    15031503            if (    SUCCEEDED(hrc)
    15041504                &&  fRunFilters)
  • trunk/src/VBox/Main/MachineImpl.cpp

    r8388 r8484  
    74017401    }
    74027402
     7403#ifdef VBOX_WITH_USB
    74037404    /* release all captured USB devices */
    74047405    if (aReason == Uninit::Abnormal && lastState >= MachineState_Running)
     
    74087409         * Console::detachAllUSBDevices() will be called upon successful
    74097410         * termination. So, we need to release USB devices only if there was
    7410          * an abnormal termination of a running VM. */
    7411         DetachAllUSBDevices (TRUE /* aDone */);
    7412     }
     7411         * an abnormal termination of a running VM.
     7412         *
     7413         * This is identical to SessionMachine::DetachAllUSBDevices except
     7414         * for the aAbnormal argument. */
     7415        HRESULT rc = mUSBController->notifyProxy (false /* aInsertFilters */);
     7416        AssertComRC (rc);
     7417        NOREF (rc);
     7418
     7419        mParent->host()->detachAllUSBDevices (this, true /* aDone */, true /* aAbnormal */);
     7420    }
     7421#endif /* VBOX_WITH_USB */
    74137422
    74147423    if (!mData->mSession.mType.isNull())
     
    76827691    NOREF (rc);
    76837692
    7684     return mParent->host()->detachAllUSBDevices (this, aDone);
     7693    return mParent->host()->detachAllUSBDevices (this, aDone, false /* aAbnormal */);
    76857694#else
    76867695    return S_OK;
  • trunk/src/VBox/Main/darwin/iokit.cpp

    r8155 r8484  
    11081108                 */
    11091109                irc = (*ppDevI)->USBDeviceReEnumerate(ppDevI, 0);
    1110                 if (irc != kIOReturnSuccess)
     1110                if (irc == kIOReturnSuccess)
     1111                    vrc = VINF_SUCCESS;
     1112                else
    11111113                {
    11121114                    LogRel(("USB: Failed to open device '%s', plug-in creation failed with irc=%#x.\n", pszAddress, irc));
  • trunk/src/VBox/Main/include/HostImpl.h

    r8471 r8484  
    117117    HRESULT detachUSBDevice (SessionMachine *aMachine, INPTR GUIDPARAM aId, BOOL aDone);
    118118    HRESULT autoCaptureUSBDevices (SessionMachine *aMachine);
    119     HRESULT detachAllUSBDevices (SessionMachine *aMachine, BOOL aDone);
     119    HRESULT detachAllUSBDevices (SessionMachine *aMachine, BOOL aDone, bool aAbnormal);
    120120
    121121    void onUSBDeviceAttached (HostUSBDevice *aDevice);
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