VirtualBox

Changeset 3415 in vbox


Ignore:
Timestamp:
Jul 4, 2007 3:21:30 PM (18 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
22620
Message:

(re-)run filters when the device becomes available (again).

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

Legend:

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

    r3034 r3415  
    20822082        aDevice->handlePendingStateChange();
    20832083    }
     2084    else if (   aDevice->state() == USBDeviceState_USBDeviceAvailable
     2085             || aDevice->state() == USBDeviceState_USBDeviceBusy)
     2086    {
     2087        /* The device has gone from being unavailable (not subject to filters) to being
     2088           available / busy. This transition can be triggered by udevd or manual
     2089           permission changes on Linux. On all systems may be triggered by the host
     2090           ceasing to use the device - like unmounting an MSD in the Finder or invoking
     2091           the "Safely remove XXXX" stuff on Windows (perhaps). */
     2092        ComObjPtr <HostUSBDevice> device (aDevice);
     2093        HRESULT rc = applyAllUSBFilters (device);
     2094        AssertComRC (rc);
     2095    }
    20842096    else
    20852097    {
  • trunk/src/VBox/Main/HostUSBDeviceImpl.cpp

    r3303 r3415  
    915915 *  @param   aDev    The current device state as seen by the proxy backend.
    916916 *
     917 *  @return Whether the Host object should be bothered with this state change.
     918 *
    917919 *  @note Locks this object for writing.
    918920 */
     
    949951     * change it later and, e.g. re-run all USB filters when the device goes from
    950952     * from Busy to Available).
     953     *
     954     * 2007-07-04: State transitions from Unavailable to Busy or Available
     955     *             are now considered important and will cause filters to
     956     *             be rerun on the device. (See #2030 and #1870.)
    951957     */
    952958
     
    991997                case USBDeviceState_USBDeviceBusy:
    992998                    return false;
    993                 /* the following state changes don't require any action for now */
    994                 case USBDeviceState_USBDeviceUnavailable:
    995999                case USBDeviceState_USBDeviceAvailable:
    9961000                    isImportant = false;
     
    10031007#endif
    10041008                default:
     1009                    /* USBDeviceState_USBDeviceUnavailable: The device has become capturable, re-run filters. */
     1010                    /* USBDeviceState_USBDeviceHeld:        Pending request. */
     1011                    /* USBDeviceState_USBDeviceCaptured:    Pending request. */
     1012                    /* USBDeviceState_USBDeviceNotSupported: Something is broken. */
    10051013                    isImportant = true;
    10061014            }
     
    10231031#endif
    10241032                /* the following state changes don't require any action for now */
    1025                 case USBDeviceState_USBDeviceUnavailable:
    10261033                case USBDeviceState_USBDeviceBusy:
    10271034                    isImportant = false;
    10281035                    break;
    10291036                default:
     1037                /* USBDeviceState_USBDeviceUnavailable: The device has become available, re-run filters. */
     1038                /* USBDeviceState_USBDeviceHeld:        Pending request. */
     1039                /* USBDeviceState_USBDeviceNotSupported: Something is broken. */
    10301040                    isImportant = true;
    10311041            }
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