VirtualBox

Changeset 5528 in vbox


Ignore:
Timestamp:
Oct 26, 2007 6:28:10 PM (17 years ago)
Author:
vboxsync
Message:

Added PortVersion and Version attributes for obtaining the major USB version of the port and the device respectively.

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

Legend:

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

    r4071 r5528  
    273273    ///@todo implement
    274274    aPort = 0;
     275
     276    return S_OK;
     277}
     278
     279STDMETHODIMP HostUSBDevice::COMGETTER(Version)(USHORT *aVersion)
     280{
     281    if (!aVersion)
     282        return E_INVALIDARG;
     283
     284    AutoCaller autoCaller (this);
     285    CheckComRCReturnRC (autoCaller.rc());
     286
     287    AutoReaderLock alock (this);
     288
     289    *aVersion = mUsb->bcdUSB >> 8;
     290
     291    return S_OK;
     292}
     293
     294STDMETHODIMP HostUSBDevice::COMGETTER(PortVersion)(USHORT *aPortVersion)
     295{
     296    if (!aPortVersion)
     297        return E_INVALIDARG;
     298
     299    AutoCaller autoCaller (this);
     300    CheckComRCReturnRC (autoCaller.rc());
     301
     302    AutoReaderLock alock (this);
     303
     304    /** @todo implement this correctly or things just won't work right, see the vista defect. */
     305    *aPortVersion = mUsb->bcdUSB >> 8;
    275306
    276307    return S_OK;
  • trunk/src/VBox/Main/RemoteUSBDeviceImpl.cpp

    r4071 r5528  
    7070
    7171    mPort         = pDevDesc->idPort;
     72    mVersion      = pDevDesc->bcdUSB >> 8;
     73    mPortVersion  = mVersion; /** @todo fix this */
    7274
    7375    mState        = USBDeviceState_USBDeviceAvailable;
     
    208210}
    209211
     212STDMETHODIMP RemoteUSBDevice::COMGETTER(Version) (USHORT *aVersion)
     213{
     214    if (!aVersion)
     215        return E_INVALIDARG;
     216
     217    AutoLock alock (this);
     218    CHECK_READY();
     219
     220    *aVersion = mVersion;
     221    return S_OK;
     222}
     223
     224STDMETHODIMP RemoteUSBDevice::COMGETTER(PortVersion) (USHORT *aPortVersion)
     225{
     226    if (!aPortVersion)
     227        return E_INVALIDARG;
     228
     229    AutoLock alock (this);
     230    CHECK_READY();
     231
     232    *aPortVersion = mPortVersion;
     233    return S_OK;
     234}
     235
    210236STDMETHODIMP RemoteUSBDevice::COMGETTER(Remote) (BOOL *aRemote)
    211237{
  • trunk/src/VBox/Main/USBDeviceImpl.cpp

    r4071 r5528  
    2929
    3030    mPort = 0;
     31    mVersion = mPortVersion = 1;
    3132    mRemote = FALSE;
    3233}
     
    7778    ComAssertComRCRet (hrc, hrc);
    7879
     80    hrc = aUSBDevice->COMGETTER(Port)(&mVersion);
     81    ComAssertComRCRet (hrc, hrc);
     82
     83    hrc = aUSBDevice->COMGETTER(Port)(&mPortVersion);
     84    ComAssertComRCRet (hrc, hrc);
     85
    7986    hrc = aUSBDevice->COMGETTER(Remote)(&mRemote);
    8087    ComAssertComRCRet (hrc, hrc);
     
    253260}
    254261
     262STDMETHODIMP OUSBDevice::COMGETTER(Version)(USHORT *aVersion)
     263{
     264    if (!aVersion)
     265        return E_POINTER;
     266
     267    AutoLock lock(this);
     268    CHECK_READY();
     269
     270    *aVersion = mVersion;
     271    return S_OK;
     272}
     273
     274STDMETHODIMP OUSBDevice::COMGETTER(PortVersion)(USHORT *aPortVersion)
     275{
     276    if (!aPortVersion)
     277        return E_POINTER;
     278
     279    AutoLock lock(this);
     280    CHECK_READY();
     281
     282    *aPortVersion = mPortVersion;
     283    return S_OK;
     284}
     285
    255286STDMETHODIMP OUSBDevice::COMGETTER(Remote)(BOOL *aRemote)
    256287{
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r5390 r5528  
    78867886  <interface
    78877887     name="IUSBDevice" extends="$unknown"
    7888      uuid="c5ab8d05-1999-4e48-ae34-cdeb235aacf0"
     7888     uuid="850af07b-9ee8-48c2-b6b0-f6d0acbf63c3"
    78897889     wsmap="managed"
    78907890     >
     
    79387938        Host USB port number the device is physically
    79397939        coonected to.
     7940      </desc>
     7941    </attribute>
     7942
     7943    <attribute name="version" type="unsigned short" readonly="yes">
     7944      <desc>
     7945        The major USB version of the device - 1 or 2.
     7946      </desc>
     7947    </attribute>
     7948
     7949    <attribute name="portVersion" type="unsigned short" readonly="yes">
     7950      <desc>
     7951        The major USB version of the host USB port the device is
     7952        physically coonected to - 1 or 2. For devices not connected to
     7953        anything this will have the same value as the version attribute.
    79407954      </desc>
    79417955    </attribute>
  • trunk/src/VBox/Main/include/HostUSBDeviceImpl.h

    r4071 r5528  
    7474    STDMETHOD(COMGETTER(Address))(BSTR *aAddress);
    7575    STDMETHOD(COMGETTER(Port))(USHORT *aPort);
     76    STDMETHOD(COMGETTER(Version))(USHORT *aVersion);
     77    STDMETHOD(COMGETTER(PortVersion))(USHORT *aPortVersion);
    7678    STDMETHOD(COMGETTER(Remote))(BOOL *aRemote);
    7779
  • trunk/src/VBox/Main/include/RemoteUSBDeviceImpl.h

    r4071 r5528  
    6363    STDMETHOD(COMGETTER(Address)) (BSTR *aAddress);
    6464    STDMETHOD(COMGETTER(Port)) (USHORT *aPort);
     65    STDMETHOD(COMGETTER(Version)) (USHORT *aVersion);
     66    STDMETHOD(COMGETTER(PortVersion)) (USHORT *aPortVersion);
    6567    STDMETHOD(COMGETTER(Remote)) (BOOL *aRemote);
    6668
     
    108110
    109111    uint16_t mPort;
     112    uint16_t mVersion;
     113    uint16_t mPortVersion;
    110114
    111115    USBDeviceState_T mState;
  • trunk/src/VBox/Main/include/USBDeviceImpl.h

    r4071 r5528  
    6262    STDMETHOD(COMGETTER(Address))(BSTR *aAddress);
    6363    STDMETHOD(COMGETTER(Port))(USHORT *aPort);
     64    STDMETHOD(COMGETTER(Version))(USHORT *aVersion);
     65    STDMETHOD(COMGETTER(PortVersion))(USHORT *aPortVersion);
    6466    STDMETHOD(COMGETTER(Remote))(BOOL *aRemote);
    6567
     
    8991    /** The host specific address of the device. */
    9092    Bstr mAddress;
    91 
     93    /** The host port number. */
    9294    USHORT mPort;
     95    /** The major USB version number of the device. */
     96    USHORT mVersion;
     97    /** The major USB version number of the port the device is attached to. */
     98    USHORT mPortVersion;
     99    /** Remote (VRDP) or local device. */
    93100    BOOL mRemote;
    94101};
Note: See TracChangeset for help on using the changeset viewer.

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