USBProxyService.h revision dc0a54940789f994c84390cb4a9f03da0b492285
70N/A * available from http://www.virtualbox.org. This file is free software;
70N/A#ifndef ____H_USBPROXYSERVICE
70N/A#define ____H_USBPROXYSERVICE
70N/A#include "VirtualBoxBase.h"
70N/A#include "VirtualBoxImpl.h"
70N/A#include "HostUSBDeviceImpl.h"
70N/A return LOCKCLASS_HOSTOBJECT;
70N/A int getLastError(void);
int start(void);
int stop(void);
virtual void deviceAdded(ComObjPtr<HostUSBDevice> &aDevice, SessionMachinesList &llOpenedMachines, PUSBDEVICE aUSBDevice);
virtual void deviceChanged(ComObjPtr<HostUSBDevice> &aDevice, SessionMachinesList *pllOpenedMachines, SessionMachine *aIgnoreMachine);
bool updateDeviceStateFake(HostUSBDevice *aDevice, PUSBDEVICE aUSBDevice, bool *aRunFilters, SessionMachine **aIgnoreMachine);
virtual bool updateDeviceState(HostUSBDevice *aDevice, PUSBDEVICE aUSBDevice, bool *aRunFilters, SessionMachine **aIgnoreMachine);
void processChanges(void);
bool volatile mTerminate;
int mLastError;
# ifdef RT_OS_DARWIN
virtual bool updateDeviceState (HostUSBDevice *aDevice, PUSBDEVICE aUSBDevice, bool *aRunFilters, SessionMachine **aIgnoreMachine);
void *mNotifyOpaque;
bool mWaitABitNextTime;
#ifndef VBOX_WITH_NEW_USB_CODE_ON_DARWIN
bool volatile mFakeAsync;
/** Whether we've successfully initialized the USBLib and should call USBLibTerm in the destructor. */
bool mUSBLibInitialized;
# ifdef RT_OS_LINUX
# include <stdio.h>
# ifdef VBOX_USB_WITH_SYSFS
# include <HostHardwareLinux.h>
# ifdef UNIT_TEST
int rcMethodInitResult)
int initUsbfs(void);
int initSysfs(void);
void doUsbfsCleanupAsNeeded(void);
virtual void deviceAdded(ComObjPtr<HostUSBDevice> &aDevice, SessionMachinesList &llOpenedMachines, PUSBDEVICE aUSBDevice);
virtual bool updateDeviceState(HostUSBDevice *aDevice, PUSBDEVICE aUSBDevice, bool *aRunFilters, SessionMachine **aIgnoreMachine);
bool mUsingUsbfsDevices;
unsigned mUdevPolls;
# ifdef VBOX_USB_WITH_SYSFS
# ifdef UNIT_TEST
const char *mpcszTestUsbfsRoot;
bool mfTestUsbfsAccessible;
const char *mpcszTestDevicesRoot;
bool mfTestDevicesAccessible;
/** The result of the usbfs/inotify-specific init */
const char *mpcszTestEnvUsb;
const char *mpcszTestEnvUsbRoot;
# ifdef RT_OS_OS2
# include <usbcalls.h>
virtual bool updateDeviceState(HostUSBDevice *aDevice, PUSBDEVICE aUSBDevice, bool *aRunFilters, SessionMachine **aIgnoreMachine);
# ifdef RT_OS_SOLARIS
# include <libdevinfo.h>
virtual bool updateDeviceState(HostUSBDevice *aDevice, PUSBDEVICE aUSBDevice, bool *aRunFilters, SessionMachine **aIgnoreMachine);
/** Whether we've successfully initialized the USBLib and should call USBLibTerm in the destructor. */
bool mUSBLibInitialized;
# ifdef RT_OS_WINDOWS
virtual bool updateDeviceState(HostUSBDevice *aDevice, PUSBDEVICE aUSBDevice, bool *aRunFilters, SessionMachine **aIgnoreMachine);
# ifdef RT_OS_FREEBSD
int initUsbfs(void);
int initSysfs(void);
virtual void deviceAdded(ComObjPtr<HostUSBDevice> &aDevice, SessionMachinesList &llOpenedMachines, PUSBDEVICE aUSBDevice);
virtual bool updateDeviceState(HostUSBDevice *aDevice, PUSBDEVICE aUSBDevice, bool *aRunFilters, SessionMachine **aIgnoreMachine);