Index: /trunk/src/VBox/Main/include/RemoteUSBDeviceImpl.h
===================================================================
--- /trunk/src/VBox/Main/include/RemoteUSBDeviceImpl.h	(revision 56583)
+++ /trunk/src/VBox/Main/include/RemoteUSBDeviceImpl.h	(revision 56584)
@@ -8,5 +8,5 @@
 
 /*
- * Copyright (C) 2006-2011 Oracle Corporation
+ * Copyright (C) 2006-2015 Oracle Corporation
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -22,5 +22,5 @@
 #define ____H_REMOTEUSBDEVICEIMPL
 
-#include "VirtualBoxBase.h"
+#include "HostUSBDeviceWrap.h"
 
 struct _VRDEUSBDEVICEDESC;
@@ -28,21 +28,9 @@
 
 class ATL_NO_VTABLE RemoteUSBDevice :
-    public VirtualBoxBase,
-    VBOX_SCRIPTABLE_IMPL(IHostUSBDevice)
+    public HostUSBDeviceWrap
 {
 public:
 
-    VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT(RemoteUSBDevice, IHostUSBDevice)
-
-    DECLARE_NOT_AGGREGATABLE (RemoteUSBDevice)
-
-    DECLARE_PROTECT_FINAL_CONSTRUCT()
-
-    BEGIN_COM_MAP (RemoteUSBDevice)
-        COM_INTERFACE_ENTRY  (IHostUSBDevice)
-        VBOX_DEFAULT_INTERFACE_ENTRIES  (IUSBDevice)
-    END_COM_MAP()
-
-    DECLARE_EMPTY_CTOR_DTOR (RemoteUSBDevice)
+    DECLARE_EMPTY_CTOR_DTOR(RemoteUSBDevice)
 
     HRESULT FinalConstruct();
@@ -53,31 +41,13 @@
     void uninit();
 
-    // IUSBDevice properties
-    STDMETHOD(COMGETTER(Id)) (BSTR *aId);
-    STDMETHOD(COMGETTER(VendorId)) (USHORT *aVendorId);
-    STDMETHOD(COMGETTER(ProductId)) (USHORT *aProductId);
-    STDMETHOD(COMGETTER(Revision)) (USHORT *aRevision);
-    STDMETHOD(COMGETTER(Manufacturer)) (BSTR *aManufacturer);
-    STDMETHOD(COMGETTER(Product)) (BSTR *aProduct);
-    STDMETHOD(COMGETTER(SerialNumber)) (BSTR *aSerialNumber);
-    STDMETHOD(COMGETTER(Address)) (BSTR *aAddress);
-    STDMETHOD(COMGETTER(Port)) (USHORT *aPort);
-    STDMETHOD(COMGETTER(Version)) (USHORT *aVersion);
-    STDMETHOD(COMGETTER(PortVersion)) (USHORT *aPortVersion);
-    STDMETHOD(COMGETTER(Speed)) (USBConnectionSpeed_T *aSpeed);
-    STDMETHOD(COMGETTER(Remote)) (BOOL *aRemote);
+    // public methods only for internal purposes
+    bool dirty(void) const { return mData.dirty; }
+    void dirty(bool aDirty) { mData.dirty = aDirty; }
 
-    // IHostUSBDevice properties
-    STDMETHOD(COMGETTER(State)) (USBDeviceState_T *aState);
+    uint16_t devId(void) const { return mData.devId; }
+    uint32_t clientId(void) { return mData.clientId; }
 
-    // public methods only for internal purposes
-    bool dirty (void) const { return mData.dirty; }
-    void dirty (bool aDirty) { mData.dirty = aDirty; }
-
-    uint16_t devId (void) const { return mData.devId; }
-    uint32_t clientId (void) { return mData.clientId; }
-
-    bool captured (void) const { return mData.state == USBDeviceState_Captured; }
-    void captured (bool aCaptured)
+    bool captured(void) const { return mData.state == USBDeviceState_Captured; }
+    void captured(bool aCaptured)
     {
         if (aCaptured)
@@ -95,8 +65,28 @@
 private:
 
+    // wrapped IUSBDevice properties
+    HRESULT getId(com::Guid &aId);
+    HRESULT getVendorId(USHORT *aVendorId);
+    HRESULT getProductId(USHORT *aProductId);
+    HRESULT getRevision(USHORT *aRevision);
+    HRESULT getManufacturer(com::Utf8Str &aManufacturer);
+    HRESULT getProduct(com::Utf8Str &aProduct);
+    HRESULT getSerialNumber(com::Utf8Str &aSerialNumber);
+    HRESULT getAddress(com::Utf8Str &aAddress);
+    HRESULT getPort(USHORT *aPort);
+    HRESULT getVersion(USHORT *aVersion);
+    HRESULT getPortVersion(USHORT *aPortVersion);
+    HRESULT getSpeed(USBConnectionSpeed_T *aSpeed);
+    HRESULT getRemote(BOOL *aRemote);
+
+    // wrapped IHostUSBDevice properties
+    HRESULT getState(USBDeviceState_T *aState);
+
+
     struct Data
     {
-        Data() : vendorId (0), productId (0), revision (0), port (0), version (1),
-                 portVersion (1), speed (USBConnectionSpeed_Null), dirty (FALSE), devId (0), clientId (0) {}
+        Data() : vendorId(0), productId(0), revision(0), port(0), version(1),
+                 portVersion(1), speed(USBConnectionSpeed_Null), dirty(FALSE),
+                 devId(0), clientId(0) {}
 
         const Guid id;
@@ -106,9 +96,9 @@
         const uint16_t revision;
 
-        const Bstr manufacturer;
-        const Bstr product;
-        const Bstr serialNumber;
+        const Utf8Str manufacturer;
+        const Utf8Str product;
+        const Utf8Str serialNumber;
 
-        const Bstr address;
+        const Utf8Str address;
 
         const uint16_t port;
Index: /trunk/src/VBox/Main/include/USBDeviceImpl.h
===================================================================
--- /trunk/src/VBox/Main/include/USBDeviceImpl.h	(revision 56583)
+++ /trunk/src/VBox/Main/include/USBDeviceImpl.h	(revision 56584)
@@ -6,5 +6,5 @@
 
 /*
- * Copyright (C) 2006-2011 Oracle Corporation
+ * Copyright (C) 2006-2015 Oracle Corporation
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -31,5 +31,5 @@
 public:
 
-    DECLARE_EMPTY_CTOR_DTOR (OUSBDevice)
+    DECLARE_EMPTY_CTOR_DTOR(OUSBDevice)
 
     HRESULT FinalConstruct();
@@ -37,5 +37,5 @@
 
     // public initializer/uninitializer for internal purposes only
-    HRESULT init (IUSBDevice *a_pUSBDevice);
+    HRESULT init(IUSBDevice *a_pUSBDevice);
     void uninit();
 
@@ -62,6 +62,7 @@
     struct Data
     {
-        Data() : vendorId (0), productId (0), revision (0), port (0),
-                 version (1), portVersion (1), speed (USBConnectionSpeed_Null), remote (FALSE) {}
+        Data() : vendorId(0), productId(0), revision(0), port(0),
+                 version(1), portVersion(1), speed(USBConnectionSpeed_Null),
+                 remote(FALSE) {}
 
         /** The UUID of this device. */
