ConsoleImpl.h revision c654f1ecae5fd97ff32f08e5e0d7a7e64af9e514
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync/* $Id$ */
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync/** @file
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync * VBox Console COM Class definition
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync */
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync
c58f1213e628a545081c70e26c6b67a841cff880vboxsync/*
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync * Copyright (C) 2005-2014 Oracle Corporation
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync *
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync * available from http://www.virtualbox.org. This file is free software;
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync * you can redistribute it and/or modify it under the terms of the GNU
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync * General Public License (GPL) as published by the Free Software
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync */
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync#ifndef ____H_CONSOLEIMPL
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync#define ____H_CONSOLEIMPL
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync#include "VirtualBoxBase.h"
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync#include "VBox/com/array.h"
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync#include "EventImpl.h"
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsyncclass Guest;
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsyncclass Keyboard;
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsyncclass Mouse;
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsyncclass Display;
2f0d866e126dd288169fed591c259c1c6b4016e5vboxsyncclass MachineDebugger;
141a285580775ead77d73bb52a63701a5591dc6dvboxsyncclass TeleporterStateSrc;
141a285580775ead77d73bb52a63701a5591dc6dvboxsyncclass OUSBDevice;
141a285580775ead77d73bb52a63701a5591dc6dvboxsyncclass RemoteUSBDevice;
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsyncclass SharedFolder;
2f0d866e126dd288169fed591c259c1c6b4016e5vboxsyncclass VRDEServerInfo;
2f0d866e126dd288169fed591c259c1c6b4016e5vboxsyncclass EmulatedUSB;
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync#ifdef VBOX_WITH_PDM_AUDIO_DRIVER
2f0d866e126dd288169fed591c259c1c6b4016e5vboxsyncclass AudioVRDE;
2f0d866e126dd288169fed591c259c1c6b4016e5vboxsync#else
2f0d866e126dd288169fed591c259c1c6b4016e5vboxsyncclass AudioSniffer;
2f0d866e126dd288169fed591c259c1c6b4016e5vboxsync#endif
2f0d866e126dd288169fed591c259c1c6b4016e5vboxsyncclass Nvram;
2f0d866e126dd288169fed591c259c1c6b4016e5vboxsync#ifdef VBOX_WITH_USB_CARDREADER
2f0d866e126dd288169fed591c259c1c6b4016e5vboxsyncclass UsbCardReader;
2f0d866e126dd288169fed591c259c1c6b4016e5vboxsync#endif
2f0d866e126dd288169fed591c259c1c6b4016e5vboxsyncclass ConsoleVRDPServer;
2f0d866e126dd288169fed591c259c1c6b4016e5vboxsyncclass VMMDev;
2f0d866e126dd288169fed591c259c1c6b4016e5vboxsyncclass Progress;
2f0d866e126dd288169fed591c259c1c6b4016e5vboxsyncclass BusAssignmentManager;
2f0d866e126dd288169fed591c259c1c6b4016e5vboxsyncCOM_STRUCT_OR_CLASS(IEventListener);
2f0d866e126dd288169fed591c259c1c6b4016e5vboxsync#ifdef VBOX_WITH_EXTPACK
2f0d866e126dd288169fed591c259c1c6b4016e5vboxsyncclass ExtPackManager;
2f0d866e126dd288169fed591c259c1c6b4016e5vboxsync#endif
2f0d866e126dd288169fed591c259c1c6b4016e5vboxsyncclass VMMDevMouseInterface;
2f0d866e126dd288169fed591c259c1c6b4016e5vboxsyncclass DisplayMouseInterface;
2f0d866e126dd288169fed591c259c1c6b4016e5vboxsync
2f0d866e126dd288169fed591c259c1c6b4016e5vboxsync#include <iprt/uuid.h>
2f0d866e126dd288169fed591c259c1c6b4016e5vboxsync#include <VBox/RemoteDesktop/VRDE.h>
2f0d866e126dd288169fed591c259c1c6b4016e5vboxsync#include <VBox/vmm/pdmdrv.h>
2f0d866e126dd288169fed591c259c1c6b4016e5vboxsync#ifdef VBOX_WITH_GUEST_PROPS
2f0d866e126dd288169fed591c259c1c6b4016e5vboxsync# include <VBox/HostServices/GuestPropertySvc.h> /* For the property notification callback */
2f0d866e126dd288169fed591c259c1c6b4016e5vboxsync#endif
2f0d866e126dd288169fed591c259c1c6b4016e5vboxsync
2f0d866e126dd288169fed591c259c1c6b4016e5vboxsync#ifdef RT_OS_WINDOWS
2f0d866e126dd288169fed591c259c1c6b4016e5vboxsync# include "../src-server/win/VBoxComEvents.h"
2f0d866e126dd288169fed591c259c1c6b4016e5vboxsync#endif
2f0d866e126dd288169fed591c259c1c6b4016e5vboxsync
2f0d866e126dd288169fed591c259c1c6b4016e5vboxsyncstruct VUSBIRHCONFIG;
2f0d866e126dd288169fed591c259c1c6b4016e5vboxsynctypedef struct VUSBIRHCONFIG *PVUSBIRHCONFIG;
2f0d866e126dd288169fed591c259c1c6b4016e5vboxsync
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync#include <list>
9ad3427071ba81a2bbf60f5d9a04eb69c147ea6evboxsync#include <vector>
9ad3427071ba81a2bbf60f5d9a04eb69c147ea6evboxsync
9ad3427071ba81a2bbf60f5d9a04eb69c147ea6evboxsync// defines
9ad3427071ba81a2bbf60f5d9a04eb69c147ea6evboxsync///////////////////////////////////////////////////////////////////////////////
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync/**
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync * Checks the availability of the underlying VM device driver corresponding
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync * to the COM interface (IKeyboard, IMouse, IDisplay, etc.). When the driver is
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync * not available (NULL), sets error info and returns returns E_ACCESSDENIED.
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync * The translatable error message is defined in null context.
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync *
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync * Intended to used only within Console children (i.e. Keyboard, Mouse,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync * Display, etc.).
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync *
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync * @param drv driver pointer to check (compare it with NULL)
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync */
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync#define CHECK_CONSOLE_DRV(drv) \
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync do { \
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync if (!(drv)) \
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync return setError(E_ACCESSDENIED, tr("The console is not powered up")); \
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync } while (0)
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync// Console
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync///////////////////////////////////////////////////////////////////////////////
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsyncclass ConsoleMouseInterface
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync{
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsyncpublic:
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync virtual VMMDevMouseInterface *getVMMDevMouseInterface() = 0;
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync virtual DisplayMouseInterface *getDisplayMouseInterface() = 0;
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync virtual void onMouseCapabilityChange(BOOL supportsAbsolute,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync BOOL supportsRelative,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync BOOL supportsMT,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync BOOL needsHostCursor) = 0;
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync};
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync/** IConsole implementation class */
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsyncclass ATL_NO_VTABLE Console :
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync public VirtualBoxBase,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync VBOX_SCRIPTABLE_IMPL(IConsole), public ConsoleMouseInterface
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync{
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync Q_OBJECT
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsyncpublic:
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT(Console, IConsole)
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync DECLARE_NOT_AGGREGATABLE(Console)
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync DECLARE_PROTECT_FINAL_CONSTRUCT()
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync BEGIN_COM_MAP(Console)
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync VBOX_DEFAULT_INTERFACE_ENTRIES(IConsole)
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync END_COM_MAP()
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync Console();
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync ~Console();
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync HRESULT FinalConstruct();
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync void FinalRelease();
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync // public initializers/uninitializers for internal purposes only
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync HRESULT init(IMachine *aMachine, IInternalMachineControl *aControl, LockType_T aLockType);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync void uninit();
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync // IConsole properties
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync STDMETHOD(COMGETTER(Machine))(IMachine **aMachine);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync STDMETHOD(COMGETTER(State))(MachineState_T *aMachineState);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync STDMETHOD(COMGETTER(Guest))(IGuest **aGuest);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync STDMETHOD(COMGETTER(Keyboard))(IKeyboard **aKeyboard);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync STDMETHOD(COMGETTER(Mouse))(IMouse **aMouse);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync STDMETHOD(COMGETTER(Display))(IDisplay **aDisplay);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync STDMETHOD(COMGETTER(Debugger))(IMachineDebugger **aDebugger);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync STDMETHOD(COMGETTER(USBDevices))(ComSafeArrayOut(IUSBDevice *, aUSBDevices));
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync STDMETHOD(COMGETTER(RemoteUSBDevices))(ComSafeArrayOut(IHostUSBDevice *, aRemoteUSBDevices));
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync STDMETHOD(COMGETTER(VRDEServerInfo))(IVRDEServerInfo **aVRDEServerInfo);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync STDMETHOD(COMGETTER(SharedFolders))(ComSafeArrayOut(ISharedFolder *, aSharedFolders));
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync STDMETHOD(COMGETTER(EventSource)) (IEventSource ** aEventSource);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync STDMETHOD(COMGETTER(AttachedPCIDevices))(ComSafeArrayOut(IPCIDeviceAttachment *, aAttachments));
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync STDMETHOD(COMGETTER(UseHostClipboard))(BOOL *aUseHostClipboard);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync STDMETHOD(COMSETTER(UseHostClipboard))(BOOL aUseHostClipboard);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync STDMETHOD(COMGETTER(EmulatedUSB))(IEmulatedUSB **aEmulatedUSB);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync // IConsole methods
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync STDMETHOD(PowerUp)(IProgress **aProgress);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync STDMETHOD(PowerUpPaused)(IProgress **aProgress);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync STDMETHOD(PowerDown)(IProgress **aProgress);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync STDMETHOD(Reset)();
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync STDMETHOD(Pause)();
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync STDMETHOD(Resume)();
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync STDMETHOD(PowerButton)();
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync STDMETHOD(SleepButton)();
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync STDMETHOD(GetPowerButtonHandled)(BOOL *aHandled);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync STDMETHOD(GetGuestEnteredACPIMode)(BOOL *aEntered);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync STDMETHOD(SaveState)(IProgress **aProgress);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync STDMETHOD(AdoptSavedState)(IN_BSTR aSavedStateFile);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync STDMETHOD(DiscardSavedState)(BOOL aRemoveFile);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync STDMETHOD(GetDeviceActivity)(DeviceType_T aDeviceType,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync DeviceActivity_T *aDeviceActivity);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync STDMETHOD(AttachUSBDevice)(IN_BSTR aId);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync STDMETHOD(DetachUSBDevice)(IN_BSTR aId, IUSBDevice **aDevice);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync STDMETHOD(FindUSBDeviceByAddress)(IN_BSTR aAddress, IUSBDevice **aDevice);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync STDMETHOD(FindUSBDeviceById)(IN_BSTR aId, IUSBDevice **aDevice);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync STDMETHOD(CreateSharedFolder)(IN_BSTR aName, IN_BSTR aHostPath, BOOL aWritable, BOOL aAutoMount);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync STDMETHOD(RemoveSharedFolder)(IN_BSTR aName);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync STDMETHOD(TakeSnapshot)(IN_BSTR aName, IN_BSTR aDescription,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync IProgress **aProgress);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync STDMETHOD(DeleteSnapshot)(IN_BSTR aId, IProgress **aProgress);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync STDMETHOD(DeleteSnapshotAndAllChildren)(IN_BSTR aId, IProgress **aProgress);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync STDMETHOD(DeleteSnapshotRange)(IN_BSTR aStartId, IN_BSTR aEndId, IProgress **aProgress);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync STDMETHOD(RestoreSnapshot)(ISnapshot *aSnapshot, IProgress **aProgress);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync STDMETHOD(Teleport)(IN_BSTR aHostname, ULONG aPort, IN_BSTR aPassword, ULONG aMaxDowntime, IProgress **aProgress);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync // public methods for internal purposes only
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync /*
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync * Note: the following methods do not increase refcount. intended to be
615c2f5544718590f05af51eff75bd1bbac4be54vboxsync * called only by the VM execution thread.
615c2f5544718590f05af51eff75bd1bbac4be54vboxsync */
615c2f5544718590f05af51eff75bd1bbac4be54vboxsync
615c2f5544718590f05af51eff75bd1bbac4be54vboxsync Guest *getGuest() const { return mGuest; }
615c2f5544718590f05af51eff75bd1bbac4be54vboxsync Keyboard *getKeyboard() const { return mKeyboard; }
615c2f5544718590f05af51eff75bd1bbac4be54vboxsync Mouse *getMouse() const { return mMouse; }
615c2f5544718590f05af51eff75bd1bbac4be54vboxsync Display *getDisplay() const { return mDisplay; }
615c2f5544718590f05af51eff75bd1bbac4be54vboxsync MachineDebugger *getMachineDebugger() const { return mDebugger; }
615c2f5544718590f05af51eff75bd1bbac4be54vboxsync#ifdef VBOX_WITH_PDM_AUDIO_DRIVER
615c2f5544718590f05af51eff75bd1bbac4be54vboxsync AudioVRDE *getAudioVRDE() const { return mAudioVRDE; }
615c2f5544718590f05af51eff75bd1bbac4be54vboxsync#else
615c2f5544718590f05af51eff75bd1bbac4be54vboxsync AudioSniffer *getAudioSniffer() const { return mAudioSniffer; }
615c2f5544718590f05af51eff75bd1bbac4be54vboxsync#endif
615c2f5544718590f05af51eff75bd1bbac4be54vboxsync
615c2f5544718590f05af51eff75bd1bbac4be54vboxsync const ComPtr<IMachine> &machine() const { return mMachine; }
615c2f5544718590f05af51eff75bd1bbac4be54vboxsync
615c2f5544718590f05af51eff75bd1bbac4be54vboxsync bool useHostClipboard() { return mfUseHostClipboard; }
615c2f5544718590f05af51eff75bd1bbac4be54vboxsync
615c2f5544718590f05af51eff75bd1bbac4be54vboxsync /** Method is called only from ConsoleVRDPServer */
615c2f5544718590f05af51eff75bd1bbac4be54vboxsync IVRDEServer *getVRDEServer() const { return mVRDEServer; }
615c2f5544718590f05af51eff75bd1bbac4be54vboxsync
615c2f5544718590f05af51eff75bd1bbac4be54vboxsync ConsoleVRDPServer *consoleVRDPServer() const { return mConsoleVRDPServer; }
615c2f5544718590f05af51eff75bd1bbac4be54vboxsync
615c2f5544718590f05af51eff75bd1bbac4be54vboxsync HRESULT updateMachineState(MachineState_T aMachineState);
615c2f5544718590f05af51eff75bd1bbac4be54vboxsync
615c2f5544718590f05af51eff75bd1bbac4be54vboxsync // events from IInternalSessionControl
615c2f5544718590f05af51eff75bd1bbac4be54vboxsync HRESULT onNetworkAdapterChange(INetworkAdapter *aNetworkAdapter, BOOL changeAdapter);
615c2f5544718590f05af51eff75bd1bbac4be54vboxsync HRESULT onSerialPortChange(ISerialPort *aSerialPort);
615c2f5544718590f05af51eff75bd1bbac4be54vboxsync HRESULT onParallelPortChange(IParallelPort *aParallelPort);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync HRESULT onStorageControllerChange();
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync HRESULT onMediumChange(IMediumAttachment *aMediumAttachment, BOOL aForce);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync HRESULT onCPUChange(ULONG aCPU, BOOL aRemove);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync HRESULT onCPUExecutionCapChange(ULONG aExecutionCap);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync HRESULT onClipboardModeChange(ClipboardMode_T aClipboardMode);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync HRESULT onDragAndDropModeChange(DragAndDropMode_T aDragAndDropMode);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync HRESULT onVRDEServerChange(BOOL aRestart);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync HRESULT onVideoCaptureChange();
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync HRESULT onUSBControllerChange();
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync HRESULT onSharedFolderChange(BOOL aGlobal);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync HRESULT onUSBDeviceAttach(IUSBDevice *aDevice, IVirtualBoxErrorInfo *aError, ULONG aMaskedIfs);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync HRESULT onUSBDeviceDetach(IN_BSTR aId, IVirtualBoxErrorInfo *aError);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync HRESULT onBandwidthGroupChange(IBandwidthGroup *aBandwidthGroup);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync HRESULT onStorageDeviceChange(IMediumAttachment *aMediumAttachment, BOOL aRemove, BOOL aSilent);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync HRESULT onExtraDataChange(IN_BSTR aMachineId, IN_BSTR aKey, IN_BSTR aVal);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync HRESULT getGuestProperty(IN_BSTR aKey, BSTR *aValue, LONG64 *aTimestamp, BSTR *aFlags);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync HRESULT setGuestProperty(IN_BSTR aKey, IN_BSTR aValue, IN_BSTR aFlags);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync HRESULT enumerateGuestProperties(IN_BSTR aPatterns,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync ComSafeArrayOut(BSTR, aNames),
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync ComSafeArrayOut(BSTR, aValues),
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync ComSafeArrayOut(LONG64, aTimestamps),
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync ComSafeArrayOut(BSTR, aFlags));
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync HRESULT onlineMergeMedium(IMediumAttachment *aMediumAttachment,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync ULONG aSourceIdx, ULONG aTargetIdx,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync IProgress *aProgress);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync int hgcmLoadService(const char *pszServiceLibrary, const char *pszServiceName);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync VMMDev *getVMMDev() { return m_pVMMDev; }
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync#ifdef VBOX_WITH_PDM_AUDIO_DRIVER
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync AudioVRDE *getAudioVRDE() { return mAudioVRDE; }
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync#else
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync AudioSniffer *getAudioSniffer() { return mAudioSniffer; }
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync#endif
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync#ifdef VBOX_WITH_EXTPACK
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync ExtPackManager *getExtPackManager();
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync#endif
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync EventSource *getEventSource() { return mEventSource; }
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync#ifdef VBOX_WITH_USB_CARDREADER
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync UsbCardReader *getUsbCardReader() { return mUsbCardReader; }
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync#endif
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync int VRDPClientLogon(uint32_t u32ClientId, const char *pszUser, const char *pszPassword, const char *pszDomain);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync void VRDPClientStatusChange(uint32_t u32ClientId, const char *pszStatus);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync void VRDPClientConnect(uint32_t u32ClientId);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync void VRDPClientDisconnect(uint32_t u32ClientId, uint32_t fu32Intercepted);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync void VRDPInterceptAudio(uint32_t u32ClientId);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync void VRDPInterceptUSB(uint32_t u32ClientId, void **ppvIntercept);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync void VRDPInterceptClipboard(uint32_t u32ClientId);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync void processRemoteUSBDevices(uint32_t u32ClientId, VRDEUSBDEVICEDESC *pDevList, uint32_t cbDevList, bool fDescExt);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync void reportVmStatistics(ULONG aValidStats, ULONG aCpuUser,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync ULONG aCpuKernel, ULONG aCpuIdle,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync ULONG aMemTotal, ULONG aMemFree,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync ULONG aMemBalloon, ULONG aMemShared,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync ULONG aMemCache, ULONG aPageTotal,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync ULONG aAllocVMM, ULONG aFreeVMM,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync ULONG aBalloonedVMM, ULONG aSharedVMM,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync ULONG aVmNetRx, ULONG aVmNetTx)
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync {
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync mControl->ReportVmStatistics(aValidStats, aCpuUser, aCpuKernel, aCpuIdle,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync aMemTotal, aMemFree, aMemBalloon, aMemShared,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync aMemCache, aPageTotal, aAllocVMM, aFreeVMM,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync aBalloonedVMM, aSharedVMM, aVmNetRx, aVmNetTx);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync }
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync void enableVMMStatistics(BOOL aEnable);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync HRESULT pause(Reason_T aReason);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync HRESULT resume(Reason_T aReason);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync HRESULT saveState(Reason_T aReason, IProgress **aProgress);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync // callback callers (partly; for some events console callbacks are notified
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync // directly from IInternalSessionControl event handlers declared above)
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync void onMousePointerShapeChange(bool fVisible, bool fAlpha,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync uint32_t xHot, uint32_t yHot,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync uint32_t width, uint32_t height,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync ComSafeArrayIn(uint8_t, aShape));
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync void onMouseCapabilityChange(BOOL supportsAbsolute, BOOL supportsRelative,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync BOOL supportsMT, BOOL needsHostCursor);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync void onStateChange(MachineState_T aMachineState);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync void onAdditionsStateChange();
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync void onAdditionsOutdated();
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync void onKeyboardLedsChange(bool fNumLock, bool fCapsLock, bool fScrollLock);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync void onUSBDeviceStateChange(IUSBDevice *aDevice, bool aAttached,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync IVirtualBoxErrorInfo *aError);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync void onRuntimeError(BOOL aFatal, IN_BSTR aErrorID, IN_BSTR aMessage);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync HRESULT onShowWindow(BOOL aCheck, BOOL *aCanShow, LONG64 *aWinId);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync void onVRDEServerInfoChange();
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync static const PDMDRVREG DrvStatusReg;
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync static HRESULT setErrorStatic(HRESULT aResultCode, const char *pcsz, ...);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync HRESULT setInvalidMachineStateError();
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync static const char *convertControllerTypeToDev(StorageControllerType_T enmCtrlType);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync static HRESULT convertBusPortDeviceToLun(StorageBus_T enmBus, LONG port, LONG device, unsigned &uLun);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync // Called from event listener
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync HRESULT onNATRedirectRuleChange(ULONG ulInstance, BOOL aNatRuleRemove,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync NATProtocol_T aProto, IN_BSTR aHostIp, LONG aHostPort, IN_BSTR aGuestIp, LONG aGuestPort);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync // Mouse interface
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync VMMDevMouseInterface *getVMMDevMouseInterface();
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync DisplayMouseInterface *getDisplayMouseInterface();
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync EmulatedUSB *getEmulatedUSB(void) { return mEmulatedUSB; }
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsyncprivate:
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync /**
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync * Base template for AutoVMCaller and SafeVMPtr. Template arguments
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync * have the same meaning as arguments of Console::addVMCaller().
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync */
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync template <bool taQuiet = false, bool taAllowNullVM = false>
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync class AutoVMCallerBase
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync {
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync public:
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync AutoVMCallerBase(Console *aThat) : mThat(aThat), mRC(S_OK)
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync {
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync Assert(aThat);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync mRC = aThat->addVMCaller(taQuiet, taAllowNullVM);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync }
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync ~AutoVMCallerBase()
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync {
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync if (SUCCEEDED(mRC))
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync mThat->releaseVMCaller();
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync }
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync /** Decreases the number of callers before the instance is destroyed. */
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync void releaseCaller()
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync {
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync AssertReturnVoid(SUCCEEDED(mRC));
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync mThat->releaseVMCaller();
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync mRC = E_FAIL;
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync }
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync /** Restores the number of callers after by #release(). #rc() must be
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync * rechecked to ensure the operation succeeded. */
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync void addYY()
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync {
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync AssertReturnVoid(!SUCCEEDED(mRC));
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync mRC = mThat->addVMCaller(taQuiet, taAllowNullVM);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync }
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync /** Returns the result of Console::addVMCaller() */
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync HRESULT rc() const { return mRC; }
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync /** Shortcut to SUCCEEDED(rc()) */
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync bool isOk() const { return SUCCEEDED(mRC); }
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync protected:
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync Console *mThat;
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync HRESULT mRC;
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync private:
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync DECLARE_CLS_COPY_CTOR_ASSIGN_NOOP(AutoVMCallerBase)
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync };
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync#if 0
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync /**
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync * Helper class that protects sections of code using the mpUVM pointer by
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync * automatically calling addVMCaller() on construction and
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync * releaseVMCaller() on destruction. Intended for Console methods dealing
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync * with mpUVM. The usage pattern is:
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync * <code>
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync * AutoVMCaller autoVMCaller(this);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync * if (FAILED(autoVMCaller.rc())) return autoVMCaller.rc();
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync * ...
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync * VMR3ReqCall (mpUVM, ...
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync * </code>
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync *
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync * @note Temporarily locks the argument for writing.
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync *
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync * @sa SafeVMPtr, SafeVMPtrQuiet
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync * @obsolete Use SafeVMPtr
76d3e53889c5a02a3881bd3cfa31509d61cea9d0vboxsync */
76d3e53889c5a02a3881bd3cfa31509d61cea9d0vboxsync typedef AutoVMCallerBase<false, false> AutoVMCaller;
76d3e53889c5a02a3881bd3cfa31509d61cea9d0vboxsync#endif
76d3e53889c5a02a3881bd3cfa31509d61cea9d0vboxsync
76d3e53889c5a02a3881bd3cfa31509d61cea9d0vboxsync /**
76d3e53889c5a02a3881bd3cfa31509d61cea9d0vboxsync * Same as AutoVMCaller but doesn't set extended error info on failure.
76d3e53889c5a02a3881bd3cfa31509d61cea9d0vboxsync *
76d3e53889c5a02a3881bd3cfa31509d61cea9d0vboxsync * @note Temporarily locks the argument for writing.
76d3e53889c5a02a3881bd3cfa31509d61cea9d0vboxsync * @obsolete Use SafeVMPtrQuiet
76d3e53889c5a02a3881bd3cfa31509d61cea9d0vboxsync */
76d3e53889c5a02a3881bd3cfa31509d61cea9d0vboxsync typedef AutoVMCallerBase<true, false> AutoVMCallerQuiet;
76d3e53889c5a02a3881bd3cfa31509d61cea9d0vboxsync
76d3e53889c5a02a3881bd3cfa31509d61cea9d0vboxsync /**
76d3e53889c5a02a3881bd3cfa31509d61cea9d0vboxsync * Same as AutoVMCaller but allows a null VM pointer (to trigger an error
76d3e53889c5a02a3881bd3cfa31509d61cea9d0vboxsync * instead of assertion).
76d3e53889c5a02a3881bd3cfa31509d61cea9d0vboxsync *
76d3e53889c5a02a3881bd3cfa31509d61cea9d0vboxsync * @note Temporarily locks the argument for writing.
76d3e53889c5a02a3881bd3cfa31509d61cea9d0vboxsync * @obsolete Use SafeVMPtr
76d3e53889c5a02a3881bd3cfa31509d61cea9d0vboxsync */
76d3e53889c5a02a3881bd3cfa31509d61cea9d0vboxsync typedef AutoVMCallerBase<false, true> AutoVMCallerWeak;
76d3e53889c5a02a3881bd3cfa31509d61cea9d0vboxsync
76d3e53889c5a02a3881bd3cfa31509d61cea9d0vboxsync /**
76d3e53889c5a02a3881bd3cfa31509d61cea9d0vboxsync * Same as AutoVMCaller but doesn't set extended error info on failure
76d3e53889c5a02a3881bd3cfa31509d61cea9d0vboxsync * and allows a null VM pointer (to trigger an error instead of
109c0d54dc2438e7887f198daefb7e164c8a9dffvboxsync * assertion).
109c0d54dc2438e7887f198daefb7e164c8a9dffvboxsync *
109c0d54dc2438e7887f198daefb7e164c8a9dffvboxsync * @note Temporarily locks the argument for writing.
91b5f2a7d9797385e53af76c22883fa15fd25adfvboxsync * @obsolete Use SafeVMPtrQuiet
109c0d54dc2438e7887f198daefb7e164c8a9dffvboxsync */
109c0d54dc2438e7887f198daefb7e164c8a9dffvboxsync typedef AutoVMCallerBase<true, true> AutoVMCallerQuietWeak;
91b5f2a7d9797385e53af76c22883fa15fd25adfvboxsync
91b5f2a7d9797385e53af76c22883fa15fd25adfvboxsync /**
109c0d54dc2438e7887f198daefb7e164c8a9dffvboxsync * Base template for SafeVMPtr and SafeVMPtrQuiet.
109c0d54dc2438e7887f198daefb7e164c8a9dffvboxsync */
62affeb44694facf8de89ef52bb676150f979887vboxsync template<bool taQuiet = false>
109c0d54dc2438e7887f198daefb7e164c8a9dffvboxsync class SafeVMPtrBase : public AutoVMCallerBase<taQuiet, true>
62affeb44694facf8de89ef52bb676150f979887vboxsync {
109c0d54dc2438e7887f198daefb7e164c8a9dffvboxsync typedef AutoVMCallerBase<taQuiet, true> Base;
109c0d54dc2438e7887f198daefb7e164c8a9dffvboxsync public:
109c0d54dc2438e7887f198daefb7e164c8a9dffvboxsync SafeVMPtrBase(Console *aThat) : Base(aThat), mpUVM(NULL)
109c0d54dc2438e7887f198daefb7e164c8a9dffvboxsync {
109c0d54dc2438e7887f198daefb7e164c8a9dffvboxsync if (SUCCEEDED(Base::mRC))
d8818699735c83c36fc9555f85e6d86b610cdc67vboxsync Base::mRC = aThat->safeVMPtrRetainer(&mpUVM, taQuiet);
109c0d54dc2438e7887f198daefb7e164c8a9dffvboxsync }
d8818699735c83c36fc9555f85e6d86b610cdc67vboxsync ~SafeVMPtrBase()
109c0d54dc2438e7887f198daefb7e164c8a9dffvboxsync {
d8818699735c83c36fc9555f85e6d86b610cdc67vboxsync if (SUCCEEDED(Base::mRC))
109c0d54dc2438e7887f198daefb7e164c8a9dffvboxsync release();
109c0d54dc2438e7887f198daefb7e164c8a9dffvboxsync }
109c0d54dc2438e7887f198daefb7e164c8a9dffvboxsync /** Direct PUVM access. */
109c0d54dc2438e7887f198daefb7e164c8a9dffvboxsync PUVM rawUVM() const { return mpUVM; }
109c0d54dc2438e7887f198daefb7e164c8a9dffvboxsync /** Release the handles. */
109c0d54dc2438e7887f198daefb7e164c8a9dffvboxsync void release()
d8818699735c83c36fc9555f85e6d86b610cdc67vboxsync {
109c0d54dc2438e7887f198daefb7e164c8a9dffvboxsync AssertReturnVoid(SUCCEEDED(Base::mRC));
d8818699735c83c36fc9555f85e6d86b610cdc67vboxsync Base::mThat->safeVMPtrReleaser(&mpUVM);
109c0d54dc2438e7887f198daefb7e164c8a9dffvboxsync Base::releaseCaller();
d8818699735c83c36fc9555f85e6d86b610cdc67vboxsync }
109c0d54dc2438e7887f198daefb7e164c8a9dffvboxsync
109c0d54dc2438e7887f198daefb7e164c8a9dffvboxsync private:
109c0d54dc2438e7887f198daefb7e164c8a9dffvboxsync PUVM mpUVM;
109c0d54dc2438e7887f198daefb7e164c8a9dffvboxsync DECLARE_CLS_COPY_CTOR_ASSIGN_NOOP(SafeVMPtrBase)
109c0d54dc2438e7887f198daefb7e164c8a9dffvboxsync };
109c0d54dc2438e7887f198daefb7e164c8a9dffvboxsync
109c0d54dc2438e7887f198daefb7e164c8a9dffvboxsyncpublic:
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync /*
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync * Helper class that safely manages the Console::mpUVM pointer
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync * by calling addVMCaller() on construction and releaseVMCaller() on
9ad3427071ba81a2bbf60f5d9a04eb69c147ea6evboxsync * destruction. Intended for Console children. The usage pattern is:
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync * <code>
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync * Console::SafeVMPtr ptrVM(mParent);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync * if (!ptrVM.isOk())
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync * return ptrVM.rc();
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync * ...
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync * VMR3ReqCall(ptrVM.rawUVM(), ...
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync * ...
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync * printf("%p\n", ptrVM.rawUVM());
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync * </code>
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync *
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync * @note Temporarily locks the argument for writing.
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync *
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync * @sa SafeVMPtrQuiet, AutoVMCaller
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync */
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync typedef SafeVMPtrBase<false> SafeVMPtr;
9ad3427071ba81a2bbf60f5d9a04eb69c147ea6evboxsync
9ad3427071ba81a2bbf60f5d9a04eb69c147ea6evboxsync /**
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync * A deviation of SafeVMPtr that doesn't set the error info on failure.
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync * Intended for pieces of code that don't need to return the VM access
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync * failure to the caller. The usage pattern is:
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync * <code>
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync * Console::SafeVMPtrQuiet pVM(mParent);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync * if (pVM.rc())
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync * VMR3ReqCall(pVM, ...
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync * return S_OK;
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync * </code>
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync *
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync * @note Temporarily locks the argument for writing.
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync *
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync * @sa SafeVMPtr, AutoVMCaller
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync */
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync typedef SafeVMPtrBase<true> SafeVMPtrQuiet;
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync class SharedFolderData
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync {
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync public:
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync SharedFolderData()
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync { }
9ad3427071ba81a2bbf60f5d9a04eb69c147ea6evboxsync
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync SharedFolderData(const Utf8Str &aHostPath,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync bool aWritable,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync bool aAutoMount)
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync : m_strHostPath(aHostPath),
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync m_fWritable(aWritable),
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync m_fAutoMount(aAutoMount)
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync { }
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync // copy constructor
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync SharedFolderData(const SharedFolderData& aThat)
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync : m_strHostPath(aThat.m_strHostPath),
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync m_fWritable(aThat.m_fWritable),
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync m_fAutoMount(aThat.m_fAutoMount)
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync { }
9ad3427071ba81a2bbf60f5d9a04eb69c147ea6evboxsync
9ad3427071ba81a2bbf60f5d9a04eb69c147ea6evboxsync Utf8Str m_strHostPath;
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync bool m_fWritable;
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync bool m_fAutoMount;
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync };
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync /**
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync * Class for managing emulated USB MSDs.
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync */
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync class USBStorageDevice
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync {
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync public:
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync USBStorageDevice()
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync { }
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync /** The UUID associated with the USB device. */
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync RTUUID mUuid;
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync /** Port of the storage device. */
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync LONG iPort;
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync };
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync typedef std::map<Utf8Str, ComObjPtr<SharedFolder> > SharedFolderMap;
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync typedef std::map<Utf8Str, SharedFolderData> SharedFolderDataMap;
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync typedef std::map<Utf8Str, ComPtr<IMediumAttachment> > MediumAttachmentMap;
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync typedef std::list <USBStorageDevice> USBStorageDeviceList;
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsyncprivate:
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync typedef std::list <ComObjPtr<OUSBDevice> > USBDeviceList;
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync typedef std::list <ComObjPtr<RemoteUSBDevice> > RemoteUSBDeviceList;
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync HRESULT addVMCaller(bool aQuiet = false, bool aAllowNullVM = false);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync void releaseVMCaller();
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync HRESULT safeVMPtrRetainer(PUVM *a_ppUVM, bool aQuiet);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync void safeVMPtrReleaser(PUVM *a_ppUVM);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync HRESULT consoleInitReleaseLog(const ComPtr<IMachine> aMachine);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync HRESULT powerUp(IProgress **aProgress, bool aPaused);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync HRESULT powerDown(IProgress *aProgress = NULL);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync/* Note: FreeBSD needs this whether netflt is used or not. */
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync#if ((defined(RT_OS_LINUX) && !defined(VBOX_WITH_NETFLT)) || defined(RT_OS_FREEBSD))
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync HRESULT attachToTapInterface(INetworkAdapter *networkAdapter);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync HRESULT detachFromTapInterface(INetworkAdapter *networkAdapter);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync#endif
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync HRESULT powerDownHostInterfaces();
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync HRESULT setMachineState(MachineState_T aMachineState, bool aUpdateServer = true);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync HRESULT setMachineStateLocally(MachineState_T aMachineState)
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync {
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync return setMachineState(aMachineState, false /* aUpdateServer */);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync }
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync HRESULT findSharedFolder(const Utf8Str &strName,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync ComObjPtr<SharedFolder> &aSharedFolder,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync bool aSetError = false);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync HRESULT fetchSharedFolders(BOOL aGlobal);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync bool findOtherSharedFolder(const Utf8Str &straName,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync SharedFolderDataMap::const_iterator &aIt);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync HRESULT createSharedFolder(const Utf8Str &strName, const SharedFolderData &aData);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync HRESULT removeSharedFolder(const Utf8Str &strName);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync HRESULT suspendBeforeConfigChange(PUVM pUVM, AutoWriteLock *pAlock, bool *pfResume);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync void resumeAfterConfigChange(PUVM pUVM);
4d93fcdfb645b86163cfea77f687172295988d16vboxsync
4d93fcdfb645b86163cfea77f687172295988d16vboxsync static DECLCALLBACK(int) configConstructor(PUVM pUVM, PVM pVM, void *pvConsole);
4d93fcdfb645b86163cfea77f687172295988d16vboxsync int configConstructorInner(PUVM pUVM, PVM pVM, AutoWriteLock *pAlock);
4d93fcdfb645b86163cfea77f687172295988d16vboxsync int configCfgmOverlay(PCFGMNODE pRoot, IVirtualBox *pVirtualBox, IMachine *pMachine);
4d93fcdfb645b86163cfea77f687172295988d16vboxsync int configDumpAPISettingsTweaks(IVirtualBox *pVirtualBox, IMachine *pMachine);
b891b477f403c0a8a1eea185f9bc4ef9c99caf2dvboxsync
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync int configGraphicsController(PCFGMNODE pDevices,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync const GraphicsControllerType_T graphicsController,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync BusAssignmentManager *pBusMgr,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync const ComPtr<IMachine> &pMachine,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync const ComPtr<IBIOSSettings> &biosSettings,
4d93fcdfb645b86163cfea77f687172295988d16vboxsync bool fHMEnabled);
4d93fcdfb645b86163cfea77f687172295988d16vboxsync int configMediumAttachment(PCFGMNODE pCtlInst,
4d93fcdfb645b86163cfea77f687172295988d16vboxsync const char *pcszDevice,
4d93fcdfb645b86163cfea77f687172295988d16vboxsync unsigned uInstance,
4d93fcdfb645b86163cfea77f687172295988d16vboxsync StorageBus_T enmBus,
4d93fcdfb645b86163cfea77f687172295988d16vboxsync bool fUseHostIOCache,
4d93fcdfb645b86163cfea77f687172295988d16vboxsync bool fBuiltinIoCache,
b891b477f403c0a8a1eea185f9bc4ef9c99caf2dvboxsync bool fSetupMerge,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync unsigned uMergeSource,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync unsigned uMergeTarget,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync IMediumAttachment *pMediumAtt,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync MachineState_T aMachineState,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync HRESULT *phrc,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync bool fAttachDetach,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync bool fForceUnmount,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync bool fHotplug,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync PUVM pUVM,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync DeviceType_T *paLedDevType,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync PCFGMNODE *ppLunL0);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync int configMedium(PCFGMNODE pLunL0,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync bool fPassthrough,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync DeviceType_T enmType,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync bool fUseHostIOCache,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync bool fBuiltinIoCache,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync bool fSetupMerge,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync unsigned uMergeSource,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync unsigned uMergeTarget,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync const char *pcszBwGroup,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync bool fDiscard,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync IMedium *pMedium,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync MachineState_T aMachineState,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync HRESULT *phrc);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync static DECLCALLBACK(int) reconfigureMediumAttachment(Console *pThis,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync PUVM pUVM,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync const char *pcszDevice,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync unsigned uInstance,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync StorageBus_T enmBus,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync bool fUseHostIOCache,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync bool fBuiltinIoCache,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync bool fSetupMerge,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync unsigned uMergeSource,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync unsigned uMergeTarget,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync IMediumAttachment *aMediumAtt,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync MachineState_T aMachineState,
3e7e8dae1bd305767a63ff29f1ae8bd8dccb8000vboxsync HRESULT *phrc);
3e7e8dae1bd305767a63ff29f1ae8bd8dccb8000vboxsync static DECLCALLBACK(int) changeRemovableMedium(Console *pThis,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync PUVM pUVM,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync const char *pcszDevice,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync unsigned uInstance,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync StorageBus_T enmBus,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync bool fUseHostIOCache,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync IMediumAttachment *aMediumAtt,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync bool fForce);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync HRESULT attachRawPCIDevices(PUVM pUVM, BusAssignmentManager *BusMgr, PCFGMNODE pDevices);
3e7e8dae1bd305767a63ff29f1ae8bd8dccb8000vboxsync void attachStatusDriver(PCFGMNODE pCtlInst, PPDMLED *papLeds,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync uint64_t uFirst, uint64_t uLast,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync Console::MediumAttachmentMap *pmapMediumAttachments,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync const char *pcszDevice, unsigned uInstance);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync int configNetwork(const char *pszDevice, unsigned uInstance, unsigned uLun,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync INetworkAdapter *aNetworkAdapter, PCFGMNODE pCfg,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync PCFGMNODE pLunL0, PCFGMNODE pInst,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync bool fAttachDetach, bool fIgnoreConnectFailure);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync static DECLCALLBACK(int) configGuestProperties(void *pvConsole, PUVM pUVM);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync static DECLCALLBACK(int) configGuestControl(void *pvConsole);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync static DECLCALLBACK(void) vmstateChangeCallback(PUVM pUVM, VMSTATE enmState, VMSTATE enmOldState, void *pvUser);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync static DECLCALLBACK(int) unplugCpu(Console *pThis, PUVM pUVM, VMCPUID idCpu);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync static DECLCALLBACK(int) plugCpu(Console *pThis, PUVM pUVM, VMCPUID idCpu);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync HRESULT doMediumChange(IMediumAttachment *aMediumAttachment, bool fForce, PUVM pUVM);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync HRESULT doCPURemove(ULONG aCpu, PUVM pUVM);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync HRESULT doCPUAdd(ULONG aCpu, PUVM pUVM);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync HRESULT doNetworkAdapterChange(PUVM pUVM, const char *pszDevice, unsigned uInstance,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync unsigned uLun, INetworkAdapter *aNetworkAdapter);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync static DECLCALLBACK(int) changeNetworkAttachment(Console *pThis, PUVM pUVM, const char *pszDevice,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync unsigned uInstance, unsigned uLun,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync INetworkAdapter *aNetworkAdapter);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync void changeClipboardMode(ClipboardMode_T aClipboardMode);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync void changeDragAndDropMode(DragAndDropMode_T aDragAndDropMode);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync#ifdef VBOX_WITH_USB
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync HRESULT attachUSBDevice(IUSBDevice *aHostDevice, ULONG aMaskedIfs);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync HRESULT detachUSBDevice(const ComObjPtr<OUSBDevice> &aHostDevice);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync static DECLCALLBACK(int) usbAttachCallback(Console *that, PUVM pUVM, IUSBDevice *aHostDevice, PCRTUUID aUuid,
3e7e8dae1bd305767a63ff29f1ae8bd8dccb8000vboxsync bool aRemote, const char *aAddress, void *pvRemoteBackend, USHORT aPortVersion, ULONG aMaskedIfs);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync static DECLCALLBACK(int) usbDetachCallback(Console *that, PUVM pUVM, PCRTUUID aUuid);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync#endif
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync static DECLCALLBACK(int) attachStorageDevice(Console *pThis,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync PUVM pUVM,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync const char *pcszDevice,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync unsigned uInstance,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync StorageBus_T enmBus,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync bool fUseHostIOCache,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync IMediumAttachment *aMediumAtt,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync bool fSilent);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync static DECLCALLBACK(int) detachStorageDevice(Console *pThis,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync PUVM pUVM,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync const char *pcszDevice,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync unsigned uInstance,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync StorageBus_T enmBus,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync IMediumAttachment *aMediumAtt,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync bool fSilent);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync HRESULT doStorageDeviceAttach(IMediumAttachment *aMediumAttachment, PUVM pUVM, bool fSilent);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync HRESULT doStorageDeviceDetach(IMediumAttachment *aMediumAttachment, PUVM pUVM, bool fSilent);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync static DECLCALLBACK(int) fntTakeSnapshotWorker(RTTHREAD Thread, void *pvUser);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync static DECLCALLBACK(int) stateProgressCallback(PUVM pUVM, unsigned uPercent, void *pvUser);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync static DECLCALLBACK(void) genericVMSetErrorCallback(PUVM pUVM, void *pvUser, int rc, RT_SRC_POS_DECL,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync const char *pszErrorFmt, va_list va);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync void setVMRuntimeErrorCallbackF(uint32_t fFatal, const char *pszErrorId, const char *pszFormat, ...);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync static DECLCALLBACK(void) setVMRuntimeErrorCallback(PUVM pUVM, void *pvUser, uint32_t fFatal,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync const char *pszErrorId, const char *pszFormat, va_list va);
1d9b8ac46277d5cbab832794c5cfcce1e0521873vboxsync
1d9b8ac46277d5cbab832794c5cfcce1e0521873vboxsync HRESULT captureUSBDevices(PUVM pUVM);
1d9b8ac46277d5cbab832794c5cfcce1e0521873vboxsync void detachAllUSBDevices(bool aDone);
1d9b8ac46277d5cbab832794c5cfcce1e0521873vboxsync
1d9b8ac46277d5cbab832794c5cfcce1e0521873vboxsync static DECLCALLBACK(int) powerUpThread(RTTHREAD Thread, void *pvUser);
1d9b8ac46277d5cbab832794c5cfcce1e0521873vboxsync static DECLCALLBACK(int) saveStateThread(RTTHREAD Thread, void *pvUser);
1d9b8ac46277d5cbab832794c5cfcce1e0521873vboxsync static DECLCALLBACK(int) powerDownThread(RTTHREAD Thread, void *pvUser);
1d9b8ac46277d5cbab832794c5cfcce1e0521873vboxsync
1d9b8ac46277d5cbab832794c5cfcce1e0521873vboxsync static DECLCALLBACK(int) vmm2User_SaveState(PCVMM2USERMETHODS pThis, PUVM pUVM);
1d9b8ac46277d5cbab832794c5cfcce1e0521873vboxsync static DECLCALLBACK(void) vmm2User_NotifyEmtInit(PCVMM2USERMETHODS pThis, PUVM pUVM, PUVMCPU pUVCpu);
1d9b8ac46277d5cbab832794c5cfcce1e0521873vboxsync static DECLCALLBACK(void) vmm2User_NotifyEmtTerm(PCVMM2USERMETHODS pThis, PUVM pUVM, PUVMCPU pUVCpu);
1d9b8ac46277d5cbab832794c5cfcce1e0521873vboxsync static DECLCALLBACK(void) vmm2User_NotifyPdmtInit(PCVMM2USERMETHODS pThis, PUVM pUVM);
1d9b8ac46277d5cbab832794c5cfcce1e0521873vboxsync static DECLCALLBACK(void) vmm2User_NotifyPdmtTerm(PCVMM2USERMETHODS pThis, PUVM pUVM);
1d9b8ac46277d5cbab832794c5cfcce1e0521873vboxsync static DECLCALLBACK(void) vmm2User_NotifyResetTurnedIntoPowerOff(PCVMM2USERMETHODS pThis, PUVM pUVM);
1d9b8ac46277d5cbab832794c5cfcce1e0521873vboxsync
1d9b8ac46277d5cbab832794c5cfcce1e0521873vboxsync static DECLCALLBACK(void *) drvStatus_QueryInterface(PPDMIBASE pInterface, const char *pszIID);
1d9b8ac46277d5cbab832794c5cfcce1e0521873vboxsync static DECLCALLBACK(void) drvStatus_UnitChanged(PPDMILEDCONNECTORS pInterface, unsigned iLUN);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync static DECLCALLBACK(int) drvStatus_MediumEjected(PPDMIMEDIANOTIFY pInterface, unsigned iLUN);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync static DECLCALLBACK(void) drvStatus_Destruct(PPDMDRVINS pDrvIns);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync static DECLCALLBACK(int) drvStatus_Construct(PPDMDRVINS pDrvIns, PCFGMNODE pCfg, uint32_t fFlags);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync int mcAudioRefs;
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync volatile uint32_t mcVRDPClients;
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync uint32_t mu32SingleRDPClientId; /* The id of a connected client in the single connection mode. */
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync volatile bool mcGuestCredentialsProvided;
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync static const char *sSSMConsoleUnit;
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync static uint32_t sSSMConsoleVer;
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync HRESULT loadDataFromSavedState();
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync int loadStateFileExecInternal(PSSMHANDLE pSSM, uint32_t u32Version);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync static DECLCALLBACK(void) saveStateFileExec(PSSMHANDLE pSSM, void *pvUser);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync static DECLCALLBACK(int) loadStateFileExec(PSSMHANDLE pSSM, void *pvUser, uint32_t uVersion, uint32_t uPass);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync#ifdef VBOX_WITH_GUEST_PROPS
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync static DECLCALLBACK(int) doGuestPropNotification(void *pvExtension, uint32_t, void *pvParms, uint32_t cbParms);
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync HRESULT doEnumerateGuestProperties(CBSTR aPatterns,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync ComSafeArrayOut(BSTR, aNames),
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync ComSafeArrayOut(BSTR, aValues),
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync ComSafeArrayOut(LONG64, aTimestamps),
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync ComSafeArrayOut(BSTR, aFlags));
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync void guestPropertiesHandleVMReset(void);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync bool guestPropertiesVRDPEnabled(void);
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync void guestPropertiesVRDPUpdateLogon(uint32_t u32ClientId, const char *pszUser, const char *pszDomain);
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync void guestPropertiesVRDPUpdateActiveClient(uint32_t u32ClientId);
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync void guestPropertiesVRDPUpdateClientAttach(uint32_t u32ClientId, bool fAttached);
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync void guestPropertiesVRDPUpdateNameChange(uint32_t u32ClientId, const char *pszName);
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync void guestPropertiesVRDPUpdateIPAddrChange(uint32_t u32ClientId, const char *pszIPAddr);
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync void guestPropertiesVRDPUpdateLocationChange(uint32_t u32ClientId, const char *pszLocation);
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync void guestPropertiesVRDPUpdateOtherInfoChange(uint32_t u32ClientId, const char *pszOtherInfo);
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync void guestPropertiesVRDPUpdateDisconnect(uint32_t u32ClientId);
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync#endif
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync bool isResetTurnedIntoPowerOff(void);
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync /** @name Teleporter support
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync * @{ */
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync static DECLCALLBACK(int) teleporterSrcThreadWrapper(RTTHREAD hThread, void *pvUser);
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync HRESULT teleporterSrc(TeleporterStateSrc *pState);
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync HRESULT teleporterSrcReadACK(TeleporterStateSrc *pState, const char *pszWhich, const char *pszNAckMsg = NULL);
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync HRESULT teleporterSrcSubmitCommand(TeleporterStateSrc *pState, const char *pszCommand, bool fWaitForAck = true);
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync HRESULT teleporterTrg(PUVM pUVM, IMachine *pMachine, Utf8Str *pErrorMsg, bool fStartPaused,
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync Progress *pProgress, bool *pfPowerOffOnFailure);
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync static DECLCALLBACK(int) teleporterTrgServeConnection(RTSOCKET Sock, void *pvUser);
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync /** @} */
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync bool mSavedStateDataLoaded : 1;
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync const ComPtr<IMachine> mMachine;
0931358f459881bc01b54d3118e0fc1b9a43bdc3vboxsync const ComPtr<IInternalMachineControl> mControl;
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync const ComPtr<IVRDEServer> mVRDEServer;
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync ConsoleVRDPServer * const mConsoleVRDPServer;
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync bool mfVRDEChangeInProcess;
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync bool mfVRDEChangePending;
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync const ComObjPtr<Guest> mGuest;
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync const ComObjPtr<Keyboard> mKeyboard;
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync const ComObjPtr<Mouse> mMouse;
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync const ComObjPtr<Display> mDisplay;
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync const ComObjPtr<MachineDebugger> mDebugger;
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync const ComObjPtr<VRDEServerInfo> mVRDEServerInfo;
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync /** This can safely be used without holding any locks.
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync * An AutoCaller suffices to prevent it being destroy while in use and
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync * internally there is a lock providing the necessary serialization. */
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync const ComObjPtr<EventSource> mEventSource;
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync#ifdef VBOX_WITH_EXTPACK
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync const ComObjPtr<ExtPackManager> mptrExtPackManager;
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync#endif
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync const ComObjPtr<EmulatedUSB> mEmulatedUSB;
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync USBDeviceList mUSBDevices;
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync RemoteUSBDeviceList mRemoteUSBDevices;
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync SharedFolderDataMap m_mapGlobalSharedFolders;
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync SharedFolderDataMap m_mapMachineSharedFolders;
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync SharedFolderMap m_mapSharedFolders; // the console instances
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync /** The user mode VM handle. */
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync PUVM mpUVM;
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync /** Holds the number of "readonly" mpUVM callers (users). */
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync uint32_t mVMCallers;
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync /** Semaphore posted when the number of mpUVM callers drops to zero. */
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync RTSEMEVENT mVMZeroCallersSem;
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync /** true when Console has entered the mpUVM destruction phase. */
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync bool mVMDestroying : 1;
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync /** true when power down is initiated by vmstateChangeCallback (EMT). */
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync bool mVMPoweredOff : 1;
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync /** true when vmstateChangeCallback shouldn't initiate a power down. */
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync bool mVMIsAlreadyPoweringOff : 1;
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync /** true if we already showed the snapshot folder size warning. */
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync bool mfSnapshotFolderSizeWarningShown : 1;
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync /** true if we already showed the snapshot folder ext4/xfs bug warning. */
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync bool mfSnapshotFolderExt4WarningShown : 1;
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync /** true if we already listed the disk type of the snapshot folder. */
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync bool mfSnapshotFolderDiskTypeShown : 1;
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync /** true if a USB controller is available (i.e. USB devices can be attached). */
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync bool mfVMHasUsbController : 1;
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync /** true if the VM power off was caused by reset. */
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync bool mfPowerOffCausedByReset : 1;
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync /** Pointer to the VMM -> User (that's us) callbacks. */
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync struct MYVMM2USERMETHODS : public VMM2USERMETHODS
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync {
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync Console *pConsole;
aede31badacc724e58bbfe5b7e48d4875bd70844vboxsync } *mpVmm2UserMethods;
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync /** The current network attachment type in the VM.
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync * This doesn't have to match the network attachment type maintained in the
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync * NetworkAdapter. This is needed to change the network attachment
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync * dynamically.
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync */
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync typedef std::vector<NetworkAttachmentType_T> NetworkAttachmentTypeVector;
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync NetworkAttachmentTypeVector meAttachmentType;
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync VMMDev * m_pVMMDev;
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync#ifdef VBOX_WITH_PDM_AUDIO_DRIVER
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync AudioVRDE * const mAudioVRDE;
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync#else
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync AudioSniffer * const mAudioSniffer;
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync#endif
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync Nvram * const mNvram;
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync#ifdef VBOX_WITH_USB_CARDREADER
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync UsbCardReader * const mUsbCardReader;
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync#endif
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync BusAssignmentManager* mBusMgr;
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync enum
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync {
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync iLedFloppy = 0,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync cLedFloppy = 2,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync iLedIde = iLedFloppy + cLedFloppy,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync cLedIde = 4,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync iLedSata = iLedIde + cLedIde,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync cLedSata = 30,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync iLedScsi = iLedSata + cLedSata,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync cLedScsi = 16,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync iLedSas = iLedScsi + cLedScsi,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync cLedSas = 8,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync iLedUsb = iLedSas + cLedSas,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync cLedUsb = 8,
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync cLedStorage = cLedFloppy + cLedIde + cLedSata + cLedScsi + cLedSas + cLedUsb
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync };
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync DeviceType_T maStorageDevType[cLedStorage];
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync PPDMLED mapStorageLeds[cLedStorage];
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync PPDMLED mapNetworkLeds[36]; /**< @todo adapt this to the maximum network card count */
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync PPDMLED mapSharedFolderLed;
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync PPDMLED mapUSBLed[2];
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync MediumAttachmentMap mapMediumAttachments;
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync /** List of attached USB storage devices. */
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync USBStorageDeviceList mUSBStorageDevices;
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync/* Note: FreeBSD needs this whether netflt is used or not. */
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync#if ((defined(RT_OS_LINUX) && !defined(VBOX_WITH_NETFLT)) || defined(RT_OS_FREEBSD))
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync Utf8Str maTAPDeviceName[8];
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync RTFILE maTapFD[8];
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync#endif
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync bool mVMStateChangeCallbackDisabled;
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync bool mfUseHostClipboard;
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync /** Local machine state value. */
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync MachineState_T mMachineState;
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync /** Pointer to the progress object of a live cancelable task.
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync *
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync * This is currently only used by Console::Teleport(), but is intended to later
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync * be used by the live snapshot code path as well. Actions like
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync * Console::PowerDown, which automatically cancels out the running snapshot /
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync * teleportation operation, will cancel the teleportation / live snapshot
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync * operation before starting. */
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync ComObjPtr<Progress> mptrCancelableProgress;
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync /* The purpose of caching of some events is probably in order to
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync automatically fire them at new event listeners. However, there is no
831acea16fc15fff2cf90a217d02eea69bf27a40vboxsync (longer?) any code making use of this... */
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync#ifdef CONSOLE_WITH_EVENT_CACHE
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync struct
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync {
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync /** OnMousePointerShapeChange() cache */
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync struct
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync {
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync bool valid;
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync bool visible;
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync bool alpha;
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync uint32_t xHot;
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync uint32_t yHot;
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync uint32_t width;
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync uint32_t height;
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync com::SafeArray<BYTE> shape;
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync } mpsc;
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync /** OnMouseCapabilityChange() cache */
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync struct
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync {
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync bool valid;
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync BOOL supportsAbsolute;
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync BOOL supportsRelative;
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync BOOL needsHostCursor;
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync } mcc;
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync /** OnKeyboardLedsChange() cache */
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync struct
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync {
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync bool valid;
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync bool numLock;
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync bool capsLock;
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync bool scrollLock;
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync } klc;
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync void clear()
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync {
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync RT_ZERO(mcc);
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync RT_ZERO(klc);
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync /* We cannot RT_ZERO mpsc because of shape's vtable. */
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync mpsc.shape.setNull();
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync mpsc.valid = mpsc.visible = mpsc.alpha = false;
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync mpsc.xHot = mpsc.yHot = mpsc.width = mpsc.height = 0;
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync }
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync } mCallbackData;
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync#endif
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync ComPtr<IEventListener> mVmListener;
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync friend struct VMTask;
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync};
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync#endif // !____H_CONSOLEIMPL
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync/* vi: set tabstop=4 shiftwidth=4 expandtab: */
6a89b975ab84f4a47fb86fc27ba6c33c701720cfvboxsync