USBProxyServiceOs2.cpp revision b52c24239bed9dc9f284d829b6059073afcb1894
/* $Id$ */
/** @file
* VirtualBox USB Proxy Service, OS/2 Specialization.
*/
/*
* Copyright (C) 2006-2010 Oracle Corporation
*
* 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 (GPL) 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.
*/
/*******************************************************************************
* Header Files *
*******************************************************************************/
#define INCL_BASE
#define INCL_ERRORS
#include "USBProxyService.h"
#include "Logging.h"
/**
* Initialize data members.
*/
{
/*
* Try initialize the usbcalls stuff.
*/
if (RT_SUCCESS(rc))
{
if (RT_SUCCESS(rc))
{
if ( (rc = DosQueryProcAddr (mhmod, 0, (PCSZ)"UsbQueryNumberDevices", (PPFN)&mpfnUsbQueryNumberDevices)) == NO_ERROR
&& (rc = DosQueryProcAddr (mhmod, 0, (PCSZ)"UsbQueryDeviceReport", (PPFN)&mpfnUsbQueryDeviceReport)) == NO_ERROR
&& (rc = DosQueryProcAddr (mhmod, 0, (PCSZ)"UsbRegisterChangeNotification", (PPFN)&mpfnUsbRegisterChangeNotification)) == NO_ERROR
&& (rc = DosQueryProcAddr (mhmod, 0, (PCSZ)"UsbDeregisterNotification", (PPFN)&mpfnUsbDeregisterNotification)) == NO_ERROR
)
{
if (!rc)
{
/*
* Start the poller thread.
*/
if (RT_SUCCESS(rc))
{
return;
}
}
}
else
LogRel (("USBProxyServiceOs2: failed to load usbcalls\n"));
}
else
mhmod = NULLHANDLE;
}
else
mhev = NULLHANDLE;
mLastError = rc;
}
/**
* Stop all service threads and free the device chain.
*/
{
LogFlowThisFunc(("\n"));
/*
* Stop the service.
*/
if (isActive())
stop();
/*
* Free resources.
*/
if (mhmod)
{
mhmod = NULLHANDLE;
}
}
{
/*
* Don't think we need to do anything when the device is held... fake it.
*/
return VINF_SUCCESS;
}
{
/*
* We're not really holding it atm., just fake it.
*/
return VINF_SUCCESS;
}
bool USBProxyServiceOs2::updateDeviceState(HostUSBDevice *aDevice, PUSBDEVICE aUSBDevice, bool *aRunFilters, SessionMachine **aIgnoreMachine)
{
}
{
return RTErrConvertFromOS2(rc);
}
int USBProxyServiceOs2::interruptWait (void)
{
: RTErrConvertFromOS2 (rc);
}
#include <stdio.h>
{
/*
* Count the devices.
*/
int rc = mpfnUsbQueryNumberDevices ((PULONG)&cDevices); /* Thanks to com/xpcom, PULONG and ULONG * aren't the same. */
if (rc)
return NULL;
/*
* Retrieve information about each device.
*/
{
/*
* Query the device and config descriptors.
*/
if (rc)
continue;
continue;
/*
* Skip it if it's some kind of hub.
*/
continue;
/*
* Allocate a new device node and initialize it with the basic stuff.
*/
pCur->u64SerialHash = 0;
//pCur->bNumConfigurations = pDevDesc->bNumConfigurations;
pCur->bNumConfigurations = 0;
pCur->bDevNumParent = 0;
pCur->bNumDevices = 0;
pCur->bMaxChildren = 0;
/* link it */
}
return pFirst;
}