ConsoleImpl.h revision 0158d474771d8cf8fb0bfbbe297d3f9b74de04cc
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * VBox Console COM Class definition
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * Copyright (C) 2005-2013 Oracle Corporation
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * This file is part of VirtualBox Open Source Edition (OSE), as
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * available from http://www.virtualbox.org. This file is free software;
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * you can redistribute it and/or modify it under the terms of the GNU
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * General Public License (GPL) as published by the Free Software
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * Foundation, in version 2 as it comes in the "COPYING" file of the
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
5b1627536384deb03449347af9c01bd4fc2d271eGarrett D'Amore# include <VBox/HostServices/GuestPropertySvc.h> /* For the property notification callback */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore# include "../src-server/win/VBoxComEvents.h"
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amoretypedef struct VUSBIRHCONFIG *PVUSBIRHCONFIG;
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore///////////////////////////////////////////////////////////////////////////////
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * Checks the availability of the underlying VM device driver corresponding
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * to the COM interface (IKeyboard, IMouse, IDisplay, etc.). When the driver is
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * not available (NULL), sets error info and returns returns E_ACCESSDENIED.
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * The translatable error message is defined in null context.
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * Intended to used only within Console children (i.e. Keyboard, Mouse,
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * Display, etc.).
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * @param drv driver pointer to check (compare it with NULL)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore return setError(E_ACCESSDENIED, tr("The console is not powered up")); \
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore///////////////////////////////////////////////////////////////////////////////
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore/** IConsole implementation class */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT(Console, IConsole)
5b1627536384deb03449347af9c01bd4fc2d271eGarrett D'Amore // public initializers/uninitializers for internal purposes only
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore HRESULT init(IMachine *aMachine, IInternalMachineControl *aControl, LockType_T aLockType);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore // IConsole properties
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore STDMETHOD(COMGETTER(Machine))(IMachine **aMachine);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore STDMETHOD(COMGETTER(State))(MachineState_T *aMachineState);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore STDMETHOD(COMGETTER(Guest))(IGuest **aGuest);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore STDMETHOD(COMGETTER(Keyboard))(IKeyboard **aKeyboard);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore STDMETHOD(COMGETTER(Mouse))(IMouse **aMouse);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore STDMETHOD(COMGETTER(Display))(IDisplay **aDisplay);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore STDMETHOD(COMGETTER(Debugger))(IMachineDebugger **aDebugger);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore STDMETHOD(COMGETTER(USBDevices))(ComSafeArrayOut(IUSBDevice *, aUSBDevices));
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore STDMETHOD(COMGETTER(RemoteUSBDevices))(ComSafeArrayOut(IHostUSBDevice *, aRemoteUSBDevices));
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore STDMETHOD(COMGETTER(VRDEServerInfo))(IVRDEServerInfo **aVRDEServerInfo);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore STDMETHOD(COMGETTER(SharedFolders))(ComSafeArrayOut(ISharedFolder *, aSharedFolders));
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore STDMETHOD(COMGETTER(EventSource)) (IEventSource ** aEventSource);
5b1627536384deb03449347af9c01bd4fc2d271eGarrett D'Amore STDMETHOD(COMGETTER(AttachedPCIDevices))(ComSafeArrayOut(IPCIDeviceAttachment *, aAttachments));
5b1627536384deb03449347af9c01bd4fc2d271eGarrett D'Amore STDMETHOD(COMGETTER(UseHostClipboard))(BOOL *aUseHostClipboard);
5b1627536384deb03449347af9c01bd4fc2d271eGarrett D'Amore STDMETHOD(COMSETTER(UseHostClipboard))(BOOL aUseHostClipboard);
5b1627536384deb03449347af9c01bd4fc2d271eGarrett D'Amore // IConsole methods
5b1627536384deb03449347af9c01bd4fc2d271eGarrett D'Amore STDMETHOD(PowerUpPaused)(IProgress **aProgress);
5b1627536384deb03449347af9c01bd4fc2d271eGarrett D'Amore STDMETHOD(PowerDown)(IProgress **aProgress);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore STDMETHOD(GetPowerButtonHandled)(BOOL *aHandled);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore STDMETHOD(GetGuestEnteredACPIMode)(BOOL *aEntered);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore STDMETHOD(SaveState)(IProgress **aProgress);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore STDMETHOD(AdoptSavedState)(IN_BSTR aSavedStateFile);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore STDMETHOD(DiscardSavedState)(BOOL aRemoveFile);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore STDMETHOD(GetDeviceActivity)(DeviceType_T aDeviceType,
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore STDMETHOD(DetachUSBDevice)(IN_BSTR aId, IUSBDevice **aDevice);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore STDMETHOD(FindUSBDeviceByAddress)(IN_BSTR aAddress, IUSBDevice **aDevice);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore STDMETHOD(FindUSBDeviceById)(IN_BSTR aId, IUSBDevice **aDevice);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore STDMETHOD(CreateSharedFolder)(IN_BSTR aName, IN_BSTR aHostPath, BOOL aWritable, BOOL aAutoMount);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore STDMETHOD(RemoveSharedFolder)(IN_BSTR aName);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore STDMETHOD(TakeSnapshot)(IN_BSTR aName, IN_BSTR aDescription,
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore STDMETHOD(DeleteSnapshot)(IN_BSTR aId, IProgress **aProgress);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore STDMETHOD(DeleteSnapshotAndAllChildren)(IN_BSTR aId, IProgress **aProgress);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore STDMETHOD(DeleteSnapshotRange)(IN_BSTR aStartId, IN_BSTR aEndId, IProgress **aProgress);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore STDMETHOD(RestoreSnapshot)(ISnapshot *aSnapshot, IProgress **aProgress);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore STDMETHOD(Teleport)(IN_BSTR aHostname, ULONG aPort, IN_BSTR aPassword, ULONG aMaxDowntime, IProgress **aProgress);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore // public methods for internal purposes only
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * Note: the following methods do not increase refcount. intended to be
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * called only by the VM execution thread.
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore Keyboard *getKeyboard() const { return mKeyboard; }
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore Display *getDisplay() const { return mDisplay; }
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore MachineDebugger *getMachineDebugger() const { return mDebugger; }
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore AudioSniffer *getAudioSniffer() const { return mAudioSniffer; }
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore const ComPtr<IMachine> &machine() const { return mMachine; }
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore bool useHostClipboard() { return mfUseHostClipboard; }
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore /** Method is called only from ConsoleVRDPServer */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore IVRDEServer *getVRDEServer() const { return mVRDEServer; }
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore ConsoleVRDPServer *consoleVRDPServer() const { return mConsoleVRDPServer; }
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore HRESULT updateMachineState(MachineState_T aMachineState);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore // events from IInternalSessionControl
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore HRESULT onNetworkAdapterChange(INetworkAdapter *aNetworkAdapter, BOOL changeAdapter);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore HRESULT onSerialPortChange(ISerialPort *aSerialPort);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore HRESULT onParallelPortChange(IParallelPort *aParallelPort);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore HRESULT onMediumChange(IMediumAttachment *aMediumAttachment, BOOL aForce);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore HRESULT onCPUChange(ULONG aCPU, BOOL aRemove);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore HRESULT onCPUExecutionCapChange(ULONG aExecutionCap);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore HRESULT onClipboardModeChange(ClipboardMode_T aClipboardMode);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore HRESULT onDragAndDropModeChange(DragAndDropMode_T aDragAndDropMode);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore HRESULT onUSBDeviceAttach(IUSBDevice *aDevice, IVirtualBoxErrorInfo *aError, ULONG aMaskedIfs);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore HRESULT onUSBDeviceDetach(IN_BSTR aId, IVirtualBoxErrorInfo *aError);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore HRESULT onBandwidthGroupChange(IBandwidthGroup *aBandwidthGroup);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore HRESULT onStorageDeviceChange(IMediumAttachment *aMediumAttachment, BOOL aRemove, BOOL aSilent);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore HRESULT getGuestProperty(IN_BSTR aKey, BSTR *aValue, LONG64 *aTimestamp, BSTR *aFlags);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore HRESULT setGuestProperty(IN_BSTR aKey, IN_BSTR aValue, IN_BSTR aFlags);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore HRESULT enumerateGuestProperties(IN_BSTR aPatterns,
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore HRESULT onlineMergeMedium(IMediumAttachment *aMediumAttachment,
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore BOOL aMergeForward, IMedium *aParentForTarget,
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore ComSafeArrayIn(IMedium *, aChildrenToReparent),
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore AudioSniffer *getAudioSniffer() { return mAudioSniffer; }
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore EventSource *getEventSource() { return mEventSource; }
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore UsbCardReader *getUsbCardReader() { return mUsbCardReader; }
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore EmWebcam *getEmWebcam() { return mEmWebcam; }
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int VRDPClientLogon(uint32_t u32ClientId, const char *pszUser, const char *pszPassword, const char *pszDomain);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore void VRDPClientStatusChange(uint32_t u32ClientId, const char *pszStatus);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore void VRDPClientConnect(uint32_t u32ClientId);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore void VRDPClientDisconnect(uint32_t u32ClientId, uint32_t fu32Intercepted);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore void VRDPInterceptAudio(uint32_t u32ClientId);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore void VRDPInterceptUSB(uint32_t u32ClientId, void **ppvIntercept);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore void VRDPInterceptClipboard(uint32_t u32ClientId);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore void processRemoteUSBDevices(uint32_t u32ClientId, VRDEUSBDEVICEDESC *pDevList, uint32_t cbDevList, bool fDescExt);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore void reportVmStatistics(ULONG aValidStats, ULONG aCpuUser,
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore mControl->ReportVmStatistics(aValidStats, aCpuUser, aCpuKernel, aCpuIdle,
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore aMemTotal, aMemFree, aMemBalloon, aMemShared,
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore aBalloonedVMM, aSharedVMM, aVmNetRx, aVmNetTx);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore HRESULT saveState(Reason_T aReason, IProgress **aProgress);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore // callback callers (partly; for some events console callbacks are notified
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore // directly from IInternalSessionControl event handlers declared above)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore void onMousePointerShapeChange(bool fVisible, bool fAlpha,
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore void onMouseCapabilityChange(BOOL supportsAbsolute, BOOL supportsRelative, BOOL needsHostCursor);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore void onStateChange(MachineState_T aMachineState);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore void onKeyboardLedsChange(bool fNumLock, bool fCapsLock, bool fScrollLock);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore void onUSBDeviceStateChange(IUSBDevice *aDevice, bool aAttached,
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore void onRuntimeError(BOOL aFatal, IN_BSTR aErrorID, IN_BSTR aMessage);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore HRESULT onShowWindow(BOOL aCheck, BOOL *aCanShow, LONG64 *aWinId);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore static HRESULT setErrorStatic(HRESULT aResultCode, const char *pcsz, ...);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore static const char *convertControllerTypeToDev(StorageControllerType_T enmCtrlType);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore static HRESULT convertBusPortDeviceToLun(StorageBus_T enmBus, LONG port, LONG device, unsigned &uLun);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore // Called from event listener
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore HRESULT onNATRedirectRuleChange(ULONG ulInstance, BOOL aNatRuleRemove,
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore NATProtocol_T aProto, IN_BSTR aHostIp, LONG aHostPort, IN_BSTR aGuestIp, LONG aGuestPort);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * Base template for AutoVMCaller and SafeVMPtr. Template arguments
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * have the same meaning as arguments of Console::addVMCaller().
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore template <bool taQuiet = false, bool taAllowNullVM = false>
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore AutoVMCallerBase(Console *aThat) : mThat(aThat), mRC(S_OK)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore mRC = aThat->addVMCaller(taQuiet, taAllowNullVM);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore /** Decreases the number of callers before the instance is destroyed. */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore /** Restores the number of callers after by #release(). #rc() must be
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * rechecked to ensure the operation succeeded. */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore mRC = mThat->addVMCaller(taQuiet, taAllowNullVM);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore /** Returns the result of Console::addVMCaller() */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore /** Shortcut to SUCCEEDED(rc()) */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore bool isOk() const { return SUCCEEDED(mRC); }
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore DECLARE_CLS_COPY_CTOR_ASSIGN_NOOP(AutoVMCallerBase)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * Helper class that protects sections of code using the mpUVM pointer by
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * automatically calling addVMCaller() on construction and
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * releaseVMCaller() on destruction. Intended for Console methods dealing
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * with mpUVM. The usage pattern is:
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * AutoVMCaller autoVMCaller(this);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * if (FAILED(autoVMCaller.rc())) return autoVMCaller.rc();
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * VMR3ReqCall (mpUVM, ...
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * @note Temporarily locks the argument for writing.
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * @sa SafeVMPtr, SafeVMPtrQuiet
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * @obsolete Use SafeVMPtr
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore typedef AutoVMCallerBase<false, false> AutoVMCaller;
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * Same as AutoVMCaller but doesn't set extended error info on failure.
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * @note Temporarily locks the argument for writing.
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * @obsolete Use SafeVMPtrQuiet
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore typedef AutoVMCallerBase<true, false> AutoVMCallerQuiet;
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * Same as AutoVMCaller but allows a null VM pointer (to trigger an error
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * instead of assertion).
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * @note Temporarily locks the argument for writing.
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * @obsolete Use SafeVMPtr
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore typedef AutoVMCallerBase<false, true> AutoVMCallerWeak;
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * Same as AutoVMCaller but doesn't set extended error info on failure
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * and allows a null VM pointer (to trigger an error instead of
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * assertion).
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * @note Temporarily locks the argument for writing.
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * @obsolete Use SafeVMPtrQuiet
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore typedef AutoVMCallerBase<true, true> AutoVMCallerQuietWeak;
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * Base template for SafeVMPtr and SafeVMPtrQuiet.
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore class SafeVMPtrBase : public AutoVMCallerBase<taQuiet, true>
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore typedef AutoVMCallerBase<taQuiet, true> Base;
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore SafeVMPtrBase(Console *aThat) : Base(aThat), mpUVM(NULL)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore Base::mRC = aThat->safeVMPtrRetainer(&mpUVM, taQuiet);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore /** Direct PUVM access. */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore /** Release the handles. */
5b1627536384deb03449347af9c01bd4fc2d271eGarrett D'Amore DECLARE_CLS_COPY_CTOR_ASSIGN_NOOP(SafeVMPtrBase)
5b1627536384deb03449347af9c01bd4fc2d271eGarrett D'Amore * Helper class that safely manages the Console::mpUVM pointer
5b1627536384deb03449347af9c01bd4fc2d271eGarrett D'Amore * by calling addVMCaller() on construction and releaseVMCaller() on
5b1627536384deb03449347af9c01bd4fc2d271eGarrett D'Amore * destruction. Intended for Console children. The usage pattern is:
5b1627536384deb03449347af9c01bd4fc2d271eGarrett D'Amore * Console::SafeVMPtr ptrVM(mParent);
5b1627536384deb03449347af9c01bd4fc2d271eGarrett D'Amore * if (!ptrVM.isOk())
5b1627536384deb03449347af9c01bd4fc2d271eGarrett D'Amore * return ptrVM.rc();
5b1627536384deb03449347af9c01bd4fc2d271eGarrett D'Amore * VMR3ReqCall(ptrVM.rawUVM(), ...
5b1627536384deb03449347af9c01bd4fc2d271eGarrett D'Amore * printf("%p\n", ptrVM.rawUVM());
5b1627536384deb03449347af9c01bd4fc2d271eGarrett D'Amore * @note Temporarily locks the argument for writing.
5b1627536384deb03449347af9c01bd4fc2d271eGarrett D'Amore * @sa SafeVMPtrQuiet, AutoVMCaller
5b1627536384deb03449347af9c01bd4fc2d271eGarrett D'Amore * A deviation of SafeVMPtr that doesn't set the error info on failure.
5b1627536384deb03449347af9c01bd4fc2d271eGarrett D'Amore * Intended for pieces of code that don't need to return the VM access
5b1627536384deb03449347af9c01bd4fc2d271eGarrett D'Amore * failure to the caller. The usage pattern is:
5b1627536384deb03449347af9c01bd4fc2d271eGarrett D'Amore * Console::SafeVMPtrQuiet pVM(mParent);
5b1627536384deb03449347af9c01bd4fc2d271eGarrett D'Amore * if (pVM.rc())
5b1627536384deb03449347af9c01bd4fc2d271eGarrett D'Amore * VMR3ReqCall(pVM, ...
5b1627536384deb03449347af9c01bd4fc2d271eGarrett D'Amore * return S_OK;
5b1627536384deb03449347af9c01bd4fc2d271eGarrett D'Amore * @note Temporarily locks the argument for writing.
5b1627536384deb03449347af9c01bd4fc2d271eGarrett D'Amore * @sa SafeVMPtr, AutoVMCaller
5b1627536384deb03449347af9c01bd4fc2d271eGarrett D'Amore // copy constructor
5b1627536384deb03449347af9c01bd4fc2d271eGarrett D'Amore SharedFolderData(const SharedFolderData& aThat)
5b1627536384deb03449347af9c01bd4fc2d271eGarrett D'Amore typedef std::map<Utf8Str, ComObjPtr<SharedFolder> > SharedFolderMap;
5b1627536384deb03449347af9c01bd4fc2d271eGarrett D'Amore typedef std::map<Utf8Str, SharedFolderData> SharedFolderDataMap;
5b1627536384deb03449347af9c01bd4fc2d271eGarrett D'Amore typedef std::map<Utf8Str, ComPtr<IMediumAttachment> > MediumAttachmentMap;
5b1627536384deb03449347af9c01bd4fc2d271eGarrett D'Amore typedef std::list <ComObjPtr<OUSBDevice> > USBDeviceList;
5b1627536384deb03449347af9c01bd4fc2d271eGarrett D'Amore typedef std::list <ComObjPtr<RemoteUSBDevice> > RemoteUSBDeviceList;
5b1627536384deb03449347af9c01bd4fc2d271eGarrett D'Amore HRESULT addVMCaller(bool aQuiet = false, bool aAllowNullVM = false);
5b1627536384deb03449347af9c01bd4fc2d271eGarrett D'Amore HRESULT safeVMPtrRetainer(PUVM *a_ppUVM, bool aQuiet);
5b1627536384deb03449347af9c01bd4fc2d271eGarrett D'Amore HRESULT consoleInitReleaseLog(const ComPtr<IMachine> aMachine);
5b1627536384deb03449347af9c01bd4fc2d271eGarrett D'Amore HRESULT powerUp(IProgress **aProgress, bool aPaused);
5b1627536384deb03449347af9c01bd4fc2d271eGarrett D'Amore HRESULT powerDown(IProgress *aProgress = NULL);
5b1627536384deb03449347af9c01bd4fc2d271eGarrett D'Amore/* Note: FreeBSD needs this whether netflt is used or not. */
5b1627536384deb03449347af9c01bd4fc2d271eGarrett D'Amore#if ((defined(RT_OS_LINUX) && !defined(VBOX_WITH_NETFLT)) || defined(RT_OS_FREEBSD))
5b1627536384deb03449347af9c01bd4fc2d271eGarrett D'Amore HRESULT attachToTapInterface(INetworkAdapter *networkAdapter);
5b1627536384deb03449347af9c01bd4fc2d271eGarrett D'Amore HRESULT detachFromTapInterface(INetworkAdapter *networkAdapter);
5b1627536384deb03449347af9c01bd4fc2d271eGarrett D'Amore HRESULT setMachineState(MachineState_T aMachineState, bool aUpdateServer = true);
5b1627536384deb03449347af9c01bd4fc2d271eGarrett D'Amore HRESULT setMachineStateLocally(MachineState_T aMachineState)
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore return setMachineState(aMachineState, false /* aUpdateServer */);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore HRESULT findSharedFolder(const Utf8Str &strName,
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore bool aSetError = false);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore bool findOtherSharedFolder(const Utf8Str &straName,
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore HRESULT createSharedFolder(const Utf8Str &strName, const SharedFolderData &aData);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore HRESULT removeSharedFolder(const Utf8Str &strName);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore static DECLCALLBACK(int) configConstructor(PUVM pUVM, PVM pVM, void *pvConsole);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int configConstructorInner(PUVM pUVM, PVM pVM, AutoWriteLock *pAlock);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int configCfgmOverlay(PCFGMNODE pRoot, IVirtualBox *pVirtualBox, IMachine *pMachine);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int configDumpAPISettingsTweaks(IVirtualBox *pVirtualBox, IMachine *pMachine);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int configGraphicsController(PCFGMNODE pDevices, const char *pcszDevice,
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int configMediumAttachment(PCFGMNODE pCtlInst,
68c47f65208790c466e5e484f2293d3baed71c6aGarrett D'Amore static DECLCALLBACK(int) reconfigureMediumAttachment(Console *pConsole,
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore static DECLCALLBACK(int) changeRemovableMedium(Console *pThis,
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore HRESULT attachRawPCIDevices(PUVM pUVM, BusAssignmentManager *BusMgr, PCFGMNODE pDevices);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore void attachStatusDriver(PCFGMNODE pCtlInst, PPDMLED *papLeds,
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore Console::MediumAttachmentMap *pmapMediumAttachments,
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore const char *pcszDevice, unsigned uInstance);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int configNetwork(const char *pszDevice, unsigned uInstance, unsigned uLun,
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore INetworkAdapter *aNetworkAdapter, PCFGMNODE pCfg,
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore bool fAttachDetach, bool fIgnoreConnectFailure);
5b1627536384deb03449347af9c01bd4fc2d271eGarrett D'Amore static DECLCALLBACK(int) configGuestProperties(void *pvConsole, PUVM pUVM);
68c47f65208790c466e5e484f2293d3baed71c6aGarrett D'Amore static DECLCALLBACK(int) configGuestControl(void *pvConsole);
68c47f65208790c466e5e484f2293d3baed71c6aGarrett D'Amore static DECLCALLBACK(void) vmstateChangeCallback(PUVM pUVM, VMSTATE enmState, VMSTATE enmOldState, void *pvUser);
5b1627536384deb03449347af9c01bd4fc2d271eGarrett D'Amore static DECLCALLBACK(int) unplugCpu(Console *pThis, PUVM pUVM, VMCPUID idCpu);
5b1627536384deb03449347af9c01bd4fc2d271eGarrett D'Amore static DECLCALLBACK(int) plugCpu(Console *pThis, PUVM pUVM, VMCPUID idCpu);
5b1627536384deb03449347af9c01bd4fc2d271eGarrett D'Amore HRESULT doMediumChange(IMediumAttachment *aMediumAttachment, bool fForce, PUVM pUVM);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore HRESULT doNetworkAdapterChange(PUVM pUVM, const char *pszDevice, unsigned uInstance,
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore unsigned uLun, INetworkAdapter *aNetworkAdapter);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore static DECLCALLBACK(int) changeNetworkAttachment(Console *pThis, PUVM pUVM, const char *pszDevice,
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore void changeClipboardMode(ClipboardMode_T aClipboardMode);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore void changeDragAndDropMode(DragAndDropMode_T aDragAndDropMode);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore HRESULT attachUSBDevice(IUSBDevice *aHostDevice, ULONG aMaskedIfs);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore HRESULT detachUSBDevice(const ComObjPtr<OUSBDevice> &aHostDevice);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore static DECLCALLBACK(int) usbAttachCallback(Console *that, PUVM pUVM, IUSBDevice *aHostDevice, PCRTUUID aUuid,
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore bool aRemote, const char *aAddress, void *pvRemoteBackend, USHORT aPortVersion, ULONG aMaskedIfs);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore static DECLCALLBACK(int) usbDetachCallback(Console *that, PUVM pUVM, PCRTUUID aUuid);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore static DECLCALLBACK(int) attachStorageDevice(Console *pThis,
68c47f65208790c466e5e484f2293d3baed71c6aGarrett D'Amore static DECLCALLBACK(int) detachStorageDevice(Console *pThis,
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore HRESULT doStorageDeviceAttach(IMediumAttachment *aMediumAttachment, PUVM pUVM, bool fSilent);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore HRESULT doStorageDeviceDetach(IMediumAttachment *aMediumAttachment, PUVM pUVM, bool fSilent);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore static DECLCALLBACK(int) fntTakeSnapshotWorker(RTTHREAD Thread, void *pvUser);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore static DECLCALLBACK(int) stateProgressCallback(PUVM pUVM, unsigned uPercent, void *pvUser);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore static DECLCALLBACK(void) genericVMSetErrorCallback(PUVM pUVM, void *pvUser, int rc, RT_SRC_POS_DECL,
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore void setVMRuntimeErrorCallbackF(uint32_t fFatal, const char *pszErrorId, const char *pszFormat, ...);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore static DECLCALLBACK(void) setVMRuntimeErrorCallback(PUVM pUVM, void *pvUser, uint32_t fFatal,
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore const char *pszErrorId, const char *pszFormat, va_list va);
68c47f65208790c466e5e484f2293d3baed71c6aGarrett D'Amore static DECLCALLBACK(int) powerUpThread(RTTHREAD Thread, void *pvUser);
68c47f65208790c466e5e484f2293d3baed71c6aGarrett D'Amore static DECLCALLBACK(int) saveStateThread(RTTHREAD Thread, void *pvUser);
68c47f65208790c466e5e484f2293d3baed71c6aGarrett D'Amore static DECLCALLBACK(int) powerDownThread(RTTHREAD Thread, void *pvUser);
68c47f65208790c466e5e484f2293d3baed71c6aGarrett D'Amore static DECLCALLBACK(int) vmm2User_SaveState(PCVMM2USERMETHODS pThis, PUVM pUVM);
68c47f65208790c466e5e484f2293d3baed71c6aGarrett D'Amore static DECLCALLBACK(void) vmm2User_NotifyEmtInit(PCVMM2USERMETHODS pThis, PUVM pUVM, PUVMCPU pUVCpu);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore static DECLCALLBACK(void) vmm2User_NotifyEmtTerm(PCVMM2USERMETHODS pThis, PUVM pUVM, PUVMCPU pUVCpu);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore static DECLCALLBACK(void) vmm2User_NotifyPdmtInit(PCVMM2USERMETHODS pThis, PUVM pUVM);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore static DECLCALLBACK(void) vmm2User_NotifyPdmtTerm(PCVMM2USERMETHODS pThis, PUVM pUVM);
68c47f65208790c466e5e484f2293d3baed71c6aGarrett D'Amore static DECLCALLBACK(void *) drvStatus_QueryInterface(PPDMIBASE pInterface, const char *pszIID);
68c47f65208790c466e5e484f2293d3baed71c6aGarrett D'Amore static DECLCALLBACK(void) drvStatus_UnitChanged(PPDMILEDCONNECTORS pInterface, unsigned iLUN);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore static DECLCALLBACK(int) drvStatus_MediumEjected(PPDMIMEDIANOTIFY pInterface, unsigned iLUN);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore static DECLCALLBACK(void) drvStatus_Destruct(PPDMDRVINS pDrvIns);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore static DECLCALLBACK(int) drvStatus_Construct(PPDMDRVINS pDrvIns, PCFGMNODE pCfg, uint32_t fFlags);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore uint32_t mu32SingleRDPClientId; /* The id of a connected client in the single connection mode. */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore static const char *sSSMConsoleUnit;
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore int loadStateFileExecInternal(PSSMHANDLE pSSM, uint32_t u32Version);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore static DECLCALLBACK(void) saveStateFileExec(PSSMHANDLE pSSM, void *pvUser);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore static DECLCALLBACK(int) loadStateFileExec(PSSMHANDLE pSSM, void *pvUser, uint32_t uVersion, uint32_t uPass);
68c47f65208790c466e5e484f2293d3baed71c6aGarrett D'Amore static DECLCALLBACK(int) doGuestPropNotification(void *pvExtension, uint32_t, void *pvParms, uint32_t cbParms);
5b1627536384deb03449347af9c01bd4fc2d271eGarrett D'Amore HRESULT doEnumerateGuestProperties(CBSTR aPatterns,
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore void guestPropertiesVRDPUpdateLogon(uint32_t u32ClientId, const char *pszUser, const char *pszDomain);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore void guestPropertiesVRDPUpdateActiveClient(uint32_t u32ClientId);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore void guestPropertiesVRDPUpdateClientAttach(uint32_t u32ClientId, bool fAttached);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore void guestPropertiesVRDPUpdateNameChange(uint32_t u32ClientId, const char *pszName);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore void guestPropertiesVRDPUpdateIPAddrChange(uint32_t u32ClientId, const char *pszIPAddr);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore void guestPropertiesVRDPUpdateLocationChange(uint32_t u32ClientId, const char *pszLocation);
5b1627536384deb03449347af9c01bd4fc2d271eGarrett D'Amore void guestPropertiesVRDPUpdateOtherInfoChange(uint32_t u32ClientId, const char *pszOtherInfo);
5b1627536384deb03449347af9c01bd4fc2d271eGarrett D'Amore void guestPropertiesVRDPUpdateDisconnect(uint32_t u32ClientId);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore /** @name Teleporter support
68c47f65208790c466e5e484f2293d3baed71c6aGarrett D'Amore static DECLCALLBACK(int) teleporterSrcThreadWrapper(RTTHREAD hThread, void *pvUser);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore HRESULT teleporterSrc(TeleporterStateSrc *pState);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore HRESULT teleporterSrcReadACK(TeleporterStateSrc *pState, const char *pszWhich, const char *pszNAckMsg = NULL);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore HRESULT teleporterSrcSubmitCommand(TeleporterStateSrc *pState, const char *pszCommand, bool fWaitForAck = true);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore HRESULT teleporterTrg(PUVM pUVM, IMachine *pMachine, Utf8Str *pErrorMsg, bool fStartPaused,
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore Progress *pProgress, bool *pfPowerOffOnFailure);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore static DECLCALLBACK(int) teleporterTrgServeConnection(RTSOCKET Sock, void *pvUser);
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore const ComPtr<IInternalMachineControl> mControl;
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore ConsoleVRDPServer * const mConsoleVRDPServer;
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore const ComObjPtr<VRDEServerInfo> mVRDEServerInfo;
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore /** This can safely be used without holding any locks.
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * An AutoCaller suffices to prevent it being destroy while in use and
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * internally there is a lock providing the necessary serialization. */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore const ComObjPtr<ExtPackManager> mptrExtPackManager;
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore SharedFolderDataMap m_mapGlobalSharedFolders;
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore SharedFolderDataMap m_mapMachineSharedFolders;
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore SharedFolderMap m_mapSharedFolders; // the console instances
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore /** The user mode VM handle. */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore /** Holds the number of "readonly" mpUVM callers (users). */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore /** Semaphore posted when the number of mpUVM callers drops to zero. */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore /** true when Console has entered the mpUVM destruction phase. */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore /** true when power down is initiated by vmstateChangeCallback (EMT). */
f9ead4a57883f3ef04ef20d83cc47987d98c0687Garrett D'Amore /** true when vmstateChangeCallback shouldn't initiate a power down. */
f9ead4a57883f3ef04ef20d83cc47987d98c0687Garrett D'Amore /** true if we already showed the snapshot folder size warning. */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore /** true if we already showed the snapshot folder ext4/xfs bug warning. */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore /** true if we already listed the disk type of the snapshot folder. */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore /** Pointer to the VMM -> User (that's us) callbacks. */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore struct MYVMM2USERMETHODS : public VMM2USERMETHODS
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore /** The current network attachment type in the VM.
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * This doesn't have to match the network attachment type maintained in the
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * NetworkAdapter. This is needed to change the network attachment
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * dynamically.
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore typedef std::vector<NetworkAttachmentType_T> NetworkAttachmentTypeVector;
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore NetworkAttachmentTypeVector meAttachmentType;
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore cLedStorage = cLedFloppy + cLedIde + cLedSata + cLedScsi + cLedSas
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore PPDMLED mapNetworkLeds[36]; /**< @todo adapt this to the maximum network card count */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore/* Note: FreeBSD needs this whether netflt is used or not. */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#if ((defined(RT_OS_LINUX) && !defined(VBOX_WITH_NETFLT)) || defined(RT_OS_FREEBSD))
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore /** Local machine state value. */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore /** Pointer to the progress object of a live cancelable task.
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * This is currently only used by Console::Teleport(), but is intended to later
505c7a699305ccafcfecc1ab0e7d4a25e2bfd1c2Garrett D'Amore * be used by the live snapshot code path as well. Actions like
505c7a699305ccafcfecc1ab0e7d4a25e2bfd1c2Garrett D'Amore * Console::PowerDown, which automatically cancels out the running snapshot /
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * teleportation operation, will cancel the teleportation / live snapshot
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore * operation before starting. */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore /* The purpose of caching of some events is probably in order to
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore automatically fire them at new event listeners. However, there is no
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore (longer?) any code making use of this... */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore /** OnMousePointerShapeChange() cache */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore /** OnMouseCapabilityChange() cache */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore /** OnKeyboardLedsChange() cache */
5b1627536384deb03449347af9c01bd4fc2d271eGarrett D'Amore /* We cannot RT_ZERO mpsc because of shape's vtable. */
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore mpsc.valid = mpsc.visible = mpsc.alpha = false;
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore mpsc.xHot = mpsc.yHot = mpsc.width = mpsc.height = 0;
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore#endif // !____H_CONSOLEIMPL
88447a05f537aabe9a1bc3d5313f22581ec992a7Garrett D'Amore/* vi: set tabstop=4 shiftwidth=4 expandtab: */