VirtualBox

Changeset 50403 in vbox for trunk/src/VBox/Main/src-client


Ignore:
Timestamp:
Feb 10, 2014 6:53:47 PM (11 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
92164
Message:

6813 - src-client/USBDeviceImpl.cpp

Location:
trunk/src/VBox/Main/src-client
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-client/ConsoleImpl.cpp

    r50033 r50403  
    29382938    while (it != mUSBDevices.end())
    29392939    {
    2940         if ((*it)->id() == uuid)
     2940        if ((*it)->i_id() == uuid)
    29412941        {
    29422942            pUSBDevice = *it;
     
    52115211    while (it != mUSBDevices.end())
    52125212    {
    5213         LogFlowThisFunc(("it={%RTuuid}\n", (*it)->id().raw()));
    5214         if ((*it)->id() == Uuid)
     5213        LogFlowThisFunc(("it={%RTuuid}\n", (*it)->i_id().raw()));
     5214        if ((*it)->i_id() == Uuid)
    52155215        {
    52165216            pUSBDevice = *it;
     
    82878287        AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    82888288        mUSBDevices.push_back(pUSBDevice);
    8289         LogFlowFunc(("Attached device {%RTuuid}\n", pUSBDevice->id().raw()));
     8289        LogFlowFunc(("Attached device {%RTuuid}\n", pUSBDevice->i_id().raw()));
    82908290
    82918291        /* notify callbacks */
     
    83658365    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    83668366    LogFlowThisFunc(("Detaching USB proxy device {%RTuuid}...\n",
    8367                      aHostDevice->id().raw()));
     8367                     aHostDevice->i_id().raw()));
    83688368
    83698369    /*
     
    83778377        setErrorStatic(hrc2, "GetRemote() failed");
    83788378
    8379     PCRTUUID pUuid = aHostDevice->id().raw();
     8379    PCRTUUID pUuid = aHostDevice->i_id().raw();
    83808380    if (fRemote)
    83818381    {
  • trunk/src/VBox/Main/src-client/USBDeviceImpl.cpp

    r44528 r50403  
    6868    ComAssertComRCRet(hrc, hrc);
    6969
    70     hrc = aUSBDevice->COMGETTER(Manufacturer)(unconst(mData.manufacturer).asOutParam());
    71     ComAssertComRCRet(hrc, hrc);
    72 
    73     hrc = aUSBDevice->COMGETTER(Product)(unconst(mData.product).asOutParam());
    74     ComAssertComRCRet(hrc, hrc);
    75 
    76     hrc = aUSBDevice->COMGETTER(SerialNumber)(unconst(mData.serialNumber).asOutParam());
    77     ComAssertComRCRet(hrc, hrc);
    78 
    79     hrc = aUSBDevice->COMGETTER(Address)(unconst(mData.address).asOutParam());
    80     ComAssertComRCRet(hrc, hrc);
     70    BSTR tmp;
     71    BSTR *bptr = &tmp;
     72
     73    hrc = aUSBDevice->COMGETTER(Manufacturer)(bptr);
     74    ComAssertComRCRet(hrc, hrc);
     75    unconst(mData.manufacturer) = Utf8Str(tmp);
     76
     77    hrc = aUSBDevice->COMGETTER(Product)(bptr);
     78    ComAssertComRCRet(hrc, hrc);
     79    unconst(mData.product) = Utf8Str(tmp);
     80
     81    hrc = aUSBDevice->COMGETTER(SerialNumber)(bptr);
     82    ComAssertComRCRet(hrc, hrc);
     83    unconst(mData.serialNumber) = Utf8Str(tmp);
     84
     85    hrc = aUSBDevice->COMGETTER(Address)(bptr);
     86    ComAssertComRCRet(hrc, hrc);
     87    unconst(mData.address) = Utf8Str(tmp);
    8188
    8289    hrc = aUSBDevice->COMGETTER(Port)(&unconst(mData.port));
     
    8693    ComAssertComRCRet(hrc, hrc);
    8794
    88     hrc = aUSBDevice->COMGETTER(Port)(&unconst(mData.portVersion));
     95    hrc = aUSBDevice->COMGETTER(Version)(&unconst(mData.portVersion));
    8996    ComAssertComRCRet(hrc, hrc);
    9097
     
    144151 * @param   aId   Address of result variable.
    145152 */
    146 STDMETHODIMP OUSBDevice::COMGETTER(Id)(BSTR *aId)
    147 {
    148     CheckComArgOutPointerValid(aId);
    149 
    150     AutoCaller autoCaller(this);
    151     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    152 
    153     /* this is const, no need to lock */
    154     Guid(mData.id).toUtf16().detachTo(aId);
     153HRESULT OUSBDevice::getId(com::Guid &aId)
     154{
     155    /* this is const, no need to lock */
     156    aId = mData.id;
    155157
    156158    return S_OK;
     
    164166 * @param   aVendorId   Where to store the vendor id.
    165167 */
    166 STDMETHODIMP OUSBDevice::COMGETTER(VendorId)(USHORT *aVendorId)
    167 {
    168     CheckComArgOutPointerValid(aVendorId);
    169 
    170     AutoCaller autoCaller(this);
    171     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    172 
     168HRESULT OUSBDevice::getVendorId(USHORT *aVendorId)
     169{
    173170    /* this is const, no need to lock */
    174171    *aVendorId = mData.vendorId;
     
    184181 * @param   aProductId  Where to store the product id.
    185182 */
    186 STDMETHODIMP OUSBDevice::COMGETTER(ProductId)(USHORT *aProductId)
    187 {
    188     CheckComArgOutPointerValid(aProductId);
    189 
    190     AutoCaller autoCaller(this);
    191     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    192 
     183HRESULT OUSBDevice::getProductId(USHORT *aProductId)
     184{
    193185    /* this is const, no need to lock */
    194186    *aProductId = mData.productId;
     
    204196 * @param   aRevision  Where to store the revision BCD.
    205197 */
    206 STDMETHODIMP OUSBDevice::COMGETTER(Revision)(USHORT *aRevision)
    207 {
    208     CheckComArgOutPointerValid(aRevision);
    209 
    210     AutoCaller autoCaller(this);
    211     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    212 
     198HRESULT OUSBDevice::getRevision(USHORT *aRevision)
     199{
    213200    /* this is const, no need to lock */
    214201    *aRevision = mData.revision;
     
    223210 * @param   aManufacturer     Where to put the return string.
    224211 */
    225 STDMETHODIMP OUSBDevice::COMGETTER(Manufacturer)(BSTR *aManufacturer)
    226 {
    227     CheckComArgOutPointerValid(aManufacturer);
    228 
    229     AutoCaller autoCaller(this);
    230     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    231 
    232     /* this is const, no need to lock */
    233     mData.manufacturer.cloneTo(aManufacturer);
     212HRESULT OUSBDevice::getManufacturer(com::Utf8Str &aManufacturer)
     213{
     214    /* this is const, no need to lock */
     215    aManufacturer = mData.manufacturer;
    234216
    235217    return S_OK;
     
    243225 * @param   aProduct          Where to put the return string.
    244226 */
    245 STDMETHODIMP OUSBDevice::COMGETTER(Product)(BSTR *aProduct)
    246 {
    247     CheckComArgOutPointerValid(aProduct);
    248 
    249     AutoCaller autoCaller(this);
    250     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    251 
    252     /* this is const, no need to lock */
    253     mData.product.cloneTo(aProduct);
     227HRESULT OUSBDevice::getProduct(com::Utf8Str &aProduct)
     228{
     229    /* this is const, no need to lock */
     230    aProduct = mData.product;
    254231
    255232    return S_OK;
     
    263240 * @param   aSerialNumber     Where to put the return string.
    264241 */
    265 STDMETHODIMP OUSBDevice::COMGETTER(SerialNumber)(BSTR *aSerialNumber)
    266 {
    267     CheckComArgOutPointerValid(aSerialNumber);
    268 
    269     AutoCaller autoCaller(this);
    270     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    271 
    272     /* this is const, no need to lock */
    273     mData.serialNumber.cloneTo(aSerialNumber);
     242HRESULT OUSBDevice::getSerialNumber(com::Utf8Str &aSerialNumber)
     243{
     244    /* this is const, no need to lock */
     245    aSerialNumber = mData.serialNumber;
    274246
    275247    return S_OK;
     
    283255 * @param   aAddress          Where to put the return string.
    284256 */
    285 STDMETHODIMP OUSBDevice::COMGETTER(Address)(BSTR *aAddress)
    286 {
    287     CheckComArgOutPointerValid(aAddress);
    288 
    289     AutoCaller autoCaller(this);
    290     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    291 
    292     /* this is const, no need to lock */
    293     mData.address.cloneTo(aAddress);
    294 
    295     return S_OK;
    296 }
    297 
    298 STDMETHODIMP OUSBDevice::COMGETTER(Port)(USHORT *aPort)
    299 {
    300     CheckComArgOutPointerValid(aPort);
    301 
    302     AutoCaller autoCaller(this);
    303     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    304 
     257HRESULT OUSBDevice::getAddress(com::Utf8Str &aAddress)
     258{
     259    /* this is const, no need to lock */
     260    aAddress = mData.address;
     261
     262    return S_OK;
     263}
     264
     265HRESULT OUSBDevice::getPort(USHORT *aPort)
     266{
    305267    /* this is const, no need to lock */
    306268    *aPort = mData.port;
     
    309271}
    310272
    311 STDMETHODIMP OUSBDevice::COMGETTER(Version)(USHORT *aVersion)
    312 {
    313     CheckComArgOutPointerValid(aVersion);
    314 
    315     AutoCaller autoCaller(this);
    316     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    317 
     273HRESULT OUSBDevice::getVersion(USHORT *aVersion)
     274{
    318275    /* this is const, no need to lock */
    319276    *aVersion = mData.version;
     
    322279}
    323280
    324 STDMETHODIMP OUSBDevice::COMGETTER(PortVersion)(USHORT *aPortVersion)
    325 {
    326     CheckComArgOutPointerValid(aPortVersion);
    327 
    328     AutoCaller autoCaller(this);
    329     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    330 
     281HRESULT OUSBDevice::getPortVersion(USHORT *aPortVersion)
     282{
    331283    /* this is const, no need to lock */
    332284    *aPortVersion = mData.portVersion;
     
    335287}
    336288
    337 STDMETHODIMP OUSBDevice::COMGETTER(Remote)(BOOL *aRemote)
    338 {
    339     CheckComArgOutPointerValid(aRemote);
    340 
    341     AutoCaller autoCaller(this);
    342     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    343 
     289HRESULT OUSBDevice::getRemote(BOOL *aRemote)
     290{
    344291    /* this is const, no need to lock */
    345292    *aRemote = mData.remote;
  • trunk/src/VBox/Main/src-client/xpcom/module.cpp

    r50370 r50403  
    9090NS_DECL_CLASSINFO(Progress)
    9191NS_IMPL_THREADSAFE_ISUPPORTS1_CI(Progress, IProgress)
    92 NS_DECL_CLASSINFO(OUSBDevice)
    93 NS_IMPL_THREADSAFE_ISUPPORTS1_CI(OUSBDevice, IUSBDevice)
    9492NS_DECL_CLASSINFO(RemoteUSBDevice)
    9593NS_IMPL_THREADSAFE_ISUPPORTS2_CI(RemoteUSBDevice, IHostUSBDevice, IUSBDevice)
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