RemoteUSBDeviceImpl.cpp revision c98fb3e16fcd571a790eab772c0c66173d225205
/** @file
*
* VirtualBox IHostUSBDevice COM interface implementation
* for remote (VRDP) USB devices
*/
/*
* Copyright (C) 2006-2007 innotek GmbH
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License as published by the Free Software Foundation,
* in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
* distribution. VirtualBox OSE is distributed in the hope that it will
* be useful, but WITHOUT ANY WARRANTY of any kind.
*/
#include "RemoteUSBDeviceImpl.h"
#include "Logging.h"
// constructor / destructor
/////////////////////////////////////////////////////////////////////////////
{
return S_OK;
}
void RemoteUSBDevice::FinalRelease()
{
if (isReady())
uninit();
}
// public initializer/uninitializer for internal purposes only
/////////////////////////////////////////////////////////////////////////////
/** @todo (sunlover) REMOTE_USB Device states. */
/**
* Initializes the remote USB device object.
*/
{
LogFlowMember (("RemoteUSBDevice::init()\n"));
char id[64];
RTStrPrintf(id, sizeof (id), REMOTE_USB_BACKEND_PREFIX_S "0x%08X&0x%08X", pDevDesc->id, u32ClientId);
mDirty = false;
setReady (true);
return S_OK;
}
/**
* Uninitializes the instance and sets the ready flag to FALSE.
* Called either from FinalRelease() or by the parent when it gets destroyed.
*/
void RemoteUSBDevice::uninit()
{
LogFlowMember (("RemoteUSBDevice::uninit()\n"));
AssertReturn (isReady(), (void) 0);
setReady (false);
}
// IUSBDevice properties
/////////////////////////////////////////////////////////////////////////////
{
if (!aId)
return E_INVALIDARG;
CHECK_READY();
return S_OK;
}
{
if (!aVendorId)
return E_INVALIDARG;
CHECK_READY();
return S_OK;
}
{
if (!aProductId)
return E_INVALIDARG;
CHECK_READY();
*aProductId = mProductId;
return S_OK;
}
{
if (!aRevision)
return E_INVALIDARG;
CHECK_READY();
return S_OK;
}
{
if (!aManufacturer)
return E_INVALIDARG;
CHECK_READY();
return S_OK;
}
{
if (!aProduct)
return E_INVALIDARG;
CHECK_READY();
return S_OK;
}
{
if (!aSerialNumber)
return E_INVALIDARG;
CHECK_READY();
return S_OK;
}
{
if (!aAddress)
return E_INVALIDARG;
CHECK_READY();
return S_OK;
}
{
if (!aPort)
return E_INVALIDARG;
CHECK_READY();
return S_OK;
}
{
if (!aRemote)
return E_INVALIDARG;
CHECK_READY();
/* RemoteUSBDevice is always remote. */
return S_OK;
}
// IHostUSBDevice properties
/////////////////////////////////////////////////////////////////////////////
{
if (!aState)
return E_POINTER;
CHECK_READY();
return S_OK;
}
// public methods only for internal purposes
////////////////////////////////////////////////////////////////////////////////