Changeset 50403 in vbox
- Timestamp:
- Feb 10, 2014 6:53:47 PM (11 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 5 edited
-
Main/include/USBDeviceImpl.h (modified) (4 diffs)
-
Main/src-client/ConsoleImpl.cpp (modified) (5 diffs)
-
Main/src-client/USBDeviceImpl.cpp (modified) (13 diffs)
-
Main/src-client/xpcom/module.cpp (modified) (1 diff)
-
Runtime/common/log/log.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/include/USBDeviceImpl.h
r44528 r50403 20 20 #define ____H_USBDEVICEIMPL 21 21 22 #include " VirtualBoxBase.h"22 #include "USBDeviceWrap.h" 23 23 24 24 /** … … 27 27 */ 28 28 class ATL_NO_VTABLE OUSBDevice : 29 public VirtualBoxBase, 30 VBOX_SCRIPTABLE_IMPL(IUSBDevice) 29 public USBDeviceWrap 31 30 { 32 31 public: 33 34 VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT(OUSBDevice, IUSBDevice)35 36 DECLARE_NOT_AGGREGATABLE(OUSBDevice)37 38 DECLARE_PROTECT_FINAL_CONSTRUCT()39 40 BEGIN_COM_MAP(OUSBDevice)41 VBOX_DEFAULT_INTERFACE_ENTRIES (IUSBDevice)42 END_COM_MAP()43 32 44 33 DECLARE_EMPTY_CTOR_DTOR (OUSBDevice) … … 51 40 void uninit(); 52 41 53 // IUSBDevice properties54 STDMETHOD(COMGETTER(Id))(BSTR *aId);55 STDMETHOD(COMGETTER(VendorId))(USHORT *aVendorId);56 STDMETHOD(COMGETTER(ProductId))(USHORT *aProductId);57 STDMETHOD(COMGETTER(Revision))(USHORT *aRevision);58 STDMETHOD(COMGETTER(Manufacturer))(BSTR *aManufacturer);59 STDMETHOD(COMGETTER(Product))(BSTR *aProduct);60 STDMETHOD(COMGETTER(SerialNumber))(BSTR *aSerialNumber);61 STDMETHOD(COMGETTER(Address))(BSTR *aAddress);62 STDMETHOD(COMGETTER(Port))(USHORT *aPort);63 STDMETHOD(COMGETTER(Version))(USHORT *aVersion);64 STDMETHOD(COMGETTER(PortVersion))(USHORT *aPortVersion);65 STDMETHOD(COMGETTER(Remote))(BOOL *aRemote);66 67 42 // public methods only for internal purposes 68 const Guid &i d() const { return mData.id; }43 const Guid &i_id() const { return mData.id; } 69 44 70 45 private: 46 47 // Wrapped IUSBDevice properties 48 HRESULT getId(com::Guid &aId); 49 HRESULT getVendorId(USHORT *aVendorId); 50 HRESULT getProductId(USHORT *aProductId); 51 HRESULT getRevision(USHORT *aRevision); 52 HRESULT getManufacturer(com::Utf8Str &aManufacturer); 53 HRESULT getProduct(com::Utf8Str &aProduct); 54 HRESULT getSerialNumber(com::Utf8Str &aSerialNumber); 55 HRESULT getAddress(com::Utf8Str &aAddress); 56 HRESULT getPort(USHORT *aPort); 57 HRESULT getVersion(USHORT *aVersion); 58 HRESULT getPortVersion(USHORT *aPortVersion); 59 HRESULT getRemote(BOOL *aRemote); 71 60 72 61 struct Data … … 86 75 const USHORT revision; 87 76 /** The Manufacturer string. (Quite possibly NULL.) */ 88 const Bstr manufacturer;77 const com::Utf8Str manufacturer; 89 78 /** The Product string. (Quite possibly NULL.) */ 90 const Bstr product;79 const com::Utf8Str product; 91 80 /** The SerialNumber string. (Quite possibly NULL.) */ 92 const Bstr serialNumber;81 const com::Utf8Str serialNumber; 93 82 /** The host specific address of the device. */ 94 const Bstr address;83 const com::Utf8Str address; 95 84 /** The host port number. */ 96 85 const USHORT port; -
trunk/src/VBox/Main/src-client/ConsoleImpl.cpp
r50033 r50403 2938 2938 while (it != mUSBDevices.end()) 2939 2939 { 2940 if ((*it)->i d() == uuid)2940 if ((*it)->i_id() == uuid) 2941 2941 { 2942 2942 pUSBDevice = *it; … … 5211 5211 while (it != mUSBDevices.end()) 5212 5212 { 5213 LogFlowThisFunc(("it={%RTuuid}\n", (*it)->i d().raw()));5214 if ((*it)->i d() == Uuid)5213 LogFlowThisFunc(("it={%RTuuid}\n", (*it)->i_id().raw())); 5214 if ((*it)->i_id() == Uuid) 5215 5215 { 5216 5216 pUSBDevice = *it; … … 8287 8287 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 8288 8288 mUSBDevices.push_back(pUSBDevice); 8289 LogFlowFunc(("Attached device {%RTuuid}\n", pUSBDevice->i d().raw()));8289 LogFlowFunc(("Attached device {%RTuuid}\n", pUSBDevice->i_id().raw())); 8290 8290 8291 8291 /* notify callbacks */ … … 8365 8365 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 8366 8366 LogFlowThisFunc(("Detaching USB proxy device {%RTuuid}...\n", 8367 aHostDevice->i d().raw()));8367 aHostDevice->i_id().raw())); 8368 8368 8369 8369 /* … … 8377 8377 setErrorStatic(hrc2, "GetRemote() failed"); 8378 8378 8379 PCRTUUID pUuid = aHostDevice->i d().raw();8379 PCRTUUID pUuid = aHostDevice->i_id().raw(); 8380 8380 if (fRemote) 8381 8381 { -
trunk/src/VBox/Main/src-client/USBDeviceImpl.cpp
r44528 r50403 68 68 ComAssertComRCRet(hrc, hrc); 69 69 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); 81 88 82 89 hrc = aUSBDevice->COMGETTER(Port)(&unconst(mData.port)); … … 86 93 ComAssertComRCRet(hrc, hrc); 87 94 88 hrc = aUSBDevice->COMGETTER( Port)(&unconst(mData.portVersion));95 hrc = aUSBDevice->COMGETTER(Version)(&unconst(mData.portVersion)); 89 96 ComAssertComRCRet(hrc, hrc); 90 97 … … 144 151 * @param aId Address of result variable. 145 152 */ 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); 153 HRESULT OUSBDevice::getId(com::Guid &aId) 154 { 155 /* this is const, no need to lock */ 156 aId = mData.id; 155 157 156 158 return S_OK; … … 164 166 * @param aVendorId Where to store the vendor id. 165 167 */ 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 168 HRESULT OUSBDevice::getVendorId(USHORT *aVendorId) 169 { 173 170 /* this is const, no need to lock */ 174 171 *aVendorId = mData.vendorId; … … 184 181 * @param aProductId Where to store the product id. 185 182 */ 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 183 HRESULT OUSBDevice::getProductId(USHORT *aProductId) 184 { 193 185 /* this is const, no need to lock */ 194 186 *aProductId = mData.productId; … … 204 196 * @param aRevision Where to store the revision BCD. 205 197 */ 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 198 HRESULT OUSBDevice::getRevision(USHORT *aRevision) 199 { 213 200 /* this is const, no need to lock */ 214 201 *aRevision = mData.revision; … … 223 210 * @param aManufacturer Where to put the return string. 224 211 */ 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); 212 HRESULT OUSBDevice::getManufacturer(com::Utf8Str &aManufacturer) 213 { 214 /* this is const, no need to lock */ 215 aManufacturer = mData.manufacturer; 234 216 235 217 return S_OK; … … 243 225 * @param aProduct Where to put the return string. 244 226 */ 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); 227 HRESULT OUSBDevice::getProduct(com::Utf8Str &aProduct) 228 { 229 /* this is const, no need to lock */ 230 aProduct = mData.product; 254 231 255 232 return S_OK; … … 263 240 * @param aSerialNumber Where to put the return string. 264 241 */ 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); 242 HRESULT OUSBDevice::getSerialNumber(com::Utf8Str &aSerialNumber) 243 { 244 /* this is const, no need to lock */ 245 aSerialNumber = mData.serialNumber; 274 246 275 247 return S_OK; … … 283 255 * @param aAddress Where to put the return string. 284 256 */ 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 257 HRESULT 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 265 HRESULT OUSBDevice::getPort(USHORT *aPort) 266 { 305 267 /* this is const, no need to lock */ 306 268 *aPort = mData.port; … … 309 271 } 310 272 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 273 HRESULT OUSBDevice::getVersion(USHORT *aVersion) 274 { 318 275 /* this is const, no need to lock */ 319 276 *aVersion = mData.version; … … 322 279 } 323 280 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 281 HRESULT OUSBDevice::getPortVersion(USHORT *aPortVersion) 282 { 331 283 /* this is const, no need to lock */ 332 284 *aPortVersion = mData.portVersion; … … 335 287 } 336 288 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 289 HRESULT OUSBDevice::getRemote(BOOL *aRemote) 290 { 344 291 /* this is const, no need to lock */ 345 292 *aRemote = mData.remote; -
trunk/src/VBox/Main/src-client/xpcom/module.cpp
r50370 r50403 90 90 NS_DECL_CLASSINFO(Progress) 91 91 NS_IMPL_THREADSAFE_ISUPPORTS1_CI(Progress, IProgress) 92 NS_DECL_CLASSINFO(OUSBDevice)93 NS_IMPL_THREADSAFE_ISUPPORTS1_CI(OUSBDevice, IUSBDevice)94 92 NS_DECL_CLASSINFO(RemoteUSBDevice) 95 93 NS_IMPL_THREADSAFE_ISUPPORTS2_CI(RemoteUSBDevice, IHostUSBDevice, IUSBDevice) -
trunk/src/VBox/Runtime/common/log/log.cpp
r49942 r50403 1501 1501 } /* strincmp */ 1502 1502 } /* for each flags */ 1503 AssertMsg(fFound, ("%.15s...", psz));1503 // AssertMsg(fFound, ("%.15s...", psz)); 1504 1504 } 1505 1505
Note:
See TracChangeset
for help on using the changeset viewer.