Index: /trunk/src/VBox/Main/src-client/RemoteUSBDeviceImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/src-client/RemoteUSBDeviceImpl.cpp	(revision 56583)
+++ /trunk/src/VBox/Main/src-client/RemoteUSBDeviceImpl.cpp	(revision 56584)
@@ -8,5 +8,5 @@
 
 /*
- * Copyright (C) 2006-2011 Oracle Corporation
+ * Copyright (C) 2006-2015 Oracle Corporation
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -34,5 +34,5 @@
 /////////////////////////////////////////////////////////////////////////////
 
-DEFINE_EMPTY_CTOR_DTOR (RemoteUSBDevice)
+DEFINE_EMPTY_CTOR_DTOR(RemoteUSBDevice)
 
 HRESULT RemoteUSBDevice::FinalConstruct()
@@ -55,5 +55,5 @@
  * Initializes the remote USB device object.
  */
-HRESULT RemoteUSBDevice::init (uint32_t u32ClientId, VRDEUSBDEVICEDESC *pDevDesc, bool fDescExt)
+HRESULT RemoteUSBDevice::init(uint32_t u32ClientId, VRDEUSBDEVICEDESC *pDevDesc, bool fDescExt)
 {
     LogFlowThisFunc(("u32ClientId=%d,pDevDesc=%p\n", u32ClientId, pDevDesc));
@@ -69,10 +69,10 @@
     unconst(mData.revision)     = pDevDesc->bcdRev;
 
-    unconst(mData.manufacturer) = pDevDesc->oManufacturer? (char *)pDevDesc + pDevDesc->oManufacturer: "";
-    unconst(mData.product)      = pDevDesc->oProduct? (char *)pDevDesc + pDevDesc->oProduct: "";
-    unconst(mData.serialNumber) = pDevDesc->oSerialNumber? (char *)pDevDesc + pDevDesc->oSerialNumber: "";
+    unconst(mData.manufacturer) = pDevDesc->oManufacturer ? (char *)pDevDesc + pDevDesc->oManufacturer : "";
+    unconst(mData.product)      = pDevDesc->oProduct ? (char *)pDevDesc + pDevDesc->oProduct : "";
+    unconst(mData.serialNumber) = pDevDesc->oSerialNumber ? (char *)pDevDesc + pDevDesc->oSerialNumber : "";
 
     char id[64];
-    RTStrPrintf(id, sizeof (id), REMOTE_USB_BACKEND_PREFIX_S "0x%08X&0x%08X", pDevDesc->id, u32ClientId);
+    RTStrPrintf(id, sizeof(id), REMOTE_USB_BACKEND_PREFIX_S "0x%08X&0x%08X", pDevDesc->id, u32ClientId);
     unconst(mData.address)      = id;
 
@@ -165,24 +165,13 @@
 /////////////////////////////////////////////////////////////////////////////
 
-STDMETHODIMP RemoteUSBDevice::COMGETTER(Id) (BSTR *aId)
-{
-    CheckComArgOutPointerValid(aId);
-
-    AutoCaller autoCaller(this);
-    if (FAILED(autoCaller.rc())) return autoCaller.rc();
-
-    /* this is const, no need to lock */
-    mData.id.toUtf16().detachTo(aId);
-
-    return S_OK;
-}
-
-STDMETHODIMP RemoteUSBDevice::COMGETTER(VendorId) (USHORT *aVendorId)
-{
-    CheckComArgOutPointerValid(aVendorId);
-
-    AutoCaller autoCaller(this);
-    if (FAILED(autoCaller.rc())) return autoCaller.rc();
-
+HRESULT RemoteUSBDevice::getId(com::Guid &aId)
+{
+    aId = mData.id;
+
+    return S_OK;
+}
+
+HRESULT RemoteUSBDevice::getVendorId(USHORT *aVendorId)
+{
     /* this is const, no need to lock */
     *aVendorId = mData.vendorId;
@@ -191,11 +180,6 @@
 }
 
-STDMETHODIMP RemoteUSBDevice::COMGETTER(ProductId) (USHORT *aProductId)
-{
-    CheckComArgOutPointerValid(aProductId);
-
-    AutoCaller autoCaller(this);
-    if (FAILED(autoCaller.rc())) return autoCaller.rc();
-
+HRESULT RemoteUSBDevice::getProductId(USHORT *aProductId)
+{
     /* this is const, no need to lock */
     *aProductId = mData.productId;
@@ -204,11 +188,6 @@
 }
 
-STDMETHODIMP RemoteUSBDevice::COMGETTER(Revision) (USHORT *aRevision)
-{
-    CheckComArgOutPointerValid(aRevision);
-
-    AutoCaller autoCaller(this);
-    if (FAILED(autoCaller.rc())) return autoCaller.rc();
-
+HRESULT RemoteUSBDevice::getRevision(USHORT *aRevision)
+{
     /* this is const, no need to lock */
     *aRevision = mData.revision;
@@ -217,63 +196,38 @@
 }
 
-STDMETHODIMP RemoteUSBDevice::COMGETTER(Manufacturer) (BSTR *aManufacturer)
-{
-    CheckComArgOutPointerValid(aManufacturer);
-
-    AutoCaller autoCaller(this);
-    if (FAILED(autoCaller.rc())) return autoCaller.rc();
-
-    /* this is const, no need to lock */
-    mData.manufacturer.cloneTo(aManufacturer);
-
-    return S_OK;
-}
-
-STDMETHODIMP RemoteUSBDevice::COMGETTER(Product) (BSTR *aProduct)
-{
-    CheckComArgOutPointerValid(aProduct);
-
-    AutoCaller autoCaller(this);
-    if (FAILED(autoCaller.rc())) return autoCaller.rc();
-
-    /* this is const, no need to lock */
-    mData.product.cloneTo(aProduct);
-
-    return S_OK;
-}
-
-STDMETHODIMP RemoteUSBDevice::COMGETTER(SerialNumber) (BSTR *aSerialNumber)
-{
-    CheckComArgOutPointerValid(aSerialNumber);
-
-    AutoCaller autoCaller(this);
-    if (FAILED(autoCaller.rc())) return autoCaller.rc();
-
-    /* this is const, no need to lock */
-    mData.serialNumber.cloneTo(aSerialNumber);
-
-    return S_OK;
-}
-
-STDMETHODIMP RemoteUSBDevice::COMGETTER(Address) (BSTR *aAddress)
-{
-    CheckComArgOutPointerValid(aAddress);
-
-    AutoCaller autoCaller(this);
-    if (FAILED(autoCaller.rc())) return autoCaller.rc();
-
-    /* this is const, no need to lock */
-    mData.address.cloneTo(aAddress);
-
-    return S_OK;
-}
-
-STDMETHODIMP RemoteUSBDevice::COMGETTER(Port) (USHORT *aPort)
-{
-    CheckComArgOutPointerValid(aPort);
-
-    AutoCaller autoCaller(this);
-    if (FAILED(autoCaller.rc())) return autoCaller.rc();
-
+HRESULT RemoteUSBDevice::getManufacturer(com::Utf8Str &aManufacturer)
+{
+    /* this is const, no need to lock */
+    aManufacturer = mData.manufacturer;
+
+    return S_OK;
+}
+
+HRESULT RemoteUSBDevice::getProduct(com::Utf8Str &aProduct)
+{
+    /* this is const, no need to lock */
+    aProduct = mData.product;
+
+    return S_OK;
+}
+
+HRESULT RemoteUSBDevice::getSerialNumber(com::Utf8Str &aSerialNumber)
+{
+    /* this is const, no need to lock */
+    aSerialNumber = mData.serialNumber;
+
+    return S_OK;
+}
+
+HRESULT RemoteUSBDevice::getAddress(com::Utf8Str &aAddress)
+{
+    /* this is const, no need to lock */
+    aAddress = mData.address;
+
+    return S_OK;
+}
+
+HRESULT RemoteUSBDevice::getPort(USHORT *aPort)
+{
     /* this is const, no need to lock */
     *aPort = mData.port;
@@ -282,11 +236,6 @@
 }
 
-STDMETHODIMP RemoteUSBDevice::COMGETTER(Version) (USHORT *aVersion)
-{
-    CheckComArgOutPointerValid(aVersion);
-
-    AutoCaller autoCaller(this);
-    if (FAILED(autoCaller.rc())) return autoCaller.rc();
-
+HRESULT RemoteUSBDevice::getVersion(USHORT *aVersion)
+{
     /* this is const, no need to lock */
     *aVersion = mData.version;
@@ -295,11 +244,6 @@
 }
 
-STDMETHODIMP RemoteUSBDevice::COMGETTER(PortVersion) (USHORT *aPortVersion)
-{
-    CheckComArgOutPointerValid(aPortVersion);
-
-    AutoCaller autoCaller(this);
-    if (FAILED(autoCaller.rc())) return autoCaller.rc();
-
+HRESULT RemoteUSBDevice::getPortVersion(USHORT *aPortVersion)
+{
     /* this is const, no need to lock */
     *aPortVersion = mData.portVersion;
@@ -308,11 +252,6 @@
 }
 
-STDMETHODIMP RemoteUSBDevice::COMGETTER(Speed) (USBConnectionSpeed_T *aSpeed)
-{
-    CheckComArgOutPointerValid(aSpeed);
-
-    AutoCaller autoCaller(this);
-    if (FAILED(autoCaller.rc())) return autoCaller.rc();
-
+HRESULT RemoteUSBDevice::getSpeed(USBConnectionSpeed_T *aSpeed)
+{
     /* this is const, no need to lock */
     *aSpeed = mData.speed;
@@ -321,11 +260,6 @@
 }
 
-STDMETHODIMP RemoteUSBDevice::COMGETTER(Remote) (BOOL *aRemote)
-{
-    CheckComArgOutPointerValid(aRemote);
-
-    AutoCaller autoCaller(this);
-    if (FAILED(autoCaller.rc())) return autoCaller.rc();
-
+HRESULT RemoteUSBDevice::getRemote(BOOL *aRemote)
+{
     /* RemoteUSBDevice is always remote. */
     /* this is const, no need to lock */
@@ -338,11 +272,6 @@
 ////////////////////////////////////////////////////////////////////////////////
 
-STDMETHODIMP RemoteUSBDevice::COMGETTER(State) (USBDeviceState_T *aState)
-{
-    CheckComArgOutPointerValid(aState);
-
-    AutoCaller autoCaller(this);
-    if (FAILED(autoCaller.rc())) return autoCaller.rc();
-
+HRESULT RemoteUSBDevice::getState(USBDeviceState_T *aState)
+{
     AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
 
Index: /trunk/src/VBox/Main/src-client/xpcom/module.cpp
===================================================================
--- /trunk/src/VBox/Main/src-client/xpcom/module.cpp	(revision 56583)
+++ /trunk/src/VBox/Main/src-client/xpcom/module.cpp	(revision 56584)
@@ -6,5 +6,5 @@
 
 /*
- * Copyright (C) 2006-2014 Oracle Corporation
+ * Copyright (C) 2006-2015 Oracle Corporation
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -38,9 +38,4 @@
 
 // XPCOM glue code unfolding
-
-#ifndef VBOX_COM_INPROC_API_CLIENT
-NS_DECL_CLASSINFO(RemoteUSBDevice)
-NS_IMPL_THREADSAFE_ISUPPORTS2_CI(RemoteUSBDevice, IHostUSBDevice, IUSBDevice)
-#endif /* VBOX_COM_INPROC_API_CLIENT */
 
 /*
