From a4868f8d1d6b152caacbc08a2ca9aef3e8812801 Mon Sep 17 00:00:00 2001 From: Christian Prochaska Date: Mon, 4 May 2015 11:36:45 +0200 Subject: [PATCH] vbox: use interface declarations from 'VirtualBox_XPCOM.h' Fixes #1499 --- repos/ports/lib/mk/virtualbox-common.inc | 8 + repos/ports/lib/mk/virtualbox-main.mk | 8 +- repos/ports/ports/virtualbox.hash | 2 +- repos/ports/ports/virtualbox.port | 25 +- .../src/virtualbox/frontend/ClientToken.h | 19 - .../src/virtualbox/frontend/GenodeImpl.h | 285 +------- .../virtualbox/frontend/MediumFormatWrap.h | 10 - .../ports/src/virtualbox/frontend/TokenWrap.h | 22 - .../frontend/VBoxAPIWrap/MediumFormatWrap.cpp | 210 ++++++ .../frontend/VBoxAPIWrap/MediumFormatWrap.h | 77 ++ .../frontend/VBoxAPIWrap/TokenWrap.cpp | 100 +++ .../frontend/VBoxAPIWrap/TokenWrap.h | 61 ++ .../src/virtualbox/frontend/VBoxEvents.h | 41 ++ .../src/virtualbox/frontend/VirtualBoxBase.h | 56 +- .../frontend/VirtualBoxErrorInfoImpl.cpp | 6 + .../frontend/VirtualBoxErrorInfoImpl.h | 49 ++ .../src/virtualbox/frontend/VirtualBoxImpl.h | 0 .../ports/src/virtualbox/frontend/console.cc | 248 +++++-- repos/ports/src/virtualbox/frontend/console.h | 159 +---- .../virtualbox/frontend/dummy/autostart.cc | 20 +- .../virtualbox/frontend/dummy/errorinfo.cc | 21 +- .../src/virtualbox/frontend/dummy/host.cc | 22 +- .../src/virtualbox/frontend/dummy/macros.h | 35 + .../src/virtualbox/frontend/dummy/rest.cc | 396 ++++++----- .../frontend/dummy/virtualboxbase.cc | 27 +- repos/ports/src/virtualbox/frontend/fb.h | 13 +- repos/ports/src/virtualbox/frontend/main.cc | 31 +- .../VBox/HostServices/VBoxClipboardSvc.h | 6 + .../virtualbox/include/VBox/com/VirtualBox.h | 5 + .../src/virtualbox/include/VBox/com/com.h | 3 - .../src/virtualbox/include/VBox/com/defs.h | 667 ++---------------- .../src/virtualbox/include/VBox/com/ptr.h | 45 +- .../src/virtualbox/include/VBox/intnet.h | 12 + .../src/virtualbox/include/xpcom/nsError.h | 38 + .../ports/src/virtualbox/include/xpcom/nsID.h | 14 + .../virtualbox/include/xpcom/nsIException.h | 10 + .../virtualbox/include/xpcom/nsISupports.h | 23 + .../include/xpcom/nsISupportsImpl.h | 14 + .../{frontend => include/xpcom}/nsMemory.h | 2 - .../src/virtualbox/include/xpcom/nscore.h | 13 + .../src/virtualbox/include/xpcom/prtypes.h | 14 + .../src/virtualbox/patches/acpi_drv.patch | 7 +- .../src/virtualbox/patches/avoid_yield.patch | 56 +- .../src/virtualbox/patches/dev_e1000.patch | 9 +- .../src/virtualbox/patches/eminternal.patch | 12 +- .../ports/src/virtualbox/patches/iconv.patch | 9 +- .../ports/src/virtualbox/patches/mouse.patch | 15 +- .../src/virtualbox/patches/network.patch | 40 +- .../src/virtualbox/patches/pdm_driver.patch | 9 +- repos/ports/src/virtualbox/patches/poke.patch | 7 +- .../src/virtualbox/patches/rem_irq.patch | 11 +- .../ports/src/virtualbox/patches/serial.patch | 9 +- repos/ports/src/virtualbox/patches/series | 21 + .../patches/sharedfolder_pagelist.patch | 15 +- .../patches/time-log-deadlock.patch | 9 +- .../src/virtualbox/patches/tm_retries.patch | 27 +- repos/ports/src/virtualbox/patches/usb.patch | 226 +++--- .../src/virtualbox/patches/vbox_inc.patch | 87 +-- .../src/virtualbox/patches/vbox_main.patch | 552 ++++++++------- .../ports/src/virtualbox/patches/vga_fb.patch | 9 +- .../src/virtualbox/patches/vga_vbva.patch | 11 +- repos/ports/src/virtualbox/patches/vmdk.patch | 15 +- .../ports/src/virtualbox/patches/vmmdev.patch | 20 +- repos/ports/src/virtualbox/target.mk | 6 + 64 files changed, 2005 insertions(+), 1994 deletions(-) delete mode 100644 repos/ports/src/virtualbox/frontend/ClientToken.h delete mode 100644 repos/ports/src/virtualbox/frontend/MediumFormatWrap.h delete mode 100644 repos/ports/src/virtualbox/frontend/TokenWrap.h create mode 100644 repos/ports/src/virtualbox/frontend/VBoxAPIWrap/MediumFormatWrap.cpp create mode 100644 repos/ports/src/virtualbox/frontend/VBoxAPIWrap/MediumFormatWrap.h create mode 100644 repos/ports/src/virtualbox/frontend/VBoxAPIWrap/TokenWrap.cpp create mode 100644 repos/ports/src/virtualbox/frontend/VBoxAPIWrap/TokenWrap.h create mode 100644 repos/ports/src/virtualbox/frontend/VirtualBoxErrorInfoImpl.cpp delete mode 100644 repos/ports/src/virtualbox/frontend/VirtualBoxImpl.h create mode 100644 repos/ports/src/virtualbox/frontend/dummy/macros.h create mode 100644 repos/ports/src/virtualbox/include/xpcom/nsError.h create mode 100644 repos/ports/src/virtualbox/include/xpcom/nsID.h create mode 100644 repos/ports/src/virtualbox/include/xpcom/nsIException.h create mode 100644 repos/ports/src/virtualbox/include/xpcom/nsISupports.h create mode 100644 repos/ports/src/virtualbox/include/xpcom/nsISupportsImpl.h rename repos/ports/src/virtualbox/{frontend => include/xpcom}/nsMemory.h (93%) create mode 100644 repos/ports/src/virtualbox/include/xpcom/nscore.h create mode 100644 repos/ports/src/virtualbox/include/xpcom/prtypes.h create mode 100644 repos/ports/src/virtualbox/patches/series diff --git a/repos/ports/lib/mk/virtualbox-common.inc b/repos/ports/lib/mk/virtualbox-common.inc index 6c5302fdee..c30d89fe89 100644 --- a/repos/ports/lib/mk/virtualbox-common.inc +++ b/repos/ports/lib/mk/virtualbox-common.inc @@ -11,6 +11,8 @@ REQUIRES += installation_of_iasl endif VIRTUALBOX_DIR = $(call select_from_ports,virtualbox)/src/app/virtualbox +VIRTUALBOX_SDK_DIR = $(call select_from_ports,virtualbox)/src/app/virtualbox_sdk + VBOX_DIR = $(VIRTUALBOX_DIR)/src/VBox VBOX_CC_OPT += -DIN_RING3 -DVBOX -DVBOX_OSE \ @@ -67,10 +69,16 @@ CC_WARN += -Wno-trigraphs CC_OPT += $(VBOX_CC_OPT) +# VirtualBox expects wchar_t to be a 16-bit type. yasm does not understand this +# flag, therefore it gets added to CC_OPT instead of VBOX_CC_OPT. +CC_OPT += -fshort-wchar + LIBS += libc libm INC_DIR += $(REP_DIR)/src/virtualbox/include +INC_DIR += $(REP_DIR)/src/virtualbox/include/xpcom INC_DIR += $(VIRTUALBOX_DIR)/include +INC_DIR += $(VIRTUALBOX_SDK_DIR)/sdk/bindings/xpcom/include INC_DIR += $(VBOX_DIR)/Devices/build vpath %.cpp $(VBOX_DIR) diff --git a/repos/ports/lib/mk/virtualbox-main.mk b/repos/ports/lib/mk/virtualbox-main.mk index 16aff043ce..e3ce46d34a 100644 --- a/repos/ports/lib/mk/virtualbox-main.mk +++ b/repos/ports/lib/mk/virtualbox-main.mk @@ -1,6 +1,6 @@ include $(REP_DIR)/lib/mk/virtualbox-common.inc -VBOX_CC_OPT += -DVBOX_COM_INPROC_API_CLIENT +VBOX_CC_OPT += -DVBOX_WITH_GENERIC_SESSION_WATCHER LIBS += stdcxx @@ -35,10 +35,12 @@ SRC_CC += Main/src-server/AudioAdapterImpl.cpp SRC_CC += Main/src-server/BandwidthControlImpl.cpp SRC_CC += Main/src-server/BandwidthGroupImpl.cpp SRC_CC += Main/src-server/BIOSSettingsImpl.cpp +SRC_CC += Main/src-server/ClientToken.cpp SRC_CC += Main/src-server/DHCPServerImpl.cpp SRC_CC += Main/src-server/GuestOSTypeImpl.cpp SRC_CC += Main/src-server/MachineImpl.cpp SRC_CC += Main/src-server/MachineImplCloneVM.cpp +SRC_CC += Main/src-server/Matching.cpp SRC_CC += Main/src-server/MediumAttachmentImpl.cpp SRC_CC += Main/src-server/MediumImpl.cpp SRC_CC += Main/src-server/MediumFormatImpl.cpp @@ -66,3 +68,7 @@ SRC_CC += Main/glue/xpcom/helpers.cpp INC_DIR += $(VBOX_DIR)/Main/xml INC_DIR += $(VBOX_DIR)/Main/include INC_DIR += $(REP_DIR)/src/virtualbox/frontend +INC_DIR += $(REP_DIR)/src/virtualbox/frontend/VBoxAPIWrap + +# search path to 'scan_code_set_2.h' +INC_DIR += $(call select_from_repositories,src/drivers/input/ps2) diff --git a/repos/ports/ports/virtualbox.hash b/repos/ports/ports/virtualbox.hash index 0ea336889b..7a52c54374 100644 --- a/repos/ports/ports/virtualbox.hash +++ b/repos/ports/ports/virtualbox.hash @@ -1 +1 @@ -1e49158411c029263f5b29b890ec3f212b2caf29 +43d2aa6fa21dcf782a5c2539d6056575602bc545 diff --git a/repos/ports/ports/virtualbox.port b/repos/ports/ports/virtualbox.port index fbf55f2f34..a55296e4ce 100644 --- a/repos/ports/ports/virtualbox.port +++ b/repos/ports/ports/virtualbox.port @@ -1,20 +1,21 @@ LICENSE := GPLv2 VERSION := 4.3.16 -DOWNLOADS := virtualbox.archive +DOWNLOADS := virtualbox.archive virtualbox_sdk.archive -VIRTUALBOX_TBZ2 := VirtualBox-$(VERSION).tar.bz2 +VIRTUALBOX_TBZ2 := VirtualBox-$(VERSION).tar.bz2 +VIRTUALBOX_SDK_ZIP := VirtualBoxSDK-$(VERSION)-95972.zip URL(virtualbox) := http://download.virtualbox.org/virtualbox/$(VERSION)/$(VIRTUALBOX_TBZ2) DIR(virtualbox) := src/app/virtualbox SHA(virtualbox) := e4c23b713e8715b8e0172fa066f2197756e901fe -PATCHES_LIST := acpi_drv dev_e1000 eminternal iconv mouse -PATCHES_LIST += pdm_driver poke sharedfolder_pagelist -PATCHES_LIST += time-log-deadlock tm_retries vbox_inc vbox_main network -PATCHES_LIST += vga_fb vga_vbva vmdk vmmdev avoid_yield serial rem_irq usb +URL(virtualbox_sdk) := http://download.virtualbox.org/virtualbox/$(VERSION)/$(VIRTUALBOX_SDK_ZIP) +DIR(virtualbox_sdk) := src/app/virtualbox_sdk +SHA(virtualbox_sdk) := 8f95a891a6cb5f712fcb0ed34f2b8bf6b1e59f4c -PATCHES := $(addsuffix .patch, $(PATCHES_LIST)) -PATCHES := $(addprefix src/virtualbox/patches/, $(PATCHES)) +PATCHES_DIR := src/virtualbox/patches +PATCHES := $(addprefix $(PATCHES_DIR)/, $(shell cat $(REP_DIR)/$(PATCHES_DIR)/series)) +PATCH_OPT := -p1 $(call check_tool,xsltproc) @@ -29,7 +30,7 @@ VBOX_MAIN_CLI += HGCMObjects VBOX_MAIN_CLI += KeyboardImpl SessionImpl VMMDevInterface BusAssignmentManager VBOX_MAIN_CLI += ConsoleImpl GuestImpl MouseImpl VBoxDriversRegister -VBOX_MAIN_SRV := AudioAdapterImpl DHCPServerImpl MediumAttachmentImpl +VBOX_MAIN_SRV := AudioAdapterImpl ClientToken DHCPServerImpl Matching MediumAttachmentImpl VBOX_MAIN_SRV += NATEngineImpl SerialPortImpl VBOX_MAIN_SRV += BandwidthControlImpl GuestOSTypeImpl MediumFormatImpl VBOX_MAIN_SRV += NetworkAdapterImpl SnapshotImpl @@ -42,7 +43,7 @@ VBOX_MAIN_SRV += USBControllerImpl USBDeviceFilterImpl USBDeviceFiltersImpl VBOX_MAIN_INC := AdditionsFacilityImpl AudioAdapterImpl AudioSnifferInterface VBOX_MAIN_INC += AutoCaller AutostartDb AutoStateDep BandwidthControlImpl VBOX_MAIN_INC += BandwidthGroupImpl BIOSSettingsImpl BusAssignmentManager Nvram -VBOX_MAIN_INC += ConsoleEvents ConsoleImpl DHCPServerImpl DisplayImpl HostImpl +VBOX_MAIN_INC += ClientToken ConsoleEvents ConsoleImpl DHCPServerImpl DisplayImpl HostImpl VBOX_MAIN_INC += DisplayUtils EventImpl FramebufferImpl Global VBOX_MAIN_INC += GuestCtrlImplPrivate GuestDirectoryImpl GuestDnDImpl Logging VBOX_MAIN_INC += GuestFileImpl GuestFsObjInfoImpl GuestImpl GuestOSTypeImpl @@ -56,7 +57,7 @@ VBOX_MAIN_INC += ProgressProxyImpl SerialPortImpl SessionImpl SharedFolderImpl VBOX_MAIN_INC += StorageControllerImpl SystemPropertiesImpl TokenImpl VMMDev VBOX_MAIN_INC += USBControllerImpl USBDeviceFilterImpl USBDeviceFiltersImpl VBOX_MAIN_INC += USBProxyService VirtualBoxImpl VRDEServerImpl GuestProcessImpl -VBOX_MAIN_INC += USBDeviceImpl HostUSBDeviceImpl Matching +VBOX_MAIN_INC += USBDeviceImpl HostUSBDeviceImpl Matching Wrapper VBOX_SRC_VBOX := VMM Devices Runtime GuestHost/HGSMI Storage Disassembler VBOX_SRC_VBOX += HostServices/SharedFolders Main/xml/Settings.cpp @@ -90,6 +91,8 @@ TAR_OPT(virtualbox) := \ --strip-components 1 \ $(addprefix $(VIRTUALBOX_TBZ2:.tar.bz2=)/,$(VBOX_CONTENT)) +UNZIP_OPT(virtualbox_sdk) := $(VIRTUALBOX_SDK_ZIP) sdk/bindings/xpcom/include/VirtualBox_XPCOM.h \# + default : additional_steps additional_steps : $(DOWNLOADS) diff --git a/repos/ports/src/virtualbox/frontend/ClientToken.h b/repos/ports/src/virtualbox/frontend/ClientToken.h deleted file mode 100644 index ce707b49bb..0000000000 --- a/repos/ports/src/virtualbox/frontend/ClientToken.h +++ /dev/null @@ -1,19 +0,0 @@ - -#ifndef ____H_CLIENTTOKEN -#define ____H_CLIENTTOKEN - -#include -#include - -#include "MachineImpl.h" - -class Machine::ClientToken -{ - public: - ClientToken(const ComObjPtr &pMachine, SessionMachine *pSessionMachine); - - bool isReady(); - bool release(); - void getId(Utf8Str &strId); -}; -#endif /* !____H_CLIENTTOKEN */ diff --git a/repos/ports/src/virtualbox/frontend/GenodeImpl.h b/repos/ports/src/virtualbox/frontend/GenodeImpl.h index 46ae4aa024..505377349f 100644 --- a/repos/ports/src/virtualbox/frontend/GenodeImpl.h +++ b/repos/ports/src/virtualbox/frontend/GenodeImpl.h @@ -1,287 +1,10 @@ #ifndef ____H_GENODEIMPL #define ____H_GENODEIMPL -#include -#include -#include -#include -#include -#include -#include +/* GuestControlSvc.h */ -class Progress; -typedef Progress IProgress; - -class VirtualBoxErrorInfo; -typedef VirtualBoxErrorInfo IVirtualBoxErrorInfo; - -class IUnknown; -#include - - -#include -#include - -#include -#include -#include -#include - -class Console; - -#include "AutoCaller.h" -#include "VMMDev.h" - -#include -#include -#include - -#define TRUNKTYPE_WHATEVER "whatever" -#define TRUNKTYPE_NETFLT "netflt" -#define INTNET_MAX_NETWORK_NAME 128 -#define VBOX_SHARED_CLIPBOARD_HOST_FN_SET_HEADLESS 2 - -enum INTNETTRUNKTYPE -{ - kIntNetTrunkType_WhateverNone, - kIntNetTrunkType_NetFlt, -}; - -class IHostNetworkInterface; -class IFramebufferOverlay; -class IInternalSessionControl; -class IHostUSBDevice; -class IHostUSBDeviceFilter; -class IHostVideoInputDevice; -class IVetoEvent; - -class AdditionsFacility; -class AudioAdapter; -class BandwidthControl; -class BandwidthGroup; -class BIOSSettings; -class ConsoleMouseInterface; -class Display; -class DHCPServer; -class EmulatedUSB; -class EventSource; -class Framebuffer; -class Guest; -class GuestDirectory; -class GuestFile; -class GuestFsObjInfo; -class GuestOSType; -class GuestProcess; -class GuestSession; -class Host; -class Keyboard; -class Machine; -class MachineDebugger; -class Medium; -class MediumAttachment; -class MediumFormat; -class MediumLockList; -class Mouse; -class NATEngine; -class NATNetwork; -class NetworkAdapter; -class OUSBDevice; -class ParallelPort; -class PCIDeviceAttachment; -class SerialPort; -class Session; -class SessionMachine; -class SharedFolder; -class Snapshot; -class StorageController; -class SystemProperties; -class Token; -class USBController; -class USBDeviceFilter; -class USBDeviceFilters; -class VBoxEvent; -class VBoxEventDesc; -class VBoxVetoEvent; -class VirtualBox; -class VRDEServer; -class VRDEServerInfo; - -class VirtualBoxErrorInfo { - - public: - HRESULT init(HRESULT aResultCode, const GUID &aIID, - const char *pcszComponent, const com::Utf8Str &strText, - IVirtualBoxErrorInfo *aNext = NULL); - HRESULT FinalConstruct() { return S_OK; } -}; - -class IStateChangedEvent -{ - public: - void get_State(MachineState_T*); -}; - -typedef AdditionsFacility IAdditionsFacility; -class IAppliance; -typedef AudioAdapter IAudioAdapter; -typedef Console IConsole; -typedef BandwidthControl IBandwidthControl; -typedef BandwidthGroup IBandwidthGroup; -typedef BIOSSettings IBIOSSettings; -typedef Display IDisplay; -typedef DHCPServer IDHCPServer; -typedef EmulatedUSB IEmulatedUSB; -typedef VBoxEvent IEvent; -typedef VBoxVetoEvent IExtraDataCanChangeEvent; -typedef EventSource IEventSource; -typedef Framebuffer IFramebuffer; -class IExtPackManager; -typedef Guest IGuest; -typedef GuestDirectory IGuestDirectory; -typedef GuestFile IGuestFile; -typedef GuestFsObjInfo IGuestFsObjInfo; -typedef GuestProcess IGuestProcess; -typedef GuestSession IGuestSession; -typedef GuestOSType IGuestOSType; -typedef Host IHost; -typedef Keyboard IKeyboard; -typedef Machine IMachine; -typedef MachineDebugger IMachineDebugger; -typedef Medium IMedium; -typedef MediumAttachment IMediumAttachment; -typedef Mouse IMouse; -typedef NetworkAdapter INetworkAdapter; -typedef NATEngine INATEngine; -typedef NATNetwork INATNetwork; -typedef ParallelPort IParallelPort; -class IPerformanceCollector; -typedef SerialPort ISerialPort; -typedef Session ISession; -typedef SharedFolder ISharedFolder; -typedef Snapshot ISnapshot; -typedef StorageController IStorageController; -typedef SystemProperties ISystemProperties; -typedef Token IToken; -typedef USBController IUSBController; -typedef OUSBDevice IUSBDevice; -typedef USBDeviceFilter IUSBDeviceFilter; -typedef USBDeviceFilters IUSBDeviceFilters; -typedef VirtualBox IVirtualBox; -typedef VRDEServer IVRDEServer; -typedef VRDEServerInfo IVRDEServerInfo; -typedef PCIDeviceAttachment IPCIDeviceAttachment; -typedef SessionMachine IInternalMachineControl; - -class IVirtualSystemDescription; - -class IEventListener { - - public: - - HRESULT HandleEvent(IEvent * aEvent); -/* - { - VBoxEventType_T aType = VBoxEventType_Invalid; - aEvent->COMGETTER(Type)(&aType); - return mListener->HandleEvent(aType, aEvent); - } -*/ - }; - -template -class DummyClass { - public: - void AddRef() { } - void Release() { } - - void fireNATRedirectEvent(const ComObjPtr&, BSTR, ULONG&, bool&, short unsigned int*&, NATProtocol_T&, short unsigned int*&, uint16_t&, short unsigned int*&, uint16_t&); - void fireNATNetworkChangedEvent(const ComObjPtr&, short unsigned int*&); - void fireNATNetworkStartStopEvent(const ComObjPtr&, short unsigned int*&, BOOL&); - void fireNATNetworkSettingEvent(const ComObjPtr&, short unsigned int*&, BOOL&, short unsigned int*&, short unsigned int*&, BOOL&, BOOL&); - void fireNATNetworkPortForwardEvent(const ComObjPtr&, short unsigned int*&, BOOL&, BOOL&, short unsigned int*&, NATProtocol_T&, short unsigned int*&, LONG&, short unsigned int*&, LONG&); - void fireHostNameResolutionConfigurationChangeEvent(const ComObjPtr&); - void fireHostPCIDevicePlugEvent(ComPtr&, BSTR, bool, bool, ComObjPtr&, void *); - void fireStateChangedEvent(const ComObjPtr&, MachineState_T); - void fireRuntimeErrorEvent(const ComObjPtr&, BOOL, IN_BSTR, IN_BSTR); -}; - -#define ATL_NO_VTABLE -#define DECLARE_CLASSFACTORY() -#define VBOX_SCRIPTABLE_IMPL(X) public DummyClass -#define DECLARE_NOT_AGGREGATABLE(X) - -#define DECLARE_REGISTRY_RESOURCEID(X) -#define DECLARE_PROTECT_FINAL_CONSTRUCT(Y) -#define DECLARE_CLASSFACTORY_SINGLETON(X) - -#define BEGIN_COM_MAP(X) -#define VBOX_DEFAULT_INTERFACE_ENTRIES(X) -#define COM_INTERFACE_ENTRY(X) -#define COM_INTERFACE_ENTRY2(X,Y) -#define END_COM_MAP() - -#define DECLARE_EMPTY_CTOR_DTOR(X) public: X(); ~X(); -#define DEFINE_EMPTY_CTOR_DTOR(X) X::X() {} X::~X() {} - -#define STDMETHODIMP HRESULT -#define STDMETHOD(X) virtual HRESULT X - -#define Q_OBJECT - -#include "BusAssignmentManager.h" - -#include "MediumFormatImpl.h" -typedef MediumFormat IMediumFormat; - -typedef struct sdfkkd { } VRDEUSBDEVICEDESC; -typedef struct sdfsdf3 { } VBOXGUESTCTRLHOSTCBCTX, *PVBOXGUESTCTRLHOSTCBCTX; -typedef struct sdffsd2 { } VBOXGUESTCTRLHOSTCALLBACK, *PVBOXGUESTCTRLHOSTCALLBACK; -typedef struct IFsObjInfo { } IFsObjInfo; - -#include "AdditionsFacilityImpl.h" -#include "BIOSSettingsImpl.h" -#include "EventImpl.h" -#include "FramebufferImpl.h" -#include "PCIDeviceAttachmentImpl.h" -#include "GuestImpl.h" -#include "GuestDirectoryImpl.h" -#include "GuestFsObjInfoImpl.h" -#include "GuestProcessImpl.h" -#include "GuestSessionImpl.h" -#include "NetworkServiceRunner.h" -#include "SnapshotImpl.h" -#include "ParallelPortImpl.h" -#include "MediumAttachmentImpl.h" -#include "StorageControllerImpl.h" -#include "USBControllerImpl.h" -#include "SerialPortImpl.h" - -#include "NATEngineImpl.h" -#include "NetworkAdapterImpl.h" -#include "ProgressImpl.h" -#include "VRDEServerImpl.h" -#include "GuestOSTypeImpl.h" -#include "DHCPServerImpl.h" -#include "SystemPropertiesImpl.h" -#include "KeyboardImpl.h" -#include "DisplayImpl.h" -#include "NATNetworkImpl.h" -#include "VRDEServerImpl.h" -#include "MediumImpl.h" -#include "SessionImpl.h" -#include "HostImpl.h" -#include "USBDeviceImpl.h" - -class VRDEServerInfo { }; -class EmulatedUSB { }; - -class ConsoleVRDPServer -{ - public: - void SendResize (void) {} - void SendUpdate (unsigned uScreenId, void *pvUpdate, uint32_t cbUpdate) const; - void SendUpdateBitmap (unsigned uScreenId, uint32_t x, uint32_t y, uint32_t w, uint32_t h) const; - void Stop(); -}; +typedef struct { } VBOXGUESTCTRLHOSTCBCTX, *PVBOXGUESTCTRLHOSTCBCTX; +typedef struct { } VBOXGUESTCTRLHOSTCALLBACK, *PVBOXGUESTCTRLHOSTCALLBACK; +enum GUEST_FILE_SEEKTYPE { }; #endif // !____H_GENODEIMPL diff --git a/repos/ports/src/virtualbox/frontend/MediumFormatWrap.h b/repos/ports/src/virtualbox/frontend/MediumFormatWrap.h deleted file mode 100644 index b885b051e4..0000000000 --- a/repos/ports/src/virtualbox/frontend/MediumFormatWrap.h +++ /dev/null @@ -1,10 +0,0 @@ -#include "VirtualBoxBase.h" - -class MediumFormatWrap : public VirtualBoxBase, public DummyClass { - - public: - virtual const char* getComponentName() const - { - return "MediumFormatWrap"; - } -}; diff --git a/repos/ports/src/virtualbox/frontend/TokenWrap.h b/repos/ports/src/virtualbox/frontend/TokenWrap.h deleted file mode 100644 index a3dff56cd9..0000000000 --- a/repos/ports/src/virtualbox/frontend/TokenWrap.h +++ /dev/null @@ -1,22 +0,0 @@ -#include "VirtualBoxBase.h" - -class Token : public VirtualBoxBase -{ - public: - virtual HRESULT abandon(AutoCaller &aAutoCaller) = 0; - - HRESULT Abandon() { - AutoCaller autoCaller(this); - abandon(autoCaller); - return S_OK; - } - - virtual const char* getComponentName() const - { - return "Token"; - } -}; - -class TokenWrap : public Token -{ -}; diff --git a/repos/ports/src/virtualbox/frontend/VBoxAPIWrap/MediumFormatWrap.cpp b/repos/ports/src/virtualbox/frontend/VBoxAPIWrap/MediumFormatWrap.cpp new file mode 100644 index 0000000000..e0e0716e90 --- /dev/null +++ b/repos/ports/src/virtualbox/frontend/VBoxAPIWrap/MediumFormatWrap.cpp @@ -0,0 +1,210 @@ +/** @file + * + * VirtualBox API class wrapper code for IMediumFormat. + * + * DO NOT EDIT! This is a generated file. + * Generated from: src/VBox/Main/idl/VirtualBox.xidl + * Generator: src/VBox/Main/idl/apiwrap-server.xsl + */ + +/** + * Copyright (C) 2010-2014 Oracle Corporation + * + * This file is part of VirtualBox Open Source Edition (OSE), as + * available from http://www.virtualbox.org. This file is free software; + * you can redistribute it and/or modify it under the terms of the GNU + * General Public License (GPL) as published by the Free Software + * Foundation, in version 2 as it comes in the "COPYING" file of the + * VirtualBox OSE distribution. VirtualBox OSE is distributed in the + * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. + */ + +#define LOG_GROUP_MAIN_OVERRIDE LOG_GROUP_MAIN_MEDIUMFORMAT + +#include "MediumFormatWrap.h" +#include "Logging.h" + +DEFINE_EMPTY_CTOR_DTOR(MediumFormatWrap) + +// +// IMediumFormat properties +// + +STDMETHODIMP MediumFormatWrap::COMGETTER(Id)(BSTR *aId) +{ + LogRelFlow(("{%p} %s: enter aId=%p\n", this, "MediumFormat::getId", aId)); + + VirtualBoxBase::clearError(); + + HRESULT hrc; + + try + { + CheckComArgOutPointerValidThrow(aId); + + AutoCaller autoCaller(this); + if (FAILED(autoCaller.rc())) + throw autoCaller.rc(); + + hrc = getId(BSTROutConverter(aId).str()); + } + catch (HRESULT hrc2) + { + hrc = hrc2; + } + catch (...) + { + hrc = VirtualBoxBase::handleUnexpectedExceptions(this, RT_SRC_POS); + } + + LogRelFlow(("{%p} %s: leave *aId=%ls hrc=%Rhrc\n", this, "MediumFormat::getId", *aId, hrc)); + return hrc; +} + +STDMETHODIMP MediumFormatWrap::COMGETTER(Name)(BSTR *aName) +{ + LogRelFlow(("{%p} %s: enter aName=%p\n", this, "MediumFormat::getName", aName)); + + VirtualBoxBase::clearError(); + + HRESULT hrc; + + try + { + CheckComArgOutPointerValidThrow(aName); + + AutoCaller autoCaller(this); + if (FAILED(autoCaller.rc())) + throw autoCaller.rc(); + + hrc = getName(BSTROutConverter(aName).str()); + } + catch (HRESULT hrc2) + { + hrc = hrc2; + } + catch (...) + { + hrc = VirtualBoxBase::handleUnexpectedExceptions(this, RT_SRC_POS); + } + + LogRelFlow(("{%p} %s: leave *aName=%ls hrc=%Rhrc\n", this, "MediumFormat::getName", *aName, hrc)); + return hrc; +} + +STDMETHODIMP MediumFormatWrap::COMGETTER(Capabilities)(ComSafeArrayOut(MediumFormatCapabilities_T, aCapabilities)) +{ + LogRelFlow(("{%p} %s: enter aCapabilities=%p\n", this, "MediumFormat::getCapabilities", aCapabilities)); + + VirtualBoxBase::clearError(); + + HRESULT hrc; + + try + { + CheckComArgOutPointerValidThrow(aCapabilities); + + AutoCaller autoCaller(this); + if (FAILED(autoCaller.rc())) + throw autoCaller.rc(); + + hrc = getCapabilities(ArrayOutConverter(ComSafeArrayOutArg(aCapabilities)).array()); + } + catch (HRESULT hrc2) + { + hrc = hrc2; + } + catch (...) + { + hrc = VirtualBoxBase::handleUnexpectedExceptions(this, RT_SRC_POS); + } + + LogRelFlow(("{%p} %s: leave *aCapabilities=%zu hrc=%Rhrc\n", this, "MediumFormat::getCapabilities", ComSafeArraySize(*aCapabilities), hrc)); + return hrc; +} + +// +// IMediumFormat methods +// + +STDMETHODIMP MediumFormatWrap::DescribeFileExtensions(ComSafeArrayOut(BSTR, aExtensions), + ComSafeArrayOut(DeviceType_T, aTypes)) +{ + LogRelFlow(("{%p} %s:enter aExtensions=%p aTypes=%p\n", this, "MediumFormat::describeFileExtensions", aExtensions, aTypes)); + + VirtualBoxBase::clearError(); + + HRESULT hrc; + + try + { + CheckComArgOutPointerValidThrow(aExtensions); + CheckComArgOutPointerValidThrow(aTypes); + + AutoCaller autoCaller(this); + if (FAILED(autoCaller.rc())) + throw autoCaller.rc(); + + hrc = describeFileExtensions(ArrayBSTROutConverter(ComSafeArrayOutArg(aExtensions)).array(), + ArrayOutConverter(ComSafeArrayOutArg(aTypes)).array()); + } + catch (HRESULT hrc2) + { + hrc = hrc2; + } + catch (...) + { + hrc = VirtualBoxBase::handleUnexpectedExceptions(this, RT_SRC_POS); + } + + LogRelFlow(("{%p} %s: leave *aExtensions=%zu *aTypes=%zu hrc=%Rhrc\n", this, "MediumFormat::describeFileExtensions", ComSafeArraySize(*aExtensions), ComSafeArraySize(*aTypes), hrc)); + return hrc; +} + +STDMETHODIMP MediumFormatWrap::DescribeProperties(ComSafeArrayOut(BSTR, aNames), + ComSafeArrayOut(BSTR, aDescriptions), + ComSafeArrayOut(DataType_T, aTypes), + ComSafeArrayOut(ULONG, aFlags), + ComSafeArrayOut(BSTR, aDefaults)) +{ + LogRelFlow(("{%p} %s:enter aNames=%p aDescriptions=%p aTypes=%p aFlags=%p aDefaults=%p\n", this, "MediumFormat::describeProperties", aNames, aDescriptions, aTypes, aFlags, aDefaults)); + + VirtualBoxBase::clearError(); + + HRESULT hrc; + + try + { + CheckComArgOutPointerValidThrow(aNames); + CheckComArgOutPointerValidThrow(aDescriptions); + CheckComArgOutPointerValidThrow(aTypes); + CheckComArgOutPointerValidThrow(aFlags); + CheckComArgOutPointerValidThrow(aDefaults); + + AutoCaller autoCaller(this); + if (FAILED(autoCaller.rc())) + throw autoCaller.rc(); + + hrc = describeProperties(ArrayBSTROutConverter(ComSafeArrayOutArg(aNames)).array(), + ArrayBSTROutConverter(ComSafeArrayOutArg(aDescriptions)).array(), + ArrayOutConverter(ComSafeArrayOutArg(aTypes)).array(), + ArrayOutConverter(ComSafeArrayOutArg(aFlags)).array(), + ArrayBSTROutConverter(ComSafeArrayOutArg(aDefaults)).array()); + } + catch (HRESULT hrc2) + { + hrc = hrc2; + } + catch (...) + { + hrc = VirtualBoxBase::handleUnexpectedExceptions(this, RT_SRC_POS); + } + + LogRelFlow(("{%p} %s: leave *aNames=%zu *aDescriptions=%zu *aTypes=%zu *aFlags=%zu *aDefaults=%zu hrc=%Rhrc\n", this, "MediumFormat::describeProperties", ComSafeArraySize(*aNames), ComSafeArraySize(*aDescriptions), ComSafeArraySize(*aTypes), ComSafeArraySize(*aFlags), ComSafeArraySize(*aDefaults), hrc)); + return hrc; +} + +#ifdef VBOX_WITH_XPCOM +NS_DECL_CLASSINFO(MediumFormatWrap) +NS_IMPL_THREADSAFE_ISUPPORTS1_CI(MediumFormatWrap, IMediumFormat) +#endif // VBOX_WITH_XPCOM diff --git a/repos/ports/src/virtualbox/frontend/VBoxAPIWrap/MediumFormatWrap.h b/repos/ports/src/virtualbox/frontend/VBoxAPIWrap/MediumFormatWrap.h new file mode 100644 index 0000000000..1a9836a3be --- /dev/null +++ b/repos/ports/src/virtualbox/frontend/VBoxAPIWrap/MediumFormatWrap.h @@ -0,0 +1,77 @@ +/** @file + * + * VirtualBox API class wrapper header for IMediumFormat. + * + * DO NOT EDIT! This is a generated file. + * Generated from: src/VBox/Main/idl/VirtualBox.xidl + * Generator: src/VBox/Main/idl/apiwrap-server.xsl + */ + +/** + * Copyright (C) 2010-2014 Oracle Corporation + * + * This file is part of VirtualBox Open Source Edition (OSE), as + * available from http://www.virtualbox.org. This file is free software; + * you can redistribute it and/or modify it under the terms of the GNU + * General Public License (GPL) as published by the Free Software + * Foundation, in version 2 as it comes in the "COPYING" file of the + * VirtualBox OSE distribution. VirtualBox OSE is distributed in the + * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. + */ + +#ifndef MediumFormatWrap_H_ +#define MediumFormatWrap_H_ + +#include "VirtualBoxBase.h" +#include "Wrapper.h" + +class ATL_NO_VTABLE MediumFormatWrap: + public VirtualBoxBase, + VBOX_SCRIPTABLE_IMPL(IMediumFormat) +{ + Q_OBJECT + +public: + VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT(MediumFormatWrap, IMediumFormat) + DECLARE_NOT_AGGREGATABLE(MediumFormatWrap) + DECLARE_PROTECT_FINAL_CONSTRUCT() + + BEGIN_COM_MAP(MediumFormatWrap) + COM_INTERFACE_ENTRY(ISupportErrorInfo) + COM_INTERFACE_ENTRY(IMediumFormat) + COM_INTERFACE_ENTRY2(IDispatch, IMediumFormat) + END_COM_MAP() + + DECLARE_EMPTY_CTOR_DTOR(MediumFormatWrap) + + // public IMediumFormat properties + STDMETHOD(COMGETTER(Id))(BSTR *aId); + STDMETHOD(COMGETTER(Name))(BSTR *aName); + STDMETHOD(COMGETTER(Capabilities))(ComSafeArrayOut(MediumFormatCapabilities_T, aCapabilities)); + + // public IMediumFormat methods + STDMETHOD(DescribeFileExtensions)(ComSafeArrayOut(BSTR, aExtensions), + ComSafeArrayOut(DeviceType_T, aTypes)); + STDMETHOD(DescribeProperties)(ComSafeArrayOut(BSTR, aNames), + ComSafeArrayOut(BSTR, aDescriptions), + ComSafeArrayOut(DataType_T, aTypes), + ComSafeArrayOut(ULONG, aFlags), + ComSafeArrayOut(BSTR, aDefaults)); + +private: + // wrapped IMediumFormat properties + virtual HRESULT getId(com::Utf8Str &aId) = 0; + virtual HRESULT getName(com::Utf8Str &aName) = 0; + virtual HRESULT getCapabilities(std::vector &aCapabilities) = 0; + + // wrapped IMediumFormat methods + virtual HRESULT describeFileExtensions(std::vector &aExtensions, + std::vector &aTypes) = 0; + virtual HRESULT describeProperties(std::vector &aNames, + std::vector &aDescriptions, + std::vector &aTypes, + std::vector &aFlags, + std::vector &aDefaults) = 0; +}; + +#endif // !MediumFormatWrap_H_ diff --git a/repos/ports/src/virtualbox/frontend/VBoxAPIWrap/TokenWrap.cpp b/repos/ports/src/virtualbox/frontend/VBoxAPIWrap/TokenWrap.cpp new file mode 100644 index 0000000000..d7b9b28775 --- /dev/null +++ b/repos/ports/src/virtualbox/frontend/VBoxAPIWrap/TokenWrap.cpp @@ -0,0 +1,100 @@ +/** @file + * + * VirtualBox API class wrapper code for IToken. + * + * DO NOT EDIT! This is a generated file. + * Generated from: src/VBox/Main/idl/VirtualBox.xidl + * Generator: src/VBox/Main/idl/apiwrap-server.xsl + */ + +/** + * Copyright (C) 2010-2014 Oracle Corporation + * + * This file is part of VirtualBox Open Source Edition (OSE), as + * available from http://www.virtualbox.org. This file is free software; + * you can redistribute it and/or modify it under the terms of the GNU + * General Public License (GPL) as published by the Free Software + * Foundation, in version 2 as it comes in the "COPYING" file of the + * VirtualBox OSE distribution. VirtualBox OSE is distributed in the + * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. + */ + +#define LOG_GROUP_MAIN_OVERRIDE LOG_GROUP_MAIN_TOKEN + +#include "TokenWrap.h" +#include "Logging.h" + +DEFINE_EMPTY_CTOR_DTOR(TokenWrap) + +// +// IToken properties +// + +// +// IToken methods +// + +STDMETHODIMP TokenWrap::Abandon() +{ + LogRelFlow(("{%p} %s:enter\n", this, "Token::abandon")); + + VirtualBoxBase::clearError(); + + HRESULT hrc; + + try + { + + AutoCaller autoCaller(this); + if (FAILED(autoCaller.rc())) + throw autoCaller.rc(); + + hrc = abandon(autoCaller); + } + catch (HRESULT hrc2) + { + hrc = hrc2; + } + catch (...) + { + hrc = VirtualBoxBase::handleUnexpectedExceptions(this, RT_SRC_POS); + } + + LogRelFlow(("{%p} %s: leave hrc=%Rhrc\n", this, "Token::abandon", hrc)); + return hrc; +} + +STDMETHODIMP TokenWrap::Dummy() +{ + LogRelFlow(("{%p} %s:enter\n", this, "Token::dummy")); + + VirtualBoxBase::clearError(); + + HRESULT hrc; + + try + { + + AutoCaller autoCaller(this); + if (FAILED(autoCaller.rc())) + throw autoCaller.rc(); + + hrc = dummy(); + } + catch (HRESULT hrc2) + { + hrc = hrc2; + } + catch (...) + { + hrc = VirtualBoxBase::handleUnexpectedExceptions(this, RT_SRC_POS); + } + + LogRelFlow(("{%p} %s: leave hrc=%Rhrc\n", this, "Token::dummy", hrc)); + return hrc; +} + +#ifdef VBOX_WITH_XPCOM +NS_DECL_CLASSINFO(TokenWrap) +NS_IMPL_THREADSAFE_ISUPPORTS1_CI(TokenWrap, IToken) +#endif // VBOX_WITH_XPCOM diff --git a/repos/ports/src/virtualbox/frontend/VBoxAPIWrap/TokenWrap.h b/repos/ports/src/virtualbox/frontend/VBoxAPIWrap/TokenWrap.h new file mode 100644 index 0000000000..ca48cd1b8d --- /dev/null +++ b/repos/ports/src/virtualbox/frontend/VBoxAPIWrap/TokenWrap.h @@ -0,0 +1,61 @@ +/** @file + * + * VirtualBox API class wrapper header for IToken. + * + * DO NOT EDIT! This is a generated file. + * Generated from: src/VBox/Main/idl/VirtualBox.xidl + * Generator: src/VBox/Main/idl/apiwrap-server.xsl + */ + +/** + * Copyright (C) 2010-2014 Oracle Corporation + * + * This file is part of VirtualBox Open Source Edition (OSE), as + * available from http://www.virtualbox.org. This file is free software; + * you can redistribute it and/or modify it under the terms of the GNU + * General Public License (GPL) as published by the Free Software + * Foundation, in version 2 as it comes in the "COPYING" file of the + * VirtualBox OSE distribution. VirtualBox OSE is distributed in the + * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. + */ + +#ifndef TokenWrap_H_ +#define TokenWrap_H_ + +#include "VirtualBoxBase.h" +#include "Wrapper.h" + +class ATL_NO_VTABLE TokenWrap: + public VirtualBoxBase, + VBOX_SCRIPTABLE_IMPL(IToken) +{ + Q_OBJECT + +public: + VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT(TokenWrap, IToken) + DECLARE_NOT_AGGREGATABLE(TokenWrap) + DECLARE_PROTECT_FINAL_CONSTRUCT() + + BEGIN_COM_MAP(TokenWrap) + COM_INTERFACE_ENTRY(ISupportErrorInfo) + COM_INTERFACE_ENTRY(IToken) + COM_INTERFACE_ENTRY2(IDispatch, IToken) + END_COM_MAP() + + DECLARE_EMPTY_CTOR_DTOR(TokenWrap) + + // public IToken properties + + // public IToken methods + STDMETHOD(Abandon)(); + STDMETHOD(Dummy)(); + +private: + // wrapped IToken properties + + // wrapped IToken methods + virtual HRESULT abandon(AutoCaller &aAutoCaller) = 0; + virtual HRESULT dummy() = 0; +}; + +#endif // !TokenWrap_H_ diff --git a/repos/ports/src/virtualbox/frontend/VBoxEvents.h b/repos/ports/src/virtualbox/frontend/VBoxEvents.h index e69de29bb2..c62e803afc 100644 --- a/repos/ports/src/virtualbox/frontend/VBoxEvents.h +++ b/repos/ports/src/virtualbox/frontend/VBoxEvents.h @@ -0,0 +1,41 @@ +#include "EventImpl.h" + +void fireStateChangedEvent(IEventSource* aSource, MachineState_T a_state); + +void fireRuntimeErrorEvent(IEventSource* aSource, BOOL a_fatal, CBSTR a_id, + CBSTR a_message); + +void fireGuestMonitorChangedEvent(IEventSource* aSource, + GuestMonitorChangedEventType_T a_changeType, + ULONG a_screenId, ULONG a_originX, + ULONG a_originY, ULONG a_width, + ULONG a_height); + +void fireHostPCIDevicePlugEvent(IEventSource* aSource, CBSTR a_machineId, + BOOL a_plugged, BOOL a_success, + IPCIDeviceAttachment* a_attachment, + CBSTR a_message); + +void fireNATRedirectEvent(IEventSource* aSource, CBSTR a_machineId, + ULONG a_slot, BOOL a_remove, CBSTR a_name, + NATProtocol_T a_proto, CBSTR a_hostIP, + LONG a_hostPort, CBSTR a_guestIP, LONG a_guestPort); + +void fireNATNetworkChangedEvent(IEventSource* aSource, CBSTR a_networkName); + +void fireNATNetworkStartStopEvent(IEventSource* aSource, CBSTR a_networkName, + BOOL a_startEvent); + +void fireNATNetworkSettingEvent(IEventSource* aSource, CBSTR a_networkName, + BOOL a_enabled, CBSTR a_network, + CBSTR a_gateway, + BOOL a_advertiseDefaultIPv6RouteEnabled, + BOOL a_needDhcpServer); + +void fireNATNetworkPortForwardEvent(IEventSource* aSource, CBSTR a_networkName, + BOOL a_create, BOOL a_ipv6, CBSTR a_name, + NATProtocol_T a_proto, CBSTR a_hostIp, + LONG a_hostPort, CBSTR a_guestIp, + LONG a_guestPort); + +void fireHostNameResolutionConfigurationChangeEvent(IEventSource* aSource); diff --git a/repos/ports/src/virtualbox/frontend/VirtualBoxBase.h b/repos/ports/src/virtualbox/frontend/VirtualBoxBase.h index 78f92ea07a..646eb74a8c 100644 --- a/repos/ports/src/virtualbox/frontend/VirtualBoxBase.h +++ b/repos/ports/src/virtualbox/frontend/VirtualBoxBase.h @@ -3,18 +3,17 @@ #include -#include +#include #include #include #include -#include "VBox/com/defs.h" -#include "VBox/com/ptr.h" -#include "VBox/com/string.h" - #include "VBox/com/AutoLock.h" +#include "VBox/com/string.h" +#include "VBox/com/Guid.h" +#include "VBox/com/VirtualBox.h" namespace com { @@ -24,12 +23,30 @@ namespace com using namespace com; using namespace util; +class AutoInitSpan; +class AutoUninitSpan; + +class VirtualBox; +class Machine; class Medium; typedef std::list > MediaList; typedef std::list StringsList; -class VirtualBoxBase : public util::Lockable { +class VirtualBoxTranslatable : public util::Lockable +{ + public: + + /* should be used for translations */ + inline static const char *tr(const char *pcszSourceText, + const char *aComment = NULL) + { + return pcszSourceText; + } +}; + +class VirtualBoxBase : public VirtualBoxTranslatable +{ public: @@ -88,15 +105,9 @@ class VirtualBoxBase : public util::Lockable { virtual const char* getComponentName() const = 0; - /* should be used for translations */ - inline static const char *tr(const char *pcszSourceText, - const char *aComment = NULL) - { - return pcszSourceText; - } - static HRESULT handleUnexpectedExceptions(VirtualBoxBase *const aThis, RT_SRC_POS_DECL); static HRESULT initializeComForThread(void); + static void uninitializeComForThread(void); static void clearError(void); HRESULT setError(HRESULT aResultCode); @@ -118,10 +129,19 @@ class VirtualBoxBase : public util::Lockable { RWLockHandle * lockHandle() const; }; -class VirtualBoxTranslatable : public util::Lockable { }; + +/** + * Dummy macro that is used to shut down Qt's lupdate tool warnings in some + * situations. This macro needs to be present inside (better at the very + * beginning) of the declaration of the class that inherits from + * VirtualBoxTranslatable, to make lupdate happy. + */ +#define Q_OBJECT + template -class Shareable { +class Shareable +{ private: @@ -153,7 +173,8 @@ class Shareable { }; template -class Backupable : public Shareable { +class Backupable : public Shareable +{ public: @@ -410,8 +431,9 @@ class Backupable : public Shareable { } while (0) +#define DECLARE_EMPTY_CTOR_DTOR(X) public: X(); ~X(); - +#define DEFINE_EMPTY_CTOR_DTOR(X) X::X() {} X::~X() {} #define VIRTUALBOXBASE_ADD_VIRTUAL_COMPONENT_METHODS(cls, iface) \ diff --git a/repos/ports/src/virtualbox/frontend/VirtualBoxErrorInfoImpl.cpp b/repos/ports/src/virtualbox/frontend/VirtualBoxErrorInfoImpl.cpp new file mode 100644 index 0000000000..874b99cc51 --- /dev/null +++ b/repos/ports/src/virtualbox/frontend/VirtualBoxErrorInfoImpl.cpp @@ -0,0 +1,6 @@ +#include "dummy/macros.h" + +#include "VirtualBoxErrorInfoImpl.h" + +HRESULT VirtualBoxErrorInfo::init(HRESULT, const GUID &, const char *, + const Utf8Str &, IVirtualBoxErrorInfo *) DUMMY(E_FAIL) diff --git a/repos/ports/src/virtualbox/frontend/VirtualBoxErrorInfoImpl.h b/repos/ports/src/virtualbox/frontend/VirtualBoxErrorInfoImpl.h index e69de29bb2..19afd6e105 100644 --- a/repos/ports/src/virtualbox/frontend/VirtualBoxErrorInfoImpl.h +++ b/repos/ports/src/virtualbox/frontend/VirtualBoxErrorInfoImpl.h @@ -0,0 +1,49 @@ +#ifndef ____H_VIRTUALBOXERRORINFO +#define ____H_VIRTUALBOXERRORINFO + +#include + +class VirtualBoxErrorInfo : + public VirtualBoxBase, + VBOX_SCRIPTABLE_IMPL(IVirtualBoxErrorInfo) +{ + public: + + VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT(VirtualBoxErrorInfo, IVirtualBoxErrorInfo) + + DECLARE_NOT_AGGREGATABLE(VirtualBoxErrorInfo) + + DECLARE_PROTECT_FINAL_CONSTRUCT() + + BEGIN_COM_MAP(VirtualBoxErrorInfo) + COM_INTERFACE_ENTRY(IErrorInfo) + COM_INTERFACE_ENTRY(IVirtualBoxErrorInfo) + COM_INTERFACE_ENTRY(IDispatch) + END_COM_MAP() + + HRESULT init(HRESULT aResultCode, const GUID &aIID, + const char *pcszComponent, const com::Utf8Str &strText, + IVirtualBoxErrorInfo *aNext = NULL); + HRESULT FinalConstruct() { return S_OK; } + + /* readonly attribute long resultCode; */ + HRESULT GetResultCode(PRInt32 *aResultCode) { return S_OK; } + + /* readonly attribute long resultDetail; */ + HRESULT GetResultDetail(PRInt32 *aResultDetail) { return S_OK; } + + /* readonly attribute wstring interfaceID; */ + HRESULT GetInterfaceID(PRUnichar * *aInterfaceID) { return S_OK; } + + /* readonly attribute wstring component; */ + HRESULT GetComponent(PRUnichar * *aComponent) { return S_OK; } + + /* readonly attribute wstring text; */ + HRESULT GetText(PRUnichar * *aText) { return S_OK; } + + /* readonly attribute IVirtualBoxErrorInfo next; */ + HRESULT GetNext(IVirtualBoxErrorInfo * *aNext) { return S_OK; } + +}; + +#endif /* ____H_VIRTUALBOXERRORINFO */ diff --git a/repos/ports/src/virtualbox/frontend/VirtualBoxImpl.h b/repos/ports/src/virtualbox/frontend/VirtualBoxImpl.h deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/repos/ports/src/virtualbox/frontend/console.cc b/repos/ports/src/virtualbox/frontend/console.cc index e92023b932..43f85a6875 100644 --- a/repos/ports/src/virtualbox/frontend/console.cc +++ b/repos/ports/src/virtualbox/frontend/console.cc @@ -4,27 +4,14 @@ #include "ConsoleImpl.h" #include "MachineImpl.h" +#include "MouseImpl.h" + +#include "dummy/macros.h" + +#include "console.h" static const bool debug = false; -#define DUMMY(X) \ - { \ - PERR("%s called (%s), not implemented, eip=%p", __func__, __FILE__, \ - __builtin_return_address(0)); \ - while (1) \ - asm volatile ("ud2a"); \ - \ - return X; \ - } - -#define TRACE(X) \ - { \ - if (debug) \ - PDBG(" called (%s) - eip=%p", __FILE__, \ - __builtin_return_address(0)); \ - return X; \ - } - void Console::uninit() DUMMY() HRESULT Console::resume(Reason_T aReason) DUMMY(E_FAIL) HRESULT Console::pause(Reason_T aReason) DUMMY(E_FAIL) @@ -45,19 +32,21 @@ HRESULT Console::attachToTapInterface(INetworkAdapter *networkAdapter) TRACE(S_OK) } -HRESULT Console::teleporterTrg(UVM*, Machine*, com::Utf8Str*, bool, Progress*, +HRESULT Console::teleporterTrg(PUVM, IMachine*, com::Utf8Str*, bool, Progress*, bool*) DUMMY(E_FAIL) HRESULT Console::detachFromTapInterface(INetworkAdapter *networkAdapter) DUMMY(E_FAIL) HRESULT Console::saveState(Reason_T aReason, IProgress **aProgress) DUMMY(E_FAIL) -HRESULT Console::get_Debugger(MachineDebugger**) DUMMY(E_FAIL) -HRESULT Console::get_USBDevices(unsigned int*, IUSBDevice***) DUMMY(E_FAIL) -HRESULT Console::get_RemoteUSBDevices(unsigned int*, IHostUSBDevice***) DUMMY(E_FAIL) -HRESULT Console::get_VRDEServerInfo(VRDEServerInfo**) DUMMY(E_FAIL) -HRESULT Console::get_SharedFolders(unsigned int*, SharedFolder***) DUMMY(E_FAIL) -HRESULT Console::get_AttachedPCIDevices(unsigned int*, PCIDeviceAttachment***) DUMMY(E_FAIL) -HRESULT Console::get_UseHostClipboard(bool*) DUMMY(E_FAIL) -HRESULT Console::set_UseHostClipboard(bool) DUMMY(E_FAIL) -HRESULT Console::get_EmulatedUSB(EmulatedUSB**) DUMMY(E_FAIL) + +STDMETHODIMP Console::COMGETTER(Debugger)(IMachineDebugger **aDebugger) DUMMY(E_FAIL) +STDMETHODIMP Console::COMGETTER(USBDevices)(ComSafeArrayOut(IUSBDevice *, aUSBDevices)) DUMMY(E_FAIL) +STDMETHODIMP Console::COMGETTER(RemoteUSBDevices)(ComSafeArrayOut(IHostUSBDevice *, aRemoteUSBDevices)) DUMMY(E_FAIL) +STDMETHODIMP Console::COMGETTER(VRDEServerInfo)(IVRDEServerInfo **aVRDEServerInfo) DUMMY(E_FAIL) +STDMETHODIMP Console::COMGETTER(EmulatedUSB)(IEmulatedUSB **aEmulatedUSB) DUMMY(E_FAIL) +STDMETHODIMP Console::COMGETTER(SharedFolders)(ComSafeArrayOut(ISharedFolder *, aSharedFolders)) DUMMY(E_FAIL) +STDMETHODIMP Console::COMGETTER(AttachedPCIDevices)(ComSafeArrayOut(IPCIDeviceAttachment *, aAttachments)) DUMMY(E_FAIL) +STDMETHODIMP Console::COMGETTER(UseHostClipboard)(BOOL *aUseHostClipboard) DUMMY(E_FAIL) +STDMETHODIMP Console::COMSETTER(UseHostClipboard)(BOOL aUseHostClipboard) DUMMY(E_FAIL) + HRESULT Console::Reset() DUMMY(E_FAIL) HRESULT Console::Pause() DUMMY(E_FAIL) HRESULT Console::Resume() DUMMY(E_FAIL) @@ -65,25 +54,22 @@ HRESULT Console::PowerButton() HRESULT Console::SleepButton() DUMMY(E_FAIL) HRESULT Console::GetPowerButtonHandled(bool*) DUMMY(E_FAIL) HRESULT Console::GetGuestEnteredACPIMode(bool*) DUMMY(E_FAIL) -HRESULT Console::SaveState(Progress**) DUMMY(E_FAIL) -HRESULT Console::AdoptSavedState(unsigned short*) DUMMY(E_FAIL) +HRESULT Console::SaveState(IProgress**) DUMMY(E_FAIL) +HRESULT Console::AdoptSavedState(IN_BSTR) DUMMY(E_FAIL) HRESULT Console::DiscardSavedState(bool) DUMMY(E_FAIL) HRESULT Console::GetDeviceActivity(DeviceType_T, DeviceActivity_T*) DUMMY(E_FAIL) -HRESULT Console::AttachUSBDevice(unsigned short*) DUMMY(E_FAIL) -HRESULT Console::DetachUSBDevice(unsigned short*, IUSBDevice**) DUMMY(E_FAIL) -HRESULT Console::FindUSBDeviceByAddress(unsigned short*, IUSBDevice**) DUMMY(E_FAIL) -HRESULT Console::FindUSBDeviceById(unsigned short*, IUSBDevice**) DUMMY(E_FAIL) -HRESULT Console::CreateSharedFolder(unsigned short*, unsigned short*, bool, - bool) DUMMY(E_FAIL) -HRESULT Console::RemoveSharedFolder(unsigned short*) DUMMY(E_FAIL) -HRESULT Console::TakeSnapshot(unsigned short*, unsigned short*, Progress**) DUMMY(E_FAIL) -HRESULT Console::DeleteSnapshot(unsigned short*, Progress**) DUMMY(E_FAIL) -HRESULT Console::DeleteSnapshotAndAllChildren(unsigned short*, Progress**) DUMMY(E_FAIL) -HRESULT Console::DeleteSnapshotRange(unsigned short*, unsigned short*, - Progress**) DUMMY(E_FAIL) -HRESULT Console::RestoreSnapshot(Snapshot*, Progress**) DUMMY(E_FAIL) -HRESULT Console::Teleport(unsigned short*, unsigned int, unsigned short*, - unsigned int, Progress**) DUMMY(E_FAIL) +HRESULT Console::AttachUSBDevice(IN_BSTR) DUMMY(E_FAIL) +HRESULT Console::DetachUSBDevice(IN_BSTR, IUSBDevice**) DUMMY(E_FAIL) +HRESULT Console::FindUSBDeviceByAddress(IN_BSTR, IUSBDevice**) DUMMY(E_FAIL) +HRESULT Console::FindUSBDeviceById(IN_BSTR, IUSBDevice**) DUMMY(E_FAIL) +HRESULT Console::CreateSharedFolder(IN_BSTR, IN_BSTR, BOOL, BOOL) DUMMY(E_FAIL) +HRESULT Console::RemoveSharedFolder(IN_BSTR) DUMMY(E_FAIL) +HRESULT Console::TakeSnapshot(IN_BSTR, IN_BSTR, IProgress**) DUMMY(E_FAIL) +HRESULT Console::DeleteSnapshot(IN_BSTR, IProgress**) DUMMY(E_FAIL) +HRESULT Console::DeleteSnapshotAndAllChildren(IN_BSTR, IProgress**) DUMMY(E_FAIL) +HRESULT Console::DeleteSnapshotRange(IN_BSTR, IN_BSTR, IProgress**) DUMMY(E_FAIL) +HRESULT Console::RestoreSnapshot(ISnapshot*, IProgress**) DUMMY(E_FAIL) +HRESULT Console::Teleport(IN_BSTR, ULONG, IN_BSTR, ULONG, IProgress **) DUMMY(E_FAIL) HRESULT Console::setDiskEncryptionKeys(const Utf8Str &strCfg) DUMMY(E_FAIL) void Console::onAdditionsStateChange() TRACE() @@ -111,3 +97,175 @@ HRESULT Console::onParallelPortChange(IParallelPort *aParallelPort) HRESULT Console::onlineMergeMedium(IMediumAttachment *aMediumAttachment, ULONG aSourceIdx, ULONG aTargetIdx, IProgress *aProgress) DUMMY(E_FAIL) + +void fireStateChangedEvent(IEventSource* aSource, + MachineState_T a_state) TRACE() + +void fireRuntimeErrorEvent(IEventSource* aSource, BOOL a_fatal, + CBSTR a_id, CBSTR a_message) +{ + PERR("%s : %u %s %s", __func__, a_fatal, + Utf8Str(a_id).c_str(), Utf8Str(a_message).c_str()); + + TRACE(); +} + +void GenodeConsole::eventWait(IKeyboard * gKeyboard, IMouse * gMouse) +{ + static LONG64 mt_events [64]; + unsigned mt_number = 0; + + _receiver.wait_for_signal(); + + /* read out input capabilities of guest */ + bool guest_abs = false, guest_rel = false, guest_multi = false; + gMouse->COMGETTER(AbsoluteSupported)(&guest_abs); + gMouse->COMGETTER(RelativeSupported)(&guest_rel); + gMouse->COMGETTER(MultiTouchSupported)(&guest_multi); + + for (int i = 0, num_ev = _input.flush(); i < num_ev; ++i) { + Input::Event &ev = _ev_buf[i]; + + bool const is_press = ev.type() == Input::Event::PRESS; + bool const is_release = ev.type() == Input::Event::RELEASE; + bool const is_key = is_press || is_release; + bool const is_motion = ev.type() == Input::Event::MOTION; + bool const is_wheel = ev.type() == Input::Event::WHEEL; + bool const is_touch = ev.type() == Input::Event::TOUCH; + + if (is_key) { + Scan_code scan_code(ev.keycode()); + + unsigned char const release_bit = + (ev.type() == Input::Event::RELEASE) ? 0x80 : 0; + + if (scan_code.is_normal()) + gKeyboard->PutScancode(scan_code.code() | release_bit); + + if (scan_code.is_ext()) { + gKeyboard->PutScancode(0xe0); + gKeyboard->PutScancode(scan_code.ext() | release_bit); + } + } + + /* + * Track press/release status of keys and buttons. Currently, + * only the mouse-button states are actually used. + */ + if (is_press) + _key_status[ev.keycode()] = true; + + if (is_release) + _key_status[ev.keycode()] = false; + + bool const is_mouse_button_event = + is_key && _is_mouse_button(ev.keycode()); + + bool const is_mouse_event = is_mouse_button_event || is_motion; + + if (is_mouse_event) { + unsigned const buttons = (_key_status[Input::BTN_LEFT] ? MouseButtonState_LeftButton : 0) + | (_key_status[Input::BTN_RIGHT] ? MouseButtonState_RightButton : 0) + | (_key_status[Input::BTN_MIDDLE] ? MouseButtonState_MiddleButton : 0); + if (ev.is_absolute_motion()) { + + _last_received_motion_event_was_absolute = true; + + /* transform absolute to relative if guest is so odd */ + if (!guest_abs && guest_rel) { + int const boundary = 20; + int rx = ev.ax() - _ax; + int ry = ev.ay() - _ay; + rx = Genode::min(boundary, Genode::max(-boundary, rx)); + ry = Genode::min(boundary, Genode::max(-boundary, ry)); + gMouse->PutMouseEvent(rx, ry, 0, 0, buttons); + } else + gMouse->PutMouseEventAbsolute(ev.ax(), ev.ay(), 0, + 0, buttons); + + _ax = ev.ax(); + _ay = ev.ay(); + + } else if (ev.is_relative_motion()) { + + _last_received_motion_event_was_absolute = false; + + /* prefer relative motion event */ + if (guest_rel) + gMouse->PutMouseEvent(ev.rx(), ev.ry(), 0, 0, buttons); + else if (guest_abs) { + _ax += ev.rx(); + _ay += ev.ry(); + gMouse->PutMouseEventAbsolute(_ax, _ay, 0, 0, buttons); + } + } + /* only the buttons changed */ + else { + + if (_last_received_motion_event_was_absolute) { + /* prefer absolute button event */ + if (guest_abs) + gMouse->PutMouseEventAbsolute(_ax, _ay, 0, 0, buttons); + else if (guest_rel) + gMouse->PutMouseEvent(0, 0, 0, 0, buttons); + } else { + /* prefer relative button event */ + if (guest_rel) + gMouse->PutMouseEvent(0, 0, 0, 0, buttons); + else if (guest_abs) + gMouse->PutMouseEventAbsolute(_ax, _ay, 0, 0, buttons); + } + + } + } + + if (is_wheel) + gMouse->PutMouseEvent(0, 0, ev.rx(), ev.ry(), 0); + + if (is_touch) { + /* if multitouch queue is full - send it */ + if (mt_number >= sizeof(mt_events) / sizeof(mt_events[0])) { + gMouse->PutEventMultiTouch(mt_number, mt_number, + mt_events, RTTimeMilliTS()); + mt_number = 0; + } + + int x = ev.ax(); + int y = ev.ay(); + int slot = ev.code(); + + /* Mouse::putEventMultiTouch drops values of 0 */ + if (x <= 0) x = 1; + if (y <= 0) y = 1; + + enum MultiTouch { + None = 0x0, + InContact = 0x01, + InRange = 0x02 + }; + + int status = MultiTouch::InContact | MultiTouch::InRange; + if (ev.is_touch_release()) + status = MultiTouch::None; + + uint16_t const s = RT_MAKE_U16(slot, status); + mt_events[mt_number++] = RT_MAKE_U64_FROM_U16(x, y, s, 0); + } + + } + + /* if there are elements - send it */ + if (mt_number) + gMouse->PutEventMultiTouch(mt_number, mt_number, mt_events, + RTTimeMilliTS()); +} + +void GenodeConsole::onMouseCapabilityChange(BOOL supportsAbsolute, BOOL supportsRelative, + BOOL supportsMT, BOOL needsHostCursor) +{ + if (supportsAbsolute) { + /* let the guest hide the software cursor */ + Mouse *gMouse = getMouse(); + gMouse->PutMouseEventAbsolute(-1, -1, 0, 0, 0); + } +} diff --git a/repos/ports/src/virtualbox/frontend/console.h b/repos/ports/src/virtualbox/frontend/console.h index 4457c17010..7f6db08857 100644 --- a/repos/ports/src/virtualbox/frontend/console.h +++ b/repos/ports/src/virtualbox/frontend/console.h @@ -144,165 +144,10 @@ class GenodeConsole : public Console { _input.sigh(_receiver.manage(&_context)); } - void eventWait(IKeyboard * gKeyboard, IMouse * gMouse) - { - static LONG64 mt_events [64]; - unsigned mt_number = 0; - - _receiver.wait_for_signal(); - - /* read out input capabilities of guest */ - bool guest_abs = false, guest_rel = false, guest_multi = false; - gMouse->COMGETTER(AbsoluteSupported)(&guest_abs); - gMouse->COMGETTER(RelativeSupported)(&guest_rel); - gMouse->COMGETTER(MultiTouchSupported)(&guest_multi); - - for (int i = 0, num_ev = _input.flush(); i < num_ev; ++i) { - Input::Event &ev = _ev_buf[i]; - - bool const is_press = ev.type() == Input::Event::PRESS; - bool const is_release = ev.type() == Input::Event::RELEASE; - bool const is_key = is_press || is_release; - bool const is_motion = ev.type() == Input::Event::MOTION; - bool const is_wheel = ev.type() == Input::Event::WHEEL; - bool const is_touch = ev.type() == Input::Event::TOUCH; - - if (is_key) { - Scan_code scan_code(ev.keycode()); - - unsigned char const release_bit = - (ev.type() == Input::Event::RELEASE) ? 0x80 : 0; - - if (scan_code.is_normal()) - gKeyboard->PutScancode(scan_code.code() | release_bit); - - if (scan_code.is_ext()) { - gKeyboard->PutScancode(0xe0); - gKeyboard->PutScancode(scan_code.ext() | release_bit); - } - } - - /* - * Track press/release status of keys and buttons. Currently, - * only the mouse-button states are actually used. - */ - if (is_press) - _key_status[ev.keycode()] = true; - - if (is_release) - _key_status[ev.keycode()] = false; - - bool const is_mouse_button_event = - is_key && _is_mouse_button(ev.keycode()); - - bool const is_mouse_event = is_mouse_button_event || is_motion; - - if (is_mouse_event) { - unsigned const buttons = (_key_status[Input::BTN_LEFT] ? MouseButtonState_LeftButton : 0) - | (_key_status[Input::BTN_RIGHT] ? MouseButtonState_RightButton : 0) - | (_key_status[Input::BTN_MIDDLE] ? MouseButtonState_MiddleButton : 0); - if (ev.is_absolute_motion()) { - - _last_received_motion_event_was_absolute = true; - - /* transform absolute to relative if guest is so odd */ - if (!guest_abs && guest_rel) { - int const boundary = 20; - int rx = ev.ax() - _ax; - int ry = ev.ay() - _ay; - rx = Genode::min(boundary, Genode::max(-boundary, rx)); - ry = Genode::min(boundary, Genode::max(-boundary, ry)); - gMouse->PutMouseEvent(rx, ry, 0, 0, buttons); - } else - gMouse->PutMouseEventAbsolute(ev.ax(), ev.ay(), 0, - 0, buttons); - - _ax = ev.ax(); - _ay = ev.ay(); - - } else if (ev.is_relative_motion()) { - - _last_received_motion_event_was_absolute = false; - - /* prefer relative motion event */ - if (guest_rel) - gMouse->PutMouseEvent(ev.rx(), ev.ry(), 0, 0, buttons); - else if (guest_abs) { - _ax += ev.rx(); - _ay += ev.ry(); - gMouse->PutMouseEventAbsolute(_ax, _ay, 0, 0, buttons); - } - } - /* only the buttons changed */ - else { - - if (_last_received_motion_event_was_absolute) { - /* prefer absolute button event */ - if (guest_abs) - gMouse->PutMouseEventAbsolute(_ax, _ay, 0, 0, buttons); - else if (guest_rel) - gMouse->PutMouseEvent(0, 0, 0, 0, buttons); - } else { - /* prefer relative button event */ - if (guest_rel) - gMouse->PutMouseEvent(0, 0, 0, 0, buttons); - else if (guest_abs) - gMouse->PutMouseEventAbsolute(_ax, _ay, 0, 0, buttons); - } - - } - } - - if (is_wheel) - gMouse->PutMouseEvent(0, 0, ev.rx(), ev.ry(), 0); - - if (is_touch) { - /* if multitouch queue is full - send it */ - if (mt_number >= sizeof(mt_events) / sizeof(mt_events[0])) { - gMouse->PutEventMultiTouch(mt_number, mt_number, - mt_events, RTTimeMilliTS()); - mt_number = 0; - } - - int x = ev.ax(); - int y = ev.ay(); - int slot = ev.code(); - - /* Mouse::putEventMultiTouch drops values of 0 */ - if (x <= 0) x = 1; - if (y <= 0) y = 1; - - enum MultiTouch { - None = 0x0, - InContact = 0x01, - InRange = 0x02 - }; - - int status = MultiTouch::InContact | MultiTouch::InRange; - if (ev.is_touch_release()) - status = MultiTouch::None; - - uint16_t const s = RT_MAKE_U16(slot, status); - mt_events[mt_number++] = RT_MAKE_U64_FROM_U16(x, y, s, 0); - } - - } - - /* if there are elements - send it */ - if (mt_number) - gMouse->PutEventMultiTouch(mt_number, mt_number, mt_events, - RTTimeMilliTS()); - } + void eventWait(IKeyboard * gKeyboard, IMouse * gMouse); void onMouseCapabilityChange(BOOL supportsAbsolute, BOOL supportsRelative, - BOOL supportsMT, BOOL needsHostCursor) - { - if (supportsAbsolute) { - /* let the guest hide the software cursor */ - Mouse *gMouse = getMouse(); - gMouse->PutMouseEventAbsolute(-1, -1, 0, 0, 0); - } - } + BOOL supportsMT, BOOL needsHostCursor); void onMousePointerShapeChange(bool fVisible, bool fAlpha, uint32_t xHot, uint32_t yHot, diff --git a/repos/ports/src/virtualbox/frontend/dummy/autostart.cc b/repos/ports/src/virtualbox/frontend/dummy/autostart.cc index b9ad43e1d1..81b8ee1cb5 100644 --- a/repos/ports/src/virtualbox/frontend/dummy/autostart.cc +++ b/repos/ports/src/virtualbox/frontend/dummy/autostart.cc @@ -1,27 +1,13 @@ #include #include "VirtualBoxBase.h" + +#include "dummy/macros.h" + #include "AutostartDb.h" static bool debug = false; -#define TRACE(X) \ - { \ - if (debug) \ - PDBG(" called (%s) - eip=%p", __FILE__, \ - __builtin_return_address(0)); \ - return X; \ - } - -#define DUMMY(X) \ - { \ - PERR("%s called (%s), not implemented, eip=%p", __func__, __FILE__, \ - __builtin_return_address(0)); \ - while (1) \ - asm volatile ("ud2a"); \ - \ - return X; \ - } int AutostartDb::addAutostartVM(const char *pszVMId) DUMMY(-1) int AutostartDb::addAutostopVM(char const*) DUMMY(-1) diff --git a/repos/ports/src/virtualbox/frontend/dummy/errorinfo.cc b/repos/ports/src/virtualbox/frontend/dummy/errorinfo.cc index 38410f23e8..0120e9ae0f 100644 --- a/repos/ports/src/virtualbox/frontend/dummy/errorinfo.cc +++ b/repos/ports/src/virtualbox/frontend/dummy/errorinfo.cc @@ -1,31 +1,16 @@ #include #include "VirtualBoxBase.h" + +#include "dummy/macros.h" + #include static bool debug = false; -#define TRACE(X) \ - { \ - if (debug) \ - PDBG(" called (%s) - eip=%p", __FILE__, \ - __builtin_return_address(0)); \ - return X; \ - } - -#define DUMMY(X) \ - { \ - PERR("%s called (%s), not implemented, eip=%p", __func__, __FILE__, \ - __builtin_return_address(0)); \ - while (1) \ - asm volatile ("ud2a"); \ - \ - return X; \ - } void ErrorInfo::init(bool aKeepObj) TRACE() void ErrorInfo::cleanup() TRACE() HRESULT ErrorInfoKeeper::restore() TRACE(S_OK) void ErrorInfo::copyFrom(const ErrorInfo &x) DUMMY() - diff --git a/repos/ports/src/virtualbox/frontend/dummy/host.cc b/repos/ports/src/virtualbox/frontend/dummy/host.cc index ab5719542f..d108ba8efc 100644 --- a/repos/ports/src/virtualbox/frontend/dummy/host.cc +++ b/repos/ports/src/virtualbox/frontend/dummy/host.cc @@ -4,26 +4,12 @@ #include +#include "dummy/macros.h" + +#include "HostImpl.h" + static bool debug = false; -#define TRACE(X) \ - { \ - if (debug) \ - PDBG(" called (%s) - eip=%p", __FILE__, \ - __builtin_return_address(0)); \ - return X; \ - } - -#define DUMMY(X) \ - { \ - PERR("%s called (%s:%u), not implemented, eip=%p", __func__, \ - __FILE__, __LINE__, \ - __builtin_return_address(0)); \ - while (1) \ - asm volatile ("ud2a"); \ - \ - return X; \ - } STDMETHODIMP Host::COMGETTER(DVDDrives)(ComSafeArrayOut(IMedium *, drives)) DUMMY(E_FAIL) STDMETHODIMP Host::COMGETTER(FloppyDrives)(ComSafeArrayOut(IMedium *, drives)) DUMMY(E_FAIL) diff --git a/repos/ports/src/virtualbox/frontend/dummy/macros.h b/repos/ports/src/virtualbox/frontend/dummy/macros.h new file mode 100644 index 0000000000..ace9b6cd4e --- /dev/null +++ b/repos/ports/src/virtualbox/frontend/dummy/macros.h @@ -0,0 +1,35 @@ +#ifndef ____H_MACROS +#define ____H_MACROS + +#include + +#define TRACE(X) \ + { \ + if (debug) \ + PDBG(" called (%s) - eip=%p", __FILE__, \ + __builtin_return_address(0)); \ + return X; \ + } + +#define DUMMY(X) \ + { \ + PERR("%s called (%s:%u), not implemented, eip=%p", __func__, __FILE__, __LINE__, \ + __builtin_return_address(0)); \ + while (1) \ + asm volatile ("ud2a"); \ + \ + return X; \ + } + +#define DUMMY_STATIC(X) \ + { \ + static X dummy; \ + PERR("%s called (%s), not implemented, eip=%p", __func__, __FILE__, \ + __builtin_return_address(0)); \ + while (1) \ + asm volatile ("ud2a"); \ + \ + return dummy; \ + } + +#endif /* ____H_MACROS */ diff --git a/repos/ports/src/virtualbox/frontend/dummy/rest.cc b/repos/ports/src/virtualbox/frontend/dummy/rest.cc index 841dc579fa..a958564e8f 100644 --- a/repos/ports/src/virtualbox/frontend/dummy/rest.cc +++ b/repos/ports/src/virtualbox/frontend/dummy/rest.cc @@ -1,70 +1,144 @@ #include -#include "VirtualBoxBase.h" -#include "ClientToken.h" -#include "TokenImpl.h" -#include "ProgressProxyImpl.h" -#include "SharedFolderImpl.h" - -#include -#include "USBProxyService.h" +#include "dummy/macros.h" static bool debug = false; -#define TRACE(X) \ - { \ - if (debug) \ - PDBG(" called (%s) - eip=%p", __FILE__, \ - __builtin_return_address(0)); \ - return X; \ - } -#define DUMMY(X) \ - { \ - PERR("%s called (%s:%u), not implemented, eip=%p", __func__, \ - __FILE__, __LINE__, \ - __builtin_return_address(0)); \ - while (1) \ - asm volatile ("ud2a"); \ - \ - return X; \ - } +/* ApplianceImplExport.cpp */ -#define DUMMY_STATIC(X) \ - { \ - static X dummy; \ - PERR("%s called (%s), not implemented, eip=%p", __func__, __FILE__, \ - __builtin_return_address(0)); \ - while (1) \ - asm volatile ("ud2a"); \ - \ - return dummy; \ - } - -/* static */ -const Guid Guid::Empty; - -HRESULT IMediumFormat::get_Capabilities(unsigned int*, - MediumFormatCapabilities_T**) DUMMY(E_FAIL) +#include "MachineImpl.h" HRESULT Machine::ExportTo(IAppliance *aAppliance, IN_BSTR location, IVirtualSystemDescription **aDescription) DUMMY(E_FAIL) + +/* com.cpp */ + +#include "VBox/com/Guid.h" + +const com::Guid com::Guid::Empty; + + +/* DisplayImpl.cpp */ + +#include "DisplayImpl.h" + +void fireGuestMonitorChangedEvent(IEventSource* aSource, + GuestMonitorChangedEventType_T a_changeType, + ULONG a_screenId, + ULONG a_originX, + ULONG a_originY, + ULONG a_width, + ULONG a_height) TRACE() + + +/* DisplayPNGUtil.cpp */ + +#include "DisplayImpl.h" + int DisplayMakePNG(uint8_t *, uint32_t, uint32_t, uint8_t **, uint32_t *, uint32_t *, uint32_t *, uint8_t) DUMMY(-1) -ProgressErrorInfo::ProgressErrorInfo(Progress*) DUMMY() -HRESULT ProgressProxy::init(VirtualBox*, IUnknown*, unsigned short const*, - bool) DUMMY(E_FAIL) -HRESULT ProgressProxy::init(VirtualBox*, void*, unsigned short const*, bool, - unsigned int, unsigned short const*, unsigned int, - unsigned int) DUMMY(E_FAIL) -HRESULT ProgressProxy::notifyComplete(HRESULT) DUMMY(E_FAIL) -HRESULT ProgressProxy::notifyComplete(HRESULT, GUID const&, char const*, - char const*, ...) DUMMY(E_FAIL) -bool ProgressProxy::setOtherProgressObject(Progress*) DUMMY(false) -HRESULT ProgressProxy::FinalConstruct() DUMMY(E_FAIL) +/* ErrorInfo.cpp */ + +#include "VBox/com/ErrorInfo.h" + +com::ProgressErrorInfo::ProgressErrorInfo(IProgress*) DUMMY() + + +/* EventImpl.cpp */ + +#include "EventImpl.h" + +HRESULT VBoxEventDesc::init(IEventSource* aSource, VBoxEventType_T aType, ...) TRACE(S_OK) +HRESULT VBoxEventDesc::reinit(VBoxEventType_T aType, ...) TRACE(S_OK) + + +/* GuestCtrlImpl.cpp */ + +#include "GuestImpl.h" + +STDMETHODIMP Guest::CreateSession(IN_BSTR, IN_BSTR, IN_BSTR, IN_BSTR, + IGuestSession **) DUMMY(E_FAIL) +STDMETHODIMP Guest::FindSession(IN_BSTR, + ComSafeArrayOut(IGuestSession *, aSessions)) DUMMY(E_FAIL) +STDMETHODIMP Guest::UpdateGuestAdditions(IN_BSTR, + ComSafeArrayIn(IN_BSTR, aArguments), + ComSafeArrayIn(AdditionsUpdateFlag_T, aFlags), + IProgress **aProgress) DUMMY(E_FAIL) + + +/* initterm.cpp */ + +#include "VBox/com/com.h" + +HRESULT com::Initialize(bool fGui) TRACE(S_OK) +HRESULT com::Shutdown() DUMMY(E_FAIL) + + +/* MachineImpl.cpp */ + +#include "MachineImpl.h" + +void fireHostPCIDevicePlugEvent(IEventSource* aSource, + CBSTR a_machineId, + BOOL a_plugged, + BOOL a_success, + IPCIDeviceAttachment* a_attachment, + CBSTR a_message) TRACE() + +/* NATNetworkImpl.cpp */ + +#include "NetworkServiceRunner.h" +#include "NATNetworkImpl.h" + +NATNetwork::NATNetwork() : mVirtualBox(nullptr) DUMMY() +NATNetwork::~NATNetwork() DUMMY() +STDMETHODIMP NATNetwork::COMGETTER(EventSource)(IEventSource **IEventSource) DUMMY(E_FAIL) +STDMETHODIMP NATNetwork::COMGETTER(Enabled)(BOOL *aEnabled) DUMMY(E_FAIL) +STDMETHODIMP NATNetwork::COMSETTER(Enabled)(BOOL aEnabled) DUMMY(E_FAIL) +STDMETHODIMP NATNetwork::COMGETTER(NetworkName)(BSTR *aName) DUMMY(E_FAIL) +STDMETHODIMP NATNetwork::COMSETTER(NetworkName)(IN_BSTR aName) DUMMY(E_FAIL) +STDMETHODIMP NATNetwork::COMGETTER(Gateway)(BSTR *aIPGateway) DUMMY(E_FAIL) +STDMETHODIMP NATNetwork::COMGETTER(Network)(BSTR *aIPNetwork) DUMMY(E_FAIL) +STDMETHODIMP NATNetwork::COMSETTER(Network)(IN_BSTR aIPNetwork) DUMMY(E_FAIL) +STDMETHODIMP NATNetwork::COMGETTER(IPv6Enabled)(BOOL *aEnabled) DUMMY(E_FAIL) +STDMETHODIMP NATNetwork::COMSETTER(IPv6Enabled)(BOOL aEnabled) DUMMY(E_FAIL) +STDMETHODIMP NATNetwork::COMGETTER(IPv6Prefix)(BSTR *aName) DUMMY(E_FAIL) +STDMETHODIMP NATNetwork::COMSETTER(IPv6Prefix)(IN_BSTR aName) DUMMY(E_FAIL) +STDMETHODIMP NATNetwork::COMGETTER(AdvertiseDefaultIPv6RouteEnabled)(BOOL *aEnabled) DUMMY(E_FAIL) +STDMETHODIMP NATNetwork::COMSETTER(AdvertiseDefaultIPv6RouteEnabled)(BOOL aEnabled) DUMMY(E_FAIL) +STDMETHODIMP NATNetwork::COMGETTER(NeedDhcpServer)(BOOL *aEnabled) DUMMY(E_FAIL) +STDMETHODIMP NATNetwork::COMSETTER(NeedDhcpServer)(BOOL aEnabled) DUMMY(E_FAIL) +STDMETHODIMP NATNetwork::COMGETTER(LocalMappings)(ComSafeArrayOut(BSTR, aLocalMappings)) DUMMY(E_FAIL) +STDMETHODIMP NATNetwork::AddLocalMapping(IN_BSTR aHostId, LONG aOffset) DUMMY(E_FAIL) +STDMETHODIMP NATNetwork::COMGETTER(LoopbackIp6)(LONG *aLoopbackIp6) DUMMY(E_FAIL) +STDMETHODIMP NATNetwork::COMSETTER(LoopbackIp6)(LONG aLoopbackIp6) DUMMY(E_FAIL) +STDMETHODIMP NATNetwork::COMGETTER(PortForwardRules4)(ComSafeArrayOut(BSTR, aPortForwardRules4)) DUMMY(E_FAIL) +STDMETHODIMP NATNetwork::COMGETTER(PortForwardRules6)(ComSafeArrayOut(BSTR, aPortForwardRules6)) DUMMY(E_FAIL) +STDMETHODIMP NATNetwork::AddPortForwardRule(BOOL aIsIpv6, + IN_BSTR aPortForwardRuleName, + NATProtocol_T aProto, + IN_BSTR aHostIp, + USHORT aHostPort, + IN_BSTR aGuestIp, + USHORT aGuestPort) DUMMY(E_FAIL) +STDMETHODIMP NATNetwork::RemovePortForwardRule(BOOL aIsIpv6, IN_BSTR aPortForwardRuleName) DUMMY(E_FAIL) +STDMETHODIMP NATNetwork::Start(IN_BSTR aTrunkType) DUMMY(E_FAIL) +STDMETHODIMP NATNetwork::Stop() DUMMY(E_FAIL) +HRESULT NATNetwork::init(VirtualBox *aVirtualBox, const settings::NATNetwork &) DUMMY(E_FAIL) +HRESULT NATNetwork::FinalConstruct() DUMMY(E_FAIL) +void NATNetwork::uninit() DUMMY() + + +/* ProgressProxyImpl.cpp */ + +#include "ProgressProxyImpl.h" + +STDMETHODIMP ProgressProxy::Cancel() DUMMY(E_FAIL) +void ProgressProxy::clearOtherProgressObjectInternal(bool fEarly) DUMMY() STDMETHODIMP ProgressProxy::COMGETTER(Cancelable)(BOOL *) DUMMY(E_FAIL) STDMETHODIMP ProgressProxy::COMGETTER(Percent)(ULONG *) DUMMY(E_FAIL) STDMETHODIMP ProgressProxy::COMGETTER(TimeRemaining)(LONG *) DUMMY(E_FAIL) @@ -77,160 +151,102 @@ STDMETHODIMP ProgressProxy::COMGETTER(OperationDescription)(BSTR *) STDMETHODIMP ProgressProxy::COMGETTER(OperationPercent)(ULONG *) DUMMY(E_FAIL) STDMETHODIMP ProgressProxy::COMSETTER(Timeout)(ULONG) DUMMY(E_FAIL) STDMETHODIMP ProgressProxy::COMGETTER(Timeout)(ULONG *) DUMMY(E_FAIL) - -STDMETHODIMP ProgressProxy::WaitForCompletion(LONG aTimeout) DUMMY(E_FAIL) -STDMETHODIMP ProgressProxy::WaitForOperationCompletion(ULONG, LONG) DUMMY(E_FAIL) -STDMETHODIMP ProgressProxy::Cancel() DUMMY(E_FAIL) +void ProgressProxy::copyProgressInfo(IProgress *pOtherProgress, bool fEarly) DUMMY() +HRESULT ProgressProxy::FinalConstruct() DUMMY(E_FAIL) +void ProgressProxy::FinalRelease() DUMMY() +HRESULT ProgressProxy::init(VirtualBox*, IUnknown*, unsigned short const*, + bool) DUMMY(E_FAIL) +HRESULT ProgressProxy::init(VirtualBox*, void*, unsigned short const*, bool, + unsigned int, unsigned short const*, unsigned int, + unsigned int) DUMMY(E_FAIL) +HRESULT ProgressProxy::notifyComplete(HRESULT) DUMMY(E_FAIL) +HRESULT ProgressProxy::notifyComplete(HRESULT, GUID const&, char const*, + char const*, ...) DUMMY(E_FAIL) STDMETHODIMP ProgressProxy::SetCurrentOperationProgress(ULONG aPercent) DUMMY(E_FAIL) STDMETHODIMP ProgressProxy::SetNextOperation(IN_BSTR, ULONG) DUMMY(E_FAIL) - -void ProgressProxy::clearOtherProgressObjectInternal(bool fEarly) DUMMY() -void ProgressProxy::copyProgressInfo(IProgress *pOtherProgress, bool fEarly) DUMMY() +bool ProgressProxy::setOtherProgressObject(IProgress*) DUMMY(false) void ProgressProxy::uninit() DUMMY() -void ProgressProxy::FinalRelease() DUMMY() - -template<> -void DummyClass::fireNATRedirectEvent(ComObjPtr const&, - unsigned short*, - unsigned int&, bool&, - unsigned short*&, - NATProtocol_T&, - unsigned short*&, - unsigned short&, - unsigned short*&, - unsigned short&) DUMMY() - -template<> -void DummyClass::fireStateChangedEvent(ComObjPtr const&, - MachineState_T) TRACE() -template<> -void DummyClass::fireRuntimeErrorEvent(ComObjPtr const&, - bool aFatal, IN_BSTR aErrorID, - IN_BSTR aMessage) -{ - PERR("%s : %u %s %s", __func__, aFatal, - Utf8Str(aErrorID).c_str(), Utf8Str(aMessage).c_str()); - - TRACE(); -} - -template<> -void DummyClass::fireHostPCIDevicePlugEvent(ComPtr&, - unsigned short*, bool, - bool, ComObjPtr&, - void*) DUMMY() - -NATNetwork::NATNetwork() : mVirtualBox(nullptr) DUMMY() -void NATNetwork::uninit() DUMMY() -HRESULT NATNetwork::init(VirtualBox *aVirtualBox, IN_BSTR aName) DUMMY(E_FAIL) -HRESULT NATNetwork::init(VirtualBox *aVirtualBox, const settings::NATNetwork &) DUMMY(E_FAIL) -HRESULT NATNetwork::FinalConstruct() DUMMY(E_FAIL) -HRESULT NATNetwork::saveSettings(settings::NATNetwork &data) DUMMY(E_FAIL) - -STDMETHODIMP NATNetwork::COMGETTER(EventSource)(IEventSource **IEventSource) DUMMY(E_FAIL) -STDMETHODIMP NATNetwork::COMGETTER(Enabled)(BOOL *aEnabled) DUMMY(E_FAIL) -STDMETHODIMP NATNetwork::COMSETTER(Enabled)(BOOL aEnabled) DUMMY(E_FAIL) - -STDMETHODIMP NATNetwork::COMGETTER(NetworkName)(BSTR *aName) DUMMY(E_FAIL) -STDMETHODIMP NATNetwork::COMSETTER(NetworkName)(IN_BSTR aName) DUMMY(E_FAIL) - -STDMETHODIMP NATNetwork::COMGETTER(Gateway)(BSTR *aIPGateway) DUMMY(E_FAIL) - -STDMETHODIMP NATNetwork::COMGETTER(Network)(BSTR *aIPNetwork) DUMMY(E_FAIL) -STDMETHODIMP NATNetwork::COMSETTER(Network)(IN_BSTR aIPNetwork) DUMMY(E_FAIL) - -STDMETHODIMP NATNetwork::COMGETTER(IPv6Enabled)(BOOL *aEnabled) DUMMY(E_FAIL) -STDMETHODIMP NATNetwork::COMSETTER(IPv6Enabled)(BOOL aEnabled) DUMMY(E_FAIL) - -STDMETHODIMP NATNetwork::COMGETTER(IPv6Prefix)(BSTR *aName) DUMMY(E_FAIL) -STDMETHODIMP NATNetwork::COMSETTER(IPv6Prefix)(IN_BSTR aName) DUMMY(E_FAIL) - -STDMETHODIMP NATNetwork::COMGETTER(AdvertiseDefaultIPv6RouteEnabled)(BOOL *aEnabled) DUMMY(E_FAIL) -STDMETHODIMP NATNetwork::COMSETTER(AdvertiseDefaultIPv6RouteEnabled)(BOOL aEnabled) DUMMY(E_FAIL) - -STDMETHODIMP NATNetwork::COMGETTER(NeedDhcpServer)(BOOL *aEnabled) DUMMY(E_FAIL) -STDMETHODIMP NATNetwork::COMSETTER(NeedDhcpServer)(BOOL aEnabled) DUMMY(E_FAIL) - -STDMETHODIMP NATNetwork::COMGETTER(LocalMappings)(ComSafeArrayOut(BSTR, aLocalMappings)) DUMMY(E_FAIL) -STDMETHODIMP NATNetwork::AddLocalMapping(IN_BSTR aHostId, LONG aOffset) DUMMY(E_FAIL) - -STDMETHODIMP NATNetwork::COMGETTER(LoopbackIp6)(LONG *aLoopbackIp6) DUMMY(E_FAIL) -STDMETHODIMP NATNetwork::COMSETTER(LoopbackIp6)(LONG aLoopbackIp6) DUMMY(E_FAIL) - -STDMETHODIMP NATNetwork::COMGETTER(PortForwardRules4)(ComSafeArrayOut(BSTR, aPortForwardRules4)) DUMMY(E_FAIL) -STDMETHODIMP NATNetwork::COMGETTER(PortForwardRules6)(ComSafeArrayOut(BSTR, aPortForwardRules6)) DUMMY(E_FAIL) - -STDMETHODIMP NATNetwork::AddPortForwardRule(BOOL aIsIpv6, - IN_BSTR aPortForwardRuleName, - NATProtocol_T aProto, - IN_BSTR aHostIp, - USHORT aHostPort, - IN_BSTR aGuestIp, - USHORT aGuestPort) DUMMY(E_FAIL) -STDMETHODIMP NATNetwork::RemovePortForwardRule(BOOL aIsIpv6, IN_BSTR aPortForwardRuleName) DUMMY(E_FAIL) - -STDMETHODIMP NATNetwork::Start(IN_BSTR aTrunkType) DUMMY(E_FAIL) -STDMETHODIMP NATNetwork::Stop() DUMMY(E_FAIL) +STDMETHODIMP ProgressProxy::WaitForCompletion(LONG aTimeout) DUMMY(E_FAIL) +STDMETHODIMP ProgressProxy::WaitForOperationCompletion(ULONG, LONG) DUMMY(E_FAIL) -HRESULT com::Shutdown() DUMMY(E_FAIL) +/* SharedFolderImpl.cpp */ -void Display::fireGuestMonitorChangedEvent(EventSource*, GuestMonitorChangedEventType, int, int, int, int, int) DUMMY() +#include "SharedFolderImpl.h" -STDMETHODIMP Guest::UpdateGuestAdditions(IN_BSTR, - ComSafeArrayIn(IN_BSTR, aArguments), - ComSafeArrayIn(AdditionsUpdateFlag_T, aFlags), - IProgress **aProgress) DUMMY(E_FAIL) -STDMETHODIMP Guest::FindSession(IN_BSTR, - ComSafeArrayOut(IGuestSession *, aSessions)) DUMMY(E_FAIL) -STDMETHODIMP Guest::CreateSession(IN_BSTR, IN_BSTR, IN_BSTR, IN_BSTR, - IGuestSession **) DUMMY(E_FAIL) - -void ConsoleVRDPServer::SendUpdate(unsigned int, void*, unsigned int) const DUMMY() -void ConsoleVRDPServer::SendUpdateBitmap(unsigned int, unsigned int, - unsigned int, unsigned int, - unsigned int) const DUMMY() -void ConsoleVRDPServer::Stop() DUMMY() - -void IStateChangedEvent::get_State(MachineState_T*) DUMMY() - -HRESULT IEventListener::HandleEvent(IEvent*) DUMMY(E_FAIL) HRESULT SharedFolder::init(Console*, com::Utf8Str const&, com::Utf8Str const&, bool, bool, bool) DUMMY(E_FAIL) -Machine::ClientToken::ClientToken(const ComObjPtr &, SessionMachine *) TRACE() -bool Machine::ClientToken::isReady() TRACE(true) -void Machine::ClientToken::getId(Utf8Str &strId) -{ - strId = "ClientTokenID DUMMY"; - TRACE() -} -HRESULT com::Initialize(bool fGui) TRACE(S_OK) +/* USBFilter.cpp */ - - - - -HRESULT USBProxyService::captureDeviceForVM(SessionMachine *, IN_GUID) DUMMY(E_FAIL) -HRESULT USBProxyService::detachAllDevicesFromVM(SessionMachine*, bool, bool) DUMMY(E_FAIL) -HRESULT USBProxyService::autoCaptureDevicesForVM(SessionMachine *) DUMMY(E_FAIL) -HRESULT USBProxyService::detachDeviceFromVM(SessionMachine*, GUID, bool) DUMMY(E_FAIL) -void matching::ParsedBoolFilter::parse(com::Bstr const&) DUMMY() +#include "VBox/usbfilter.h" USBFILTERMATCH USBFilterGetMatchingMethod(PCUSBFILTER, USBFILTERIDX) DUMMY(USBFILTERMATCH_INVALID) -const char * USBFilterGetString(PCUSBFILTER pFilter, USBFILTERIDX enmFieldIdx) DUMMY(nullptr) - -bool USBFilterIsMethodNumeric(USBFILTERMATCH enmMatchingMethod) DUMMY(false) -bool USBFilterMatch(PCUSBFILTER pFilter, PCUSBFILTER pDevice) DUMMY(false) -void USBFilterInit(PUSBFILTER pFilter, USBFILTERTYPE enmType) DUMMY() -int USBFilterSetStringExact(PUSBFILTER, USBFILTERIDX, const char *, bool) DUMMY(-1) -int USBFilterSetNumExact(PUSBFILTER, USBFILTERIDX, uint16_t, bool) DUMMY(-1) int USBFilterGetNum(PCUSBFILTER pFilter, USBFILTERIDX enmFieldIdx) DUMMY(-1) -bool USBFilterIsNumericField(USBFILTERIDX enmFieldIdx) DUMMY(false) +const char * USBFilterGetString(PCUSBFILTER pFilter, USBFILTERIDX enmFieldIdx) DUMMY(nullptr) +void USBFilterInit(PUSBFILTER pFilter, USBFILTERTYPE enmType) DUMMY() +bool USBFilterIsMethodNumeric(USBFILTERMATCH enmMatchingMethod) DUMMY(false) bool USBFilterIsMethodString(USBFILTERMATCH enmMatchingMethod) DUMMY(false) +bool USBFilterIsNumericField(USBFILTERIDX enmFieldIdx) DUMMY(false) bool USBFilterIsStringField(USBFILTERIDX enmFieldIdx) DUMMY(false) -int USBFilterSetStringPattern(PUSBFILTER, USBFILTERIDX, const char *, bool) DUMMY(-1) -int USBFilterSetNumExpression(PUSBFILTER, USBFILTERIDX, const char *, bool) DUMMY(-1) +bool USBFilterMatch(PCUSBFILTER pFilter, PCUSBFILTER pDevice) DUMMY(false) int USBFilterSetIgnore(PUSBFILTER pFilter, USBFILTERIDX enmFieldIdx) DUMMY(-1) +int USBFilterSetNumExact(PUSBFILTER, USBFILTERIDX, uint16_t, bool) DUMMY(-1) +int USBFilterSetNumExpression(PUSBFILTER, USBFILTERIDX, const char *, bool) DUMMY(-1) +int USBFilterSetStringExact(PUSBFILTER, USBFILTERIDX, const char *, bool) DUMMY(-1) +int USBFilterSetStringPattern(PUSBFILTER, USBFILTERIDX, const char *, bool) DUMMY(-1) + +/* USBProxyService.cpp */ + +#include "USBProxyService.h" + +HRESULT USBProxyService::autoCaptureDevicesForVM(SessionMachine *) DUMMY(E_FAIL) +HRESULT USBProxyService::captureDeviceForVM(SessionMachine *, IN_GUID) DUMMY(E_FAIL) +HRESULT USBProxyService::detachAllDevicesFromVM(SessionMachine*, bool, bool) DUMMY(E_FAIL) +HRESULT USBProxyService::detachDeviceFromVM(SessionMachine*, IN_GUID, bool) DUMMY(E_FAIL) + + +/* VirtualBoxImpl.cpp */ + +#include "VirtualBoxImpl.h" + +void fireNATRedirectEvent(IEventSource* aSource, + CBSTR a_machineId, + ULONG a_slot, + BOOL a_remove, + CBSTR a_name, + NATProtocol_T a_proto, + CBSTR a_hostIP, + LONG a_hostPort, + CBSTR a_guestIP, + LONG a_guestPort) TRACE() + +void fireNATNetworkChangedEvent(IEventSource* aSource, + CBSTR a_networkName) TRACE() + +void fireNATNetworkStartStopEvent(IEventSource* aSource, + CBSTR a_networkName, + BOOL a_startEvent) TRACE() + +void fireNATNetworkSettingEvent(IEventSource* aSource, + CBSTR a_networkName, + BOOL a_enabled, + CBSTR a_network, + CBSTR a_gateway, + BOOL a_advertiseDefaultIPv6RouteEnabled, + BOOL a_needDhcpServer) TRACE() + +void fireNATNetworkPortForwardEvent(IEventSource* aSource, + CBSTR a_networkName, + BOOL a_create, + BOOL a_ipv6, + CBSTR a_name, + NATProtocol_T a_proto, + CBSTR a_hostIp, + LONG a_hostPort, + CBSTR a_guestIp, + LONG a_guestPort) TRACE() + +void fireHostNameResolutionConfigurationChangeEvent(IEventSource* aSource) TRACE() diff --git a/repos/ports/src/virtualbox/frontend/dummy/virtualboxbase.cc b/repos/ports/src/virtualbox/frontend/dummy/virtualboxbase.cc index cd1faf63bc..b0f90a81cd 100644 --- a/repos/ports/src/virtualbox/frontend/dummy/virtualboxbase.cc +++ b/repos/ports/src/virtualbox/frontend/dummy/virtualboxbase.cc @@ -3,26 +3,10 @@ #include "VirtualBoxImpl.h" #include "VBox/com/MultiResult.h" +#include "dummy/macros.h" + static bool debug = false; -#define TRACE(X) \ - { \ - if (debug) \ - PDBG(" called (%s) - eip=%p", __FILE__, \ - __builtin_return_address(0)); \ - return X; \ - } - -#define DUMMY(X) \ - { \ - PERR("%s called (%s:%u), not implemented, eip=%p", __func__, __FILE__, __LINE__, \ - __builtin_return_address(0)); \ - while (1) \ - asm volatile ("ud2a"); \ - \ - return X; \ - } - HRESULT VirtualBoxBase::setError(HRESULT aResultCode, const char *pcsz, ...) { Genode::printf(ESC_ERR); @@ -50,9 +34,4 @@ HRESULT VirtualBoxBase::handleUnexpectedExceptions(VirtualBoxBase *const, HRESULT VirtualBoxBase::setErrorInternal(HRESULT, GUID const&, char const*, com::Utf8Str, bool, bool) DUMMY(E_FAIL) HRESULT VirtualBoxBase::initializeComForThread(void) TRACE(S_OK) - -HRESULT VirtualBoxErrorInfo::init(HRESULT, const GUID &, const char *, - const Utf8Str &, IVirtualBoxErrorInfo *) DUMMY(E_FAIL) - -HRESULT VBoxEventDesc::init(IEventSource* aSource, VBoxEventType_T aType, ...) TRACE(S_OK) -HRESULT VBoxEventDesc::reinit(VBoxEventType_T aType, ...) TRACE(S_OK) +void VirtualBoxBase::uninitializeComForThread(void) TRACE() diff --git a/repos/ports/src/virtualbox/frontend/fb.h b/repos/ports/src/virtualbox/frontend/fb.h index e1a0b8a957..c9d4ad0831 100644 --- a/repos/ports/src/virtualbox/frontend/fb.h +++ b/repos/ports/src/virtualbox/frontend/fb.h @@ -18,7 +18,11 @@ /* VirtualBox includes */ -class Genodefb : public Framebuffer +#include "Global.h" +#include "VirtualBoxBase.h" + +class Genodefb : + VBOX_SCRIPTABLE_IMPL(IFramebuffer) { private: @@ -158,7 +162,7 @@ class Genodefb : public Framebuffer return S_OK; } - STDMETHODIMP COMGETTER(WinId) (ULONG64 *winId) + STDMETHODIMP COMGETTER(WinId) (PRInt64 *winId) { Assert(!"FixMe"); return S_OK; @@ -193,4 +197,9 @@ class Genodefb : public Framebuffer { return E_NOTIMPL; } + + STDMETHODIMP Notify3DEvent(PRUint32, PRUint8*) + { + return E_NOTIMPL; + } }; diff --git a/repos/ports/src/virtualbox/frontend/main.cc b/repos/ports/src/virtualbox/frontend/main.cc index 2910de9dbc..41076e8e34 100644 --- a/repos/ports/src/virtualbox/frontend/main.cc +++ b/repos/ports/src/virtualbox/frontend/main.cc @@ -21,12 +21,15 @@ #include #include #include +#include #include /* Virtualbox includes of generic Main frontend */ #include "ConsoleImpl.h" #include "MachineImpl.h" #include "MouseImpl.h" +#include "SessionImpl.h" +#include "VirtualBoxImpl.h" /* Genode port specific includes */ #include "console.h" @@ -62,8 +65,6 @@ void * nsMemory::Clone(const void*, size_t) /** * Other stuff */ -Framebuffer::Framebuffer() { } -Framebuffer::~Framebuffer() { } int com::GetVBoxUserHomeDirectory(char *aDir, size_t aDirLen, bool fCreateDir) { @@ -111,7 +112,7 @@ HRESULT setupmachine() return rc; // open a session - ComObjPtr session; + ComObjPtr session; rc = session.createObject(); if (FAILED(rc)) return rc; @@ -120,18 +121,6 @@ HRESULT setupmachine() if (FAILED(rc)) return rc; - /* Console object */ - GenodeConsole * gConsole = new GenodeConsole(); - /* Derived from Session::AssignMachine method in Main/src-client/SessionImpl.cpp */ - static IInternalMachineControl control; - rc = control.init(machine); - if (FAILED(rc)) - return rc; - - rc = gConsole->init(machine, &control, LockType_VM); - if (FAILED(rc)) - return rc; - /* Validate configured memory of vbox file and Genode config */ ULONG memory_vbox; rc = machine->COMGETTER(MemorySize)(&memory_vbox); @@ -153,8 +142,12 @@ HRESULT setupmachine() return E_FAIL; } + /* Console object */ + ComPtr gConsole; + rc = session->COMGETTER(Console)(gConsole.asOutParam()); + /* Display object */ - ComPtr display; + ComPtr display; rc = gConsole->COMGETTER(Display)(display.asOutParam()); if (FAILED(rc)) return rc; @@ -191,7 +184,7 @@ HRESULT setupmachine() /* request mouse object */ static ComPtr gMouse; rc = gConsole->COMGETTER(Mouse)(gMouse.asOutParam()); - if (RT_FAILURE(rc)) + if (FAILED(rc)) return rc; Assert (&*gMouse); @@ -203,8 +196,10 @@ HRESULT setupmachine() Assert (&*gKeyboard); /* handle input of Genode and forward it to VMM layer */ + ComPtr genodeConsole = gConsole; + RTLogPrintf("genodeConsole = %p\n", genodeConsole); while (true) { - gConsole->eventWait(gKeyboard, gMouse); + genodeConsole->eventWait(gKeyboard, gMouse); } Assert(!"return not expected"); diff --git a/repos/ports/src/virtualbox/include/VBox/HostServices/VBoxClipboardSvc.h b/repos/ports/src/virtualbox/include/VBox/HostServices/VBoxClipboardSvc.h index e69de29bb2..14565a70a6 100644 --- a/repos/ports/src/virtualbox/include/VBox/HostServices/VBoxClipboardSvc.h +++ b/repos/ports/src/virtualbox/include/VBox/HostServices/VBoxClipboardSvc.h @@ -0,0 +1,6 @@ +#ifndef ___VBox_HostService_VBoxClipboardSvc_h +#define ___VBox_HostService_VBoxClipboardSvc_h + +#define VBOX_SHARED_CLIPBOARD_HOST_FN_SET_HEADLESS 2 + +#endif diff --git a/repos/ports/src/virtualbox/include/VBox/com/VirtualBox.h b/repos/ports/src/virtualbox/include/VBox/com/VirtualBox.h index 29ee5af545..433da00f4c 100644 --- a/repos/ports/src/virtualbox/include/VBox/com/VirtualBox.h +++ b/repos/ports/src/virtualbox/include/VBox/com/VirtualBox.h @@ -1,7 +1,12 @@ #ifndef ___VBox_com_VirtualBox_h #define ___VBox_com_VirtualBox_h +// for convenience #include +#include + +// generated VirtualBox COM library definition file +#include #endif diff --git a/repos/ports/src/virtualbox/include/VBox/com/com.h b/repos/ports/src/virtualbox/include/VBox/com/com.h index 4484e7f702..d54a88c468 100644 --- a/repos/ports/src/virtualbox/include/VBox/com/com.h +++ b/repos/ports/src/virtualbox/include/VBox/com/com.h @@ -1,9 +1,6 @@ #ifndef ___VBox_com_com_h #define ___VBox_com_com_h -#define COMGETTER(n) get_##n -#define COMSETTER(n) set_##n - #include namespace com { diff --git a/repos/ports/src/virtualbox/include/VBox/com/defs.h b/repos/ports/src/virtualbox/include/VBox/com/defs.h index 419673610c..f969325433 100644 --- a/repos/ports/src/virtualbox/include/VBox/com/defs.h +++ b/repos/ports/src/virtualbox/include/VBox/com/defs.h @@ -3,70 +3,90 @@ #include -typedef short unsigned int * BSTR; -typedef BSTR IN_BSTR; -typedef const short unsigned int * CBSTR; -typedef short unsigned int OLECHAR; -typedef unsigned int PRUint32; -typedef OLECHAR PRUnichar; -typedef bool BOOL; -typedef unsigned char BYTE; +#include + +#define ATL_NO_VTABLE +#define DECLARE_CLASSFACTORY() +#define DECLARE_CLASSFACTORY_SINGLETON(X) +#define DECLARE_REGISTRY_RESOURCEID(X) +#define DECLARE_NOT_AGGREGATABLE(X) +#define DECLARE_PROTECT_FINAL_CONSTRUCT(Y) +#define BEGIN_COM_MAP(X) +#define COM_INTERFACE_ENTRY(X) +#define COM_INTERFACE_ENTRY2(X,Y) +#define END_COM_MAP() + +#define HRESULT nsresult +#define SUCCEEDED(X) ((X) == VINF_SUCCESS) +#define FAILED(X) ((X) != VINF_SUCCESS) + +#define FAILED_DEAD_INTERFACE(rc) ( (rc) == NS_ERROR_ABORT \ + || (rc) == NS_ERROR_CALL_FAILED \ + ) + +#define IUnknown nsISupports + +typedef PRBool BOOL; +typedef PRUint8 BYTE; +typedef PRInt16 SHORT; +typedef PRUint16 USHORT; +typedef PRInt32 LONG; +typedef PRUint32 ULONG; +typedef PRInt64 LONG64; +typedef PRUint64 ULONG64; #define FALSE false #define TRUE true -#define SUCCEEDED(X) ((X) == VINF_SUCCESS) -#define FAILED(X) ((X) != VINF_SUCCESS) +typedef wchar_t OLECHAR; +typedef PRUnichar *BSTR; +typedef const PRUnichar *CBSTR; +typedef CBSTR IN_BSTR; + +#define GUID nsID +#define IN_GUID const nsID & +#define OUT_GUID nsID ** + +#define COMGETTER(n) Get##n +#define COMSETTER(n) Set##n -#define ComSafeArrayInArg(aArg) aArg##Size, aArg -#define ComSafeArrayOutArg(aArg) aArg##Size, aArg -#define ComSafeArrayOut(aType, aArg) PRUint32 *aArg##Size, aType **aArg #define ComSafeArrayIn(aType, aArg) unsigned aArg##Size, aType *aArg +#define ComSafeArrayInIsNull(aArg) ((aArg) == NULL) +#define ComSafeArrayInArg(aArg) aArg##Size, aArg + +#define ComSafeArrayOut(aType, aArg) PRUint32 *aArg##Size, aType **aArg +#define ComSafeArrayOutIsNull(aArg) ((aArg) == NULL) +#define ComSafeArrayOutArg(aArg) aArg##Size, aArg + #define ComSafeGUIDArrayIn(aArg) PRUint32 aArg##Size, const nsID **aArg #define ComSafeGUIDArrayInArg(aArg) ComSafeArrayInArg(aArg) -#define ComSafeArrayOutIsNull(aArg) ((aArg) == NULL) -#define ComSafeArrayInIsNull(aArg) ((aArg) == NULL) -#define COM_STRUCT_OR_CLASS(I) class I +#define ComSafeArraySize(aArg) ((aArg) == NULL ? 0 : (aArg##Size)) -#define FAILED_DEAD_INTERFACE(rc) ( (rc) != VINF_SUCCESS ) +/* OLE error codes */ +#define S_OK ((nsresult)NS_OK) +#define E_UNEXPECTED NS_ERROR_UNEXPECTED +#define E_NOTIMPL NS_ERROR_NOT_IMPLEMENTED +#define E_OUTOFMEMORY NS_ERROR_OUT_OF_MEMORY +#define E_INVALIDARG NS_ERROR_INVALID_ARG +#define E_NOINTERFACE NS_ERROR_NO_INTERFACE +#define E_POINTER NS_ERROR_NULL_POINTER +#define E_ABORT NS_ERROR_ABORT +#define E_FAIL NS_ERROR_FAILURE +/* Note: a better analog for E_ACCESSDENIED would probably be + * NS_ERROR_NOT_AVAILABLE, but we want binary compatibility for now. */ +#define E_ACCESSDENIED ((nsresult)0x80070005L) -enum HRESULT { - S_OK, - E_ACCESSDENIED, - E_OUTOFMEMORY, - E_INVALIDARG, - E_FAIL, - E_POINTER, - E_NOTIMPL, - E_UNEXPECTED, - E_NOINTERFACE, - E_ABORT, - VBOX_E_VM_ERROR, - VBOX_E_INVALID_VM_STATE, - VBOX_E_INVALID_OBJECT_STATE, - VBOX_E_INVALID_SESSION_STATE, - VBOX_E_OBJECT_NOT_FOUND, - VBOX_E_FILE_ERROR, - VBOX_E_OBJECT_IN_USE, - VBOX_E_NOT_SUPPORTED, - VBOX_E_IPRT_ERROR, - VBOX_E_PDM_ERROR, - VBOX_E_HOST_ERROR, - VBOX_E_XML_ERROR, -}; - -typedef struct { char x [sizeof(RTUUID)]; } GUID; +#define STDMETHOD(X) virtual HRESULT X +#define STDMETHODIMP HRESULT inline GUID& stuffstuff() { static GUID stuff; return stuff; } #define COM_IIDOF(X) stuffstuff() -#define getStaticClassIID() stuffstuff() -#define IN_GUID GUID -#define OUT_GUID GUID * +#define COM_STRUCT_OR_CLASS(I) class I extern "C" { @@ -78,558 +98,13 @@ extern "C" unsigned int SysStringLen(BSTR bstr); } -typedef signed int LONG; -typedef unsigned int ULONG; -typedef unsigned short USHORT; -typedef short SHORT; -typedef signed long long LONG64; -typedef unsigned long long ULONG64; +namespace com { -/* capiidl.xsl */ -typedef enum VARTYPE -{ - VT_I2 = 2, - VT_I4 = 3, - VT_BSTR = 8, - VT_DISPATCH = 9, - VT_BOOL = 11, - VT_UNKNOWN = 13, - VT_I1 = 16, - VT_UI1 = 17, - VT_UI2 = 18, - VT_UI4 = 19, - VT_I8 = 20, - VT_UI8 = 21, - VT_HRESULT = 25 -} VARTYPE; +#define VBOX_SCRIPTABLE_IMPL(iface) \ + public iface -typedef struct SAFEARRAY -{ - void *pv; - ULONG c; -} SAFEARRAY; +#define VBOX_DEFAULT_INTERFACE_ENTRIES(X) -enum AccessMode_T -{ - AccessMode_ReadOnly, - AccessMode_ReadWrite, -}; - -enum AdditionsFacilityClass_T -{ - AdditionsFacilityClass_None, - AdditionsFacilityClass_Driver, - AdditionsFacilityClass_Feature, - AdditionsFacilityClass_Program, - AdditionsFacilityClass_Service, -}; - -enum AdditionsFacilityStatus_T -{ - AdditionsFacilityStatus_Unknown, - AdditionsFacilityStatus_Active, -}; - -enum AdditionsFacilityType_T -{ - AdditionsFacilityType_None, - AdditionsFacilityType_AutoLogon, - AdditionsFacilityType_Graphics, - AdditionsFacilityType_Seamless, - AdditionsFacilityType_VBoxService, - AdditionsFacilityType_VBoxGuestDriver, - AdditionsFacilityType_VBoxTrayClient, -}; - -enum CopyFileFlag_T { }; -enum DeviceActivity_T { }; -enum FsObjType_T { }; -enum FileStatus_T { }; -enum FileSeekType_T { }; -enum DragAndDropAction_T { }; -enum GuestSessionStatus_T { }; -enum GuestSessionWaitForFlag_T { }; -enum GuestSessionWaitResult_T { }; -enum DirectoryCreateFlag_T { }; -enum DirectoryOpenFlag_T { }; -enum DirectoryRemoveRecFlag_T { }; -enum PathRenameFlag_T { }; -enum SymlinkType_T { }; -enum SymlinkReadFlag_T { }; -enum AdditionsUpdateFlag_T { }; -enum AdditionsRunLevelType_T -{ - AdditionsRunLevelType_None, - AdditionsRunLevelType_System, - AdditionsRunLevelType_Desktop, - AdditionsRunLevelType_Userland, -}; - -enum GuestUserState_T { -}; - -enum MouseButtonState -{ - MouseButtonState_LeftButton = 0x01, - MouseButtonState_RightButton = 0x02, - MouseButtonState_MiddleButton = 0x04, - MouseButtonState_WheelUp = 0x08, - MouseButtonState_WheelDown = 0x10, - MouseButtonState_XButton1 = 0x20, - MouseButtonState_XButton2 = 0x40, - MouseButtonState_MouseStateMask = 0x7F -}; - -enum GuestMouseEventMode_T -{ - GuestMouseEventMode_Absolute, - GuestMouseEventMode_Relative, -}; - -enum GUEST_FILE_SEEKTYPE { }; -enum ProcessPriority_T -{ - ProcessPriority_Default, -}; - -enum FramebufferPixelFormat -{ - FramebufferPixelFormat_Opaque = 0, - FramebufferPixelFormat_FOURCC_RGB = 0x32424752, -}; - -enum GuestMonitorChangedEventType -{ - GuestMonitorChangedEventType_Enabled, - GuestMonitorChangedEventType_Disabled, - GuestMonitorChangedEventType_NewOrigin, -}; - -enum VBoxEventType_T -{ - VBoxEventType_Invalid = 0, - VBoxEventType_Any = 1, - VBoxEventType_Vetoable = 2, - VBoxEventType_MachineEvent = 3, - VBoxEventType_SnapshotEvent = 4, - VBoxEventType_InputEvent = 5, - VBoxEventType_LastWildcard = 31, - VBoxEventType_OnMachineStateChanged = 32, - VBoxEventType_OnMachineDataChanged = 33, - VBoxEventType_OnExtraDataChanged = 34, - VBoxEventType_OnExtraDataCanChange = 35, - VBoxEventType_OnMediumRegistered = 36, - VBoxEventType_OnMachineRegistered = 37, - VBoxEventType_OnSessionStateChanged = 38, - VBoxEventType_OnSnapshotTaken = 39, - VBoxEventType_OnSnapshotDeleted = 40, - VBoxEventType_OnSnapshotChanged = 41, - VBoxEventType_OnGuestPropertyChanged = 42, - VBoxEventType_OnMousePointerShapeChanged = 43, - VBoxEventType_OnMouseCapabilityChanged = 44, - VBoxEventType_OnKeyboardLedsChanged = 45, - VBoxEventType_OnStateChanged = 46, - VBoxEventType_OnAdditionsStateChanged = 47, - VBoxEventType_OnNetworkAdapterChanged = 48, - VBoxEventType_OnSerialPortChanged = 49, - VBoxEventType_OnParallelPortChanged = 50, - VBoxEventType_OnStorageControllerChanged = 51, - VBoxEventType_OnMediumChanged = 52, - VBoxEventType_OnVRDEServerChanged = 53, - VBoxEventType_OnUSBControllerChanged = 54, - VBoxEventType_OnUSBDeviceStateChanged = 55, - VBoxEventType_OnSharedFolderChanged = 56, - VBoxEventType_OnRuntimeError = 57, - VBoxEventType_OnCanShowWindow = 58, - VBoxEventType_OnShowWindow = 59, - VBoxEventType_OnCPUChanged = 60, - VBoxEventType_OnVRDEServerInfoChanged = 61, - VBoxEventType_OnEventSourceChanged = 62, - VBoxEventType_OnCPUExecutionCapChanged = 63, - VBoxEventType_OnGuestKeyboard = 64, - VBoxEventType_OnGuestMouse = 65, - VBoxEventType_OnNATRedirect = 66, - VBoxEventType_OnHostPCIDevicePlug = 67, - VBoxEventType_OnVBoxSVCAvailabilityChanged = 68, - VBoxEventType_OnBandwidthGroupChanged = 69, - VBoxEventType_OnGuestMonitorChanged = 70, - VBoxEventType_OnStorageDeviceChanged = 71, - VBoxEventType_OnClipboardModeChanged = 72, - VBoxEventType_OnDragAndDropModeChanged = 73, - VBoxEventType_OnGuestMultiTouch = 74, - VBoxEventType_Last = 75 -}; - -enum ProcessStatus_T { }; -enum ProcessInputStatus_T { }; -enum ProcessInputFlag_T { }; -enum ProcessWaitResult_T { }; -enum ProcessWaitForFlag_T { }; - -enum ProcessCreateFlag_T -{ - ProcessCreateFlag_None, -}; - -enum SessionType_T -{ - SessionType_Null, - SessionType_WriteLock, - SessionType_Remote, - SessionType_Shared, -}; - -enum MachineState_T { - MachineState_Null, - MachineState_Aborted, - MachineState_Running, - MachineState_Paused, - MachineState_Teleporting, - MachineState_LiveSnapshotting, - MachineState_Stuck, - MachineState_Starting, - MachineState_Stopping, - MachineState_Saving, - MachineState_Restoring, - MachineState_TeleportingPausedVM, - MachineState_TeleportingIn, - MachineState_RestoringSnapshot, - MachineState_DeletingSnapshot, - MachineState_SettingUp, - MachineState_FaultTolerantSyncing, - MachineState_PoweredOff, - MachineState_Teleported, - MachineState_Saved, - MachineState_DeletingSnapshotOnline, - MachineState_DeletingSnapshotPaused, -}; - -enum CleanupMode_T { - CleanupMode_UnregisterOnly, - CleanupMode_DetachAllReturnHardDisksOnly, - CleanupMode_Full, - }; - -enum CloneMode_T { - CloneMode_MachineState, - CloneMode_AllStates, - CloneMode_MachineAndChildStates, -}; - -enum CloneOptions_T { - CloneOptions_Link, - CloneOptions_KeepAllMACs, - CloneOptions_KeepNATMACs, - CloneOptions_KeepDiskNames, -}; - -enum LockType_T { - LockType_Shared, - LockType_Write, - LockType_VM, -}; - -enum SessionState_T { - SessionState_Null, - SessionState_Locked, - SessionState_Spawning, - SessionState_Unlocking, - SessionState_Unlocked, -}; - -enum Reason_T -{ - Reason_Unspecified, - Reason_HostSuspend, - Reason_HostResume, - Reason_HostBatteryLow, -}; - -enum MediumFormatCapabilities_T -{ - MediumFormatCapabilities_Uuid = 0x01, - MediumFormatCapabilities_CreateFixed = 0x02, - MediumFormatCapabilities_CreateDynamic = 0x04, - MediumFormatCapabilities_Differencing = 0x10, - MediumFormatCapabilities_File = 0x40 -}; - -enum DataType_T { - DataType_Int32, - DataType_Int8, - DataType_String, -}; - -enum DataFlags_T { - DataFlags_Array, -}; - -enum MediumVariant_T { - MediumVariant_Standard, - MediumVariant_Fixed, - MediumVariant_Diff, - MediumVariant_VmdkStreamOptimized, - MediumVariant_NoCreateDir, -}; -enum HostNetworkInterfaceType_T { }; - -enum NATAliasMode_T -{ - NATAliasMode_AliasLog = 0x1, - NATAliasMode_AliasProxyOnly = 0x02, - NATAliasMode_AliasUseSamePorts = 0x04, -}; - -enum MediumState_T { - MediumState_NotCreated = 0, - MediumState_Created = 1, - MediumState_LockedRead = 2, - MediumState_LockedWrite = 3, - MediumState_Inaccessible = 4, - MediumState_Creating = 5, - MediumState_Deleting = 6 -}; - -enum AuthType_T { - AuthType_Null, - AuthType_Guest, - AuthType_External, -}; - -enum BIOSBootMenuMode_T { - BIOSBootMenuMode_MessageAndMenu, - BIOSBootMenuMode_Disabled, - BIOSBootMenuMode_MenuOnly, -}; - -enum USBControllerType_T { - USBControllerType_Null, - USBControllerType_OHCI, - USBControllerType_EHCI, - USBControllerType_Last, -}; - -enum USBDeviceFilterAction_T { - USBDeviceFilterAction_Null, - USBDeviceFilterAction_Ignore, - USBDeviceFilterAction_Hold, -}; - -enum DeviceType_T { - DeviceType_Null, - DeviceType_HardDisk, - DeviceType_DVD, - DeviceType_Floppy, - DeviceType_Network, - DeviceType_USB, - DeviceType_SharedFolder, -}; - -enum MediumType_T { - MediumType_Normal, - MediumType_Immutable, - MediumType_Writethrough, - MediumType_Shareable, - MediumType_Readonly, - MediumType_MultiAttach, -}; - -enum NATProtocol_T { - NATProtocol_TCP, - NATProtocol_UDP, -}; - -enum NetworkAdapterType_T { - NetworkAdapterType_Am79C970A, - NetworkAdapterType_Am79C973, - NetworkAdapterType_I82540EM, - NetworkAdapterType_I82543GC, - NetworkAdapterType_I82545EM, - NetworkAdapterType_Virtio, -}; - -enum ProcessorFeature_T -{ - ProcessorFeature_HWVirtEx, - ProcessorFeature_LongMode, - ProcessorFeature_NestedPaging, - ProcessorFeature_PAE, -}; - -enum CPUPropertyType_T -{ - CPUPropertyType_Null, - CPUPropertyType_PAE, - CPUPropertyType_Synthetic, - CPUPropertyType_LongMode, - CPUPropertyType_TripleFaultReset, -}; - -/* End of enum CPUPropertyType Declaration */ -enum AudioDriverType_T { - AudioDriverType_Null, - AudioDriverType_WinMM, - AudioDriverType_DirectSound, - AudioDriverType_SolAudio, - AudioDriverType_ALSA, - AudioDriverType_Pulse, - AudioDriverType_OSS, - AudioDriverType_CoreAudio, - AudioDriverType_MMPM, -}; - -enum PortMode_T { - PortMode_Disconnected, - PortMode_HostPipe, - PortMode_HostDevice, - PortMode_RawFile, -}; - -enum BandwidthGroupType_T { - BandwidthGroupType_Null, - BandwidthGroupType_Disk, - BandwidthGroupType_Network, -}; - -enum ClipboardMode_T { - ClipboardMode_Disabled, - ClipboardMode_HostToGuest, - ClipboardMode_GuestToHost, - ClipboardMode_Bidirectional, -}; - -enum FaultToleranceState_T { - FaultToleranceState_Inactive, - FaultToleranceState_Master, - FaultToleranceState_Standby, -}; - -enum AudioControllerType_T { - AudioControllerType_AC97, - AudioControllerType_HDA, - AudioControllerType_SB16, -}; - -enum NetworkAttachmentType_T { - NetworkAttachmentType_Null, - NetworkAttachmentType_NAT, - NetworkAttachmentType_Bridged, - NetworkAttachmentType_Internal, - NetworkAttachmentType_HostOnly, - NetworkAttachmentType_Generic, - NetworkAttachmentType_NATNetwork, -}; - -enum NetworkAdapterPromiscModePolicy_T { - NetworkAdapterPromiscModePolicy_Deny, - NetworkAdapterPromiscModePolicy_AllowNetwork, - NetworkAdapterPromiscModePolicy_AllowAll, -}; - -enum StorageBus_T { - StorageBus_Null, - StorageBus_IDE, - StorageBus_SATA, - StorageBus_SAS, - StorageBus_SCSI, - StorageBus_Floppy, -}; - -enum FirmwareType_T { - FirmwareType_BIOS, - FirmwareType_EFI, - FirmwareType_EFI32, - FirmwareType_EFI64, - FirmwareType_EFIDUAL, -}; - -enum GraphicsControllerType_T { - GraphicsControllerType_Null, - GraphicsControllerType_VBoxVGA, - GraphicsControllerType_VMSVGA, -}; - -enum AutostopType_T { - AutostopType_Disabled, - AutostopType_SaveState, - AutostopType_PowerOff, - AutostopType_AcpiShutdown, -}; - -enum DragAndDropMode_T { - DragAndDropMode_Disabled, - DragAndDropMode_HostToGuest, - DragAndDropMode_GuestToHost, - DragAndDropMode_Bidirectional, -}; - -enum StorageControllerType_T { - StorageControllerType_PIIX3, - StorageControllerType_IntelAhci, - StorageControllerType_LsiLogic, - StorageControllerType_BusLogic, - StorageControllerType_PIIX4, - StorageControllerType_ICH6, - StorageControllerType_I82078, - StorageControllerType_LsiLogicSas, -}; - -enum KeyboardHIDType_T { - KeyboardHIDType_None, - KeyboardHIDType_PS2Keyboard, - KeyboardHIDType_USBKeyboard, - KeyboardHIDType_ComboKeyboard, -}; - -enum PointingHIDType_T { - PointingHIDType_None, - PointingHIDType_PS2Mouse, - PointingHIDType_USBMouse, - PointingHIDType_USBTablet, - PointingHIDType_ComboMouse, - PointingHIDType_USBMultiTouch, -}; - -enum ChipsetType_T { - ChipsetType_Null, - ChipsetType_ICH9, - ChipsetType_PIIX3, -}; - -enum DhcpOpt_T { - DhcpOpt_SubnetMask, - DhcpOpt_Router, -}; - -enum SettingsVersion_T { - SettingsVersion_Null, - SettingsVersion_v1_3, - SettingsVersion_v1_4, - SettingsVersion_v1_5, - SettingsVersion_v1_6, - SettingsVersion_v1_7, - SettingsVersion_v1_8, - SettingsVersion_v1_9, - SettingsVersion_v1_10, - SettingsVersion_v1_11, - SettingsVersion_v1_12, - SettingsVersion_v1_13, - SettingsVersion_v1_14, - SettingsVersion_Future, -}; - -enum HWVirtExPropertyType_T -{ - HWVirtExPropertyType_Enabled, - HWVirtExPropertyType_Force, - HWVirtExPropertyType_NestedPaging, - HWVirtExPropertyType_LargePages, - HWVirtExPropertyType_VPID, - HWVirtExPropertyType_UnrestrictedExecution, -}; - -enum USBDeviceState_T -{ -}; +} /* namespace com */ #endif /* !___VBox_com_defs_h */ diff --git a/repos/ports/src/virtualbox/include/VBox/com/ptr.h b/repos/ports/src/virtualbox/include/VBox/com/ptr.h index aa2b896965..12bd6d6c0d 100644 --- a/repos/ports/src/virtualbox/include/VBox/com/ptr.h +++ b/repos/ports/src/virtualbox/include/VBox/com/ptr.h @@ -3,6 +3,8 @@ #include +#include + template class ComPtr { @@ -16,15 +18,47 @@ class ComPtr { /* copy constructor */ ComPtr (T *obj) : _obj(obj) { } + template - ComPtr (X *obj) : _obj(nullptr) { } + ComPtr (X *obj) : _obj(dynamic_cast(obj)) + { + if (!_obj) + PDBG("dynamic cast failed"); + } + template - ComPtr(const ComPtr &that) : _obj(nullptr) { } + ComPtr(const ComPtr &that) : ComPtr((T2*)that) { } /* operators */ T * operator->() const { return _obj; } operator T*() const { return _obj; } + template + ComPtr& operator=(const ComPtr &that) + { + return operator=((T2*)that); + } + + ComPtr& operator=(const ComPtr &that) + { + return operator=((T*)that); + } + + template + ComPtr& operator=(T2 *p) + { + _obj = dynamic_cast(p); + if (!_obj) + PDBG("dynamic cast failed"); + return *this; + } + + ComPtr& operator=(T *p) + { + _obj = p; + return *this; + } + bool isNull () const { return _obj == nullptr; } T ** asOutParam() { return &_obj; } @@ -39,6 +73,13 @@ class ComPtr { } void setNull() { _obj = nullptr; } + + template + bool operator==(T2* p) + { + return (p == _obj); + } + }; diff --git a/repos/ports/src/virtualbox/include/VBox/intnet.h b/repos/ports/src/virtualbox/include/VBox/intnet.h index e69de29bb2..9d060f95a7 100644 --- a/repos/ports/src/virtualbox/include/VBox/intnet.h +++ b/repos/ports/src/virtualbox/include/VBox/intnet.h @@ -0,0 +1,12 @@ +#ifndef ___VBox_intnet_h +#define ___VBox_intnet_h + +#define INTNET_MAX_NETWORK_NAME 128 + +enum INTNETTRUNKTYPE +{ + kIntNetTrunkType_WhateverNone, + kIntNetTrunkType_NetFlt, +}; + +#endif diff --git a/repos/ports/src/virtualbox/include/xpcom/nsError.h b/repos/ports/src/virtualbox/include/xpcom/nsError.h new file mode 100644 index 0000000000..36b509570c --- /dev/null +++ b/repos/ports/src/virtualbox/include/xpcom/nsError.h @@ -0,0 +1,38 @@ +#ifndef nsError_h__ +#define nsError_h__ + +/* Standard "it worked" return value */ +#define NS_OK 0 + +#define NS_ERROR_BASE ((nsresult) 0xC1F30000) + +/* Returned by a not implemented function */ +#define NS_ERROR_NOT_IMPLEMENTED ((nsresult) 0x80004001L) + +/* Returned when a given interface is not supported. */ +#define NS_NOINTERFACE ((nsresult) 0x80004002L) +#define NS_ERROR_NO_INTERFACE NS_NOINTERFACE + +#define NS_ERROR_INVALID_POINTER ((nsresult) 0x80004003L) +#define NS_ERROR_NULL_POINTER NS_ERROR_INVALID_POINTER + +/* Returned when a function aborts */ +#define NS_ERROR_ABORT ((nsresult) 0x80004004L) + +/* Returned when a function fails */ +#define NS_ERROR_FAILURE ((nsresult) 0x80004005L) + +/* Returned when an IPC fails */ +#define NS_ERROR_CALL_FAILED ((nsresult) 0x800706beL) + +/* Returned when an unexpected error occurs */ +#define NS_ERROR_UNEXPECTED ((nsresult) 0x8000ffffL) + +/* Returned when a memory allocation fails */ +#define NS_ERROR_OUT_OF_MEMORY ((nsresult) 0x8007000eL) + +/* Returned when an illegal value is passed */ +#define NS_ERROR_ILLEGAL_VALUE ((nsresult) 0x80070057L) +#define NS_ERROR_INVALID_ARG NS_ERROR_ILLEGAL_VALUE + +#endif diff --git a/repos/ports/src/virtualbox/include/xpcom/nsID.h b/repos/ports/src/virtualbox/include/xpcom/nsID.h new file mode 100644 index 0000000000..1248d5eae2 --- /dev/null +++ b/repos/ports/src/virtualbox/include/xpcom/nsID.h @@ -0,0 +1,14 @@ +#ifndef nsID_h__ +#define nsID_h__ + +#ifndef nscore_h___ +#include "nscore.h" +#endif + +typedef struct { char x [sizeof(RTUUID)]; } nsID; /* differs from original */ + +typedef nsID nsCID; + +#define NS_DEFINE_STATIC_IID_ACCESSOR(x) + +#endif diff --git a/repos/ports/src/virtualbox/include/xpcom/nsIException.h b/repos/ports/src/virtualbox/include/xpcom/nsIException.h new file mode 100644 index 0000000000..22c16416ec --- /dev/null +++ b/repos/ports/src/virtualbox/include/xpcom/nsIException.h @@ -0,0 +1,10 @@ +#ifndef __gen_nsIException_h__ +#define __gen_nsIException_h__ + +#ifndef __gen_nsISupports_h__ +#include "nsISupports.h" +#endif + +class nsIException : public nsISupports { }; + +#endif /* __gen_nsIException_h__ */ diff --git a/repos/ports/src/virtualbox/include/xpcom/nsISupports.h b/repos/ports/src/virtualbox/include/xpcom/nsISupports.h new file mode 100644 index 0000000000..051e6d016e --- /dev/null +++ b/repos/ports/src/virtualbox/include/xpcom/nsISupports.h @@ -0,0 +1,23 @@ +#ifndef __gen_nsISupports_h__ +#define __gen_nsISupports_h__ + +#ifndef nsError_h__ +#include "nsError.h" +#endif + +#ifndef nsISupportsImpl_h__ +#include "nsISupportsImpl.h" +#endif + +class nsISupports +{ + public: + + /* make the class polymorphic, so it can be used with 'dynamic_cast' */ + virtual ~nsISupports() { } + + void AddRef() { } + void Release() { } +}; + +#endif /* __gen_nsISupports_h__ */ diff --git a/repos/ports/src/virtualbox/include/xpcom/nsISupportsImpl.h b/repos/ports/src/virtualbox/include/xpcom/nsISupportsImpl.h new file mode 100644 index 0000000000..9a7fa09d1f --- /dev/null +++ b/repos/ports/src/virtualbox/include/xpcom/nsISupportsImpl.h @@ -0,0 +1,14 @@ +#ifndef nsISupportsImpl_h__ +#define nsISupportsImpl_h__ + +#ifndef nscore_h___ +#include "nscore.h" +#endif + +#define NS_DECL_CLASSINFO(x) +#define NS_IMPL_THREADSAFE_ADDREF(x) +#define NS_IMPL_THREADSAFE_RELEASE(x) +#define NS_IMPL_QUERY_INTERFACE1_CI(x, y) +#define NS_IMPL_CI_INTERFACE_GETTER1(x, y) + +#endif diff --git a/repos/ports/src/virtualbox/frontend/nsMemory.h b/repos/ports/src/virtualbox/include/xpcom/nsMemory.h similarity index 93% rename from repos/ports/src/virtualbox/frontend/nsMemory.h rename to repos/ports/src/virtualbox/include/xpcom/nsMemory.h index 884b2bf016..fe713501be 100644 --- a/repos/ports/src/virtualbox/frontend/nsMemory.h +++ b/repos/ports/src/virtualbox/include/xpcom/nsMemory.h @@ -1,8 +1,6 @@ #ifndef nsMemory_h__ #define nsMemory_h__ -#define nsID GUID - #include class nsMemory diff --git a/repos/ports/src/virtualbox/include/xpcom/nscore.h b/repos/ports/src/virtualbox/include/xpcom/nscore.h new file mode 100644 index 0000000000..40c5e58f18 --- /dev/null +++ b/repos/ports/src/virtualbox/include/xpcom/nscore.h @@ -0,0 +1,13 @@ +#ifndef nscore_h___ +#define nscore_h___ + +#include "prtypes.h" + +#define NS_IMETHOD_(type) virtual type +#define NS_IMETHOD NS_IMETHOD_(nsresult) + +typedef PRUint32 nsresult; + +#include "nsError.h" + +#endif /* nscore_h___ */ diff --git a/repos/ports/src/virtualbox/include/xpcom/prtypes.h b/repos/ports/src/virtualbox/include/xpcom/prtypes.h new file mode 100644 index 0000000000..6b8ff3b610 --- /dev/null +++ b/repos/ports/src/virtualbox/include/xpcom/prtypes.h @@ -0,0 +1,14 @@ +#ifndef prtypes_h___ +#define prtypes_h___ + +typedef bool PRBool; +typedef uint8_t PRUint8; +typedef int16_t PRInt16; +typedef uint16_t PRUint16; +typedef int32_t PRInt32; +typedef uint32_t PRUint32; +typedef int64_t PRInt64; +typedef uint64_t PRUint64; +typedef PRUint16 PRUnichar; + +#endif /* prtypes_h___ */ diff --git a/repos/ports/src/virtualbox/patches/acpi_drv.patch b/repos/ports/src/virtualbox/patches/acpi_drv.patch index 536a976808..4d8182c750 100644 --- a/repos/ports/src/virtualbox/patches/acpi_drv.patch +++ b/repos/ports/src/virtualbox/patches/acpi_drv.patch @@ -1,4 +1,9 @@ -+++ src/app/virtualbox/src/VBox/Devices/PC/DrvACPI.cpp +acpi_drv.patch + +diff --git a/src/app/virtualbox/src/VBox/Devices/PC/DrvACPI.cpp b/src/app/virtualbox/src/VBox/Devices/PC/DrvACPI.cpp +index d22fc11..f194326 100644 +--- a/src/app/virtualbox/src/VBox/Devices/PC/DrvACPI.cpp ++++ b/src/app/virtualbox/src/VBox/Devices/PC/DrvACPI.cpp @@ -44,6 +44,7 @@ # include #endif diff --git a/repos/ports/src/virtualbox/patches/avoid_yield.patch b/repos/ports/src/virtualbox/patches/avoid_yield.patch index 96c2d68069..a31266bec4 100644 --- a/repos/ports/src/virtualbox/patches/avoid_yield.patch +++ b/repos/ports/src/virtualbox/patches/avoid_yield.patch @@ -1,5 +1,31 @@ -+++ src/app/virtualbox/src/VBox/VMM/VMMR3/VMM.cpp -@@ -660,11 +660,13 @@ +avoid_yield.patch + +diff --git a/src/app/virtualbox/src/VBox/Devices/Storage/DevATA.cpp b/src/app/virtualbox/src/VBox/Devices/Storage/DevATA.cpp +index 009f80f..39cb535 100644 +--- a/src/app/virtualbox/src/VBox/Devices/Storage/DevATA.cpp ++++ b/src/app/virtualbox/src/VBox/Devices/Storage/DevATA.cpp +@@ -4466,6 +4466,7 @@ static int ataIOPortReadU8(PATACONTROLLER pCtl, uint32_t addr, uint32_t *pu32) + { + #ifdef IN_RING3 + cBusy = 0; ++#if 0 + PDMCritSectLeave(&pCtl->lock); + + #ifndef RT_OS_WINDOWS +@@ -4501,7 +4502,7 @@ static int ataIOPortReadU8(PATACONTROLLER pCtl, uint32_t addr, uint32_t *pu32) + PDMCritSectEnter(&pCtl->lock, VINF_SUCCESS); + STAM_PROFILE_STOP(&pCtl->StatLockWait, a); + } +- ++#endif + val = s->uATARegStatus; + #else /* !IN_RING3 */ + /* Cannot yield CPU in guest context. And switching to host +diff --git a/src/app/virtualbox/src/VBox/VMM/VMMR3/VMM.cpp b/src/app/virtualbox/src/VBox/VMM/VMMR3/VMM.cpp +index c0a1400..f35bc0e 100644 +--- a/src/app/virtualbox/src/VBox/VMM/VMMR3/VMM.cpp ++++ b/src/app/virtualbox/src/VBox/VMM/VMMR3/VMM.cpp +@@ -660,11 +660,13 @@ VMMR3_INT_DECL(int) VMMR3InitCompleted(PVM pVM, VMINITCOMPLETED enmWhat) /* * Create the EMT yield timer. */ @@ -13,7 +39,7 @@ #ifdef VBOX_WITH_NMI /* -@@ -1160,6 +1162,7 @@ +@@ -1160,6 +1162,7 @@ VMMR3_INT_DECL(int) VMMR3GetImportRC(PVM pVM, const char *pszSymbol, PRTRCPTR pR */ VMMR3_INT_DECL(void) VMMR3YieldSuspend(PVM pVM) { @@ -21,7 +47,7 @@ VMCPU_ASSERT_EMT(&pVM->aCpus[0]); if (!pVM->vmm.s.cYieldResumeMillies) { -@@ -1172,6 +1175,7 @@ +@@ -1172,6 +1175,7 @@ VMMR3_INT_DECL(void) VMMR3YieldSuspend(PVM pVM) TMTimerStop(pVM->vmm.s.pYieldTimer); } pVM->vmm.s.u64LastYield = RTTimeNanoTS(); @@ -29,7 +55,7 @@ } -@@ -1182,10 +1186,12 @@ +@@ -1182,10 +1186,12 @@ VMMR3_INT_DECL(void) VMMR3YieldSuspend(PVM pVM) */ VMMR3_INT_DECL(void) VMMR3YieldStop(PVM pVM) { @@ -42,7 +68,7 @@ } -@@ -1196,11 +1202,13 @@ +@@ -1196,11 +1202,13 @@ VMMR3_INT_DECL(void) VMMR3YieldStop(PVM pVM) */ VMMR3_INT_DECL(void) VMMR3YieldResume(PVM pVM) { @@ -56,21 +82,3 @@ } -+++ src/app/virtualbox/src/VBox/Devices/Storage/DevATA.cpp -@@ -4466,6 +4466,7 @@ - { - #ifdef IN_RING3 - cBusy = 0; -+#if 0 - PDMCritSectLeave(&pCtl->lock); - - #ifndef RT_OS_WINDOWS -@@ -4502,7 +4501,7 @@ - PDMCritSectEnter(&pCtl->lock, VINF_SUCCESS); - STAM_PROFILE_STOP(&pCtl->StatLockWait, a); - } -+#endif -- - val = s->uATARegStatus; - #else /* !IN_RING3 */ - /* Cannot yield CPU in guest context. And switching to host diff --git a/repos/ports/src/virtualbox/patches/dev_e1000.patch b/repos/ports/src/virtualbox/patches/dev_e1000.patch index d7b09341cd..f3babc6908 100644 --- a/repos/ports/src/virtualbox/patches/dev_e1000.patch +++ b/repos/ports/src/virtualbox/patches/dev_e1000.patch @@ -1,5 +1,10 @@ -+++ src/app/virtualbox/src/VBox/Devices/Network/DevE1000.cpp -@@ -5721,22 +5721,29 @@ +dev_e1000.patch + +diff --git a/src/app/virtualbox/src/VBox/Devices/Network/DevE1000.cpp b/src/app/virtualbox/src/VBox/Devices/Network/DevE1000.cpp +index b8f9ebf..aa3eb87 100644 +--- a/src/app/virtualbox/src/VBox/Devices/Network/DevE1000.cpp ++++ b/src/app/virtualbox/src/VBox/Devices/Network/DevE1000.cpp +@@ -5721,22 +5721,29 @@ static int e1kRegReadUnaligned(PE1KSTATE pThis, uint32_t offReg, void *pv, uint3 rc = g_aE1kRegMap[index].pfnRead(pThis, offReg & 0xFFFFFFFC, index, &u32); u32 &= mask; //e1kCsLeave(pThis); diff --git a/repos/ports/src/virtualbox/patches/eminternal.patch b/repos/ports/src/virtualbox/patches/eminternal.patch index c88253066e..793dd34ed6 100644 --- a/repos/ports/src/virtualbox/patches/eminternal.patch +++ b/repos/ports/src/virtualbox/patches/eminternal.patch @@ -1,10 +1,10 @@ -Triggers misalignment assertion in STAM.cpp +eminternal.patch -case STAMTYPE_PROFILE_ADV: - AssertMsg(!((uintptr_t)pvSample & 7), ("%p - %s - %u\n", pvSample, pszName, enmType)); - -+++ src/app/virtualbox/src/VBox/VMM/include/EMInternal.h -@@ -361,6 +361,8 @@ +diff --git a/src/app/virtualbox/src/VBox/VMM/include/EMInternal.h b/src/app/virtualbox/src/VBox/VMM/include/EMInternal.h +index 11a7ac3..02e6e29 100644 +--- a/src/app/virtualbox/src/VBox/VMM/include/EMInternal.h ++++ b/src/app/virtualbox/src/VBox/VMM/include/EMInternal.h +@@ -361,6 +361,8 @@ typedef struct EMCPU #ifdef VBOX_WITH_RAW_MODE /** Pointer to the PATM status structure. (R3 Ptr) */ R3PTRTYPE(PPATMGCSTATE) pPatmGCState; diff --git a/repos/ports/src/virtualbox/patches/iconv.patch b/repos/ports/src/virtualbox/patches/iconv.patch index 186d3840a9..c89d18863e 100644 --- a/repos/ports/src/virtualbox/patches/iconv.patch +++ b/repos/ports/src/virtualbox/patches/iconv.patch @@ -1,5 +1,10 @@ -+++ src/app/virtualbox/src/VBox/Runtime/r3/posix/utf8-posix.cpp -@@ -324,11 +324,7 @@ +iconv.patch + +diff --git a/src/app/virtualbox/src/VBox/Runtime/r3/posix/utf8-posix.cpp b/src/app/virtualbox/src/VBox/Runtime/r3/posix/utf8-posix.cpp +index cb723eb..d51dd51 100644 +--- a/src/app/virtualbox/src/VBox/Runtime/r3/posix/utf8-posix.cpp ++++ b/src/app/virtualbox/src/VBox/Runtime/r3/posix/utf8-posix.cpp +@@ -324,11 +324,7 @@ static int rtStrConvertUncached(const void *pvInput, size_t cbInput, const char const void *pvInputLeft = pvInput; void *pvOutputLeft = pvOutput; size_t cchNonRev; diff --git a/repos/ports/src/virtualbox/patches/mouse.patch b/repos/ports/src/virtualbox/patches/mouse.patch index 001c59aab5..cef31f3015 100644 --- a/repos/ports/src/virtualbox/patches/mouse.patch +++ b/repos/ports/src/virtualbox/patches/mouse.patch @@ -1,9 +1,10 @@ -This patch avoids an assertion in the VboxBFE frontend when the PS/2 model does -not manage to read out the mouse events quick enough. The PS/2 model is still -alive but reads out the buffer with some delay. +mouse.patch -+++ src/app/virtualbox/src/VBox/Devices/Input/DrvMouseQueue.cpp -@@ -101,6 +101,7 @@ +diff --git a/src/app/virtualbox/src/VBox/Devices/Input/DrvMouseQueue.cpp b/src/app/virtualbox/src/VBox/Devices/Input/DrvMouseQueue.cpp +index 9d0a8d2..7eb6a09 100644 +--- a/src/app/virtualbox/src/VBox/Devices/Input/DrvMouseQueue.cpp ++++ b/src/app/virtualbox/src/VBox/Devices/Input/DrvMouseQueue.cpp +@@ -119,6 +119,7 @@ static DECLCALLBACK(void *) drvMouseQueueQueryInterface(PPDMIBASE pInterface, c /** * @interface_method_impl{PDMIMOUSEPORT,pfnPutEvent} */ @@ -11,7 +12,7 @@ alive but reads out the buffer with some delay. static DECLCALLBACK(int) drvMouseQueuePutEvent(PPDMIMOUSEPORT pInterface, int32_t dx, int32_t dy, int32_t dz, int32_t dw, -@@ -121,7 +122,8 @@ +@@ -141,7 +142,8 @@ static DECLCALLBACK(int) drvMouseQueuePutEvent(PPDMIMOUSEPORT pInterface, PDMQueueInsert(pDrv->pQueue, &pItem->Core); return VINF_SUCCESS; } @@ -21,7 +22,7 @@ alive but reads out the buffer with some delay. } /** -@@ -147,7 +149,8 @@ +@@ -169,7 +171,8 @@ static DECLCALLBACK(int) drvMouseQueuePutEventAbs(PPDMIMOUSEPORT pInterface, PDMQueueInsert(pDrv->pQueue, &pItem->Core); return VINF_SUCCESS; } diff --git a/repos/ports/src/virtualbox/patches/network.patch b/repos/ports/src/virtualbox/patches/network.patch index c1cc562917..ab140c7dd1 100644 --- a/repos/ports/src/virtualbox/patches/network.patch +++ b/repos/ports/src/virtualbox/patches/network.patch @@ -1,18 +1,10 @@ -+++ src/app/virtualbox/src/VBox/Devices/Network/DevPCNet.cpp -@@ -5331,6 +5331,11 @@ - rc = PDMDevHlpDriverAttach(pDevIns, 0, &pThis->IBase, &pThis->pDrvBase, "Network Port"); - if (RT_SUCCESS(rc)) - { -+ /* Genode: read out the mac address from nic_session interface */ -+ PPDMINETWORKCONFIG pDrvConfig = PDMIBASE_QUERY_INTERFACE(pThis->pDrvBase, PDMINETWORKCONFIG); -+ Assert(pDrvConfig && pDrvConfig->pfnGetMac); -+ pDrvConfig->pfnGetMac(pDrvConfig, &pThis->MacConfigured); -+ - if (rc == VINF_NAT_DNS) - { - #ifdef RT_OS_LINUX -+++ src/app/virtualbox/src/VBox/Devices/Network/DevE1000.cpp -@@ -7512,6 +7519,35 @@ +network.patch + +diff --git a/src/app/virtualbox/src/VBox/Devices/Network/DevE1000.cpp b/src/app/virtualbox/src/VBox/Devices/Network/DevE1000.cpp +index aa3eb87..fc2660a 100644 +--- a/src/app/virtualbox/src/VBox/Devices/Network/DevE1000.cpp ++++ b/src/app/virtualbox/src/VBox/Devices/Network/DevE1000.cpp +@@ -7519,6 +7519,35 @@ static DECLCALLBACK(int) e1kR3Construct(PPDMDEVINS pDevIns, int iInstance, PCFGM pThis->fR0Enabled ? "enabled" : "disabled", pThis->fRCEnabled ? "enabled" : "disabled")); @@ -48,7 +40,7 @@ /* Initialize the EEPROM. */ pThis->eeprom.init(pThis->macConfigured); -@@ -7670,28 +7706,6 @@ +@@ -7677,28 +7706,6 @@ static DECLCALLBACK(int) e1kR3Construct(PPDMDEVINS pDevIns, int iInstance, PCFGM return PDMDEV_SET_ERROR(pDevIns, rc, N_("Failed to attach the status LUN")); pThis->pLedsConnector = PDMIBASE_QUERY_INTERFACE(pBase, PDMILEDCONNECTORS); @@ -77,3 +69,19 @@ rc = RTSemEventCreate(&pThis->hEventMoreRxDescAvail); if (RT_FAILURE(rc)) return rc; +diff --git a/src/app/virtualbox/src/VBox/Devices/Network/DevPCNet.cpp b/src/app/virtualbox/src/VBox/Devices/Network/DevPCNet.cpp +index 481267e..80f4af9 100644 +--- a/src/app/virtualbox/src/VBox/Devices/Network/DevPCNet.cpp ++++ b/src/app/virtualbox/src/VBox/Devices/Network/DevPCNet.cpp +@@ -5056,6 +5056,11 @@ static DECLCALLBACK(int) pcnetConstruct(PPDMDEVINS pDevIns, int iInstance, PCFGM + rc = PDMDevHlpDriverAttach(pDevIns, 0, &pThis->IBase, &pThis->pDrvBase, "Network Port"); + if (RT_SUCCESS(rc)) + { ++ /* Genode: read out the mac address from nic_session interface */ ++ PPDMINETWORKCONFIG pDrvConfig = PDMIBASE_QUERY_INTERFACE(pThis->pDrvBase, PDMINETWORKCONFIG); ++ Assert(pDrvConfig && pDrvConfig->pfnGetMac); ++ pDrvConfig->pfnGetMac(pDrvConfig, &pThis->MacConfigured); ++ + if (rc == VINF_NAT_DNS) + { + #ifdef RT_OS_LINUX diff --git a/repos/ports/src/virtualbox/patches/pdm_driver.patch b/repos/ports/src/virtualbox/patches/pdm_driver.patch index 0241aee397..b985112b76 100644 --- a/repos/ports/src/virtualbox/patches/pdm_driver.patch +++ b/repos/ports/src/virtualbox/patches/pdm_driver.patch @@ -1,5 +1,10 @@ -+++ src/app/virtualbox/src/VBox/VMM/VMMR3/PDMDriver.cpp -@@ -1550,7 +1550,11 @@ +pdm_driver.patch + +diff --git a/src/app/virtualbox/src/VBox/VMM/VMMR3/PDMDriver.cpp b/src/app/virtualbox/src/VBox/VMM/VMMR3/PDMDriver.cpp +index 80e4efc..43b3bfc 100644 +--- a/src/app/virtualbox/src/VBox/VMM/VMMR3/PDMDriver.cpp ++++ b/src/app/virtualbox/src/VBox/VMM/VMMR3/PDMDriver.cpp +@@ -1550,7 +1550,11 @@ static DECLCALLBACK(int) pdmR3DrvHlp_AsyncCompletionTemplateCreate(PPDMDRVINS pD LogFlow(("pdmR3DrvHlp_AsyncCompletionTemplateCreate: caller='%s'/%d: ppTemplate=%p pfnCompleted=%p pszDesc=%p:{%s}\n", pDrvIns->pReg->szName, pDrvIns->iInstance, ppTemplate, pfnCompleted, pszDesc, pszDesc)); diff --git a/repos/ports/src/virtualbox/patches/poke.patch b/repos/ports/src/virtualbox/patches/poke.patch index 84d2d56678..96fe3f9261 100644 --- a/repos/ports/src/virtualbox/patches/poke.patch +++ b/repos/ports/src/virtualbox/patches/poke.patch @@ -1,4 +1,9 @@ -+++ src/app/virtualbox/src/VBox/VMM/VMMR3/VMEmt.cpp +poke.patch + +diff --git a/src/app/virtualbox/src/VBox/VMM/VMMR3/VMEmt.cpp b/src/app/virtualbox/src/VBox/VMM/VMMR3/VMEmt.cpp +index f52b3c7..8135443 100644 +--- a/src/app/virtualbox/src/VBox/VMM/VMMR3/VMEmt.cpp ++++ b/src/app/virtualbox/src/VBox/VMM/VMMR3/VMEmt.cpp @@ -804,6 +804,20 @@ static DECLCALLBACK(int) vmR3HaltGlobal1Wait(PUVMCPU pUVCpu) */ static DECLCALLBACK(void) vmR3HaltGlobal1NotifyCpuFF(PUVMCPU pUVCpu, uint32_t fFlags) diff --git a/repos/ports/src/virtualbox/patches/rem_irq.patch b/repos/ports/src/virtualbox/patches/rem_irq.patch index c0a1a49294..4b2937b913 100644 --- a/repos/ports/src/virtualbox/patches/rem_irq.patch +++ b/repos/ports/src/virtualbox/patches/rem_irq.patch @@ -1,5 +1,10 @@ -+++ src/app/virtualbox/src/VBox/VMM/VMMR3/TRPM.cpp -@@ -1561,6 +1561,17 @@ +rem_irq.patch + +diff --git a/src/app/virtualbox/src/VBox/VMM/VMMR3/TRPM.cpp b/src/app/virtualbox/src/VBox/VMM/VMMR3/TRPM.cpp +index 8c12949..a7fd67e 100644 +--- a/src/app/virtualbox/src/VBox/VMM/VMMR3/TRPM.cpp ++++ b/src/app/virtualbox/src/VBox/VMM/VMMR3/TRPM.cpp +@@ -1561,6 +1561,17 @@ VMMR3DECL(int) TRPMR3InjectEvent(PVM pVM, PVMCPU pVCpu, TRPMEVENT enmEvent) return HMR3IsActive(pVCpu) ? VINF_EM_RESCHEDULE_HM : VINF_EM_RESCHEDULE_REM; /* (Heed the halted state if this is changed!) */ } #else /* !TRPM_FORWARD_TRAPS_IN_GC */ @@ -17,7 +22,7 @@ uint8_t u8Interrupt; int rc = PDMGetInterrupt(pVCpu, &u8Interrupt); Log(("TRPMR3InjectEvent: u8Interrupt=%d (%#x) rc=%Rrc\n", u8Interrupt, u8Interrupt, rc)); -@@ -1571,6 +1582,7 @@ +@@ -1571,6 +1582,7 @@ VMMR3DECL(int) TRPMR3InjectEvent(PVM pVM, PVMCPU pVCpu, TRPMEVENT enmEvent) STAM_COUNTER_INC(&pVM->trpm.s.paStatForwardedIRQR3[u8Interrupt]); return HMR3IsActive(pVCpu) ? VINF_EM_RESCHEDULE_HM : VINF_EM_RESCHEDULE_REM; } diff --git a/repos/ports/src/virtualbox/patches/serial.patch b/repos/ports/src/virtualbox/patches/serial.patch index c37590ae5f..a87b3c5d4e 100644 --- a/repos/ports/src/virtualbox/patches/serial.patch +++ b/repos/ports/src/virtualbox/patches/serial.patch @@ -1,5 +1,10 @@ -+++ src/app/virtualbox/src/VBox/Devices/Serial/DrvHostSerial.cpp -@@ -903,6 +903,7 @@ +serial.patch + +diff --git a/src/app/virtualbox/src/VBox/Devices/Serial/DrvHostSerial.cpp b/src/app/virtualbox/src/VBox/Devices/Serial/DrvHostSerial.cpp +index 0c44fad..34b7fea 100644 +--- a/src/app/virtualbox/src/VBox/Devices/Serial/DrvHostSerial.cpp ++++ b/src/app/virtualbox/src/VBox/Devices/Serial/DrvHostSerial.cpp +@@ -903,6 +903,7 @@ static DECLCALLBACK(int) drvHostSerialMonitorThread(PPDMDRVINS pDrvIns, PPDMTHRE PDMDrvHlpVMSetRuntimeError(pDrvIns, 0 /*fFlags*/, "DrvHostSerialFail", N_("Ioctl failed for serial host device '%s' (%Rrc). The device will not work properly"), pThis->pszDevicePath, RTErrConvertFromErrno(errno)); diff --git a/repos/ports/src/virtualbox/patches/series b/repos/ports/src/virtualbox/patches/series new file mode 100644 index 0000000000..a758c87a8a --- /dev/null +++ b/repos/ports/src/virtualbox/patches/series @@ -0,0 +1,21 @@ +acpi_drv.patch +dev_e1000.patch +eminternal.patch +iconv.patch +mouse.patch +pdm_driver.patch +poke.patch +sharedfolder_pagelist.patch +time-log-deadlock.patch +tm_retries.patch +vbox_inc.patch +vbox_main.patch +network.patch +vga_fb.patch +vga_vbva.patch +vmdk.patch +vmmdev.patch +avoid_yield.patch +serial.patch +rem_irq.patch +usb.patch diff --git a/repos/ports/src/virtualbox/patches/sharedfolder_pagelist.patch b/repos/ports/src/virtualbox/patches/sharedfolder_pagelist.patch index a6e2ae6074..3a65f17cfb 100644 --- a/repos/ports/src/virtualbox/patches/sharedfolder_pagelist.patch +++ b/repos/ports/src/virtualbox/patches/sharedfolder_pagelist.patch @@ -1,5 +1,10 @@ -+++ src/app/virtualbox/src/VBox/HostServices/SharedFolders/service.cpp -@@ -546,6 +546,14 @@ +sharedfolder_pagelist.patch + +diff --git a/src/app/virtualbox/src/VBox/HostServices/SharedFolders/service.cpp b/src/app/virtualbox/src/VBox/HostServices/SharedFolders/service.cpp +index 49a0006..499d541 100644 +--- a/src/app/virtualbox/src/VBox/HostServices/SharedFolders/service.cpp ++++ b/src/app/virtualbox/src/VBox/HostServices/SharedFolders/service.cpp +@@ -549,6 +549,14 @@ static DECLCALLBACK(void) svcCall (void *, VBOXHGCMCALLHANDLE callHandle, uint32 } else { @@ -14,7 +19,7 @@ /* Execute the function. */ if (pStatusLed) { -@@ -559,13 +567,25 @@ +@@ -562,13 +570,25 @@ static DECLCALLBACK(void) svcCall (void *, VBOXHGCMCALLHANDLE callHandle, uint32 if (RT_SUCCESS(rc)) { @@ -41,7 +46,7 @@ } } break; -@@ -613,6 +633,16 @@ +@@ -616,6 +636,16 @@ static DECLCALLBACK(void) svcCall (void *, VBOXHGCMCALLHANDLE callHandle, uint32 } else { @@ -58,7 +63,7 @@ /* Execute the function. */ if (pStatusLed) { -@@ -626,13 +656,25 @@ +@@ -629,13 +659,25 @@ static DECLCALLBACK(void) svcCall (void *, VBOXHGCMCALLHANDLE callHandle, uint32 if (RT_SUCCESS(rc)) { diff --git a/repos/ports/src/virtualbox/patches/time-log-deadlock.patch b/repos/ports/src/virtualbox/patches/time-log-deadlock.patch index 9a4a14470c..ea179a5b78 100644 --- a/repos/ports/src/virtualbox/patches/time-log-deadlock.patch +++ b/repos/ports/src/virtualbox/patches/time-log-deadlock.patch @@ -1,5 +1,10 @@ -+++ src/app/virtualbox/src/VBox/Runtime/common/log/log.cpp -@@ -3063,7 +3066,8 @@ +time-log-deadlock.patch + +diff --git a/src/app/virtualbox/src/VBox/Runtime/common/log/log.cpp b/src/app/virtualbox/src/VBox/Runtime/common/log/log.cpp +index 62463c4..f10baad 100644 +--- a/src/app/virtualbox/src/VBox/Runtime/common/log/log.cpp ++++ b/src/app/virtualbox/src/VBox/Runtime/common/log/log.cpp +@@ -3128,7 +3128,8 @@ static DECLCALLBACK(size_t) rtLogOutputPrefixed(void *pv, const char *pachChars, { #if defined(IN_RING3) || defined(IN_RC) diff --git a/repos/ports/src/virtualbox/patches/tm_retries.patch b/repos/ports/src/virtualbox/patches/tm_retries.patch index 0b81bc3e99..7ecf15e86b 100644 --- a/repos/ports/src/virtualbox/patches/tm_retries.patch +++ b/repos/ports/src/virtualbox/patches/tm_retries.patch @@ -1,22 +1,9 @@ -Wait longer for stable timer state - -Some functions in the time manager, for example 'TMTimerSet()' and -'TMTimerStop()' let VirtualBox abort with a failed assertion if the timer -does not change to a 'stable' state after 1000 calls of a mixture of -'yield' and 'sleep'. On Genode, this happens sometimes when the 'EMT' -thread is executing 'TMTimerSet()' and gets interrupted by the 'TAP' -thread, which calls 'TMTimerStop()' and waits for the 'EMT' thread to -finish setting the timer. Since the 'EMT' thread has the lowest priority, -1000 retries can be too few. Without the assertion, these functions would -return an error code, which is often ignored by the caller, so it seems -safer to keep retrying until the function can return successfully. +tm_retries.patch -Issue #1437 - -diff --git src/app/virtualbox/src/VBox/VMM/VMMAll/TMAll.cpp src/app/virtualbox/src/VBox/VMM/VMMAll/TMAll.cpp +diff --git a/src/app/virtualbox/src/VBox/VMM/VMMAll/TMAll.cpp b/src/app/virtualbox/src/VBox/VMM/VMMAll/TMAll.cpp index a1167a1..fbf95e2 100644 ---- src/app/virtualbox/src/VBox/VMM/VMMAll/TMAll.cpp -+++ src/app/virtualbox/src/VBox/VMM/VMMAll/TMAll.cpp +--- a/src/app/virtualbox/src/VBox/VMM/VMMAll/TMAll.cpp ++++ b/src/app/virtualbox/src/VBox/VMM/VMMAll/TMAll.cpp @@ -1334,6 +1334,12 @@ VMMDECL(int) TMTimerSet(PTMTIMER pTimer, uint64_t u64Expire) AssertMsgFailed(("Unknown timer state %d (%s)\n", enmState, R3STRING(pTimer->pszDesc))); return VERR_TM_UNKNOWN_STATE; @@ -69,10 +56,10 @@ index a1167a1..fbf95e2 100644 } while (cRetries-- > 0); AssertMsgFailed(("Failed waiting for stable state. state=%d (%s)\n", pTimer->enmState, R3STRING(pTimer->pszDesc))); -diff --git src/app/virtualbox/src/VBox/VMM/VMMR3/TM.cpp src/app/virtualbox/src/VBox/VMM/VMMR3/TM.cpp +diff --git a/src/app/virtualbox/src/VBox/VMM/VMMR3/TM.cpp b/src/app/virtualbox/src/VBox/VMM/VMMR3/TM.cpp index f6f6c8e..c3bc22d 100644 ---- src/app/virtualbox/src/VBox/VMM/VMMR3/TM.cpp -+++ src/app/virtualbox/src/VBox/VMM/VMMR3/TM.cpp +--- a/src/app/virtualbox/src/VBox/VMM/VMMR3/TM.cpp ++++ b/src/app/virtualbox/src/VBox/VMM/VMMR3/TM.cpp @@ -1617,8 +1617,10 @@ VMMR3DECL(int) TMR3TimerDestroy(PTMTIMER pTimer) TM_UNLOCK_TIMERS(pVM); if (!RTThreadYield()) diff --git a/repos/ports/src/virtualbox/patches/usb.patch b/repos/ports/src/virtualbox/patches/usb.patch index b298177436..d22402b0fd 100644 --- a/repos/ports/src/virtualbox/patches/usb.patch +++ b/repos/ports/src/virtualbox/patches/usb.patch @@ -1,103 +1,10 @@ -+++ src/app/virtualbox/src/VBox/Devices/USB/VUSBDevice.cpp -@@ -230,7 +230,14 @@ - if (i != VUSB_PIPE_DEFAULT) - { - vusbMsgFreeExtraData(pDev->aPipes[i].pCtrl); -+ -+ int rc = RTCritSectDelete(&pDev->aPipes[i].CritSectCtrl); -+ AssertRC(rc); -+ - memset(&pDev->aPipes[i], 0, sizeof(pDev->aPipes[i])); -+ -+ rc = RTCritSectInit(&pDev->aPipes[i].CritSectCtrl); -+ AssertRC(rc); - } - } - memset(pDev->paIfStates, 0, pCfgDesc->Core.bNumInterfaces * sizeof(pDev->paIfStates[0])); -@@ -1134,7 +1134,7 @@ - vusbUrbDoReapAsyncDev(pDev, RT_INDEFINITE_WAIT); - - /* Process any URBs waiting to be cancelled first. */ -- int rc = RTReqQueueProcess(pDev->hReqQueueSync, 0); /* Don't wait if there is nothing to do. */ -+ int rc = RTReqQueueProcess(pDev->hReqQueueSync, pDev->enmState == VUSB_DEVICE_STATE_RESET ? 5 : 0); /* if in reset state (takes 10ms) sleep a bit - otherwise this thread consumes in this loop a lot of cpu time */ - Assert(RT_SUCCESS(rc) || rc == VERR_TIMEOUT); - } - -+++ src/app/virtualbox/src/VBox/Main/src-server/MachineImpl.cpp -@@ -13571,6 +13582,7 @@ - AutoCaller autoCaller(this); - AssertComRCReturn(autoCaller.rc(), autoCaller.rc()); - -+#if 0 - #ifdef VBOX_WITH_USB - HRESULT rc = mUSBDeviceFilters->notifyProxy(true /* aInsertFilters */); - AssertComRC(rc); -@@ -13579,6 +13591,7 @@ - USBProxyService *service = mParent->host()->usbProxyService(); - AssertReturn(service, E_FAIL); - return service->autoCaptureDevicesForVM(this); -+#endif /* if 0 */ - #else - return S_OK; - #endif -@@ -13601,6 +13614,7 @@ - AutoCaller autoCaller(this); - AssertComRCReturn(autoCaller.rc(), autoCaller.rc()); - -+#if 0 - #ifdef VBOX_WITH_USB - HRESULT rc = mUSBDeviceFilters->notifyProxy(false /* aInsertFilters */); - AssertComRC(rc); -@@ -13609,6 +13623,7 @@ - USBProxyService *service = mParent->host()->usbProxyService(); - AssertReturn(service, E_FAIL); - return service->detachAllDevicesFromVM(this, !!aDone, false /* aAbnormal */); -+#endif /* if 0 */ - #else - NOREF(aDone); - return S_OK; -+++ src/app/virtualbox/src/VBox/Main/include/Matching.h -@@ -291,10 +291,12 @@ - return mValueAny || mValue == aValue; - } - -+#if 0 - bool isMatch (const BOOL aValue) const - { - return isMatch (bool (aValue == TRUE)); - } -+#endif /* if 0 */ - - private: - -+++ src/app/virtualbox/src/VBox/Main/src-server/USBDeviceFiltersImpl.cpp -@@ -1037,13 +1037,10 @@ - LogFlowThisFunc(("aInsertFilters=%RTbool\n", aInsertFilters)); - - AutoCaller autoCaller(this); -- AssertComRCReturn(autoCaller.rc(), false); -+ AssertComRCReturnRC(autoCaller.rc()); - - AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); - -- USBProxyService *pProxySvc = m->pHost->usbProxyService(); -- AssertReturn(pProxySvc, E_FAIL); -- - DeviceFilterList::const_iterator it = m->llDeviceFilters->begin(); - while (it != m->llDeviceFilters->end()) - { -@@ -1054,6 +1051,9 @@ - && pFilter->getData().mRemote.isMatch(false) /* and if the filter is NOT remote */ - ) - { -+ USBProxyService *pProxySvc = m->pHost->usbProxyService(); -+ AssertReturn(pProxySvc, E_FAIL); -+ - if (aInsertFilters) - { - AssertReturn(pFilter->getId() == NULL, E_FAIL); -+++ src/app/virtualbox/src/VBox/Devices/USB/USBProxyDevice.cpp -@@ -843,10 +843,14 @@ +usb.patch + +diff --git a/src/app/virtualbox/src/VBox/Devices/USB/USBProxyDevice.cpp b/src/app/virtualbox/src/VBox/Devices/USB/USBProxyDevice.cpp +index a51bc36..bed42e8 100644 +--- a/src/app/virtualbox/src/VBox/Devices/USB/USBProxyDevice.cpp ++++ b/src/app/virtualbox/src/VBox/Devices/USB/USBProxyDevice.cpp +@@ -843,10 +843,14 @@ static DECLCALLBACK(int) usbProxyConstruct(PPDMUSBINS pUsbIns, int iInstance, PC /* * Select backend and open the device. */ @@ -112,8 +19,39 @@ pThis->pvInstanceDataR3 = RTMemAllocZ(pThis->pOps->cbBackend); if (!pThis->pvInstanceDataR3) -+++ src/app/virtualbox/src/VBox/Devices/build/VBoxDD.cpp -@@ -39,6 +39,7 @@ +diff --git a/src/app/virtualbox/src/VBox/Devices/USB/VUSBDevice.cpp b/src/app/virtualbox/src/VBox/Devices/USB/VUSBDevice.cpp +index 4790fcb..4efa818 100644 +--- a/src/app/virtualbox/src/VBox/Devices/USB/VUSBDevice.cpp ++++ b/src/app/virtualbox/src/VBox/Devices/USB/VUSBDevice.cpp +@@ -230,7 +230,14 @@ bool vusbDevDoSelectConfig(PVUSBDEV pDev, PCVUSBDESCCONFIGEX pCfgDesc) + if (i != VUSB_PIPE_DEFAULT) + { + vusbMsgFreeExtraData(pDev->aPipes[i].pCtrl); ++ ++ int rc = RTCritSectDelete(&pDev->aPipes[i].CritSectCtrl); ++ AssertRC(rc); ++ + memset(&pDev->aPipes[i], 0, sizeof(pDev->aPipes[i])); ++ ++ rc = RTCritSectInit(&pDev->aPipes[i].CritSectCtrl); ++ AssertRC(rc); + } + } + memset(pDev->paIfStates, 0, pCfgDesc->Core.bNumInterfaces * sizeof(pDev->paIfStates[0])); +@@ -1134,7 +1141,7 @@ static DECLCALLBACK(int) vusbDevUrbIoThread(RTTHREAD hThread, void *pvUser) + vusbUrbDoReapAsyncDev(pDev, RT_INDEFINITE_WAIT); + + /* Process any URBs waiting to be cancelled first. */ +- int rc = RTReqQueueProcess(pDev->hReqQueueSync, 0); /* Don't wait if there is nothing to do. */ ++ int rc = RTReqQueueProcess(pDev->hReqQueueSync, pDev->enmState == VUSB_DEVICE_STATE_RESET ? 5 : 0); /* if in reset state (takes 10ms) sleep a bit - otherwise this thread consumes in this loop a lot of cpu time */ + Assert(RT_SUCCESS(rc) || rc == VERR_TIMEOUT); + } + +diff --git a/src/app/virtualbox/src/VBox/Devices/build/VBoxDD.cpp b/src/app/virtualbox/src/VBox/Devices/build/VBoxDD.cpp +index 3173a36..8105987 100644 +--- a/src/app/virtualbox/src/VBox/Devices/build/VBoxDD.cpp ++++ b/src/app/virtualbox/src/VBox/Devices/build/VBoxDD.cpp +@@ -39,6 +39,7 @@ const void *g_apvVBoxDDDependencies[] = NULL, }; @@ -121,7 +59,7 @@ /** * Register builtin devices. -@@ -329,6 +330,7 @@ +@@ -329,6 +330,7 @@ extern "C" DECLEXPORT(int) VBoxDriversRegister(PCPDMDRVREGCB pCallbacks, uint32_ return VINF_SUCCESS; } @@ -129,3 +67,85 @@ /** * Register builtin USB device. +diff --git a/src/app/virtualbox/src/VBox/Main/include/Matching.h b/src/app/virtualbox/src/VBox/Main/include/Matching.h +index 2f01f69..9b13e37 100644 +--- a/src/app/virtualbox/src/VBox/Main/include/Matching.h ++++ b/src/app/virtualbox/src/VBox/Main/include/Matching.h +@@ -291,10 +291,12 @@ public: + return mValueAny || mValue == aValue; + } + ++#if 0 + bool isMatch (const BOOL aValue) const + { + return isMatch (bool (aValue == TRUE)); + } ++#endif /* if 0 */ + + private: + +diff --git a/src/app/virtualbox/src/VBox/Main/src-server/MachineImpl.cpp b/src/app/virtualbox/src/VBox/Main/src-server/MachineImpl.cpp +index 5fcb53c..b4016b2 100644 +--- a/src/app/virtualbox/src/VBox/Main/src-server/MachineImpl.cpp ++++ b/src/app/virtualbox/src/VBox/Main/src-server/MachineImpl.cpp +@@ -13582,6 +13582,7 @@ STDMETHODIMP SessionMachine::AutoCaptureUSBDevices() + AutoCaller autoCaller(this); + AssertComRCReturn(autoCaller.rc(), autoCaller.rc()); + ++#if 0 + #ifdef VBOX_WITH_USB + HRESULT rc = mUSBDeviceFilters->notifyProxy(true /* aInsertFilters */); + AssertComRC(rc); +@@ -13590,6 +13591,7 @@ STDMETHODIMP SessionMachine::AutoCaptureUSBDevices() + USBProxyService *service = mParent->host()->usbProxyService(); + AssertReturn(service, E_FAIL); + return service->autoCaptureDevicesForVM(this); ++#endif /* if 0 */ + #else + return S_OK; + #endif +@@ -13612,6 +13614,7 @@ STDMETHODIMP SessionMachine::DetachAllUSBDevices(BOOL aDone) + AutoCaller autoCaller(this); + AssertComRCReturn(autoCaller.rc(), autoCaller.rc()); + ++#if 0 + #ifdef VBOX_WITH_USB + HRESULT rc = mUSBDeviceFilters->notifyProxy(false /* aInsertFilters */); + AssertComRC(rc); +@@ -13620,6 +13623,7 @@ STDMETHODIMP SessionMachine::DetachAllUSBDevices(BOOL aDone) + USBProxyService *service = mParent->host()->usbProxyService(); + AssertReturn(service, E_FAIL); + return service->detachAllDevicesFromVM(this, !!aDone, false /* aAbnormal */); ++#endif /* if 0 */ + #else + NOREF(aDone); + return S_OK; +diff --git a/src/app/virtualbox/src/VBox/Main/src-server/USBDeviceFiltersImpl.cpp b/src/app/virtualbox/src/VBox/Main/src-server/USBDeviceFiltersImpl.cpp +index 09b42f5..c179ca6 100644 +--- a/src/app/virtualbox/src/VBox/Main/src-server/USBDeviceFiltersImpl.cpp ++++ b/src/app/virtualbox/src/VBox/Main/src-server/USBDeviceFiltersImpl.cpp +@@ -1037,13 +1037,10 @@ HRESULT USBDeviceFilters::notifyProxy(bool aInsertFilters) + LogFlowThisFunc(("aInsertFilters=%RTbool\n", aInsertFilters)); + + AutoCaller autoCaller(this); +- AssertComRCReturn(autoCaller.rc(), false); ++ AssertComRCReturnRC(autoCaller.rc()); + + AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); + +- USBProxyService *pProxySvc = m->pHost->usbProxyService(); +- AssertReturn(pProxySvc, E_FAIL); +- + DeviceFilterList::const_iterator it = m->llDeviceFilters->begin(); + while (it != m->llDeviceFilters->end()) + { +@@ -1054,6 +1051,9 @@ HRESULT USBDeviceFilters::notifyProxy(bool aInsertFilters) + && pFilter->getData().mRemote.isMatch(false) /* and if the filter is NOT remote */ + ) + { ++ USBProxyService *pProxySvc = m->pHost->usbProxyService(); ++ AssertReturn(pProxySvc, E_FAIL); ++ + if (aInsertFilters) + { + AssertReturn(pFilter->getId() == NULL, E_FAIL); diff --git a/repos/ports/src/virtualbox/patches/vbox_inc.patch b/repos/ports/src/virtualbox/patches/vbox_inc.patch index 35c2bab425..c529d75b8a 100644 --- a/repos/ports/src/virtualbox/patches/vbox_inc.patch +++ b/repos/ports/src/virtualbox/patches/vbox_inc.patch @@ -1,5 +1,25 @@ -+++ src/app/virtualbox/include/VBox/com/array.h -@@ -219,10 +219,10 @@ +vbox_inc.patch + +diff --git a/src/app/virtualbox/include/VBox/com/ErrorInfo.h b/src/app/virtualbox/include/VBox/com/ErrorInfo.h +index 869b998..c6adf70 100644 +--- a/src/app/virtualbox/include/VBox/com/ErrorInfo.h ++++ b/src/app/virtualbox/include/VBox/com/ErrorInfo.h +@@ -31,8 +31,8 @@ + #include "VBox/com/Guid.h" + #include "VBox/com/assert.h" + +-struct IProgress; +-struct IVirtualBoxErrorInfo; ++//struct IProgress; ++//struct IVirtualBoxErrorInfo; + + namespace com + { +diff --git a/src/app/virtualbox/include/VBox/com/array.h b/src/app/virtualbox/include/VBox/com/array.h +index 77f9d60..dcbad41 100644 +--- a/src/app/virtualbox/include/VBox/com/array.h ++++ b/src/app/virtualbox/include/VBox/com/array.h +@@ -219,10 +219,10 @@ struct SafeArrayTraits protected: /** Initializes memory for aElem. */ @@ -12,49 +32,11 @@ /** Creates a deep copy of aFrom and stores it in aTo. */ static void Copy(const T &aFrom, T &aTo) { aTo = aFrom; } -+++ src/app/virtualbox/include/VBox/com/ErrorInfo.h -@@ -31,8 +31,8 @@ - #include "VBox/com/Guid.h" - #include "VBox/com/assert.h" - --struct IProgress; --struct IVirtualBoxErrorInfo; -+//struct IProgress; -+//struct IVirtualBoxErrorInfo; - - namespace com - { -+++ src/app/virtualbox/include/VBox/com/string.h -@@ -109,11 +109,13 @@ - } - - #if defined(VBOX_WITH_XPCOM) -+/* - Bstr(const wchar_t *that) - { - AssertCompile(sizeof(wchar_t) == sizeof(OLECHAR)); - copyFrom((const OLECHAR *)that); - } -+*/ - #endif - - Bstr(const RTCString &that) -@@ -151,12 +153,14 @@ - } - - #if defined(VBOX_WITH_XPCOM) -+/* - Bstr& operator=(const wchar_t *that) - { - cleanup(); - copyFrom((const OLECHAR *)that); - return *this; - } -+*/ - #endif - - Bstr& setNull() -@@ -247,7 +251,7 @@ +diff --git a/src/app/virtualbox/include/VBox/com/string.h b/src/app/virtualbox/include/VBox/com/string.h +index 263dc40..768c336 100644 +--- a/src/app/virtualbox/include/VBox/com/string.h ++++ b/src/app/virtualbox/include/VBox/com/string.h +@@ -247,7 +247,7 @@ public: * returns a pointer to a global variable containing an empty BSTR with a proper zero * length prefix so that Windows is happy. */ @@ -63,8 +45,11 @@ { if (m_bstr) return m_bstr; -+++ src/app/virtualbox/include/VBox/vmm/hm_vmx.h -@@ -1859,10 +1859,10 @@ +diff --git a/src/app/virtualbox/include/VBox/vmm/hm_vmx.h b/src/app/virtualbox/include/VBox/vmm/hm_vmx.h +index 7deb357..668764c 100644 +--- a/src/app/virtualbox/include/VBox/vmm/hm_vmx.h ++++ b/src/app/virtualbox/include/VBox/vmm/hm_vmx.h +@@ -1859,10 +1859,10 @@ DECLINLINE(int) VMXEnable(RTHCPHYS pVMXOn) ".byte 0xF3, 0x0F, 0xC7, 0x34, 0x24 # VMXON [esp] \n\t" "ja 2f \n\t" "je 1f \n\t" @@ -77,7 +62,7 @@ "2: \n\t" "add $8, %%esp \n\t" :"=rm"(rc) -@@ -1952,7 +1952,7 @@ +@@ -1952,7 +1952,7 @@ DECLINLINE(int) VMXClearVmcs(RTHCPHYS pVMCS) "push %2 \n\t" ".byte 0x66, 0x0F, 0xC7, 0x34, 0x24 # VMCLEAR [esp] \n\t" "jnc 1f \n\t" @@ -86,7 +71,7 @@ "1: \n\t" "add $8, %%esp \n\t" :"=rm"(rc) -@@ -2009,7 +2009,7 @@ +@@ -2009,7 +2009,7 @@ DECLINLINE(int) VMXActivateVmcs(RTHCPHYS pVMCS) "push %2 \n\t" ".byte 0x0F, 0xC7, 0x34, 0x24 # VMPTRLD [esp] \n\t" "jnc 1f \n\t" @@ -95,7 +80,7 @@ "1: \n\t" "add $8, %%esp \n\t" :"=rm"(rc) -@@ -2079,10 +2079,10 @@ +@@ -2079,10 +2079,10 @@ DECLINLINE(int) VMXWriteVmcs32(uint32_t idxField, uint32_t u32Val) ".byte 0x0F, 0x79, 0xC2 # VMWRITE eax, edx \n\t" "ja 2f \n\t" "je 1f \n\t" @@ -108,7 +93,7 @@ "2: \n\t" :"=rm"(rc) :"0"(VINF_SUCCESS), -@@ -2207,14 +2207,14 @@ +@@ -2207,14 +2207,14 @@ DECLINLINE(int) VMXReadVmcs32(uint32_t idxField, uint32_t *pData) # if RT_INLINE_ASM_GNU_STYLE int rc = VINF_SUCCESS; __asm__ __volatile__ ( diff --git a/repos/ports/src/virtualbox/patches/vbox_main.patch b/repos/ports/src/virtualbox/patches/vbox_main.patch index e059ca93f4..ccddad538c 100644 --- a/repos/ports/src/virtualbox/patches/vbox_main.patch +++ b/repos/ports/src/virtualbox/patches/vbox_main.patch @@ -1,7 +1,9 @@ -diff --git src/app/virtualbox/src/VBox/Main/include/ConsoleImpl.h src/app/virtualbox/src/VBox/Main/include/ConsoleImpl.h -index 030a601..fe6cb1c 100644 ---- src/app/virtualbox/src/VBox/Main/include/ConsoleImpl.h -+++ src/app/virtualbox/src/VBox/Main/include/ConsoleImpl.h +vbox_main.patch + +diff --git a/src/app/virtualbox/src/VBox/Main/include/ConsoleImpl.h b/src/app/virtualbox/src/VBox/Main/include/ConsoleImpl.h +index 030a601..7fce453 100644 +--- a/src/app/virtualbox/src/VBox/Main/include/ConsoleImpl.h ++++ b/src/app/virtualbox/src/VBox/Main/include/ConsoleImpl.h @@ -50,7 +50,9 @@ class VMMDevMouseInterface; class DisplayMouseInterface; @@ -12,7 +14,17 @@ index 030a601..fe6cb1c 100644 #include #ifdef VBOX_WITH_GUEST_PROPS # include /* For the property notification callback */ -@@ -261,10 +263,12 @@ public: +@@ -251,7 +253,9 @@ public: + void VRDPInterceptUSB(uint32_t u32ClientId, void **ppvIntercept); + void VRDPInterceptClipboard(uint32_t u32ClientId); + ++#if 0 + void processRemoteUSBDevices(uint32_t u32ClientId, VRDEUSBDEVICEDESC *pDevList, uint32_t cbDevList, bool fDescExt); ++#endif /* if 0 */ + void reportVmStatistics(ULONG aValidStats, ULONG aCpuUser, + ULONG aCpuKernel, ULONG aCpuIdle, + ULONG aMemTotal, ULONG aMemFree, +@@ -261,10 +265,12 @@ public: ULONG aBalloonedVMM, ULONG aSharedVMM, ULONG aVmNetRx, ULONG aVmNetTx) { @@ -25,7 +37,7 @@ index 030a601..fe6cb1c 100644 } void enableVMMStatistics(BOOL aEnable); -@@ -274,12 +278,12 @@ public: +@@ -274,12 +280,12 @@ public: // callback callers (partly; for some events console callbacks are notified // directly from IInternalSessionControl event handlers declared above) @@ -44,10 +56,10 @@ index 030a601..fe6cb1c 100644 void onStateChange(MachineState_T aMachineState); void onAdditionsStateChange(); void onAdditionsOutdated(); -diff --git src/app/virtualbox/src/VBox/Main/include/DisplayImpl.h src/app/virtualbox/src/VBox/Main/include/DisplayImpl.h -index 585f6b2..368453c 100644 ---- src/app/virtualbox/src/VBox/Main/include/DisplayImpl.h -+++ src/app/virtualbox/src/VBox/Main/include/DisplayImpl.h +diff --git a/src/app/virtualbox/src/VBox/Main/include/DisplayImpl.h b/src/app/virtualbox/src/VBox/Main/include/DisplayImpl.h +index 585f6b2..ecb58b9 100644 +--- a/src/app/virtualbox/src/VBox/Main/include/DisplayImpl.h ++++ b/src/app/virtualbox/src/VBox/Main/include/DisplayImpl.h @@ -122,7 +122,7 @@ typedef struct _DISPLAYFBINFO class DisplayMouseInterface { @@ -57,15 +69,7 @@ index 585f6b2..368453c 100644 ULONG *pcy, ULONG *pcBPP, LONG *pXOrigin, LONG *pYOrigin) = 0; virtual void getFramebufferDimensions(int32_t *px1, int32_t *py1, int32_t *px2, int32_t *py2) = 0; -@@ -132,6 +132,7 @@ class VMMDev; - - class ATL_NO_VTABLE Display : - public VirtualBoxBase, -+ public IEventListener, - VBOX_SCRIPTABLE_IMPL(IEventListener), - VBOX_SCRIPTABLE_IMPL(IDisplay), - public DisplayMouseInterface -@@ -192,7 +193,7 @@ public: +@@ -192,7 +192,7 @@ public: return maFramebuffers[VBOX_VIDEO_PRIMARY_SCREEN].pFramebuffer; } void getFramebufferDimensions(int32_t *px1, int32_t *py1, int32_t *px2, int32_t *py2); @@ -74,19 +78,21 @@ index 585f6b2..368453c 100644 ULONG *pcBPP, LONG *pXOrigin, LONG *pYOrigin) { return GetScreenResolution(cScreen, pcx, pcy, pcBPP, pXOrigin, pYOrigin); -@@ -232,6 +233,8 @@ public: +@@ -232,6 +232,10 @@ public: static const PDMDRVREG DrvReg; ++#if 0 + static void fireGuestMonitorChangedEvent(EventSource*, GuestMonitorChangedEventType, int32_t, int32_t, int32_t, int32_t, int32_t); ++#endif + private: int updateDisplayData(void); -diff --git src/app/virtualbox/src/VBox/Main/include/FramebufferImpl.h src/app/virtualbox/src/VBox/Main/include/FramebufferImpl.h +diff --git a/src/app/virtualbox/src/VBox/Main/include/FramebufferImpl.h b/src/app/virtualbox/src/VBox/Main/include/FramebufferImpl.h index feebfcd..4136d6d 100644 ---- src/app/virtualbox/src/VBox/Main/include/FramebufferImpl.h -+++ src/app/virtualbox/src/VBox/Main/include/FramebufferImpl.h +--- a/src/app/virtualbox/src/VBox/Main/include/FramebufferImpl.h ++++ b/src/app/virtualbox/src/VBox/Main/include/FramebufferImpl.h @@ -70,6 +70,7 @@ public: STDMETHOD(SetVisibleRegion)(BYTE *aRectangles, ULONG aCount) = 0; @@ -95,10 +101,10 @@ index feebfcd..4136d6d 100644 }; #endif // ____H_H_FRAMEBUFFERIMPL -diff --git src/app/virtualbox/src/VBox/Main/include/MachineImpl.h src/app/virtualbox/src/VBox/Main/include/MachineImpl.h +diff --git a/src/app/virtualbox/src/VBox/Main/include/MachineImpl.h b/src/app/virtualbox/src/VBox/Main/include/MachineImpl.h index bb91290..d3c6d85 100644 ---- src/app/virtualbox/src/VBox/Main/include/MachineImpl.h -+++ src/app/virtualbox/src/VBox/Main/include/MachineImpl.h +--- a/src/app/virtualbox/src/VBox/Main/include/MachineImpl.h ++++ b/src/app/virtualbox/src/VBox/Main/include/MachineImpl.h @@ -1213,7 +1213,7 @@ private: HRESULT setMachineState(MachineState_T aMachineState); HRESULT updateMachineStateOnClient(); @@ -108,23 +114,10 @@ index bb91290..d3c6d85 100644 ConsoleTaskData mConsoleTaskData; -diff --git src/app/virtualbox/src/VBox/Main/include/MediumFormatImpl.h src/app/virtualbox/src/VBox/Main/include/MediumFormatImpl.h -index 2acdc6e..88ac27c 100644 ---- src/app/virtualbox/src/VBox/Main/include/MediumFormatImpl.h -+++ src/app/virtualbox/src/VBox/Main/include/MediumFormatImpl.h -@@ -72,6 +72,8 @@ public: - /** Const, no need to lock */ - const PropertyArray &i_getProperties() const { return m.maProperties; } - -+ HRESULT COMGETTER(Capabilities)(ComSafeArrayOut(MediumFormatCapabilities_T, aCapabilities)); -+ - private: - - // wrapped IMediumFormat properties -diff --git src/app/virtualbox/src/VBox/Main/include/NetworkServiceRunner.h src/app/virtualbox/src/VBox/Main/include/NetworkServiceRunner.h +diff --git a/src/app/virtualbox/src/VBox/Main/include/NetworkServiceRunner.h b/src/app/virtualbox/src/VBox/Main/include/NetworkServiceRunner.h index f0ec275..78a390e 100644 ---- src/app/virtualbox/src/VBox/Main/include/NetworkServiceRunner.h -+++ src/app/virtualbox/src/VBox/Main/include/NetworkServiceRunner.h +--- a/src/app/virtualbox/src/VBox/Main/include/NetworkServiceRunner.h ++++ b/src/app/virtualbox/src/VBox/Main/include/NetworkServiceRunner.h @@ -15,6 +15,9 @@ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. */ @@ -141,50 +134,10 @@ index f0ec275..78a390e 100644 }; + +#endif /* ____H_H_NetworkServiceRunner */ -diff --git src/app/virtualbox/src/VBox/Main/include/ProgressImpl.h src/app/virtualbox/src/VBox/Main/include/ProgressImpl.h -index 6b01274..70aca28 100644 ---- src/app/virtualbox/src/VBox/Main/include/ProgressImpl.h -+++ src/app/virtualbox/src/VBox/Main/include/ProgressImpl.h -@@ -103,7 +103,7 @@ public: - #if !defined (VBOX_COM_INPROC) - VirtualBox *aParent, - #endif -- IUnknown *aInitiator, -+ void *aInitiator, - CBSTR aDescription, - BOOL aCancelable, - OUT_GUID aId = NULL) -@@ -138,7 +138,7 @@ public: - #if !defined (VBOX_COM_INPROC) - VirtualBox *aParent, - #endif -- IUnknown *aInitiator, -+ void *aInitiator, - CBSTR aDescription, BOOL aCancelable, - ULONG cOperations, - CBSTR bstrFirstOperationDescription, -@@ -162,7 +162,7 @@ public: - #if !defined (VBOX_COM_INPROC) - VirtualBox *aParent, - #endif -- IUnknown *aInitiator, -+ void *aInitiator, - CBSTR aDescription, - BOOL aCancelable, - ULONG cOperations, -@@ -180,7 +180,7 @@ public: - #if !defined (VBOX_COM_INPROC) - VirtualBox *aParent, - #endif -- IUnknown *aInitiator, -+ void *aInitiator, - CBSTR aDescription, OUT_GUID aId = NULL); - HRESULT init(AutoInitSpan &aAutoInitSpan); - void init(AutoUninitSpan &aAutoUninitSpan); -diff --git src/app/virtualbox/src/VBox/Main/include/ProgressProxyImpl.h src/app/virtualbox/src/VBox/Main/include/ProgressProxyImpl.h +diff --git a/src/app/virtualbox/src/VBox/Main/include/ProgressProxyImpl.h b/src/app/virtualbox/src/VBox/Main/include/ProgressProxyImpl.h index 66f2b31..0ac7ab8 100644 ---- src/app/virtualbox/src/VBox/Main/include/ProgressProxyImpl.h -+++ src/app/virtualbox/src/VBox/Main/include/ProgressProxyImpl.h +--- a/src/app/virtualbox/src/VBox/Main/include/ProgressProxyImpl.h ++++ b/src/app/virtualbox/src/VBox/Main/include/ProgressProxyImpl.h @@ -52,7 +52,7 @@ public: #if !defined (VBOX_COM_INPROC) VirtualBox *pParent, @@ -194,22 +147,32 @@ index 66f2b31..0ac7ab8 100644 CBSTR bstrDescription, BOOL fCancelable, ULONG uTotalOperationsWeight, -diff --git src/app/virtualbox/src/VBox/Main/include/SessionImpl.h src/app/virtualbox/src/VBox/Main/include/SessionImpl.h -index b0f600e..4ee298c 100644 ---- src/app/virtualbox/src/VBox/Main/include/SessionImpl.h -+++ src/app/virtualbox/src/VBox/Main/include/SessionImpl.h -@@ -135,5 +135,7 @@ private: - ClientTokenHolder *mClientTokenHolder; - }; +diff --git a/src/app/virtualbox/src/VBox/Main/include/SessionImpl.h b/src/app/virtualbox/src/VBox/Main/include/SessionImpl.h +index b0f600e..bcd6b4c 100644 +--- a/src/app/virtualbox/src/VBox/Main/include/SessionImpl.h ++++ b/src/app/virtualbox/src/VBox/Main/include/SessionImpl.h +@@ -24,6 +24,8 @@ + # include "win/resource.h" + #endif -+class IInternalSessionControl : public Session { }; ++class GenodeConsole; + - #endif // !____H_SESSIONIMPL - /* vi: set tabstop=4 shiftwidth=4 expandtab: */ -diff --git src/app/virtualbox/src/VBox/Main/src-all/EventImpl.cpp src/app/virtualbox/src/VBox/Main/src-all/EventImpl.cpp + #ifdef RT_OS_WINDOWS + [threading(free)] + #endif +@@ -122,7 +124,7 @@ private: + ComPtr mControl; + + #ifndef VBOX_COM_INPROC_API_CLIENT +- ComObjPtr mConsole; ++ ComObjPtr mConsole; + #endif + + ComPtr mRemoteMachine; +diff --git a/src/app/virtualbox/src/VBox/Main/src-all/EventImpl.cpp b/src/app/virtualbox/src/VBox/Main/src-all/EventImpl.cpp index 182f267..90b8716 100644 ---- src/app/virtualbox/src/VBox/Main/src-all/EventImpl.cpp -+++ src/app/virtualbox/src/VBox/Main/src-all/EventImpl.cpp +--- a/src/app/virtualbox/src/VBox/Main/src-all/EventImpl.cpp ++++ b/src/app/virtualbox/src/VBox/Main/src-all/EventImpl.cpp @@ -1263,7 +1263,8 @@ STDMETHODIMP EventSource::EventProcessed(IEventListener *aListener, */ class ATL_NO_VTABLE PassiveEventListener : @@ -258,10 +221,10 @@ index 182f267..90b8716 100644 STDMETHODIMP EventSource::CreateListener(IEventListener **aListener) -diff --git src/app/virtualbox/src/VBox/Main/src-all/PCIDeviceAttachmentImpl.cpp src/app/virtualbox/src/VBox/Main/src-all/PCIDeviceAttachmentImpl.cpp +diff --git a/src/app/virtualbox/src/VBox/Main/src-all/PCIDeviceAttachmentImpl.cpp b/src/app/virtualbox/src/VBox/Main/src-all/PCIDeviceAttachmentImpl.cpp index e984238..b02cb45 100644 ---- src/app/virtualbox/src/VBox/Main/src-all/PCIDeviceAttachmentImpl.cpp -+++ src/app/virtualbox/src/VBox/Main/src-all/PCIDeviceAttachmentImpl.cpp +--- a/src/app/virtualbox/src/VBox/Main/src-all/PCIDeviceAttachmentImpl.cpp ++++ b/src/app/virtualbox/src/VBox/Main/src-all/PCIDeviceAttachmentImpl.cpp @@ -131,6 +131,6 @@ STDMETHODIMP PCIDeviceAttachment::COMGETTER(GuestAddress)(LONG * aGuestAddress) } @@ -271,10 +234,10 @@ index e984238..b02cb45 100644 +//NS_DECL_CLASSINFO(PCIDeviceAttachment) +//NS_IMPL_THREADSAFE_ISUPPORTS1_CI(PCIDeviceAttachment, IPCIDeviceAttachment) #endif -diff --git src/app/virtualbox/src/VBox/Main/src-all/ProgressImpl.cpp src/app/virtualbox/src/VBox/Main/src-all/ProgressImpl.cpp -index fa3ecea..f372edc 100644 ---- src/app/virtualbox/src/VBox/Main/src-all/ProgressImpl.cpp -+++ src/app/virtualbox/src/VBox/Main/src-all/ProgressImpl.cpp +diff --git a/src/app/virtualbox/src/VBox/Main/src-all/ProgressImpl.cpp b/src/app/virtualbox/src/VBox/Main/src-all/ProgressImpl.cpp +index fa3ecea..ac1a203 100644 +--- a/src/app/virtualbox/src/VBox/Main/src-all/ProgressImpl.cpp ++++ b/src/app/virtualbox/src/VBox/Main/src-all/ProgressImpl.cpp @@ -20,9 +20,9 @@ @@ -297,15 +260,6 @@ index fa3ecea..f372edc 100644 } #else mInitiator.queryInterfaceTo(aInitiator); -@@ -514,7 +514,7 @@ HRESULT Progress::init( - #if !defined(VBOX_COM_INPROC) - VirtualBox *aParent, - #endif -- IUnknown *aInitiator, -+ void *aInitiator, - CBSTR aDescription, - BOOL aCancelable, - ULONG cOperations, @@ -573,8 +573,10 @@ HRESULT Progress::init( #endif @@ -334,10 +288,10 @@ index fa3ecea..f372edc 100644 #endif /* !defined(VBOX_WITH_XPCOM) */ AssertMsg(rc == S_OK, ("Couldn't get error info (rc=%08X) while trying to set a failed result (%08X)!\n", -diff --git src/app/virtualbox/src/VBox/Main/src-all/VirtualBoxBase.cpp src/app/virtualbox/src/VBox/Main/src-all/VirtualBoxBase.cpp +diff --git a/src/app/virtualbox/src/VBox/Main/src-all/VirtualBoxBase.cpp b/src/app/virtualbox/src/VBox/Main/src-all/VirtualBoxBase.cpp index b43f5a6..6aef9df 100644 ---- src/app/virtualbox/src/VBox/Main/src-all/VirtualBoxBase.cpp -+++ src/app/virtualbox/src/VBox/Main/src-all/VirtualBoxBase.cpp +--- a/src/app/virtualbox/src/VBox/Main/src-all/VirtualBoxBase.cpp ++++ b/src/app/virtualbox/src/VBox/Main/src-all/VirtualBoxBase.cpp @@ -23,6 +23,7 @@ #include @@ -370,15 +324,14 @@ index b43f5a6..6aef9df 100644 //////////////////////////////////////////////////////////////////////////////// // -diff --git src/app/virtualbox/src/VBox/Main/src-client/ConsoleImpl.cpp src/app/virtualbox/src/VBox/Main/src-client/ConsoleImpl.cpp -index 69e3109..289e7f3 100644 ---- src/app/virtualbox/src/VBox/Main/src-client/ConsoleImpl.cpp -+++ src/app/virtualbox/src/VBox/Main/src-client/ConsoleImpl.cpp -@@ -51,10 +51,14 @@ +diff --git a/src/app/virtualbox/src/VBox/Main/src-client/ConsoleImpl.cpp b/src/app/virtualbox/src/VBox/Main/src-client/ConsoleImpl.cpp +index 69e3109..9ed6cdd 100644 +--- a/src/app/virtualbox/src/VBox/Main/src-client/ConsoleImpl.cpp ++++ b/src/app/virtualbox/src/VBox/Main/src-client/ConsoleImpl.cpp +@@ -51,23 +51,32 @@ #include "KeyboardImpl.h" #include "MouseImpl.h" #include "DisplayImpl.h" -+#include "MachineImpl.h" +#if 0 #include "MachineDebuggerImpl.h" #include "USBDeviceImpl.h" @@ -389,15 +342,26 @@ index 69e3109..289e7f3 100644 #include "AudioSnifferInterface.h" #include "Nvram.h" #ifdef VBOX_WITH_USB_CARDREADER -@@ -68,6 +72,7 @@ + # include "UsbCardReader.h" + #endif ++#endif + #include "ProgressImpl.h" ++#if 0 + #include "ConsoleVRDPServer.h" ++#endif + #include "VMMDev.h" ++#if 0 + #ifdef VBOX_WITH_EXTPACK + # include "ExtPackManagerImpl.h" #endif #include "BusAssignmentManager.h" #include "EmulatedUSBImpl.h" +#endif ++#include "VirtualBoxImpl.h" #include "VBoxEvents.h" #include "AutoCaller.h" -@@ -75,7 +80,9 @@ +@@ -75,7 +84,9 @@ #include #include "VBox/com/ErrorInfo.h" @@ -407,7 +371,7 @@ index 69e3109..289e7f3 100644 #include #include -@@ -90,6 +97,7 @@ +@@ -90,6 +101,7 @@ #include #include @@ -415,7 +379,17 @@ index 69e3109..289e7f3 100644 #include #include #include -@@ -117,6 +125,8 @@ +@@ -109,14 +121,17 @@ + #include + + #include +- ++#endif + #include ++#if 0 + #include + #ifdef VBOX_WITH_GUEST_PROPS + # include # include #endif @@ -424,7 +398,7 @@ index 69e3109..289e7f3 100644 #include #include #include // for auto_ptr -@@ -278,6 +288,8 @@ struct VMSaveTask : public VMTask +@@ -278,6 +293,8 @@ struct VMSaveTask : public VMTask Reason_T mReason; }; @@ -433,7 +407,7 @@ index 69e3109..289e7f3 100644 // Handler for global events //////////////////////////////////////////////////////////////////////////////// inline static const char *networkAdapterTypeToName(NetworkAdapterType_T adapterType); -@@ -383,6 +395,7 @@ typedef ListenerImpl VmEventListenerImpl; +@@ -383,6 +400,7 @@ typedef ListenerImpl VmEventListenerImpl; VBOX_LISTENER_DECLARE(VmEventListenerImpl) @@ -441,7 +415,7 @@ index 69e3109..289e7f3 100644 // constructor / destructor ///////////////////////////////////////////////////////////////////////////// -@@ -530,6 +543,7 @@ HRESULT Console::init(IMachine *aMachine, IInternalMachineControl *aControl, Loc +@@ -530,6 +548,7 @@ HRESULT Console::init(IMachine *aMachine, IInternalMachineControl *aControl, Loc rc = mDisplay->init(this); AssertComRCReturnRC(rc); @@ -449,7 +423,7 @@ index 69e3109..289e7f3 100644 unconst(mVRDEServerInfo).createObject(); rc = mVRDEServerInfo->init(this); AssertComRCReturnRC(rc); -@@ -538,6 +552,7 @@ HRESULT Console::init(IMachine *aMachine, IInternalMachineControl *aControl, Loc +@@ -538,6 +557,7 @@ HRESULT Console::init(IMachine *aMachine, IInternalMachineControl *aControl, Loc rc = mEmulatedUSB->init(this); AssertComRCReturnRC(rc); @@ -457,7 +431,7 @@ index 69e3109..289e7f3 100644 /* Grab global and machine shared folder lists */ rc = fetchSharedFolders(true /* aGlobal */); -@@ -545,10 +560,12 @@ HRESULT Console::init(IMachine *aMachine, IInternalMachineControl *aControl, Loc +@@ -545,10 +565,12 @@ HRESULT Console::init(IMachine *aMachine, IInternalMachineControl *aControl, Loc rc = fetchSharedFolders(false /* aGlobal */); AssertComRCReturnRC(rc); @@ -470,7 +444,7 @@ index 69e3109..289e7f3 100644 /* Figure out size of meAttachmentType vector */ ComPtr pVirtualBox; -@@ -574,9 +591,11 @@ HRESULT Console::init(IMachine *aMachine, IInternalMachineControl *aControl, Loc +@@ -574,9 +596,11 @@ HRESULT Console::init(IMachine *aMachine, IInternalMachineControl *aControl, Loc // unconst(m_pVMMDev) = new VMMDev(this); // AssertReturn(mVMMDev, E_FAIL); @@ -482,7 +456,7 @@ index 69e3109..289e7f3 100644 FirmwareType_T enmFirmwareType; mMachine->COMGETTER(FirmwareType)(&enmFirmwareType); if ( enmFirmwareType == FirmwareType_EFI -@@ -584,8 +603,10 @@ HRESULT Console::init(IMachine *aMachine, IInternalMachineControl *aControl, Loc +@@ -584,8 +608,10 @@ HRESULT Console::init(IMachine *aMachine, IInternalMachineControl *aControl, Loc || enmFirmwareType == FirmwareType_EFI64 || enmFirmwareType == FirmwareType_EFIDUAL) { @@ -493,7 +467,7 @@ index 69e3109..289e7f3 100644 } #ifdef VBOX_WITH_USB_CARDREADER -@@ -593,6 +614,7 @@ HRESULT Console::init(IMachine *aMachine, IInternalMachineControl *aControl, Loc +@@ -593,6 +619,7 @@ HRESULT Console::init(IMachine *aMachine, IInternalMachineControl *aControl, Loc AssertReturn(mUsbCardReader, E_FAIL); #endif @@ -501,7 +475,7 @@ index 69e3109..289e7f3 100644 /* VirtualBox events registration. */ { ComPtr pES; -@@ -609,6 +631,7 @@ HRESULT Console::init(IMachine *aMachine, IInternalMachineControl *aControl, Loc +@@ -609,6 +636,7 @@ HRESULT Console::init(IMachine *aMachine, IInternalMachineControl *aControl, Loc rc = pES->RegisterListener(aVmListener, ComSafeArrayAsInParam(eventTypes), true); AssertComRC(rc); } @@ -509,7 +483,7 @@ index 69e3109..289e7f3 100644 } /* Confirm a successful initialization when it's the case */ -@@ -625,6 +648,7 @@ HRESULT Console::init(IMachine *aMachine, IInternalMachineControl *aControl, Loc +@@ -625,6 +653,7 @@ HRESULT Console::init(IMachine *aMachine, IInternalMachineControl *aControl, Loc return S_OK; } @@ -517,7 +491,7 @@ index 69e3109..289e7f3 100644 /** * Uninitializes the Console object. */ -@@ -1035,6 +1059,8 @@ void Console::guestPropertiesVRDPUpdateDisconnect(uint32_t u32ClientId) +@@ -1035,6 +1064,8 @@ void Console::guestPropertiesVRDPUpdateDisconnect(uint32_t u32ClientId) #endif /* VBOX_WITH_GUEST_PROPS */ @@ -526,7 +500,7 @@ index 69e3109..289e7f3 100644 bool Console::isResetTurnedIntoPowerOff(void) { Bstr value; -@@ -1046,6 +1072,8 @@ bool Console::isResetTurnedIntoPowerOff(void) +@@ -1046,6 +1077,8 @@ bool Console::isResetTurnedIntoPowerOff(void) return false; } @@ -535,7 +509,7 @@ index 69e3109..289e7f3 100644 #ifdef VBOX_WITH_EXTPACK /** * Used by VRDEServer and others to talke to the extension pack manager. -@@ -1505,6 +1533,7 @@ void Console::VRDPInterceptClipboard(uint32_t u32ClientId) +@@ -1505,6 +1538,7 @@ void Console::VRDPInterceptClipboard(uint32_t u32ClientId) return; } @@ -543,7 +517,7 @@ index 69e3109..289e7f3 100644 //static const char *Console::sSSMConsoleUnit = "ConsoleData"; -@@ -1970,6 +1999,8 @@ STDMETHODIMP Console::COMGETTER(Display)(IDisplay **aDisplay) +@@ -1970,6 +2004,8 @@ STDMETHODIMP Console::COMGETTER(Display)(IDisplay **aDisplay) return S_OK; } @@ -552,7 +526,7 @@ index 69e3109..289e7f3 100644 STDMETHODIMP Console::COMGETTER(Debugger)(IMachineDebugger **aDebugger) { CheckComArgOutPointerValid(aDebugger); -@@ -2069,6 +2100,7 @@ Console::COMGETTER(SharedFolders)(ComSafeArrayOut(ISharedFolder *, aSharedFolder +@@ -2069,6 +2105,7 @@ Console::COMGETTER(SharedFolders)(ComSafeArrayOut(ISharedFolder *, aSharedFolder return S_OK; } @@ -560,7 +534,7 @@ index 69e3109..289e7f3 100644 STDMETHODIMP Console::COMGETTER(EventSource)(IEventSource ** aEventSource) { -@@ -2085,6 +2117,8 @@ STDMETHODIMP Console::COMGETTER(EventSource)(IEventSource ** aEventSource) +@@ -2085,6 +2122,8 @@ STDMETHODIMP Console::COMGETTER(EventSource)(IEventSource ** aEventSource) return hrc; } @@ -569,7 +543,7 @@ index 69e3109..289e7f3 100644 STDMETHODIMP Console::COMGETTER(AttachedPCIDevices)(ComSafeArrayOut(IPCIDeviceAttachment *, aAttachments)) { CheckComArgOutSafeArrayPointerValid(aAttachments); -@@ -2134,6 +2168,7 @@ STDMETHODIMP Console::COMSETTER(UseHostClipboard)(BOOL aUseHostClipboard) +@@ -2134,6 +2173,7 @@ STDMETHODIMP Console::COMSETTER(UseHostClipboard)(BOOL aUseHostClipboard) // IConsole methods ///////////////////////////////////////////////////////////////////////////// @@ -577,7 +551,7 @@ index 69e3109..289e7f3 100644 STDMETHODIMP Console::PowerUp(IProgress **aProgress) { -@@ -2291,6 +2326,8 @@ STDMETHODIMP Console::PowerDown(IProgress **aProgress) +@@ -2291,6 +2331,8 @@ STDMETHODIMP Console::PowerDown(IProgress **aProgress) return rc; } @@ -586,7 +560,7 @@ index 69e3109..289e7f3 100644 STDMETHODIMP Console::Reset() { LogFlowThisFuncEnter(); -@@ -3451,6 +3488,8 @@ STDMETHODIMP Console::RestoreSnapshot(ISnapshot *aSnapshot, IProgress **aProgres +@@ -3451,6 +3493,8 @@ STDMETHODIMP Console::RestoreSnapshot(ISnapshot *aSnapshot, IProgress **aProgres return S_OK; } @@ -595,7 +569,7 @@ index 69e3109..289e7f3 100644 // Non-interface public methods ///////////////////////////////////////////////////////////////////////////// -@@ -3526,6 +3565,8 @@ HRESULT Console::convertBusPortDeviceToLun(StorageBus_T enmBus, LONG port, LONG +@@ -3526,6 +3570,8 @@ HRESULT Console::convertBusPortDeviceToLun(StorageBus_T enmBus, LONG port, LONG } } @@ -604,7 +578,7 @@ index 69e3109..289e7f3 100644 // private methods ///////////////////////////////////////////////////////////////////////////// -@@ -4388,6 +4429,8 @@ HRESULT Console::onNATRedirectRuleChange(ULONG ulInstance, BOOL aNatRuleRemove, +@@ -4388,6 +4434,8 @@ HRESULT Console::onNATRedirectRuleChange(ULONG ulInstance, BOOL aNatRuleRemove, return rc; } @@ -613,7 +587,7 @@ index 69e3109..289e7f3 100644 VMMDevMouseInterface *Console::getVMMDevMouseInterface() { return m_pVMMDev; -@@ -4398,6 +4441,8 @@ DisplayMouseInterface *Console::getDisplayMouseInterface() +@@ -4398,6 +4446,8 @@ DisplayMouseInterface *Console::getDisplayMouseInterface() return mDisplay; } @@ -622,7 +596,7 @@ index 69e3109..289e7f3 100644 /** * Parses one key value pair. * -@@ -6490,6 +6535,8 @@ void Console::onMouseCapabilityChange(BOOL supportsAbsolute, BOOL supportsRelati +@@ -6490,6 +6540,8 @@ void Console::onMouseCapabilityChange(BOOL supportsAbsolute, BOOL supportsRelati fireMouseCapabilityChangedEvent(mEventSource, supportsAbsolute, supportsRelative, supportsMT, needsHostCursor); } @@ -631,7 +605,7 @@ index 69e3109..289e7f3 100644 void Console::onStateChange(MachineState_T machineState) { AutoCaller autoCaller(this); -@@ -6497,6 +6544,8 @@ void Console::onStateChange(MachineState_T machineState) +@@ -6497,6 +6549,8 @@ void Console::onStateChange(MachineState_T machineState) fireStateChangedEvent(mEventSource, machineState); } @@ -640,7 +614,7 @@ index 69e3109..289e7f3 100644 void Console::onAdditionsStateChange() { AutoCaller autoCaller(this); -@@ -6555,6 +6604,8 @@ void Console::onUSBDeviceStateChange(IUSBDevice *aDevice, bool aAttached, +@@ -6555,6 +6609,8 @@ void Console::onUSBDeviceStateChange(IUSBDevice *aDevice, bool aAttached, fireUSBDeviceStateChangedEvent(mEventSource, aDevice, aAttached, aError); } @@ -649,7 +623,7 @@ index 69e3109..289e7f3 100644 void Console::onRuntimeError(BOOL aFatal, IN_BSTR aErrorID, IN_BSTR aMessage) { AutoCaller autoCaller(this); -@@ -6563,6 +6614,8 @@ void Console::onRuntimeError(BOOL aFatal, IN_BSTR aErrorID, IN_BSTR aMessage) +@@ -6563,6 +6619,8 @@ void Console::onRuntimeError(BOOL aFatal, IN_BSTR aErrorID, IN_BSTR aMessage) fireRuntimeErrorEvent(mEventSource, aFatal, aErrorID, aMessage); } @@ -658,7 +632,7 @@ index 69e3109..289e7f3 100644 HRESULT Console::onShowWindow(BOOL aCheck, BOOL *aCanShow, LONG64 *aWinId) { AssertReturn(aCanShow, E_POINTER); -@@ -6626,6 +6679,8 @@ HRESULT Console::onShowWindow(BOOL aCheck, BOOL *aCanShow, LONG64 *aWinId) +@@ -6626,6 +6684,8 @@ HRESULT Console::onShowWindow(BOOL aCheck, BOOL *aCanShow, LONG64 *aWinId) return S_OK; } @@ -667,7 +641,7 @@ index 69e3109..289e7f3 100644 // private methods //////////////////////////////////////////////////////////////////////////////// -@@ -6819,6 +6874,8 @@ HRESULT Console::consoleInitReleaseLog(const ComPtr aMachine) +@@ -6819,6 +6879,8 @@ HRESULT Console::consoleInitReleaseLog(const ComPtr aMachine) } } @@ -676,7 +650,7 @@ index 69e3109..289e7f3 100644 char szError[RTPATH_MAX + 128]; int vrc = com::VBoxLogRelCreate("VM", logFile.c_str(), RTLOGFLAGS_PREFIX_TIME_PROG | RTLOGFLAGS_RESTRICT_GROUPS, -@@ -6839,6 +6896,8 @@ HRESULT Console::consoleInitReleaseLog(const ComPtr aMachine) +@@ -6839,6 +6901,8 @@ HRESULT Console::consoleInitReleaseLog(const ComPtr aMachine) if (SUCCEEDED(hrc) || cHistoryFiles) RTDirFlush(logDir.c_str()); @@ -685,16 +659,18 @@ index 69e3109..289e7f3 100644 return hrc; } -@@ -7113,6 +7172,8 @@ HRESULT Console::powerUp(IProgress **aProgress, bool aPaused) +@@ -7113,6 +7177,10 @@ HRESULT Console::powerUp(IProgress **aProgress, bool aPaused) } #endif -+ ComPtr pVirtualBox; -+ mMachine->COMGETTER(Parent)(pVirtualBox.asOutParam()); ++ ComPtr pIVirtualBox; ++ mMachine->COMGETTER(Parent)(pIVirtualBox.asOutParam()); ++ VirtualBox *pVirtualBox = ++ dynamic_cast(*pIVirtualBox.asOutParam()); // If there is immutable drive the process that. VMPowerUpTask::ProgressList progresses(task->hardDiskProgresses); -@@ -7123,7 +7184,8 @@ HRESULT Console::powerUp(IProgress **aProgress, bool aPaused) +@@ -7123,7 +7191,8 @@ HRESULT Console::powerUp(IProgress **aProgress, bool aPaused) ++cOperations; ulTotalOperationsWeight += 1; } @@ -704,7 +680,7 @@ index 69e3109..289e7f3 100644 progressDesc.raw(), TRUE, // Cancelable cOperations, -@@ -7136,13 +7198,15 @@ HRESULT Console::powerUp(IProgress **aProgress, bool aPaused) +@@ -7136,13 +7205,15 @@ HRESULT Console::powerUp(IProgress **aProgress, bool aPaused) else if ( mMachineState == MachineState_Saved || (!fTeleporterEnabled && !fFaultToleranceSyncEnabled)) { @@ -722,7 +698,7 @@ index 69e3109..289e7f3 100644 progressDesc.raw(), TRUE /* aCancelable */, 3 /* cOperations */, -@@ -7153,7 +7217,8 @@ HRESULT Console::powerUp(IProgress **aProgress, bool aPaused) +@@ -7153,7 +7224,8 @@ HRESULT Console::powerUp(IProgress **aProgress, bool aPaused) } else if (fFaultToleranceSyncEnabled) { @@ -732,7 +708,23 @@ index 69e3109..289e7f3 100644 progressDesc.raw(), TRUE /* aCancelable */, 3 /* cOperations */, -@@ -7649,6 +7714,8 @@ HRESULT Console::setMachineState(MachineState_T aMachineState, +@@ -7399,6 +7471,7 @@ HRESULT Console::powerDown(IProgress *aProgress /*= NULL*/) + * safe to release the object lock now if needed) + * ---------------------------------------------------------------------- */ + ++#if 0 + /* Stop the VRDP server to prevent new clients connection while VM is being + * powered off. */ + if (mConsoleVRDPServer) +@@ -7413,6 +7486,7 @@ HRESULT Console::powerDown(IProgress *aProgress /*= NULL*/) + + alock.acquire(); + } ++#endif + + /* advance percent count */ + if (aProgress) +@@ -7649,6 +7723,8 @@ HRESULT Console::setMachineState(MachineState_T aMachineState, return rc; } @@ -741,7 +733,7 @@ index 69e3109..289e7f3 100644 /** * Searches for a shared folder with the given logical name * in the collection of shared folders. -@@ -7684,6 +7751,8 @@ HRESULT Console::findSharedFolder(const Utf8Str &strName, +@@ -7684,6 +7760,8 @@ HRESULT Console::findSharedFolder(const Utf8Str &strName, return VBOX_E_FILE_ERROR; } @@ -750,7 +742,7 @@ index 69e3109..289e7f3 100644 /** * Fetches the list of global or machine shared folders from the server. * -@@ -8353,6 +8422,8 @@ DECLCALLBACK(void) Console::vmstateChangeCallback(PUVM pUVM, VMSTATE enmState, V +@@ -8353,6 +8431,8 @@ DECLCALLBACK(void) Console::vmstateChangeCallback(PUVM pUVM, VMSTATE enmState, V } } @@ -759,7 +751,7 @@ index 69e3109..289e7f3 100644 /** * Changes the clipboard mode. * -@@ -8875,6 +8946,8 @@ HRESULT Console::detachFromTapInterface(INetworkAdapter *networkAdapter) +@@ -8875,6 +8955,8 @@ HRESULT Console::detachFromTapInterface(INetworkAdapter *networkAdapter) } #endif /* (RT_OS_LINUX || RT_OS_FREEBSD) && !VBOX_WITH_NETFLT */ @@ -768,7 +760,19 @@ index 69e3109..289e7f3 100644 /** * Called at power down to terminate host interface networking. * -@@ -9077,6 +9150,8 @@ void Console::detachAllUSBDevices(bool aDone) +@@ -9046,9 +9128,10 @@ HRESULT Console::captureUSBDevices(PUVM pUVM) + * us back from under its lock (e.g. onUSBDeviceAttach()) which would + * produce an inter-process dead-lock otherwise. */ + alock.release(); +- ++#if 0 + HRESULT hrc = mControl->AutoCaptureUSBDevices(); + ComAssertComRCRetRC(hrc); ++#endif + } + + return S_OK; +@@ -9077,6 +9160,8 @@ void Console::detachAllUSBDevices(bool aDone) mControl->DetachAllUSBDevices(aDone); } @@ -777,7 +781,7 @@ index 69e3109..289e7f3 100644 /** * @note Locks this object for writing. */ -@@ -9249,6 +9324,8 @@ void Console::processRemoteUSBDevices(uint32_t u32ClientId, VRDEUSBDEVICEDESC *p +@@ -9249,6 +9334,8 @@ void Console::processRemoteUSBDevices(uint32_t u32ClientId, VRDEUSBDEVICEDESC *p LogFlowThisFuncLeave(); } @@ -786,7 +790,7 @@ index 69e3109..289e7f3 100644 /** * Progress cancelation callback for fault tolerance VM poweron */ -@@ -9346,6 +9423,7 @@ DECLCALLBACK(int) Console::powerUpThread(RTTHREAD Thread, void *pvUser) +@@ -9346,6 +9433,7 @@ DECLCALLBACK(int) Console::powerUpThread(RTTHREAD Thread, void *pvUser) /* Create the VRDP server. In case of headless operation, this will * also create the framebuffer, required at VM creation. */ @@ -794,7 +798,7 @@ index 69e3109..289e7f3 100644 ConsoleVRDPServer *server = pConsole->consoleVRDPServer(); Assert(server); -@@ -9392,6 +9470,7 @@ DECLCALLBACK(int) Console::powerUpThread(RTTHREAD Thread, void *pvUser) +@@ -9392,6 +9480,7 @@ DECLCALLBACK(int) Console::powerUpThread(RTTHREAD Thread, void *pvUser) vrc, errMsg.c_str())); throw setErrorStatic(E_FAIL, errMsg.c_str()); } @@ -802,7 +806,7 @@ index 69e3109..289e7f3 100644 ComPtr pMachine = pConsole->machine(); ULONG cCpus = 1; -@@ -9416,8 +9495,10 @@ DECLCALLBACK(int) Console::powerUpThread(RTTHREAD Thread, void *pvUser) +@@ -9416,8 +9505,10 @@ DECLCALLBACK(int) Console::powerUpThread(RTTHREAD Thread, void *pvUser) alock.acquire(); @@ -813,7 +817,7 @@ index 69e3109..289e7f3 100644 if (RT_SUCCESS(vrc)) { -@@ -9441,9 +9522,11 @@ DECLCALLBACK(int) Console::powerUpThread(RTTHREAD Thread, void *pvUser) +@@ -9441,9 +9532,11 @@ DECLCALLBACK(int) Console::powerUpThread(RTTHREAD Thread, void *pvUser) /* * Synchronize debugger settings */ @@ -825,7 +829,7 @@ index 69e3109..289e7f3 100644 /* * Shared Folders -@@ -9719,6 +9802,7 @@ DECLCALLBACK(int) Console::powerUpThread(RTTHREAD Thread, void *pvUser) +@@ -9719,6 +9812,7 @@ DECLCALLBACK(int) Console::powerUpThread(RTTHREAD Thread, void *pvUser) return VINF_SUCCESS; } @@ -833,7 +837,7 @@ index 69e3109..289e7f3 100644 /** * Reconfigures a medium attachment (part of taking or deleting an online snapshot). -@@ -10209,6 +10293,8 @@ DECLCALLBACK(int) Console::saveStateThread(RTTHREAD Thread, void *pvUser) +@@ -10209,6 +10303,8 @@ DECLCALLBACK(int) Console::saveStateThread(RTTHREAD Thread, void *pvUser) return VINF_SUCCESS; } @@ -842,23 +846,16 @@ index 69e3109..289e7f3 100644 /** * Thread for powering down the Console. * -@@ -10252,6 +10338,7 @@ DECLCALLBACK(int) Console::powerDownThread(RTTHREAD Thread, void *pvUser) - return VINF_SUCCESS; - } - -+#if 0 - - /** - * @interface_method_impl{VMM2USERMETHODS,pfnSaveState} -@@ -10367,6 +10454,7 @@ Console::i_pdmIfSecKey_KeyRelease(PPDMISECKEY pInterface, const char *pszId) +@@ -10367,8 +10463,6 @@ Console::i_pdmIfSecKey_KeyRelease(PPDMISECKEY pInterface, const char *pszId) } -+#endif /* #if 0 */ - - +- +- /** -@@ -10461,9 +10549,11 @@ DECLCALLBACK(int) Console::drvStatus_MediumEjected(PPDMIMEDIANOTIFY pInterface, + * The Main status driver instance data. + */ +@@ -10461,9 +10555,11 @@ DECLCALLBACK(int) Console::drvStatus_MediumEjected(PPDMIMEDIANOTIFY pInterface, alock.release(); ComPtr pNewMediumAtt; @@ -870,10 +867,10 @@ index 69e3109..289e7f3 100644 alock.acquire(); if (pNewMediumAtt != pMediumAtt) -diff --git src/app/virtualbox/src/VBox/Main/src-client/ConsoleImpl2.cpp src/app/virtualbox/src/VBox/Main/src-client/ConsoleImpl2.cpp +diff --git a/src/app/virtualbox/src/VBox/Main/src-client/ConsoleImpl2.cpp b/src/app/virtualbox/src/VBox/Main/src-client/ConsoleImpl2.cpp index caed4be..6d02496 100644 ---- src/app/virtualbox/src/VBox/Main/src-client/ConsoleImpl2.cpp -+++ src/app/virtualbox/src/VBox/Main/src-client/ConsoleImpl2.cpp +--- a/src/app/virtualbox/src/VBox/Main/src-client/ConsoleImpl2.cpp ++++ b/src/app/virtualbox/src/VBox/Main/src-client/ConsoleImpl2.cpp @@ -27,6 +27,7 @@ #include "VBox/com/ptr.h" @@ -1041,10 +1038,10 @@ index caed4be..6d02496 100644 } #elif defined(VBOX_WITH_NETFLT) -diff --git src/app/virtualbox/src/VBox/Main/src-client/DisplayImpl.cpp src/app/virtualbox/src/VBox/Main/src-client/DisplayImpl.cpp +diff --git a/src/app/virtualbox/src/VBox/Main/src-client/DisplayImpl.cpp b/src/app/virtualbox/src/VBox/Main/src-client/DisplayImpl.cpp index fed0ac3..bc3c334 100644 ---- src/app/virtualbox/src/VBox/Main/src-client/DisplayImpl.cpp -+++ src/app/virtualbox/src/VBox/Main/src-client/DisplayImpl.cpp +--- a/src/app/virtualbox/src/VBox/Main/src-client/DisplayImpl.cpp ++++ b/src/app/virtualbox/src/VBox/Main/src-client/DisplayImpl.cpp @@ -16,9 +16,12 @@ */ @@ -1142,10 +1139,10 @@ index fed0ac3..bc3c334 100644 } return VINF_SUCCESS; } -diff --git src/app/virtualbox/src/VBox/Main/src-client/GuestImpl.cpp src/app/virtualbox/src/VBox/Main/src-client/GuestImpl.cpp +diff --git a/src/app/virtualbox/src/VBox/Main/src-client/GuestImpl.cpp b/src/app/virtualbox/src/VBox/Main/src-client/GuestImpl.cpp index b438f9d..2b9755e 100644 ---- src/app/virtualbox/src/VBox/Main/src-client/GuestImpl.cpp -+++ src/app/virtualbox/src/VBox/Main/src-client/GuestImpl.cpp +--- a/src/app/virtualbox/src/VBox/Main/src-client/GuestImpl.cpp ++++ b/src/app/virtualbox/src/VBox/Main/src-client/GuestImpl.cpp @@ -16,6 +16,7 @@ */ @@ -1195,10 +1192,10 @@ index b438f9d..2b9755e 100644 LogFlowFuncLeave(); } -diff --git src/app/virtualbox/src/VBox/Main/src-client/MouseImpl.cpp src/app/virtualbox/src/VBox/Main/src-client/MouseImpl.cpp +diff --git a/src/app/virtualbox/src/VBox/Main/src-client/MouseImpl.cpp b/src/app/virtualbox/src/VBox/Main/src-client/MouseImpl.cpp index 652f2df..877b775 100644 ---- src/app/virtualbox/src/VBox/Main/src-client/MouseImpl.cpp -+++ src/app/virtualbox/src/VBox/Main/src-client/MouseImpl.cpp +--- a/src/app/virtualbox/src/VBox/Main/src-client/MouseImpl.cpp ++++ b/src/app/virtualbox/src/VBox/Main/src-client/MouseImpl.cpp @@ -816,7 +816,11 @@ HRESULT Mouse::putEventMultiTouch(LONG aCount, } } @@ -1212,10 +1209,10 @@ index 652f2df..877b775 100644 { rc = reportMultiTouchEventToDevice(cContacts, cContacts? pau64Contacts: NULL, (uint32_t)aScanTime); -diff --git src/app/virtualbox/src/VBox/Main/src-client/SessionImpl.cpp src/app/virtualbox/src/VBox/Main/src-client/SessionImpl.cpp -index 6ea10d3..c8ce931 100644 ---- src/app/virtualbox/src/VBox/Main/src-client/SessionImpl.cpp -+++ src/app/virtualbox/src/VBox/Main/src-client/SessionImpl.cpp +diff --git a/src/app/virtualbox/src/VBox/Main/src-client/SessionImpl.cpp b/src/app/virtualbox/src/VBox/Main/src-client/SessionImpl.cpp +index 6ea10d3..267be48 100644 +--- a/src/app/virtualbox/src/VBox/Main/src-client/SessionImpl.cpp ++++ b/src/app/virtualbox/src/VBox/Main/src-client/SessionImpl.cpp @@ -17,8 +17,11 @@ #include "SessionImpl.h" @@ -1228,7 +1225,16 @@ index 6ea10d3..c8ce931 100644 #include "AutoCaller.h" #include "Logging.h" -@@ -329,7 +332,9 @@ STDMETHODIMP Session::AssignMachine(IMachine *aMachine, LockType_T aLockType, +@@ -26,6 +29,8 @@ + #include + #include + ++#include "console.h" ++ + /** + * Local macro to check whether the session is open and return an error if not. + * @note Don't forget to do |Auto[Reader]Lock alock (this);| before using this +@@ -329,7 +334,9 @@ STDMETHODIMP Session::AssignMachine(IMachine *aMachine, LockType_T aLockType, /* query IInternalMachineControl interface */ mControl = aMachine; @@ -1238,7 +1244,7 @@ index 6ea10d3..c8ce931 100644 #ifndef VBOX_COM_INPROC_API_CLIENT HRESULT rc = mConsole.createObject(); -@@ -349,6 +354,7 @@ STDMETHODIMP Session::AssignMachine(IMachine *aMachine, LockType_T aLockType, +@@ -349,6 +356,7 @@ STDMETHODIMP Session::AssignMachine(IMachine *aMachine, LockType_T aLockType, AssertPtr(aToken); #endif /* VBOX_WITH_GENERIC_SESSION_WATCHER */ /* create the machine client token */ @@ -1246,7 +1252,7 @@ index 6ea10d3..c8ce931 100644 try { #ifndef VBOX_WITH_GENERIC_SESSION_WATCHER -@@ -367,6 +373,7 @@ STDMETHODIMP Session::AssignMachine(IMachine *aMachine, LockType_T aLockType, +@@ -367,6 +375,7 @@ STDMETHODIMP Session::AssignMachine(IMachine *aMachine, LockType_T aLockType, { rc = E_OUTOFMEMORY; } @@ -1254,7 +1260,7 @@ index 6ea10d3..c8ce931 100644 /* * Reference the VirtualBox object to ensure the server is up -@@ -1217,12 +1224,14 @@ HRESULT Session::unlockMachine(bool aFinalRelease, bool aFromServer, AutoWriteLo +@@ -1217,12 +1226,14 @@ HRESULT Session::unlockMachine(bool aFinalRelease, bool aFromServer, AutoWriteLo if (mType == SessionType_WriteLock) { @@ -1269,10 +1275,10 @@ index 6ea10d3..c8ce931 100644 if (!aFinalRelease && !aFromServer) { /* -diff --git src/app/virtualbox/src/VBox/Main/src-client/VBoxDriversRegister.cpp src/app/virtualbox/src/VBox/Main/src-client/VBoxDriversRegister.cpp +diff --git a/src/app/virtualbox/src/VBox/Main/src-client/VBoxDriversRegister.cpp b/src/app/virtualbox/src/VBox/Main/src-client/VBoxDriversRegister.cpp index 7fa0f99..d85976d 100644 ---- src/app/virtualbox/src/VBox/Main/src-client/VBoxDriversRegister.cpp -+++ src/app/virtualbox/src/VBox/Main/src-client/VBoxDriversRegister.cpp +--- a/src/app/virtualbox/src/VBox/Main/src-client/VBoxDriversRegister.cpp ++++ b/src/app/virtualbox/src/VBox/Main/src-client/VBoxDriversRegister.cpp @@ -25,7 +25,9 @@ #include "VMMDev.h" #include "AudioSnifferInterface.h" @@ -1308,10 +1314,10 @@ index 7fa0f99..d85976d 100644 #ifdef VBOX_WITH_USB_CARDREADER rc = pCallbacks->pfnRegister(pCallbacks, &UsbCardReader::DrvReg); -diff --git src/app/virtualbox/src/VBox/Main/src-client/VMMDevInterface.cpp src/app/virtualbox/src/VBox/Main/src-client/VMMDevInterface.cpp +diff --git a/src/app/virtualbox/src/VBox/Main/src-client/VMMDevInterface.cpp b/src/app/virtualbox/src/VBox/Main/src-client/VMMDevInterface.cpp index b4f4da4..a341e45 100644 ---- src/app/virtualbox/src/VBox/Main/src-client/VMMDevInterface.cpp -+++ src/app/virtualbox/src/VBox/Main/src-client/VMMDevInterface.cpp +--- a/src/app/virtualbox/src/VBox/Main/src-client/VMMDevInterface.cpp ++++ b/src/app/virtualbox/src/VBox/Main/src-client/VMMDevInterface.cpp @@ -553,7 +553,9 @@ DECLCALLBACK(int) vmmdevIsPageFusionEnabled(PPDMIVMMDEVCONNECTOR pInterface, boo { PDRVMAINVMMDEV pDrv = PDMIVMMDEVCONNECTOR_2_MAINVMMDEV(pInterface); @@ -1322,10 +1328,27 @@ index b4f4da4..a341e45 100644 if (!pfPageFusionEnabled) return VERR_INVALID_POINTER; -diff --git src/app/virtualbox/src/VBox/Main/src-server/DHCPServerImpl.cpp src/app/virtualbox/src/VBox/Main/src-server/DHCPServerImpl.cpp +diff --git a/src/app/virtualbox/src/VBox/Main/src-server/ClientToken.cpp b/src/app/virtualbox/src/VBox/Main/src-server/ClientToken.cpp +index be0afb8..54d5ba4 100644 +--- a/src/app/virtualbox/src/VBox/Main/src-server/ClientToken.cpp ++++ b/src/app/virtualbox/src/VBox/Main/src-server/ClientToken.cpp +@@ -179,11 +179,7 @@ Machine::ClientToken::ClientToken(const ComObjPtr &pMachine, + { + mClientToken = pToken; + if (mClientToken) +- { +- rc = mClientToken->AddRef(); +- if (FAILED(rc)) +- mClientToken = NULL; +- } ++ mClientToken->AddRef(); + } + } + pToken.setNull(); +diff --git a/src/app/virtualbox/src/VBox/Main/src-server/DHCPServerImpl.cpp b/src/app/virtualbox/src/VBox/Main/src-server/DHCPServerImpl.cpp index 1cd7ce7..366d693 100644 ---- src/app/virtualbox/src/VBox/Main/src-server/DHCPServerImpl.cpp -+++ src/app/virtualbox/src/VBox/Main/src-server/DHCPServerImpl.cpp +--- a/src/app/virtualbox/src/VBox/Main/src-server/DHCPServerImpl.cpp ++++ b/src/app/virtualbox/src/VBox/Main/src-server/DHCPServerImpl.cpp @@ -20,6 +20,7 @@ #include #include "NetworkServiceRunner.h" @@ -1334,19 +1357,10 @@ index 1cd7ce7..366d693 100644 #include "AutoCaller.h" #include "Logging.h" -diff --git src/app/virtualbox/src/VBox/Main/src-server/MachineImpl.cpp src/app/virtualbox/src/VBox/Main/src-server/MachineImpl.cpp -index 3889a01..a4df732 100644 ---- src/app/virtualbox/src/VBox/Main/src-server/MachineImpl.cpp -+++ src/app/virtualbox/src/VBox/Main/src-server/MachineImpl.cpp -@@ -3522,7 +3522,7 @@ STDMETHODIMP Machine::LockMachine(ISession *aSession, - tr("The given session is busy")); - - // get the client's IInternalSessionControl interface -- ComPtr pSessionControl = aSession; -+ ComPtr pSessionControl = aSession; - ComAssertMsgRet(!!pSessionControl, ("No IInternalSessionControl interface"), - E_INVALIDARG); - +diff --git a/src/app/virtualbox/src/VBox/Main/src-server/MachineImpl.cpp b/src/app/virtualbox/src/VBox/Main/src-server/MachineImpl.cpp +index 3889a01..5fcb53c 100644 +--- a/src/app/virtualbox/src/VBox/Main/src-server/MachineImpl.cpp ++++ b/src/app/virtualbox/src/VBox/Main/src-server/MachineImpl.cpp @@ -3826,8 +3826,10 @@ STDMETHODIMP Machine::LockMachine(ISession *aSession, /* request an IUnknown pointer early from the remote party for later * identity checks (it will be internally cached within mDirectControl @@ -1358,15 +1372,6 @@ index 3889a01..a4df732 100644 } /* Release the lock since SessionMachine::uninit() locks VirtualBox which -@@ -3933,7 +3935,7 @@ STDMETHODIMP Machine::LaunchVMProcess(ISession *aSession, - ComObjPtr progress; - progress.createObject(); - rc = progress->init(mParent, -- static_cast(this), -+ nullptr, - Bstr(tr("Starting VM")).raw(), - TRUE /* aCancelable */, - fTeleporterEnabled ? 20 : 10 /* uTotalOperationsWeight */, @@ -4920,7 +4922,7 @@ STDMETHODIMP Machine::SetHotPluggableForDevice(IN_BSTR aControllerName, LONG aCo STDMETHODIMP Machine::SetNoBandwidthGroupForDevice(IN_BSTR aControllerName, LONG aControllerPort, LONG aDevice) @@ -1394,15 +1399,6 @@ index 3889a01..a4df732 100644 LogFlowThisFunc(("aControllerName=\"%ls\" aControllerPort=%d aDevice=%d aForce=%d\n", aControllerName, aControllerPort, aDevice, aForce)); -@@ -5610,7 +5612,7 @@ STDMETHODIMP Machine::DeleteConfig(ComSafeArrayIn(IMedium*, aMedia), IProgress * - - pTask->pProgress.createObject(); - pTask->pProgress->init(getVirtualBox(), -- static_cast(this) /* aInitiator */, -+ nullptr /* aInitiator */, - Bstr(tr("Deleting files")).raw(), - true /* fCancellable */, - pTask->llFilesToDelete.size() + pTask->llMediums.size() + 1, // cOperations @@ -8025,7 +8027,9 @@ HRESULT Machine::launchVMProcess(IInternalSessionControl *aControl, size_t cchBufLeft = strlen(szPath); szPath[cchBufLeft++] = RTPATH_DELIMITER; @@ -1518,10 +1514,10 @@ index 3889a01..a4df732 100644 } /** -diff --git src/app/virtualbox/src/VBox/Main/src-server/MachineImplCloneVM.cpp src/app/virtualbox/src/VBox/Main/src-server/MachineImplCloneVM.cpp +diff --git a/src/app/virtualbox/src/VBox/Main/src-server/MachineImplCloneVM.cpp b/src/app/virtualbox/src/VBox/Main/src-server/MachineImplCloneVM.cpp index 3a7507d..ce9a2b3 100644 ---- src/app/virtualbox/src/VBox/Main/src-server/MachineImplCloneVM.cpp -+++ src/app/virtualbox/src/VBox/Main/src-server/MachineImplCloneVM.cpp +--- a/src/app/virtualbox/src/VBox/Main/src-server/MachineImplCloneVM.cpp ++++ b/src/app/virtualbox/src/VBox/Main/src-server/MachineImplCloneVM.cpp @@ -889,7 +889,7 @@ HRESULT MachineCloneVM::start(IProgress **pProgress) rc = d->pProgress.createObject(); if (FAILED(rc)) throw rc; @@ -1531,19 +1527,21 @@ index 3a7507d..ce9a2b3 100644 Bstr(p->tr("Cloning Machine")).raw(), true /* fCancellable */, uCount, -diff --git src/app/virtualbox/src/VBox/Main/src-server/MediumImpl.cpp src/app/virtualbox/src/VBox/Main/src-server/MediumImpl.cpp -index c61ea6f..893ac88 100644 ---- src/app/virtualbox/src/VBox/Main/src-server/MediumImpl.cpp -+++ src/app/virtualbox/src/VBox/Main/src-server/MediumImpl.cpp -@@ -20,6 +20,7 @@ +diff --git a/src/app/virtualbox/src/VBox/Main/src-server/MediumImpl.cpp b/src/app/virtualbox/src/VBox/Main/src-server/MediumImpl.cpp +index c61ea6f..ed4bb7a 100644 +--- a/src/app/virtualbox/src/VBox/Main/src-server/MediumImpl.cpp ++++ b/src/app/virtualbox/src/VBox/Main/src-server/MediumImpl.cpp +@@ -20,7 +20,9 @@ #include "ProgressImpl.h" #include "SystemPropertiesImpl.h" #include "VirtualBoxImpl.h" +#include "TokenImpl.h" ++#include "Global.h" #include "AutoCaller.h" #include "Logging.h" -@@ -679,16 +680,21 @@ DECLCALLBACK(int) Medium::Task::fntMediumTask(RTTHREAD aThread, void *pvUser) + +@@ -679,16 +681,21 @@ DECLCALLBACK(int) Medium::Task::fntMediumTask(RTTHREAD aThread, void *pvUser) HRESULT rc = pTask->handler(); @@ -1566,7 +1564,7 @@ index c61ea6f..893ac88 100644 LogFlowFunc(("rc=%Rhrc\n", rc)); LogFlowFuncLeave(); -@@ -1231,7 +1237,7 @@ HRESULT Medium::init(VirtualBox *aVirtualBox, +@@ -1231,7 +1238,7 @@ HRESULT Medium::init(VirtualBox *aVirtualBox, else { // Otherwise use the old VirtualBox "make absolute path" logic: @@ -1575,7 +1573,7 @@ index c61ea6f..893ac88 100644 if (FAILED(rc)) return rc; } } -@@ -2578,7 +2584,7 @@ STDMETHODIMP Medium::CreateBaseStorage(LONG64 aLogicalSize, +@@ -2578,7 +2585,7 @@ STDMETHODIMP Medium::CreateBaseStorage(LONG64 aLogicalSize, pProgress.createObject(); rc = pProgress->init(m->pVirtualBox, @@ -1584,7 +1582,7 @@ index c61ea6f..893ac88 100644 (mediumVariantFlags & MediumVariant_Fixed) ? BstrFmt(tr("Creating fixed medium storage unit '%s'"), m->strLocationFull.c_str()).raw() : BstrFmt(tr("Creating dynamic medium storage unit '%s'"), m->strLocationFull.c_str()).raw(), -@@ -2758,7 +2764,7 @@ STDMETHODIMP Medium::CloneToBase(IMedium *aTarget, +@@ -2758,7 +2765,7 @@ STDMETHODIMP Medium::CloneToBase(IMedium *aTarget, ComSafeArrayIn(MediumVariant_T, aVariant), IProgress **aProgress) { @@ -1593,10 +1591,10 @@ index c61ea6f..893ac88 100644 CheckComArgNotNull(aTarget); CheckComArgOutPointerValid(aProgress); CheckComArgSafeArrayNotNull(aVariant); -diff --git src/app/virtualbox/src/VBox/Main/src-server/MediumLock.cpp src/app/virtualbox/src/VBox/Main/src-server/MediumLock.cpp +diff --git a/src/app/virtualbox/src/VBox/Main/src-server/MediumLock.cpp b/src/app/virtualbox/src/VBox/Main/src-server/MediumLock.cpp index 567973d..2cda8b2 100644 ---- src/app/virtualbox/src/VBox/Main/src-server/MediumLock.cpp -+++ src/app/virtualbox/src/VBox/Main/src-server/MediumLock.cpp +--- a/src/app/virtualbox/src/VBox/Main/src-server/MediumLock.cpp ++++ b/src/app/virtualbox/src/VBox/Main/src-server/MediumLock.cpp @@ -18,7 +18,7 @@ #include "MediumLock.h" #include "MediumImpl.h" @@ -1606,10 +1604,10 @@ index 567973d..2cda8b2 100644 MediumLock::MediumLock() : mMedium(NULL), mMediumCaller(NULL), mLockWrite(false), -diff --git src/app/virtualbox/src/VBox/Main/src-server/NetworkAdapterImpl.cpp src/app/virtualbox/src/VBox/Main/src-server/NetworkAdapterImpl.cpp +diff --git a/src/app/virtualbox/src/VBox/Main/src-server/NetworkAdapterImpl.cpp b/src/app/virtualbox/src/VBox/Main/src-server/NetworkAdapterImpl.cpp index e3908bb..c5cee5c 100644 ---- src/app/virtualbox/src/VBox/Main/src-server/NetworkAdapterImpl.cpp -+++ src/app/virtualbox/src/VBox/Main/src-server/NetworkAdapterImpl.cpp +--- a/src/app/virtualbox/src/VBox/Main/src-server/NetworkAdapterImpl.cpp ++++ b/src/app/virtualbox/src/VBox/Main/src-server/NetworkAdapterImpl.cpp @@ -1332,7 +1332,7 @@ HRESULT NetworkAdapter::saveSettings(settings::NetworkAdapter &data) bool NetworkAdapter::isModified() { AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); @@ -1619,10 +1617,10 @@ index e3908bb..c5cee5c 100644 return fChanged; } -diff --git src/app/virtualbox/src/VBox/Main/src-server/SnapshotImpl.cpp src/app/virtualbox/src/VBox/Main/src-server/SnapshotImpl.cpp +diff --git a/src/app/virtualbox/src/VBox/Main/src-server/SnapshotImpl.cpp b/src/app/virtualbox/src/VBox/Main/src-server/SnapshotImpl.cpp index ddce18b..55065d2 100644 ---- src/app/virtualbox/src/VBox/Main/src-server/SnapshotImpl.cpp -+++ src/app/virtualbox/src/VBox/Main/src-server/SnapshotImpl.cpp +--- a/src/app/virtualbox/src/VBox/Main/src-server/SnapshotImpl.cpp ++++ b/src/app/virtualbox/src/VBox/Main/src-server/SnapshotImpl.cpp @@ -24,6 +24,7 @@ #include "MediumFormatImpl.h" #include "Global.h" @@ -1640,10 +1638,10 @@ index ddce18b..55065d2 100644 childSnapshotId = pChildSnapshot->getId(); } pAtt = findAttachment(pMachine->mMediaData->mAttachments, it->mpSource); -diff --git src/app/virtualbox/src/VBox/Main/src-server/VRDEServerImpl.cpp src/app/virtualbox/src/VBox/Main/src-server/VRDEServerImpl.cpp +diff --git a/src/app/virtualbox/src/VBox/Main/src-server/VRDEServerImpl.cpp b/src/app/virtualbox/src/VBox/Main/src-server/VRDEServerImpl.cpp index a717aff..3d52b9f 100644 ---- src/app/virtualbox/src/VBox/Main/src-server/VRDEServerImpl.cpp -+++ src/app/virtualbox/src/VBox/Main/src-server/VRDEServerImpl.cpp +--- a/src/app/virtualbox/src/VBox/Main/src-server/VRDEServerImpl.cpp ++++ b/src/app/virtualbox/src/VBox/Main/src-server/VRDEServerImpl.cpp @@ -31,7 +31,7 @@ #include #include @@ -1687,10 +1685,10 @@ index a717aff..3d52b9f 100644 if (papszNames) { -diff --git src/app/virtualbox/src/VBox/Main/src-server/VirtualBoxImpl.cpp src/app/virtualbox/src/VBox/Main/src-server/VirtualBoxImpl.cpp +diff --git a/src/app/virtualbox/src/VBox/Main/src-server/VirtualBoxImpl.cpp b/src/app/virtualbox/src/VBox/Main/src-server/VirtualBoxImpl.cpp index 9ce039a..2e6ac11 100644 ---- src/app/virtualbox/src/VBox/Main/src-server/VirtualBoxImpl.cpp -+++ src/app/virtualbox/src/VBox/Main/src-server/VirtualBoxImpl.cpp +--- a/src/app/virtualbox/src/VBox/Main/src-server/VirtualBoxImpl.cpp ++++ b/src/app/virtualbox/src/VBox/Main/src-server/VirtualBoxImpl.cpp @@ -42,7 +42,9 @@ #include #include @@ -1730,10 +1728,10 @@ index 9ce039a..2e6ac11 100644 return rc; } -diff --git src/app/virtualbox/src/VBox/Main/xml/Settings.cpp src/app/virtualbox/src/VBox/Main/xml/Settings.cpp +diff --git a/src/app/virtualbox/src/VBox/Main/xml/Settings.cpp b/src/app/virtualbox/src/VBox/Main/xml/Settings.cpp index 3520c9c..e3288af 100644 ---- src/app/virtualbox/src/VBox/Main/xml/Settings.cpp -+++ src/app/virtualbox/src/VBox/Main/xml/Settings.cpp +--- a/src/app/virtualbox/src/VBox/Main/xml/Settings.cpp ++++ b/src/app/virtualbox/src/VBox/Main/xml/Settings.cpp @@ -4922,6 +4922,8 @@ void MachineConfigFile::buildStorageControllersXML(xml::ElementNode &elmParent, case DeviceType_Floppy: pcszType = "Floppy"; diff --git a/repos/ports/src/virtualbox/patches/vga_fb.patch b/repos/ports/src/virtualbox/patches/vga_fb.patch index 09dc15212a..27fefa6734 100644 --- a/repos/ports/src/virtualbox/patches/vga_fb.patch +++ b/repos/ports/src/virtualbox/patches/vga_fb.patch @@ -1,5 +1,10 @@ -+++ src/app/virtualbox/src/VBox/Devices/Graphics/DevVGA.cpp -@@ -3468,9 +3475,15 @@ +vga_fb.patch + +diff --git a/src/app/virtualbox/src/VBox/Devices/Graphics/DevVGA.cpp b/src/app/virtualbox/src/VBox/Devices/Graphics/DevVGA.cpp +index a21fe7e..5b3b9b3 100644 +--- a/src/app/virtualbox/src/VBox/Devices/Graphics/DevVGA.cpp ++++ b/src/app/virtualbox/src/VBox/Devices/Graphics/DevVGA.cpp +@@ -3494,9 +3494,15 @@ static DECLCALLBACK(int) vgaR3LFBAccessHandler(PVM pVM, RTGCPHYS GCPhys, void *p int rc; Assert(pThis); Assert(GCPhys >= pThis->GCPhysVRAM); diff --git a/repos/ports/src/virtualbox/patches/vga_vbva.patch b/repos/ports/src/virtualbox/patches/vga_vbva.patch index 1e06c8493f..6631563d7a 100644 --- a/repos/ports/src/virtualbox/patches/vga_vbva.patch +++ b/repos/ports/src/virtualbox/patches/vga_vbva.patch @@ -1,5 +1,10 @@ -+++ src/app/virtualbox/src/VBox/Devices/Graphics/DevVGA_VBVA.cpp -@@ -536,7 +536,8 @@ +vga_vbva.patch + +diff --git a/src/app/virtualbox/src/VBox/Devices/Graphics/DevVGA_VBVA.cpp b/src/app/virtualbox/src/VBox/Devices/Graphics/DevVGA_VBVA.cpp +index 28ab4a8..1cc8e6b 100644 +--- a/src/app/virtualbox/src/VBox/Devices/Graphics/DevVGA_VBVA.cpp ++++ b/src/app/virtualbox/src/VBox/Devices/Graphics/DevVGA_VBVA.cpp +@@ -546,7 +546,8 @@ static int vbvaDisable (unsigned uScreenId, PVGASTATE pVGAState, VBVACONTEXT *pC pView->u32VBVAOffset = HGSMIOFFSET_VOID; } @@ -8,4 +13,4 @@ + pVGAState->pDrv->pfnVBVADisable (pVGAState->pDrv, uScreenId); return VINF_SUCCESS; } - + diff --git a/repos/ports/src/virtualbox/patches/vmdk.patch b/repos/ports/src/virtualbox/patches/vmdk.patch index 71267cb1b8..7a24851f8b 100644 --- a/repos/ports/src/virtualbox/patches/vmdk.patch +++ b/repos/ports/src/virtualbox/patches/vmdk.patch @@ -1,13 +1,18 @@ -+++ src/app/virtualbox/src/VBox/Storage/VMDK.cpp -@@ -6114,7 +6114,6 @@ +vmdk.patch + +diff --git a/src/app/virtualbox/src/VBox/Storage/VMDK.cpp b/src/app/virtualbox/src/VBox/Storage/VMDK.cpp +index f749ee4..0c5d49e 100644 +--- a/src/app/virtualbox/src/VBox/Storage/VMDK.cpp ++++ b/src/app/virtualbox/src/VBox/Storage/VMDK.cpp +@@ -5771,7 +5771,6 @@ static int vmdkRead(void *pBackendData, uint64_t uOffset, size_t cbToRead, } pExtent->uGrainSectorAbs = uSectorExtentAbs; pExtent->uGrain = uSectorExtentRel / pExtent->cSectorsPerGrain; - Assert(uLBA == uSectorExtentRel); } - memcpy(pvBuf, (uint8_t *)pExtent->pvGrain + VMDK_SECTOR2BYTE(uSectorInGrain), cbToRead); - } -@@ -6258,7 +6257,6 @@ + vdIfIoIntIoCtxCopyTo(pImage->pIfIo, pIoCtx, + (uint8_t *)pExtent->pvGrain +@@ -5920,7 +5919,6 @@ static int vmdkWrite(void *pBackendData, uint64_t uOffset, size_t cbToWrite, * which is somewhere between expensive and impossible. */ rc = VERR_VD_VMDK_INVALID_STATE; pExtent->uGrainSectorAbs = 0; diff --git a/repos/ports/src/virtualbox/patches/vmmdev.patch b/repos/ports/src/virtualbox/patches/vmmdev.patch index 42c0dc498e..e1a2b36d5a 100644 --- a/repos/ports/src/virtualbox/patches/vmmdev.patch +++ b/repos/ports/src/virtualbox/patches/vmmdev.patch @@ -1,5 +1,10 @@ -+++ src/app/virtualbox/src/VBox/Devices/VMMDev/VMMDev.cpp -@@ -2179,6 +2179,10 @@ +vmmdev.patch + +diff --git a/src/app/virtualbox/src/VBox/Devices/VMMDev/VMMDev.cpp b/src/app/virtualbox/src/VBox/Devices/VMMDev/VMMDev.cpp +index 8ce46a8..a6b84b0 100644 +--- a/src/app/virtualbox/src/VBox/Devices/VMMDev/VMMDev.cpp ++++ b/src/app/virtualbox/src/VBox/Devices/VMMDev/VMMDev.cpp +@@ -2179,6 +2179,10 @@ static int vmmdevReqHandler_GetPageSharingStatus(PVMMDEV pThis, VMMDevRequestHea ("%u\n", pReq->header.size), VERR_INVALID_PARAMETER); pReq->fEnabled = false; @@ -10,7 +15,7 @@ int rc = pThis->pDrv->pfnIsPageFusionEnabled(pThis->pDrv, &pReq->fEnabled); if (RT_FAILURE(rc)) pReq->fEnabled = false; -@@ -2404,7 +2408,6 @@ +@@ -2404,7 +2408,6 @@ static int vmmdevReqDispatcher(PVMMDEV pThis, VMMDevRequestHeader *pReqHdr, RTGC pReqHdr->rc = vmmdevReqHandler_HGCMCall(pThis, pReqHdr, GCPhysReqHdr); *pfDelayedUnlock = true; break; @@ -18,7 +23,7 @@ case VMMDevReq_HGCMCancel: pReqHdr->rc = vmmdevReqHandler_HGCMCancel(pThis, pReqHdr, GCPhysReqHdr); -@@ -2414,6 +2417,7 @@ +@@ -2414,6 +2417,7 @@ static int vmmdevReqDispatcher(PVMMDEV pThis, VMMDevRequestHeader *pReqHdr, RTGC case VMMDevReq_HGCMCancel2: pReqHdr->rc = vmmdevReqHandler_HGCMCancel2(pThis, pReqHdr); break; @@ -26,7 +31,7 @@ case VMMDevReq_VideoAccelEnable: pReqHdr->rc = vmmdevReqHandler_VideoAccelEnable(pThis, pReqHdr); -@@ -3595,8 +3599,10 @@ +@@ -3595,8 +3599,10 @@ static DECLCALLBACK(void) vmmdevReset(PPDMDEVINS pDevIns) /* disabled statistics updating */ pThis->u32LastStatIntervalSize = 0; @@ -37,7 +42,10 @@ /* * Clear the event variables. -+++ src/app/virtualbox/src/VBox/Devices/VMMDev/VMMDevHGCM.cpp +diff --git a/src/app/virtualbox/src/VBox/Devices/VMMDev/VMMDevHGCM.cpp b/src/app/virtualbox/src/VBox/Devices/VMMDev/VMMDevHGCM.cpp +index d495599..21dfada 100644 +--- a/src/app/virtualbox/src/VBox/Devices/VMMDev/VMMDevHGCM.cpp ++++ b/src/app/virtualbox/src/VBox/Devices/VMMDev/VMMDevHGCM.cpp @@ -19,7 +19,7 @@ /******************************************************************************* * Header Files * diff --git a/repos/ports/src/virtualbox/target.mk b/repos/ports/src/virtualbox/target.mk index a18fcb4913..c0d5aaf980 100644 --- a/repos/ports/src/virtualbox/target.mk +++ b/repos/ports/src/virtualbox/target.mk @@ -1,4 +1,5 @@ VBOX_CC_OPT += -DVBOX_WITH_HARDENING +VBOX_CC_OPT += -DVBOX_WITH_GENERIC_SESSION_WATCHER include $(REP_DIR)/lib/mk/virtualbox-common.inc @@ -6,6 +7,9 @@ CC_WARN += -Wall TARGET = virtualbox SRC_CC = frontend/main.cc frontend/console.cc \ + frontend/VBoxAPIWrap/MediumFormatWrap.cpp \ + frontend/VBoxAPIWrap/TokenWrap.cpp \ + frontend/VirtualBoxErrorInfoImpl.cpp \ devices.cc drivers.cc dummies.cc libc.cc \ logger.cc mm.cc pdm.cc pgm.cc rt.cc sup.cc iommio.cc ioport.cc \ hm.cc thread.cc dynlib.cc unimpl.cc @@ -39,6 +43,8 @@ INC_DIR += $(VBOX_DIR)/Main/include INC_DIR += $(VBOX_DIR)/VMM/include INC_DIR += $(REP_DIR)/src/virtualbox/frontend +INC_DIR += $(REP_DIR)/src/virtualbox/frontend/VBoxAPIWrap + INC_DIR += $(VBOX_DIR)/Main/xml # search path to 'scan_code_set_2.h'