ConsoleImpl.h revision 85ec4409e76bf34043dafc8e379966c4c67e77a8
29099c2d04b11e614f1fa399fab9e9162f2788b9vboxsync/* $Id$ */
29099c2d04b11e614f1fa399fab9e9162f2788b9vboxsync/** @file
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync * VBox Console COM Class definition
29099c2d04b11e614f1fa399fab9e9162f2788b9vboxsync */
29099c2d04b11e614f1fa399fab9e9162f2788b9vboxsync
29099c2d04b11e614f1fa399fab9e9162f2788b9vboxsync/*
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync * Copyright (C) 2006-2010 Oracle Corporation
29099c2d04b11e614f1fa399fab9e9162f2788b9vboxsync *
29099c2d04b11e614f1fa399fab9e9162f2788b9vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
29099c2d04b11e614f1fa399fab9e9162f2788b9vboxsync * available from http://www.virtualbox.org. This file is free software;
29099c2d04b11e614f1fa399fab9e9162f2788b9vboxsync * you can redistribute it and/or modify it under the terms of the GNU
29099c2d04b11e614f1fa399fab9e9162f2788b9vboxsync * General Public License (GPL) as published by the Free Software
29099c2d04b11e614f1fa399fab9e9162f2788b9vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
29099c2d04b11e614f1fa399fab9e9162f2788b9vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
29099c2d04b11e614f1fa399fab9e9162f2788b9vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
29099c2d04b11e614f1fa399fab9e9162f2788b9vboxsync */
29099c2d04b11e614f1fa399fab9e9162f2788b9vboxsync
29099c2d04b11e614f1fa399fab9e9162f2788b9vboxsync#ifndef ____H_CONSOLEIMPL
29099c2d04b11e614f1fa399fab9e9162f2788b9vboxsync#define ____H_CONSOLEIMPL
29099c2d04b11e614f1fa399fab9e9162f2788b9vboxsync
29099c2d04b11e614f1fa399fab9e9162f2788b9vboxsync#include "VirtualBoxBase.h"
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync#include "SchemaDefs.h"
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync#include "VBox/com/array.h"
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync#include "EventImpl.h"
29099c2d04b11e614f1fa399fab9e9162f2788b9vboxsync
29099c2d04b11e614f1fa399fab9e9162f2788b9vboxsyncclass Guest;
29099c2d04b11e614f1fa399fab9e9162f2788b9vboxsyncclass Keyboard;
29099c2d04b11e614f1fa399fab9e9162f2788b9vboxsyncclass Mouse;
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsyncclass Display;
29099c2d04b11e614f1fa399fab9e9162f2788b9vboxsyncclass MachineDebugger;
29099c2d04b11e614f1fa399fab9e9162f2788b9vboxsyncclass TeleporterStateSrc;
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsyncclass OUSBDevice;
29099c2d04b11e614f1fa399fab9e9162f2788b9vboxsyncclass RemoteUSBDevice;
29099c2d04b11e614f1fa399fab9e9162f2788b9vboxsyncclass SharedFolder;
66b58af085e22ee26be57f98127fb49ee2e91790vboxsyncclass RemoteDisplayInfo;
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsyncclass AudioSniffer;
29099c2d04b11e614f1fa399fab9e9162f2788b9vboxsyncclass ConsoleVRDPServer;
29099c2d04b11e614f1fa399fab9e9162f2788b9vboxsyncclass VMMDev;
29099c2d04b11e614f1fa399fab9e9162f2788b9vboxsyncclass Progress;
29099c2d04b11e614f1fa399fab9e9162f2788b9vboxsync
29099c2d04b11e614f1fa399fab9e9162f2788b9vboxsync#include <VBox/vrdpapi.h>
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync#include <VBox/pdmdrv.h>
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync#ifdef VBOX_WITH_GUEST_PROPS
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync# include <VBox/HostServices/GuestPropertySvc.h> /* For the property notification callback */
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync#endif
5c4d7e2aae42bbf39793dfa686925f076a56b4d5vboxsync
5c4d7e2aae42bbf39793dfa686925f076a56b4d5vboxsync#ifdef RT_OS_WINDOWS
5c4d7e2aae42bbf39793dfa686925f076a56b4d5vboxsync# include "win/VBoxComEvents.h"
5c4d7e2aae42bbf39793dfa686925f076a56b4d5vboxsync#endif
5c4d7e2aae42bbf39793dfa686925f076a56b4d5vboxsync
5c4d7e2aae42bbf39793dfa686925f076a56b4d5vboxsyncstruct VUSBIRHCONFIG;
5c4d7e2aae42bbf39793dfa686925f076a56b4d5vboxsynctypedef struct VUSBIRHCONFIG *PVUSBIRHCONFIG;
5c4d7e2aae42bbf39793dfa686925f076a56b4d5vboxsync
5c4d7e2aae42bbf39793dfa686925f076a56b4d5vboxsync#include <list>
5c4d7e2aae42bbf39793dfa686925f076a56b4d5vboxsync
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync// defines
29099c2d04b11e614f1fa399fab9e9162f2788b9vboxsync///////////////////////////////////////////////////////////////////////////////
5c4d7e2aae42bbf39793dfa686925f076a56b4d5vboxsync
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync/**
0c94a8282c9042b02f022302a3d987746140eab9vboxsync * Checks the availability of the underlying VM device driver corresponding
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync * to the COM interface (IKeyboard, IMouse, IDisplay, etc.). When the driver is
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync * not available (NULL), sets error info and returns returns E_ACCESSDENIED.
29099c2d04b11e614f1fa399fab9e9162f2788b9vboxsync * The translatable error message is defined in null context.
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync *
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync * Intended to used only within Console children (i.e. Keyboard, Mouse,
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync * Display, etc.).
fdb40b7d2efa84fc6f03b7a695cb4b2e035c30c7vboxsync *
fdb40b7d2efa84fc6f03b7a695cb4b2e035c30c7vboxsync * @param drv driver pointer to check (compare it with NULL)
5c4d7e2aae42bbf39793dfa686925f076a56b4d5vboxsync */
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync#define CHECK_CONSOLE_DRV(drv) \
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync do { \
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync if (!(drv)) \
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync return setError(E_ACCESSDENIED, tr("The console is not powered up")); \
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync } while (0)
29099c2d04b11e614f1fa399fab9e9162f2788b9vboxsync
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync// Console
29099c2d04b11e614f1fa399fab9e9162f2788b9vboxsync///////////////////////////////////////////////////////////////////////////////
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync/** IConsole implementation class */
5c4d7e2aae42bbf39793dfa686925f076a56b4d5vboxsyncclass ATL_NO_VTABLE Console :
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync public VirtualBoxBaseWithChildrenNEXT,
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync VBOX_SCRIPTABLE_IMPL(IConsole)
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync#ifdef RT_OS_WINDOWS
5c4d7e2aae42bbf39793dfa686925f076a56b4d5vboxsync , public CComCoClass<Console, &CLSID_Console>
5c4d7e2aae42bbf39793dfa686925f076a56b4d5vboxsync#endif
5c4d7e2aae42bbf39793dfa686925f076a56b4d5vboxsync{
5c4d7e2aae42bbf39793dfa686925f076a56b4d5vboxsync Q_OBJECT
5c4d7e2aae42bbf39793dfa686925f076a56b4d5vboxsync
5c4d7e2aae42bbf39793dfa686925f076a56b4d5vboxsyncpublic:
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT(Console, IConsole)
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync DECLARE_NOT_AGGREGATABLE(Console)
0c94a8282c9042b02f022302a3d987746140eab9vboxsync
0c94a8282c9042b02f022302a3d987746140eab9vboxsync DECLARE_PROTECT_FINAL_CONSTRUCT()
0c94a8282c9042b02f022302a3d987746140eab9vboxsync
0c94a8282c9042b02f022302a3d987746140eab9vboxsync BEGIN_COM_MAP(Console)
0c94a8282c9042b02f022302a3d987746140eab9vboxsync COM_INTERFACE_ENTRY(ISupportErrorInfo)
0c94a8282c9042b02f022302a3d987746140eab9vboxsync COM_INTERFACE_ENTRY(IConsole)
0c94a8282c9042b02f022302a3d987746140eab9vboxsync COM_INTERFACE_ENTRY(IDispatch)
0c94a8282c9042b02f022302a3d987746140eab9vboxsync END_COM_MAP()
0c94a8282c9042b02f022302a3d987746140eab9vboxsync
0c94a8282c9042b02f022302a3d987746140eab9vboxsync Console();
0c94a8282c9042b02f022302a3d987746140eab9vboxsync ~Console();
0c94a8282c9042b02f022302a3d987746140eab9vboxsync
0c94a8282c9042b02f022302a3d987746140eab9vboxsync HRESULT FinalConstruct();
0c94a8282c9042b02f022302a3d987746140eab9vboxsync void FinalRelease();
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync // public initializers/uninitializers for internal purposes only
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync HRESULT init(IMachine *aMachine, IInternalMachineControl *aControl);
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync void uninit();
0c94a8282c9042b02f022302a3d987746140eab9vboxsync
0c94a8282c9042b02f022302a3d987746140eab9vboxsync // IConsole properties
0c94a8282c9042b02f022302a3d987746140eab9vboxsync STDMETHOD(COMGETTER(Machine))(IMachine **aMachine);
0c94a8282c9042b02f022302a3d987746140eab9vboxsync STDMETHOD(COMGETTER(State))(MachineState_T *aMachineState);
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync STDMETHOD(COMGETTER(Guest))(IGuest **aGuest);
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync STDMETHOD(COMGETTER(Keyboard))(IKeyboard **aKeyboard);
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync STDMETHOD(COMGETTER(Mouse))(IMouse **aMouse);
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync STDMETHOD(COMGETTER(Display))(IDisplay **aDisplay);
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync STDMETHOD(COMGETTER(Debugger))(IMachineDebugger **aDebugger);
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync STDMETHOD(COMGETTER(USBDevices))(ComSafeArrayOut(IUSBDevice *, aUSBDevices));
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync STDMETHOD(COMGETTER(RemoteUSBDevices))(ComSafeArrayOut(IHostUSBDevice *, aRemoteUSBDevices));
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync STDMETHOD(COMGETTER(RemoteDisplayInfo))(IRemoteDisplayInfo **aRemoteDisplayInfo);
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync STDMETHOD(COMGETTER(SharedFolders))(ComSafeArrayOut(ISharedFolder *, aSharedFolders));
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync STDMETHOD(COMGETTER(EventSource)) (IEventSource ** aEventSource);
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync // IConsole methods
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync STDMETHOD(PowerUp)(IProgress **aProgress);
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync STDMETHOD(PowerUpPaused)(IProgress **aProgress);
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync STDMETHOD(PowerDown)(IProgress **aProgress);
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync STDMETHOD(Reset)();
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync STDMETHOD(Pause)();
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync STDMETHOD(Resume)();
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync STDMETHOD(PowerButton)();
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync STDMETHOD(SleepButton)();
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync STDMETHOD(GetPowerButtonHandled)(BOOL *aHandled);
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync STDMETHOD(GetGuestEnteredACPIMode)(BOOL *aEntered);
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync STDMETHOD(SaveState)(IProgress **aProgress);
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync STDMETHOD(AdoptSavedState)(IN_BSTR aSavedStateFile);
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync STDMETHOD(DiscardSavedState)(BOOL aRemoveFile);
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync STDMETHOD(GetDeviceActivity)(DeviceType_T aDeviceType,
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync DeviceActivity_T *aDeviceActivity);
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync STDMETHOD(AttachUSBDevice)(IN_BSTR aId);
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync STDMETHOD(DetachUSBDevice)(IN_BSTR aId, IUSBDevice **aDevice);
f9cdd92d151d9c28eb0f1aed25863fc04f85691dvboxsync STDMETHOD(FindUSBDeviceByAddress)(IN_BSTR aAddress, IUSBDevice **aDevice);
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync STDMETHOD(FindUSBDeviceById)(IN_BSTR aId, IUSBDevice **aDevice);
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync STDMETHOD(CreateSharedFolder)(IN_BSTR aName, IN_BSTR aHostPath, BOOL aWritable, BOOL aAutoMount);
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync STDMETHOD(RemoveSharedFolder)(IN_BSTR aName);
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync STDMETHOD(TakeSnapshot)(IN_BSTR aName, IN_BSTR aDescription,
f9cdd92d151d9c28eb0f1aed25863fc04f85691dvboxsync IProgress **aProgress);
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync STDMETHOD(DeleteSnapshot)(IN_BSTR aId, IProgress **aProgress);
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync STDMETHOD(RestoreSnapshot)(ISnapshot *aSnapshot, IProgress **aProgress);
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync STDMETHOD(Teleport)(IN_BSTR aHostname, ULONG aPort, IN_BSTR aPassword, ULONG aMaxDowntime, IProgress **aProgress);
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync // public methods for internal purposes only
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync /*
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync * Note: the following methods do not increase refcount. intended to be
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync * called only by the VM execution thread.
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync */
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync
1969e98a26e5b56b67fbe3b6bfa007f8f09e86ebvboxsync Guest *getGuest() const { return mGuest; }
44372afb953dc9f1f1ec71943f5f561a607c0307vboxsync Keyboard *getKeyboard() const { return mKeyboard; }
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync Mouse *getMouse() const { return mMouse; }
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync Display *getDisplay() const { return mDisplay; }
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync MachineDebugger *getMachineDebugger() const { return mDebugger; }
0c94a8282c9042b02f022302a3d987746140eab9vboxsync
0c94a8282c9042b02f022302a3d987746140eab9vboxsync const ComPtr<IMachine> &machine() const { return mMachine; }
0c94a8282c9042b02f022302a3d987746140eab9vboxsync
0c94a8282c9042b02f022302a3d987746140eab9vboxsync /** Method is called only from ConsoleVRDPServer */
0c94a8282c9042b02f022302a3d987746140eab9vboxsync IVRDPServer *getVRDPServer() const { return mVRDPServer; }
0c94a8282c9042b02f022302a3d987746140eab9vboxsync
0c94a8282c9042b02f022302a3d987746140eab9vboxsync ConsoleVRDPServer *consoleVRDPServer() const { return mConsoleVRDPServer; }
0c94a8282c9042b02f022302a3d987746140eab9vboxsync
0c94a8282c9042b02f022302a3d987746140eab9vboxsync HRESULT updateMachineState(MachineState_T aMachineState);
0c94a8282c9042b02f022302a3d987746140eab9vboxsync
0c94a8282c9042b02f022302a3d987746140eab9vboxsync // events from IInternalSessionControl
0c94a8282c9042b02f022302a3d987746140eab9vboxsync HRESULT onNetworkAdapterChange(INetworkAdapter *aNetworkAdapter, BOOL changeAdapter);
0c94a8282c9042b02f022302a3d987746140eab9vboxsync HRESULT onSerialPortChange(ISerialPort *aSerialPort);
0c94a8282c9042b02f022302a3d987746140eab9vboxsync HRESULT onParallelPortChange(IParallelPort *aParallelPort);
0c94a8282c9042b02f022302a3d987746140eab9vboxsync HRESULT onStorageControllerChange();
0c94a8282c9042b02f022302a3d987746140eab9vboxsync HRESULT onMediumChange(IMediumAttachment *aMediumAttachment, BOOL aForce);
0c94a8282c9042b02f022302a3d987746140eab9vboxsync HRESULT onCPUChange(ULONG aCPU, BOOL aRemove);
0c94a8282c9042b02f022302a3d987746140eab9vboxsync HRESULT onCPUPriorityChange(ULONG aCpuPriority);
0c94a8282c9042b02f022302a3d987746140eab9vboxsync HRESULT onVRDPServerChange(BOOL aRestart);
0c94a8282c9042b02f022302a3d987746140eab9vboxsync HRESULT onUSBControllerChange();
0c94a8282c9042b02f022302a3d987746140eab9vboxsync HRESULT onSharedFolderChange(BOOL aGlobal);
0c94a8282c9042b02f022302a3d987746140eab9vboxsync HRESULT onUSBDeviceAttach(IUSBDevice *aDevice, IVirtualBoxErrorInfo *aError, ULONG aMaskedIfs);
0c94a8282c9042b02f022302a3d987746140eab9vboxsync HRESULT onUSBDeviceDetach(IN_BSTR aId, IVirtualBoxErrorInfo *aError);
0c94a8282c9042b02f022302a3d987746140eab9vboxsync HRESULT getGuestProperty(IN_BSTR aKey, BSTR *aValue, LONG64 *aTimestamp, BSTR *aFlags);
0c94a8282c9042b02f022302a3d987746140eab9vboxsync HRESULT setGuestProperty(IN_BSTR aKey, IN_BSTR aValue, IN_BSTR aFlags);
0c94a8282c9042b02f022302a3d987746140eab9vboxsync HRESULT enumerateGuestProperties(IN_BSTR aPatterns,
0c94a8282c9042b02f022302a3d987746140eab9vboxsync ComSafeArrayOut(BSTR, aNames),
0c94a8282c9042b02f022302a3d987746140eab9vboxsync ComSafeArrayOut(BSTR, aValues),
0c94a8282c9042b02f022302a3d987746140eab9vboxsync ComSafeArrayOut(LONG64, aTimestamps),
0c94a8282c9042b02f022302a3d987746140eab9vboxsync ComSafeArrayOut(BSTR, aFlags));
0c94a8282c9042b02f022302a3d987746140eab9vboxsync HRESULT onlineMergeMedium(IMediumAttachment *aMediumAttachment,
0c94a8282c9042b02f022302a3d987746140eab9vboxsync ULONG aSourceIdx, ULONG aTargetIdx,
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync IMedium *aSource, IMedium *aTarget,
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync BOOL aMergeForward, IMedium *aParentForTarget,
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync ComSafeArrayIn(IMedium *, aChildrenToReparent),
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync IProgress *aProgress);
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync VMMDev *getVMMDev() { return mVMMDev; }
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync AudioSniffer *getAudioSniffer() { return mAudioSniffer; }
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync int VRDPClientLogon(uint32_t u32ClientId, const char *pszUser, const char *pszPassword, const char *pszDomain);
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync void VRDPClientConnect(uint32_t u32ClientId);
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync void VRDPClientDisconnect(uint32_t u32ClientId, uint32_t fu32Intercepted);
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync void VRDPInterceptAudio(uint32_t u32ClientId);
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync void VRDPInterceptUSB(uint32_t u32ClientId, void **ppvIntercept);
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync void VRDPInterceptClipboard(uint32_t u32ClientId);
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync void processRemoteUSBDevices(uint32_t u32ClientId, VRDPUSBDEVICEDESC *pDevList, uint32_t cbDevList);
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync // callback callers (partly; for some events console callbacks are notified
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync // directly from IInternalSessionControl event handlers declared above)
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync void onMousePointerShapeChange(bool fVisible, bool fAlpha,
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync uint32_t xHot, uint32_t yHot,
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync uint32_t width, uint32_t height,
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync ComSafeArrayIn(uint8_t, aShape));
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync void onMouseCapabilityChange(BOOL supportsAbsolute, BOOL supportsRelative, BOOL needsHostCursor);
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync void onStateChange(MachineState_T aMachineState);
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync void onAdditionsStateChange();
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync void onAdditionsOutdated();
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync void onKeyboardLedsChange(bool fNumLock, bool fCapsLock, bool fScrollLock);
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync void onUSBDeviceStateChange(IUSBDevice *aDevice, bool aAttached,
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync IVirtualBoxErrorInfo *aError);
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync void onRuntimeError(BOOL aFatal, IN_BSTR aErrorID, IN_BSTR aMessage);
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync HRESULT onShowWindow(BOOL aCheck, BOOL *aCanShow, LONG64 *aWinId);
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync void onRemoteDisplayInfoChange();
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync static const PDMDRVREG DrvStatusReg;
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync static HRESULT setErrorStatic(HRESULT aResultCode, const char *pcsz, ...);
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync HRESULT setInvalidMachineStateError();
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync static HRESULT handleUnexpectedExceptions(RT_SRC_POS_DECL);
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync static const char *convertControllerTypeToDev(StorageControllerType_T enmCtrlType);
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync static HRESULT convertBusPortDeviceToLun(StorageBus_T enmBus, LONG port, LONG device, unsigned &uLun);
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsyncprivate:
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync /**
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync * Base template for AutoVMCaller and SaveVMPtr. Template arguments
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync * have the same meaning as arguments of Console::addVMCaller().
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync */
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync template <bool taQuiet = false, bool taAllowNullVM = false>
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync class AutoVMCallerBase
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync {
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync public:
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync AutoVMCallerBase(Console *aThat) : mThat(aThat), mRC(S_OK)
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync {
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync Assert(aThat);
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync mRC = aThat->addVMCaller(taQuiet, taAllowNullVM);
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync }
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync ~AutoVMCallerBase()
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync {
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync if (SUCCEEDED(mRC))
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync mThat->releaseVMCaller();
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync }
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync /** Decreases the number of callers before the instance is destroyed. */
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync void release()
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync {
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync AssertReturnVoid(SUCCEEDED(mRC));
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync mThat->releaseVMCaller();
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync mRC = E_FAIL;
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync }
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync /** Restores the number of callers after by #release(). #rc() must be
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync * rechecked to ensure the operation succeeded. */
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync void add()
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync {
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync AssertReturnVoid(!SUCCEEDED(mRC));
38745c55f37c31ba8b78cc728d2f08ea6eec38d6vboxsync mRC = mThat->addVMCaller(taQuiet, taAllowNullVM);
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync }
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync /** Returns the result of Console::addVMCaller() */
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync HRESULT rc() const { return mRC; }
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync /** Shortcut to SUCCEEDED(rc()) */
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync bool isOk() const { return SUCCEEDED(mRC); }
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync protected:
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync Console *mThat;
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync HRESULT mRC;
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync private:
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync DECLARE_CLS_COPY_CTOR_ASSIGN_NOOP(AutoVMCallerBase)
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync DECLARE_CLS_NEW_DELETE_NOOP(AutoVMCallerBase)
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync };
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync /**
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync * Helper class that protects sections of code using the mpVM pointer by
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync * automatically calling addVMCaller() on construction and
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync * releaseVMCaller() on destruction. Intended for Console methods dealing
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync * with mpVM. The usage pattern is:
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync * <code>
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync * AutoVMCaller autoVMCaller(this);
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync * if (FAILED(autoVMCaller.rc())) return autoVMCaller.rc();
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync * ...
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync * VMR3ReqCall (mpVM, ...
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync * </code>
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync *
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync * @note Temporarily locks the argument for writing.
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync *
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync * @sa SafeVMPtr, SafeVMPtrQuiet
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync */
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync typedef AutoVMCallerBase <false, false> AutoVMCaller;
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync /**
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync * Same as AutoVMCaller but doesn't set extended error info on failure.
29099c2d04b11e614f1fa399fab9e9162f2788b9vboxsync *
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync * @note Temporarily locks the argument for writing.
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync */
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync typedef AutoVMCallerBase <true, false> AutoVMCallerQuiet;
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync /**
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync * Same as AutoVMCaller but allows a null VM pointer (to trigger an error
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync * instead of assertion).
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync *
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync * @note Temporarily locks the argument for writing.
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync */
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync typedef AutoVMCallerBase <false, true> AutoVMCallerWeak;
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync /**
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync * Same as AutoVMCaller but doesn't set extended error info on failure
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync * and allows a null VM pointer (to trigger an error instead of
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync * assertion).
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync *
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync * @note Temporarily locks the argument for writing.
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync */
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync typedef AutoVMCallerBase <true, true> AutoVMCallerQuietWeak;
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync /**
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync * Base template for SaveVMPtr and SaveVMPtrQuiet.
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync */
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync template <bool taQuiet = false>
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync class SafeVMPtrBase : public AutoVMCallerBase <taQuiet, true>
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync {
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync typedef AutoVMCallerBase <taQuiet, true> Base;
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync public:
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync SafeVMPtrBase(Console *aThat) : Base(aThat), mpVM(NULL)
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync {
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync if (SUCCEEDED(Base::mRC))
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync mpVM = aThat->mpVM;
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync }
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync /** Smart SaveVMPtr to PVM cast operator */
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync operator PVM() const { return mpVM; }
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync /** Direct PVM access for printf()-like functions */
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync PVM raw() const { return mpVM; }
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync private:
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync PVM mpVM;
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync DECLARE_CLS_COPY_CTOR_ASSIGN_NOOP(SafeVMPtrBase)
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync DECLARE_CLS_NEW_DELETE_NOOP(SafeVMPtrBase)
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync };
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync
66b58af085e22ee26be57f98127fb49ee2e91790vboxsyncpublic:
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync /**
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync * Helper class that safely manages the Console::mpVM pointer
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync * by calling addVMCaller() on construction and releaseVMCaller() on
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync * destruction. Intended for Console children. The usage pattern is:
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync * <code>
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync * Console::SaveVMPtr pVM(mParent);
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync * if (FAILED(pVM.rc())) return pVM.rc();
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync * ...
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync * VMR3ReqCall(pVM, ...
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync * ...
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync * printf("%p\n", pVM.raw());
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync * </code>
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync *
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync * @note Temporarily locks the argument for writing.
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync *
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync * @sa SafeVMPtrQuiet, AutoVMCaller
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync */
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync typedef SafeVMPtrBase <false> SafeVMPtr;
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync /**
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync * A deviation of SaveVMPtr that doesn't set the error info on failure.
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync * Intended for pieces of code that don't need to return the VM access
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync * failure to the caller. The usage pattern is:
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync * <code>
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync * Console::SaveVMPtrQuiet pVM(mParent);
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync * if (pVM.rc())
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync * VMR3ReqCall(pVM, ...
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync * return S_OK;
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync * </code>
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync *
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync * @note Temporarily locks the argument for writing.
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync *
0c94a8282c9042b02f022302a3d987746140eab9vboxsync * @sa SafeVMPtr, AutoVMCaller
0c94a8282c9042b02f022302a3d987746140eab9vboxsync */
0c94a8282c9042b02f022302a3d987746140eab9vboxsync typedef SafeVMPtrBase <true> SafeVMPtrQuiet;
0c94a8282c9042b02f022302a3d987746140eab9vboxsync
0c94a8282c9042b02f022302a3d987746140eab9vboxsync class SharedFolderData
0c94a8282c9042b02f022302a3d987746140eab9vboxsync {
0c94a8282c9042b02f022302a3d987746140eab9vboxsync public:
0c94a8282c9042b02f022302a3d987746140eab9vboxsync SharedFolderData() {}
0c94a8282c9042b02f022302a3d987746140eab9vboxsync SharedFolderData(Bstr aHostPath, BOOL aWritable, BOOL aAutoMount)
38745c55f37c31ba8b78cc728d2f08ea6eec38d6vboxsync : mHostPath(aHostPath)
0c94a8282c9042b02f022302a3d987746140eab9vboxsync , mWritable(aWritable)
0c94a8282c9042b02f022302a3d987746140eab9vboxsync , mAutoMount(aAutoMount) {}
0c94a8282c9042b02f022302a3d987746140eab9vboxsync SharedFolderData(const SharedFolderData& aThat)
0c94a8282c9042b02f022302a3d987746140eab9vboxsync : mHostPath(aThat.mHostPath)
0c94a8282c9042b02f022302a3d987746140eab9vboxsync , mWritable(aThat.mWritable)
0c94a8282c9042b02f022302a3d987746140eab9vboxsync , mAutoMount(aThat.mAutoMount) {}
0c94a8282c9042b02f022302a3d987746140eab9vboxsync Bstr mHostPath;
0c94a8282c9042b02f022302a3d987746140eab9vboxsync BOOL mWritable;
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync BOOL mAutoMount;
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync };
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync typedef std::map <Bstr, ComObjPtr<SharedFolder> > SharedFolderMap;
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync typedef std::map <Bstr, SharedFolderData> SharedFolderDataMap;
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsyncprivate:
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync typedef std::list <ComObjPtr<OUSBDevice> > USBDeviceList;
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync typedef std::list <ComObjPtr<RemoteUSBDevice> > RemoteUSBDeviceList;
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync HRESULT addVMCaller(bool aQuiet = false, bool aAllowNullVM = false);
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync void releaseVMCaller();
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync HRESULT consoleInitReleaseLog(const ComPtr<IMachine> aMachine);
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync HRESULT powerUp(IProgress **aProgress, bool aPaused);
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync HRESULT powerDown(Progress *aProgress = NULL);
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync HRESULT callTapSetupApplication(bool isStatic, RTFILE tapFD, Bstr &tapDevice,
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync Bstr &tapSetupApplication);
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync#if ((defined(RT_OS_LINUX) && !defined(VBOX_WITH_NETFLT)) || defined(RT_OS_FREEBSD))
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync HRESULT attachToTapInterface(INetworkAdapter *networkAdapter);
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync HRESULT detachFromTapInterface(INetworkAdapter *networkAdapter);
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync#endif
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync HRESULT powerDownHostInterfaces();
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync HRESULT setMachineState(MachineState_T aMachineState, bool aUpdateServer = true);
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync HRESULT setMachineStateLocally(MachineState_T aMachineState)
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync {
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync return setMachineState(aMachineState, false /* aUpdateServer */);
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync }
f9cdd92d151d9c28eb0f1aed25863fc04f85691dvboxsync
f9cdd92d151d9c28eb0f1aed25863fc04f85691dvboxsync HRESULT findSharedFolder(CBSTR aName,
f9cdd92d151d9c28eb0f1aed25863fc04f85691dvboxsync ComObjPtr<SharedFolder> &aSharedFolder,
f9cdd92d151d9c28eb0f1aed25863fc04f85691dvboxsync bool aSetError = false);
f9cdd92d151d9c28eb0f1aed25863fc04f85691dvboxsync
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync HRESULT fetchSharedFolders(BOOL aGlobal);
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync bool findOtherSharedFolder(IN_BSTR aName,
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync SharedFolderDataMap::const_iterator &aIt);
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync HRESULT createSharedFolder(CBSTR aName, SharedFolderData aData);
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync HRESULT removeSharedFolder(CBSTR aName);
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync static DECLCALLBACK(int) configConstructor(PVM pVM, void *pvConsole);
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync int configMediumAttachment(PCFGMNODE pCtlInst,
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync const char *pcszDevice,
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync unsigned uInstance,
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync StorageBus_T enmBus,
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync bool fUseHostIOCache,
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync bool fSetupMerge,
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync unsigned uMergeSource,
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync unsigned uMergeTarget,
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync IMediumAttachment *pMediumAtt,
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync MachineState_T aMachineState,
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync HRESULT *phrc,
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync bool fAttachDetach,
38745c55f37c31ba8b78cc728d2f08ea6eec38d6vboxsync bool fForceUnmount,
38745c55f37c31ba8b78cc728d2f08ea6eec38d6vboxsync PVM pVM,
38745c55f37c31ba8b78cc728d2f08ea6eec38d6vboxsync DeviceType_T *paLedDevType);
38745c55f37c31ba8b78cc728d2f08ea6eec38d6vboxsync int configMedium(PCFGMNODE pLunL0,
38745c55f37c31ba8b78cc728d2f08ea6eec38d6vboxsync bool fPassthrough,
38745c55f37c31ba8b78cc728d2f08ea6eec38d6vboxsync DeviceType_T enmType,
38745c55f37c31ba8b78cc728d2f08ea6eec38d6vboxsync bool fUseHostIOCache,
38745c55f37c31ba8b78cc728d2f08ea6eec38d6vboxsync bool fSetupMerge,
f9cdd92d151d9c28eb0f1aed25863fc04f85691dvboxsync unsigned uMergeSource,
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync unsigned uMergeTarget,
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync IMedium *pMedium,
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync MachineState_T aMachineState,
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync HRESULT *phrc);
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync static DECLCALLBACK(int) reconfigureMediumAttachment(Console *pConsole,
f9cdd92d151d9c28eb0f1aed25863fc04f85691dvboxsync PVM pVM,
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync const char *pcszDevice,
f9cdd92d151d9c28eb0f1aed25863fc04f85691dvboxsync unsigned uInstance,
f9cdd92d151d9c28eb0f1aed25863fc04f85691dvboxsync StorageBus_T enmBus,
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync bool fUseHostIOCache,
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync bool fSetupMerge,
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync unsigned uMergeSource,
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync unsigned uMergeTarget,
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync IMediumAttachment *aMediumAtt,
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync MachineState_T aMachineState,
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync HRESULT *phrc);
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync static DECLCALLBACK(int) changeRemovableMedium(Console *pThis,
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync const char *pcszDevice,
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync unsigned uInstance,
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync StorageBus_T enmBus,
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync bool fUseHostIOCache,
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync IMediumAttachment *aMediumAtt,
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync bool fForce);
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync int configNetwork(const char *pszDevice, unsigned uInstance, unsigned uLun,
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync INetworkAdapter *aNetworkAdapter, PCFGMNODE pCfg,
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync PCFGMNODE pLunL0, PCFGMNODE pInst, bool fAttachDetach);
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync static DECLCALLBACK(int) configGuestProperties(void *pvConsole);
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync static DECLCALLBACK(int) configGuestControl(void *pvConsole);
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync static DECLCALLBACK(void) vmstateChangeCallback(PVM aVM, VMSTATE aState,
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync VMSTATE aOldState, void *aUser);
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync static DECLCALLBACK(int) unplugCpu(Console *pThis, unsigned uCpu);
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync static DECLCALLBACK(int) plugCpu(Console *pThis, unsigned uCpu);
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync HRESULT doMediumChange(IMediumAttachment *aMediumAttachment, bool fForce);
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync HRESULT doCPURemove(ULONG aCpu);
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync HRESULT doCPUAdd(ULONG aCpu);
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync#ifdef VBOX_DYNAMIC_NET_ATTACH
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync HRESULT doNetworkAdapterChange(const char *pszDevice, unsigned uInstance,
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync unsigned uLun, INetworkAdapter *aNetworkAdapter);
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync static DECLCALLBACK(int) changeNetworkAttachment(Console *pThis, const char *pszDevice,
0c94a8282c9042b02f022302a3d987746140eab9vboxsync unsigned uInstance, unsigned uLun,
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync INetworkAdapter *aNetworkAdapter);
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync#endif /* VBOX_DYNAMIC_NET_ATTACH */
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync#ifdef VBOX_WITH_USB
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync HRESULT attachUSBDevice(IUSBDevice *aHostDevice, ULONG aMaskedIfs);
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync HRESULT detachUSBDevice(USBDeviceList::iterator &aIt);
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync static DECLCALLBACK(int) usbAttachCallback(Console *that, IUSBDevice *aHostDevice, PCRTUUID aUuid,
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync bool aRemote, const char *aAddress, ULONG aMaskedIfs);
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync static DECLCALLBACK(int) usbDetachCallback(Console *that, USBDeviceList::iterator *aIt, PCRTUUID aUuid);
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync#endif
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync static DECLCALLBACK(int) fntTakeSnapshotWorker(RTTHREAD Thread, void *pvUser);
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync static DECLCALLBACK(int) stateProgressCallback(PVM pVM, unsigned uPercent, void *pvUser);
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync static DECLCALLBACK(void) genericVMSetErrorCallback(PVM pVM, void *pvUser, int rc, RT_SRC_POS_DECL,
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync const char *pszErrorFmt, va_list va);
fdb40b7d2efa84fc6f03b7a695cb4b2e035c30c7vboxsync
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync static DECLCALLBACK(void) setVMRuntimeErrorCallbackF(PVM pVM, void *pvUser, uint32_t fFatal,
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync const char *pszErrorId,
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync const char *pszFormat, ...);
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync static DECLCALLBACK(void) setVMRuntimeErrorCallback(PVM pVM, void *pvUser, uint32_t fFatal,
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync const char *pszErrorId,
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync const char *pszFormat, va_list va);
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync HRESULT captureUSBDevices(PVM pVM);
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync void detachAllUSBDevices(bool aDone);
0c94a8282c9042b02f022302a3d987746140eab9vboxsync
0c94a8282c9042b02f022302a3d987746140eab9vboxsync static DECLCALLBACK(int) powerUpThread(RTTHREAD Thread, void *pvUser);
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync static DECLCALLBACK(int) saveStateThread(RTTHREAD Thread, void *pvUser);
0c94a8282c9042b02f022302a3d987746140eab9vboxsync static DECLCALLBACK(int) powerDownThread(RTTHREAD Thread, void *pvUser);
0c94a8282c9042b02f022302a3d987746140eab9vboxsync
0c94a8282c9042b02f022302a3d987746140eab9vboxsync static DECLCALLBACK(int) vmm2User_SaveState(PCVMM2USERMETHODS pThis, PVM pVM);
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync
0c94a8282c9042b02f022302a3d987746140eab9vboxsync static DECLCALLBACK(void *) drvStatus_QueryInterface(PPDMIBASE pInterface, const char *pszIID);
0c94a8282c9042b02f022302a3d987746140eab9vboxsync static DECLCALLBACK(void) drvStatus_UnitChanged(PPDMILEDCONNECTORS pInterface, unsigned iLUN);
0c94a8282c9042b02f022302a3d987746140eab9vboxsync static DECLCALLBACK(void) drvStatus_Destruct(PPDMDRVINS pDrvIns);
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync static DECLCALLBACK(int) drvStatus_Construct(PPDMDRVINS pDrvIns, PCFGMNODE pCfg, uint32_t fFlags);
0c94a8282c9042b02f022302a3d987746140eab9vboxsync
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync int mcAudioRefs;
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync volatile uint32_t mcVRDPClients;
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync uint32_t mu32SingleRDPClientId; /* The id of a connected client in the single connection mode. */
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync static const char *sSSMConsoleUnit;
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync static uint32_t sSSMConsoleVer;
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync HRESULT loadDataFromSavedState();
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync int loadStateFileExecInternal(PSSMHANDLE pSSM, uint32_t u32Version);
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync static DECLCALLBACK(void) saveStateFileExec(PSSMHANDLE pSSM, void *pvUser);
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync static DECLCALLBACK(int) loadStateFileExec(PSSMHANDLE pSSM, void *pvUser, uint32_t uVersion, uint32_t uPass);
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync#ifdef VBOX_WITH_GUEST_PROPS
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync static DECLCALLBACK(int) doGuestPropNotification(void *pvExtension, uint32_t, void *pvParms, uint32_t cbParms);
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync HRESULT doEnumerateGuestProperties(CBSTR aPatterns,
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync ComSafeArrayOut(BSTR, aNames),
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync ComSafeArrayOut(BSTR, aValues),
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync ComSafeArrayOut(LONG64, aTimestamps),
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync ComSafeArrayOut(BSTR, aFlags));
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync bool enabledGuestPropertiesVRDP(void);
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync void updateGuestPropertiesVRDPLogon(uint32_t u32ClientId, const char *pszUser, const char *pszDomain);
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync void updateGuestPropertiesVRDPDisconnect(uint32_t u32ClientId);
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync#endif
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync /** @name Teleporter support
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync * @{ */
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync static DECLCALLBACK(int) teleporterSrcThreadWrapper(RTTHREAD hThread, void *pvUser);
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync HRESULT teleporterSrc(TeleporterStateSrc *pState);
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync HRESULT teleporterSrcReadACK(TeleporterStateSrc *pState, const char *pszWhich, const char *pszNAckMsg = NULL);
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync HRESULT teleporterSrcSubmitCommand(TeleporterStateSrc *pState, const char *pszCommand, bool fWaitForAck = true);
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync HRESULT teleporterTrg(PVM pVM, IMachine *pMachine, Utf8Str *pErrorMsg, bool fStartPaused,
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync Progress *pProgress, bool *pfPowerOffOnFailure);
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync static DECLCALLBACK(int) teleporterTrgServeConnection(RTSOCKET Sock, void *pvUser);
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync /** @} */
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync bool mSavedStateDataLoaded : 1;
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync const ComPtr<IMachine> mMachine;
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync const ComPtr<IInternalMachineControl> mControl;
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync const ComPtr <IVRDPServer> mVRDPServer;
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync ConsoleVRDPServer * const mConsoleVRDPServer;
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync const ComObjPtr<Guest> mGuest;
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync const ComObjPtr<Keyboard> mKeyboard;
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync const ComObjPtr<Mouse> mMouse;
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync const ComObjPtr<Display> mDisplay;
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync const ComObjPtr<MachineDebugger> mDebugger;
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync const ComObjPtr<RemoteDisplayInfo> mRemoteDisplayInfo;
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync const ComObjPtr<EventSource> mEventSource;
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync USBDeviceList mUSBDevices;
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync RemoteUSBDeviceList mRemoteUSBDevices;
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync SharedFolderMap mSharedFolders;
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync SharedFolderDataMap mMachineSharedFolders;
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync SharedFolderDataMap mGlobalSharedFolders;
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync /** The VM instance handle. */
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync PVM mpVM;
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync /** Holds the number of "readonly" mpVM callers (users) */
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync uint32_t mVMCallers;
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync /** Semaphore posted when the number of mpVM callers drops to zero */
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync RTSEMEVENT mVMZeroCallersSem;
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync /** true when Console has entered the mpVM destruction phase */
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync bool mVMDestroying : 1;
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync /** true when power down is initiated by vmstateChangeCallback (EMT) */
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync bool mVMPoweredOff : 1;
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync /** true when vmstateChangeCallback shouldn't initiate a power down. */
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync bool mVMIsAlreadyPoweringOff : 1;
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync /** true if we already showed the snapshot folder size warning. */
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync bool mfSnapshotFolderSizeWarningShown : 1;
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync /** true if we already showed the snapshot folder ext4/xfs bug warning. */
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync bool mfSnapshotFolderExt4WarningShown : 1;
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync /** Pointer to the VMM -> User (that's us) callbacks.
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync * This structure is followed by a pointer to the Console object. */
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync PCVMM2USERMETHODS mpVmm2UserMethods;
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync /** The current network attachment type in the VM.
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync * This doesn't have to match the network attachment type maintained in the
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync * NetworkAdapter. This is needed to change the network attachment
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync * dynamically.
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync */
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync NetworkAttachmentType_T meAttachmentType[SchemaDefs::NetworkAdapterCount];
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync VMMDev * const mVMMDev;
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync AudioSniffer * const mAudioSniffer;
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync enum
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync {
fdb40b7d2efa84fc6f03b7a695cb4b2e035c30c7vboxsync iLedFloppy = 0,
fdb40b7d2efa84fc6f03b7a695cb4b2e035c30c7vboxsync cLedFloppy = 1,
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync iLedIde = iLedFloppy + cLedFloppy,
fdb40b7d2efa84fc6f03b7a695cb4b2e035c30c7vboxsync cLedIde = 4,
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync iLedSata = iLedIde + cLedIde,
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync cLedSata = 30,
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync iLedScsi = iLedSata + cLedSata,
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync cLedScsi = 16,
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync iLedSas = iLedScsi + cLedScsi,
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync cLedSas = 8,
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync cLedStorage = cLedFloppy + cLedIde + cLedSata + cLedScsi + cLedSas
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync };
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync DeviceType_T maStorageDevType[cLedStorage];
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync PPDMLED mapStorageLeds[cLedStorage];
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync PPDMLED mapNetworkLeds[SchemaDefs::NetworkAdapterCount];
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync PPDMLED mapSharedFolderLed;
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync PPDMLED mapUSBLed[2];
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync#if ((defined(RT_OS_LINUX) && !defined(VBOX_WITH_NETFLT)) || defined(RT_OS_FREEBSD))
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync Utf8Str maTAPDeviceName[8];
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync RTFILE maTapFD[8];
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync#endif
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync bool mVMStateChangeCallbackDisabled;
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync /** Local machine state value. */
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync MachineState_T mMachineState;
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync /** Pointer to the progress object of a live cancelable task.
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync *
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync * This is currently only used by Console::Teleport(), but is intended to later
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync * be used by the live snapshot code path as well. Actions like
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync * Console::PowerDown, which automatically cancels out the running snapshot /
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync * teleportion operation, will cancel the teleportation / live snapshot
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync * operation before starting. */
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync ComObjPtr<Progress> mptrCancelableProgress;
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync struct
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync {
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync /** OnMousePointerShapeChange() cache */
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync struct
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync {
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync bool valid;
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync bool visible;
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync bool alpha;
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync uint32_t xHot;
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync uint32_t yHot;
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync uint32_t width;
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync uint32_t height;
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync com::SafeArray<BYTE> shape;
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync }
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync mpsc;
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync /** OnMouseCapabilityChange() cache */
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync struct
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync {
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync bool valid;
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync BOOL supportsAbsolute;
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync BOOL supportsRelative;
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync BOOL needsHostCursor;
9c9db71d639cf066ed41d49629d46d48bff4be2fvboxsync }
44372afb953dc9f1f1ec71943f5f561a607c0307vboxsync mcc;
44372afb953dc9f1f1ec71943f5f561a607c0307vboxsync
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync /** OnKeyboardLedsChange() cache */
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync struct
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync {
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync bool valid;
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync bool numLock;
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync bool capsLock;
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync bool scrollLock;
fdb40b7d2efa84fc6f03b7a695cb4b2e035c30c7vboxsync }
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync klc;
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync void clear()
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync {
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync /* We cannot do memset() on mpsc to avoid cleaning shape's vtable */
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync mpsc.shape.setNull();
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync mpsc.valid = mpsc.visible = mpsc.alpha = false;
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync mpsc.xHot = mpsc.yHot = mpsc.width = mpsc.height = 0;
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync ::memset(&mcc, 0, sizeof mcc);
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync ::memset(&klc, 0, sizeof klc);
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync }
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync }
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync mCallbackData;
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync friend struct VMTask;
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync};
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync#endif // !____H_CONSOLEIMPL
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync/* vi: set tabstop=4 shiftwidth=4 expandtab: */
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync