VirtualBox

Changeset 41184 in vbox for trunk/src


Ignore:
Timestamp:
May 7, 2012 1:28:04 PM (13 years ago)
Author:
vboxsync
Message:

Main+Frontends: removed unused and confusing VirtualBoxErrorInfo implementation, and cleaned up lots of misleading comments and other leftovers about the earlier ErrorInfo mess

Location:
trunk/src/VBox
Files:
1 deleted
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxBFE/NetworkAdapterImpl.cpp

    r28800 r41184  
    187187        AssertMsgFailed(("Invalid file descriptor: %ld.\n", tapFileDescriptor));
    188188
    189         //    setError  VirtualBoxSupportErrorInfoImplBase which
    190         //       is a parent class of NetworAdapter in the COM flavored version
    191         //    return setError (E_INVALIDARG,
    192         //        tr ("Invalid file descriptor: %ld"), tapFileDescriptor);
    193 
    194         return S_OK;
    195 
     189        return setError (E_INVALIDARG,
     190                tr ("Invalid file descriptor: %ld"), tapFileDescriptor);
    196191    }
    197192
  • trunk/src/VBox/Frontends/VBoxBFE/VirtualBoxBase.h

    r36120 r41184  
    8181
    8282/**
    83  *  A special version of the Assert macro to be used within VirtualBoxBase
    84  *  subclasses that also inherit the VirtualBoxSupportErrorInfoImpl template.
     83 *  Assert macro wrapper.
    8584 *
    8685 *  In the debug build, this macro is equivalent to Assert.
    87  *  In the release build, this macro uses |setError (E_FAIL, ...)| to set the
    88  *  error info from the asserted expression.
    89  *
    90  *  @see VirtualBoxSupportErrorInfoImpl::setError
     86 *  In the release build, this is a no-op.
    9187 *
    9288 *  @param   expr    Expression which should be true.
     
    10096
    10197/**
    102  *  A special version of the AssertMsg macro to be used within VirtualBoxBase
    103  *  subclasses that also inherit the VirtualBoxSupportErrorInfoImpl template.
     98 *  AssertMsg macro wrapper.
     99 *
     100 *  In the debug build, this macro is equivalent to AssertMsg.
     101 *  In the release build, this is a no-op.
    104102 *
    105103 *  See ComAssert for more info.
     
    116114
    117115/**
    118  *  A special version of the AssertRC macro to be used within VirtualBoxBase
    119  *  subclasses that also inherit the VirtualBoxSupportErrorInfoImpl template.
     116 *  AssertRC macro wrapper.
     117 *
     118 *  In the debug build, this macro is equivalent to AssertRC.
     119 *  In the release build, this is a no-op.
    120120 *
    121121 *  See ComAssert for more info.
     
    130130
    131131/**
    132  *  A special version of the AssertMsgRC macro to be used within VirtualBoxBase
    133  *  subclasses that also inherit the VirtualBoxSupportErrorInfoImpl template.
     132 *  AssertMsgRC macro wrapper.
     133 *
     134 *  In the debug build, this macro is equivalent to AssertMsgRC.
     135 *  In the release build, this is a no-op.
    134136 *
    135137 *  See ComAssert for more info.
     
    146148
    147149/**
    148  *  A special version of the AssertFailed macro to be used within VirtualBoxBase
    149  *  subclasses that also inherit the VirtualBoxSupportErrorInfoImpl template.
     150 *  AssertFailed macro wrapper.
     151 *
     152 *  In the debug build, this macro is equivalent to AssertFailed.
     153 *  In the release build, this is a no-op.
    150154 *
    151155 *  See ComAssert for more info.
     
    159163
    160164/**
    161  *  A special version of the AssertMsgFailed macro to be used within VirtualBoxBase
    162  *  subclasses that also inherit the VirtualBoxSupportErrorInfoImpl template.
     165 *  AssertMsgFailed macro wrapper.
     166 *
     167 *  In the debug build, this macro is equivalent to AssertMsgFailed.
     168 *  In the release build, this is a no-op.
    163169 *
    164170 *  See ComAssert for more info.
     
    174180
    175181/**
    176  *  A special version of the AssertComRC macro to be used within VirtualBoxBase
    177  *  subclasses that also inherit the VirtualBoxSupportErrorInfoImpl template.
     182 *  AssertComRC macro wrapper.
     183 *
     184 *  In the debug build, this macro is equivalent to AssertComRC.
     185 *  In the release build, this is a no-op.
    178186 *
    179187 *  See ComAssert for more info.
     
    246254 *  This macro <b>must</b> be used at the beginning of all interface methods
    247255 *  (right after entering the class lock) in classes derived from both
    248  *  VirtualBoxBase and VirtualBoxSupportErrorInfoImpl.
     256 *  VirtualBoxBase.
    249257 */
    250258#define CHECK_READY() \
  • trunk/src/VBox/Main/Makefile.kmk

    r41040 r41184  
    706706        glue/EventQueue.cpp \
    707707        glue/ErrorInfo.cpp \
    708         glue/errorprint.cpp \
    709         glue/VirtualBoxErrorInfo.cpp
     708        glue/errorprint.cpp
    710709VBoxCOM_INCS          += \
    711710        include
  • trunk/src/VBox/Main/include/FramebufferImpl.h

    r35638 r41184  
    2626class ATL_NO_VTABLE Framebuffer :
    2727    public VirtualBoxBase,
    28     public VirtualBoxSupportErrorInfoImpl<Framebuffer, IFramebuffer>,
    2928    public VirtualBoxSupportTranslation<Framebuffer>,
    3029    VBOX_SCRIPTABLE_IMPL(IFramebuffer)
     
    7372
    7473    STDMETHOD(ProcessVHWACommand)(BYTE *pCommand) = 0;
    75 
    76     // for VirtualBoxSupportErrorInfoImpl
    77     static const wchar_t *getComponentName() { return L"Framebuffer"; }
    78 
    7974};
    8075
  • trunk/src/VBox/Main/include/ProgressProxyImpl.h

    r35638 r41184  
    2828 */
    2929class ATL_NO_VTABLE ProgressProxy :
    30     //public com::SupportErrorInfoDerived<Progress, ProgressProxy, IProgress>,
    3130    public Progress
    3231{
     
    9493    bool setOtherProgressObject(IProgress *pOtherProgress);
    9594
    96     /** For com::SupportErrorInfoImpl. */
    97     static const char *ComponentName() { return "ProgressProxy"; }
    98 
    9995protected:
    10096    void clearOtherProgressObjectInternal(bool fEarly);
  • trunk/src/VBox/Main/include/VirtualBoxBase.h

    r40432 r41184  
    146146/**
    147147 *  Special version of the Assert macro to be used within VirtualBoxBase
    148  *  subclasses that also inherit the VirtualBoxSupportErrorInfoImpl template.
     148 *  subclasses.
    149149 *
    150150 *  In the debug build, this macro is equivalent to Assert.
     
    152152 *  error info from the asserted expression.
    153153 *
    154  *  @see VirtualBoxSupportErrorInfoImpl::setError
     154 *  @see VirtualBoxBase::setError
    155155 *
    156156 *  @param   expr    Expression which should be true.
     
    170170/**
    171171 *  Special version of the AssertFailed macro to be used within VirtualBoxBase
    172  *  subclasses that also inherit the VirtualBoxSupportErrorInfoImpl template.
     172 *  subclasses.
    173173 *
    174174 *  In the debug build, this macro is equivalent to AssertFailed.
     
    176176 *  error info from the asserted expression.
    177177 *
    178  *  @see VirtualBoxSupportErrorInfoImpl::setError
     178 *  @see VirtualBoxBase::setError
    179179 *
    180180 */
     
    192192/**
    193193 *  Special version of the AssertMsg macro to be used within VirtualBoxBase
    194  *  subclasses that also inherit the VirtualBoxSupportErrorInfoImpl template.
     194 *  subclasses.
    195195 *
    196196 *  See ComAssert for more info.
     
    213213/**
    214214 *  Special version of the AssertRC macro to be used within VirtualBoxBase
    215  *  subclasses that also inherit the VirtualBoxSupportErrorInfoImpl template.
     215 *  subclasses.
    216216 *
    217217 *  See ComAssert for more info.
     
    227227/**
    228228 *  Special version of the AssertMsgRC macro to be used within VirtualBoxBase
    229  *  subclasses that also inherit the VirtualBoxSupportErrorInfoImpl template.
     229 *  subclasses.
    230230 *
    231231 *  See ComAssert for more info.
     
    242242/**
    243243 *  Special version of the AssertComRC macro to be used within VirtualBoxBase
    244  *  subclasses that also inherit the VirtualBoxSupportErrorInfoImpl template.
     244 *  subclasses.
    245245 *
    246246 *  See ComAssert for more info.
  • trunk/src/VBox/Main/src-all/ProgressImpl.cpp

    r40257 r41184  
    12351235 * Marks the operation as complete and attaches full error info.
    12361236 *
    1237  * See com::SupportErrorInfoImpl::setError(HRESULT, const GUID &, const wchar_t
     1237 * See VirtualBoxBase::setError(HRESULT, const GUID &, const wchar_t
    12381238 * *, const char *, ...) for more info.
    12391239 *
  • trunk/src/VBox/Main/src-all/VirtualBoxBase.cpp

    r41104 r41184  
    739739
    740740/**
    741  * Places the managed VirtualBoxBase object to  Ready/Limited state if the
     741 * Places the managed VirtualBoxBase object to Ready/Limited state if the
    742742 * initialization succeeded or partly succeeded, or places it to InitFailed
    743743 * state and calls the object's uninit() method.
  • trunk/src/VBox/Main/src-all/VirtualBoxErrorInfoImpl.cpp

    r38533 r41184  
    11/** @file
    22 *
    3  * VirtualBoxErrorInfo COM classe implementation
     3 * VirtualBoxErrorInfo COM class implementation
    44 */
    55
    66/*
    7  * Copyright (C) 2006-2010 Oracle Corporation
     7 * Copyright (C) 2006-2012 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    6666////////////////////////////////////////////////////////////////////////////////
    6767
    68 STDMETHODIMP VirtualBoxErrorInfo::COMGETTER(ResultCode) (LONG *aResultCode)
     68STDMETHODIMP VirtualBoxErrorInfo::COMGETTER(ResultCode)(LONG *aResultCode)
    6969{
    7070    CheckComArgOutPointerValid(aResultCode);
     
    7474}
    7575
    76 STDMETHODIMP VirtualBoxErrorInfo::COMGETTER(InterfaceID) (BSTR *aIID)
     76STDMETHODIMP VirtualBoxErrorInfo::COMGETTER(InterfaceID)(BSTR *aIID)
    7777{
    7878    CheckComArgOutPointerValid(aIID);
     
    8282}
    8383
    84 STDMETHODIMP VirtualBoxErrorInfo::COMGETTER(Component) (BSTR *aComponent)
     84STDMETHODIMP VirtualBoxErrorInfo::COMGETTER(Component)(BSTR *aComponent)
    8585{
    8686    CheckComArgOutPointerValid(aComponent);
     
    9090}
    9191
    92 STDMETHODIMP VirtualBoxErrorInfo::COMGETTER(Text) (BSTR *aText)
     92STDMETHODIMP VirtualBoxErrorInfo::COMGETTER(Text)(BSTR *aText)
    9393{
    9494    CheckComArgOutPointerValid(aText);
     
    9898}
    9999
    100 STDMETHODIMP VirtualBoxErrorInfo::COMGETTER(Next) (IVirtualBoxErrorInfo **aNext)
     100STDMETHODIMP VirtualBoxErrorInfo::COMGETTER(Next)(IVirtualBoxErrorInfo **aNext)
    101101{
    102102    CheckComArgOutPointerValid(aNext);
     
    112112 *  object.
    113113 */
    114 HRESULT VirtualBoxErrorInfo::init (IErrorInfo *aInfo)
     114HRESULT VirtualBoxErrorInfo::init(IErrorInfo *aInfo)
    115115{
    116116    AssertReturn(aInfo, E_FAIL);
     
    124124    m_resultCode = S_OK;
    125125    rc = aInfo->GetGUID(m_IID.asOutParam());
    126     AssertComRC (rc);
     126    AssertComRC(rc);
    127127    Bstr bstrComponent;
    128128    rc = aInfo->GetSource(bstrComponent.asOutParam());
    129     AssertComRC (rc);
     129    AssertComRC(rc);
    130130    m_strComponent = bstrComponent;
    131131    Bstr bstrText;
    132132    rc = aInfo->GetDescription(bstrText.asOutParam());
    133     AssertComRC (rc);
     133    AssertComRC(rc);
    134134    m_strText = bstrText;
    135135
     
    140140////////////////////////////////////////////////////////////////////////////////
    141141
    142 STDMETHODIMP VirtualBoxErrorInfo::GetDescription (BSTR *description)
    143 {
    144     return COMGETTER(Text) (description);
    145 }
    146 
    147 STDMETHODIMP VirtualBoxErrorInfo::GetGUID (GUID *guid)
     142STDMETHODIMP VirtualBoxErrorInfo::GetDescription(BSTR *description)
     143{
     144    return COMGETTER(Text)(description);
     145}
     146
     147STDMETHODIMP VirtualBoxErrorInfo::GetGUID(GUID *guid)
    148148{
    149149    Bstr iid;
    150     HRESULT rc = COMGETTER(InterfaceID) (iid.asOutParam());
     150    HRESULT rc = COMGETTER(InterfaceID)(iid.asOutParam());
    151151    if (SUCCEEDED(rc))
    152152        *guid = Guid(iid).ref();
     
    154154}
    155155
    156 STDMETHODIMP VirtualBoxErrorInfo::GetHelpContext (DWORD *pdwHelpContext)
     156STDMETHODIMP VirtualBoxErrorInfo::GetHelpContext(DWORD *pdwHelpContext)
    157157{
    158158    return E_NOTIMPL;
    159159}
    160160
    161 STDMETHODIMP VirtualBoxErrorInfo::GetHelpFile (BSTR *pbstrHelpFile)
     161STDMETHODIMP VirtualBoxErrorInfo::GetHelpFile(BSTR *pbstrHelpFile)
    162162{
    163163    return E_NOTIMPL;
    164164}
    165165
    166 STDMETHODIMP VirtualBoxErrorInfo::GetSource (BSTR *source)
    167 {
    168     return COMGETTER(Component) (source);
     166STDMETHODIMP VirtualBoxErrorInfo::GetSource(BSTR *source)
     167{
     168    return COMGETTER(Component)(source);
    169169}
    170170
     
    206206
    207207/* readonly attribute string message; */
    208 NS_IMETHODIMP VirtualBoxErrorInfo::GetMessage (char **aMessage)
     208NS_IMETHODIMP VirtualBoxErrorInfo::GetMessage(char **aMessage)
    209209{
    210210    CheckComArgOutPointerValid(aMessage);
     
    215215
    216216/* readonly attribute nsresult result; */
    217 NS_IMETHODIMP VirtualBoxErrorInfo::GetResult (nsresult *aResult)
     217NS_IMETHODIMP VirtualBoxErrorInfo::GetResult(nsresult *aResult)
    218218{
    219219    if (!aResult)
     
    221221
    222222    PRInt32 lrc;
    223     nsresult rc = COMGETTER(ResultCode) (&lrc);
     223    nsresult rc = COMGETTER(ResultCode)(&lrc);
    224224    if (SUCCEEDED(rc))
    225225      *aResult = lrc;
     
    228228
    229229/* readonly attribute string name; */
    230 NS_IMETHODIMP VirtualBoxErrorInfo::GetName (char ** /* aName */)
     230NS_IMETHODIMP VirtualBoxErrorInfo::GetName(char ** /* aName */)
    231231{
    232232    return NS_ERROR_NOT_IMPLEMENTED;
     
    234234
    235235/* readonly attribute string filename; */
    236 NS_IMETHODIMP VirtualBoxErrorInfo::GetFilename (char ** /* aFilename */)
     236NS_IMETHODIMP VirtualBoxErrorInfo::GetFilename(char ** /* aFilename */)
    237237{
    238238    return NS_ERROR_NOT_IMPLEMENTED;
     
    240240
    241241/* readonly attribute PRUint32 lineNumber; */
    242 NS_IMETHODIMP VirtualBoxErrorInfo::GetLineNumber (PRUint32 * /* aLineNumber */)
     242NS_IMETHODIMP VirtualBoxErrorInfo::GetLineNumber(PRUint32 * /* aLineNumber */)
    243243{
    244244    return NS_ERROR_NOT_IMPLEMENTED;
     
    246246
    247247/* readonly attribute PRUint32 columnNumber; */
    248 NS_IMETHODIMP VirtualBoxErrorInfo::GetColumnNumber (PRUint32 * /*aColumnNumber */)
     248NS_IMETHODIMP VirtualBoxErrorInfo::GetColumnNumber(PRUint32 * /*aColumnNumber */)
    249249{
    250250    return NS_ERROR_NOT_IMPLEMENTED;
     
    252252
    253253/* readonly attribute nsIStackFrame location; */
    254 NS_IMETHODIMP VirtualBoxErrorInfo::GetLocation (nsIStackFrame ** /* aLocation */)
     254NS_IMETHODIMP VirtualBoxErrorInfo::GetLocation(nsIStackFrame ** /* aLocation */)
    255255{
    256256    return NS_ERROR_NOT_IMPLEMENTED;
     
    258258
    259259/* readonly attribute nsIException inner; */
    260 NS_IMETHODIMP VirtualBoxErrorInfo::GetInner (nsIException **aInner)
     260NS_IMETHODIMP VirtualBoxErrorInfo::GetInner(nsIException **aInner)
    261261{
    262262    ComPtr<IVirtualBoxErrorInfo> info;
    263     nsresult rv = COMGETTER(Next) (info.asOutParam());
     263    nsresult rv = COMGETTER(Next)(info.asOutParam());
    264264    if (FAILED(rv)) return rv;
    265265    return info.queryInterfaceTo(aInner);
     
    267267
    268268/* readonly attribute nsISupports data; */
    269 NS_IMETHODIMP VirtualBoxErrorInfo::GetData (nsISupports ** /* aData */)
    270 {
    271     return NS_ERROR_NOT_IMPLEMENTED;
    272 }
    273 
    274 /* string toString (); */
    275 NS_IMETHODIMP VirtualBoxErrorInfo::ToString (char ** /* retval */)
    276 {
    277     return NS_ERROR_NOT_IMPLEMENTED;
    278 }
    279 
    280 NS_IMPL_THREADSAFE_ISUPPORTS2 (VirtualBoxErrorInfo,
    281                                nsIException, IVirtualBoxErrorInfo)
     269NS_IMETHODIMP VirtualBoxErrorInfo::GetData(nsISupports ** /* aData */)
     270{
     271    return NS_ERROR_NOT_IMPLEMENTED;
     272}
     273
     274/* string toString(); */
     275NS_IMETHODIMP VirtualBoxErrorInfo::ToString(char ** /* retval */)
     276{
     277    return NS_ERROR_NOT_IMPLEMENTED;
     278}
     279
     280NS_IMPL_THREADSAFE_ISUPPORTS2(VirtualBoxErrorInfo,
     281                              nsIException, IVirtualBoxErrorInfo)
    282282
    283283#endif // defined(VBOX_WITH_XPCOM)
  • trunk/src/VBox/Main/src-server/USBControllerImpl.cpp

    r38441 r41184  
    55
    66/*
    7  * Copyright (C) 2006-2010 Oracle Corporation
     7 * Copyright (C) 2006-2012 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    8686/////////////////////////////////////////////////////////////////////////////
    8787
    88 DEFINE_EMPTY_CTOR_DTOR (USBController)
     88DEFINE_EMPTY_CTOR_DTOR(USBController)
    8989
    9090HRESULT USBController::FinalConstruct()
     
    262262/////////////////////////////////////////////////////////////////////////////
    263263
    264 STDMETHODIMP USBController::COMGETTER(Enabled) (BOOL *aEnabled)
     264STDMETHODIMP USBController::COMGETTER(Enabled)(BOOL *aEnabled)
    265265{
    266266    CheckComArgOutPointerValid(aEnabled);
     
    277277
    278278
    279 STDMETHODIMP USBController::COMSETTER(Enabled) (BOOL aEnabled)
     279STDMETHODIMP USBController::COMSETTER(Enabled)(BOOL aEnabled)
    280280{
    281281    LogFlowThisFunc(("aEnabled=%RTbool\n", aEnabled));
     
    308308}
    309309
    310 STDMETHODIMP USBController::COMGETTER(EnabledEhci) (BOOL *aEnabled)
     310STDMETHODIMP USBController::COMGETTER(EnabledEhci)(BOOL *aEnabled)
    311311{
    312312    CheckComArgOutPointerValid(aEnabled);
     
    322322}
    323323
    324 STDMETHODIMP USBController::COMSETTER(EnabledEhci) (BOOL aEnabled)
     324STDMETHODIMP USBController::COMSETTER(EnabledEhci)(BOOL aEnabled)
    325325{
    326326    LogFlowThisFunc(("aEnabled=%RTbool\n", aEnabled));
     
    353353}
    354354
    355 STDMETHODIMP USBController::COMGETTER(ProxyAvailable) (BOOL *aEnabled)
     355STDMETHODIMP USBController::COMGETTER(ProxyAvailable)(BOOL *aEnabled)
    356356{
    357357    CheckComArgOutPointerValid(aEnabled);
     
    371371}
    372372
    373 STDMETHODIMP USBController::COMGETTER(USBStandard) (USHORT *aUSBStandard)
     373STDMETHODIMP USBController::COMGETTER(USBStandard)(USHORT *aUSBStandard)
    374374{
    375375    CheckComArgOutPointerValid(aUSBStandard);
     
    399399    DECLARE_PROTECT_FINAL_CONSTRUCT()
    400400    BEGIN_COM_MAP(USBDeviceFilter)
    401         COM_INTERFACE_ENTRY(ISupportErrorInfo)
    402         COM_INTERFACE_ENTRY(IUSBDeviceFilter)
     401        VBOX_DEFAULT_INTERFACE_ENTRIES(IUSBDeviceFilter)
    403402    END_COM_MAP()
    404403
    405     DECLARE_EMPTY_CTOR_DTOR (USBDeviceFilter)
     404    DECLARE_EMPTY_CTOR_DTOR(USBDeviceFilter)
    406405
    407406    // IUSBDeviceFilter properties
    408     STDMETHOD(COMGETTER(Name)) (BSTR *aName);
    409     STDMETHOD(COMSETTER(Name)) (IN_BSTR aName);
    410     STDMETHOD(COMGETTER(Active)) (BOOL *aActive);
    411     STDMETHOD(COMSETTER(Active)) (BOOL aActive);
    412     STDMETHOD(COMGETTER(VendorId)) (BSTR *aVendorId);
    413     STDMETHOD(COMSETTER(VendorId)) (IN_BSTR aVendorId);
    414     STDMETHOD(COMGETTER(ProductId)) (BSTR *aProductId);
    415     STDMETHOD(COMSETTER(ProductId)) (IN_BSTR aProductId);
    416     STDMETHOD(COMGETTER(Revision)) (BSTR *aRevision);
    417     STDMETHOD(COMSETTER(Revision)) (IN_BSTR aRevision);
    418     STDMETHOD(COMGETTER(Manufacturer)) (BSTR *aManufacturer);
    419     STDMETHOD(COMSETTER(Manufacturer)) (IN_BSTR aManufacturer);
    420     STDMETHOD(COMGETTER(Product)) (BSTR *aProduct);
    421     STDMETHOD(COMSETTER(Product)) (IN_BSTR aProduct);
    422     STDMETHOD(COMGETTER(SerialNumber)) (BSTR *aSerialNumber);
    423     STDMETHOD(COMSETTER(SerialNumber)) (IN_BSTR aSerialNumber);
    424     STDMETHOD(COMGETTER(Port)) (BSTR *aPort);
    425     STDMETHOD(COMSETTER(Port)) (IN_BSTR aPort);
    426     STDMETHOD(COMGETTER(Remote)) (BSTR *aRemote);
    427     STDMETHOD(COMSETTER(Remote)) (IN_BSTR aRemote);
    428     STDMETHOD(COMGETTER(MaskedInterfaces)) (ULONG *aMaskedIfs);
    429     STDMETHOD(COMSETTER(MaskedInterfaces)) (ULONG aMaskedIfs);
     407    STDMETHOD(COMGETTER(Name))(BSTR *aName);
     408    STDMETHOD(COMSETTER(Name))(IN_BSTR aName);
     409    STDMETHOD(COMGETTER(Active))(BOOL *aActive);
     410    STDMETHOD(COMSETTER(Active))(BOOL aActive);
     411    STDMETHOD(COMGETTER(VendorId))(BSTR *aVendorId);
     412    STDMETHOD(COMSETTER(VendorId))(IN_BSTR aVendorId);
     413    STDMETHOD(COMGETTER(ProductId))(BSTR *aProductId);
     414    STDMETHOD(COMSETTER(ProductId))(IN_BSTR aProductId);
     415    STDMETHOD(COMGETTER(Revision))(BSTR *aRevision);
     416    STDMETHOD(COMSETTER(Revision))(IN_BSTR aRevision);
     417    STDMETHOD(COMGETTER(Manufacturer))(BSTR *aManufacturer);
     418    STDMETHOD(COMSETTER(Manufacturer))(IN_BSTR aManufacturer);
     419    STDMETHOD(COMGETTER(Product))(BSTR *aProduct);
     420    STDMETHOD(COMSETTER(Product))(IN_BSTR aProduct);
     421    STDMETHOD(COMGETTER(SerialNumber))(BSTR *aSerialNumber);
     422    STDMETHOD(COMSETTER(SerialNumber))(IN_BSTR aSerialNumber);
     423    STDMETHOD(COMGETTER(Port))(BSTR *aPort);
     424    STDMETHOD(COMSETTER(Port))(IN_BSTR aPort);
     425    STDMETHOD(COMGETTER(Remote))(BSTR *aRemote);
     426    STDMETHOD(COMSETTER(Remote))(IN_BSTR aRemote);
     427    STDMETHOD(COMGETTER(MaskedInterfaces))(ULONG *aMaskedIfs);
     428    STDMETHOD(COMSETTER(MaskedInterfaces))(ULONG aMaskedIfs);
    430429};
    431430#endif /* !VBOX_WITH_USB */
    432431
    433432
    434 STDMETHODIMP USBController::COMGETTER(DeviceFilters) (ComSafeArrayOut(IUSBDeviceFilter *, aDevicesFilters))
     433STDMETHODIMP USBController::COMGETTER(DeviceFilters)(ComSafeArrayOut(IUSBDeviceFilter *, aDevicesFilters))
    435434{
    436435#ifdef VBOX_WITH_USB
     
    438437
    439438    AutoCaller autoCaller(this);
    440     if (FAILED(autoCaller.rc())) return autoCaller.rc();
     439    if(FAILED(autoCaller.rc())) return autoCaller.rc();
    441440
    442441    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    443442
    444     SafeIfaceArray<IUSBDeviceFilter> collection (*m->llDeviceFilters.data());
     443    SafeIfaceArray<IUSBDeviceFilter> collection(*m->llDeviceFilters.data());
    445444    collection.detachTo(ComSafeArrayOutArg(aDevicesFilters));
    446445
     
    458457/////////////////////////////////////////////////////////////////////////////
    459458
    460 STDMETHODIMP USBController::CreateDeviceFilter (IN_BSTR aName,
    461                                                 IUSBDeviceFilter **aFilter)
     459STDMETHODIMP USBController::CreateDeviceFilter(IN_BSTR aName,
     460                                               IUSBDeviceFilter **aFilter)
    462461{
    463462#ifdef VBOX_WITH_USB
     
    477476    ComObjPtr<USBDeviceFilter> filter;
    478477    filter.createObject();
    479     HRESULT rc = filter->init (this, aName);
    480     ComAssertComRCRetRC (rc);
     478    HRESULT rc = filter->init(this, aName);
     479    ComAssertComRCRetRC(rc);
    481480    rc = filter.queryInterfaceTo(aFilter);
    482481    AssertComRCReturnRC(rc);
     
    509508    // @todo r=dj make sure the input object is actually from us
    510509//     if (!filter)
    511 //         return setError (E_INVALIDARG,
    512 //             tr ("The given USB device filter is not created within "
     510//         return setError(E_INVALIDARG,
     511//             tr("The given USB device filter is not created within "
    513512//                 "this VirtualBox instance"));
    514513
     
    525524    {
    526525        it = m->llDeviceFilters->begin();
    527         std::advance (it, aPosition);
     526        std::advance(it, aPosition);
    528527    }
    529528    else
    530529        it = m->llDeviceFilters->end();
    531530    /* ...and insert */
    532     m->llDeviceFilters->insert (it, filter);
     531    m->llDeviceFilters->insert(it, filter);
    533532    filter->mInList = true;
    534533
    535534    /* notify the proxy (only when it makes sense) */
    536535    if (filter->getData().mActive && Global::IsOnline(adep.machineState())
    537         && filter->getData().mRemote.isMatch (false))
     536        && filter->getData().mRemote.isMatch(false))
    538537    {
    539538        USBProxyService *service = m->pHost->usbProxyService();
     
    541540
    542541        ComAssertRet(filter->getId() == NULL, E_FAIL);
    543         filter->getId() = service->insertFilter (&filter->getData().mUSBFilter);
     542        filter->getId() = service->insertFilter(&filter->getData().mUSBFilter);
    544543    }
    545544
     
    592591        /* iterate to the position... */
    593592        DeviceFilterList::iterator it = m->llDeviceFilters->begin();
    594         std::advance (it, aPosition);
     593        std::advance(it, aPosition);
    595594        /* ...get an element from there... */
    596595        filter = *it;
    597596        /* ...and remove */
    598597        filter->mInList = false;
    599         m->llDeviceFilters->erase (it);
     598        m->llDeviceFilters->erase(it);
    600599    }
    601600
     
    607606    /* notify the proxy (only when it makes sense) */
    608607    if (filter->getData().mActive && Global::IsOnline(adep.machineState())
    609         && filter->getData().mRemote.isMatch (false))
     608        && filter->getData().mRemote.isMatch(false))
    610609    {
    611610        USBProxyService *service = m->pHost->usbProxyService();
     
    719718        (*it)->COMGETTER(ProductId)(str.asOutParam());
    720719        f.strProductId = str;
    721         (*it)->COMGETTER (Revision) (str.asOutParam());
     720        (*it)->COMGETTER(Revision)(str.asOutParam());
    722721        f.strRevision = str;
    723         (*it)->COMGETTER (Manufacturer) (str.asOutParam());
     722        (*it)->COMGETTER(Manufacturer)(str.asOutParam());
    724723        f.strManufacturer = str;
    725         (*it)->COMGETTER (Product) (str.asOutParam());
     724        (*it)->COMGETTER(Product)(str.asOutParam());
    726725        f.strProduct = str;
    727         (*it)->COMGETTER (SerialNumber) (str.asOutParam());
     726        (*it)->COMGETTER(SerialNumber)(str.asOutParam());
    728727        f.strSerialNumber = str;
    729         (*it)->COMGETTER (Port) (str.asOutParam());
     728        (*it)->COMGETTER(Port)(str.asOutParam());
    730729        f.strPort = str;
    731730        f.strRemote = filterData.mRemote.string();
     
    765764        while (it != m->llDeviceFilters->end())
    766765        {
    767             if (std::find (backedList->begin(), backedList->end(), *it) ==
     766            if (std::find(backedList->begin(), backedList->end(), *it) ==
    768767                backedList->end())
    769768            {
    770769                /* notify the proxy (only when it makes sense) */
    771770                if ((*it)->getData().mActive &&
    772                     Global::IsOnline (adep.machineState())
    773                     && (*it)->getData().mRemote.isMatch (false))
     771                    Global::IsOnline(adep.machineState())
     772                    && (*it)->getData().mRemote.isMatch(false))
    774773                {
    775774                    USBDeviceFilter *filter = *it;
     
    784783        }
    785784
    786         if (Global::IsOnline (adep.machineState()))
     785        if (Global::IsOnline(adep.machineState()))
    787786        {
    788787            /* find all removed old filters (absent in the new list)
     
    791790            while (it != backedList->end())
    792791            {
    793                 if (std::find (m->llDeviceFilters->begin(), m->llDeviceFilters->end(), *it) ==
     792                if (std::find(m->llDeviceFilters->begin(), m->llDeviceFilters->end(), *it) ==
    794793                    m->llDeviceFilters->end())
    795794                {
    796795                    /* notify the proxy (only when necessary) */
    797796                    if ((*it)->getData().mActive
    798                             && (*it)->getData().mRemote.isMatch (false))
     797                            && (*it)->getData().mRemote.isMatch(false))
    799798                    {
    800799                        USBDeviceFilter *flt = *it; /* resolve ambiguity */
     
    838837    /* sanity */
    839838    AutoCaller autoCaller(this);
    840     AssertComRCReturnVoid (autoCaller.rc());
     839    AssertComRCReturnVoid(autoCaller.rc());
    841840
    842841    /* sanity too */
    843842    AutoCaller peerCaller(m->pPeer);
    844     AssertComRCReturnVoid (peerCaller.rc());
     843    AssertComRCReturnVoid(peerCaller.rc());
    845844
    846845    /* lock both for writing since we modify both (mPeer is "master" so locked
     
    894893                }
    895894                /* and add it to the new list */
    896                 newList->push_back (peer);
     895                newList->push_back(peer);
    897896
    898897                ++ it;
     
    940939 *  represented by @a aThat (locked for reading).
    941940 */
    942 void USBController::copyFrom (USBController *aThat)
    943 {
    944     AssertReturnVoid (aThat != NULL);
     941void USBController::copyFrom(USBController *aThat)
     942{
     943    AssertReturnVoid(aThat != NULL);
    945944
    946945    /* sanity */
    947946    AutoCaller autoCaller(this);
    948     AssertComRCReturnVoid (autoCaller.rc());
     947    AssertComRCReturnVoid(autoCaller.rc());
    949948
    950949    /* sanity too */
    951     AutoCaller thatCaller (aThat);
    952     AssertComRCReturnVoid (thatCaller.rc());
     950    AutoCaller thatCaller(aThat);
     951    AssertComRCReturnVoid(thatCaller.rc());
    953952
    954953    /* even more sanity */
    955954    AutoAnyStateDependency adep(m->pParent);
    956     AssertComRCReturnVoid (adep.rc());
     955    AssertComRCReturnVoid(adep.rc());
    957956    /* Machine::copyFrom() may not be called when the VM is running */
    958     AssertReturnVoid (!Global::IsOnline (adep.machineState()));
     957    AssertReturnVoid(!Global::IsOnline(adep.machineState()));
    959958
    960959    /* peer is not modified, lock it for reading (aThat is "master" so locked
     
    980979        ComObjPtr<USBDeviceFilter> filter;
    981980        filter.createObject();
    982         filter->initCopy (this, *it);
    983         m->llDeviceFilters->push_back (filter);
     981        filter->initCopy(this, *it);
     982        m->llDeviceFilters->push_back(filter);
    984983    }
    985984
     
    994993 *  @note Locks nothing.
    995994 */
    996 HRESULT USBController::onDeviceFilterChange (USBDeviceFilter *aFilter,
    997                                              BOOL aActiveChanged /* = FALSE */)
     995HRESULT USBController::onDeviceFilterChange(USBDeviceFilter *aFilter,
     996                                            BOOL aActiveChanged /* = FALSE */)
    998997{
    999998    AutoCaller autoCaller(this);
     
    10051004
    10061005    /* nothing to do if the machine isn't running */
    1007     if (!Global::IsOnline (adep.machineState()))
     1006    if (!Global::IsOnline(adep.machineState()))
    10081007        return S_OK;
    10091008
     
    10181017        if (aActiveChanged)
    10191018        {
    1020             if (aFilter->getData().mRemote.isMatch (false))
     1019            if (aFilter->getData().mRemote.isMatch(false))
    10211020            {
    10221021                /* insert/remove the filter from the proxy */
     
    10411040                ComAssertRet(aFilter->getId() != NULL, E_FAIL);
    10421041                service->removeFilter(aFilter->getId());
    1043                 if (aFilter->getData().mRemote.isMatch (false))
     1042                if (aFilter->getData().mRemote.isMatch(false))
    10441043                {
    10451044                    aFilter->getId() = service->insertFilter(&aFilter->getData().mUSBFilter);
     
    10601059 *  @note Locks this object for reading.
    10611060 */
    1062 bool USBController::hasMatchingFilter (const ComObjPtr<HostUSBDevice> &aDevice, ULONG *aMaskedIfs)
    1063 {
    1064     AutoCaller autoCaller(this);
    1065     AssertComRCReturn (autoCaller.rc(), false);
     1061bool USBController::hasMatchingFilter(const ComObjPtr<HostUSBDevice> &aDevice, ULONG *aMaskedIfs)
     1062{
     1063    AutoCaller autoCaller(this);
     1064    AssertComRCReturn(autoCaller.rc(), false);
    10661065
    10671066    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     
    10991098 *  @note Locks this object for reading.
    11001099 */
    1101 bool USBController::hasMatchingFilter (IUSBDevice *aUSBDevice, ULONG *aMaskedIfs)
     1100bool USBController::hasMatchingFilter(IUSBDevice *aUSBDevice, ULONG *aMaskedIfs)
    11021101{
    11031102    LogFlowThisFuncEnter();
    11041103
    11051104    AutoCaller autoCaller(this);
    1106     AssertComRCReturn (autoCaller.rc(), false);
     1105    AssertComRCReturn(autoCaller.rc(), false);
    11071106
    11081107    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     
    11161115    /* query fields */
    11171116    USBFILTER dev;
    1118     USBFilterInit (&dev, USBFILTERTYPE_CAPTURE);
     1117    USBFilterInit(&dev, USBFILTERTYPE_CAPTURE);
    11191118
    11201119    USHORT vendorId = 0;
    1121     rc = aUSBDevice->COMGETTER(VendorId) (&vendorId);
     1120    rc = aUSBDevice->COMGETTER(VendorId)(&vendorId);
    11221121    ComAssertComRCRet(rc, false);
    11231122    ComAssertRet(vendorId, false);
    1124     int vrc = USBFilterSetNumExact (&dev, USBFILTERIDX_VENDOR_ID, vendorId, true); AssertRC(vrc);
     1123    int vrc = USBFilterSetNumExact(&dev, USBFILTERIDX_VENDOR_ID, vendorId, true); AssertRC(vrc);
    11251124
    11261125    USHORT productId = 0;
    1127     rc = aUSBDevice->COMGETTER(ProductId) (&productId);
     1126    rc = aUSBDevice->COMGETTER(ProductId)(&productId);
    11281127    ComAssertComRCRet(rc, false);
    1129     vrc = USBFilterSetNumExact (&dev, USBFILTERIDX_PRODUCT_ID, productId, true); AssertRC(vrc);
     1128    vrc = USBFilterSetNumExact(&dev, USBFILTERIDX_PRODUCT_ID, productId, true); AssertRC(vrc);
    11301129
    11311130    USHORT revision;
    1132     rc = aUSBDevice->COMGETTER(Revision) (&revision);
     1131    rc = aUSBDevice->COMGETTER(Revision)(&revision);
    11331132    ComAssertComRCRet(rc, false);
    1134     vrc = USBFilterSetNumExact (&dev, USBFILTERIDX_DEVICE, revision, true); AssertRC(vrc);
     1133    vrc = USBFilterSetNumExact(&dev, USBFILTERIDX_DEVICE, revision, true); AssertRC(vrc);
    11351134
    11361135    Bstr manufacturer;
    1137     rc = aUSBDevice->COMGETTER(Manufacturer) (manufacturer.asOutParam());
     1136    rc = aUSBDevice->COMGETTER(Manufacturer)(manufacturer.asOutParam());
    11381137    ComAssertComRCRet(rc, false);
    11391138    if (!manufacturer.isEmpty())
    1140         USBFilterSetStringExact (&dev, USBFILTERIDX_MANUFACTURER_STR, Utf8Str(manufacturer).c_str(), true);
     1139        USBFilterSetStringExact(&dev, USBFILTERIDX_MANUFACTURER_STR, Utf8Str(manufacturer).c_str(), true);
    11411140
    11421141    Bstr product;
    1143     rc = aUSBDevice->COMGETTER(Product) (product.asOutParam());
     1142    rc = aUSBDevice->COMGETTER(Product)(product.asOutParam());
    11441143    ComAssertComRCRet(rc, false);
    11451144    if (!product.isEmpty())
    1146         USBFilterSetStringExact (&dev, USBFILTERIDX_PRODUCT_STR, Utf8Str(product).c_str(), true);
     1145        USBFilterSetStringExact(&dev, USBFILTERIDX_PRODUCT_STR, Utf8Str(product).c_str(), true);
    11471146
    11481147    Bstr serialNumber;
    1149     rc = aUSBDevice->COMGETTER(SerialNumber) (serialNumber.asOutParam());
     1148    rc = aUSBDevice->COMGETTER(SerialNumber)(serialNumber.asOutParam());
    11501149    ComAssertComRCRet(rc, false);
    11511150    if (!serialNumber.isEmpty())
    1152         USBFilterSetStringExact (&dev, USBFILTERIDX_SERIAL_NUMBER_STR, Utf8Str(serialNumber).c_str(), true);
     1151        USBFilterSetStringExact(&dev, USBFILTERIDX_SERIAL_NUMBER_STR, Utf8Str(serialNumber).c_str(), true);
    11531152
    11541153    Bstr address;
    1155     rc = aUSBDevice->COMGETTER(Address) (address.asOutParam());
     1154    rc = aUSBDevice->COMGETTER(Address)(address.asOutParam());
    11561155    ComAssertComRCRet(rc, false);
    11571156
     
    11591158    rc = aUSBDevice->COMGETTER(Port)(&port);
    11601159    ComAssertComRCRet(rc, false);
    1161     USBFilterSetNumExact (&dev, USBFILTERIDX_PORT, port, true);
     1160    USBFilterSetNumExact(&dev, USBFILTERIDX_PORT, port, true);
    11621161
    11631162    BOOL remote = FALSE;
     
    11781177        if (!aData.mActive)
    11791178            continue;
    1180         if (!aData.mRemote.isMatch (remote))
     1179        if (!aData.mRemote.isMatch(remote))
    11811180            continue;
    1182         if (!USBFilterMatch (&aData.mUSBFilter, &dev))
     1181        if (!USBFilterMatch(&aData.mUSBFilter, &dev))
    11831182            continue;
    11841183
     
    12021201 *  @note Locks this object for reading.
    12031202 */
    1204 HRESULT USBController::notifyProxy (bool aInsertFilters)
     1203HRESULT USBController::notifyProxy(bool aInsertFilters)
    12051204{
    12061205    LogFlowThisFunc(("aInsertFilters=%RTbool\n", aInsertFilters));
    12071206
    12081207    AutoCaller autoCaller(this);
    1209     AssertComRCReturn (autoCaller.rc(), false);
     1208    AssertComRCReturn(autoCaller.rc(), false);
    12101209
    12111210    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     
    12211220        /* notify the proxy (only if the filter is active) */
    12221221        if (flt->getData().mActive
    1223                 && flt->getData().mRemote.isMatch (false) /* and if the filter is NOT remote */
     1222                && flt->getData().mRemote.isMatch(false) /* and if the filter is NOT remote */
    12241223                )
    12251224        {
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