HostUSBDeviceImpl.h revision fcb7529771e773b085b87eb5f251ed1182a118fb
fd9abdda70912b99b24e3bf1a38f26fde908a74cnd * VirtualBox IHostUSBDevice COM interface implementation
a78048ccbdb6256da15e6b0e7e95355e480c2301nd * Copyright (C) 2006-2007 innotek GmbH
a78048ccbdb6256da15e6b0e7e95355e480c2301nd * This file is part of VirtualBox Open Source Edition (OSE), as
96ad5d81ee4a2cc66a4ae19893efc8aa6d06fae7jailletc * available from http://www.virtualbox.org. This file is free software;
a78048ccbdb6256da15e6b0e7e95355e480c2301nd * you can redistribute it and/or modify it under the terms of the GNU
a78048ccbdb6256da15e6b0e7e95355e480c2301nd * General Public License as published by the Free Software Foundation,
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen * in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
2e545ce2450a9953665f701bb05350f0d3f26275nd * distribution. VirtualBox OSE is distributed in the hope that it will
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen * be useful, but WITHOUT ANY WARRANTY of any kind.
a78048ccbdb6256da15e6b0e7e95355e480c2301nd * If you received this file as part of a commercial VirtualBox
a78048ccbdb6256da15e6b0e7e95355e480c2301nd * distribution, then only the terms of your commercial VirtualBox
af33a4994ae2ff15bc67d19ff1a7feb906745bf8rbowen * license agreement apply instead of the previous paragraph.
e609c337f729875bc20e01096c7e610f45356f54nilgun/* #include "USBProxyService.h" circular on Host/HostUSBDevice, the includer
f086b4b402fa9a2fefc7dda85de2a3cc1cd0a654rjung * must include this. */
a78048ccbdb6256da15e6b0e7e95355e480c2301nd * Object class used to hold Host USB Device properties.
a78048ccbdb6256da15e6b0e7e95355e480c2301nd public VirtualBoxSupportErrorInfoImpl <HostUSBDevice, IHostUSBDevice>,
a78048ccbdb6256da15e6b0e7e95355e480c2301nd // public initializer/uninitializer for internal purposes only
a78048ccbdb6256da15e6b0e7e95355e480c2301nd HRESULT init(PUSBDEVICE aUsb, USBProxyService *aUSBProxyService);
a78048ccbdb6256da15e6b0e7e95355e480c2301nd // IUSBDevice properties
a78048ccbdb6256da15e6b0e7e95355e480c2301nd // IHostUSBDevice properties
a78048ccbdb6256da15e6b0e7e95355e480c2301nd // public methods only for internal purposes
a78048ccbdb6256da15e6b0e7e95355e480c2301nd /* @note Must be called from under the object read lock. */
a78048ccbdb6256da15e6b0e7e95355e480c2301nd /* @note Must be called from under the object read lock. */
a78048ccbdb6256da15e6b0e7e95355e480c2301nd /* @note Must be called from under the object read lock. */
a78048ccbdb6256da15e6b0e7e95355e480c2301nd USBDeviceState_T pendingState() const { return mPendingState; }
a78048ccbdb6256da15e6b0e7e95355e480c2301nd /* @note Must be called from under the object read lock. */
a78048ccbdb6256da15e6b0e7e95355e480c2301nd ComObjPtr <SessionMachine, ComWeakRef> &machine() { return mMachine; }
a78048ccbdb6256da15e6b0e7e95355e480c2301nd /* @note Must be called from under the object read lock. */
a78048ccbdb6256da15e6b0e7e95355e480c2301nd /* @note Must be called from under the object read lock. */
a78048ccbdb6256da15e6b0e7e95355e480c2301nd static int compare (PCUSBDEVICE pDev1, PCUSBDEVICE pDev2);
a78048ccbdb6256da15e6b0e7e95355e480c2301nd // for VirtualBoxSupportErrorInfoImpl
a78048ccbdb6256da15e6b0e7e95355e480c2301nd static const wchar_t *getComponentName() { return L"HostUSBDevice"; }
a78048ccbdb6256da15e6b0e7e95355e480c2301nd /** Pointer to the USB Proxy Service instance. */
a78048ccbdb6256da15e6b0e7e95355e480c2301nd /** Pointer to the USB Device structure owned by this device.
a78048ccbdb6256da15e6b0e7e95355e480c2301nd * Only used for host devices. */
a78048ccbdb6256da15e6b0e7e95355e480c2301ndCOM_DECL_READONLY_ENUM_AND_COLLECTION_BEGIN (HostUSBDevice)
e609c337f729875bc20e01096c7e610f45356f54nilgun STDMETHOD(FindById) (INPTR GUIDPARAM aId, IHostUSBDevice **aDevice)
af33a4994ae2ff15bc67d19ff1a7feb906745bf8rbowen return setError (E_INVALIDARG, HostUSBDeviceCollection::tr (
0d0ba3a410038e179b695446bb149cce6264e0abnd "Could not find a USB device with UUID {%s}"),
if (!aAddress)
return E_INVALIDARG;
if (!aDevice)
return E_POINTER;
++ it;
if (!found)
aAddress);