From 6a16f6900dd884e07125b51c9625f6be0a1f9b70 Mon Sep 17 00:00:00 2001 From: Felix Geyer Date: Tue, 28 Jun 2011 12:27:03 +0200 Subject: Imported Upstream version 4.0.10-dfsg --- Config.kmk | 8 +- doc/manual/en_US/user_Technical.xml | 2 +- doc/manual/en_US/user_VBoxManage.xml | 20 +- doc/manual/user_ChangeLogImpl.xml | 105 ++ include/VBox/usblib-solaris.h | 1 - include/VBox/vmm/pdmdrv.h | 2 +- include/VBox/vmm/pdmusb.h | 8 + include/VBox/vmm/tm.h | 4 +- include/iprt/darwin/machkernel.h | 84 ++ include/iprt/file.h | 80 +- include/iprt/process.h | 3 + .../common/VBoxGuest/VBoxGuest-win-pnp.cpp | 18 +- .../VBoxGuestLib/VBoxGuestR3LibAdditions.cpp | 226 ++-- .../common/VBoxGuestLib/VBoxGuestR3LibSeamless.cpp | 4 + .../common/VBoxService/VBoxServiceControlExec.cpp | 3 + .../common/VBoxService/VBoxServiceVMInfo.cpp | 10 +- src/VBox/Additions/linux/drm/vboxvideo_drm.c | 12 +- src/VBox/Additions/solaris/Installer/VBox.sh | 42 +- .../Additions/solaris/Installer/postinstall.sh | 14 +- src/VBox/Devices/Graphics/DevVGA.cpp | 18 +- src/VBox/Devices/Network/Pcap.cpp | 19 +- src/VBox/Devices/PC/DevACPI.cpp | 26 +- src/VBox/Devices/Storage/DevAHCI.cpp | 27 +- src/VBox/Devices/USB/VUSBDevice.cpp | 69 +- src/VBox/Devices/USB/VUSBInternal.h | 8 +- src/VBox/Devices/VMMDev/VMMDev.cpp | 7 +- .../Devices/testcase/tstDeviceStructSizeRC.cpp | 31 +- src/VBox/Frontends/Makefile.kmk | 2 +- src/VBox/Frontends/VBoxBFE/VBoxBFE.cpp | 2 +- .../Frontends/VBoxManage/VBoxManageGuestCtrl.cpp | 2 + src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp | 2 +- src/VBox/Frontends/VBoxManage/VBoxManageMisc.cpp | 2 +- src/VBox/Frontends/VBoxShell/vboxshell.py | 16 +- .../VirtualBox/src/extensions/QITreeWidget.cpp | 16 +- .../VirtualBox/src/extensions/QITreeWidget.h | 2 +- .../VirtualBox/src/globals/VBoxProblemReporter.cpp | 8 + .../VirtualBox/src/globals/VBoxProblemReporter.h | 1 + .../src/runtime/normal/UIMachineViewNormal.cpp | 5 + .../VirtualBox/src/selector/VBoxSelectorWnd.cpp | 2 +- .../VirtualBox/src/settings/UISettingsDialog.cpp | 5 + .../src/settings/UISettingsDialogSpecific.cpp | 43 +- .../src/settings/VBoxSettingsSelector.cpp | 25 +- .../settings/machine/UIMachineSettingsGeneral.ui | 3 - .../VirtualBox/src/widgets/UIProgressDialog.cpp | 2 +- .../VirtualBox/src/wizards/newvm/UINewVMWzd.cpp | 2 +- .../HostDrivers/Support/SUPR3HardenedVerify.cpp | 5 + src/VBox/HostDrivers/Support/freebsd/Makefile | 2 + src/VBox/HostDrivers/Support/freebsd/files_vboxdrv | 2 + .../HostDrivers/Support/linux/SUPLib-linux.cpp | 9 +- src/VBox/HostDrivers/VBoxUSB/solaris/Makefile.kmk | 8 - .../HostDrivers/VBoxUSB/solaris/USBLib-solaris.cpp | 128 --- .../HostDrivers/VBoxUSB/solaris/VBoxUSBHelper.cpp | 261 ----- .../HostDrivers/VBoxUSB/win/Monitor/USBMon.cpp | 6 + src/VBox/HostServices/SharedOpenGL/Makefile.kmk | 1 + .../SharedOpenGL/crserver/crservice.cpp | 8 +- .../HostServices/SharedOpenGL/render/renderspu.c | 24 + .../HostServices/SharedOpenGL/render/renderspu.h | 4 + .../SharedOpenGL/render/renderspu_cocoa.c | 20 + .../SharedOpenGL/render/renderspu_cocoa_helper.h | 4 + .../SharedOpenGL/render/renderspu_cocoa_helper.m | 1152 +++++++++++++------- src/VBox/HostServices/auth/Makefile.kmk | 4 +- src/VBox/Installer/linux/VBox.sh | 55 +- src/VBox/Installer/solaris/VBox.sh | 62 +- src/VBox/Installer/solaris/makepackage.sh | 4 +- src/VBox/Installer/solaris/vboxconfig.sh | 4 + src/VBox/Main/glue/glue-java.xsl | 60 +- src/VBox/Main/idl/VirtualBox.xidl | 3 + src/VBox/Main/src-client/DisplayImpl.cpp | 2 + src/VBox/Main/src-client/GuestCtrlImpl.cpp | 3 +- src/VBox/Main/src-server/HostImpl.cpp | 5 +- src/VBox/Main/src-server/MachineImpl.cpp | 6 +- src/VBox/Main/src-server/MediumImpl.cpp | 178 +-- src/VBox/Main/src-server/linux/USBGetDevices.cpp | 55 +- src/VBox/Main/src-server/xpcom/server.cpp | 18 +- src/VBox/Main/webservice/vboxweb.cpp | 2 +- src/VBox/RDP/client/COPYING | 906 ++++++++++----- src/VBox/RDP/client/Makefile.in | 7 +- src/VBox/RDP/client/Makefile.kmk | 6 +- src/VBox/RDP/client/README | 29 +- src/VBox/RDP/client/bitmap.c | 9 +- src/VBox/RDP/client/cache.c | 57 +- src/VBox/RDP/client/channels.c | 9 +- src/VBox/RDP/client/cliprdr.c | 9 +- src/VBox/RDP/client/configure | 398 ++++--- src/VBox/RDP/client/configure.ac | 24 +- src/VBox/RDP/client/constants.h | 51 +- src/VBox/RDP/client/disk.c | 179 ++- src/VBox/RDP/client/disk.h | 11 +- src/VBox/RDP/client/doc/AUTHORS | 14 - src/VBox/RDP/client/doc/ChangeLog | 103 -- src/VBox/RDP/client/doc/HACKING | 45 - src/VBox/RDP/client/doc/TODO | 102 -- src/VBox/RDP/client/doc/ipv6.txt | 29 - src/VBox/RDP/client/doc/keymap-names.txt | 124 --- src/VBox/RDP/client/doc/keymapping.txt | 259 ----- src/VBox/RDP/client/doc/licensing.txt | 56 - src/VBox/RDP/client/doc/patches.txt | 340 ------ src/VBox/RDP/client/doc/rdesktop.1 | 228 ---- src/VBox/RDP/client/doc/redirection.txt | 74 -- src/VBox/RDP/client/ewmhints.c | 42 +- src/VBox/RDP/client/iso.c | 41 +- src/VBox/RDP/client/keymaps/ar | 98 -- src/VBox/RDP/client/keymaps/common | 229 ---- src/VBox/RDP/client/keymaps/convert-map | 63 -- src/VBox/RDP/client/keymaps/cs | 87 -- src/VBox/RDP/client/keymaps/da | 120 -- src/VBox/RDP/client/keymaps/de | 114 -- src/VBox/RDP/client/keymaps/de-ch | 169 --- src/VBox/RDP/client/keymaps/en-dv | 216 ---- src/VBox/RDP/client/keymaps/en-gb | 119 -- src/VBox/RDP/client/keymaps/en-us | 35 - src/VBox/RDP/client/keymaps/es | 105 -- src/VBox/RDP/client/keymaps/et | 86 -- src/VBox/RDP/client/keymaps/fi | 122 --- src/VBox/RDP/client/keymaps/fo | 77 -- src/VBox/RDP/client/keymaps/fr | 181 --- src/VBox/RDP/client/keymaps/fr-be | 135 --- src/VBox/RDP/client/keymaps/fr-ca | 53 - src/VBox/RDP/client/keymaps/fr-ch | 169 --- src/VBox/RDP/client/keymaps/he | 91 -- src/VBox/RDP/client/keymaps/hr | 125 --- src/VBox/RDP/client/keymaps/hu | 115 -- src/VBox/RDP/client/keymaps/is | 140 --- src/VBox/RDP/client/keymaps/it | 115 -- src/VBox/RDP/client/keymaps/ja | 107 -- src/VBox/RDP/client/keymaps/ko | 37 - src/VBox/RDP/client/keymaps/lt | 57 - src/VBox/RDP/client/keymaps/lv | 128 --- src/VBox/RDP/client/keymaps/mk | 101 -- src/VBox/RDP/client/keymaps/modifiers | 18 - src/VBox/RDP/client/keymaps/nl | 60 - src/VBox/RDP/client/keymaps/nl-be | 142 --- src/VBox/RDP/client/keymaps/no | 119 -- src/VBox/RDP/client/keymaps/pl | 122 --- src/VBox/RDP/client/keymaps/pt | 113 -- src/VBox/RDP/client/keymaps/pt-br | 69 -- src/VBox/RDP/client/keymaps/ru | 109 -- src/VBox/RDP/client/keymaps/sl | 110 -- src/VBox/RDP/client/keymaps/sv | 80 -- src/VBox/RDP/client/keymaps/th | 131 --- src/VBox/RDP/client/keymaps/tr | 138 --- src/VBox/RDP/client/licence.c | 11 +- src/VBox/RDP/client/lspci.c | 35 +- src/VBox/RDP/client/mcs.c | 56 +- src/VBox/RDP/client/mppc.c | 9 +- src/VBox/RDP/client/orders.c | 169 ++- src/VBox/RDP/client/orders.h | 9 +- src/VBox/RDP/client/parallel.c | 9 +- src/VBox/RDP/client/parse.h | 9 +- src/VBox/RDP/client/printer.c | 13 +- src/VBox/RDP/client/printercache.c | 37 +- src/VBox/RDP/client/proto.h | 35 +- src/VBox/RDP/client/proto.head | 7 +- src/VBox/RDP/client/pstcache.c | 11 +- src/VBox/RDP/client/rdesktop.c | 239 ++-- src/VBox/RDP/client/rdesktop.h | 87 +- src/VBox/RDP/client/rdesktop.spec | 6 +- src/VBox/RDP/client/rdp.c | 345 ++++-- src/VBox/RDP/client/rdp5.c | 14 +- src/VBox/RDP/client/rdpdr.c | 26 +- src/VBox/RDP/client/rdpsnd.c | 80 +- src/VBox/RDP/client/rdpsnd.h | 9 +- src/VBox/RDP/client/rdpsnd_alsa.c | 15 +- src/VBox/RDP/client/rdpsnd_dsp.c | 9 +- src/VBox/RDP/client/rdpsnd_dsp.h | 9 +- src/VBox/RDP/client/rdpsnd_libao.c | 13 +- src/VBox/RDP/client/rdpsnd_oss.c | 167 +-- src/VBox/RDP/client/rdpsnd_sgi.c | 13 +- src/VBox/RDP/client/rdpsnd_sun.c | 18 +- src/VBox/RDP/client/scard.c | 164 ++- src/VBox/RDP/client/scard.h | 9 +- src/VBox/RDP/client/seamless.c | 13 +- src/VBox/RDP/client/seamless.h | 9 +- src/VBox/RDP/client/secure.c | 46 +- src/VBox/RDP/client/serial.c | 14 +- src/VBox/RDP/client/ssl.c | 23 +- src/VBox/RDP/client/ssl.h | 15 +- src/VBox/RDP/client/tcp.c | 14 +- src/VBox/RDP/client/types.h | 20 +- src/VBox/RDP/client/vrdp/rdpusb.c | 5 +- src/VBox/RDP/client/xclip.c | 12 +- src/VBox/RDP/client/xkeymap.c | 45 +- src/VBox/RDP/client/xproto.h | 2 + src/VBox/RDP/client/xwin.c | 370 +++++-- src/VBox/Runtime/Makefile.kmk | 1 + src/VBox/Runtime/include/internal/ldrELF.h | 2 +- src/VBox/Runtime/include/internal/ldrELF32.h | 2 +- src/VBox/Runtime/include/internal/ldrELF64.h | 2 +- src/VBox/Runtime/include/internal/ldrMach-O.h | 601 ++++++++++ .../Runtime/r0drv/darwin/initterm-r0drv-darwin.cpp | 29 +- .../r0drv/darwin/mach_kernel-r0drv-darwin.cpp | 1045 ++++++++++++++++++ src/VBox/Runtime/r0drv/darwin/mp-r0drv-darwin.cpp | 6 +- src/VBox/Runtime/r0drv/darwin/the-darwin-kernel.h | 16 +- .../r0drv/darwin/threadpreempt-r0drv-darwin.cpp | 20 +- .../r0drv/freebsd/sleepqueue-r0drv-freebsd.h | 2 + .../Runtime/r3/posix/process-creation-posix.cpp | 7 +- src/VBox/Runtime/r3/win/process-win.cpp | 233 ++-- src/VBox/Runtime/r3/win/thread-win.cpp | 6 + src/VBox/Runtime/testcase/Makefile.kmk | 9 +- .../Runtime/testcase/tstRTDarwinMachKernel.cpp | 77 ++ src/VBox/Storage/VD.cpp | 26 +- src/VBox/Storage/VDI.cpp | 12 +- src/VBox/Storage/VMDK.cpp | 35 +- src/VBox/VMM/Makefile.kmk | 2 +- src/VBox/VMM/VMMR3/PDMBlkCache.cpp | 9 +- src/VBox/VMM/VMMR3/PDMDriver.cpp | 7 +- src/VBox/VMM/VMMR3/PDMUsb.cpp | 6 +- src/VBox/VMM/VMMR3/PGMPhys.cpp | 64 +- src/VBox/VMM/VMMR3/TM.cpp | 81 ++ src/VBox/VMM/VMMR3/VMMR3.def | 2 + src/VBox/VMM/include/TMInternal.h | 11 + 211 files changed, 6531 insertions(+), 8646 deletions(-) create mode 100644 include/iprt/darwin/machkernel.h delete mode 100644 src/VBox/HostDrivers/VBoxUSB/solaris/VBoxUSBHelper.cpp delete mode 100644 src/VBox/RDP/client/doc/AUTHORS delete mode 100644 src/VBox/RDP/client/doc/ChangeLog delete mode 100644 src/VBox/RDP/client/doc/HACKING delete mode 100644 src/VBox/RDP/client/doc/TODO delete mode 100644 src/VBox/RDP/client/doc/ipv6.txt delete mode 100644 src/VBox/RDP/client/doc/keymap-names.txt delete mode 100644 src/VBox/RDP/client/doc/keymapping.txt delete mode 100644 src/VBox/RDP/client/doc/licensing.txt delete mode 100644 src/VBox/RDP/client/doc/patches.txt delete mode 100644 src/VBox/RDP/client/doc/rdesktop.1 delete mode 100644 src/VBox/RDP/client/doc/redirection.txt delete mode 100644 src/VBox/RDP/client/keymaps/ar delete mode 100644 src/VBox/RDP/client/keymaps/common delete mode 100755 src/VBox/RDP/client/keymaps/convert-map delete mode 100644 src/VBox/RDP/client/keymaps/cs delete mode 100644 src/VBox/RDP/client/keymaps/da delete mode 100644 src/VBox/RDP/client/keymaps/de delete mode 100644 src/VBox/RDP/client/keymaps/de-ch delete mode 100644 src/VBox/RDP/client/keymaps/en-dv delete mode 100644 src/VBox/RDP/client/keymaps/en-gb delete mode 100644 src/VBox/RDP/client/keymaps/en-us delete mode 100644 src/VBox/RDP/client/keymaps/es delete mode 100644 src/VBox/RDP/client/keymaps/et delete mode 100644 src/VBox/RDP/client/keymaps/fi delete mode 100644 src/VBox/RDP/client/keymaps/fo delete mode 100644 src/VBox/RDP/client/keymaps/fr delete mode 100644 src/VBox/RDP/client/keymaps/fr-be delete mode 100644 src/VBox/RDP/client/keymaps/fr-ca delete mode 100644 src/VBox/RDP/client/keymaps/fr-ch delete mode 100644 src/VBox/RDP/client/keymaps/he delete mode 100644 src/VBox/RDP/client/keymaps/hr delete mode 100644 src/VBox/RDP/client/keymaps/hu delete mode 100644 src/VBox/RDP/client/keymaps/is delete mode 100644 src/VBox/RDP/client/keymaps/it delete mode 100644 src/VBox/RDP/client/keymaps/ja delete mode 100644 src/VBox/RDP/client/keymaps/ko delete mode 100644 src/VBox/RDP/client/keymaps/lt delete mode 100644 src/VBox/RDP/client/keymaps/lv delete mode 100644 src/VBox/RDP/client/keymaps/mk delete mode 100644 src/VBox/RDP/client/keymaps/modifiers delete mode 100644 src/VBox/RDP/client/keymaps/nl delete mode 100644 src/VBox/RDP/client/keymaps/nl-be delete mode 100644 src/VBox/RDP/client/keymaps/no delete mode 100644 src/VBox/RDP/client/keymaps/pl delete mode 100644 src/VBox/RDP/client/keymaps/pt delete mode 100644 src/VBox/RDP/client/keymaps/pt-br delete mode 100644 src/VBox/RDP/client/keymaps/ru delete mode 100644 src/VBox/RDP/client/keymaps/sl delete mode 100644 src/VBox/RDP/client/keymaps/sv delete mode 100644 src/VBox/RDP/client/keymaps/th delete mode 100644 src/VBox/RDP/client/keymaps/tr create mode 100644 src/VBox/Runtime/include/internal/ldrMach-O.h create mode 100644 src/VBox/Runtime/r0drv/darwin/mach_kernel-r0drv-darwin.cpp create mode 100644 src/VBox/Runtime/testcase/tstRTDarwinMachKernel.cpp diff --git a/Config.kmk b/Config.kmk index 165be6baf..a94a5da4e 100644 --- a/Config.kmk +++ b/Config.kmk @@ -157,7 +157,7 @@ VBOX_VERSION_MINOR = 0 # This is the current build number. It should be increased every time we publish a # new build. The define is available in every source file. Only even build numbers # will be published, odd numbers are set during development. -VBOX_VERSION_BUILD = 8 +VBOX_VERSION_BUILD = 10 # The raw version string. This *must not* contain any other information/fields than # major, minor and build revision (as it is now) -- also will be used for host/guest version # comparison. @@ -2587,7 +2587,7 @@ TEMPLATE_VBoxR0_CXXFLAGS = -Zi -Zl -GR- -EHs- -GF -W3 -wd4244 -GS- -w TEMPLATE_VBoxR0_CXXFLAGS = -Zi -Zl -GR- -EHs- -GF -W3 -wd4244 $(VBOX_VCC_OPT) $(VBOX_VCC_FP) $(VBOX_VCC_WERR) endif TEMPLATE_VBoxR0_CFLAGS = $(TEMPLATE_VBoxR0_CXXFLAGS) -TEMPLATE_VBoxR0_LDFLAGS = -Driver -Subsystem:NATIVE -Incremental:NO -Align:64 -MapInfo:Exports -NoD $(VBOX_VCC_LD_WERR) -Debug +TEMPLATE_VBoxR0_LDFLAGS = -Driver -Subsystem:NATIVE -Incremental:NO -Align:4096 -MapInfo:Exports -NoD $(VBOX_VCC_LD_WERR) -Debug TEMPLATE_VBoxR0_LIBS = \ $(PATH_LIB)/RuntimeR0Stub$(VBOX_SUFF_LIB) ifdef VBOX_USE_WINDDK @@ -2678,7 +2678,7 @@ ifeq ($(KBUILD_TARGET),win) TEMPLATE_VBOXR0DRV_CXXFLAGS = -Zi -Zl -GR- -EHs- -GF -Gz -W3 $(VBOX_VCC_OPT) $(VBOX_VCC_FP) endif TEMPLATE_VBOXR0DRV_CFLAGS = $(TEMPLATE_VBOXR0DRV_CXXFLAGS) - TEMPLATE_VBOXR0DRV_LDFLAGS = -Driver -Subsystem:NATIVE -Incremental:NO -Align:64 -MapInfo:Exports -NoD -Debug + TEMPLATE_VBOXR0DRV_LDFLAGS = -Driver -Subsystem:NATIVE -Incremental:NO -Align:4096 -MapInfo:Exports -NoD -Debug TEMPLATE_VBOXR0DRV_POST_CMDS = $(VBOX_SIGN_DRIVER_CMDS) ifdef VBOX_USE_VCC100 # HACK ALERT! TEMPLATE_VBOXR0DRV_CINCS = $(TOOL_$(VBOX_VCC_TOOL)_CINCS) @@ -4659,7 +4659,7 @@ endif SVN ?= svn$(HOSTSUFF_EXE) VBOX_SVN_REV_KMK = $(PATH_OUT)/revision.kmk ifndef VBOX_SVN_REV - VBOX_SVN_REV_FALLBACK := $(patsubst %:,, $Rev: 71778 $ ) + VBOX_SVN_REV_FALLBACK := $(patsubst %:,, $Rev: 72436 $ ) VBOX_SVN_DEP := $(wildcard $(PATH_ROOT)/.svn/entries) ifeq ($(which $(SVN)),) VBOX_SVN_DEP := diff --git a/doc/manual/en_US/user_Technical.xml b/doc/manual/en_US/user_Technical.xml index af97fc2d7..7b757e81d 100644 --- a/doc/manual/en_US/user_Technical.xml +++ b/doc/manual/en_US/user_Technical.xml @@ -884,7 +884,7 @@ (TLBs). To enable these features for a VM, you need to use the - VBoxManage modifyvm --vtxvpids and + VBoxManage modifyvm --vtxvpid and --largepages commands; see . diff --git a/doc/manual/en_US/user_VBoxManage.xml b/doc/manual/en_US/user_VBoxManage.xml index 92b2e6003..821261889 100644 --- a/doc/manual/en_US/user_VBoxManage.xml +++ b/doc/manual/en_US/user_VBoxManage.xml @@ -1898,6 +1898,12 @@ Virtual system 0: "showvdiinfo" command is also supported and mapped internally to the "showhdinfo" command. + The disk image must be specified either by its UUID (if the medium + is registered) or by its filename. Registered images can be listed by + VBoxManage list hdds (see + for more information). A filename must be specified as valid path, either + as an absolute path or as a relative path starting from the current + directory. @@ -1972,6 +1978,12 @@ Virtual system 0: mapped internally to the "modifyhd" command. + The disk image to modify must be specified either by its UUID + (if the medium is registered) or by its filename. Registered images + can be listed by VBoxManage list hdds + (see for more information). + A filename must be specified as valid path, either as an absolute path + or as a relative path starting from the current directory. The following options are available: With the --type argument, you @@ -2041,7 +2053,13 @@ Virtual system 0: [--variant Standard,Fixed,Split2G,Stream,ESX] [--existing] - where the parameters mean: + The disk image to clone as well as the target image must be described + either by its UUIDs (if the mediums are registered) or by its filename. + Registered images can be listed by VBoxManage list hdds + (see for more information). + A filename must be specified as valid path, either as an absolute path or + as a relative path starting from the current directory. + The following options are available: format diff --git a/doc/manual/user_ChangeLogImpl.xml b/doc/manual/user_ChangeLogImpl.xml index 968d4feb1..34cc9a989 100644 --- a/doc/manual/user_ChangeLogImpl.xml +++ b/doc/manual/user_ChangeLogImpl.xml @@ -1,5 +1,110 @@ + + Version 4.0.10 (2011-06-22) + + This is a maintenance release. The following items were fixed and/or + added: + + + + + GUI: fixed disappearing settings widgets on KDE hosts (bug #6809) + + + + Storage: fixed hang under rare circumstances with flat VMDK images + + + + Storage: a saved VM could not be restored under certain circumstances + after the host kernel was updated (bug #8983) + + + + Storage: refuse to create a medium with an invalid variant + (for example Split2G with VDI; bug #7227) + + + + iSCSI: pause the VM if a request times out + + + + Snapshots: none of the hard disk attachments must be attached to + another VM in normal mode when creating a snapshot + + + + USB: fixed occasional VM hangs with SMP guests (bug #4580) + + + + USB: proper device detection on RHEL/OEL/CentOS 5 guests + (partial fix for bug #8978) + + + + ACPI: force the ACPI timer to return monotonic values for improve behavior + with SMP Linux guests (bug #8511 and others) + + + + RDP: fixed screen corruption under rare circumstances (bug #8977) + + + + rdesktop-vrdp: updated to version 1.7.0 + + + + OVF: under rare circumstances some data at the end of a VMDK + file was not written during export + + + + Mac OS X hosts: Lion fixes + + + + Mac OS X hosts: GNOME 3 fix + + + + Linux hosts: fixed VT-x detection on Linux 3.0 hosts (bug #9071) + + + + Linux hosts: fixed Python 2.7 bindings in the universal Linux + binaries + + + + Windows hosts: fixed leak of thread and process handles + + + + Windows Additions: fixed bug when determining the extended version + of the Guest Additions (4.0.8 regression; bug #8948) + + + + Solaris Additions: fixed installation to 64-bit Solaris 10u9 guests + (4.0.8 regression) + + + + Linux Additions: RHEL6.1/OL6.1 compile fix + + + + Linux Additions: fixed a memory leak during VBoxManage + guestcontrol execute (bug #9068) + + + + + Version 4.0.8 (2011-05-16) diff --git a/include/VBox/usblib-solaris.h b/include/VBox/usblib-solaris.h index c4bc8743a..ca92424d2 100644 --- a/include/VBox/usblib-solaris.h +++ b/include/VBox/usblib-solaris.h @@ -201,7 +201,6 @@ typedef struct /** USB driver name*/ #define VBOXUSB_DRIVER_NAME "vboxusb" -#define VBOXUSB_HELPER_NAME "VBoxUSBHelper" /* No automatic buffering, size limited to 255 bytes => use VBOXUSBREQ for everything. */ #define VBOXUSB_IOCTL_CODE(Function, Size) _IOWRN('V', (Function) | VBOXUSB_IOCTL_FLAG, sizeof(VBOXUSBREQ)) diff --git a/include/VBox/vmm/pdmdrv.h b/include/VBox/vmm/pdmdrv.h index 050146b82..c65851f7c 100644 --- a/include/VBox/vmm/pdmdrv.h +++ b/include/VBox/vmm/pdmdrv.h @@ -1763,7 +1763,7 @@ typedef struct PDMDRVREGCB */ typedef DECLCALLBACK(int) FNPDMVBOXDRIVERSREGISTER(PCPDMDRVREGCB pCallbacks, uint32_t u32Version); -VMMR3DECL(int) PDMR3RegisterDrivers(PVM pVM, FNPDMVBOXDRIVERSREGISTER pfnCallback); +VMMR3DECL(int) PDMR3DrvStaticRegistration(PVM pVM, FNPDMVBOXDRIVERSREGISTER pfnCallback); #endif /* IN_RING3 */ diff --git a/include/VBox/vmm/pdmusb.h b/include/VBox/vmm/pdmusb.h index a2517474a..18e49999e 100644 --- a/include/VBox/vmm/pdmusb.h +++ b/include/VBox/vmm/pdmusb.h @@ -902,6 +902,14 @@ DECLINLINE(void) PDMUsbHlpMMHeapFree(PPDMUSBINS pUsbIns, void *pv) MMR3HeapFree(pv); } +/** + * @copydoc PDMUSBHLP::pfnTMTimerCreate + */ +DECLINLINE(int) PDMUsbHlpTMTimerCreate(PPDMUSBINS pUsbIns, TMCLOCK enmClock, PFNTMTIMERUSB pfnCallback, void *pvUser, + uint32_t fFlags, const char *pszDesc, PPTMTIMERR3 ppTimer) +{ + return pUsbIns->pHlpR3->pfnTMTimerCreate(pUsbIns, enmClock, pfnCallback, pvUser, fFlags, pszDesc, ppTimer); +} #endif /* IN_RING3 */ diff --git a/include/VBox/vmm/tm.h b/include/VBox/vmm/tm.h index 9cca2f874..fd14bac19 100644 --- a/include/VBox/vmm/tm.h +++ b/include/VBox/vmm/tm.h @@ -156,7 +156,7 @@ typedef DECLCALLBACK(void) FNTMTIMERDEV(PPDMDEVINS pDevIns, PTMTIMER pTimer, voi typedef FNTMTIMERDEV *PFNTMTIMERDEV; /** - * Device timer callback function. + * USB device timer callback function. * * @param pUsbIns The USB device instance the timer is associated * with. @@ -250,11 +250,13 @@ VMM_INT_DECL(int) TMR3Term(PVM pVM); VMM_INT_DECL(void) TMR3Reset(PVM pVM); VMM_INT_DECL(int) TMR3GetImportRC(PVM pVM, const char *pszSymbol, PRTRCPTR pRCPtrValue); VMM_INT_DECL(int) TMR3TimerCreateDevice(PVM pVM, PPDMDEVINS pDevIns, TMCLOCK enmClock, PFNTMTIMERDEV pfnCallback, void *pvUser, uint32_t fFlags, const char *pszDesc, PPTMTIMERR3 ppTimer); +VMM_INT_DECL(int) TMR3TimerCreateUsb(PVM pVM, PPDMUSBINS pUsbIns, TMCLOCK enmClock, PFNTMTIMERUSB pfnCallback, void *pvUser, uint32_t fFlags, const char *pszDesc, PPTMTIMERR3 ppTimer); VMM_INT_DECL(int) TMR3TimerCreateDriver(PVM pVM, PPDMDRVINS pDrvIns, TMCLOCK enmClock, PFNTMTIMERDRV pfnCallback, void *pvUser, uint32_t fFlags, const char *pszDesc, PPTMTIMERR3 ppTimer); VMMR3DECL(int) TMR3TimerCreateInternal(PVM pVM, TMCLOCK enmClock, PFNTMTIMERINT pfnCallback, void *pvUser, const char *pszDesc, PPTMTIMERR3 ppTimer); VMMR3DECL(PTMTIMERR3) TMR3TimerCreateExternal(PVM pVM, TMCLOCK enmClock, PFNTMTIMEREXT pfnCallback, void *pvUser, const char *pszDesc); VMMR3DECL(int) TMR3TimerDestroy(PTMTIMER pTimer); VMM_INT_DECL(int) TMR3TimerDestroyDevice(PVM pVM, PPDMDEVINS pDevIns); +VMM_INT_DECL(int) TMR3TimerDestroyUsb(PVM pVM, PPDMUSBINS pUsbIns); VMM_INT_DECL(int) TMR3TimerDestroyDriver(PVM pVM, PPDMDRVINS pDrvIns); VMMR3DECL(int) TMR3TimerSave(PTMTIMERR3 pTimer, PSSMHANDLE pSSM); VMMR3DECL(int) TMR3TimerLoad(PTMTIMERR3 pTimer, PSSMHANDLE pSSM); diff --git a/include/iprt/darwin/machkernel.h b/include/iprt/darwin/machkernel.h new file mode 100644 index 000000000..4b4a8a830 --- /dev/null +++ b/include/iprt/darwin/machkernel.h @@ -0,0 +1,84 @@ +/* $Id: machkernel.h $ */ +/** @file + * IPRT - mach_kernel symbol resolving hack, R0 Driver, Darwin. + */ + +/* + * Copyright (C) 2011 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. + * + * The contents of this file may alternatively be used under the terms + * of the Common Development and Distribution License Version 1.0 + * (CDDL) only, as it comes in the "COPYING.CDDL" file of the + * VirtualBox OSE distribution, in which case the provisions of the + * CDDL are applicable instead of those of the GPL. + * + * You may elect to license modified versions of this file under the + * terms and conditions of either the GPL or the CDDL or both. + */ + +#ifndef ___iprt_darwin_machkernel_h +#define ___iprt_darwin_machkernel_h + +#include + +RT_C_DECLS_BEGIN + +/** @defgroup grp_rt_darwin_machkernel Mach Kernel Symbols (Ring-0 only) + * @addtogroup grp_rt + * @{ + */ + +/** Handle to the mach kernel symbol database (darwin/r0 only). */ +typedef R3R0PTRTYPE(struct RTR0MACHKERNELINT *) RTR0MACHKERNEL; +/** Pointer to a mach kernel symbol database handle. */ +typedef RTR0MACHKERNEL *PRTR0MACHKERNEL; +/** Nil mach kernel symbol database handle. */ +#define NIL_RTR0MACHKERNEL ((RTR0MACHKERNEL)0) + + +/** + * Opens symbol table of the mach_kernel. + * + * @returns IPRT status code. + * @param pszMachKernel The path to the mach_kernel image. + * @param phKernel Where to return a mach kernel symbol database + * handle on success. Call RTR0MachKernelClose on it + * when done. + */ +RTDECL(int) RTR0MachKernelOpen(const char *pszMachKernel, PRTR0MACHKERNEL phKernel); + +/** + * Frees up the internal scratch data when done looking up symbols. + * + * @param pThis The internal scratch data. + */ +RTDECL(int) RTR0MachKernelClose(RTR0MACHKERNEL hKernel); + +/** + * Looks up a kernel symbol. + * + * @returns VINF_SUCCESS if found, *ppvValue set. + * @retval VERR_SYMBOL_NOT_FOUND if not found. + * @retval VERR_INVALID_HANDLE + * @retval VERR_INVALID_POINTER + * + * @param hKernel The mach kernel handle. + * @param pszSymbol The name of the symbol to look up, omitting the + * leading underscore. + * @param ppvValue Where to store the symbol address (optional). + */ +RTDECL(int) RTR0MachKernelGetSymbol(RTR0MACHKERNEL hKernel, const char *pszSymbol, void **ppvValue); + +/** @} */ +RT_C_DECLS_END + +#endif + diff --git a/include/iprt/file.h b/include/iprt/file.h index 178ed76e9..c5e055b2e 100644 --- a/include/iprt/file.h +++ b/include/iprt/file.h @@ -29,9 +29,7 @@ #include #include #include -#ifdef IN_RING3 -# include -#endif +#include RT_C_DECLS_BEGIN @@ -70,8 +68,6 @@ RT_C_DECLS_BEGIN #endif -#ifdef IN_RING3 - /** * Checks if the specified file name exists and is a regular file. * @@ -235,6 +231,7 @@ RTDECL(int) RTFileQuerySize(const char *pszPath, uint64_t *pcbFile); /** @} */ +#ifdef IN_RING3 /** * Force the use of open flags for all files opened after the setting is * changed. The caller is responsible for not causing races with RTFileOpen(). @@ -245,6 +242,7 @@ RTDECL(int) RTFileQuerySize(const char *pszPath, uint64_t *pcbFile); * @param fMask Open flags to be masked out. */ RTR3DECL(int) RTFileSetForceFlags(unsigned fOpenForAccess, unsigned fSet, unsigned fMask); +#endif /* IN_RING3 */ /** * Open a file. @@ -255,7 +253,7 @@ RTR3DECL(int) RTFileSetForceFlags(unsigned fOpenForAccess, unsigned fSet, unsig * @param fOpen Open flags, i.e a combination of the RTFILE_O_* defines. * The ACCESS, ACTION and DENY flags are mandatory! */ -RTR3DECL(int) RTFileOpen(PRTFILE pFile, const char *pszFilename, uint32_t fOpen); +RTDECL(int) RTFileOpen(PRTFILE pFile, const char *pszFilename, uint32_t fOpen); /** * Open a file given as a format string. @@ -268,7 +266,7 @@ RTR3DECL(int) RTFileOpen(PRTFILE pFile, const char *pszFilename, uint32_t fOpen * be opened. (UTF-8) * @param ... Arguments to the format string. */ -RTR3DECL(int) RTFileOpenF(PRTFILE pFile, uint32_t fOpen, const char *pszFilenameFmt, ...); +RTDECL(int) RTFileOpenF(PRTFILE pFile, uint32_t fOpen, const char *pszFilenameFmt, ...); /** * Open a file given as a format string. @@ -281,7 +279,7 @@ RTR3DECL(int) RTFileOpenF(PRTFILE pFile, uint32_t fOpen, const char *pszFilenam * be opened. (UTF-8) * @param va Arguments to the format string. */ -RTR3DECL(int) RTFileOpenV(PRTFILE pFile, uint32_t fOpen, const char *pszFilenameFmt, va_list va); +RTDECL(int) RTFileOpenV(PRTFILE pFile, uint32_t fOpen, const char *pszFilenameFmt, va_list va); /** * Open the bit bucket (aka /dev/null or nul). @@ -290,7 +288,7 @@ RTR3DECL(int) RTFileOpenV(PRTFILE pFile, uint32_t fOpen, const char *pszFilenam * @param phFile Where to store the handle to the opened file. * @param fAccess The desired access only, i.e. read, write or both. */ -RTR3DECL(int) RTFileOpenBitBucket(PRTFILE phFile, uint32_t fAccess); +RTDECL(int) RTFileOpenBitBucket(PRTFILE phFile, uint32_t fAccess); /** * Close a file opened by RTFileOpen(). @@ -298,7 +296,7 @@ RTR3DECL(int) RTFileOpenBitBucket(PRTFILE phFile, uint32_t fAccess); * @returns iprt status code. * @param File The file handle to close. */ -RTR3DECL(int) RTFileClose(RTFILE File); +RTDECL(int) RTFileClose(RTFILE File); /** * Creates an IPRT file handle from a native one. @@ -307,7 +305,7 @@ RTR3DECL(int) RTFileClose(RTFILE File); * @param pFile Where to store the IPRT file handle. * @param uNative The native handle. */ -RTR3DECL(int) RTFileFromNative(PRTFILE pFile, RTHCINTPTR uNative); +RTDECL(int) RTFileFromNative(PRTFILE pFile, RTHCINTPTR uNative); /** * Gets the native handle for an IPRT file handle. @@ -315,7 +313,7 @@ RTR3DECL(int) RTFileFromNative(PRTFILE pFile, RTHCINTPTR uNative); * @return The native handle. * @param File The IPRT file handle. */ -RTR3DECL(RTHCINTPTR) RTFileToNative(RTFILE File); +RTDECL(RTHCINTPTR) RTFileToNative(RTFILE File); /** * Delete a file. @@ -324,7 +322,7 @@ RTR3DECL(RTHCINTPTR) RTFileToNative(RTFILE File); * @param pszFilename Path to the file which is to be deleted. (UTF-8) * @todo This is a RTPath api! */ -RTR3DECL(int) RTFileDelete(const char *pszFilename); +RTDECL(int) RTFileDelete(const char *pszFilename); /** @name Seek flags. * @{ */ @@ -351,7 +349,7 @@ RTR3DECL(int) RTFileDelete(const char *pszFilename); * @param poffActual Where to store the new file position. * NULL is allowed. */ -RTR3DECL(int) RTFileSeek(RTFILE File, int64_t offSeek, unsigned uMethod, uint64_t *poffActual); +RTDECL(int) RTFileSeek(RTFILE File, int64_t offSeek, unsigned uMethod, uint64_t *poffActual); /** * Read bytes from a file. @@ -363,7 +361,7 @@ RTR3DECL(int) RTFileSeek(RTFILE File, int64_t offSeek, unsigned uMethod, uint64 * @param *pcbRead How much we actually read . * If NULL an error will be returned for a partial read. */ -RTR3DECL(int) RTFileRead(RTFILE File, void *pvBuf, size_t cbToRead, size_t *pcbRead); +RTDECL(int) RTFileRead(RTFILE File, void *pvBuf, size_t cbToRead, size_t *pcbRead); /** * Read bytes from a file at a given offset. @@ -377,7 +375,7 @@ RTR3DECL(int) RTFileRead(RTFILE File, void *pvBuf, size_t cbToRead, size_t *pcb * @param *pcbRead How much we actually read . * If NULL an error will be returned for a partial read. */ -RTR3DECL(int) RTFileReadAt(RTFILE File, RTFOFF off, void *pvBuf, size_t cbToRead, size_t *pcbRead); +RTDECL(int) RTFileReadAt(RTFILE File, RTFOFF off, void *pvBuf, size_t cbToRead, size_t *pcbRead); /** * Write bytes to a file. @@ -389,7 +387,7 @@ RTR3DECL(int) RTFileReadAt(RTFILE File, RTFOFF off, void *pvBuf, size_t cbToRea * @param *pcbWritten How much we actually wrote. * If NULL an error will be returned for a partial write. */ -RTR3DECL(int) RTFileWrite(RTFILE File, const void *pvBuf, size_t cbToWrite, size_t *pcbWritten); +RTDECL(int) RTFileWrite(RTFILE File, const void *pvBuf, size_t cbToWrite, size_t *pcbWritten); /** * Write bytes to a file at a given offset. @@ -403,7 +401,7 @@ RTR3DECL(int) RTFileWrite(RTFILE File, const void *pvBuf, size_t cbToWrite, siz * @param *pcbWritten How much we actually wrote. * If NULL an error will be returned for a partial write. */ -RTR3DECL(int) RTFileWriteAt(RTFILE File, RTFOFF off, const void *pvBuf, size_t cbToWrite, size_t *pcbWritten); +RTDECL(int) RTFileWriteAt(RTFILE File, RTFOFF off, const void *pvBuf, size_t cbToWrite, size_t *pcbWritten); /** * Flushes the buffers for the specified file. @@ -411,7 +409,7 @@ RTR3DECL(int) RTFileWriteAt(RTFILE File, RTFOFF off, const void *pvBuf, size_t * @returns iprt status code. * @param File Handle to the file. */ -RTR3DECL(int) RTFileFlush(RTFILE File); +RTDECL(int) RTFileFlush(RTFILE File); /** * Set the size of the file. @@ -420,7 +418,7 @@ RTR3DECL(int) RTFileFlush(RTFILE File); * @param File Handle to the file. * @param cbSize The new file size. */ -RTR3DECL(int) RTFileSetSize(RTFILE File, uint64_t cbSize); +RTDECL(int) RTFileSetSize(RTFILE File, uint64_t cbSize); /** * Query the size of the file. @@ -429,7 +427,7 @@ RTR3DECL(int) RTFileSetSize(RTFILE File, uint64_t cbSize); * @param File Handle to the file. * @param pcbSize Where to store the filesize. */ -RTR3DECL(int) RTFileGetSize(RTFILE File, uint64_t *pcbSize); +RTDECL(int) RTFileGetSize(RTFILE File, uint64_t *pcbSize); /** * Determine the maximum file size. @@ -439,7 +437,7 @@ RTR3DECL(int) RTFileGetSize(RTFILE File, uint64_t *pcbSize); * @param File Handle to the file. * @see RTFileGetMaxSizeEx. */ -RTR3DECL(RTFOFF) RTFileGetMaxSize(RTFILE File); +RTDECL(RTFOFF) RTFileGetMaxSize(RTFILE File); /** * Determine the maximum file size. @@ -449,7 +447,7 @@ RTR3DECL(RTFOFF) RTFileGetMaxSize(RTFILE File); * @param pcbMax Where to store the max file size. * @see RTFileGetMaxSize. */ -RTR3DECL(int) RTFileGetMaxSizeEx(RTFILE File, PRTFOFF pcbMax); +RTDECL(int) RTFileGetMaxSizeEx(RTFILE File, PRTFOFF pcbMax); /** * Determine the maximum file size depending on the file system the file is stored on. @@ -458,7 +456,7 @@ RTR3DECL(int) RTFileGetMaxSizeEx(RTFILE File, PRTFOFF pcbMax); * -1 on failure. * @param File Handle to the file. */ -RTR3DECL(RTFOFF) RTFileGetMaxSize(RTFILE File); +RTDECL(RTFOFF) RTFileGetMaxSize(RTFILE File); /** * Gets the current file position. @@ -476,7 +474,7 @@ RTDECL(uint64_t) RTFileTell(RTFILE File); * @returns false if invalid. * @param File The file handle */ -RTR3DECL(bool) RTFileIsValid(RTFILE File); +RTDECL(bool) RTFileIsValid(RTFILE File); /** * Copies a file. @@ -640,7 +638,7 @@ RTDECL(int) RTFileMove(const char *pszSrc, const char *pszDst, unsigned fMove); * @param offLock Offset of lock start. * @param cbLock Length of region to lock, may overlap the end of file. */ -RTR3DECL(int) RTFileLock(RTFILE File, unsigned fLock, int64_t offLock, uint64_t cbLock); +RTDECL(int) RTFileLock(RTFILE File, unsigned fLock, int64_t offLock, uint64_t cbLock); /** * Changes a lock type from read to write or from write to read. @@ -665,7 +663,7 @@ RTR3DECL(int) RTFileLock(RTFILE File, unsigned fLock, int64_t offLock, uint64_t * @param offLock Offset of lock start. * @param cbLock Length of region to lock, may overlap the end of file. */ -RTR3DECL(int) RTFileChangeLock(RTFILE File, unsigned fLock, int64_t offLock, uint64_t cbLock); +RTDECL(int) RTFileChangeLock(RTFILE File, unsigned fLock, int64_t offLock, uint64_t cbLock); /** * Unlocks previously locked region of file. @@ -677,7 +675,7 @@ RTR3DECL(int) RTFileChangeLock(RTFILE File, unsigned fLock, int64_t offLock, ui * @param offLock Offset of lock start. * @param cbLock Length of region to unlock, may overlap the end of file. */ -RTR3DECL(int) RTFileUnlock(RTFILE File, int64_t offLock, uint64_t cbLock); +RTDECL(int) RTFileUnlock(RTFILE File, int64_t offLock, uint64_t cbLock); /** @@ -690,7 +688,7 @@ RTR3DECL(int) RTFileUnlock(RTFILE File, int64_t offLock, uint64_t cbLock); * @param enmAdditionalAttribs Which set of additional attributes to request. * Use RTFSOBJATTRADD_NOTHING if this doesn't matter. */ -RTR3DECL(int) RTFileQueryInfo(RTFILE File, PRTFSOBJINFO pObjInfo, RTFSOBJATTRADD enmAdditionalAttribs); +RTDECL(int) RTFileQueryInfo(RTFILE File, PRTFSOBJINFO pObjInfo, RTFSOBJATTRADD enmAdditionalAttribs); /** * Changes one or more of the timestamps associated of file system object. @@ -716,8 +714,8 @@ RTR3DECL(int) RTFileQueryInfo(RTFILE File, PRTFSOBJINFO pObjInfo, RTFSOBJATTRADD * * @remark POSIX can only set Access & Modification and will always set both. */ -RTR3DECL(int) RTFileSetTimes(RTFILE File, PCRTTIMESPEC pAccessTime, PCRTTIMESPEC pModificationTime, - PCRTTIMESPEC pChangeTime, PCRTTIMESPEC pBirthTime); +RTDECL(int) RTFileSetTimes(RTFILE File, PCRTTIMESPEC pAccessTime, PCRTTIMESPEC pModificationTime, + PCRTTIMESPEC pChangeTime, PCRTTIMESPEC pBirthTime); /** * Gets one or more of the timestamps associated of file system object. @@ -731,8 +729,8 @@ RTR3DECL(int) RTFileSetTimes(RTFILE File, PCRTTIMESPEC pAccessTime, PCRTTIMESPEC * * @remark This is wrapper around RTFileQueryInfo() and exists to complement RTFileSetTimes(). */ -RTR3DECL(int) RTFileGetTimes(RTFILE File, PRTTIMESPEC pAccessTime, PRTTIMESPEC pModificationTime, - PRTTIMESPEC pChangeTime, PRTTIMESPEC pBirthTime); +RTDECL(int) RTFileGetTimes(RTFILE File, PRTTIMESPEC pAccessTime, PRTTIMESPEC pModificationTime, + PRTTIMESPEC pChangeTime, PRTTIMESPEC pBirthTime); /** * Changes the mode flags of an open file. @@ -744,7 +742,7 @@ RTR3DECL(int) RTFileGetTimes(RTFILE File, PRTTIMESPEC pAccessTime, PRTTIMESPEC p * @param File Handle to the file. * @param fMode The new file mode, see @ref grp_rt_fs for details. */ -RTR3DECL(int) RTFileSetMode(RTFILE File, RTFMODE fMode); +RTDECL(int) RTFileSetMode(RTFILE File, RTFMODE fMode); /** * Gets the mode flags of an open file. @@ -756,7 +754,7 @@ RTR3DECL(int) RTFileSetMode(RTFILE File, RTFMODE fMode); * @remark This is wrapper around RTFileQueryInfo() * and exists to complement RTFileSetMode(). */ -RTR3DECL(int) RTFileGetMode(RTFILE File, uint32_t *pfMode); +RTDECL(int) RTFileGetMode(RTFILE File, uint32_t *pfMode); /** * Changes the owner and/or group of an open file. @@ -768,7 +766,7 @@ RTR3DECL(int) RTFileGetMode(RTFILE File, uint32_t *pfMode); * @param gid The new group id. Pass NIL_RTGID to leave this * unchanged. */ -RTR3DECL(int) RTFileSetOwner(RTFILE File, uint32_t uid, uint32_t gid); +RTDECL(int) RTFileSetOwner(RTFILE File, uint32_t uid, uint32_t gid); /** * Gets the owner and/or group of an open file. @@ -780,7 +778,7 @@ RTR3DECL(int) RTFileSetOwner(RTFILE File, uint32_t uid, uint32_t gid); * * @remark This is wrapper around RTFileQueryInfo() and exists to complement RTFileGetOwner(). */ -RTR3DECL(int) RTFileGetOwner(RTFILE File, uint32_t *pUid, uint32_t *pGid); +RTDECL(int) RTFileGetOwner(RTFILE File, uint32_t *pUid, uint32_t *pGid); /** * Executes an IOCTL on a file descriptor. @@ -799,7 +797,7 @@ RTR3DECL(int) RTFileGetOwner(RTFILE File, uint32_t *pUid, uint32_t *pGid); * @param cbData Size of the IOCTL data. * @param piRet Return value of the IOCTL request. */ -RTR3DECL(int) RTFileIoCtl(RTFILE File, unsigned long ulRequest, void *pvData, unsigned cbData, int *piRet); +RTDECL(int) RTFileIoCtl(RTFILE File, unsigned long ulRequest, void *pvData, unsigned cbData, int *piRet); /** * Query the sizes of a filesystem. @@ -816,8 +814,8 @@ RTR3DECL(int) RTFileIoCtl(RTFILE File, unsigned long ulRequest, void *pvData, un * * @sa RTFsQuerySizes */ -RTR3DECL(int) RTFileQueryFsSizes(RTFILE hFile, PRTFOFF pcbTotal, RTFOFF *pcbFree, - uint32_t *pcbBlock, uint32_t *pcbSector); +RTDECL(int) RTFileQueryFsSizes(RTFILE hFile, PRTFOFF pcbTotal, RTFOFF *pcbFree, + uint32_t *pcbBlock, uint32_t *pcbSector); /** * Reads the file into memory. @@ -912,6 +910,8 @@ RTDECL(void) RTFileReadAllFree(void *pvFile, size_t cbFile); /** @} */ +#ifdef IN_RING3 + /** @page pg_rt_asyncio RT File async I/O API * * File operations are usually blocking the calling thread until diff --git a/include/iprt/process.h b/include/iprt/process.h index 979f6499c..8a820f7bc 100644 --- a/include/iprt/process.h +++ b/include/iprt/process.h @@ -197,6 +197,9 @@ RTR3DECL(int) RTProcCreateEx(const char *pszExec, const char * const *papszArg * on Solaris. Without this flag the contract id is always changed, * as that's the more frequently used case. */ #define RTPROC_FLAGS_SAME_CONTRACT RT_BIT(3) +/** Do not load user profile data when executing a process. This bit + * at the moment only is used on Windows. */ +#define RTPROC_FLAGS_NO_PROFILE RT_BIT(4) /** @} */ diff --git a/src/VBox/Additions/common/VBoxGuest/VBoxGuest-win-pnp.cpp b/src/VBox/Additions/common/VBoxGuest/VBoxGuest-win-pnp.cpp index 69ffcb308..8e2f8c0e7 100644 --- a/src/VBox/Additions/common/VBoxGuest/VBoxGuest-win-pnp.cpp +++ b/src/VBox/Additions/common/VBoxGuest/VBoxGuest-win-pnp.cpp @@ -240,9 +240,14 @@ NTSTATUS vboxguestwinPnP(PDEVICE_OBJECT pDevObj, PIRP pIrp) /* This IRP passed down to lower driver. */ pIrp->IoStatus.Status = STATUS_SUCCESS; - rc = vboxguestwinSendIrpSynchronously(pDevExt->win.s.pNextLowerDriver, pIrp, TRUE); + IoSkipCurrentIrpStackLocation(pIrp); - /* Do not complete the IRP. */ + rc = IoCallDriver(pDevExt->win.s.pNextLowerDriver, pIrp); + Log(("VBoxGuest::vboxguestwinGuestPnp: QUERY_REMOVE_DEVICE: Next lower driver replied rc = 0x%x\n", rc)); + + /* we must not do anything the IRP after doing IoSkip & CallDriver + * since the driver below us will complete (or already have completed) the IRP. + * I.e. just return the status we got from IoCallDriver */ return rc; } @@ -330,9 +335,14 @@ NTSTATUS vboxguestwinPnP(PDEVICE_OBJECT pDevObj, PIRP pIrp) /* This IRP passed down to lower driver. */ pIrp->IoStatus.Status = STATUS_SUCCESS; - rc = vboxguestwinSendIrpSynchronously(pDevExt->win.s.pNextLowerDriver, pIrp, TRUE); + IoSkipCurrentIrpStackLocation(pIrp); + + rc = IoCallDriver(pDevExt->win.s.pNextLowerDriver, pIrp); + Log(("VBoxGuest::vboxguestwinGuestPnp: QUERY_STOP_DEVICE: Next lower driver replied rc = 0x%x\n", rc)); - /* Do not complete the IRP. */ + /* we must not do anything with the IRP after doing IoSkip & CallDriver + * since the driver below us will complete (or already have completed) the IRP. + * I.e. just return the status we got from IoCallDriver */ return rc; } diff --git a/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibAdditions.cpp b/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibAdditions.cpp index b530f4316..0353f046a 100644 --- a/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibAdditions.cpp +++ b/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibAdditions.cpp @@ -36,55 +36,58 @@ /** - * Fallback for vbglR3GetAdditionsVersion. + * Fallback for VbglR3GetAdditionsVersion. */ static int vbglR3GetAdditionsCompileTimeVersion(char **ppszVer, char **ppszVerEx, char **ppszRev) { - /* Raw version string: major.minor.build. */ + int rc = VINF_SUCCESS; if (ppszVer) + rc = RTStrDupEx(ppszVer, VBOX_VERSION_STRING_RAW); + if (RT_SUCCESS(rc)) { - *ppszVer = RTStrDup(VBOX_VERSION_STRING_RAW); - if (!*ppszVer) - return VERR_NO_STR_MEMORY; - } - - /* Extended version string: major.minor.build (+ vendor [suffix(es)]). */ - if (ppszVerEx) - { - *ppszVerEx = RTStrDup(VBOX_VERSION_STRING); - if (!*ppszVerEx) - return VERR_NO_STR_MEMORY; - } - - if (ppszRev) - { - char szRev[64]; - RTStrPrintf(szRev, sizeof(szRev), "%d", VBOX_SVN_REV); - *ppszRev = RTStrDup(szRev); - if (!*ppszRev) + if (ppszVerEx) + rc = RTStrDupEx(ppszVerEx, VBOX_VERSION_STRING); + if (RT_SUCCESS(rc)) { - if (ppszVer) + if (ppszRev) { - RTStrFree(*ppszVer); - *ppszVer = NULL; +#if 0 + char szRev[64]; + RTStrPrintf(szRev, sizeof(szRev), "%d", VBOX_SVN_REV); + rc = RTStrDupEx(ppszRev, szRev); +#else + rc = RTStrDupEx(ppszRev, RT_XSTR(VBOX_SVN_REV)); +#endif } - return VERR_NO_STR_MEMORY; + if (RT_SUCCESS(rc)) + return VINF_SUCCESS; + + /* bail out: */ + } + if (ppszVerEx) + { + RTStrFree(*ppszVerEx); + *ppszVerEx = NULL; } } - - return VINF_SUCCESS; + if (ppszVer) + { + RTStrFree(*ppszVer); + *ppszVer = NULL; + } + return rc; } #ifdef RT_OS_WINDOWS + /** * Looks up the storage path handle (registry). * * @returns IPRT status value - * @param hKey Receives pointer of allocated version string. NULL is - * accepted. The returned pointer must be closed by - * vbglR3CloseAdditionsWinStoragePath(). + * @param hKey Receives storage path handle on success. + * The returned handle must be closed by vbglR3CloseAdditionsWinStoragePath(). */ -static int vbglR3GetAdditionsWinStoragePath(PHKEY phKey) +static int vbglR3QueryAdditionsWinStoragePath(PHKEY phKey) { /* * Try get the *installed* version first. @@ -138,7 +141,7 @@ static int vbglR3GetAdditionsWinStoragePath(PHKEY phKey) * * @returns IPRT status value * @param hKey Handle to close, retrieved by - * vbglR3GetAdditionsWinStoragePath(). + * vbglR3QueryAdditionsWinStoragePath(). */ static int vbglR3CloseAdditionsWinStoragePath(HKEY hKey) { @@ -173,6 +176,36 @@ VBGLR3DECL(int) VbglR3ReportAdditionsStatus(VBoxGuestStatusFacility enmFacility, return rc; } +#ifdef RT_OS_WINDOWS + +/** + * Queries a string value from a specified registry key. + * + * @return IPRT status code. + * @param hKey Handle of registry key to use. + * @param pszValName Value name to query value from. + * @param pszBuffer Pointer to buffer which the queried string value gets stored into. + * @param cchBuffer Size (in bytes) of buffer. + */ +static int vbglR3QueryRegistryString(HKEY hKey, const char *pszValName, char *pszBuffer, size_t cchBuffer) +{ + AssertReturn(pszValName, VERR_INVALID_PARAMETER); + AssertReturn(pszBuffer, VERR_INVALID_POINTER); + AssertReturn(cchBuffer, VERR_INVALID_PARAMETER); + + int rc; + DWORD dwType; + DWORD dwSize = (DWORD)cchBuffer; + LONG lRet = RegQueryValueEx(hKey, pszValName, NULL, &dwType, (BYTE *)pszBuffer, &dwSize); + if (lRet == ERROR_SUCCESS) + rc = dwType == REG_SZ ? VINF_SUCCESS : VERR_INVALID_PARAMETER; + else + rc = RTErrConvertFromWin32(lRet); + return rc; +} + +#endif /* RT_OS_WINDOWS */ + /** * Retrieves the installed Guest Additions version and/or revision. * @@ -180,7 +213,7 @@ VBGLR3DECL(int) VbglR3ReportAdditionsStatus(VBoxGuestStatusFacility enmFacility, * @param ppszVer Receives pointer of allocated raw version string * (major.minor.build). NULL is accepted. The returned * pointer must be freed using RTStrFree().* - * @param ppszVerEx Receives pointer of allocated full version string + * @param ppszVerExt Receives pointer of allocated full version string * (raw version + vendor suffix(es)). NULL is * accepted. The returned pointer must be freed using * RTStrFree(). @@ -188,94 +221,67 @@ VBGLR3DECL(int) VbglR3ReportAdditionsStatus(VBoxGuestStatusFacility enmFacility, * accepted. The returned pointer must be freed using * RTStrFree(). */ -VBGLR3DECL(int) VbglR3GetAdditionsVersion(char **ppszVer, char **ppszVerEx, char **ppszRev) +VBGLR3DECL(int) VbglR3GetAdditionsVersion(char **ppszVer, char **ppszVerExt, char **ppszRev) { + /* + * Zap the return value up front. + */ + if (ppszVer) + *ppszVer = NULL; + if (ppszVerExt) + *ppszVerExt = NULL; + if (ppszRev) + *ppszRev = NULL; + #ifdef RT_OS_WINDOWS HKEY hKey; - int rc = vbglR3GetAdditionsWinStoragePath(&hKey); + int rc = vbglR3QueryAdditionsWinStoragePath(&hKey); if (RT_SUCCESS(rc)) { - /* Version. */ - LONG l; - DWORD dwType; - DWORD dwSize = 32; - char *pszTmp; + /* + * Version. + */ + char szTemp[32]; if (ppszVer) { - pszTmp = (char*)RTMemAlloc(dwSize); - if (pszTmp) - { - l = RegQueryValueEx(hKey, "Version", NULL, &dwType, (BYTE*)(LPCTSTR)pszTmp, &dwSize); - if (l == ERROR_SUCCESS) - { - if (dwType == REG_SZ) - rc = RTStrDupEx(ppszVer, pszTmp); - else - rc = VERR_INVALID_PARAMETER; - } - else - { - rc = RTErrConvertFromWin32(l); - } - RTMemFree(pszTmp); - } - else - rc = VERR_NO_MEMORY; + rc = vbglR3QueryRegistryString(hKey, "Version", szTemp, sizeof(szTemp)); + if (RT_SUCCESS(rc)) + rc = RTStrDupEx(ppszVer, szTemp); } - if (ppszVerEx) + + if ( RT_SUCCESS(rc) + && ppszVerExt) { - dwSize = 32; /* Reset */ - pszTmp = (char*)RTMemAlloc(dwSize); - if (pszTmp) - { - l = RegQueryValueEx(hKey, "VersionEx", NULL, &dwType, (BYTE*)(LPCTSTR)pszTmp, &dwSize); - if (l == ERROR_SUCCESS) - { - if (dwType == REG_SZ) - rc = RTStrDupEx(ppszVerEx, pszTmp); - else - rc = VERR_INVALID_PARAMETER; - } - else - { - rc = RTErrConvertFromWin32(l); - } - RTMemFree(pszTmp); - } - else - rc = VERR_NO_MEMORY; + rc = vbglR3QueryRegistryString(hKey, "VersionExt", szTemp, sizeof(szTemp)); + if (RT_SUCCESS(rc)) + rc = RTStrDupEx(ppszVerExt, szTemp); } - /* Revision. */ - if (ppszRev) + + /* + * Revision. + */ + if ( RT_SUCCESS(rc) + && ppszRev) { - dwSize = 32; /* Reset */ - pszTmp = (char*)RTMemAlloc(dwSize); - if (pszTmp) - { - l = RegQueryValueEx(hKey, "Revision", NULL, &dwType, (BYTE*)(LPCTSTR)pszTmp, &dwSize); - if (l == ERROR_SUCCESS) - { - if (dwType == REG_SZ) - rc = RTStrDupEx(ppszRev, pszTmp); - else - rc = VERR_INVALID_PARAMETER; - } - else - { - rc = RTErrConvertFromWin32(l); - } - RTMemFree(pszTmp); - } - else - rc = VERR_NO_MEMORY; + rc = vbglR3QueryRegistryString(hKey, "Revision", szTemp, sizeof(szTemp)); + if (RT_SUCCESS(rc)) + rc = RTStrDupEx(ppszRev, szTemp); + } - if (RT_FAILURE(rc) && ppszVer) - { + int rc2 = vbglR3CloseAdditionsWinStoragePath(hKey); + if (RT_SUCCESS(rc)) + rc = rc2; + + /* Clean up allocated strings on error. */ + if (RT_FAILURE(rc)) + { + if (ppszVer) RTStrFree(*ppszVer); - *ppszVer = NULL; - } + if (ppszVerExt) + RTStrFree(*ppszVerExt); + if (ppszRev) + RTStrFree(*ppszRev); } - rc = vbglR3CloseAdditionsWinStoragePath(hKey); } else { @@ -283,7 +289,7 @@ VBGLR3DECL(int) VbglR3GetAdditionsVersion(char **ppszVer, char **ppszVerEx, char * No registry entries found, return the version string compiled * into this binary. */ - rc = vbglR3GetAdditionsCompileTimeVersion(ppszVer, ppszVerEx, ppszRev); + rc = vbglR3GetAdditionsCompileTimeVersion(ppszVer, ppszVerExt, ppszRev); } return rc; @@ -291,7 +297,7 @@ VBGLR3DECL(int) VbglR3GetAdditionsVersion(char **ppszVer, char **ppszVerEx, char /* * On non-Windows platforms just return the compile-time version string. */ - return vbglR3GetAdditionsCompileTimeVersion(ppszVer, ppszVerEx, ppszRev); + return vbglR3GetAdditionsCompileTimeVersion(ppszVer, ppszVerExt, ppszRev); #endif /* !RT_OS_WINDOWS */ } @@ -309,7 +315,7 @@ VBGLR3DECL(int) VbglR3GetAdditionsInstallationPath(char **ppszPath) int rc; #ifdef RT_OS_WINDOWS HKEY hKey; - rc = vbglR3GetAdditionsWinStoragePath(&hKey); + rc = vbglR3QueryAdditionsWinStoragePath(&hKey); if (RT_SUCCESS(rc)) { /* Installation directory. */ diff --git a/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibSeamless.cpp b/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibSeamless.cpp index d7b100ae0..c82ed08ca 100644 --- a/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibSeamless.cpp +++ b/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibSeamless.cpp @@ -144,6 +144,10 @@ VBGLR3DECL(int) VbglR3SeamlessSendRects(uint32_t cRects, PRTRECT pRects) if (!cRects || !pRects) return VINF_SUCCESS; + AssertMsgReturn(cRects <= _1M, ("%u\n", cRects), VERR_OUT_OF_RANGE); + AssertReturn(sizeof(VMMDevVideoSetVisibleRegion)+(cRects-1)*sizeof(RTRECT) + == sizeof(VMMDevVideoSetVisibleRegion)+(uint64_t)(cRects-1)*sizeof(RTRECT), VERR_INVALID_PARAMETER); + rc = vbglR3GRAlloc((VMMDevRequestHeader **)&pReq, sizeof(VMMDevVideoSetVisibleRegion) + (cRects - 1) * sizeof(RTRECT), VMMDevReq_VideoSetVisibleRegion); diff --git a/src/VBox/Additions/common/VBoxService/VBoxServiceControlExec.cpp b/src/VBox/Additions/common/VBoxService/VBoxServiceControlExec.cpp index 136679fe8..0e5155ef5 100644 --- a/src/VBox/Additions/common/VBoxService/VBoxServiceControlExec.cpp +++ b/src/VBox/Additions/common/VBoxService/VBoxServiceControlExec.cpp @@ -864,6 +864,9 @@ static int VBoxServiceControlExecCreateProcess(const char *pszExec, const char * /* Process Main flag "ExecuteProcessFlag_Hidden". */ if (fFlags & RT_BIT(2)) uProcFlags = RTPROC_FLAGS_HIDDEN; + /* Process Main flag "ExecuteProcessFlag_NoProfile". */ + if (fFlags & RT_BIT(3)) + uProcFlags = RTPROC_FLAGS_NO_PROFILE; } /* If no user name specified run with current credentials (e.g. diff --git a/src/VBox/Additions/common/VBoxService/VBoxServiceVMInfo.cpp b/src/VBox/Additions/common/VBoxService/VBoxServiceVMInfo.cpp index 59f24e72b..85f17e5ef 100644 --- a/src/VBox/Additions/common/VBoxService/VBoxServiceVMInfo.cpp +++ b/src/VBox/Additions/common/VBoxService/VBoxServiceVMInfo.cpp @@ -189,19 +189,19 @@ static void vboxserviceVMInfoWriteFixedProperties(void) * Retrieve version information about Guest Additions and installed files (components). */ char *pszAddVer; - char *pszAddVerEx; + char *pszAddVerExt; char *pszAddRev; - rc = VbglR3GetAdditionsVersion(&pszAddVer, &pszAddVerEx, &pszAddRev); + rc = VbglR3GetAdditionsVersion(&pszAddVer, &pszAddVerExt, &pszAddRev); VBoxServiceWritePropF(g_uVMInfoGuestPropSvcClientID, "/VirtualBox/GuestAdd/Version", "%s", RT_FAILURE(rc) ? "" : pszAddVer); - VBoxServiceWritePropF(g_uVMInfoGuestPropSvcClientID, "/VirtualBox/GuestAdd/VersionEx", - "%s", RT_FAILURE(rc) ? "" : pszAddVerEx); + VBoxServiceWritePropF(g_uVMInfoGuestPropSvcClientID, "/VirtualBox/GuestAdd/VersionExt", + "%s", RT_FAILURE(rc) ? "" : pszAddVerExt); VBoxServiceWritePropF(g_uVMInfoGuestPropSvcClientID, "/VirtualBox/GuestAdd/Revision", "%s", RT_FAILURE(rc) ? "" : pszAddRev); if (RT_SUCCESS(rc)) { RTStrFree(pszAddVer); - RTStrFree(pszAddVerEx); + RTStrFree(pszAddVerExt); RTStrFree(pszAddRev); } diff --git a/src/VBox/Additions/linux/drm/vboxvideo_drm.c b/src/VBox/Additions/linux/drm/vboxvideo_drm.c index 8ac7896fc..b335f76eb 100644 --- a/src/VBox/Additions/linux/drm/vboxvideo_drm.c +++ b/src/VBox/Additions/linux/drm/vboxvideo_drm.c @@ -62,6 +62,14 @@ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27) +# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 32) +# ifdef RHEL_RELEASE_CODE +# if RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(6,1) +# define DRM_RHEL61 +# endif +# endif +# endif + #include "drm/drmP.h" #include "vboxvideo_drm.h" @@ -83,8 +91,8 @@ static struct drm_driver driver = /* .driver_features = DRIVER_USE_MTRR, */ .load = vboxvideo_driver_load, .reclaim_buffers = drm_core_reclaim_buffers, - /* As of Linux 2.65.37, always the internal functions are used. */ -#if LINUX_VERSION_CODE < KERNEL_VERSION (2, 6, 37) + /* As of Linux 2.6.37, always the internal functions are used. */ +#if LINUX_VERSION_CODE < KERNEL_VERSION (2, 6, 37) && !defined(DRM_RHEL61) .get_map_ofs = drm_core_get_map_ofs, .get_reg_ofs = drm_core_get_reg_ofs, #endif diff --git a/src/VBox/Additions/solaris/Installer/VBox.sh b/src/VBox/Additions/solaris/Installer/VBox.sh index 842cbc1fd..5beedbc52 100755 --- a/src/VBox/Additions/solaris/Installer/VBox.sh +++ b/src/VBox/Additions/solaris/Installer/VBox.sh @@ -2,7 +2,7 @@ # # VirtualBox startup script for Solaris Guests Additions # -# Copyright (C) 2008-2010 Oracle Corporation +# Copyright (C) 2008-2011 Oracle Corporation # # This file is part of VirtualBox Open Source Edition (OSE), as # available from http://www.virtualbox.org. This file is free software; @@ -22,27 +22,27 @@ # terms and conditions of either the GPL or the CDDL or both. # -CPUTYPE=`isainfo -k` -ISADIR="" -if test "$CPUTYPE" = "amd64"; then - ISADIR="amd64" +CURRENT_ISA=`isainfo -k` +if test "$CURRENT_ISA" = "amd64"; then + INSTALL_DIR="/opt/VirtualBoxAdditions/amd64" +else + INSTALL_DIR="/opt/VirtualBoxAdditions" fi -INSTALL_DIR="/opt/VirtualBoxAdditions" -APP=`which $0` -APP=`basename $APP` +APP=`basename $0` case "$APP" in - VBoxClient) - exec "$INSTALL_DIR/$ISADIR/VBoxClient" "$@" - ;; - VBoxService) - exec "$INSTALL_DIR/$ISADIR/VBoxService" "$@" - ;; - VBoxControl) - exec "$INSTALL_DIR/$ISADIR/VBoxControl" "$@" - ;; - *) - echo "Unknown application - $APP" - ;; + VBoxClient) + exec "$INSTALL_DIR/VBoxClient" "$@" + ;; + VBoxService) + exec "$INSTALL_DIR/VBoxService" "$@" + ;; + VBoxControl) + exec "$INSTALL_DIR/VBoxControl" "$@" + ;; + *) + echo "Unknown application - $APP" + exit 1 + ;; esac - +exit 0 diff --git a/src/VBox/Additions/solaris/Installer/postinstall.sh b/src/VBox/Additions/solaris/Installer/postinstall.sh index 98d3ebfad..467605307 100755 --- a/src/VBox/Additions/solaris/Installer/postinstall.sh +++ b/src/VBox/Additions/solaris/Installer/postinstall.sh @@ -22,6 +22,9 @@ # terms and conditions of either the GPL or the CDDL or both. # +LANG=C +export LANG + # uncompress(directory, file) # Updates package metadata and uncompresses the file. uncompress_file() @@ -214,8 +217,15 @@ if test ! -z "$xorgbin"; then # snv_163 drops 32-bit support completely, and uses 32-bit locations for the 64-bit stuff. Ugly. # We try to detect this by looking at bitness of "mouse_drv.so", and adjust our destination paths accordingly. - bitsize=`file $vboxmouse32_dest_base/mouse_drv.so | grep "32-bit"` - skip32="no" + # We do not rely on using Xorg -version's ABI output because some builds (snv_162 iirc) have 64-bit ABI with + # 32-bit file locations. + if test -f "$vboxmouse32_dest_base/mouse_drv.so"; then + bitsize=`file "$vboxmouse32_dest_base/mouse_drv.so" | grep -i "32-bit"` + skip32="no" + else + echo "* Warning mouse_drv.so missing. Assuming Xorg ABI is 64-bit..." + fi + if test -z "$bitsize"; then skip32="yes" vboxmouse64_dest_base=$vboxmouse32_dest_base diff --git a/src/VBox/Devices/Graphics/DevVGA.cpp b/src/VBox/Devices/Graphics/DevVGA.cpp index 3559771d2..7cf9bb460 100644 --- a/src/VBox/Devices/Graphics/DevVGA.cpp +++ b/src/VBox/Devices/Graphics/DevVGA.cpp @@ -5677,7 +5677,9 @@ static DECLCALLBACK(int) vgaR3Construct(PPDMDEVINS pDevIns, int iInstance, PCF "CustomVideoMode13\0" "CustomVideoMode14\0" "CustomVideoMode15\0" - "CustomVideoMode16\0")) + "CustomVideoMode16\0" + "MaxBiosXRes\0" + "MaxBiosYRes\0")) return PDMDEV_SET_ERROR(pDevIns, VERR_PDM_DEVINS_UNKNOWN_CFG_VALUES, N_("Invalid configuration for vga device")); @@ -6055,6 +6057,14 @@ static DECLCALLBACK(int) vgaR3Construct(PPDMDEVINS pDevIns, int iInstance, PCF AssertLogRelRCReturn(rc, rc); #ifdef VBE_NEW_DYN_LIST + + uint16_t maxBiosXRes; + rc = CFGMR3QueryU16Def(pCfg, "MaxBiosXRes", &maxBiosXRes, UINT16_MAX); + AssertLogRelRCReturn(rc, rc); + uint16_t maxBiosYRes; + rc = CFGMR3QueryU16Def(pCfg, "MaxBiosYRes", &maxBiosYRes, UINT16_MAX); + AssertLogRelRCReturn(rc, rc); + /* * Compute buffer size for the VBE BIOS Extra Data. */ @@ -6102,6 +6112,9 @@ static DECLCALLBACK(int) vgaR3Construct(PPDMDEVINS pDevIns, int iInstance, PCF * pixelWidth; if (reqSize >= pThis->vram_size) continue; + if ( mode_info_list[i].info.XResolution > maxBiosXRes + || mode_info_list[i].info.YResolution > maxBiosYRes) + continue; *pCurMode = mode_info_list[i]; vgaAdjustModeInfo(pThis, pCurMode); pCurMode++; @@ -6133,6 +6146,9 @@ static DECLCALLBACK(int) vgaR3Construct(PPDMDEVINS pDevIns, int iInstance, PCF reqSize = pDefMode->info.XResolution * pDefMode->info.YResolution * pixelWidth; if (reqSize >= pThis->vram_size) continue; + if ( pDefMode->info.XResolution > maxBiosXRes + || pDefMode->info.YResolution - cyReduction > maxBiosYRes) + continue; *pCurMode = *pDefMode; pCurMode->mode += 0x30; pCurMode->info.YResolution -= cyReduction; diff --git a/src/VBox/Devices/Network/Pcap.cpp b/src/VBox/Devices/Network/Pcap.cpp index af8c357c3..2c33563d8 100644 --- a/src/VBox/Devices/Network/Pcap.cpp +++ b/src/VBox/Devices/Network/Pcap.cpp @@ -4,7 +4,7 @@ */ /* - * Copyright (C) 2006-2008 Oracle Corporation + * Copyright (C) 2006-2011 Oracle Corporation * * This file is part of VirtualBox Open Source Edition (OSE), as * available from http://www.virtualbox.org. This file is free software; @@ -58,7 +58,6 @@ struct pcaprec_hdr_init { uint32_t u32Magic; struct pcap_hdr pcap; - struct pcaprec_hdr rec0; }; @@ -69,11 +68,9 @@ static pcaprec_hdr_init const s_Hdr = { PCAP_MAGIC, { 2, 4, 0, 0, 0xffff, 1 }, - /* force ethereal to start at 0.000000. */ - { 0, 1, 0, 60 } - }; +static const char s_szDummyData[] = { 0, 0, 0, 0 }; /** * Internal helper. @@ -108,9 +105,9 @@ static void pcapUpdateHeader(struct pcaprec_hdr *pHdr, size_t cbFrame, size_t cb */ int PcapStreamHdr(PRTSTREAM pStream, uint64_t StartNanoTS) { - pcaprec_hdr_init Hdr = s_Hdr; - pcapCalcHeader(&Hdr.rec0, StartNanoTS, 60, 0); - return RTStrmWrite(pStream, &Hdr, sizeof(Hdr)); + int rc1 = RTStrmWrite(pStream, &s_Hdr, sizeof(s_Hdr)); + int rc2 = PcapStreamFrame(pStream, StartNanoTS, s_szDummyData, 60, sizeof(s_szDummyData)); + return RT_SUCCESS(rc1) ? rc2 : rc1; } @@ -188,9 +185,9 @@ int PcapStreamGsoFrame(PRTSTREAM pStream, uint64_t StartNanoTS, PCPDMNETWORKGSO */ int PcapFileHdr(RTFILE File, uint64_t StartNanoTS) { - pcaprec_hdr_init Hdr = s_Hdr; - pcapCalcHeader(&Hdr.rec0, StartNanoTS, 60, 0); - return RTFileWrite(File, &Hdr, sizeof(Hdr), NULL); + int rc1 = RTFileWrite(File, &s_Hdr, sizeof(s_Hdr), NULL); + int rc2 = PcapFileFrame(File, StartNanoTS, s_szDummyData, 60, sizeof(s_szDummyData)); + return RT_SUCCESS(rc1) ? rc2 : rc1; } diff --git a/src/VBox/Devices/PC/DevACPI.cpp b/src/VBox/Devices/PC/DevACPI.cpp index 30d6775d3..f83d1f8f1 100644 --- a/src/VBox/Devices/PC/DevACPI.cpp +++ b/src/VBox/Devices/PC/DevACPI.cpp @@ -198,7 +198,8 @@ typedef struct ACPIState uint16_t pm1a_ctl; /** Number of logical CPUs in guest */ uint16_t cCpus; - int64_t pm_timer_initial; + uint64_t u64PmTimerInitial; + uint64_t u64PmTimerLastSeen; PTMTIMERR3 tsR3; PTMTIMERR0 tsR0; PTMTIMERRC tsRC; @@ -1888,10 +1889,17 @@ PDMBOTHCBDECL(int) acpiPMTmrRead(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT Port if (cb == 4) { ACPIState *s = PDMINS_2_DATA(pDevIns, ACPIState *); - int64_t now = TMTimerGet(s->CTX_SUFF(ts)); - int64_t elapsed = now - s->pm_timer_initial; + uint64_t u64Now = TMTimerGet(s->CTX_SUFF(ts)); + uint64_t u64Seen; + do + { + u64Seen = ASMAtomicReadU64(&s->u64PmTimerLastSeen); + if (u64Now < u64Seen) + u64Now = u64Seen + 1; + } while (!ASMAtomicCmpXchgU64(&s->u64PmTimerLastSeen, u64Now, u64Seen)); - *pu32 = ASMMultU64ByU32DivByU32(elapsed, PM_TMR_FREQ, TMTimerGetFreq(s->CTX_SUFF(ts))); + uint64_t u64Elapsed = u64Now - s->u64PmTimerInitial; + *pu32 = ASMMultU64ByU32DivByU32(u64Elapsed, PM_TMR_FREQ, TMTimerGetFreq(s->CTX_SUFF(ts))); Log(("acpi: acpiPMTmrRead -> %#x\n", *pu32)); return VINF_SUCCESS; } @@ -2090,7 +2098,7 @@ static const SSMFIELD g_AcpiSavedStateFields4[] = SSMFIELD_ENTRY(ACPIState, pm1a_en), SSMFIELD_ENTRY(ACPIState, pm1a_sts), SSMFIELD_ENTRY(ACPIState, pm1a_ctl), - SSMFIELD_ENTRY(ACPIState, pm_timer_initial), + SSMFIELD_ENTRY(ACPIState, u64PmTimerInitial), SSMFIELD_ENTRY(ACPIState, gpe0_en), SSMFIELD_ENTRY(ACPIState, gpe0_sts), SSMFIELD_ENTRY(ACPIState, uBatteryIndex), @@ -2110,7 +2118,7 @@ static const SSMFIELD g_AcpiSavedStateFields5[] = SSMFIELD_ENTRY(ACPIState, pm1a_en), SSMFIELD_ENTRY(ACPIState, pm1a_sts), SSMFIELD_ENTRY(ACPIState, pm1a_ctl), - SSMFIELD_ENTRY(ACPIState, pm_timer_initial), + SSMFIELD_ENTRY(ACPIState, u64PmTimerInitial), SSMFIELD_ENTRY(ACPIState, gpe0_en), SSMFIELD_ENTRY(ACPIState, gpe0_sts), SSMFIELD_ENTRY(ACPIState, uBatteryIndex), @@ -2129,7 +2137,7 @@ static const SSMFIELD g_AcpiSavedStateFields6[] = SSMFIELD_ENTRY(ACPIState, pm1a_en), SSMFIELD_ENTRY(ACPIState, pm1a_sts), SSMFIELD_ENTRY(ACPIState, pm1a_ctl), - SSMFIELD_ENTRY(ACPIState, pm_timer_initial), + SSMFIELD_ENTRY(ACPIState, u64PmTimerInitial), SSMFIELD_ENTRY(ACPIState, gpe0_en), SSMFIELD_ENTRY(ACPIState, gpe0_sts), SSMFIELD_ENTRY(ACPIState, uBatteryIndex), @@ -2548,7 +2556,7 @@ static DECLCALLBACK(void) acpiReset(PPDMDEVINS pDevIns) s->pm1a_en = 0; s->pm1a_sts = 0; s->pm1a_ctl = 0; - s->pm_timer_initial = TMTimerGet(s->CTX_SUFF(ts)); + s->u64PmTimerInitial = TMTimerGet(s->CTX_SUFF(ts)); acpiPMTimerReset(s); s->uBatteryIndex = 0; s->uSystemInfoIndex = 0; @@ -2832,7 +2840,7 @@ static DECLCALLBACK(int) acpiConstruct(PPDMDEVINS pDevIns, int iInstance, PCFGMN s->tsR0 = TMTimerR0Ptr(s->tsR3); s->tsRC = TMTimerRCPtr(s->tsR3); - s->pm_timer_initial = TMTimerGet(s->tsR3); + s->u64PmTimerInitial = TMTimerGet(s->tsR3); acpiPMTimerReset(s); PCIDevSetVendorId(dev, 0x8086); /* Intel */ diff --git a/src/VBox/Devices/Storage/DevAHCI.cpp b/src/VBox/Devices/Storage/DevAHCI.cpp index 6cf04fe57..da2c39cea 100644 --- a/src/VBox/Devices/Storage/DevAHCI.cpp +++ b/src/VBox/Devices/Storage/DevAHCI.cpp @@ -652,10 +652,8 @@ typedef struct AHCI /** Number of usable ports on this controller. */ uint32_t cPortsImpl; - -#if HC_ARCH_BITS == 64 - uint32_t Alignment9; -#endif + /** Number of usable command slots for each port. */ + uint32_t cCmdSlotsAvail; /** Flag whether we have written the first 4bytes in an 8byte MMIO write successfully. */ volatile bool f8ByteMMIO4BytesWrittenSuccessfully; @@ -1985,7 +1983,7 @@ static void ahciHBAReset(PAHCI pThis) AHCI_HBA_CAP_SNCQ | /* Support native command queuing */ AHCI_HBA_CAP_SSS | /* Staggered spin up */ AHCI_HBA_CAP_CCCS | /* Support command completion coalescing */ - AHCI_HBA_CAP_NCS_SET(AHCI_NR_COMMAND_SLOTS) | /* Number of command slots we support */ + AHCI_HBA_CAP_NCS_SET(pThis->cCmdSlotsAvail) | /* Number of command slots we support */ AHCI_HBA_CAP_NP_SET(pThis->cPortsImpl); /* Number of supported ports */ pThis->regHbaCtrl = AHCI_HBA_CTRL_AE; pThis->regHbaIs = 0; @@ -2873,7 +2871,7 @@ static int ahciIdentifySS(PAHCIPort pAhciPort, void *pvBuf) p[103] = RT_H2LE_U16(pAhciPort->cTotalSectors >> 48); /* The following are SATA specific */ - p[75] = RT_H2LE_U16(31); /* We support 32 commands */ + p[75] = RT_H2LE_U16(pAhciPort->CTX_SUFF(pAhci)->cCmdSlotsAvail-1); /* Number of commands we support, 0's based */ p[76] = RT_H2LE_U16((1 << 8) | (1 << 2)); /* Native command queuing and Serial ATA Gen2 (3.0 Gbps) speed supported */ uint32_t uCsum = ataChecksum(p, 510); @@ -7740,7 +7738,8 @@ static DECLCALLBACK(int) ahciR3Construct(PPDMDEVINS pDevIns, int iInstance, PCFG "SecondarySlave\0" "PortCount\0" "UseAsyncInterfaceIfAvailable\0" - "Bootable\0")) + "Bootable\0" + "CmdSlotsAvail\0")) return PDMDEV_SET_ERROR(pDevIns, VERR_PDM_DEVINS_UNKNOWN_CFG_VALUES, N_("AHCI configuration error: unknown option specified")); @@ -7780,6 +7779,20 @@ static DECLCALLBACK(int) ahciR3Construct(PPDMDEVINS pDevIns, int iInstance, PCFG return PDMDEV_SET_ERROR(pDevIns, rc, N_("AHCI configuration error: failed to read Bootable as boolean")); + rc = CFGMR3QueryU32Def(pCfg, "CmdSlotsAvail", &pThis->cCmdSlotsAvail, AHCI_NR_COMMAND_SLOTS); + if (RT_FAILURE(rc)) + return PDMDEV_SET_ERROR(pDevIns, rc, + N_("AHCI configuration error: failed to read CmdSlotsAvail as integer")); + Log(("%s: cCmdSlotsAvail=%u\n", __FUNCTION__, pThis->cCmdSlotsAvail)); + if (pThis->cCmdSlotsAvail > AHCI_NR_COMMAND_SLOTS) + return PDMDevHlpVMSetError(pDevIns, VERR_INVALID_PARAMETER, RT_SRC_POS, + N_("AHCI configuration error: CmdSlotsAvail=%u should not exceed %u"), + pThis->cPortsImpl, AHCI_NR_COMMAND_SLOTS); + if (pThis->cCmdSlotsAvail < 1) + return PDMDevHlpVMSetError(pDevIns, VERR_INVALID_PARAMETER, RT_SRC_POS, + N_("AHCI configuration error: CmdSlotsAvail=%u should be at least 1"), + pThis->cCmdSlotsAvail); + pThis->fR0Enabled = fR0Enabled; pThis->fGCEnabled = fGCEnabled; pThis->pDevInsR3 = pDevIns; diff --git a/src/VBox/Devices/USB/VUSBDevice.cpp b/src/VBox/Devices/USB/VUSBDevice.cpp index 1aa2fc1f2..49ffcb47f 100644 --- a/src/VBox/Devices/USB/VUSBDevice.cpp +++ b/src/VBox/Devices/USB/VUSBDevice.cpp @@ -57,8 +57,6 @@ typedef struct vusb_reset_args PFNVUSBRESETDONE pfnDone; /** User argument to pfnDone. */ void *pvUser; - /** The timer used to notify EMT. */ - PTMTIMER pTimer; } VUSBRESETARGS, *PVUSBRESETARGS; @@ -1167,8 +1165,6 @@ void vusbDevDestroy(PVUSBDEV pDev) { PVUSBRESETARGS pArgs = (PVUSBRESETARGS)pDev->pvResetArgs; Assert(pArgs->pDev == pDev); - TMR3TimerDestroy(pArgs->pTimer); - pArgs->pTimer = NULL; RTMemTmpFree(pArgs); pDev->hResetThread = NIL_RTTHREAD; @@ -1184,6 +1180,7 @@ void vusbDevDestroy(PVUSBDEV pDev) vusbDevDetach(pDev); RTMemFree(pDev->paIfStates); pDev->enmState = VUSB_DEVICE_STATE_DESTROYED; + TMR3TimerDestroy(pDev->pResetTimer); } @@ -1251,13 +1248,16 @@ static void vusbDevResetDone(PVUSBDEV pDev, int rc, PFNVUSBRESETDONE pfnDone, vo /** * Timer callback for doing reset completion. * + * @param pUsbIns The USB device instance. + * @param pTimer The timer instance. + * @param pvUser The VUSB device data. * @thread EMT */ -static DECLCALLBACK(void) vusbDevResetDoneTimer(void *pvUser) +static DECLCALLBACK(void) vusbDevResetDoneTimer(PPDMUSBINS pUsbIns, PTMTIMER pTimer, void *pvUser) { - PVUSBRESETARGS pArgs = (PVUSBRESETARGS)pvUser; - PVUSBDEV pDev = pArgs->pDev; - Assert(pDev->pvResetArgs == pArgs); + PVUSBDEV pDev = (PVUSBDEV)pvUser; + PVUSBRESETARGS pArgs = (PVUSBRESETARGS)pDev->pvResetArgs; + AssertPtr(pArgs); Assert(pArgs->pDev == pDev); Assert(pDev->pUsbIns == pUsbIns); /* * Release the thread and update the device structure. @@ -1265,14 +1265,13 @@ static DECLCALLBACK(void) vusbDevResetDoneTimer(void *pvUser) int rc = RTThreadWait(pDev->hResetThread, 2, NULL); AssertRC(rc); pDev->hResetThread = NIL_RTTHREAD; - pDev->pvResetArgs = NULL; + pDev->pvResetArgs = NULL; /* * Reset-done processing and cleanup. */ vusbDevResetDone(pArgs->pDev, pArgs->rc, pArgs->pfnDone, pArgs->pvUser); - TMR3TimerDestroy(pArgs->pTimer); RTMemTmpFree(pArgs); } @@ -1290,22 +1289,23 @@ static DECLCALLBACK(void) vusbDevResetDoneTimer(void *pvUser) static DECLCALLBACK(int) vusbDevResetThread(RTTHREAD Thread, void *pvUser) { PVUSBRESETARGS pArgs = (PVUSBRESETARGS)pvUser; + PVUSBDEV pDev = pArgs->pDev; LogFlow(("vusb: reset thread started\n")); /* * Tell EMT that we're in flow and then perform the reset. */ - uint64_t u64EndTS = TMTimerGet(pArgs->pTimer) + TMTimerFromMilli(pArgs->pTimer, 10); + uint64_t u64EndTS = TMTimerGet(pDev->pResetTimer) + TMTimerFromMilli(pDev->pResetTimer, 10); RTThreadUserSignal(Thread); - int rc = pArgs->rc = vusbDevResetWorker(pArgs->pDev, pArgs->fResetOnLinux); + int rc = pArgs->rc = vusbDevResetWorker(pDev, pArgs->fResetOnLinux); /* * We use a timer to communicate the result back to EMT. * This avoids suspend + poweroff issues, and it should give * us more accurate scheduling than making this thread sleep. */ - int rc2 = TMTimerSet(pArgs->pTimer, u64EndTS); + int rc2 = TMTimerSet(pDev->pResetTimer, u64EndTS); AssertReleaseRC(rc2); LogFlow(("vusb: reset thread exiting, rc=%Rrc\n", rc)); @@ -1317,7 +1317,7 @@ static DECLCALLBACK(int) vusbDevResetThread(RTTHREAD Thread, void *pvUser) * Resets a device. * * Since a device reset shall take at least 10ms from the guest point of view, - * it must be performed asynchronously. We create a thread which performs this + * it must be performed asynchronously. We create a thread which performs this * operation and ensures it will take at least 10ms. * * At times - like init - a synchronous reset is required, this can be done @@ -1370,27 +1370,22 @@ DECLCALLBACK(int) vusbDevReset(PVUSBIDEVICE pDevice, bool fResetOnLinux, PFNVUSB PVUSBRESETARGS pArgs = (PVUSBRESETARGS)RTMemTmpAlloc(sizeof(*pArgs)); if (pArgs) { - pArgs->pTimer = TMR3TimerCreateExternal(pVM, TMCLOCK_VIRTUAL, vusbDevResetDoneTimer, pArgs, "USB Device Reset Timer."); - if (pArgs->pTimer) + pDev->pvResetArgs = pArgs; + pArgs->pDev = pDev; + pArgs->fResetOnLinux = fResetOnLinux; + pArgs->rc = VERR_INTERNAL_ERROR; + pArgs->pfnDone = pfnDone; + pArgs->pvUser = pvUser; + int rc = RTThreadCreate(&pDev->hResetThread, vusbDevResetThread, pArgs, 0, RTTHREADTYPE_IO, RTTHREADFLAGS_WAITABLE, "USBRESET"); + if (RT_SUCCESS(rc)) { - pDev->pvResetArgs = pArgs; - pArgs->pDev = pDev; - pArgs->fResetOnLinux = fResetOnLinux; - pArgs->rc = VERR_INTERNAL_ERROR; - pArgs->pfnDone = pfnDone; - pArgs->pvUser = pvUser; - int rc = RTThreadCreate(&pDev->hResetThread, vusbDevResetThread, pArgs, 0, RTTHREADTYPE_IO, RTTHREADFLAGS_WAITABLE, "USBRESET"); - if (RT_SUCCESS(rc)) - { - /* give the thread a chance to get started. */ - RTThreadUserWait(pDev->hResetThread, 2); - return rc; - } - - pDev->pvResetArgs = NULL; - pDev->hResetThread = NIL_RTTHREAD; - TMR3TimerDestroy(pArgs->pTimer); + /* give the thread a chance to get started. */ + RTThreadUserWait(pDev->hResetThread, 2); + return rc; } + + pDev->pvResetArgs = NULL; + pDev->hResetThread = NIL_RTTHREAD; RTMemTmpFree(pArgs); } /* fall back to sync on failure */ @@ -1553,6 +1548,14 @@ int vusbDevInit(PVUSBDEV pDev, PPDMUSBINS pUsbIns) memset(&pDev->aPipes[0], 0, sizeof(pDev->aPipes)); pDev->hResetThread = NIL_RTTHREAD; pDev->pvResetArgs = NULL; + pDev->pResetTimer = NULL; + + /* + * Create the reset timer. + */ + int rc = PDMUsbHlpTMTimerCreate(pUsbIns, TMCLOCK_VIRTUAL, vusbDevResetDoneTimer, pDev, 0 /*fFlags*/, + "USB Device Reset Timer", &pDev->pResetTimer); + AssertRCReturn(rc, rc); /* * Get the descriptor cache from the device. (shall cannot fail) diff --git a/src/VBox/Devices/USB/VUSBInternal.h b/src/VBox/Devices/USB/VUSBInternal.h index aeadca228..c325a7ab1 100644 --- a/src/VBox/Devices/USB/VUSBInternal.h +++ b/src/VBox/Devices/USB/VUSBInternal.h @@ -211,6 +211,8 @@ typedef struct VUSBDEV RTTHREAD hResetThread; /** Pointer to the reset thread arguments. */ void *pvResetArgs; + /** The reset timer handle. */ + PTMTIMER pResetTimer; } VUSBDEV; @@ -337,6 +339,9 @@ typedef struct VUSBROOTHUB /** The HUB. * @todo remove this? */ VUSBHUB Hub; +#if HC_ARCH_BITS == 32 + uint32_t Alignment0; +#endif /** Address hash table. */ PVUSBDEV apAddrHash[VUSB_ADDR_HASHSZ]; /** List of async URBs. */ @@ -353,9 +358,6 @@ typedef struct VUSBROOTHUB /** Chain of devices attached to this hub. */ PVUSBDEV pDevices; -#if HC_ARCH_BITS == 32 -// uint32_t Alignment0; -#endif /** Availability Bitmap. */ VUSBPORTBITMAP Bitmap; diff --git a/src/VBox/Devices/VMMDev/VMMDev.cpp b/src/VBox/Devices/VMMDev/VMMDev.cpp index bd9f65e81..a7ca0ca03 100644 --- a/src/VBox/Devices/VMMDev/VMMDev.cpp +++ b/src/VBox/Devices/VMMDev/VMMDev.cpp @@ -1489,10 +1489,11 @@ static DECLCALLBACK(int) vmmdevRequestHandler(PPDMDEVINS pDevIns, void *pvUser, Log(("VMMDevReq_VideoSetVisibleRegion no rectangles!!!\n")); pRequestHeader->rc = VERR_INVALID_PARAMETER; } - else - if (pRequestHeader->size != sizeof(VMMDevVideoSetVisibleRegion) + (ptr->cRect-1)*sizeof(RTRECT)) + else if ( ptr->cRect > _1M /* restrict to sane range */ + || pRequestHeader->size != sizeof(VMMDevVideoSetVisibleRegion) + ptr->cRect * sizeof(RTRECT) - sizeof(RTRECT)) { - Log(("VMMDevReq_VideoSetVisibleRegion request size too small!!!\n")); + Log(("VMMDevReq_VideoSetVisibleRegion: cRects=%#x doesn't match size=%#x or is out of bounds\n", + ptr->cRect, pRequestHeader->size)); pRequestHeader->rc = VERR_INVALID_PARAMETER; } else diff --git a/src/VBox/Devices/testcase/tstDeviceStructSizeRC.cpp b/src/VBox/Devices/testcase/tstDeviceStructSizeRC.cpp index bfff101b7..1bee096f5 100644 --- a/src/VBox/Devices/testcase/tstDeviceStructSizeRC.cpp +++ b/src/VBox/Devices/testcase/tstDeviceStructSizeRC.cpp @@ -449,7 +449,7 @@ int main() GEN_CHECK_OFF(ACPIState, pm1a_en); GEN_CHECK_OFF(ACPIState, pm1a_sts); GEN_CHECK_OFF(ACPIState, pm1a_ctl); - GEN_CHECK_OFF(ACPIState, pm_timer_initial); + GEN_CHECK_OFF(ACPIState, u64PmTimerInitial); GEN_CHECK_OFF(ACPIState, tsR3); GEN_CHECK_OFF(ACPIState, tsR0); GEN_CHECK_OFF(ACPIState, tsRC); @@ -907,6 +907,9 @@ int main() GEN_CHECK_OFF(EHCIROOTHUB, pIDev); GEN_CHECK_OFF(EHCIROOTHUB, IBase); GEN_CHECK_OFF(EHCIROOTHUB, IRhPort); + GEN_CHECK_OFF(EHCIROOTHUB, Led); + GEN_CHECK_OFF(EHCIROOTHUB, ILeds); + GEN_CHECK_OFF(EHCIROOTHUB, pLedsConnector); GEN_CHECK_OFF(EHCIROOTHUB, status); GEN_CHECK_OFF(EHCIROOTHUB, desc_a); GEN_CHECK_OFF(EHCIROOTHUB, desc_b); @@ -924,11 +927,24 @@ int main() GEN_CHECK_OFF(EHCI, pDevInsR3); GEN_CHECK_OFF(EHCI, pDevInsR0); GEN_CHECK_OFF(EHCI, pDevInsRC); + GEN_CHECK_OFF(EHCI, MMIOBase); GEN_CHECK_OFF(EHCI, SofTime); GEN_CHECK_OFF(EHCI, RootHub); + GEN_CHECK_OFF(EHCI, cap_length); + GEN_CHECK_OFF(EHCI, hci_version); + GEN_CHECK_OFF(EHCI, hcs_params); + GEN_CHECK_OFF(EHCI, hcc_params); + GEN_CHECK_OFF(EHCI, cmd); GEN_CHECK_OFF(EHCI, intr_status); GEN_CHECK_OFF(EHCI, intr); + GEN_CHECK_OFF(EHCI, frame_idx); + GEN_CHECK_OFF(EHCI, ds_segment); + GEN_CHECK_OFF(EHCI, periodic_list_base); + GEN_CHECK_OFF(EHCI, async_list_base); + GEN_CHECK_OFF(EHCI, config); + GEN_CHECK_OFF(EHCI, uIrqInterval); GEN_CHECK_OFF(EHCI, HcFmNumber); + GEN_CHECK_OFF(EHCI, uFramesPerTimerCall); GEN_CHECK_OFF(EHCI, cTicksPerFrame); GEN_CHECK_OFF(EHCI, cTicksPerUsbTick); GEN_CHECK_OFF(EHCI, cInFlight); @@ -936,6 +952,7 @@ int main() GEN_CHECK_OFF(EHCI, aInFlight[0].GCPhysTD); GEN_CHECK_OFF(EHCI, aInFlight[0].pUrb); GEN_CHECK_OFF(EHCI, aInFlight[1]); + GEN_CHECK_OFF(EHCI, aInFlight[256]); GEN_CHECK_OFF(EHCI, pLoad); GEN_CHECK_OFF(EHCI, fAsyncTraversalTimerActive); # ifdef VBOX_WITH_STATISTICS @@ -944,6 +961,17 @@ int main() GEN_CHECK_OFF(EHCI, StatDroppedUrbs); GEN_CHECK_OFF(EHCI, StatTimer); # endif + GEN_CHECK_OFF(EHCI, SavedStateEnd); + GEN_CHECK_OFF(EHCI, u64TimerHz); + GEN_CHECK_OFF(EHCI, cIdleCycles); + GEN_CHECK_OFF(EHCI, uFrameRate); + GEN_CHECK_OFF(EHCI, fIdle); + GEN_CHECK_OFF(EHCI, pEOFTimerSyncR3); + GEN_CHECK_OFF(EHCI, pEOFTimerSyncR0); + GEN_CHECK_OFF(EHCI, pEOFTimerSyncRC); + GEN_CHECK_OFF(EHCI, pEOFTimerNoSyncRC); + GEN_CHECK_OFF(EHCI, pEOFTimerNoSyncR3); + GEN_CHECK_OFF(EHCI, pEOFTimerNoSyncR0); # endif /* VBOX_WITH_EHCI */ #endif /* VBOX_WITH_USB */ @@ -1271,6 +1299,7 @@ int main() GEN_CHECK_OFF(AHCI, fSignalIdle); GEN_CHECK_OFF(AHCI, fBootable); GEN_CHECK_OFF(AHCI, cPortsImpl); + GEN_CHECK_OFF(AHCI, cCmdSlotsAvail); GEN_CHECK_OFF(AHCI, f8ByteMMIO4BytesWrittenSuccessfully); #endif /* VBOX_WITH_AHCI */ diff --git a/src/VBox/Frontends/Makefile.kmk b/src/VBox/Frontends/Makefile.kmk index bef60be9d..45c9f2b4f 100644 --- a/src/VBox/Frontends/Makefile.kmk +++ b/src/VBox/Frontends/Makefile.kmk @@ -23,7 +23,7 @@ ifdef VBOX_WITH_MAIN include $(PATH_SUB_CURRENT)/VBoxManage/Makefile.kmk endif ifndef VBOX_ONLY_DOCS - ifndef VBOX_OSE + ifdef VBOX_WITH_MAIN include $(PATH_SUB_CURRENT)/VBoxBalloonCtrl/Makefile.kmk endif ifdef VBOX_WITH_VBOXSDL diff --git a/src/VBox/Frontends/VBoxBFE/VBoxBFE.cpp b/src/VBox/Frontends/VBoxBFE/VBoxBFE.cpp index d798924dd..65ca87f29 100644 --- a/src/VBox/Frontends/VBoxBFE/VBoxBFE.cpp +++ b/src/VBox/Frontends/VBoxBFE/VBoxBFE.cpp @@ -1381,7 +1381,7 @@ static DECLCALLBACK(int) vboxbfeConfigConstructor(PVM pVM, void *pvUser) /* * PDM. */ - rc = PDMR3RegisterDrivers(pVM, VBoxDriversRegister); UPDATE_RC(); + rc = PDMR3DrvStaticRegistration(pVM, VBoxDriversRegister); UPDATE_RC(); /* * Devices diff --git a/src/VBox/Frontends/VBoxManage/VBoxManageGuestCtrl.cpp b/src/VBox/Frontends/VBoxManage/VBoxManageGuestCtrl.cpp index 75fe0ae71..c42129fba 100644 --- a/src/VBox/Frontends/VBoxManage/VBoxManageGuestCtrl.cpp +++ b/src/VBox/Frontends/VBoxManage/VBoxManageGuestCtrl.cpp @@ -363,6 +363,8 @@ static int handleCtrlExecProgram(HandlerArg *a) /** @todo Add a hidden flag. */ if (!RTStrICmp(ValueUnion.psz, "ignoreorphanedprocesses")) uFlags |= ExecuteProcessFlag_IgnoreOrphanedProcesses; + else if (!RTStrICmp(ValueUnion.psz, "noprofile")) + uFlags |= ExecuteProcessFlag_NoProfile; else fUsageOK = false; break; diff --git a/src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp b/src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp index cb77bbfd6..4c9344919 100644 --- a/src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp +++ b/src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp @@ -136,7 +136,7 @@ void printUsage(USAGECATEGORY u64Cmd, PRTSTREAM pStrm) "VBoxManage createvm --name \n" " [--ostype ]\n" " [--register]\n" - " [--basefolder | --settingsfile ]\n" + " [--basefolder ]\n" " [--uuid ]\n" "\n"); diff --git a/src/VBox/Frontends/VBoxManage/VBoxManageMisc.cpp b/src/VBox/Frontends/VBoxManage/VBoxManageMisc.cpp index 04315d0ec..f999db8ec 100644 --- a/src/VBox/Frontends/VBoxManage/VBoxManageMisc.cpp +++ b/src/VBox/Frontends/VBoxManage/VBoxManageMisc.cpp @@ -889,7 +889,7 @@ int handleExtPack(HandlerArg *a) static const RTGETOPTDEF s_aUninstallOptions[] = { - { "--forced", 'f', RTGETOPT_REQ_NOTHING }, + { "--force", 'f', RTGETOPT_REQ_NOTHING }, }; RTGetOptInit(&GetState, a->argc, a->argv, s_aUninstallOptions, RT_ELEMENTS(s_aUninstallOptions), 1, 0); diff --git a/src/VBox/Frontends/VBoxShell/vboxshell.py b/src/VBox/Frontends/VBoxShell/vboxshell.py index 416330d4c..f1a658341 100755 --- a/src/VBox/Frontends/VBoxShell/vboxshell.py +++ b/src/VBox/Frontends/VBoxShell/vboxshell.py @@ -1,6 +1,6 @@ #!/usr/bin/python # -# Copyright (C) 2009-2010 Oracle Corporation +# Copyright (C) 2009-2011 Oracle Corporation # # This file is part of VirtualBox Open Source Edition (OSE), as # available from http://www.virtualbox.org. This file is free software; @@ -207,10 +207,10 @@ def colSize(ctx,m): def colSizeM(ctx,m): return colored(str(m)+'M', 'red') -def createVm(ctx,name,kind,base): +def createVm(ctx,name,kind): mgr = ctx['mgr'] vb = ctx['vb'] - mach = vb.createMachine(name, kind, base, "", False) + mach = vb.createMachine("", name, kind, "", False) mach.saveSettings() print "created machine with UUID",mach.id vb.registerMachine(mach) @@ -1033,21 +1033,17 @@ def startCmd(ctx, args): return 0 def createVmCmd(ctx, args): - if (len(args) < 3 or len(args) > 4): - print "usage: createvm name ostype " + if (len(args) != 3): + print "usage: createvm name ostype" return 0 name = args[1] oskind = args[2] - if len(args) == 4: - base = args[3] - else: - base = '' try: ctx['vb'].getGuestOSType(oskind) except Exception, e: print 'Unknown OS type:',oskind return 0 - createVm(ctx, name, oskind, base) + createVm(ctx, name, oskind) return 0 def ginfoCmd(ctx,args): diff --git a/src/VBox/Frontends/VirtualBox/src/extensions/QITreeWidget.cpp b/src/VBox/Frontends/VirtualBox/src/extensions/QITreeWidget.cpp index 56aa83560..e03966a78 100644 --- a/src/VBox/Frontends/VirtualBox/src/extensions/QITreeWidget.cpp +++ b/src/VBox/Frontends/VirtualBox/src/extensions/QITreeWidget.cpp @@ -29,6 +29,12 @@ QITreeWidget::QITreeWidget (QWidget *aParent) { } +void QITreeWidget::setSizeHintForItems(const QSize &sizeHint) +{ + for (int i = 0; i < topLevelItemCount(); ++i) + topLevelItem(i)->setSizeHint(0, sizeHint); +} + void QITreeWidget::paintEvent (QPaintEvent *aEvent) { /* Opens Items Painter */ @@ -59,13 +65,3 @@ void QITreeWidget::resizeEvent (QResizeEvent *aEvent) emit resized (aEvent->size(), aEvent->oldSize()); } -void QITreeWidget::addTopBottomMarginToItems (int aMargin) -{ - for (int i = 0; i < topLevelItemCount(); ++ i) - { - QTreeWidgetItem *item = topLevelItem (i); - QSize s = item->sizeHint (0); - item->setSizeHint (0, QSize (s.width(), s.height() + 2 * aMargin)); - } -} - diff --git a/src/VBox/Frontends/VirtualBox/src/extensions/QITreeWidget.h b/src/VBox/Frontends/VirtualBox/src/extensions/QITreeWidget.h index 11f656ffe..88de169e0 100644 --- a/src/VBox/Frontends/VirtualBox/src/extensions/QITreeWidget.h +++ b/src/VBox/Frontends/VirtualBox/src/extensions/QITreeWidget.h @@ -33,7 +33,7 @@ public: QITreeWidget (QWidget *aParent = 0); - void addTopBottomMarginToItems (int aMargin); + void setSizeHintForItems(const QSize &sizeHint); signals: diff --git a/src/VBox/Frontends/VirtualBox/src/globals/VBoxProblemReporter.cpp b/src/VBox/Frontends/VirtualBox/src/globals/VBoxProblemReporter.cpp index 25b5be84a..001345e4d 100644 --- a/src/VBox/Frontends/VirtualBox/src/globals/VBoxProblemReporter.cpp +++ b/src/VBox/Frontends/VirtualBox/src/globals/VBoxProblemReporter.cpp @@ -772,6 +772,14 @@ void VBoxProblemReporter::cannotDeleteMachine(const CMachine &machine) !machine.isOk() ? formatErrorInfo(machine) : formatErrorInfo(res)); } +void VBoxProblemReporter::cannotDeleteMachine(const CMachine &machine, const CProgress &progress) +{ + message(mainWindowShown(), + Error, + tr("Failed to remove the virtual machine %1.").arg(machine.GetName()), + formatErrorInfo(progress.GetErrorInfo())); +} + void VBoxProblemReporter::cannotDiscardSavedState (const CConsole &console) { /* preserve the current error info before calling the object again */ diff --git a/src/VBox/Frontends/VirtualBox/src/globals/VBoxProblemReporter.h b/src/VBox/Frontends/VirtualBox/src/globals/VBoxProblemReporter.h index 2fafd7364..8876017b3 100644 --- a/src/VBox/Frontends/VirtualBox/src/globals/VBoxProblemReporter.h +++ b/src/VBox/Frontends/VirtualBox/src/globals/VBoxProblemReporter.h @@ -201,6 +201,7 @@ public: void cannotStopMachine (const CConsole &console); void cannotStopMachine (const CProgress &progress); void cannotDeleteMachine (const CMachine &machine); + void cannotDeleteMachine(const CMachine &machine, const CProgress &progress); void cannotDiscardSavedState (const CConsole &console); void cannotSendACPIToMachine(); diff --git a/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineViewNormal.cpp b/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineViewNormal.cpp index a76c48745..b210fd4a9 100644 --- a/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineViewNormal.cpp +++ b/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineViewNormal.cpp @@ -320,6 +320,7 @@ void UIMachineViewNormal::setGuestAutoresizeEnabled(bool fEnabled) void UIMachineViewNormal::normalizeGeometry(bool bAdjustPosition) { +#ifndef VBOX_GUI_WITH_CUSTOMIZATIONS1 QWidget *pTopLevelWidget = window(); /* Make no normalizeGeometry in case we are in manual resize mode or main window is maximized: */ @@ -364,6 +365,10 @@ void UIMachineViewNormal::normalizeGeometry(bool bAdjustPosition) /* Finally, set the frame geometry */ pTopLevelWidget->setGeometry(frameGeo.left() + dl, frameGeo.top() + dt, frameGeo.width() - dl - dr, frameGeo.height() - dt - db); + +#else /* !VBOX_GUI_WITH_CUSTOMIZATIONS1 */ + Q_UNUSED(bAdjustPosition); +#endif /* VBOX_GUI_WITH_CUSTOMIZATIONS1 */ } QRect UIMachineViewNormal::workingArea() diff --git a/src/VBox/Frontends/VirtualBox/src/selector/VBoxSelectorWnd.cpp b/src/VBox/Frontends/VirtualBox/src/selector/VBoxSelectorWnd.cpp index 008f16b75..e240da2eb 100644 --- a/src/VBox/Frontends/VirtualBox/src/selector/VBoxSelectorWnd.cpp +++ b/src/VBox/Frontends/VirtualBox/src/selector/VBoxSelectorWnd.cpp @@ -785,7 +785,7 @@ void VBoxSelectorWnd::vmDelete(const QString &aUuid /* = QString::null */) { vboxProblem().showModalProgressDialog(progress, item->name(), ":/progress_delete_90px.png", 0, true); if (progress.GetResultCode() != 0) - vboxProblem().cannotDeleteMachine(machine); + vboxProblem().cannotDeleteMachine(machine, progress); } } if (!machine.isOk()) diff --git a/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialog.cpp b/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialog.cpp index 8a7c1e862..c5032c97b 100644 --- a/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialog.cpp +++ b/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialog.cpp @@ -208,6 +208,11 @@ void UISettingsDialog::retranslateUi() else if (!m_fSilent) m_pWarningPane->setWarningText(m_strWarningHint); +#ifndef VBOX_GUI_WITH_TOOLBAR_SETTINGS + /* Retranslate current page headline: */ + m_pLbTitle->setText(m_pSelector->itemText(m_pSelector->currentId())); +#endif /* VBOX_GUI_WITH_TOOLBAR_SETTINGS */ + /* Get the list of validators: */ QList validatorsList = findChildren(); /* Retranslate all validators: */ diff --git a/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialogSpecific.cpp b/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialogSpecific.cpp index 901fa8bca..5bd98ced4 100644 --- a/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialogSpecific.cpp +++ b/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialogSpecific.cpp @@ -433,6 +433,9 @@ void UIGLSettingsDlg::putBackTo() void UIGLSettingsDlg::retranslateUi() { + /* Base-class UI translation: */ + UISettingsDialog::retranslateUi(); + /* Set dialog's name: */ setWindowTitle(title()); @@ -459,9 +462,6 @@ void UIGLSettingsDlg::retranslateUi() /* Translate the selector: */ m_pSelector->polish(); - - /* Base-class UI translation: */ - UISettingsDialog::retranslateUi(); } QString UIGLSettingsDlg::title() const @@ -767,13 +767,22 @@ void UIVMSettingsDlg::putBackTo() void UIVMSettingsDlg::retranslateUi() { - /* Set dialog's name: */ - setWindowTitle(title()); - - /* We have to make sure that the Serial & Network subpages are retranslated + /* We have to make sure that the Network, Serial & Parallel pages are retranslated * before they are revalidated. Cause: They do string comparing within - * vboxGlobal which is retranslated at that point already. */ + * vboxGlobal which is retranslated at that point already: */ QEvent event(QEvent::LanguageChange); + if (QWidget *pPage = m_pSelector->idToPage(VMSettingsPage_Network)) + qApp->sendEvent(pPage, &event); + if (QWidget *pPage = m_pSelector->idToPage(VMSettingsPage_Serial)) + qApp->sendEvent(pPage, &event); + if (QWidget *pPage = m_pSelector->idToPage(VMSettingsPage_Parallel)) + qApp->sendEvent(pPage, &event); + + /* Base-class UI translation: */ + UISettingsDialog::retranslateUi(); + + /* Set dialog's name: */ + setWindowTitle(title()); /* General page: */ m_pSelector->setItemText(VMSettingsPage_General, tr("General")); @@ -792,21 +801,15 @@ void UIVMSettingsDlg::retranslateUi() /* Network page: */ m_pSelector->setItemText(VMSettingsPage_Network, tr("Network")); - if (QWidget *pPage = m_pSelector->idToPage(VMSettingsPage_Network)) - qApp->sendEvent(pPage, &event); /* Ports page: */ m_pSelector->setItemText(VMSettingsPage_Ports, tr("Ports")); /* Serial page: */ m_pSelector->setItemText(VMSettingsPage_Serial, tr("Serial Ports")); - if (QWidget *pPage = m_pSelector->idToPage(VMSettingsPage_Serial)) - qApp->sendEvent(pPage, &event); /* Parallel page: */ m_pSelector->setItemText(VMSettingsPage_Parallel, tr("Parallel Ports")); - if (QWidget *pPage = m_pSelector->idToPage(VMSettingsPage_Parallel)) - qApp->sendEvent(pPage, &event); /* USB page: */ m_pSelector->setItemText(VMSettingsPage_USB, tr("USB")); @@ -816,18 +819,6 @@ void UIVMSettingsDlg::retranslateUi() /* Translate the selector: */ m_pSelector->polish(); - - /* Base-class UI translation: */ - UISettingsDialog::retranslateUi(); - - /* Revalidate all pages to retranslate the warning messages also: */ - QList validators = findChildren(); - for (int i = 0; i < validators.size(); ++i) - { - QIWidgetValidator *pValidator = validators[i]; - if (!pValidator->isValid()) - sltRevalidate(pValidator); - } } QString UIVMSettingsDlg::title() const diff --git a/src/VBox/Frontends/VirtualBox/src/settings/VBoxSettingsSelector.cpp b/src/VBox/Frontends/VirtualBox/src/settings/VBoxSettingsSelector.cpp index 6457522b8..ed11fcae5 100644 --- a/src/VBox/Frontends/VirtualBox/src/settings/VBoxSettingsSelector.cpp +++ b/src/VBox/Frontends/VirtualBox/src/settings/VBoxSettingsSelector.cpp @@ -284,15 +284,22 @@ void VBoxSettingsTreeViewSelector::setVisibleById (int aId, bool aShow) void VBoxSettingsTreeViewSelector::polish() { - mTwSelector->setFixedWidth (static_cast (mTwSelector) - ->sizeHintForColumn (treeWidget_Category) + 2 * mTwSelector->frameWidth()); - - /* Sort selector by the id column */ - mTwSelector->sortItems (treeWidget_Id, Qt::AscendingOrder); - mTwSelector->resizeColumnToContents (treeWidget_Category); - - /* Add some margin to every item in the tree */ - mTwSelector->addTopBottomMarginToItems (12); + /* Get recommended size hint: */ + int iItemWidth = static_cast(mTwSelector)->sizeHintForColumn(treeWidget_Category); + int iItemHeight = qMax(16 /* icon height */, mTwSelector->fontMetrics().height() /* text height */); + /* Add some margin to every item in the tree: */ + iItemHeight += 4 /* margin itself */ * 2 /* margin count */; + /* Set final size hint for items: */ + mTwSelector->setSizeHintForItems(QSize(iItemWidth , iItemHeight)); + + /* Fix selector width to minimum possible: */ + mTwSelector->setFixedWidth(iItemWidth + 2 * mTwSelector->frameWidth()); + + /* Sort selector by the id column: */ + mTwSelector->sortItems(treeWidget_Id, Qt::AscendingOrder); + + /* Resize column(s) to content: */ + mTwSelector->resizeColumnToContents(treeWidget_Category); } void VBoxSettingsTreeViewSelector::settingsGroupChanged (QTreeWidgetItem *aItem, diff --git a/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsGeneral.ui b/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsGeneral.ui index 8bbced3c3..b912b85d7 100644 --- a/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsGeneral.ui +++ b/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsGeneral.ui @@ -60,9 +60,6 @@ Displays the name of the virtual machine. - - - diff --git a/src/VBox/Frontends/VirtualBox/src/widgets/UIProgressDialog.cpp b/src/VBox/Frontends/VirtualBox/src/widgets/UIProgressDialog.cpp index a0ad930cf..03aad59dd 100644 --- a/src/VBox/Frontends/VirtualBox/src/widgets/UIProgressDialog.cpp +++ b/src/VBox/Frontends/VirtualBox/src/widgets/UIProgressDialog.cpp @@ -247,7 +247,7 @@ void UIProgressDialog::timerEvent(QTimerEvent * /* pEvent */) else if (days > 0) m_pEtaLbl->setText(strOneComp.arg(strDays)); else if (hours > 2) - m_pEtaLbl->setText(strTwoComp.arg(strHours)); + m_pEtaLbl->setText(strOneComp.arg(strHours)); else if (hours > 0 && minutes > 0) m_pEtaLbl->setText(strTwoComp.arg(strHours).arg(strMinutes)); else if (hours > 0) diff --git a/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UINewVMWzd.cpp b/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UINewVMWzd.cpp index 996cddc81..0cf29f758 100644 --- a/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UINewVMWzd.cpp +++ b/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UINewVMWzd.cpp @@ -49,7 +49,7 @@ static const osTypePattern gs_OSTypePattern[] = { QRegExp("(Wi.*NT)|(NT4)", Qt::CaseInsensitive), "WindowsNT4" }, { QRegExp("((Wi.*XP)|(\\bXP\\b)).*64", Qt::CaseInsensitive), "WindowsXP_64" }, { QRegExp("(Wi.*XP)|(\\bXP\\b)", Qt::CaseInsensitive), "WindowsXP" }, - { QRegExp("((Wi.*2003)|(W2K3).*64", Qt::CaseInsensitive), "Windows2003_64" }, + { QRegExp("((Wi.*2003)|(W2K3)).*64", Qt::CaseInsensitive), "Windows2003_64" }, { QRegExp("(Wi.*2003)|(W2K3)", Qt::CaseInsensitive), "Windows2003" }, { QRegExp("((Wi.*V)|(Vista)).*64", Qt::CaseInsensitive), "WindowsVista_64" }, { QRegExp("(Wi.*V)|(Vista)", Qt::CaseInsensitive), "WindowsVista" }, diff --git a/src/VBox/HostDrivers/Support/SUPR3HardenedVerify.cpp b/src/VBox/HostDrivers/Support/SUPR3HardenedVerify.cpp index f11412f5f..bd820bace 100644 --- a/src/VBox/HostDrivers/Support/SUPR3HardenedVerify.cpp +++ b/src/VBox/HostDrivers/Support/SUPR3HardenedVerify.cpp @@ -1186,6 +1186,11 @@ static int supR3HardenedVerifyFsObject(PCSUPR3HARDENEDFSOBJSTATE pFsObjState, bo full access. So, to work around we relax the hardening a bit and permit grand parents and beyond to be group writable by admin. */ if (pFsObjState->Stat.st_gid != 80 /*admin*/) /** @todo dynamically resolve the admin group? */ +#endif +#ifdef RT_OS_FREEBSD + /* PC-BSD 9 has group-writable application directory, similar to OSX and + their Applications directory */ + if (pFsObjState->Stat.st_gid != 5 /*operators*/) /* Allow operators group-writes */ #endif return supR3HardenedSetError3(VERR_SUPLIB_WRITE_NON_SYS_GROUP, pErrInfo, "The group is not a system group and it has write access to '", pszPath, "'"); diff --git a/src/VBox/HostDrivers/Support/freebsd/Makefile b/src/VBox/HostDrivers/Support/freebsd/Makefile index 4fda0f866..9b0050fc5 100644 --- a/src/VBox/HostDrivers/Support/freebsd/Makefile +++ b/src/VBox/HostDrivers/Support/freebsd/Makefile @@ -85,6 +85,8 @@ SRCS += \ .PATH: ${.CURDIR}/common/string SRCS += \ RTStrCopyP.c \ + RTStrCopy.c \ + RTStrNCmp.c \ strformat.c \ strformatrt.c \ strformattype.c \ diff --git a/src/VBox/HostDrivers/Support/freebsd/files_vboxdrv b/src/VBox/HostDrivers/Support/freebsd/files_vboxdrv index ae2c1dd82..aa585e176 100755 --- a/src/VBox/HostDrivers/Support/freebsd/files_vboxdrv +++ b/src/VBox/HostDrivers/Support/freebsd/files_vboxdrv @@ -110,6 +110,8 @@ FILES_VBOXDRV_NOBIN=" \ ${PATH_ROOT}/src/VBox/Runtime/common/misc/once.cpp=>common/misc/once.c \ ${PATH_ROOT}/src/VBox/Runtime/common/misc/thread.cpp=>common/misc/thread.c \ ${PATH_ROOT}/src/VBox/Runtime/common/string/RTStrCopyP.cpp=>common/string/RTStrCopyP.c \ + ${PATH_ROOT}/src/VBox/Runtime/common/string/RTStrCopy.cpp=>common/string/RTStrCopy.c \ + ${PATH_ROOT}/src/VBox/Runtime/common/string/RTStrNCmp.cpp=>common/string/RTStrNCmp.c \ ${PATH_ROOT}/src/VBox/Runtime/common/string/strformat.cpp=>common/string/strformat.c \ ${PATH_ROOT}/src/VBox/Runtime/common/string/strformatrt.cpp=>common/string/strformatrt.c \ ${PATH_ROOT}/src/VBox/Runtime/common/string/strformattype.cpp=>common/string/strformattype.c \ diff --git a/src/VBox/HostDrivers/Support/linux/SUPLib-linux.cpp b/src/VBox/HostDrivers/Support/linux/SUPLib-linux.cpp index 0d8f86518..9d31b7f58 100644 --- a/src/VBox/HostDrivers/Support/linux/SUPLib-linux.cpp +++ b/src/VBox/HostDrivers/Support/linux/SUPLib-linux.cpp @@ -266,11 +266,16 @@ int suplibOsQueryVTxSupported(void) rc = RTStrToUInt32Ex(szBuf, &pszNext, 10, &uA); if ( RT_SUCCESS(rc) - && *pszNext == '.') + && *pszNext == '.') { + /* + * new version number scheme starting with Linux 3.0 + */ + if (uA >= 3) + return VINF_SUCCESS; rc = RTStrToUInt32Ex(pszNext+1, &pszNext, 10, &uB); if ( RT_SUCCESS(rc) - && *pszNext == '.') + && *pszNext == '.') { rc = RTStrToUInt32Ex(pszNext+1, &pszNext, 10, &uC); if (RT_SUCCESS(rc)) diff --git a/src/VBox/HostDrivers/VBoxUSB/solaris/Makefile.kmk b/src/VBox/HostDrivers/VBoxUSB/solaris/Makefile.kmk index 5dec2d7fd..cfb87be6e 100644 --- a/src/VBox/HostDrivers/VBoxUSB/solaris/Makefile.kmk +++ b/src/VBox/HostDrivers/VBoxUSB/solaris/Makefile.kmk @@ -18,14 +18,6 @@ SUB_DEPTH = ../../../../.. include $(KBUILD_PATH)/subheader.kmk -# -# VBoxUSBHelper - Setuid binary helper for updating driver alias. -# -PROGRAMS.solaris += VBoxUSBHelper -VBoxUSBHelper_TEMPLATE = VBOXR3EXE -VBoxUSBHelper_SOURCES = VBoxUSBHelper.cpp -VBoxUSBHelper_LIBS = nvpair device - # # vboxusbmon - The Solaris USB Monitor Kernel module. # diff --git a/src/VBox/HostDrivers/VBoxUSB/solaris/USBLib-solaris.cpp b/src/VBox/HostDrivers/VBoxUSB/solaris/USBLib-solaris.cpp index d86eeaf50..d85fb3cb3 100644 --- a/src/VBox/HostDrivers/VBoxUSB/solaris/USBLib-solaris.cpp +++ b/src/VBox/HostDrivers/VBoxUSB/solaris/USBLib-solaris.cpp @@ -73,7 +73,6 @@ typedef enum USBHELPER_OP * Internal Functions * *******************************************************************************/ static int usblibDoIOCtl(unsigned iFunction, void *pvData, size_t cbData); -static int usblibRunHelper(USBHELPER_OP HelperOp, void *pvData); USBLIB_DECL(int) USBLibInit(void) @@ -219,7 +218,6 @@ USBLIB_DECL(int) USBLibGetClientInfo(char *pszDeviceIdent, char **ppszClientPath } -#if 1 USBLIB_DECL(int) USBLibResetDevice(char *pszDevicePath, bool fReattach) { LogFlow((USBLIBR3 ":USBLibResetDevice pszDevicePath=%s\n", pszDevicePath)); @@ -239,131 +237,6 @@ USBLIB_DECL(int) USBLibResetDevice(char *pszDevicePath, bool fReattach) RTMemFree(pReq); return rc; } -#else - -USBLIB_DECL(int) USBLibResetDevice(char *pszDevicePath, bool fReattach) -{ - VBOXUSBHELPERDATA_RESET Data; - Data.pszDevicePath = pszDevicePath; - Data.fHardReset = fReattach; - return usblibRunHelper(RESET, &Data); -} -#endif - -USBLIB_DECL(int) USBLibAddDeviceAlias(PUSBDEVICE pDevice) -{ - VBOXUSBHELPERDATA_ALIAS Data; - Data.idVendor = pDevice->idVendor; - Data.idProduct = pDevice->idProduct; - Data.bcdDevice = pDevice->bcdDevice; - Data.pszDevicePath = pDevice->pszDevicePath; - return usblibRunHelper(ADD_ALIAS, &Data); -} - - -USBLIB_DECL(int) USBLibRemoveDeviceAlias(PUSBDEVICE pDevice) -{ - VBOXUSBHELPERDATA_ALIAS Data; - Data.idVendor = pDevice->idVendor; - Data.idProduct = pDevice->idProduct; - Data.bcdDevice = pDevice->bcdDevice; - Data.pszDevicePath = pDevice->pszDevicePath; - return usblibRunHelper(DEL_ALIAS, &Data); -} - -#if 0 -USBLIB_DECL(int) USBLibConfigureDevice(PUSBDEVICE pDevice) -{ - return usblibRunHelper(pDevice, CONFIGURE); -} -#endif - -static int usblibRunHelper(USBHELPER_OP HelperOp, void *pvUsbHelperData) -{ - LogFlow((USBLIBR3 ":usblibRunHelper HelperOp=%d pvUSBHelperData=%p\n", HelperOp, pvUsbHelperData)); - - /* - * Find VBoxUSBHelper. - */ - char szDriverCtl[PATH_MAX]; - int rc = RTPathExecDir(szDriverCtl, sizeof(szDriverCtl) - sizeof("/" VBOXUSB_HELPER_NAME)); - if (RT_SUCCESS(rc)) - { - strcat(szDriverCtl, "/" VBOXUSB_HELPER_NAME); - if (!RTPathExists(szDriverCtl)) - { - LogRel(("USBProxy: path %s does not exist. Failed to run USB helper %s.\n", szDriverCtl, VBOXUSB_HELPER_NAME)); - return VERR_FILE_NOT_FOUND; - } - - /* - * Run VBoxUSBHelper task. - */ - const char *pszArgs[5]; - if (HelperOp == RESET) - { - PVBOXUSBHELPERDATA_RESET pData = (PVBOXUSBHELPERDATA_RESET)pvUsbHelperData; - pszArgs[0] = szDriverCtl; - pszArgs[1] = pData->fHardReset ? "hardreset" : "softreset"; - pszArgs[2] = pData->pszDevicePath; - pszArgs[3] = NULL; - } - else - { - PVBOXUSBHELPERDATA_ALIAS pData = (PVBOXUSBHELPERDATA_ALIAS)pvUsbHelperData; - char szDriverAlias[128]; - -#if 0 - /* - * USB vid.pid.rev driver binding alias. - */ - RTStrPrintf(szDriverAlias, sizeof(szDriverAlias), "usb%x,%x.%x", pData->idVendor, pData->idProduct, pData->bcdDevice); -#else - /* - * Path based driver binding alias. - */ - RTStrPrintf(szDriverAlias, sizeof(szDriverAlias), "%s", pData->pszDevicePath + sizeof("/devices")); -#endif - pszArgs[0] = szDriverCtl; - pszArgs[1] = HelperOp == ADD_ALIAS ? "add" : "del"; - pszArgs[2] = szDriverAlias; - pszArgs[3] = VBOXUSB_DRIVER_NAME; - } - pszArgs[4] = NULL; - RTPROCESS pid = NIL_RTPROCESS; - rc = RTProcCreate(pszArgs[0], pszArgs, RTENV_DEFAULT, 0, &pid); - if (RT_SUCCESS(rc)) - { - RTPROCSTATUS Status; - rc = RTProcWait(pid, 0, &Status); - if (RT_SUCCESS(rc)) - { - if (Status.enmReason == RTPROCEXITREASON_NORMAL) - { - switch (Status.iStatus) - { - case 0: return VINF_SUCCESS; /* @todo later maybe ignore -4 as well (see VBoxUSBHelper return codes). */ - case -1: return VERR_PERMISSION_DENIED; - case -2: return VERR_INVALID_PARAMETER; - case -3: return VERR_GENERAL_FAILURE; - default: return VERR_INTERNAL_ERROR; - } - } - else - LogRel((USBLIBR3 ":abnormal termination of USB Helper. enmReason=%d\n", Status.enmReason)); - rc = VERR_GENERAL_FAILURE; - } - else - LogRel((USBLIBR3 ":RTProcWait failed rc=%Rrc\n", rc)); - } - else - { - /* Bad. RTProcCreate() failed! */ - LogRel((USBLIBR3 ":Failed to fork() process for running USB helper for device %s: rc=%Rrc\n", rc)); - } - } - return rc; -} static int usblibDoIOCtl(unsigned iFunction, void *pvData, size_t cbData) @@ -393,4 +266,3 @@ static int usblibDoIOCtl(unsigned iFunction, void *pvData, size_t cbData) return rc; } - diff --git a/src/VBox/HostDrivers/VBoxUSB/solaris/VBoxUSBHelper.cpp b/src/VBox/HostDrivers/VBoxUSB/solaris/VBoxUSBHelper.cpp deleted file mode 100644 index fc61ef2af..000000000 --- a/src/VBox/HostDrivers/VBoxUSB/solaris/VBoxUSBHelper.cpp +++ /dev/null @@ -1,261 +0,0 @@ -/** $Id: VBoxUSBHelper.cpp $ */ -/** @file - * VBoxUSBHelper, setuid binary wrapper for dynamic driver alias updating. - */ - -/* - * Copyright (C) 2008-2009 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. - */ - -/* - * I think it is currently a security risk using VBoxUSBHelper. By that I mean - * here we have an application that can add/remove driver aliases in a generic - * fashion without requiring root privileges (well setuid). - * - * Later maybe we can change this to hardcode aliases to prefix "usb" and then - * hardcode the driver as "ugen". - */ - -/******************************************************************************* -* Header Files * -*******************************************************************************/ -#include -#include -#include -#include -#include -#include -#include -#include - -typedef enum AliasOp -{ - ADD_ALIAS = 12, - DEL_ALIAS -} AliasOp; - -/** - * Print usage to stdout. - */ -static void Usage(char *pszName) -{ - /* @todo Eventually remove the usage syntax display & only display the copyright and warning. */ - fprintf(stderr, "Oracle VM VirtualBox USB Helper\nCopyright (C) Oracle Corporation\n\n"); -#if 0 - fprintf(stderr, "Usage:\n"); - fprintf(stderr, "Add: %s add \n", pszName); - fprintf(stderr, "Delete: %s del \n", pszName); - fprintf(stderr, "Config: %s cfg \n\n", pszName); - fprintf(stderr, "Warning!! This program is internally used by VirtualBox and not meant to be used directly.\n"); -#endif - exit(-1); -} - -/** - * Return code legend: - * 0 - success. - * -1 - no root permission - * -2 - insufficient arguments - * -3 - abnormal termination of update_drv (not likely) - * -4 - update_drv failed (mostly trying to add already existing alias) - */ -static int UpdateDrv(AliasOp Op, char *pszAlias, char *pszDrv) -{ - char szAlias[256]; - sprintf(szAlias, "\"%s\"", pszAlias); - - /* Store current user ID and raise privilege. */ - uid_t userID = getuid(); - setuid(0); - - /* For adding alias add the driver once to make sure we can update alias, no error checking needed. */ - if (Op == ADD_ALIAS) - { - char szAddDrvCmd[512]; - sprintf(szAddDrvCmd, "/usr/sbin/add_drv %s\n", pszDrv); - system(szAddDrvCmd); - } - - /* Update the alias. */ - char *pszArgs[6]; - int rc = 0; - pszArgs[0] = "/usr/sbin/update_drv"; - pszArgs[1] = (char *)(Op == ADD_ALIAS ? "-a" : "-d"); - pszArgs[2] = "-i"; - pszArgs[3] = pszAlias; - pszArgs[4] = pszDrv; - pszArgs[5] = NULL; - pid_t processID = fork(); - if (processID < 0) - { - /* Bad. fork() failed! */ - rc = -2; - } - if (processID == 0) - { - /* Child process. */ - syslog(LOG_ERR, "VBoxUSBHelper: %s %s %s %s %s\n", pszArgs[0], pszArgs[1], pszArgs[2], pszArgs[3], pszArgs[4]); - execv(pszArgs[0], pszArgs); - _exit(1); - } - - /* Parent process. */ - int result; - while (waitpid(processID, &result, 0) < 0) - ; - if (!WIFEXITED(result)) /* abnormally terminated. */ - rc = -3; - if (WEXITSTATUS(result) != 0) /* non-zero exit status. */ - rc = -4; - - /* Restore user ID. */ - setuid(userID); - - fprintf(stdout, "rc=%d result=%d\n", rc, result); - return rc; -} - -/** - * Return code legend: - * 0 - success. - * -1 - no root permission - * -2 - invalid USB device path - * -3 - failed to acquire devctl_handle - * -4 - failed to reset - */ -static int ResetDev(char *pszDevicePath, bool fHardReset) -{ - /* Convert the di_node device path into a devctl compatible Ap-Id. */ - char szApId[PATH_MAX + 1]; - char *pszPort = NULL; - char *pszDir = NULL; - int rc = 0; - - syslog(LOG_ERR, "VBosUSBHelper: given path=%s\n", pszDevicePath); - - strcpy(szApId, "/devices"); - strcat(szApId, pszDevicePath); - pszPort = strrchr(pszDevicePath, '@'); - if (pszPort) - { - pszPort++; - pszDir = strrchr(szApId, '/'); - if (pszDir) - { - pszDir[0] = '\0'; - strcat(szApId, ":"); - strcat(szApId, pszPort); - - /* Acquire devctl handle. */ - devctl_hdl_t pDevHandle; - pDevHandle = devctl_ap_acquire(szApId, 0); - if (pDevHandle) - { - /* Prepare to configure. */ - nvlist_t *pValueList = NULL; - nvlist_alloc(&pValueList, NV_UNIQUE_NAME_TYPE, NULL); - nvlist_add_int32(pValueList, "port", atoi(pszPort)); - - /* Reset the device */ - rc = devctl_ap_unconfigure(pDevHandle, pValueList); - if (!rc) - { - if (fHardReset) - rc = devctl_ap_disconnect(pDevHandle, pValueList); - - if (!rc) - { - if (fHardReset) - rc = devctl_ap_connect(pDevHandle, pValueList); - - if (!rc) - { - rc = devctl_ap_configure(pDevHandle, pValueList); - if (rc) - syslog(LOG_ERR, "VBoxUSBHelper: Configuring %s failed. rc=%d errno=%d\n", szApId, rc, errno); - } - else - syslog(LOG_ERR, "VBoxUSBHelper: Connecting %s failed. rc=%d errno=%d\n", szApId, rc, errno); - } - else - syslog(LOG_ERR, "VBoxUSBHelper: Disconnecting for %s failed. rc=%d errno=%d\n", szApId, rc, errno); - } - else - syslog(LOG_ERR, "VBoxUSBHelper: Unconfigure for %s failed. rc=%d errno=%d\n", szApId, rc, errno); - - if (rc) - rc = -4; - - /* Free-up the name-value list and the obtained handle. */ - nvlist_free(pValueList); - devctl_release(pDevHandle); - } - else - { - syslog(LOG_ERR, "VBoxUSBHelper: devctl_ap_acquire for %s failed. errno=%d\n", szApId, errno); - rc = -3; - } - } - else - { - syslog(LOG_ERR, "VBoxUSBHelper: invalid device %s\n", pszDevicePath); - rc = -1; - } - } - else - { - syslog(LOG_ERR, "VBoxUSBHelper: invalid device %s\n", pszDevicePath); - rc = -1; - } - fprintf(stdout, "rc=%d\n", rc); - return rc; -} - -/** - * returns error code from UpdateDrv. See UpdateDrv error codes. - */ -int main(int argc, char *argv[]) -{ - /* Check root permissions. */ - if (geteuid() != 0) - { - fprintf(stderr, "This program needs administrator privileges.\n"); - return -1; - } - - if (argc < 3) - { - Usage(argv[0]); - return -2; - } - - AliasOp Operation = ADD_ALIAS; - char *pszOp = argv[1]; - if (!strcasecmp(pszOp, "hardreset")) - return ResetDev(argv[2], true); - else if (!strcasecmp(pszOp, "softreset")) - return ResetDev(argv[2], false); - else if (!strcasecmp(pszOp, "del")) - Operation = DEL_ALIAS; - else if (!strcasecmp(pszOp, "add")) - Operation = ADD_ALIAS; - else - { - Usage(argv[0]); - return -2; - } - - char *pszAlias = argv[2]; - char *pszDrv = argv[3]; - /* Return status from update_drv */ - return UpdateDrv(Operation, pszAlias, pszDrv); -} - diff --git a/src/VBox/HostDrivers/VBoxUSB/win/Monitor/USBMon.cpp b/src/VBox/HostDrivers/VBoxUSB/win/Monitor/USBMon.cpp index ac35fc1df..34564057e 100644 --- a/src/VBox/HostDrivers/VBoxUSB/win/Monitor/USBMon.cpp +++ b/src/VBox/HostDrivers/VBoxUSB/win/Monitor/USBMon.cpp @@ -755,6 +755,9 @@ NTSTATUS _stdcall VBoxUSBMonPnPHook(IN PDEVICE_OBJECT pDevObj, IN PIRP pIrp) if (!pNewIrp) break; + /* The driver verifier claims all PNP irps must have Status preset to STATUS_NOT_SUPPORTED */ + pNewIrp->IoStatus.Status = STATUS_NOT_SUPPORTED; + /* Get the next stack location as that is used for the new irp */ newIrpStack = IoGetNextIrpStackLocation(pNewIrp); Assert(newIrpStack); @@ -797,6 +800,9 @@ NTSTATUS _stdcall VBoxUSBMonPnPHook(IN PDEVICE_OBJECT pDevObj, IN PIRP pIrp) if (!pNewIrp) break; + /* The driver verifier claims all PNP irps must have Status preset to STATUS_NOT_SUPPORTED */ + pNewIrp->IoStatus.Status = STATUS_NOT_SUPPORTED; + /* Get the next stack location as that is used for the new irp */ newIrpStack = IoGetNextIrpStackLocation(pNewIrp); Assert(newIrpStack); diff --git a/src/VBox/HostServices/SharedOpenGL/Makefile.kmk b/src/VBox/HostServices/SharedOpenGL/Makefile.kmk index ea72e77fd..3227dd557 100644 --- a/src/VBox/HostServices/SharedOpenGL/Makefile.kmk +++ b/src/VBox/HostServices/SharedOpenGL/Makefile.kmk @@ -249,6 +249,7 @@ VBoxOGLrenderspu_SOURCES.linux = render/renderspu_glx.c VBoxOGLrenderspu_SOURCES.solaris = render/renderspu_glx.c VBoxOGLrenderspu_SOURCES.freebsd = render/renderspu_glx.c ifdef VBOX_WITH_COCOA_QT + VBoxOGLrenderspu_OBJCFLAGS.darwin = -Wno-shadow VBoxOGLrenderspu_SOURCES.darwin = \ render/renderspu_cocoa.c \ render/renderspu_cocoa_helper.m diff --git a/src/VBox/HostServices/SharedOpenGL/crserver/crservice.cpp b/src/VBox/HostServices/SharedOpenGL/crserver/crservice.cpp index 8ecbe8848..3d88fe267 100644 --- a/src/VBox/HostServices/SharedOpenGL/crserver/crservice.cpp +++ b/src/VBox/HostServices/SharedOpenGL/crserver/crservice.cpp @@ -347,6 +347,12 @@ static CRVBOXSVCBUFFER_t* svcGetBuffer(uint32_t iBuffer, uint32_t cbBufferSize) { if (pBuffer->uiId == iBuffer) { + if (pBuffer->uiSize!=cbBufferSize) + { + LogRel(("SHARED_CROPENGL svcGetBuffer: invalid buffer(%i) size %i instead of %i\n", + iBuffer, pBuffer->uiSize, cbBufferSize)); + return NULL; + } return pBuffer; } pBuffer = pBuffer->pNext; @@ -679,7 +685,7 @@ static DECLCALLBACK(void) svcCall (void *, VBOXHGCMCALLHANDLE callHandle, uint32 /* Execute the function. */ CRVBOXSVCBUFFER_t *pSvcBuffer = svcGetBuffer(iBuffer, cbBufferSize); - if (!pSvcBuffer || ui32Offset+cbBuffer>cbBufferSize) + if (!pSvcBuffer || ((uint64_t)ui32Offset+cbBuffer)>cbBufferSize) { rc = VERR_INVALID_PARAMETER; } diff --git a/src/VBox/HostServices/SharedOpenGL/render/renderspu.c b/src/VBox/HostServices/SharedOpenGL/render/renderspu.c index bc62a5166..a9d6b9d4b 100644 --- a/src/VBox/HostServices/SharedOpenGL/render/renderspu.c +++ b/src/VBox/HostServices/SharedOpenGL/render/renderspu.c @@ -1076,6 +1076,26 @@ void renderspuBindFramebufferEXT(GLenum target, GLuint framebuffer) { renderspu_SystemBindFramebufferEXT(target, framebuffer); } + +void renderspuCopyPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type) +{ + renderspu_SystemCopyPixels(x, y, width, height, type); +} + +void renderspuGetIntegerv(GLenum pname, GLint * params) +{ + renderspu_SystemGetIntegerv(pname, params); +} + +void renderspuDrawBuffer(GLenum mode) +{ + renderspu_SystemDrawBuffer(mode); +} + +void renderspuReadBuffer(GLenum mode) +{ + renderspu_SystemReadBuffer(mode); +} # endif #endif @@ -1120,6 +1140,10 @@ renderspuCreateFunctions(SPUNamedFunctionTable table[]) FILLIN( "Flush", renderspuFlush ); FILLIN( "Finish", renderspuFinish ); FILLIN( "BindFramebufferEXT", renderspuBindFramebufferEXT ); + FILLIN( "CopyPixels", renderspuCopyPixels ); + FILLIN( "GetIntegerv", renderspuGetIntegerv ); + FILLIN( "ReadBuffer", renderspuReadBuffer ); + FILLIN( "DrawBuffer", renderspuDrawBuffer ); # endif #endif return i; diff --git a/src/VBox/HostServices/SharedOpenGL/render/renderspu.h b/src/VBox/HostServices/SharedOpenGL/render/renderspu.h index 1cecd3f0d..61e7662c1 100644 --- a/src/VBox/HostServices/SharedOpenGL/render/renderspu.h +++ b/src/VBox/HostServices/SharedOpenGL/render/renderspu.h @@ -302,6 +302,10 @@ extern void renderspu_SystemSetRootVisibleRegion(GLint cRects, GLint *pRects); extern void renderspu_SystemFlush(); extern void renderspu_SystemFinish(); extern void renderspu_SystemBindFramebufferEXT(GLenum target, GLuint framebuffer); +extern void renderspu_SystemCopyPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type); +extern void renderspu_SystemGetIntegerv(GLenum pname, GLint *params); +extern void renderspu_SystemReadBuffer(GLenum mode); +extern void renderspu_SystemDrawBuffer(GLenum mode); # endif #endif extern void renderspu_SystemShowWindow( WindowInfo *window, GLboolean showIt ); diff --git a/src/VBox/HostServices/SharedOpenGL/render/renderspu_cocoa.c b/src/VBox/HostServices/SharedOpenGL/render/renderspu_cocoa.c index 9e17931c5..2fbe77d7b 100644 --- a/src/VBox/HostServices/SharedOpenGL/render/renderspu_cocoa.c +++ b/src/VBox/HostServices/SharedOpenGL/render/renderspu_cocoa.c @@ -200,3 +200,23 @@ void renderspu_SystemBindFramebufferEXT(GLenum target, GLuint framebuffer) cocoaBindFramebufferEXT(target, framebuffer); } +void renderspu_SystemCopyPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type) +{ + cocoaCopyPixels(x, y, width, height, type); +} + +void renderspu_SystemGetIntegerv(GLenum pname, GLint * params) +{ + cocoaGetIntegerv(pname, params); +} + +void renderspu_SystemReadBuffer(GLenum mode) +{ + cocoaReadBuffer(mode); +} + +void renderspu_SystemDrawBuffer(GLenum mode) +{ + cocoaDrawBuffer(mode); +} + diff --git a/src/VBox/HostServices/SharedOpenGL/render/renderspu_cocoa_helper.h b/src/VBox/HostServices/SharedOpenGL/render/renderspu_cocoa_helper.h index 7edcaa194..32a5e3a41 100644 --- a/src/VBox/HostServices/SharedOpenGL/render/renderspu_cocoa_helper.h +++ b/src/VBox/HostServices/SharedOpenGL/render/renderspu_cocoa_helper.h @@ -48,6 +48,10 @@ void cocoaViewSetVisibleRegion(NativeNSViewRef pView, GLint cRects, GLint* paRec void cocoaFlush(void); void cocoaFinish(void); void cocoaBindFramebufferEXT(GLenum target, GLuint framebuffer); +void cocoaCopyPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type); +void cocoaGetIntegerv(GLenum pname, GLint *params); +void cocoaReadBuffer(GLenum mode); +void cocoaDrawBuffer(GLenum mode); RT_C_DECLS_END diff --git a/src/VBox/HostServices/SharedOpenGL/render/renderspu_cocoa_helper.m b/src/VBox/HostServices/SharedOpenGL/render/renderspu_cocoa_helper.m index 1943d1355..bd0c55827 100644 --- a/src/VBox/HostServices/SharedOpenGL/render/renderspu_cocoa_helper.m +++ b/src/VBox/HostServices/SharedOpenGL/render/renderspu_cocoa_helper.m @@ -26,10 +26,56 @@ #include #include +/* + * How this works: + * In general it is not so easy like on the other platforms, cause Cocoa + * doesn't support any clipping of already painted stuff. In Mac OS X there is + * the concept of translucent canvas's e.g. windows and there it is just + * painted what should be visible to the user. Unfortunately this isn't the + * concept of chromium. Therefor I reroute all OpenGL operation from the guest + * to a frame buffer object (FBO). This is a OpenGL extension, which is + * supported by all OS X versions we support (AFAIC tell). Of course the guest + * doesn't know that and we have to make sure that the OpenGL state always is + * in the right state to paint into the FBO and not to the front/back buffer. + * Several functions below (like cocoaBindFramebufferEXT, cocoaGetIntegerv, + * ...) doing this. When a swap or finish is triggered by the guest, the + * content (which is already bound to an texture) is painted on the screen + * within a separate OpenGL context. This allows the usage of the same + * resources (texture ids, buffers ...) but at the same time having an + * different internal OpenGL state. Another advantage is that we can paint a + * thumbnail of the current output in a much more smaller (GPU accelerated + * scale) version on a third context and use glReadPixels to get the actual + * data. glReadPixels is a very slow operation, but as we just use a much more + * smaller image, we can handle it (anyway this is only done 5 times per + * second). + * + * Other things to know: + * - If the guest request double buffering, we have to make sure there are two + * buffers. We use the same FBO with 2 color attachments. Also glDrawBuffer + * and glReadBuffer is intercepted to make sure it is painted/read to/from + * the correct buffers. On swap our buffers are swapped and not the + * front/back buffer. + * - If the guest request a depth/stencil buffer, a combined render buffer for + * this is created. + * - If the size of the guest OpenGL window changes, all FBO's, textures, ... + * need to be recreated. + * - We need to track any changes to the parent window + * (create/destroy/move/resize). The various classes like OverlayHelperView, + * OverlayWindow, ... are there for. + * - The HGCM service runs on a other thread than the Main GUI. Keeps this + * always in mind (see e.g. performSelectorOnMainThread in renderFBOToView) + * - We make heavy use of late binding. We can not be sure that the GUI (or any + * other third party GUI), overwrite our NSOpenGLContext. So we always ask if + * this is our own one, before use. Really neat concept of Objective-C/Cocoa + * ;) + */ + /* Debug macros */ #define FBO 1 /* Disable this to see how the output is without the FBO in the middle of the processing chain. */ -//#define SHOW_WINDOW_BACKGROUND 1 /* Define this to see the window background even if the window is clipped */ -//#define DEBUG_VERBOSE /* Define this could get some debug info about the messages flow. */ +#if 0 +#define SHOW_WINDOW_BACKGROUND 1 /* Define this to see the window background even if the window is clipped */ +#define DEBUG_VERBOSE /* Define this to get some debug info about the messages flow. */ +#endif #ifdef DEBUG_poetzsch #define DEBUG_MSG(text) \ @@ -62,14 +108,14 @@ char *errStr; switch (g) { - case GL_INVALID_ENUM: errStr = RTStrDup("GL_INVALID_ENUM"); break; - case GL_INVALID_VALUE: errStr = RTStrDup("GL_INVALID_VALUE"); break; + case GL_INVALID_ENUM: errStr = RTStrDup("GL_INVALID_ENUM"); break; + case GL_INVALID_VALUE: errStr = RTStrDup("GL_INVALID_VALUE"); break; case GL_INVALID_OPERATION: errStr = RTStrDup("GL_INVALID_OPERATION"); break; - case GL_STACK_OVERFLOW: errStr = RTStrDup("GL_STACK_OVERFLOW"); break; - case GL_STACK_UNDERFLOW: errStr = RTStrDup("GL_STACK_UNDERFLOW"); break; - case GL_OUT_OF_MEMORY: errStr = RTStrDup("GL_OUT_OF_MEMORY"); break; - case GL_TABLE_TOO_LARGE: errStr = RTStrDup("GL_TABLE_TOO_LARGE"); break; - default: errStr = RTStrDup("UNKNOWN"); break; + case GL_STACK_OVERFLOW: errStr = RTStrDup("GL_STACK_OVERFLOW"); break; + case GL_STACK_UNDERFLOW: errStr = RTStrDup("GL_STACK_UNDERFLOW"); break; + case GL_OUT_OF_MEMORY: errStr = RTStrDup("GL_OUT_OF_MEMORY"); break; + case GL_TABLE_TOO_LARGE: errStr = RTStrDup("GL_TABLE_TOO_LARGE"); break; + default: errStr = RTStrDup("UNKNOWN"); break; } DEBUG_MSG(("%s:%d: glError %d (%s)\n", file, line, g, errStr)); RTMemFree(errStr); @@ -143,15 +189,23 @@ while(0); NSOpenGLContext *m_pSharedGLCtx; RTTHREAD mThread; - /* FBO handling */ +#ifdef FBO GLuint m_FBOId; - GLuint m_FBOTexId; - NSSize m_FBOTexSize; + /* FBO handling */ + GLuint m_FBOTexBackId; + GLuint m_FBOTexFrontId; + GLuint m_FBOAttBackId; + GLuint m_FBOAttFrontId; GLuint m_FBODepthStencilPackedId; + NSSize m_FBOTexSize; + + bool m_fFrontDrawing; +#endif /* The corresponding dock tile view of this OpenGL view & all helper * members. */ DockOverlayView *m_DockTileView; + GLuint m_FBOThumbId; GLuint m_FBOThumbTexId; GLfloat m_FBOThumbScaleX; @@ -188,13 +242,17 @@ while(0); - (void)createFBO; - (void)deleteFBO; +- (bool)isCurrentFBO; - (void)updateFBO; - (void)makeCurrentFBO; - (void)swapFBO; - (void)flushFBO; +- (void)stateInfo:(GLenum)pname withParams:(GLint*)params; - (void)finishFBO; -- (void)bindFBO; +- (void)bindFBO:(GLenum)target withFrameBuffer:(GLuint)framebuffer; +- (void)tryDraw; - (void)renderFBOToView; +- (void)renderFBOToDockTile; - (void)clearVisibleRegions; - (void)setVisibleRegions:(GLint)cRects paRects:(GLint*)paRects; @@ -316,6 +374,7 @@ while(0); hasAlpha:YES isPlanar:NO colorSpaceName:NSDeviceRGBColorSpace + bitmapFormat:NSAlphaFirstBitmapFormat bytesPerRow:frame.size.width * 4 bitsPerPixel:8 * 4]; m_ThumbImage = [[NSImage alloc] initWithSize:[m_ThumbBitmap size]]; @@ -331,11 +390,13 @@ while(0); - (void)drawRect:(NSRect)aRect { + NSRect frame; + [self lock]; #ifdef SHOW_WINDOW_BACKGROUND [[NSColor colorWithCalibratedRed:1.0 green:0.0 blue:0.0 alpha:0.7] set]; - NSRect frame = [self frame]; - [NSBezierPath fillRect:NSMakeRect(0, 0, frame.size.width, frame.size.height)]; + frame = [self frame]; + [NSBezierPath fillRect:NSMakeRect(0, 0, frame.size.width, frame.size.height)]; #endif /* SHOW_WINDOW_BACKGROUND */ if (m_ThumbImage != nil) [m_ThumbImage drawAtPoint:NSMakePoint(0, 0) fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0]; @@ -369,12 +430,14 @@ while(0); if (self) m_pPixelFormat = format; + DEBUG_MSG(("OCTX(%p): init OverlayOpenGLContext\n", (void*)self)); + return self; } - + - (void)dealloc { - DEBUG_MSG(("Dealloc context %X\n", (uint)self)); + DEBUG_MSG(("OCTX(%p): dealloc OverlayOpenGLContext\n", (void*)self)); [m_pPixelFormat release]; @@ -390,6 +453,8 @@ while(0); -(void)setView:(NSView*)view { + DEBUG_MSG(("OCTX(%p): setView: new view: %p\n", (void*)self, (void*)view)); + #ifdef FBO m_pView = view;; #else @@ -408,6 +473,8 @@ while(0); -(void)clearDrawable { + DEBUG_MSG(("OCTX(%p): clearDrawable\n", (void*)self)); + m_pView = NULL;; [super clearDrawable]; } @@ -417,7 +484,7 @@ while(0); return m_pPixelFormat; } -@end; +@end /******************************************************************************** * @@ -432,11 +499,15 @@ while(0); m_pOverlayWindow = pOverlayWindow; + DEBUG_MSG(("OHVW(%p): init OverlayHelperView\n", (void*)self)); + return self; } -(void)viewDidMoveToWindow { + DEBUG_MSG(("OHVW(%p): viewDidMoveToWindow: new win: %p\n", (void*)self, (void*)[self window])); + [m_pOverlayWindow parentWindowChanged:[self window]]; } @@ -451,7 +522,9 @@ while(0); - (id)initWithParentView:(NSView*)pParentView overlayView:(OverlayView*)pOverlayView { - if(self = [super initWithContentRect:NSZeroRect styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:NO]) + NSWindow *pParentWin = nil; + + if((self = [super initWithContentRect:NSZeroRect styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:NO])) { m_pParentView = pParentView; m_pOverlayView = pOverlayView; @@ -475,7 +548,7 @@ while(0); /* Disable mouse events for this window */ [self setIgnoresMouseEvents:YES]; - NSWindow *pParentWin = [m_pParentView window]; + pParentWin = [m_pParentView window]; /* Initial set the position to the parents view top/left (Compiz fix). */ [self setFrameOrigin: @@ -487,15 +560,17 @@ while(0); /* Add ourself as a child to the parent views window. Note: this has to * be done last so that everything else is setup in - * parentWindowChanged. */ + * parentWindowChanged. */ [pParentWin addChildWindow:self ordered:NSWindowAbove]; } + DEBUG_MSG(("OWIN(%p): init OverlayWindow\n", (void*)self)); + return self; } - (void)dealloc { - DEBUG_MSG(("Dealloc window %X\n", (uint)self)); + DEBUG_MSG(("OWIN(%p): dealloc OverlayWindow\n", (void*)self)); [[NSNotificationCenter defaultCenter] removeObserver:self]; @@ -507,17 +582,23 @@ while(0); - (void)parentWindowFrameChanged:(NSNotification*)pNote { + DEBUG_MSG(("OWIN(%p): parentWindowFrameChanged\n", (void*)self)); + /* Reposition this window with the help of the OverlayView. Perform the * call in the OpenGL thread. */ -// [m_pOverlayView performSelector:@selector(reshape) onThread:m_Thread withObject:nil waitUntilDone:YES]; - DEBUG_MSG(("parentWindowFrameChanged\n")); + /* + [m_pOverlayView performSelector:@selector(reshape) onThread:m_Thread withObject:nil waitUntilDone:YES]; + */ + [m_pOverlayView reshape]; } - (void)parentWindowChanged:(NSWindow*)pWindow { + DEBUG_MSG(("OWIN(%p): parentWindowChanged\n", (void*)self)); + [[NSNotificationCenter defaultCenter] removeObserver:self]; - DEBUG_MSG(("parentWindowChanged\n")); + if(pWindow != nil) { /* Ask to get notifications when our parent window frame changes. */ @@ -530,8 +611,10 @@ while(0); [pWindow addChildWindow:self ordered:NSWindowAbove]; /* Reshape the overlay view after a short waiting time to let the main * window resize itself properly. */ -// [m_pOverlayView performSelector:@selector(reshape) withObject:nil afterDelay:0.2]; -// [NSTimer scheduledTimerWithTimeInterval:0.2 target:m_pOverlayView selector:@selector(reshape) userInfo:nil repeats:NO]; + /* + [m_pOverlayView performSelector:@selector(reshape) withObject:nil afterDelay:0.2]; + [NSTimer scheduledTimerWithTimeInterval:0.2 target:m_pOverlayView selector:@selector(reshape) userInfo:nil repeats:NO]; + */ [m_pOverlayView reshape]; } } @@ -547,44 +630,49 @@ while(0); - (id)initWithFrame:(NSRect)frame thread:(RTTHREAD)aThread parentView:(NSView*)pParentView { - m_pParentView = pParentView; + m_pParentView = pParentView; /* Make some reasonable defaults */ - m_pGLCtx = NULL; - m_pSharedGLCtx = NULL; - mThread = aThread; - m_FBOId = 0; - m_FBOTexId = 0; - m_FBOTexSize = NSZeroSize; + m_pGLCtx = nil; + m_pSharedGLCtx = nil; + mThread = aThread; +#ifdef FBO + m_FBOId = 0; + m_FBOTexBackId = 0; + m_FBOTexFrontId = 0; + m_FBOAttBackId = GL_COLOR_ATTACHMENT0_EXT; + m_FBOAttFrontId = GL_COLOR_ATTACHMENT1_EXT; m_FBODepthStencilPackedId = 0; - m_FBOThumbId = 0; - m_FBOThumbTexId = 0; - m_cClipRects = 0; - m_paClipRects = NULL; - m_Pos = NSZeroPoint; - m_Size = NSZeroSize; - m_RootShift = NSZeroPoint; + m_FBOTexSize = NSZeroSize; +#endif + m_FBOThumbId = 0; + m_FBOThumbTexId = 0; + m_cClipRects = 0; + m_paClipRects = NULL; + m_Pos = NSZeroPoint; + m_Size = NSMakeSize(1, 1); + m_RootShift = NSZeroPoint; - DEBUG_MSG(("Init view %X (%X)\n", (uint)self, (uint)mThread)); - self = [super initWithFrame:frame]; + DEBUG_MSG(("OVIW(%p): init OverlayView\n", (void*)self)); + return self; } - (void)dealloc { - DEBUG_MSG(("Dealloc view %X\n", (uint)self)); + DEBUG_MSG(("OVIW(%p): dealloc OverlayView\n", (void*)self)); [self deleteFBO]; if (m_pGLCtx) { - if ([m_pGLCtx view] == self) + if ([m_pGLCtx view] == self) [m_pGLCtx clearDrawable]; } if (m_pSharedGLCtx) { - if ([m_pSharedGLCtx view] == self) + if ([m_pSharedGLCtx view] == self) [m_pSharedGLCtx clearDrawable]; [m_pSharedGLCtx release]; @@ -597,21 +685,13 @@ while(0); - (void)drawRect:(NSRect)aRect { -// NSGraphicsContext*pC = [NSGraphicsContext currentContext]; -// [[NSColor blueColor] set]; -// NSBezierPath *p = [[NSBezierPath alloc] bezierPathWithOvalInRect:[self frame]]; -// [p fill]; -// [[NSColor greenColor] set]; -// [p stroke]; -// if ([self lockFocusIfCanDraw]) -// { -// [self renderFBOToView]; -// [self unlockFocus]; -// } + /* Do nothing */ } - (void)setGLCtx:(NSOpenGLContext*)pCtx { + DEBUG_MSG(("OVIW(%p): setGLCtx: new ctx: %p\n", (void*)self, (void*)pCtx)); + m_pGLCtx = pCtx; } @@ -625,14 +705,18 @@ while(0); return m_pParentView; } -- (void)setParentView: (NSView*)view +- (void)setParentView:(NSView*)pView { - m_pParentView = view; + DEBUG_MSG(("OVIW(%p): setParentView: new view: %p\n", (void*)self, (void*)pView)); + + m_pParentView = pView; } -- (void)setOverlayWin: (NSWindow*)win +- (void)setOverlayWin:(NSWindow*)pWin { - m_pOverlayWin = win; + DEBUG_MSG(("OVIW(%p): setOverlayWin: new win: %p\n", (void*)self, (void*)pWin)); + + m_pOverlayWin = pWin; } - (NSWindow*)overlayWin @@ -642,7 +726,10 @@ while(0); - (void)setPos:(NSPoint)pos { + DEBUG_MSG(("OVIW(%p): setPos: new pos: %d, %d\n", (void*)self, (int)pos.x, (int)pos.y)); + m_Pos = pos; + [self reshape]; } @@ -654,20 +741,22 @@ while(0); - (void)setSize:(NSSize)size { m_Size = size; - - if (!m_FBOId) + +#ifdef FBO + if (m_FBOId) { - DEBUG_MSG(("Set size (no fbo) %p\n", self)); + DEBUG_MSG(("OVIW(%p): setSize: new size: %dx%d\n", (void*)self, (int)size.width, (int)size.height)); [self reshape]; [self updateFBO]; + /* have to rebind GL_TEXTURE_RECTANGLE_ARB as m_FBOTexId could be changed in updateFBO call */ + [self updateViewport]; } else +#endif { - DEBUG_MSG(("Set size FBO %p\n", self)); + DEBUG_MSG(("OVIW(%p): setSize (no FBO): new size: %dx%d\n", (void*)self, (int)size.width, (int)size.height)); [self reshape]; [self updateFBO]; - /* have to rebind GL_TEXTURE_RECTANGLE_ARB as m_FBOTexId could be changed in updateFBO call */ - [self updateViewport]; } } @@ -678,62 +767,69 @@ while(0); - (void)updateViewport { - DEBUG_MSG(("updateViewport %p\n", self)); + NSRect r; + + DEBUG_MSG(("OVIW(%p): updateViewport\n", (void*)self)); + +#ifdef FBO if (m_pSharedGLCtx) { /* Update the viewport for our OpenGL view */ - DEBUG_MSG(("MakeCurrent (shared) %X\n", m_pSharedGLCtx)); + DEBUG_MSG(("OVIW(%p): makeCurrent (shared) %p\n", (void*)self, (void*)m_pSharedGLCtx)); [m_pSharedGLCtx makeCurrentContext]; [m_pSharedGLCtx update]; - NSRect r = [self frame]; + r = [self frame]; /* Setup all matrices */ glMatrixMode(GL_PROJECTION); glLoadIdentity(); glViewport(0, 0, r.size.width, r.size.height); glOrtho(0, r.size.width, 0, r.size.height, -1, 1); - DEBUG_MSG_1(("frame[%i, %i, %i, %i]\n", (int)r.origin.x, (int)r.origin.x, (int)r.size.width, (int)r.size.height)); - DEBUG_MSG_1(("m_Pos(%i,%i) m_Size(%i,%i)\n", (int)m_Pos.x, (int)m_Pos.y, (int)m_Size.width, (int)m_Size.height)); - DEBUG_MSG_1(("m_RootShift(%i, %i)\n", (int)m_RootShift.x, (int)m_RootShift.y)); + DEBUG_MSG_1(("OVIW(%p): frame[%i, %i, %i, %i]\n", (void*)self, (int)r.origin.x, (int)r.origin.x, (int)r.size.width, (int)r.size.height)); + DEBUG_MSG_1(("OVIW(%p): m_Pos(%i,%i) m_Size(%i,%i)\n", (void*)self, (int)m_Pos.x, (int)m_Pos.y, (int)m_Size.width, (int)m_Size.height)); + DEBUG_MSG_1(("OVIW(%p): m_RootShift(%i, %i)\n", (void*)self, (int)m_RootShift.x, (int)m_RootShift.y)); glMatrixMode(GL_TEXTURE); glLoadIdentity(); - glTranslatef(0.0f, m_RootShift.y, 0.0f); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); - glTranslatef(-m_RootShift.x, 0.0f, 0.0f); /* Clear background to transparent */ glClearColor(0.0f, 0.0f, 0.0f, 0.0f); - glEnable(GL_TEXTURE_RECTANGLE_ARB); - glBindTexture(GL_TEXTURE_RECTANGLE_ARB, m_FBOTexId); - - DEBUG_MSG(("MakeCurrent %X\n", m_pGLCtx)); + DEBUG_MSG(("OVIW(%p): makeCurrent (non shared) %p\n", (void*)self, (void*)m_pGLCtx)); [m_pGLCtx makeCurrentContext]; } +#endif } - (void)reshape { - DEBUG_MSG(("(%p)reshape %p\n", RTThreadSelf(), self)); + NSRect parentFrame = NSZeroRect; + NSPoint parentPos = NSZeroPoint; + NSPoint childPos = NSZeroPoint; + NSRect childFrame = NSZeroRect; + NSRect newFrame = NSZeroRect; + + DEBUG_MSG(("OVIW(%p): reshape\n", (void*)self)); + /* Getting the right screen coordinates of the parents frame is a little bit * complicated. */ - NSRect parentFrame = [m_pParentView frame]; - NSPoint parentPos = [[m_pParentView window] convertBaseToScreen:[[m_pParentView superview] convertPointToBase:NSMakePoint(parentFrame.origin.x, parentFrame.origin.y + parentFrame.size.height)]]; + parentFrame = [m_pParentView frame]; + parentPos = [[m_pParentView window] convertBaseToScreen:[[m_pParentView superview] convertPointToBase:NSMakePoint(parentFrame.origin.x, parentFrame.origin.y + parentFrame.size.height)]]; parentFrame.origin.x = parentPos.x; parentFrame.origin.y = parentPos.y; /* Calculate the new screen coordinates of the overlay window. */ - NSPoint childPos = NSMakePoint(m_Pos.x, m_Pos.y + m_Size.height); + childPos = NSMakePoint(m_Pos.x, m_Pos.y + m_Size.height); childPos = [[m_pParentView window] convertBaseToScreen:[[m_pParentView superview] convertPointToBase:childPos]]; /* Make a frame out of it. */ - NSRect childFrame = NSMakeRect(childPos.x, childPos.y, m_Size.width, m_Size.height); + childFrame = NSMakeRect(childPos.x, childPos.y, m_Size.width, m_Size.height); /* We have to make sure that the overlay window will not be displayed out * of the parent window. So intersect both frames & use the result as the new * frame for the window. */ - NSRect newFrame = NSIntersectionRect(parentFrame, childFrame); + newFrame = NSIntersectionRect(parentFrame, childFrame); /* Later we have to correct the texture position in the case the window is * out of the parents window frame. So save the shift values for later use. */ @@ -746,17 +842,19 @@ while(0); else m_RootShift.y = 0; -// NSScrollView *pScrollView = [[[m_pParentView window] contentView] enclosingScrollView]; -// if (pScrollView) -// { -// NSRect scrollRect = [pScrollView documentVisibleRect]; -// NSRect scrollRect = [m_pParentView visibleRect]; -// printf ("sc rect: %d %d %d %d\n", (int) scrollRect.origin.x,(int) scrollRect.origin.y,(int) scrollRect.size.width,(int) scrollRect.size.height); -// NSRect b = [[m_pParentView superview] bounds]; -// printf ("bound rect: %d %d %d %d\n", (int) b.origin.x,(int) b.origin.y,(int) b.size.width,(int) b.size.height); -// newFrame.origin.x += scrollRect.origin.x; -// newFrame.origin.y += scrollRect.origin.y; -// } + /* + NSScrollView *pScrollView = [[[m_pParentView window] contentView] enclosingScrollView]; + if (pScrollView) + { + NSRect scrollRect = [pScrollView documentVisibleRect]; + NSRect scrollRect = [m_pParentView visibleRect]; + printf ("sc rect: %d %d %d %d\n", (int) scrollRect.origin.x,(int) scrollRect.origin.y,(int) scrollRect.size.width,(int) scrollRect.size.height); + NSRect b = [[m_pParentView superview] bounds]; + printf ("bound rect: %d %d %d %d\n", (int) b.origin.x,(int) b.origin.y,(int) b.size.width,(int) b.size.height); + newFrame.origin.x += scrollRect.origin.x; + newFrame.origin.y += scrollRect.origin.y; + } + */ /* Set the new frame. */ [[self window] setFrame:newFrame display:YES]; @@ -770,19 +868,17 @@ while(0); - (void)createFBO { - GLint oldTexId; - GLint oldFBId; - - DEBUG_MSG(("createFBO %p\n", self)); + GLint oldTexId = 0; + GLint oldFBId = 0; + NSView *pDockScreen = nil; + GLint maxTexSize = 0; + GLfloat imageAspectRatio = 0; + GLint filter = GL_NEAREST; + [self deleteFBO]; - //GL_SAVE_STATE; -#if 0 - CHECK_GL_ERROR(); - glPushAttrib(GL_ACCUM_BUFFER_BIT); - glPopAttrib(); - CHECK_GL_ERROR(); -#endif +#ifdef FBO + DEBUG_MSG(("OVIW(%p): createFBO\n", (void*)self)); glGetIntegerv(GL_TEXTURE_BINDING_RECTANGLE_ARB, &oldTexId); glGetIntegerv(GL_FRAMEBUFFER_BINDING_EXT, &oldFBId); @@ -799,14 +895,20 @@ while(0); isFBO = gluCheckExtension((const GLubyte*)"GL_EXT_framebuffer_object", strExt); if (!isFBO) { - DEBUG_MSG(("Your system does not support framebuffer extension\n")); + DEBUG_MSG(("Your system does not support the GL_EXT_framebuffer_object extension\n")); } - + isFBO = gluCheckExtension((const GLubyte*)"GL_EXT_framebuffer_blit", strExt); + if (!isFBO) + { + DEBUG_MSG(("Your system does not support the GL_EXT_framebuffer_blit extension\n")); + } + /* Create FBO object */ glGenFramebuffersEXT(1, &m_FBOId); /* & the texture as well the depth/stencil render buffer */ - glGenTextures(1, &m_FBOTexId); - DEBUG_MSG(("Create FBO %d %d\n", m_FBOId, m_FBOTexId)); + glGenTextures(1, &m_FBOTexBackId); + glGenTextures(1, &m_FBOTexFrontId); + DEBUG_MSG(("OVIW(%p): gen numbers: FBOId=%d FBOTexBackId=%d FBOTexFrontId=%d\n", (void*)self, m_FBOId, m_FBOTexBackId, m_FBOTexFrontId)); glGenRenderbuffersEXT(1, &m_FBODepthStencilPackedId); } @@ -815,62 +917,74 @@ while(0); /* Bind to FBO */ glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_FBOId); - /*glEnable(GL_TEXTURE_RECTANGLE_ARB);*/ - - GLfloat imageAspectRatio = m_FBOTexSize.width / m_FBOTexSize.height; + /* + glEnable(GL_TEXTURE_RECTANGLE_ARB); + */ + + imageAspectRatio = m_FBOTexSize.width / m_FBOTexSize.height; /* Sanity check against maximum OpenGL texture size. If bigger adjust to * maximum possible size while maintain the aspect ratio. */ - GLint maxTexSize; glGetIntegerv(GL_MAX_TEXTURE_SIZE, &maxTexSize); -// maxTexSize = 150; - GLint filter = GL_NEAREST; - if (m_FBOTexSize.width > maxTexSize || m_FBOTexSize.height > maxTexSize) + if (m_FBOTexSize.width > maxTexSize || m_FBOTexSize.height > maxTexSize) { filter = GL_LINEAR; if (imageAspectRatio > 1) { - m_FBOTexSize.width = maxTexSize; + m_FBOTexSize.width = maxTexSize; m_FBOTexSize.height = maxTexSize / imageAspectRatio; } else { m_FBOTexSize.width = maxTexSize * imageAspectRatio; - m_FBOTexSize.height = maxTexSize; + m_FBOTexSize.height = maxTexSize; } } - - /* Initialize FBO Texture */ - glBindTexture(GL_TEXTURE_RECTANGLE_ARB, m_FBOTexId); - glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MAG_FILTER, filter); - glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MIN_FILTER, filter); - glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_WRAP_S, GL_CLAMP); - glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_WRAP_T, GL_CLAMP); - + + DEBUG_MSG(("OVIW(%p): tex size is: %dx%d\n", (void*)self, (int)m_FBOTexSize.width, (int)m_FBOTexSize.height)); + + /* Initialize FBO Textures */ /* The GPUs like the GL_BGRA / GL_UNSIGNED_INT_8_8_8_8_REV combination * others are also valid, but might incur a costly software translation. */ + glBindTexture(GL_TEXTURE_RECTANGLE_ARB, m_FBOTexBackId); glTexImage2D(GL_TEXTURE_RECTANGLE_ARB, 0, GL_RGB, m_FBOTexSize.width, m_FBOTexSize.height, 0, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, NULL); - DEBUG_MSG(("m_FBOTexSize(%i,%i)\n", (int)m_FBOTexSize.width, (int)m_FBOTexSize.height)); - - /* Now attach texture to the FBO as its color destination */ - glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_RECTANGLE_ARB, m_FBOTexId, 0); + glBindTexture(GL_TEXTURE_RECTANGLE_ARB, m_FBOTexFrontId); + glTexImage2D(GL_TEXTURE_RECTANGLE_ARB, 0, GL_RGB, m_FBOTexSize.width, m_FBOTexSize.height, 0, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, NULL); + + /* Now attach the textures to the FBO as its color destinations */ + glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, m_FBOAttBackId, GL_TEXTURE_RECTANGLE_ARB, m_FBOTexBackId, 0); + glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, m_FBOAttFrontId, GL_TEXTURE_RECTANGLE_ARB, m_FBOTexFrontId, 0); glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, m_FBODepthStencilPackedId); - glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_STENCIL_EXT, m_FBOTexSize.width, m_FBOTexSize.height); - glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT,GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, m_FBODepthStencilPackedId); - glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_STENCIL_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, m_FBODepthStencilPackedId); + glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT, m_FBOTexSize.width, m_FBOTexSize.height); + glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, m_FBODepthStencilPackedId); + + /* Bind the FBOs for reading and drawing. */ + glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, m_FBOId); + glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, m_FBOId); + + /* Explicitly clear the textures otherwise they would contain old memory stuff. */ + glDrawBuffer(m_FBOAttBackId); + glClear(GL_COLOR_BUFFER_BIT); + glDrawBuffer(m_FBOAttFrontId); + glClear(GL_COLOR_BUFFER_BIT); + + /* Now initially reading/drawing to the back buffer. */ + glReadBuffer(m_FBOAttBackId); + glDrawBuffer(m_FBOAttBackId); /* Make sure the FBO was created successfully. */ if (GL_FRAMEBUFFER_COMPLETE_EXT != glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT)) - DEBUG_MSG(("Framebuffer Object creation or update failed!\n")); + DEBUG_MSG(("OVIW(%p): Framebuffer Object creation or update failed!\n", (void*)self)); +// glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, 0); glBindTexture(GL_TEXTURE_RECTANGLE_ARB, oldTexId); - glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, oldFBId ? oldFBId:m_FBOId); + glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, (GLuint)oldFBId ? (GLuint)oldFBId : m_FBOId); /* Is there a dock tile preview enabled in the GUI? If so setup a * additional thumbnail view for the dock tile. */ - NSView *dockScreen = [self dockTileScreen]; - if (dockScreen) + pDockScreen = [self dockTileScreen]; + if (pDockScreen) { if (!m_FBOThumbId) { @@ -885,24 +999,24 @@ while(0); glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_WRAP_S, GL_CLAMP); glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_WRAP_T, GL_CLAMP); - + /* The GPUs like the GL_BGRA / GL_UNSIGNED_INT_8_8_8_8_REV combination * others are also valid, but might incur a costly software translation. */ - glTexImage2D(GL_TEXTURE_RECTANGLE_ARB, 0, GL_RGBA, m_FBOTexSize.width * m_FBOThumbScaleX, m_FBOTexSize.height * m_FBOThumbScaleY, 0, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, NULL); + glTexImage2D(GL_TEXTURE_RECTANGLE_ARB, 0, GL_RGB, m_FBOTexSize.width * m_FBOThumbScaleX, m_FBOTexSize.height * m_FBOThumbScaleY, 0, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, NULL); /* Now attach texture to the FBO as its color destination */ glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_RECTANGLE_ARB, m_FBOThumbTexId, 0); /* Make sure the FBO was created successfully. */ if (GL_FRAMEBUFFER_COMPLETE_EXT != glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT)) - DEBUG_MSG(("Framebuffer Thumb Object creation or update failed!\n")); + DEBUG_MSG(("OVIW(%p): Framebuffer \"Thumb\" Object creation or update failed!\n", (void*)self)); glBindTexture(GL_TEXTURE_RECTANGLE_ARB, oldTexId); - glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, oldFBId ? oldFBId:m_FBOId); + glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, (GLuint)oldFBId ? (GLuint)oldFBId : m_FBOId); m_DockTileView = [[DockOverlayView alloc] init]; [self reshapeDockTile]; - [dockScreen addSubview:m_DockTileView]; + [pDockScreen addSubview:m_DockTileView]; } /* Initialize with one big visual region over the full size */ @@ -913,16 +1027,16 @@ while(0); m_paClipRects[1] = 0; m_paClipRects[2] = m_FBOTexSize.width; m_paClipRects[3] = m_FBOTexSize.height; - - //GL_RESTORE_STATE; +#endif } - (void)deleteFBO { - DEBUG_MSG(("deleteFBO %p\n", self)); + DEBUG_MSG(("OVIW(%p): deleteFBO\n", (void*)self)); + if (m_pSharedGLCtx) { - DEBUG_MSG(("MakeCurrent (shared) %X\n", m_pSharedGLCtx)); + DEBUG_MSG(("OVIW(%p): makeCurrent (shared) %p\n", (void*)self, (void*)m_pSharedGLCtx)); [m_pSharedGLCtx makeCurrentContext]; [m_pSharedGLCtx update]; @@ -932,32 +1046,34 @@ while(0); if (m_pGLCtx) { - DEBUG_MSG(("MakeCurrent %X\n", m_pGLCtx)); + DEBUG_MSG(("OVIW(%p): makeCurrent (non shared) %p\n", (void*)self, (void*)m_pGLCtx)); [m_pGLCtx makeCurrentContext]; +#ifdef FBO if (m_FBODepthStencilPackedId > 0) { glDeleteRenderbuffersEXT(1, &m_FBODepthStencilPackedId); m_FBODepthStencilPackedId = 0; } - if (m_FBOTexId > 0) + if (m_FBOTexBackId > 0) + { + glDeleteTextures(1, &m_FBOTexBackId); + m_FBOTexBackId = 0; + } + if (m_FBOTexFrontId > 0) { - glDeleteTextures(1, &m_FBOTexId); - m_FBOTexId = 0; + glDeleteTextures(1, &m_FBOTexFrontId); + m_FBOTexFrontId = 0; } if (m_FBOId > 0) { - GLint tmpFB; - glGetIntegerv(GL_FRAMEBUFFER_BINDING_EXT, &tmpFB); - - if (tmpFB == m_FBOId) - { + if ([self isCurrentFBO]) glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); - } - + glDeleteFramebuffersEXT(1, &m_FBOId); m_FBOId = 0; } +#endif } if (m_DockTileView != nil) @@ -970,9 +1086,10 @@ while(0); - (void)updateFBO { - DEBUG_MSG(("updateFBO %p\n", self)); + DEBUG_MSG(("OVIW(%p): updateFBO\n", (void*)self)); + [self makeCurrentFBO]; - + if (m_pGLCtx) { #ifdef FBO @@ -986,15 +1103,16 @@ while(0); - (void)makeCurrentFBO { - DEBUG_MSG_1(("MakeCurrent called %X\n", self)); + DEBUG_MSG(("OVIW(%p): makeCurrentFBO\n", (void*)self)); #ifdef FBO + DEBUG_MSG(("OVIW(%p): FBOId=%d CTX=%p\n", (void*)self, m_FBOId, (void*)m_pGLCtx)); if([NSOpenGLContext currentContext] != 0) glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_FBOId); #endif if (m_pGLCtx) { - if ([m_pGLCtx view] != self) + if ([m_pGLCtx view] != self) { /* We change the active view, so flush first */ if([NSOpenGLContext currentContext] != 0) @@ -1002,12 +1120,15 @@ while(0); [m_pGLCtx setView: self]; CHECK_GL_ERROR(); } -// if ([NSOpenGLContext currentContext] != m_pGLCtx) + /* + if ([NSOpenGLContext currentContext] != m_pGLCtx) + */ { - DEBUG_MSG(("MakeCurrent %X\n", m_pGLCtx)); [m_pGLCtx makeCurrentContext]; CHECK_GL_ERROR(); -// [m_pGLCtx update]; + /* + [m_pGLCtx update]; + */ } } #ifdef FBO @@ -1015,28 +1136,77 @@ while(0); #endif } +- (bool)isCurrentFBO +{ +#ifdef FBO + GLint curFBOId = 0; + + glGetIntegerv(GL_FRAMEBUFFER_BINDING_EXT, &curFBOId); + DEBUG_MSG_1(("OVIW(%p): isCurrentFBO: curFBOId=%d FBOId=%d\n", (void*)self, curFBOId, m_FBOId)); + return (GLuint)curFBOId == m_FBOId; +#else + return false; +#endif +} + +- (void)tryDraw +{ + if ([self lockFocusIfCanDraw]) + { + [self renderFBOToView]; + [self unlockFocus]; + } +} + - (void)swapFBO { - DEBUG_MSG_1(("SwapCurrent called %X\n", self)); + GLint sw = 0; + GLint readFBOId = 0; + GLint drawFBOId = 0; + GLint readId = 0; + GLint drawId = 0; + + DEBUG_MSG(("OVIW(%p): swapFBO\n", (void*)self)); #ifdef FBO - GLint tmpFB; - glGetIntegerv(GL_FRAMEBUFFER_BINDING_EXT, &tmpFB); - DEBUG_MSG_1(("Swap GetINT %d\n", tmpFB)); - /* Don't use flush buffers cause we are using FBOs here */ -// [m_pGLCtx flushBuffer]; + /* Don't use flush buffers cause we are using FBOs here! */ + + /* Before we swap make sure everything is done (This is really + * important. Don't remove.) */ glFlush(); -// glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); - DEBUG_MSG_1(("swapFBO bound:%i, self:%i\n", tmpFB, m_FBOId)); - if (tmpFB == m_FBOId) + + /* Fetch the current used read and draw buffers. */ + glGetIntegerv(GL_READ_FRAMEBUFFER_BINDING, &readFBOId); + glGetIntegerv(GL_DRAW_FRAMEBUFFER_BINDING, &drawFBOId); + glGetIntegerv(GL_READ_BUFFER, &readId); + glGetIntegerv(GL_DRAW_BUFFER, &drawId); + + /* Do the swapping of our internal ids */ + sw = m_FBOTexFrontId; + m_FBOTexFrontId = m_FBOTexBackId; + m_FBOTexBackId = sw; + sw = m_FBOAttFrontId; + m_FBOAttFrontId = m_FBOAttBackId; + m_FBOAttBackId = sw; + + DEBUG_MSG_1(("read FBO: %d draw FBO: %d readId: %d drawId: %d\n", readFBOId, drawFBOId, readId, drawId)); + /* We also have to swap the real ids on the current context. */ + if ((GLuint)readFBOId == m_FBOId) { - if ([self lockFocusIfCanDraw]) - { - [self renderFBOToView]; - [self unlockFocus]; - } + if ((GLuint)readId == m_FBOAttFrontId) + glReadBuffer(m_FBOAttBackId); + if ((GLuint)readId == m_FBOAttBackId) + glReadBuffer(m_FBOAttFrontId); + } + if ((GLuint)drawFBOId == m_FBOId) + { + if ((GLuint)drawId == m_FBOAttFrontId) + glDrawBuffer(m_FBOAttBackId); + if ((GLuint)drawId == m_FBOAttBackId) + glDrawBuffer(m_FBOAttFrontId); } -// glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_FBOId); + + [self tryDraw]; #else [m_pGLCtx flushBuffer]; #endif @@ -1044,58 +1214,183 @@ while(0); - (void)flushFBO { - GLint tmpFB; - glGetIntegerv(GL_FRAMEBUFFER_BINDING_EXT, &tmpFB); + GLint drawId = 0; + GLint FBOId = 0; + + DEBUG_MSG(("OVIW(%p): flushFBO\n", (void*)self)); + glFlush(); -// glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); - DEBUG_MSG_1 (("Flush GetINT %d\n", tmpFB)); - if (tmpFB == m_FBOId) +#ifdef FBO + /* If at any time OpenGl operations where done in the front buffer, we need + * to reflect this in the FBO as well. This is something which on real + * hardware happens and unfortunately some applications rely on it (grrr ... Compiz). */ + if ( m_fFrontDrawing + && [self isCurrentFBO]) { - if ([self lockFocusIfCanDraw]) - { - [self renderFBOToView]; - [self unlockFocus]; - } + /* Only reset if we aren't currently front. */ + glGetIntegerv(GL_DRAW_FRAMEBUFFER_BINDING, &FBOId); + glGetIntegerv(GL_DRAW_BUFFER, &drawId); + if (!( (GLuint)FBOId == m_FBOId + && (GLuint)drawId == m_FBOAttFrontId)) + m_fFrontDrawing = false; + [self tryDraw]; } -// glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_FBOId); +#endif } - (void)finishFBO { - GLint tmpFB; - glGetIntegerv(GL_FRAMEBUFFER_BINDING_EXT, &tmpFB); + DEBUG_MSG(("OVIW(%p): finishFBO\n", (void*)self)); + glFinish(); - // glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); - DEBUG_MSG_1 (("Finish GetINT %d\n", tmpFB)); - if (tmpFB == m_FBOId) +#ifdef FBO + if ([self isCurrentFBO]) + [self tryDraw]; +#endif +} + +- (void)stateInfo:(GLenum)pname withParams:(GLint*)params +{ + GLint test; +// DEBUG_MSG_1(("StateInfo requested: %d\n", pname)); + + glGetIntegerv(pname, params); +#ifdef FBO + switch(pname) { - if ([self lockFocusIfCanDraw]) + case GL_FRAMEBUFFER_BINDING_EXT: + case GL_READ_FRAMEBUFFER_BINDING: + case GL_READ_FRAMEBUFFER_EXT: + case GL_DRAW_FRAMEBUFFER_EXT: + { + if ((GLuint)*params == m_FBOId) + *params = 0; + break; + } + case GL_READ_BUFFER: + { + glGetIntegerv(GL_READ_FRAMEBUFFER_BINDING, &test); + if ((GLuint)test == m_FBOId) + { + if ((GLuint)*params == m_FBOAttFrontId) + *params = GL_FRONT; + else + if ((GLuint)*params == m_FBOAttBackId) + *params = GL_BACK; + } + break; + } + case GL_DRAW_BUFFER: { - [self renderFBOToView]; - [self unlockFocus]; + glGetIntegerv(GL_DRAW_FRAMEBUFFER_BINDING, &test); + if ((GLuint)test == m_FBOId) + { + if ((GLuint)*params == m_FBOAttFrontId) + *params = GL_FRONT; + else + if ((GLuint)*params == m_FBOAttBackId) + *params = GL_BACK; + } + break; } } -// glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_FBOId); +#endif } -- (void)bindFBO +- (void)readBuffer:(GLenum)mode { - glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_FBOId); +#ifdef FBO + /* + if ([self isCurrentFBO]) + */ + { + if (mode == GL_FRONT) + { + glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, m_FBOId); + glReadBuffer(m_FBOAttFrontId); + } + else if (mode == GL_BACK) + { + glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, m_FBOId); + glReadBuffer(m_FBOAttBackId); + } + else + glReadBuffer(mode); + } +#else + glReadBuffer(mode); +#endif +} + +- (void)drawBuffer:(GLenum)mode +{ +#ifdef FBO + /* + if ([self isCurrentFBO]) + */ + { + if (mode == GL_FRONT) + { + DEBUG_MSG(("OVIW(%p): front\n", (void*)self)); + glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, m_FBOId); + glDrawBuffer(m_FBOAttFrontId); + m_fFrontDrawing = true; + } + else if (mode == GL_BACK) + { + DEBUG_MSG(("OVIW(%p): back\n", (void*)self)); + glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, m_FBOId); + glDrawBuffer(m_FBOAttBackId); + } + else + { + DEBUG_MSG(("OVIW(%p): other: %d\n", (void*)self, mode)); + glDrawBuffer(mode); + } + } +#else + glDrawBuffer(mode); +#endif +} + +- (void)bindFBO:(GLenum)target withFrameBuffer:(GLuint)framebuffer +{ +#ifdef FBO + if (framebuffer != 0) + glBindFramebufferEXT(target, framebuffer); + else + glBindFramebufferEXT(target, m_FBOId); +#else + glBindFramebufferEXT(target, framebuffer); +#endif } - (void)renderFBOToView { + GLint opaque = 0; + GLint i = 0; + GLint oldReadFBOId = 0; + GLint oldDrawFBOId = 0; + GLint oldReadId = 0; + GLint oldDrawId = 0; + + DEBUG_MSG(("OVIW(%p): renderFBOToView\n", (void*)self)); + +#ifdef FBO + + /* Fetch the current used read and draw buffers. */ + glGetIntegerv(GL_READ_FRAMEBUFFER_BINDING_EXT, &oldReadFBOId); + glGetIntegerv(GL_DRAW_FRAMEBUFFER_BINDING_EXT, &oldDrawFBOId); + glGetIntegerv(GL_READ_BUFFER, &oldReadId); + glGetIntegerv(GL_DRAW_BUFFER, &oldDrawId); + if (!m_pSharedGLCtx) { /* Create a shared context out of the main context. Use the same pixel format. */ m_pSharedGLCtx = [[NSOpenGLContext alloc] initWithFormat:[(OverlayOpenGLContext*)m_pGLCtx openGLPixelFormat] shareContext:m_pGLCtx]; /* Set the new context as non opaque */ - GLint opaque = 0; - [m_pSharedGLCtx setValues:&opaque forParameter:NSOpenGLCPSurfaceOpacity]; - /* Only swap on screen refresh */ -// GLint swap = 1; -// [m_pSharedGLCtx setValues:&swap forParameter:NSOpenGLCPSwapInterval]; + [m_pSharedGLCtx setValues:&opaque forParameter:NSOpenGLCPSurfaceOpacity]; /* Set this view as the drawable for the new context */ [m_pSharedGLCtx setView: self]; [self updateViewport]; @@ -1104,140 +1399,137 @@ while(0); if (m_pSharedGLCtx) { NSRect r = [self frame]; - DEBUG_MSG_1(("rF2V frame[%i, %i, %i, %i]\n", (int)r.origin.x, (int)r.origin.y, (int)r.size.width, (int)r.size.height)); + DEBUG_MSG(("OVIW(%p): rF2V frame: [%i, %i, %i, %i]\n", (void*)self, (int)r.origin.x, (int)r.origin.y, (int)r.size.width, (int)r.size.height)); - if (m_FBOTexId > 0) + if (m_FBOTexFrontId > 0) { if ([m_pSharedGLCtx view] != self) { - DEBUG_MSG(("renderFBOToView: not current view of shared ctx!")); + DEBUG_MSG(("OVIW(%p): not current view of shared ctx! Switching ...\n", (void*)self)); [m_pSharedGLCtx setView: self]; [self updateViewport]; } - //DEBUG_MSG(("MakeCurrent (shared) %X\n", m_pSharedGLCtx)); [m_pSharedGLCtx makeCurrentContext]; - - if (m_FBOThumbTexId > 0 && - [m_DockTileView thumbBitmap] != nil) + + glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, m_FBOId); + glReadBuffer(m_FBOAttFrontId); + glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, 0); + glDrawBuffer(GL_BACK); + + /* Render FBO content to the dock tile when necessary. */ + [self renderFBOToDockTile]; + +#if 1 /* Set to 0 to see the docktile instead of the real output */ + /* Clear background to transparent */ + glClear(GL_COLOR_BUFFER_BIT); + + /* Blit the content of the FBO to the screen. */ + for (i = 0; i < m_cClipRects; ++i) { - /* Only update after at least 200 ms, cause glReadPixels is - * heavy performance wise. */ - uint64_t uiNewTime = RTTimeMilliTS(); - if (uiNewTime - m_uiDockUpdateTime > 200) - { - m_uiDockUpdateTime = uiNewTime; -#if 0 - /* todo: check this for optimization */ - glBindTexture(GL_TEXTURE_RECTANGLE_ARB, myTextureName); - glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_STORAGE_HINT_APPLE, - GL_STORAGE_SHARED_APPLE); - glPixelStorei(GL_UNPACK_CLIENT_STORAGE_APPLE, GL_TRUE); - glTexImage2D(GL_TEXTURE_RECTANGLE_ARB, 0, GL_RGBA, - sizex, sizey, 0, GL_BGRA, - GL_UNSIGNED_INT_8_8_8_8_REV, myImagePtr); - glCopyTexSubImage2D(GL_TEXTURE_RECTANGLE_ARB, - 0, 0, 0, 0, 0, image_width, image_height); - glFlush(); - // Do other work processing here, using a double or triple buffer - glGetTexImage(GL_TEXTURE_RECTANGLE_ARB, 0, GL_BGRA, - GL_UNSIGNED_INT_8_8_8_8_REV, pixels); + GLint x1 = m_paClipRects[4*i]; + GLint y1 = r.size.height - m_paClipRects[4*i+1]; + GLint x2 = m_paClipRects[4*i+2]; + GLint y2 = r.size.height - m_paClipRects[4*i+3]; + glBlitFramebufferEXT(x1, y1 + m_RootShift.y, x2, y2 + m_RootShift.y, + x1 - m_RootShift.x, y1, x2 - m_RootShift.x, y2, + GL_COLOR_BUFFER_BIT, GL_NEAREST); + } #endif + /* + glFinish(); + */ + glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); + [m_pSharedGLCtx flushBuffer]; - GL_SAVE_STATE; - glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_FBOThumbId); - - /* We like to read from the primary color buffer */ - glReadBuffer(GL_COLOR_ATTACHMENT0_EXT); - - NSRect rr = [m_DockTileView frame]; - - /* Setup all matrices */ - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glViewport(0, 0, rr.size.width, rr.size.height); - glOrtho(0, rr.size.width, 0, rr.size.height, -1, 1); - glScalef(m_FBOThumbScaleX, m_FBOThumbScaleY, 1.0f); - glMatrixMode(GL_TEXTURE); - glLoadIdentity(); - glTranslatef(0.0f, m_RootShift.y, 0.0f); - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - - /* Clear background to transparent */ - glClearColor(0.0f, 0.0f, 0.0f, 0.0f); - glClear(GL_COLOR_BUFFER_BIT); - - glEnable(GL_TEXTURE_RECTANGLE_ARB); - glBindTexture(GL_TEXTURE_RECTANGLE_ARB, m_FBOTexId); - GLint i; - for (i = 0; i < m_cClipRects; ++i) - { - GLint x1 = m_paClipRects[4*i]; - GLint y1 = (r.size.height - m_paClipRects[4*i+1]); - GLint x2 = m_paClipRects[4*i+2]; - GLint y2 = (r.size.height - m_paClipRects[4*i+3]); - glBegin(GL_QUADS); - { - glTexCoord2i(x1, y1); glVertex2i(x1, y1); - glTexCoord2i(x1, y2); glVertex2i(x1, y2); - glTexCoord2i(x2, y2); glVertex2i(x2, y2); - glTexCoord2i(x2, y1); glVertex2i(x2, y1); - } - glEnd(); - } - glFinish(); - - /* Here the magic of reading the FBO content in our own buffer - * happens. We have to lock this access, in the case the dock - * is updated currently. */ - [m_DockTileView lock]; - glReadPixels(0, 0, rr.size.width, rr.size.height, - GL_RGBA, - GL_UNSIGNED_BYTE, - [[m_DockTileView thumbBitmap] bitmapData]); - [m_DockTileView unlock]; - - NSDockTile *pDT = [[NSApplication sharedApplication] dockTile]; - - /* Send a display message to the dock tile in the main thread */ - [[[NSApplication sharedApplication] dockTile] performSelectorOnMainThread:@selector(display) withObject:nil waitUntilDone:NO]; - - glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); - GL_RESTORE_STATE; - } - } + [m_pGLCtx makeCurrentContext]; + /* Reset to previous buffer bindings. */ + glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, oldReadFBOId); + glReadBuffer(oldReadId); + glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, oldDrawFBOId); + glDrawBuffer(oldDrawId); + } + } +#else + [m_pGLCtx flushBuffer]; +#endif +} + +- (void)renderFBOToDockTile +{ + NSRect r = [self frame]; + NSRect rr = NSZeroRect; + GLint i = 0; + NSDockTile *pDT = nil; +#ifdef FBO + if ( m_FBOThumbId + && m_FBOThumbTexId + && [m_DockTileView thumbBitmap] != nil) + { + /* Only update after at least 200 ms, cause glReadPixels is + * heavy performance wise. */ + uint64_t uiNewTime = RTTimeMilliTS(); + if (uiNewTime - m_uiDockUpdateTime > 200) + { + m_uiDockUpdateTime = uiNewTime; +#if 0 + /* todo: check this for optimization */ + glBindTexture(GL_TEXTURE_RECTANGLE_ARB, myTextureName); + glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_STORAGE_HINT_APPLE, + GL_STORAGE_SHARED_APPLE); + glPixelStorei(GL_UNPACK_CLIENT_STORAGE_APPLE, GL_TRUE); + glTexImage2D(GL_TEXTURE_RECTANGLE_ARB, 0, GL_RGBA, + sizex, sizey, 0, GL_BGRA, + GL_UNSIGNED_INT_8_8_8_8_REV, myImagePtr); + glCopyTexSubImage2D(GL_TEXTURE_RECTANGLE_ARB, + 0, 0, 0, 0, 0, image_width, image_height); + glFlush(); + /* Do other work processing here, using a double or triple buffer */ + glGetTexImage(GL_TEXTURE_RECTANGLE_ARB, 0, GL_BGRA, + GL_UNSIGNED_INT_8_8_8_8_REV, pixels); +#endif /* Clear background to transparent */ glClear(GL_COLOR_BUFFER_BIT); - glEnable(GL_TEXTURE_RECTANGLE_ARB); - glBindTexture(GL_TEXTURE_RECTANGLE_ARB, m_FBOTexId); + rr = [m_DockTileView frame]; - /* Blit the content of the FBO to the screen. todo: check for - * optimization with display lists. */ - GLint i; for (i = 0; i < m_cClipRects; ++i) { GLint x1 = m_paClipRects[4*i]; GLint y1 = r.size.height - m_paClipRects[4*i+1]; GLint x2 = m_paClipRects[4*i+2]; GLint y2 = r.size.height - m_paClipRects[4*i+3]; - glBegin(GL_QUADS); - { - glTexCoord2i(x1, y1); glVertex2i(x1, y1); - glTexCoord2i(x1, y2); glVertex2i(x1, y2); - glTexCoord2i(x2, y2); glVertex2i(x2, y2); - glTexCoord2i(x2, y1); glVertex2i(x2, y1); - } - glEnd(); + + glBlitFramebufferEXT(x1, y1 + m_RootShift.y, x2, y2 + m_RootShift.y, + x1 * m_FBOThumbScaleX, y1 * m_FBOThumbScaleY, x2 * m_FBOThumbScaleX, y2 * m_FBOThumbScaleY, + GL_COLOR_BUFFER_BIT, GL_LINEAR); } glFinish(); - [m_pSharedGLCtx flushBuffer]; - //DEBUG_MSG(("MakeCurrent %X\n", m_pGLCtx)); - [m_pGLCtx makeCurrentContext]; + + glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, 0); + glReadBuffer(GL_BACK); + /* Here the magic of reading the FBO content in our own buffer + * happens. We have to lock this access, in the case the dock + * is updated currently. */ + [m_DockTileView lock]; + glReadPixels(0, 0, rr.size.width, rr.size.height, + GL_BGRA, + GL_UNSIGNED_INT_8_8_8_8, + [[m_DockTileView thumbBitmap] bitmapData]); + [m_DockTileView unlock]; + + glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, m_FBOId); + glReadBuffer(m_FBOAttFrontId); + + pDT = [[NSApplication sharedApplication] dockTile]; + + /* Send a display message to the dock tile in the main thread */ + [[[NSApplication sharedApplication] dockTile] performSelectorOnMainThread:@selector(display) withObject:nil waitUntilDone:NO]; + } } +#endif } - (void)clearVisibleRegions @@ -1252,11 +1544,11 @@ while(0); - (void)setVisibleRegions:(GLint)cRects paRects:(GLint*)paRects { - DEBUG_MSG_1(("New region received\n")); + DEBUG_MSG_1(("OVIW(%p): setVisibleRegions: cRects=%d\n", (void*)self, cRects)); [self clearVisibleRegions]; - if (cRects>0) + if (cRects > 0) { m_paClipRects = (GLint*)RTMemAlloc(sizeof(GLint) * 4 * cRects); m_cClipRects = cRects; @@ -1280,6 +1572,8 @@ while(0); - (void)reshapeDockTile { + NSRect newFrame = NSZeroRect; + NSView *pView = [self dockTileScreen]; if (pView != nil) { @@ -1288,10 +1582,12 @@ while(0); m_FBOThumbScaleX = (float)dockFrame.size.width / parentFrame.size.width; m_FBOThumbScaleY = (float)dockFrame.size.height / parentFrame.size.height; - NSRect newFrame = NSMakeRect ((int)(m_Pos.x * m_FBOThumbScaleX), (int)(dockFrame.size.height - (m_Pos.y + m_Size.height - m_RootShift.y) * m_FBOThumbScaleY), (int)(m_Size.width * m_FBOThumbScaleX), (int)(m_Size.height * m_FBOThumbScaleY)); -// NSRect newFrame = NSMakeRect ((int)roundf(m_Pos.x * m_FBOThumbScaleX), (int)roundf(dockFrame.size.height - (m_Pos.y + m_Size.height) * m_FBOThumbScaleY), (int)roundf(m_Size.width * m_FBOThumbScaleX), (int)roundf(m_Size.height * m_FBOThumbScaleY)); -// NSRect newFrame = NSMakeRect ((m_Pos.x * m_FBOThumbScaleX), (dockFrame.size.height - (m_Pos.y + m_Size.height) * m_FBOThumbScaleY), (m_Size.width * m_FBOThumbScaleX), (m_Size.height * m_FBOThumbScaleY)); -// printf ("%f %f %f %f - %f %f\n", newFrame.origin.x, newFrame.origin.y, newFrame.size.width, newFrame.size.height, m_Size.height, m_FBOThumbScaleY); + newFrame = NSMakeRect((int)(m_Pos.x * m_FBOThumbScaleX), (int)(dockFrame.size.height - (m_Pos.y + m_Size.height - m_RootShift.y) * m_FBOThumbScaleY), (int)(m_Size.width * m_FBOThumbScaleX), (int)(m_Size.height * m_FBOThumbScaleY)); + /* + NSRect newFrame = NSMakeRect ((int)roundf(m_Pos.x * m_FBOThumbScaleX), (int)roundf(dockFrame.size.height - (m_Pos.y + m_Size.height) * m_FBOThumbScaleY), (int)roundf(m_Size.width * m_FBOThumbScaleX), (int)roundf(m_Size.height * m_FBOThumbScaleY)); + NSRect newFrame = NSMakeRect ((m_Pos.x * m_FBOThumbScaleX), (dockFrame.size.height - (m_Pos.y + m_Size.height) * m_FBOThumbScaleY), (m_Size.width * m_FBOThumbScaleX), (m_Size.height * m_FBOThumbScaleY)); + printf ("%f %f %f %f - %f %f\n", newFrame.origin.x, newFrame.origin.y, newFrame.size.width, newFrame.size.height, m_Size.height, m_FBOThumbScaleY); + */ [m_DockTileView setFrame: newFrame]; } } @@ -1305,16 +1601,19 @@ while(0); ********************************************************************************/ void cocoaGLCtxCreate(NativeNSOpenGLContextRef *ppCtx, GLbitfield fVisParams) { + NSOpenGLPixelFormat *pFmt = nil; + NSAutoreleasePool *pPool = [[NSAutoreleasePool alloc] init]; - NSOpenGLPixelFormatAttribute attribs[24] = + NSOpenGLPixelFormatAttribute attribs[24] = { NSOpenGLPFAWindow, NSOpenGLPFAAccelerated, NSOpenGLPFAColorSize, (NSOpenGLPixelFormatAttribute)24 }; - + int i = 4; + if (fVisParams & CR_ALPHA_BIT) { DEBUG_MSG(("CR_ALPHA_BIT requested\n")); @@ -1333,7 +1632,7 @@ void cocoaGLCtxCreate(NativeNSOpenGLContextRef *ppCtx, GLbitfield fVisParams) attribs[i++] = NSOpenGLPFAStencilSize; attribs[i++] = 8; } - if (fVisParams & CR_ACCUM_BIT) + if (fVisParams & CR_ACCUM_BIT) { DEBUG_MSG(("CR_ACCUM_BIT requested\n")); attribs[i++] = NSOpenGLPFAAccumSize; @@ -1342,7 +1641,7 @@ void cocoaGLCtxCreate(NativeNSOpenGLContextRef *ppCtx, GLbitfield fVisParams) else attribs[i++] = 24; } - if (fVisParams & CR_MULTISAMPLE_BIT) + if (fVisParams & CR_MULTISAMPLE_BIT) { DEBUG_MSG(("CR_MULTISAMPLE_BIT requested\n")); attribs[i++] = NSOpenGLPFASampleBuffers; @@ -1357,26 +1656,30 @@ void cocoaGLCtxCreate(NativeNSOpenGLContextRef *ppCtx, GLbitfield fVisParams) } if (fVisParams & CR_STEREO_BIT) { - DEBUG_MSG(("CR_DOUBLE_BIT requested\n")); + /* We don't support that. + DEBUG_MSG(("CR_STEREO_BIT requested\n")); attribs[i++] = NSOpenGLPFAStereo; + */ } - + /* Mark the end */ attribs[i++] = 0; /* Choose a pixel format */ - NSOpenGLPixelFormat* pFmt = [[NSOpenGLPixelFormat alloc] initWithAttributes:attribs]; - + pFmt = [[NSOpenGLPixelFormat alloc] initWithAttributes:attribs]; + if (pFmt) { *ppCtx = [[OverlayOpenGLContext alloc] initWithFormat:pFmt shareContext:nil]; /* Enable multi threaded OpenGL engine */ -// CGLContextObj cglCtx = [*ppCtx CGLContextObj]; -// CGLError err = CGLEnable(cglCtx, kCGLCEMPEngine); -// if (err != kCGLNoError) -// printf ("Couldn't enable MT OpenGL engine!\n"); - + /* + CGLContextObj cglCtx = [*ppCtx CGLContextObj]; + CGLError err = CGLEnable(cglCtx, kCGLCEMPEngine); + if (err != kCGLNoError) + printf ("Couldn't enable MT OpenGL engine!\n"); + */ + DEBUG_MSG(("New context %X\n", (uint)*ppCtx)); } @@ -1387,7 +1690,9 @@ void cocoaGLCtxDestroy(NativeNSOpenGLContextRef pCtx) { NSAutoreleasePool *pPool = [[NSAutoreleasePool alloc] init]; -// [pCtx release]; + /* + [pCtx release]; + */ [pPool release]; } @@ -1445,29 +1750,39 @@ void cocoaViewReparent(NativeNSViewRef pView, NativeNSViewRef pParentView) void cocoaViewDestroy(NativeNSViewRef pView) { + NSWindow *pWin = nil; + NSAutoreleasePool *pPool = [[NSAutoreleasePool alloc] init]; /* Hide the view early */ [pView setHidden: YES]; - NSWindow *win = [pView window]; - [[NSNotificationCenter defaultCenter] removeObserver:win]; - [win setContentView: nil]; - [[win parentWindow] removeChildWindow: win]; - int b = [win retainCount]; -// for (; b > 1; --b) -// [win performSelector:@selector(release)] - [win performSelectorOnMainThread:@selector(release) withObject:nil waitUntilDone:YES]; -// [win release]; + pWin = [pView window]; + [[NSNotificationCenter defaultCenter] removeObserver:pWin]; + [pWin setContentView: nil]; + [[pWin parentWindow] removeChildWindow: pWin]; + /* + a = [pWin retainCount]; + for (; a > 1; --a) + [pWin performSelector:@selector(release)] + */ + [pWin performSelectorOnMainThread:@selector(release) withObject:nil waitUntilDone:YES]; + /* + [pWin release]; + */ /* There seems to be a bug in the performSelector method which is called in * parentWindowChanged above. The object is retained but not released. This * results in an unbalanced reference count, which is here manually * decremented. */ - int a = [pView retainCount]; -// for (; a > 1; --a) + /* + a = [pView retainCount]; + for (; a > 1; --a) + */ [pView performSelectorOnMainThread:@selector(release) withObject:nil waitUntilDone:YES]; -// [pView release]; + /* + [pView release]; + */ [pPool release]; } @@ -1482,10 +1797,10 @@ void cocoaViewShow(NativeNSViewRef pView, GLboolean fShowIt) } void cocoaViewDisplay(NativeNSViewRef pView) -{ +{ NSAutoreleasePool *pPool = [[NSAutoreleasePool alloc] init]; - DEBUG_MSG_1(("cocoaViewDisplay %p\n", pView)); + DEBUG_MSG_1(("cocoaViewDisplay %p\n", (void*)pView)); [(OverlayView*)pView swapFBO]; [pPool release]; @@ -1528,7 +1843,7 @@ void cocoaViewMakeCurrentContext(NativeNSViewRef pView, NativeNSOpenGLContextRef NSAutoreleasePool *pPool = [[NSAutoreleasePool alloc] init]; DEBUG_MSG(("cocoaViewMakeCurrentContext(%p, %p)\n", (void*)pView, (void*)pCtx)); - + [(OverlayView*)pView setGLCtx:pCtx]; [(OverlayView*)pView makeCurrentFBO]; @@ -1549,53 +1864,71 @@ void cocoaViewSetVisibleRegion(NativeNSViewRef pView, GLint cRects, GLint* paRec * Additional OpenGL wrapper * ********************************************************************************/ -void cocoaFlush(void) +static void performSelectorOnView(SEL selector) { - NSAutoreleasePool *pPool = [[NSAutoreleasePool alloc] init]; - -// glFlush(); -// return; - - DEBUG_MSG_1(("glFlush called\n")); - -#ifdef FBO NSOpenGLContext *pCtx = [NSOpenGLContext currentContext]; + if (pCtx) { NSView *pView = [pCtx view]; if (pView) { - if ([pView respondsToSelector:@selector(flushFBO)]) - [pView performSelector:@selector(flushFBO)]; + if ([pView respondsToSelector:selector]) + [pView performSelector:selector]; } } -#else - glFlush(); -#endif - - [pPool release]; } -void cocoaFinish(void) +static void performSelectorOnViewOneArg(SEL selector, id arg1) { - NSAutoreleasePool *pPool = [[NSAutoreleasePool alloc] init]; + NSOpenGLContext *pCtx = [NSOpenGLContext currentContext]; - DEBUG_MSG_1(("glFinish called\n")); + if (pCtx) + { + NSView *pView = [pCtx view]; + if (pView) + { + if ([pView respondsToSelector:selector]) + [pView performSelector:selector withObject:arg1]; + } + } +} -#ifdef FBO +static void performSelectorOnViewTwoArgs(SEL selector, id arg1, id arg2) +{ NSOpenGLContext *pCtx = [NSOpenGLContext currentContext]; + if (pCtx) { NSView *pView = [pCtx view]; if (pView) { - if ([pView respondsToSelector:@selector(finishFBO)]) - [pView performSelector:@selector(finishFBO)]; + if ([pView respondsToSelector:selector]) + [pView performSelector:selector withObject:arg1 withObject:arg2]; } } -#else - glFinish(); -#endif +} + +void cocoaFlush(void) +{ + NSOpenGLContext *pCtx = nil; + + NSAutoreleasePool *pPool = [[NSAutoreleasePool alloc] init]; + + DEBUG_MSG_1(("glFlush called\n")); + + performSelectorOnView(@selector(flushFBO)); + + [pPool release]; +} + +void cocoaFinish(void) +{ + NSAutoreleasePool *pPool = [[NSAutoreleasePool alloc] init]; + + DEBUG_MSG_1(("glFinish called\n")); + + performSelectorOnView(@selector(finishFBO)); [pPool release]; } @@ -1604,28 +1937,63 @@ void cocoaBindFramebufferEXT(GLenum target, GLuint framebuffer) { NSAutoreleasePool *pPool = [[NSAutoreleasePool alloc] init]; - DEBUG_MSG(("glRenderspuBindFramebufferEXT called %d\n", framebuffer)); + DEBUG_MSG_1(("glBindFramebufferEXT called target: %d fb: %d\n", target, framebuffer)); + + performSelectorOnViewTwoArgs(@selector(bindFBO:withFrameBuffer:), (id)target, (id)framebuffer); + + [pPool release]; +} + +void cocoaCopyPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type) +{ + NSAutoreleasePool *pPool = [[NSAutoreleasePool alloc] init]; + GLbitfield mask = GL_COLOR_BUFFER_BIT; + + DEBUG_MSG_1(("glCopyPixels called: %d,%d-%dx%d type: %d\n", x, y, width, height, type)); #ifdef FBO - if (framebuffer != 0) - glBindFramebufferEXT(target, framebuffer); - else - { - NSOpenGLContext *pCtx = [NSOpenGLContext currentContext]; - if (pCtx) - { - NSView *pView = [pCtx view]; - if (pView) - { - if ([pView respondsToSelector:@selector(bindFBO)]) - [pView performSelector:@selector(bindFBO)]; - } - } - } + if (type == GL_DEPTH) + mask = GL_DEPTH_BUFFER_BIT; + else if (type == GL_STENCIL) + mask = GL_STENCIL_BUFFER_BIT; + glBlitFramebufferEXT(x, y, x + width, y + height, x, y, x + width, y + height, mask, GL_NEAREST); #else - glBindFramebufferEXT(target, framebuffer); + glCopyPixels(x, y, width, height, type); #endif [pPool release]; } +void cocoaGetIntegerv(GLenum pname, GLint *params) +{ + NSAutoreleasePool *pPool = [[NSAutoreleasePool alloc] init]; + +// DEBUG_MSG_1(("getIntergerv called: %d\n", pname)); + + performSelectorOnViewTwoArgs(@selector(stateInfo:withParams:), (id)pname, (id)params); + + [pPool release]; +} + +void cocoaReadBuffer(GLenum mode) +{ + NSAutoreleasePool *pPool = [[NSAutoreleasePool alloc] init]; + + DEBUG_MSG_1(("glReadBuffer called: %d\n", mode)); + + performSelectorOnViewOneArg(@selector(readBuffer:), (id)mode); + + [pPool release]; +} + +void cocoaDrawBuffer(GLenum mode) +{ + NSAutoreleasePool *pPool = [[NSAutoreleasePool alloc] init]; + + DEBUG_MSG_1(("glDrawBuffer called: %d\n", mode)); + + performSelectorOnViewOneArg(@selector(drawBuffer:), (id)mode); + + [pPool release]; +} + diff --git a/src/VBox/HostServices/auth/Makefile.kmk b/src/VBox/HostServices/auth/Makefile.kmk index 74a740223..f23dcabf1 100644 --- a/src/VBox/HostServices/auth/Makefile.kmk +++ b/src/VBox/HostServices/auth/Makefile.kmk @@ -38,7 +38,9 @@ VBoxAuth_LDFLAGS.darwin = -framework DirectoryService # The simple plugin. ifndef VBOX_ONLY_SDK - DLLS += VBoxAuthSimple + if defined(VBOX_WITH_MAIN) + DLLS += VBoxAuthSimple + endif endif VBoxAuthSimple_TEMPLATE = VBOXMAINCLIENTDLL VBoxAuthSimple_SOURCES = simple/VBoxAuthSimple.cpp diff --git a/src/VBox/Installer/linux/VBox.sh b/src/VBox/Installer/linux/VBox.sh index 3de227978..e427872f6 100755 --- a/src/VBox/Installer/linux/VBox.sh +++ b/src/VBox/Installer/linux/VBox.sh @@ -1,8 +1,8 @@ #!/bin/sh # -# Oracle VM VirtualBox +# Oracle VM VirtualBox startup script, Linux hosts. # -# Copyright (C) 2006-2010 Oracle Corporation +# Copyright (C) 2006-2011 Oracle Corporation # # This file is part of VirtualBox Open Source Edition (OSE), as # available from http://www.virtualbox.org. This file is free software; @@ -77,29 +77,32 @@ if [ "$SHUTDOWN" = "true" ]; then exit 0 fi -APP=`which $0` -APP=`basename $APP` -APP=${APP##/*/} +APP=`basename $0` case "$APP" in - VirtualBox|virtualbox) - exec "$INSTALL_DIR/VirtualBox" "$@" - ;; - VBoxManage|vboxmanage) - exec "$INSTALL_DIR/VBoxManage" "$@" - ;; - VBoxSDL|vboxsdl) - exec "$INSTALL_DIR/VBoxSDL" "$@" - ;; - VBoxVRDP|VBoxHeadless|vboxheadless) - exec "$INSTALL_DIR/VBoxHeadless" "$@" - ;; - VBoxBalloonCtrl|vboxballoonctrl) - exec "$INSTALL_DIR/VBoxBalloonCtrl" "$@" - ;; - vboxwebsrv) - exec "$INSTALL_DIR/vboxwebsrv" "$@" - ;; - *) - echo "Unknown application - $APP" - ;; + VirtualBox|virtualbox) + exec "$INSTALL_DIR/VirtualBox" "$@" + ;; + VBoxManage|vboxmanage) + exec "$INSTALL_DIR/VBoxManage" "$@" + ;; + VBoxSDL|vboxsdl) + exec "$INSTALL_DIR/VBoxSDL" "$@" + ;; + VBoxVRDP|VBoxHeadless|vboxheadless) + exec "$INSTALL_DIR/VBoxHeadless" "$@" + ;; + VBoxBalloonCtrl|vboxballoonctrl) + exec "$INSTALL_DIR/VBoxBalloonCtrl" "$@" + ;; + vboxwebsrv) + exec "$INSTALL_DIR/vboxwebsrv" "$@" + ;; + VBoxBFE|vboxbfe) + exec "$INSTALL_DIR/VBoxBFE" "$@" + ;; + *) + echo "Unknown application - $APP" + exit 1 + ;; esac +exit 0 diff --git a/src/VBox/Installer/solaris/VBox.sh b/src/VBox/Installer/solaris/VBox.sh index a55f540a6..a2b21e622 100755 --- a/src/VBox/Installer/solaris/VBox.sh +++ b/src/VBox/Installer/solaris/VBox.sh @@ -1,8 +1,8 @@ #!/bin/sh # -# VirtualBox startup script, Solaris hosts. +# Oracle VM VirtualBox startup script, Solaris hosts. # -# Copyright (C) 2007-2010 Oracle Corporation +# Copyright (C) 2006-2011 Oracle Corporation # # This file is part of VirtualBox Open Source Edition (OSE), as # available from http://www.virtualbox.org. This file is free software; @@ -19,32 +19,36 @@ if test "$CURRENT_ISA" = "amd64"; then else INSTALL_DIR="/opt/VirtualBox/i386" fi -APP=`which $0` -APP=`basename $APP` + +APP=`basename $0` case "$APP" in - VirtualBox) - exec "$INSTALL_DIR/VirtualBox" "$@" - ;; - VBoxManage) - exec "$INSTALL_DIR/VBoxManage" "$@" - ;; - VBoxSDL) - exec "$INSTALL_DIR/VBoxSDL" "$@" - ;; - VBoxVRDP) - exec "$INSTALL_DIR/VBoxHeadless" "$@" - ;; - VBoxHeadless) - exec "$INSTALL_DIR/VBoxHeadless" "$@" - ;; - VBoxQtconfig) - exec "$INSTALL_DIR/VBoxQtconfig" "$@" - ;; - VBoxBFE) - exec "$INSTALL_DIR/VBoxBFE" "$@" - ;; - *) - echo "Unknown application - $APP" - ;; + VirtualBox|virtualbox) + exec "$INSTALL_DIR/VirtualBox" "$@" + ;; + VBoxManage|vboxmanage) + exec "$INSTALL_DIR/VBoxManage" "$@" + ;; + VBoxSDL|vboxsdl) + exec "$INSTALL_DIR/VBoxSDL" "$@" + ;; + VBoxVRDP|VBoxHeadless|vboxheadless) + exec "$INSTALL_DIR/VBoxHeadless" "$@" + ;; + VBoxBalloonCtrl|vboxballoonctrl) + exec "$INSTALL_DIR/VBoxBalloonCtrl" "$@" + ;; + vboxwebsrv) + exec "$INSTALL_DIR/vboxwebsrv" "$@" + ;; + VBoxBFE|vboxbfe) + exec "$INSTALL_DIR/VBoxBFE" "$@" + ;; + VBoxQtconfig) + exec "$INSTALL_DIR/VBoxQtconfig" "$@" + ;; + *) + echo "Unknown application - $APP" + exit 1 + ;; esac - +exit 0 diff --git a/src/VBox/Installer/solaris/makepackage.sh b/src/VBox/Installer/solaris/makepackage.sh index 0cf7ca3e1..9261f979c 100755 --- a/src/VBox/Installer/solaris/makepackage.sh +++ b/src/VBox/Installer/solaris/makepackage.sh @@ -203,9 +203,7 @@ fi # Other executables that need setuid root (hardened or otherwise) $VBOX_AWK 'NF == 6 \ - && ( $3 == "opt/VirtualBox/amd64/VBoxUSBHelper" \ - || $3 == "opt/VirtualBox/i386/VBoxUSBHelper" \ - || $3 == "opt/VirtualBox/amd64/VBoxNetAdpCtl" \ + && ( $3 == "opt/VirtualBox/amd64/VBoxNetAdpCtl" \ || $3 == "opt/VirtualBox/i386/VBoxNetAdpCtl" \ || $3 == "opt/VirtualBox/amd64/VBoxNetDHCP" \ || $3 == "opt/VirtualBox/i386/VBoxNetDHCP" \ diff --git a/src/VBox/Installer/solaris/vboxconfig.sh b/src/VBox/Installer/solaris/vboxconfig.sh index 1fd366606..e26875fdd 100755 --- a/src/VBox/Installer/solaris/vboxconfig.sh +++ b/src/VBox/Installer/solaris/vboxconfig.sh @@ -18,6 +18,9 @@ # Never use exit 2 or exit 20 etc., the return codes are used in # SRv4 postinstall procedures which carry special meaning. Just use exit 1 for failure. +LANG=C +export LANG + # S10 or OpenSoalris HOST_OS_MAJORVERSION=`uname -r` # Which OpenSolaris version (snv_xxx or oi_xxx)? @@ -751,6 +754,7 @@ cleanup_install() # !! failure is always fatal postinstall() { + infoprint "Detected Solaris $HOST_OS_MAJORVERSION Version $HOST_OS_MINORVERSION" infoprint "Loading VirtualBox kernel modules..." install_drivers diff --git a/src/VBox/Main/glue/glue-java.xsl b/src/VBox/Main/glue/glue-java.xsl index da6ee7d8e..18ed6f147 100644 --- a/src/VBox/Main/glue/glue-java.xsl +++ b/src/VBox/Main/glue/glue-java.xsl @@ -2451,7 +2451,7 @@ public class VirtualBoxManager this.vbox = new IVirtualBox((org.mozilla.interfaces.IVirtualBox) this.componentManager .createInstanceByContractID("@virtualbox.org/VirtualBox;1", null, - org.mozilla.interfaces.IVirtualBox.IVIRTUALBOX_IID)); + org.mozilla.interfaces.IVirtualBox.IVIRTUALBOX_IID)); } public void connect(String url, String username, String passwd) @@ -3216,7 +3216,7 @@ public class Helper { throw new AssertionError(e); } } - // temporary methods, will bo away soon + // temporary methods, will go away soon public static byte[] wrapBytes(List arr) { if (arr == null) @@ -3394,40 +3394,44 @@ public class VirtualBoxManager this.port = pool.getPort(); try { ((BindingProvider)port).getRequestContext(). - put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, url); - String handle = port.iWebsessionManagerLogon(username, passwd); - this.vbox = new IVirtualBox(handle, port); - } catch (Throwable t) { - if (this.port != null) + put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, url); + String handle = port.iWebsessionManagerLogon(username, passwd); + this.vbox = new IVirtualBox(handle, port); + } catch (Throwable t) { + if (this.port != null && pool != null) { pool.releasePort(this.port); - // we have to throw smth derived from RuntimeException - throw new VBoxException(t, t.getMessage()); - } + this.port = null; + } + // we have to throw smth derived from RuntimeException + throw new VBoxException(t, t.getMessage()); + } } public void connect(String url, String username, String passwd, Map requestContext, Map responseContext) { - this.port = pool.getPort(); + this.port = pool.getPort(); - try { - ((BindingProvider)port).getRequestContext(); - if (requestContext != null) - ((BindingProvider)port).getRequestContext().putAll(requestContext); + try { + ((BindingProvider)port).getRequestContext(); + if (requestContext != null) + ((BindingProvider)port).getRequestContext().putAll(requestContext); - if (responseContext != null) - ((BindingProvider)port).getResponseContext().putAll(responseContext); + if (responseContext != null) + ((BindingProvider)port).getResponseContext().putAll(responseContext); - ((BindingProvider)port).getRequestContext(). + ((BindingProvider)port).getRequestContext(). put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, url); String handle = port.iWebsessionManagerLogon(username, passwd); this.vbox = new IVirtualBox(handle, port); - } catch (Throwable t) { - if (this.port != null) - pool.releasePort(port); - // we have to throw smth derived from RuntimeException - throw new VBoxException(t, t.getMessage()); - } + } catch (Throwable t) { + if (this.port != null && pool != null) { + pool.releasePort(this.port); + this.port = null; + } + // we have to throw smth derived from RuntimeException + throw new VBoxException(t, t.getMessage()); + } } public void disconnect() @@ -3440,10 +3444,10 @@ public class VirtualBoxManager } catch (RuntimeFaultMsg e) { throw new VBoxException(e, e.getMessage()); } finally { - if (this.port != null) { - pool.releasePort(this.port); - this.port = null; - } + if (this.port != null) { + pool.releasePort(this.port); + this.port = null; + } } } diff --git a/src/VBox/Main/idl/VirtualBox.xidl b/src/VBox/Main/idl/VirtualBox.xidl index e3d38f267..54b98d847 100644 --- a/src/VBox/Main/idl/VirtualBox.xidl +++ b/src/VBox/Main/idl/VirtualBox.xidl @@ -7913,6 +7913,9 @@ Don't show the started process according to the guest OS guidelines. + + Do not use the user's profile data when exeuting a process. + IConnector.cx + (int32_t)maFramebuffers[0].xOrigin; y2 = mpDrv->IConnector.cy + (int32_t)maFramebuffers[0].yOrigin; } diff --git a/src/VBox/Main/src-client/GuestCtrlImpl.cpp b/src/VBox/Main/src-client/GuestCtrlImpl.cpp index f98b52acc..b2343187b 100644 --- a/src/VBox/Main/src-client/GuestCtrlImpl.cpp +++ b/src/VBox/Main/src-client/GuestCtrlImpl.cpp @@ -1506,7 +1506,8 @@ HRESULT Guest::executeProcessInternal(IN_BSTR aCommand, ULONG aFlags, { if ( !(aFlags & ExecuteProcessFlag_IgnoreOrphanedProcesses) && !(aFlags & ExecuteProcessFlag_WaitForProcessStartOnly) - && !(aFlags & ExecuteProcessFlag_Hidden)) + && !(aFlags & ExecuteProcessFlag_Hidden) + && !(aFlags & ExecuteProcessFlag_NoProfile)) { if (pRC) *pRC = VERR_INVALID_PARAMETER; diff --git a/src/VBox/Main/src-server/HostImpl.cpp b/src/VBox/Main/src-server/HostImpl.cpp index 6bba2ac66..a2994f520 100644 --- a/src/VBox/Main/src-server/HostImpl.cpp +++ b/src/VBox/Main/src-server/HostImpl.cpp @@ -239,6 +239,7 @@ void Host::FinalRelease() */ HRESULT Host::init(VirtualBox *aParent) { + HRESULT hrc; LogFlowThisFunc(("aParent=%p\n", aParent)); /* Enclose the state transition NotReady->InInit->Ready */ @@ -268,7 +269,7 @@ HRESULT Host::init(VirtualBox *aParent) # else m->pUSBProxyService = new USBProxyService(this); # endif - HRESULT hrc = m->pUSBProxyService->init(); + hrc = m->pUSBProxyService->init(); AssertComRCReturn(hrc, hrc); #endif /* VBOX_WITH_USB */ @@ -1679,7 +1680,7 @@ HRESULT Host::getDrives(DeviceType_T mediumType, Medium *pNew = *itNew; const Utf8Str strLocationNew = pNew->getLocationFull(); bool fFound = false; - for (MediaList::iterator itCached = pllCached->begin(); + for (itCached = pllCached->begin(); itCached != pllCached->end(); ++itCached) { diff --git a/src/VBox/Main/src-server/MachineImpl.cpp b/src/VBox/Main/src-server/MachineImpl.cpp index bb88c937b..ae2b4c76e 100644 --- a/src/VBox/Main/src-server/MachineImpl.cpp +++ b/src/VBox/Main/src-server/MachineImpl.cpp @@ -7757,6 +7757,8 @@ HRESULT Machine::loadStorageDevices(StorageController *aStorageController, rc = medium->addBackReference(mData->mUuid, *puuidSnapshot); else rc = medium->addBackReference(mData->mUuid); + /* If the medium->addBackReference fails it sets an appropriate + * error message, so no need to do any guesswork here. */ if (puuidRegistry) // caller wants registry ID to be set on all attached media (OVF import case) @@ -9013,8 +9015,8 @@ HRESULT Machine::createImplicitDiffs(IProgress *aProgress, { ErrorInfoKeeper eik; - rc = lockedMediaMap->Clear(); - AssertComRC(rc); + HRESULT rc1 = lockedMediaMap->Clear(); + AssertComRC(rc1); } if (FAILED(rc)) diff --git a/src/VBox/Main/src-server/MediumImpl.cpp b/src/VBox/Main/src-server/MediumImpl.cpp index 6e8322b4d..ab4daf457 100644 --- a/src/VBox/Main/src-server/MediumImpl.cpp +++ b/src/VBox/Main/src-server/MediumImpl.cpp @@ -238,7 +238,7 @@ public: PVDINTERFACE mVDOperationIfaces; - // Whether the caller needs to call VirtualBox::saveSettings() after + // Whether the caller needs to call VirtualBox::saveRegistries() after // the task function returns. Only used in synchronous (wait) mode; // otherwise the task will save the settings itself. GuidList *m_pllRegistriesThatNeedSaving; @@ -1307,8 +1307,6 @@ HRESULT Medium::init(VirtualBox *aVirtualBox, if (FAILED(rc)) return rc; m->strDescription = aDescription; -/// @todo generate uuid (similarly to host network interface uuid) from location and device type - autoInitSpan.setSucceeded(); return S_OK; } @@ -2252,11 +2250,11 @@ STDMETHODIMP Medium::Close() ComObjPtr pVirtualBox(m->pVirtualBox); GuidList llRegistriesThatNeedSaving; - HRESULT rc = close(&llRegistriesThatNeedSaving, autoCaller); - - pVirtualBox->saveRegistries(llRegistriesThatNeedSaving); + MultiResult mrc = close(&llRegistriesThatNeedSaving, autoCaller); + /* Must save the registries, since an entry was most likely removed. */ + mrc = pVirtualBox->saveRegistries(llRegistriesThatNeedSaving); - return rc; + return mrc; } STDMETHODIMP Medium::GetProperty(IN_BSTR aName, BSTR *aValue) @@ -2471,15 +2469,16 @@ STDMETHODIMP Medium::DeleteStorage(IProgress **aProgress) ComObjPtr pProgress; GuidList llRegistriesThatNeedSaving; - HRESULT rc = deleteStorage(&pProgress, - false /* aWait */, - &llRegistriesThatNeedSaving); - m->pVirtualBox->saveRegistries(llRegistriesThatNeedSaving); + MultiResult mrc = deleteStorage(&pProgress, + false /* aWait */, + &llRegistriesThatNeedSaving); + /* Must save the registries in any case, since an entry was removed. */ + mrc = m->pVirtualBox->saveRegistries(llRegistriesThatNeedSaving); - if (SUCCEEDED(rc)) + if (SUCCEEDED(mrc)) pProgress.queryInterfaceTo(aProgress); - return rc; + return mrc; } STDMETHODIMP Medium::CreateDiffStorage(IMedium *aTarget, @@ -3302,7 +3301,12 @@ HRESULT Medium::addBackReference(const Guid &aMachineId, if (aSnapshotId.isEmpty()) { /* sanity: no duplicate attachments */ - AssertReturn(!it->fInCurState, E_FAIL); + if (it->fInCurState) + return setError(VBOX_E_OBJECT_IN_USE, + tr("Cannot attach medium '%s' {%RTuuid}: medium is already associated with the current state of machine uuid {%RTuuid}!"), + m->strLocationFull.c_str(), + m->id.raw(), + aMachineId.raw()); it->fInCurState = true; return S_OK; @@ -3326,8 +3330,7 @@ HRESULT Medium::addBackReference(const Guid &aMachineId, tr("Cannot attach medium '%s' {%RTuuid} from snapshot '%RTuuid': medium is already in use by this snapshot!"), m->strLocationFull.c_str(), m->id.raw(), - aSnapshotId.raw(), - idOldSnapshot.raw()); + aSnapshotId.raw()); } } @@ -3787,7 +3790,7 @@ HRESULT Medium::createMediumLockList(bool fFailIfInaccessible, * @param aWait @c true if this method should block instead of * creating an asynchronous thread. * @param pllRegistriesThatNeedSaving Optional pointer to a list of UUIDs that will receive the registry IDs that need saving. - * This only works in "wait" mode; otherwise saveSettings is called automatically by the thread that + * This only works in "wait" mode; otherwise saveRegistries is called automatically by the thread that * was created, and this parameter is ignored. * * @note Locks this object and @a aTarget for writing. @@ -3924,7 +3927,7 @@ Utf8Str Medium::getPreferredDiffFormat() /** * Implementation for the public Medium::Close() with the exception of calling - * VirtualBox::saveSettings(), in case someone wants to call this for several + * VirtualBox::saveRegistries(), in case someone wants to call this for several * media. * * After this returns with success, uninit() has been called on the medium, and @@ -4008,8 +4011,8 @@ HRESULT Medium::close(GuidList *pllRegistriesThatNeedSaving, * @param aWait @c true if this method should block instead of creating * an asynchronous thread. * @param pfNeedsGlobalSaveSettings Optional pointer to a bool that must have been initialized to false and that will be set to true - * by this function if the caller should invoke VirtualBox::saveSettings() because the global settings have changed. - * This only works in "wait" mode; otherwise saveSettings gets called automatically by the thread that was created, + * by this function if the caller should invoke VirtualBox::saveRegistries() because the global settings have changed. + * This only works in "wait" mode; otherwise saveRegistries gets called automatically by the thread that was created, * and this parameter is ignored. * * @note Locks mVirtualBox and this object for writing. Locks medium tree for @@ -4626,8 +4629,8 @@ HRESULT Medium::prepareMergeTo(const ComObjPtr &pTarget, * @param aWait @c true if this method should block instead of creating * an asynchronous thread. * @param pfNeedsGlobalSaveSettings Optional pointer to a bool that must have been initialized to false and that will be set to true - * by this function if the caller should invoke VirtualBox::saveSettings() because the global settings have changed. - * This only works in "wait" mode; otherwise saveSettings gets called automatically by the thread that was created, + * by this function if the caller should invoke VirtualBox::saveRegistries() because the global settings have changed. + * This only works in "wait" mode; otherwise saveRegistries gets called automatically by the thread that was created, * and this parameter is ignored. * * @note Locks the tree lock for writing. Locks the media from the chain @@ -4840,10 +4843,10 @@ HRESULT Medium::fixParentUuidOfChildren(const MediaList &childrenToReparent) catch (HRESULT aRC) { rc = aRC; } catch (int aVRC) { - throw setError(E_FAIL, - tr("Could not update medium UUID references to parent '%s' (%s)"), - m->strLocationFull.c_str(), - vdError(aVRC).c_str()); + rc = setError(E_FAIL, + tr("Could not update medium UUID references to parent '%s' (%s)"), + m->strLocationFull.c_str(), + vdError(aVRC).c_str()); } VDDestroy(hdd); @@ -6269,7 +6272,7 @@ HRESULT Medium::taskCreateBaseHandler(Medium::CreateBaseTask &task) */ HRESULT Medium::taskCreateDiffHandler(Medium::CreateDiffTask &task) { - HRESULT rc = S_OK; + HRESULT rcTmp = S_OK; const ComObjPtr &pTarget = task.mTarget; @@ -6352,7 +6355,7 @@ HRESULT Medium::taskCreateDiffHandler(Medium::CreateDiffTask &task) /* ensure the target directory exists */ if (capabilities & VD_CAP_FILE) { - rc = VirtualBox::ensureFilePathExists(targetLocation); + HRESULT rc = VirtualBox::ensureFilePathExists(targetLocation); if (FAILED(rc)) throw rc; } @@ -6379,13 +6382,15 @@ HRESULT Medium::taskCreateDiffHandler(Medium::CreateDiffTask &task) if (RT_SUCCESS(vrc)) variant = (MediumVariant_T)uImageFlags; } - catch (HRESULT aRC) { rc = aRC; } + catch (HRESULT aRC) { rcTmp = aRC; } VDDestroy(hdd); } - catch (HRESULT aRC) { rc = aRC; } + catch (HRESULT aRC) { rcTmp = aRC; } - if (SUCCEEDED(rc)) + MultiResult mrc(rcTmp); + + if (SUCCEEDED(mrc)) { AutoWriteLock treeLock(m->pVirtualBox->getMediaTreeLockHandle() COMMA_LOCKVAL_SRC_POS); @@ -6403,16 +6408,16 @@ HRESULT Medium::taskCreateDiffHandler(Medium::CreateDiffTask &task) /* register with mVirtualBox as the last step and move to * Created state only on success (leaving an orphan file is * better than breaking media registry consistency) */ - rc = m->pVirtualBox->registerHardDisk(pTarget, &llRegistriesThatNeedSaving); + mrc = m->pVirtualBox->registerHardDisk(pTarget, &llRegistriesThatNeedSaving); - if (FAILED(rc)) + if (FAILED(mrc)) /* break the parent association on failure to register */ deparent(); } AutoMultiWriteLock2 mediaLock(this, pTarget COMMA_LOCKVAL_SRC_POS); - if (SUCCEEDED(rc)) + if (SUCCEEDED(mrc)) { pTarget->m->state = MediumState_Created; @@ -6439,7 +6444,7 @@ HRESULT Medium::taskCreateDiffHandler(Medium::CreateDiffTask &task) if (task.isAsync()) { mediaLock.release(); - m->pVirtualBox->saveRegistries(llRegistriesThatNeedSaving); + mrc = m->pVirtualBox->saveRegistries(llRegistriesThatNeedSaving); } else // synchronous mode: report save settings result to caller @@ -6449,7 +6454,7 @@ HRESULT Medium::taskCreateDiffHandler(Medium::CreateDiffTask &task) /* Note that in sync mode, it's the caller's responsibility to * unlock the medium. */ - return rc; + return mrc; } /** @@ -6466,7 +6471,7 @@ HRESULT Medium::taskCreateDiffHandler(Medium::CreateDiffTask &task) */ HRESULT Medium::taskMergeHandler(Medium::MergeTask &task) { - HRESULT rc = S_OK; + HRESULT rcTmp = S_OK; const ComObjPtr &pTarget = task.mTarget; @@ -6593,23 +6598,25 @@ HRESULT Medium::taskMergeHandler(Medium::MergeTask &task) } } } - catch (HRESULT aRC) { rc = aRC; } + catch (HRESULT aRC) { rcTmp = aRC; } catch (int aVRC) { - throw setError(VBOX_E_FILE_ERROR, - tr("Could not merge the medium '%s' to '%s'%s"), - m->strLocationFull.c_str(), - pTarget->m->strLocationFull.c_str(), - vdError(aVRC).c_str()); + rcTmp = setError(VBOX_E_FILE_ERROR, + tr("Could not merge the medium '%s' to '%s'%s"), + m->strLocationFull.c_str(), + pTarget->m->strLocationFull.c_str(), + vdError(aVRC).c_str()); } VDDestroy(hdd); } - catch (HRESULT aRC) { rc = aRC; } + catch (HRESULT aRC) { rcTmp = aRC; } + ErrorInfoKeeper eik; + MultiResult mrc(rcTmp); HRESULT rc2; - if (SUCCEEDED(rc)) + if (SUCCEEDED(mrc)) { /* all media but the target were successfully deleted by * VDMerge; reparent the last one and uninitialize deleted media. */ @@ -6726,19 +6733,22 @@ HRESULT Medium::taskMergeHandler(Medium::MergeTask &task) // in asynchronous mode, save settings now GuidList llRegistriesThatNeedSaving; addToRegistryIDList(llRegistriesThatNeedSaving); - rc = m->pVirtualBox->saveRegistries(llRegistriesThatNeedSaving); + /* collect multiple errors */ + eik.restore(); + mrc = m->pVirtualBox->saveRegistries(llRegistriesThatNeedSaving); + eik.fetch(); } else // synchronous mode: report save settings result to caller if (task.m_pllRegistriesThatNeedSaving) pTarget->addToRegistryIDList(*task.m_pllRegistriesThatNeedSaving); - if (FAILED(rc)) + if (FAILED(mrc)) { /* Here we come if either VDMerge() failed (in which case we * assume that it tried to do everything to make a further * retry possible -- e.g. not deleted intermediate media - * and so on) or VirtualBox::saveSettings() failed (where we + * and so on) or VirtualBox::saveRegistries() failed (where we * should have the original tree but with intermediate storage * units deleted by VDMerge()). We have to only restore states * (through the MergeChain dtor) unless we are run synchronously @@ -6752,7 +6762,7 @@ HRESULT Medium::taskMergeHandler(Medium::MergeTask &task) } } - return rc; + return mrc; } /** @@ -6766,7 +6776,7 @@ HRESULT Medium::taskMergeHandler(Medium::MergeTask &task) */ HRESULT Medium::taskCloneHandler(Medium::CloneTask &task) { - HRESULT rc = S_OK; + HRESULT rcTmp = S_OK; const ComObjPtr &pTarget = task.mTarget; const ComObjPtr &pParent = task.mParent; @@ -6848,7 +6858,7 @@ HRESULT Medium::taskCloneHandler(Medium::CloneTask &task) /* ensure the target directory exists */ if (capabilities & VD_CAP_FILE) { - rc = VirtualBox::ensureFilePathExists(targetLocation); + HRESULT rc = VirtualBox::ensureFilePathExists(targetLocation); if (FAILED(rc)) throw rc; } @@ -6927,18 +6937,21 @@ HRESULT Medium::taskCloneHandler(Medium::CloneTask &task) if (RT_SUCCESS(vrc)) variant = (MediumVariant_T)uImageFlags; } - catch (HRESULT aRC) { rc = aRC; } + catch (HRESULT aRC) { rcTmp = aRC; } VDDestroy(targetHdd); } - catch (HRESULT aRC) { rc = aRC; } + catch (HRESULT aRC) { rcTmp = aRC; } VDDestroy(hdd); } - catch (HRESULT aRC) { rc = aRC; } + catch (HRESULT aRC) { rcTmp = aRC; } + + ErrorInfoKeeper eik; + MultiResult mrc(rcTmp); /* Only do the parent changes for newly created media. */ - if (SUCCEEDED(rc) && fCreatingTarget) + if (SUCCEEDED(mrc) && fCreatingTarget) { /* we set mParent & children() */ AutoWriteLock alock2(m->pVirtualBox->getMediaTreeLockHandle() COMMA_LOCKVAL_SRC_POS); @@ -6955,16 +6968,20 @@ HRESULT Medium::taskCloneHandler(Medium::CloneTask &task) /* register with mVirtualBox as the last step and move to * Created state only on success (leaving an orphan file is * better than breaking media registry consistency) */ - rc = pParent->m->pVirtualBox->registerHardDisk(pTarget, NULL /* pllRegistriesThatNeedSaving */); + eik.restore(); + mrc = pParent->m->pVirtualBox->registerHardDisk(pTarget, NULL /* pllRegistriesThatNeedSaving */); + eik.fetch(); - if (FAILED(rc)) + if (FAILED(mrc)) /* break parent association on failure to register */ pTarget->deparent(); // removes target from parent } else { /* just register */ - rc = m->pVirtualBox->registerHardDisk(pTarget, NULL /* pllRegistriesThatNeedSaving */); + eik.restore(); + mrc = m->pVirtualBox->registerHardDisk(pTarget, NULL /* pllRegistriesThatNeedSaving */); + eik.fetch(); } } @@ -6972,7 +6989,7 @@ HRESULT Medium::taskCloneHandler(Medium::CloneTask &task) { AutoWriteLock mLock(pTarget COMMA_LOCKVAL_SRC_POS); - if (SUCCEEDED(rc)) + if (SUCCEEDED(mrc)) { pTarget->m->state = MediumState_Created; @@ -6996,7 +7013,10 @@ HRESULT Medium::taskCloneHandler(Medium::CloneTask &task) // save the settings GuidList llRegistriesThatNeedSaving; addToRegistryIDList(llRegistriesThatNeedSaving); - rc = m->pVirtualBox->saveRegistries(llRegistriesThatNeedSaving); + /* collect multiple errors */ + eik.restore(); + mrc = m->pVirtualBox->saveRegistries(llRegistriesThatNeedSaving); + eik.fetch(); } /* Everything is explicitly unlocked when the task exits, @@ -7007,7 +7027,7 @@ HRESULT Medium::taskCloneHandler(Medium::CloneTask &task) * is called & the source chain is released at the same time. */ task.mpSourceMediumLockList->Clear(); - return rc; + return mrc; } /** @@ -7507,7 +7527,7 @@ HRESULT Medium::taskExportHandler(Medium::ExportTask &task) 0 /* cbSize */, task.mVariant, NULL /* pDstUuid */, - VD_OPEN_FLAGS_NORMAL, + VD_OPEN_FLAGS_NORMAL | VD_OPEN_FLAGS_SEQUENTIAL, NULL /* pVDIfsOperation */, task.mVDImageIfaces, task.mVDOperationIfaces); @@ -7548,7 +7568,7 @@ HRESULT Medium::taskExportHandler(Medium::ExportTask &task) */ HRESULT Medium::taskImportHandler(Medium::ImportTask &task) { - HRESULT rc = S_OK; + HRESULT rcTmp = S_OK; const ComObjPtr &pParent = task.mParent; @@ -7612,7 +7632,7 @@ HRESULT Medium::taskImportHandler(Medium::ImportTask &task) /* ensure the target directory exists */ if (capabilities & VD_CAP_FILE) { - rc = VirtualBox::ensureFilePathExists(targetLocation); + HRESULT rc = VirtualBox::ensureFilePathExists(targetLocation); if (FAILED(rc)) throw rc; } @@ -7691,18 +7711,21 @@ HRESULT Medium::taskImportHandler(Medium::ImportTask &task) if (RT_SUCCESS(vrc)) variant = (MediumVariant_T)uImageFlags; } - catch (HRESULT aRC) { rc = aRC; } + catch (HRESULT aRC) { rcTmp = aRC; } VDDestroy(targetHdd); } - catch (HRESULT aRC) { rc = aRC; } + catch (HRESULT aRC) { rcTmp = aRC; } VDDestroy(hdd); } - catch (HRESULT aRC) { rc = aRC; } + catch (HRESULT aRC) { rcTmp = aRC; } + + ErrorInfoKeeper eik; + MultiResult mrc(rcTmp); /* Only do the parent changes for newly created media. */ - if (SUCCEEDED(rc) && fCreatingTarget) + if (SUCCEEDED(mrc) && fCreatingTarget) { /* we set mParent & children() */ AutoWriteLock alock2(m->pVirtualBox->getMediaTreeLockHandle() COMMA_LOCKVAL_SRC_POS); @@ -7719,16 +7742,20 @@ HRESULT Medium::taskImportHandler(Medium::ImportTask &task) /* register with mVirtualBox as the last step and move to * Created state only on success (leaving an orphan file is * better than breaking media registry consistency) */ - rc = pParent->m->pVirtualBox->registerHardDisk(this, NULL /* llRegistriesThatNeedSaving */); + eik.restore(); + mrc = pParent->m->pVirtualBox->registerHardDisk(this, NULL /* llRegistriesThatNeedSaving */); + eik.fetch(); - if (FAILED(rc)) + if (FAILED(mrc)) /* break parent association on failure to register */ this->deparent(); // removes target from parent } else { /* just register */ - rc = m->pVirtualBox->registerHardDisk(this, NULL /* pllRegistriesThatNeedSaving */); + eik.restore(); + mrc = m->pVirtualBox->registerHardDisk(this, NULL /* pllRegistriesThatNeedSaving */); + eik.fetch(); } } @@ -7736,7 +7763,7 @@ HRESULT Medium::taskImportHandler(Medium::ImportTask &task) { AutoWriteLock mLock(this COMMA_LOCKVAL_SRC_POS); - if (SUCCEEDED(rc)) + if (SUCCEEDED(mrc)) { m->state = MediumState_Created; @@ -7760,7 +7787,10 @@ HRESULT Medium::taskImportHandler(Medium::ImportTask &task) // save the settings GuidList llRegistriesThatNeedSaving; addToRegistryIDList(llRegistriesThatNeedSaving); - rc = m->pVirtualBox->saveRegistries(llRegistriesThatNeedSaving); + /* collect multiple errors */ + eik.restore(); + mrc = m->pVirtualBox->saveRegistries(llRegistriesThatNeedSaving); + eik.fetch(); } /* Everything is explicitly unlocked when the task exits, @@ -7770,7 +7800,7 @@ HRESULT Medium::taskImportHandler(Medium::ImportTask &task) * lead to deadlocks with concurrent IAppliance activities. */ task.mpTargetMediumLockList->Clear(); - return rc; + return mrc; } /* vi: set tabstop=4 shiftwidth=4 expandtab: */ diff --git a/src/VBox/Main/src-server/linux/USBGetDevices.cpp b/src/VBox/Main/src-server/linux/USBGetDevices.cpp index 02e684aa0..63b45f37f 100644 --- a/src/VBox/Main/src-server/linux/USBGetDevices.cpp +++ b/src/VBox/Main/src-server/linux/USBGetDevices.cpp @@ -824,26 +824,36 @@ static int USBDevInfoInit(USBDeviceInfo *pSelf, const char *aDevice, #define USBDEVICE_MAJOR 189 -/** Deduce the bus that a USB device is plugged into from the device node - * number. See drivers/usb/core/hub.c:usb_new_device as of Linux 2.6.20. */ -static unsigned usbBusFromDevNum(dev_t devNum) +/** Calculate the bus (a.k.a root hub) number of a USB device from it's sysfs + * path. sysfs nodes representing root hubs have file names of the form + * usb, where n is the bus number; other devices start with that number. + * See [http://www.linux-usb.org/FAQ.html#i6] and + * [http://www.kernel.org/doc/Documentation/usb/proc_usb_info.txt] for + * equivalent information about usbfs. + * @returns a bus number greater than 0 on success or 0 on failure. + */ +static unsigned usbGetBusFromSysfsPath(const char *pcszPath) { - AssertReturn(devNum, 0); - AssertReturn(major(devNum) == USBDEVICE_MAJOR, 0); - return (minor(devNum) >> 7) + 1; + const char *pcszFile = strrchr(pcszPath, '/'); + if (!pcszFile) + return 0; + unsigned bus = RTStrToUInt32(pcszFile + 1); + if ( !bus + && pcszFile[1] == 'u' && pcszFile[2] == 's' && pcszFile[3] == 'b') + bus = RTStrToUInt32(pcszFile + 4); + return bus; } - -/** Deduce the device number of a USB device on the bus from the device node - * number. See drivers/usb/core/hub.c:usb_new_device as of Linux 2.6.20. */ -static unsigned usbDeviceFromDevNum(dev_t devNum) +/** Calculate the device number of a USB device. See + * drivers/usb/core/hub.c:usb_new_device as of Linux 2.6.20. */ +static dev_t usbMakeDevNum(unsigned bus, unsigned device) { - AssertReturn(devNum, 0); - AssertReturn(major(devNum) == USBDEVICE_MAJOR, 0); - return (minor(devNum) & 127) + 1; + AssertReturn(bus > 0, 0); + AssertReturn(((device - 1) & ~127) == 0, 0); + AssertReturn(device > 0, 0); + return makedev(USBDEVICE_MAJOR, ((bus - 1) << 7) + device - 1); } - /** * If a file @a pcszNode from /sys/bus/usb/devices is a device rather than an * interface add an element for the device to @a pvecDevInfo. @@ -853,12 +863,15 @@ static int addIfDevice(const char *pcszDevicesRoot, VECTOR_OBJ(USBDeviceInfo) *pvecDevInfo) { const char *pcszFile = strrchr(pcszNode, '/'); + if (!pcszFile) + return VERR_INVALID_PARAMETER; if (strchr(pcszFile, ':')) return VINF_SUCCESS; - dev_t devnum = RTLinuxSysFsReadDevNumFile("%s/dev", pcszNode); - /* Sanity test of our static helpers */ - Assert(usbBusFromDevNum(makedev(USBDEVICE_MAJOR, 517)) == 5); - Assert(usbDeviceFromDevNum(makedev(USBDEVICE_MAJOR, 517)) == 6); + unsigned bus = usbGetBusFromSysfsPath(pcszNode); + if (!bus) + return VINF_SUCCESS; + unsigned device = RTLinuxSysFsReadIntFile(10, "%s/devnum", pcszNode); + dev_t devnum = usbMakeDevNum(bus, device); if (!devnum) return VINF_SUCCESS; char szDevPath[RTPATH_MAX]; @@ -866,9 +879,7 @@ static int addIfDevice(const char *pcszDevicesRoot, cchDevPath = RTLinuxFindDevicePath(devnum, RTFS_TYPE_DEV_CHAR, szDevPath, sizeof(szDevPath), "%s/%.3d/%.3d", - pcszDevicesRoot, - usbBusFromDevNum(devnum), - usbDeviceFromDevNum(devnum)); + pcszDevicesRoot, bus, device); if (cchDevPath < 0) return VINF_SUCCESS; @@ -1225,7 +1236,7 @@ static void fillInDeviceFromSysfs(USBDEVICE *Dev, USBDeviceInfo *pInfo) /* Fill in the simple fields */ Dev->enmState = USBDEVICESTATE_UNUSED; - Dev->bBus = RTLinuxSysFsReadIntFile(10, "%s/busnum", pszSysfsPath); + Dev->bBus = usbGetBusFromSysfsPath(pszSysfsPath); Dev->bDeviceClass = RTLinuxSysFsReadIntFile(16, "%s/bDeviceClass", pszSysfsPath); Dev->bDeviceSubClass = RTLinuxSysFsReadIntFile(16, "%s/bDeviceSubClass", pszSysfsPath); Dev->bDeviceProtocol = RTLinuxSysFsReadIntFile(16, "%s/bDeviceProtocol", pszSysfsPath); diff --git a/src/VBox/Main/src-server/xpcom/server.cpp b/src/VBox/Main/src-server/xpcom/server.cpp index 2cc798a43..ee81e4fd9 100644 --- a/src/VBox/Main/src-server/xpcom/server.cpp +++ b/src/VBox/Main/src-server/xpcom/server.cpp @@ -712,15 +712,25 @@ static void signal_handler(int sig) } } -static nsresult vboxsvcSpawnDaemonByReExec(const char *pszPath) +static nsresult vboxsvcSpawnDaemonByReExec(const char *pszPath, bool fAutoShutdown, const char *pszPidFile) { PRFileDesc *readable = nsnull, *writable = nsnull; PRProcessAttr *attr = nsnull; nsresult rv = NS_ERROR_FAILURE; PRFileDesc *devNull; + unsigned args_index = 0; // The ugly casts are necessary because the PR_CreateProcessDetached has // a const array of writable strings as a parameter. It won't write. */ - char * const args[] = { (char *)pszPath, (char *)"--auto-shutdown", 0 }; + char * args[1 + 1 + 2 + 1]; + args[args_index++] = (char *)pszPath; + if (fAutoShutdown) + args[args_index++] = (char *)"--auto-shutdown"; + if (pszPidFile) + { + args[args_index++] = (char *)"--pidfile"; + args[args_index++] = (char *)pszPidFile; + } + args[args_index++] = 0; // Use a pipe to determine when the daemon process is in the position // to actually process requests. The daemon will write "READY" to the pipe. @@ -743,7 +753,7 @@ static nsresult vboxsvcSpawnDaemonByReExec(const char *pszPath) PR_ProcessAttrSetStdioRedirect(attr, PR_StandardOutput, devNull); PR_ProcessAttrSetStdioRedirect(attr, PR_StandardError, devNull); - if (PR_CreateProcessDetached(pszPath, args, nsnull, attr) != PR_SUCCESS) + if (PR_CreateProcessDetached(pszPath, (char * const *)args, nsnull, attr) != PR_SUCCESS) goto end; // Close /dev/null @@ -847,7 +857,7 @@ int main(int argc, char **argv) if (fDaemonize) { - vboxsvcSpawnDaemonByReExec(argv[0]); + vboxsvcSpawnDaemonByReExec(argv[0], gAutoShutdown, g_pszPidFile); exit(126); } diff --git a/src/VBox/Main/webservice/vboxweb.cpp b/src/VBox/Main/webservice/vboxweb.cpp index 6302a5ed1..e8036ed23 100644 --- a/src/VBox/Main/webservice/vboxweb.cpp +++ b/src/VBox/Main/webservice/vboxweb.cpp @@ -724,7 +724,7 @@ void doQueuesLoop() if (s < 0) { WebLogSoapError(&soap); - break; + continue; } // add the socket to the queue and tell worker threads to diff --git a/src/VBox/RDP/client/COPYING b/src/VBox/RDP/client/COPYING index 43d773001..443254047 100644 --- a/src/VBox/RDP/client/COPYING +++ b/src/VBox/RDP/client/COPYING @@ -1,292 +1,627 @@ -This software is released under the GNU General Public License -(reproduced below) with the additional exemption that compiling, -linking, and/or using OpenSSL together with this software is -allowed. - ---- GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 + Version 3, 29 June 2007 - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 675 Mass Ave, Cambridge, MA 02139, USA + Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of this License. - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. END OF TERMS AND CONDITIONS - - Appendix: How to Apply These Terms to Your New Programs + + How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it @@ -294,15 +629,15 @@ free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least +state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. - Copyright (C) 19yy + Copyright (C) - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or + the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -311,36 +646,31 @@ the "copyright" line and a pointer to where the full notice is found. GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: - Gnomovision version 69, Copyright (C) 19yy name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. - , 1 April 1989 - Ty Coon, President of Vice + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. diff --git a/src/VBox/RDP/client/Makefile.in b/src/VBox/RDP/client/Makefile.in index cc1de659f..78c43731d 100644 --- a/src/VBox/RDP/client/Makefile.in +++ b/src/VBox/RDP/client/Makefile.in @@ -94,7 +94,7 @@ clean: .PHONY: distclean distclean: clean - rm -rf autom4te.cache config.log config.status Makefile + rm -rf autom4te.cache config.log config.status Makefile rdesktop-$(VERSION).tar.gz .PHONY: dist dist: rdesktop-$(VERSION).tar.gz @@ -159,5 +159,6 @@ configure: configure.ac .c.o: $(CC) $(CFLAGS) -o $@ -c $< -.cpp.o: - $(CXX) $(CFLAGS) -o $@ -c $< +.PHONY: doc/AUTHORS +doc/AUTHORS: + ./genauthors *.c diff --git a/src/VBox/RDP/client/Makefile.kmk b/src/VBox/RDP/client/Makefile.kmk index e3516eeee..c191c25fc 100644 --- a/src/VBox/RDP/client/Makefile.kmk +++ b/src/VBox/RDP/client/Makefile.kmk @@ -24,7 +24,7 @@ VBOX_PATH_DEVICES_USB := $(PATH_ROOT)/src/VBox/Devices/USB VBOX_PATH_USB_LIB := $(PATH_ROOT)/src/VBox/HostDrivers/VBoxUSB VBOX_PATH_MAIN_LINUX := $(PATH_ROOT)/src/VBox/Main/src-server/linux VBOX_PATH_MAIN_INCLUDE := $(PATH_ROOT)/src/VBox/Main/include -VBOX_RDESKTOP_SRC_SUBDIR = rdesktop-1.6.0-vrdp +VBOX_RDESKTOP_SRC_SUBDIR = rdesktop-1.7.0-vrdp # # The rdesktop-vrdp program. @@ -33,8 +33,8 @@ PROGRAMS += rdesktop-vrdp rdesktop-vrdp_TEMPLATE = VBOXR3NPEXE rdesktop-vrdp_SDKS = VBOX_OPENSSL rdesktop-vrdp_DEFS = \ - PACKAGE_NAME=\"rdesktop-vrdp\" PACKAGE_TARNAME=\"rdesktop-vrdp\" PACKAGE_VERSION=\"1.6.0\" \ - PACKAGE_STRING=\"rdesktop\ 1.6.0\" PACKAGE_BUGREPORT=\"\" STDC_HEADERS=1 L_ENDIAN=1 \ + PACKAGE_NAME=\"rdesktop-vrdp\" PACKAGE_TARNAME=\"rdesktop-vrdp\" PACKAGE_VERSION=\"1.7.0\" \ + PACKAGE_STRING=\"rdesktop\ 1.7.0\" PACKAGE_BUGREPORT=\"\" STDC_HEADERS=1 L_ENDIAN=1 \ HAVE_SYS_TYPES_H=1 HAVE_SYS_STAT_H=1 HAVE_STDLIB_H=1 HAVE_STRING_H=1 HAVE_MEMORY_H=1 \ HAVE_STRINGS_H=1 HAVE_INTTYPES_H=1 HAVE_STDINT_H=1 HAVE_UNISTD_H=1 HAVE_SYS_SELECT_H=1 \ HAVE_LOCALE_H=1 HAVE_LANGINFO_H=1 HAVE_ICONV_H=1 \ diff --git a/src/VBox/RDP/client/README b/src/VBox/RDP/client/README index 7e2c4c79a..13dd63509 100644 --- a/src/VBox/RDP/client/README +++ b/src/VBox/RDP/client/README @@ -1,16 +1,16 @@ -=========================================== -rdesktop: A Remote Desktop Protocol client. -=========================================== +========================================== +rdesktop: A Remote Desktop Protocol client +========================================== -rdesktop is a client for Microsoft Windows NT Terminal Server, Windows 2000 -Terminal Services, Windows 2003 Terminal Services/Remote Desktop, Windows XP -Remote Desktop, and possibly other Terminal Services products. -rdesktop currently implements the RDP version 4 and 5 protocols. +rdesktop is an open source client for Microsoft's RDP protocol. It is +known to work with Windows versions such as NT 4 Terminal Server, +2000, XP, 2003, 2003 R2, Vista, 2008, 7, and 2008 R2. rdesktop +currently implements the RDP version 4 and 5 protocols. Installation ------------ rdesktop uses a GNU-style build procedure. Typically all that is necessary -to install rdesktop is the following: +to install rdesktop is the following:: % ./configure % make @@ -19,15 +19,16 @@ to install rdesktop is the following: The default is to install under /usr/local. This can be changed by adding --prefix=directory to the configure line. -Note for CVS users ------------------- -If you have downloaded a snapshot of rdesktop using CVS, you will first need to -run ./bootstrap in order to generate the build infrastructure. This is not -necessary for release versions of rdesktop. +Note for Subversion users +------------------------- +If you have downloaded a snapshot of rdesktop using Subversion, you +will first need to run ./bootstrap in order to generate the build +infrastructure. This is not necessary for release versions of +rdesktop. Invocation ---------- -Simply run: +Simply run:: % rdesktop server diff --git a/src/VBox/RDP/client/bitmap.c b/src/VBox/RDP/client/bitmap.c index 7e5dff529..96cf2b858 100644 --- a/src/VBox/RDP/client/bitmap.c +++ b/src/VBox/RDP/client/bitmap.c @@ -1,11 +1,11 @@ /* -*- c-basic-offset: 8 -*- rdesktop: A Remote Desktop Protocol client. Bitmap decompression routines - Copyright (C) Matthew Chapman 1999-2007 + Copyright (C) Matthew Chapman 1999-2008 - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or + the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + along with this program. If not, see . */ /* diff --git a/src/VBox/RDP/client/cache.c b/src/VBox/RDP/client/cache.c index f98c7a2d4..aa738a276 100644 --- a/src/VBox/RDP/client/cache.c +++ b/src/VBox/RDP/client/cache.c @@ -1,12 +1,13 @@ /* -*- c-basic-offset: 8 -*- rdesktop: A Remote Desktop Protocol client. Cache routines - Copyright (C) Matthew Chapman 1999-2007 - Copyright (C) Jeroen Meijer 2005 + Copyright (C) Matthew Chapman 1999-2008 + Copyright (C) Jeroen Meijer 2005 + Copyright 2003-2011 Peter Astrand for Cendio AB - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or + the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -15,8 +16,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + along with this program. If not, see . */ /* @@ -59,6 +59,7 @@ static RD_HBITMAP g_volatile_bc[3]; static int g_bmpcache_lru[3] = { NOT_SET, NOT_SET, NOT_SET }; static int g_bmpcache_mru[3] = { NOT_SET, NOT_SET, NOT_SET }; + static int g_bmpcache_count[3]; /* Setup the bitmap cache lru/mru linked list */ @@ -103,7 +104,7 @@ cache_rebuild_bmpcache_linked_list(uint8 id, sint16 * idx, int count) { error("Oops. %d in bitmap cache linked list, %d in ui cache...\n", c, g_bmpcache_count[id]); - exit(1); + exit(EX_SOFTWARE); } } @@ -185,7 +186,7 @@ cache_evict_bitmap(uint8 id) idx = g_bmpcache_lru[id]; n_idx = g_bmpcache[id][idx].next; - DEBUG_RDP5(("evict bitmap: id=%d idx=%d n_idx=%d bmp=0x%x\n", id, idx, n_idx, + DEBUG_RDP5(("evict bitmap: id=%d idx=%d n_idx=%d bmp=%p\n", id, idx, n_idx, g_bmpcache[id][idx].bitmap)); ui_destroy_bitmap(g_bmpcache[id][idx].bitmap); @@ -439,3 +440,43 @@ cache_put_cursor(uint16 cache_idx, RD_HCURSOR cursor) error("put cursor %d\n", cache_idx); } } + +/* BRUSH CACHE */ +/* index 0 is 2 colour brush, index 1 is muti colour brush */ +static BRUSHDATA g_brushcache[2][64]; + +/* Retrieve brush from cache */ +BRUSHDATA * +cache_get_brush_data(uint8 colour_code, uint8 idx) +{ + colour_code = colour_code == 1 ? 0 : 1; + if (idx < NUM_ELEMENTS(g_brushcache[0])) + { + return &g_brushcache[colour_code][idx]; + } + error("get brush %d %d\n", colour_code, idx); + return NULL; +} + +/* Store brush in cache */ +/* this function takes over the data pointer in struct, eg, caller gives it up */ +void +cache_put_brush_data(uint8 colour_code, uint8 idx, BRUSHDATA * brush_data) +{ + BRUSHDATA *bd; + + colour_code = colour_code == 1 ? 0 : 1; + if (idx < NUM_ELEMENTS(g_brushcache[0])) + { + bd = &g_brushcache[colour_code][idx]; + if (bd->data != 0) + { + xfree(bd->data); + } + memcpy(bd, brush_data, sizeof(BRUSHDATA)); + } + else + { + error("put brush %d %d\n", colour_code, idx); + } +} diff --git a/src/VBox/RDP/client/channels.c b/src/VBox/RDP/client/channels.c index f8f1c0671..1a6e1a320 100644 --- a/src/VBox/RDP/client/channels.c +++ b/src/VBox/RDP/client/channels.c @@ -2,11 +2,11 @@ rdesktop: A Remote Desktop Protocol client. Protocol services - Virtual channels Copyright (C) Erik Forsberg 2003 - Copyright (C) Matthew Chapman 2003-2007 + Copyright (C) Matthew Chapman 2003-2008 - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or + the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -15,8 +15,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + along with this program. If not, see . */ /* diff --git a/src/VBox/RDP/client/cliprdr.c b/src/VBox/RDP/client/cliprdr.c index 276115aa7..cbe478b9a 100644 --- a/src/VBox/RDP/client/cliprdr.c +++ b/src/VBox/RDP/client/cliprdr.c @@ -2,11 +2,11 @@ rdesktop: A Remote Desktop Protocol client. Protocol services - Clipboard functions Copyright (C) Erik Forsberg 2003 - Copyright (C) Matthew Chapman 2003-2007 + Copyright (C) Matthew Chapman 2003-2008 - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or + the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -15,8 +15,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + along with this program. If not, see . */ /* diff --git a/src/VBox/RDP/client/configure b/src/VBox/RDP/client/configure index ddfcaaf19..4b93beff2 100755 --- a/src/VBox/RDP/client/configure +++ b/src/VBox/RDP/client/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.67 for rdesktop 1.6.0. +# Generated by GNU Autoconf 2.68 for rdesktop 1.7.0. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -89,6 +89,7 @@ fi IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. +as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -214,11 +215,18 @@ IFS=$as_save_IFS # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. + # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV export CONFIG_SHELL - exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} + case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; + esac + exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"} fi if test x$as_have_required = xno; then : @@ -549,8 +557,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='rdesktop' PACKAGE_TARNAME='rdesktop' -PACKAGE_VERSION='1.6.0' -PACKAGE_STRING='rdesktop 1.6.0' +PACKAGE_VERSION='1.7.0' +PACKAGE_STRING='rdesktop 1.7.0' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -1111,7 +1119,7 @@ Try \`$0 --help' for more information" $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 - : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac @@ -1249,7 +1257,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures rdesktop 1.6.0 to adapt to many kinds of systems. +\`configure' configures rdesktop 1.7.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1318,7 +1326,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of rdesktop 1.6.0:";; + short | recursive ) echo "Configuration of rdesktop 1.7.0:";; esac cat <<\_ACEOF @@ -1431,8 +1439,8 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -rdesktop configure 1.6.0 -generated by GNU Autoconf 2.67 +rdesktop configure 1.7.0 +generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation @@ -1478,7 +1486,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile @@ -1516,7 +1524,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_compile @@ -1553,7 +1561,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp @@ -1595,7 +1603,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run @@ -1609,7 +1617,7 @@ ac_fn_c_check_header_compile () as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if eval "test \"\${$3+set}\"" = set; then : +if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -1627,7 +1635,7 @@ fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile @@ -1672,7 +1680,7 @@ fi # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link @@ -1685,7 +1693,7 @@ ac_fn_c_check_func () as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if eval "test \"\${$3+set}\"" = set; then : +if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -1740,7 +1748,7 @@ fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func @@ -1752,10 +1760,10 @@ $as_echo "$ac_res" >&6; } ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if eval "test \"\${$3+set}\"" = set; then : + if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if eval "test \"\${$3+set}\"" = set; then : +if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 @@ -1818,7 +1826,7 @@ $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if eval "test \"\${$3+set}\"" = set; then : +if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" @@ -1827,7 +1835,7 @@ eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_mongrel @@ -1842,7 +1850,7 @@ ac_fn_c_check_decl () as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 $as_echo_n "checking whether $as_decl_name is declared... " >&6; } -if eval "test \"\${$3+set}\"" = set; then : +if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -1873,7 +1881,7 @@ fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_decl @@ -1886,7 +1894,7 @@ ac_fn_c_check_type () as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if eval "test \"\${$3+set}\"" = set; then : +if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=no" @@ -1927,7 +1935,7 @@ fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_type @@ -1940,7 +1948,7 @@ ac_fn_c_check_member () as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5 $as_echo_n "checking for $2.$3... " >&6; } -if eval "test \"\${$4+set}\"" = set; then : +if eval \${$4+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -1984,15 +1992,15 @@ fi eval ac_res=\$$4 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_member cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by rdesktop $as_me 1.6.0, which was -generated by GNU Autoconf 2.67. Invocation command line was +It was created by rdesktop $as_me 1.7.0, which was +generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2250,7 +2258,7 @@ $as_echo "$as_me: loading site script $ac_site_file" >&6;} || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file -See \`config.log' for more details" "$LINENO" 5 ; } +See \`config.log' for more details" "$LINENO" 5; } fi done @@ -2352,7 +2360,7 @@ if test -n "$ac_tool_prefix"; then set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -2392,7 +2400,7 @@ if test -z "$ac_cv_prog_CC"; then set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : +if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then @@ -2445,7 +2453,7 @@ if test -z "$CC"; then set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -2485,7 +2493,7 @@ if test -z "$CC"; then set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -2544,7 +2552,7 @@ if test -z "$CC"; then set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -2588,7 +2596,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : +if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then @@ -2643,7 +2651,7 @@ fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH -See \`config.log' for more details" "$LINENO" 5 ; } +See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 @@ -2758,7 +2766,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables -See \`config.log' for more details" "$LINENO" 5 ; } +See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } @@ -2801,7 +2809,7 @@ else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details" "$LINENO" 5 ; } +See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 @@ -2860,7 +2868,7 @@ $as_echo "$ac_try_echo"; } >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. -See \`config.log' for more details" "$LINENO" 5 ; } +See \`config.log' for more details" "$LINENO" 5; } fi fi fi @@ -2871,7 +2879,7 @@ rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } -if test "${ac_cv_objext+set}" = set; then : +if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -2912,7 +2920,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile -See \`config.log' for more details" "$LINENO" 5 ; } +See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi @@ -2922,7 +2930,7 @@ OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if test "${ac_cv_c_compiler_gnu+set}" = set; then : +if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -2959,7 +2967,7 @@ ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } -if test "${ac_cv_prog_cc_g+set}" = set; then : +if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag @@ -3037,7 +3045,7 @@ else fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if test "${ac_cv_prog_cc_c89+set}" = set; then : +if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no @@ -3151,7 +3159,7 @@ if test -z "$CXX"; then set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CXX+set}" = set; then : +if ${ac_cv_prog_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CXX"; then @@ -3195,7 +3203,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then : +if ${ac_cv_prog_ac_ct_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CXX"; then @@ -3273,7 +3281,7 @@ done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 $as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } -if test "${ac_cv_cxx_compiler_gnu+set}" = set; then : +if ${ac_cv_cxx_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -3310,7 +3318,7 @@ ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 $as_echo_n "checking whether $CXX accepts -g... " >&6; } -if test "${ac_cv_prog_cxx_g+set}" = set; then : +if ${ac_cv_prog_cxx_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_cxx_werror_flag=$ac_cxx_werror_flag @@ -3439,7 +3447,7 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then -if test "${ac_cv_path_install+set}" = set; then : +if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -3534,7 +3542,7 @@ if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then - if test "${ac_cv_prog_CPP+set}" = set; then : + if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded @@ -3650,7 +3658,7 @@ else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details" "$LINENO" 5 ; } +See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c @@ -3662,7 +3670,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } -if test "${ac_cv_path_GREP+set}" = set; then : +if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then @@ -3725,7 +3733,7 @@ $as_echo "$ac_cv_path_GREP" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } -if test "${ac_cv_path_EGREP+set}" = set; then : +if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 @@ -3792,7 +3800,7 @@ $as_echo "$ac_cv_path_EGREP" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } -if test "${ac_cv_header_stdc+set}" = set; then : +if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -3921,7 +3929,7 @@ done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 $as_echo_n "checking whether byte ordering is bigendian... " >&6; } -if test "${ac_cv_c_bigendian+set}" = set; then : +if ${ac_cv_c_bigendian+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_c_bigendian=unknown @@ -4141,7 +4149,7 @@ $as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h ;; #( *) as_fn_error $? "unknown endianness - presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; + presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for X" >&5 @@ -4159,8 +4167,8 @@ if test "x$with_x" = xno; then have_x=disabled else case $x_includes,$x_libraries in #( - *\'*) as_fn_error $? "cannot use X directory names containing '" "$LINENO" 5 ;; #( - *,NONE | NONE,*) if test "${ac_cv_have_x+set}" = set; then : + *\'*) as_fn_error $? "cannot use X directory names containing '" "$LINENO" 5;; #( + *,NONE | NONE,*) if ${ac_cv_have_x+:} false; then : $as_echo_n "(cached) " >&6 else # One or both of the vars are not set, and there is no cached value. @@ -4437,7 +4445,7 @@ if ac_fn_c_try_link "$LINENO"; then : else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dnet_ntoa in -ldnet" >&5 $as_echo_n "checking for dnet_ntoa in -ldnet... " >&6; } -if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then : +if ${ac_cv_lib_dnet_dnet_ntoa+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -4471,14 +4479,14 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dnet_dnet_ntoa" >&5 $as_echo "$ac_cv_lib_dnet_dnet_ntoa" >&6; } -if test "x$ac_cv_lib_dnet_dnet_ntoa" = x""yes; then : +if test "x$ac_cv_lib_dnet_dnet_ntoa" = xyes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet" fi if test $ac_cv_lib_dnet_dnet_ntoa = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dnet_ntoa in -ldnet_stub" >&5 $as_echo_n "checking for dnet_ntoa in -ldnet_stub... " >&6; } -if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then : +if ${ac_cv_lib_dnet_stub_dnet_ntoa+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -4512,7 +4520,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5 $as_echo "$ac_cv_lib_dnet_stub_dnet_ntoa" >&6; } -if test "x$ac_cv_lib_dnet_stub_dnet_ntoa" = x""yes; then : +if test "x$ac_cv_lib_dnet_stub_dnet_ntoa" = xyes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub" fi @@ -4531,14 +4539,14 @@ rm -f core conftest.err conftest.$ac_objext \ # The functions gethostbyname, getservbyname, and inet_addr are # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking. ac_fn_c_check_func "$LINENO" "gethostbyname" "ac_cv_func_gethostbyname" -if test "x$ac_cv_func_gethostbyname" = x""yes; then : +if test "x$ac_cv_func_gethostbyname" = xyes; then : fi if test $ac_cv_func_gethostbyname = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lnsl" >&5 $as_echo_n "checking for gethostbyname in -lnsl... " >&6; } -if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then : +if ${ac_cv_lib_nsl_gethostbyname+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -4572,14 +4580,14 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostbyname" >&5 $as_echo "$ac_cv_lib_nsl_gethostbyname" >&6; } -if test "x$ac_cv_lib_nsl_gethostbyname" = x""yes; then : +if test "x$ac_cv_lib_nsl_gethostbyname" = xyes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl" fi if test $ac_cv_lib_nsl_gethostbyname = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lbsd" >&5 $as_echo_n "checking for gethostbyname in -lbsd... " >&6; } -if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then : +if ${ac_cv_lib_bsd_gethostbyname+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -4613,7 +4621,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bsd_gethostbyname" >&5 $as_echo "$ac_cv_lib_bsd_gethostbyname" >&6; } -if test "x$ac_cv_lib_bsd_gethostbyname" = x""yes; then : +if test "x$ac_cv_lib_bsd_gethostbyname" = xyes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd" fi @@ -4628,14 +4636,14 @@ fi # must be given before -lnsl if both are needed. We assume that # if connect needs -lnsl, so does gethostbyname. ac_fn_c_check_func "$LINENO" "connect" "ac_cv_func_connect" -if test "x$ac_cv_func_connect" = x""yes; then : +if test "x$ac_cv_func_connect" = xyes; then : fi if test $ac_cv_func_connect = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for connect in -lsocket" >&5 $as_echo_n "checking for connect in -lsocket... " >&6; } -if test "${ac_cv_lib_socket_connect+set}" = set; then : +if ${ac_cv_lib_socket_connect+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -4669,7 +4677,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_connect" >&5 $as_echo "$ac_cv_lib_socket_connect" >&6; } -if test "x$ac_cv_lib_socket_connect" = x""yes; then : +if test "x$ac_cv_lib_socket_connect" = xyes; then : X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS" fi @@ -4677,14 +4685,14 @@ fi # Guillermo Gomez says -lposix is necessary on A/UX. ac_fn_c_check_func "$LINENO" "remove" "ac_cv_func_remove" -if test "x$ac_cv_func_remove" = x""yes; then : +if test "x$ac_cv_func_remove" = xyes; then : fi if test $ac_cv_func_remove = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for remove in -lposix" >&5 $as_echo_n "checking for remove in -lposix... " >&6; } -if test "${ac_cv_lib_posix_remove+set}" = set; then : +if ${ac_cv_lib_posix_remove+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -4718,7 +4726,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_posix_remove" >&5 $as_echo "$ac_cv_lib_posix_remove" >&6; } -if test "x$ac_cv_lib_posix_remove" = x""yes; then : +if test "x$ac_cv_lib_posix_remove" = xyes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix" fi @@ -4726,14 +4734,14 @@ fi # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. ac_fn_c_check_func "$LINENO" "shmat" "ac_cv_func_shmat" -if test "x$ac_cv_func_shmat" = x""yes; then : +if test "x$ac_cv_func_shmat" = xyes; then : fi if test $ac_cv_func_shmat = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shmat in -lipc" >&5 $as_echo_n "checking for shmat in -lipc... " >&6; } -if test "${ac_cv_lib_ipc_shmat+set}" = set; then : +if ${ac_cv_lib_ipc_shmat+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -4767,7 +4775,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ipc_shmat" >&5 $as_echo "$ac_cv_lib_ipc_shmat" >&6; } -if test "x$ac_cv_lib_ipc_shmat" = x""yes; then : +if test "x$ac_cv_lib_ipc_shmat" = xyes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc" fi @@ -4785,7 +4793,7 @@ fi # John Interrante, Karl Berry { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IceConnectionNumber in -lICE" >&5 $as_echo_n "checking for IceConnectionNumber in -lICE... " >&6; } -if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then : +if ${ac_cv_lib_ICE_IceConnectionNumber+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -4819,7 +4827,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5 $as_echo "$ac_cv_lib_ICE_IceConnectionNumber" >&6; } -if test "x$ac_cv_lib_ICE_IceConnectionNumber" = x""yes; then : +if test "x$ac_cv_lib_ICE_IceConnectionNumber" = xyes; then : X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE" fi @@ -4844,7 +4852,7 @@ fi set dummy pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : +if ${ac_cv_path_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in @@ -4883,7 +4891,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing socket" >&5 $as_echo_n "checking for library containing socket... " >&6; } -if test "${ac_cv_search_socket+set}" = set; then : +if ${ac_cv_search_socket+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS @@ -4917,11 +4925,11 @@ for ac_lib in '' socket; do fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext - if test "${ac_cv_search_socket+set}" = set; then : + if ${ac_cv_search_socket+:} false; then : break fi done -if test "${ac_cv_search_socket+set}" = set; then : +if ${ac_cv_search_socket+:} false; then : else ac_cv_search_socket=no @@ -4939,7 +4947,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing inet_aton" >&5 $as_echo_n "checking for library containing inet_aton... " >&6; } -if test "${ac_cv_search_inet_aton+set}" = set; then : +if ${ac_cv_search_inet_aton+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS @@ -4973,11 +4981,11 @@ for ac_lib in '' resolv; do fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext - if test "${ac_cv_search_inet_aton+set}" = set; then : + if ${ac_cv_search_inet_aton+:} false; then : break fi done -if test "${ac_cv_search_inet_aton+set}" = set; then : +if ${ac_cv_search_inet_aton+:} false; then : else ac_cv_search_inet_aton=no @@ -4995,7 +5003,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing clock_gettime" >&5 $as_echo_n "checking for library containing clock_gettime... " >&6; } -if test "${ac_cv_search_clock_gettime+set}" = set; then : +if ${ac_cv_search_clock_gettime+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS @@ -5029,11 +5037,11 @@ for ac_lib in '' rt; do fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext - if test "${ac_cv_search_clock_gettime+set}" = set; then : + if ${ac_cv_search_clock_gettime+:} false; then : break fi done -if test "${ac_cv_search_clock_gettime+set}" = set; then : +if ${ac_cv_search_clock_gettime+:} false; then : else ac_cv_search_clock_gettime=no @@ -5051,54 +5059,61 @@ fi ac_fn_c_check_header_mongrel "$LINENO" "sys/select.h" "ac_cv_header_sys_select_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_select_h" = x""yes; then : +if test "x$ac_cv_header_sys_select_h" = xyes; then : $as_echo "#define HAVE_SYS_SELECT_H 1" >>confdefs.h fi ac_fn_c_check_header_mongrel "$LINENO" "sys/modem.h" "ac_cv_header_sys_modem_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_modem_h" = x""yes; then : +if test "x$ac_cv_header_sys_modem_h" = xyes; then : $as_echo "#define HAVE_SYS_MODEM_H 1" >>confdefs.h fi ac_fn_c_check_header_mongrel "$LINENO" "sys/filio.h" "ac_cv_header_sys_filio_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_filio_h" = x""yes; then : +if test "x$ac_cv_header_sys_filio_h" = xyes; then : $as_echo "#define HAVE_SYS_FILIO_H 1" >>confdefs.h fi ac_fn_c_check_header_mongrel "$LINENO" "sys/strtio.h" "ac_cv_header_sys_strtio_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_strtio_h" = x""yes; then : +if test "x$ac_cv_header_sys_strtio_h" = xyes; then : $as_echo "#define HAVE_SYS_STRTIO_H 1" >>confdefs.h fi ac_fn_c_check_header_mongrel "$LINENO" "locale.h" "ac_cv_header_locale_h" "$ac_includes_default" -if test "x$ac_cv_header_locale_h" = x""yes; then : +if test "x$ac_cv_header_locale_h" = xyes; then : $as_echo "#define HAVE_LOCALE_H 1" >>confdefs.h fi ac_fn_c_check_header_mongrel "$LINENO" "langinfo.h" "ac_cv_header_langinfo_h" "$ac_includes_default" -if test "x$ac_cv_header_langinfo_h" = x""yes; then : +if test "x$ac_cv_header_langinfo_h" = xyes; then : $as_echo "#define HAVE_LANGINFO_H 1" >>confdefs.h fi +ac_fn_c_check_header_mongrel "$LINENO" "sysexits.h" "ac_cv_header_sysexits_h" "$ac_includes_default" +if test "x$ac_cv_header_sysexits_h" = xyes; then : + $as_echo "#define HAVE_SYSEXITS_H 1" >>confdefs.h + +fi + + if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_STRIP+set}" = set; then : +if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then @@ -5138,7 +5153,7 @@ if test -z "$ac_cv_prog_STRIP"; then set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then : +if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then @@ -5257,6 +5272,20 @@ rpath="$rpath:$ssldir/lib" fi +# xrandr +if test -n "$PKG_CONFIG"; then + + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: pkg-config not available, cannot check for xrandr" >&5 +$as_echo "$as_me: WARNING: pkg-config not available, cannot check for xrandr" >&2;} + HAVE_XRANDR=0 + +fi +if test x"$HAVE_XRANDR" = "x1"; then + CFLAGS="$CFLAGS $XRANDR_CFLAGS" + LIBS="$LIBS $XRANDR_LIBS" + $as_echo "#define HAVE_XRANDR 1" >>confdefs.h + +fi # Check whether --enable-smartcard was given. if test "${enable_smartcard+set}" = set; then : @@ -5264,7 +5293,7 @@ if test "${enable_smartcard+set}" = set; then : case "$OSTYPE" in darwin*) ac_fn_c_check_header_mongrel "$LINENO" "PCSC/pcsclite.h" "ac_cv_header_PCSC_pcsclite_h" "$ac_includes_default" -if test "x$ac_cv_header_PCSC_pcsclite_h" = x""yes; then : +if test "x$ac_cv_header_PCSC_pcsclite_h" = xyes; then : WITH_SCARD=1 else WITH_SCARD=0 @@ -5465,7 +5494,7 @@ fi ac_fn_c_check_header_mongrel "$LINENO" "sys/soundcard.h" "ac_cv_header_sys_soundcard_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_soundcard_h" = x""yes; then : +if test "x$ac_cv_header_sys_soundcard_h" = xyes; then : HAVE_OSS=1 else HAVE_OSS=0 @@ -5473,7 +5502,7 @@ fi ac_fn_c_check_header_mongrel "$LINENO" "dmedia/audio.h" "ac_cv_header_dmedia_audio_h" "$ac_includes_default" -if test "x$ac_cv_header_dmedia_audio_h" = x""yes; then : +if test "x$ac_cv_header_dmedia_audio_h" = xyes; then : HAVE_SGI=1 else HAVE_SGI=0 @@ -5481,7 +5510,7 @@ fi ac_fn_c_check_header_mongrel "$LINENO" "sys/audioio.h" "ac_cv_header_sys_audioio_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_audioio_h" = x""yes; then : +if test "x$ac_cv_header_sys_audioio_h" = xyes; then : HAVE_SUN=1 else HAVE_SUN=0 @@ -5652,7 +5681,7 @@ for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5 $as_echo_n "checking for $ac_hdr that defines DIR... " >&6; } -if eval "test \"\${$as_ac_Header+set}\"" = set; then : +if eval \${$as_ac_Header+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -5692,7 +5721,7 @@ done if test $ac_header_dirent = dirent.h; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 $as_echo_n "checking for library containing opendir... " >&6; } -if test "${ac_cv_search_opendir+set}" = set; then : +if ${ac_cv_search_opendir+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS @@ -5726,11 +5755,11 @@ for ac_lib in '' dir; do fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext - if test "${ac_cv_search_opendir+set}" = set; then : + if ${ac_cv_search_opendir+:} false; then : break fi done -if test "${ac_cv_search_opendir+set}" = set; then : +if ${ac_cv_search_opendir+:} false; then : else ac_cv_search_opendir=no @@ -5749,7 +5778,7 @@ fi else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 $as_echo_n "checking for library containing opendir... " >&6; } -if test "${ac_cv_search_opendir+set}" = set; then : +if ${ac_cv_search_opendir+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS @@ -5783,11 +5812,11 @@ for ac_lib in '' x; do fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext - if test "${ac_cv_search_opendir+set}" = set; then : + if ${ac_cv_search_opendir+:} false; then : break fi done -if test "${ac_cv_search_opendir+set}" = set; then : +if ${ac_cv_search_opendir+:} false; then : else ac_cv_search_opendir=no @@ -5824,7 +5853,7 @@ fi for ac_func in dirfd do : ac_fn_c_check_func "$LINENO" "dirfd" "ac_cv_func_dirfd" -if test "x$ac_cv_func_dirfd" = x""yes; then : +if test "x$ac_cv_func_dirfd" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_DIRFD 1 _ACEOF @@ -5834,7 +5863,7 @@ done ac_fn_c_check_decl "$LINENO" "dirfd" "ac_cv_have_decl_dirfd" "$dirfd_headers " -if test "x$ac_cv_have_decl_dirfd" = x""yes; then : +if test "x$ac_cv_have_decl_dirfd" = xyes; then : ac_have_decl=1 else ac_have_decl=0 @@ -5847,7 +5876,7 @@ _ACEOF { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether dirfd is a macro" >&5 $as_echo_n "checking whether dirfd is a macro... " >&6; } -if test "${jm_cv_func_dirfd_macro+set}" = set; then : +if ${jm_cv_func_dirfd_macro+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -5874,7 +5903,7 @@ $as_echo "$jm_cv_func_dirfd_macro" >&6; } if test $ac_cv_func_dirfd,$ac_cv_have_decl_dirfd,$jm_cv_func_dirfd_macro \ = no,no,no; then ac_fn_c_check_func "$LINENO" "dirfd" "ac_cv_func_dirfd" -if test "x$ac_cv_func_dirfd" = x""yes; then : +if test "x$ac_cv_func_dirfd" = xyes; then : $as_echo "#define HAVE_DIRFD 1" >>confdefs.h else @@ -5889,7 +5918,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to get the file descriptor associated with an open DIR*" >&5 $as_echo_n "checking how to get the file descriptor associated with an open DIR*... " >&6; } -if test "${gl_cv_sys_dir_fd_member_name+set}" = set; then : +if ${gl_cv_sys_dir_fd_member_name+:} false; then : $as_echo_n "(cached) " >&6 else @@ -5957,7 +5986,7 @@ if test "${with_libiconv_prefix+set}" = set; then : fi ac_fn_c_check_header_mongrel "$LINENO" "iconv.h" "ac_cv_header_iconv_h" "$ac_includes_default" -if test "x$ac_cv_header_iconv_h" = x""yes; then : +if test "x$ac_cv_header_iconv_h" = xyes; then : $as_echo "#define HAVE_ICONV_H 1" >>confdefs.h fi @@ -5966,7 +5995,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv" >&5 $as_echo_n "checking for iconv... " >&6; } -if test "${am_cv_func_iconv+set}" = set; then : +if ${am_cv_func_iconv+:} false; then : $as_echo_n "(cached) " >&6 else @@ -6026,7 +6055,7 @@ $as_echo "#define HAVE_ICONV 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv declaration" >&5 $as_echo_n "checking for iconv declaration... " >&6; } - if test "${am_cv_proto_iconv+set}" = set; then : + if ${am_cv_proto_iconv+:} false; then : $as_echo_n "(cached) " >&6 else @@ -6091,19 +6120,19 @@ LIBS="$LIBS $LIBICONV" ac_fn_c_check_type "$LINENO" "socklen_t" "ac_cv_type_socklen_t" "#include #include " -if test "x$ac_cv_type_socklen_t" = x""yes; then : +if test "x$ac_cv_type_socklen_t" = xyes; then : else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for socklen_t equivalent" >&5 $as_echo_n "checking for socklen_t equivalent... " >&6; } - if test "${socklen_t_equiv+set}" = set; then : + if ${socklen_t_cv_equiv+:} false; then : $as_echo_n "(cached) " >&6 else # Systems have either "struct sockaddr *" or # "void *" as the second argument to getpeername - socklen_t_equiv= + socklen_t_cv_equiv= for arg2 in "struct sockaddr" void; do for t in int size_t unsigned long "unsigned long"; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -6127,7 +6156,7 @@ main () _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - socklen_t_equiv="$t" + socklen_t_cv_equiv="$t" break fi @@ -6135,17 +6164,17 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done done - if test "x$socklen_t_equiv" = x; then + if test "x$socklen_t_cv_equiv" = x; then as_fn_error $? "Cannot find a type to use in place of socklen_t" "$LINENO" 5 fi fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $socklen_t_equiv" >&5 -$as_echo "$socklen_t_equiv" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $socklen_t_cv_equiv" >&5 +$as_echo "$socklen_t_cv_equiv" >&6; } cat >>confdefs.h <<_ACEOF -#define socklen_t $socklen_t_equiv +#define socklen_t $socklen_t_cv_equiv _ACEOF fi @@ -6158,7 +6187,7 @@ fi for ac_header in sys/vfs.h do : ac_fn_c_check_header_mongrel "$LINENO" "sys/vfs.h" "ac_cv_header_sys_vfs_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_vfs_h" = x""yes; then : +if test "x$ac_cv_header_sys_vfs_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SYS_VFS_H 1 _ACEOF @@ -6170,7 +6199,7 @@ done for ac_header in sys/statvfs.h do : ac_fn_c_check_header_mongrel "$LINENO" "sys/statvfs.h" "ac_cv_header_sys_statvfs_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_statvfs_h" = x""yes; then : +if test "x$ac_cv_header_sys_statvfs_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SYS_STATVFS_H 1 _ACEOF @@ -6182,7 +6211,7 @@ done for ac_header in sys/statfs.h do : ac_fn_c_check_header_mongrel "$LINENO" "sys/statfs.h" "ac_cv_header_sys_statfs_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_statfs_h" = x""yes; then : +if test "x$ac_cv_header_sys_statfs_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SYS_STATFS_H 1 _ACEOF @@ -6194,7 +6223,7 @@ done for ac_header in sys/param.h do : ac_fn_c_check_header_mongrel "$LINENO" "sys/param.h" "ac_cv_header_sys_param_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_param_h" = x""yes; then : +if test "x$ac_cv_header_sys_param_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SYS_PARAM_H 1 _ACEOF @@ -6215,7 +6244,7 @@ for ac_header in sys/mount.h do : ac_fn_c_check_header_compile "$LINENO" "sys/mount.h" "ac_cv_header_sys_mount_h" "$mount_includes " -if test "x$ac_cv_header_sys_mount_h" = x""yes; then : +if test "x$ac_cv_header_sys_mount_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SYS_MOUNT_H 1 _ACEOF @@ -6236,7 +6265,7 @@ if test $space = no; then # SVR4 { $as_echo "$as_me:${as_lineno-$LINENO}: checking statvfs64 function (SVR4)" >&5 $as_echo_n "checking statvfs64 function (SVR4)... " >&6; } -if test "${fu_cv_sys_stat_statvfs64+set}" = set; then : +if ${fu_cv_sys_stat_statvfs64+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : @@ -6286,7 +6315,7 @@ if test $space = no; then # SVR4 { $as_echo "$as_me:${as_lineno-$LINENO}: checking statvfs function (SVR4)" >&5 $as_echo_n "checking statvfs function (SVR4)... " >&6; } -if test "${fu_cv_sys_stat_statvfs+set}" = set; then : +if ${fu_cv_sys_stat_statvfs+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -6323,7 +6352,7 @@ if test $space = no; then # DEC Alpha running OSF/1 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 3-argument statfs function (DEC OSF/1)" >&5 $as_echo_n "checking for 3-argument statfs function (DEC OSF/1)... " >&6; } - if test "${fu_cv_sys_stat_statfs3_osf1+set}" = set; then : + if ${fu_cv_sys_stat_statfs3_osf1+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : @@ -6368,7 +6397,7 @@ if test $space = no; then # AIX { $as_echo "$as_me:${as_lineno-$LINENO}: checking for two-argument statfs with statfs.bsize member (AIX, 4.3BSD)" >&5 $as_echo_n "checking for two-argument statfs with statfs.bsize member (AIX, 4.3BSD)... " >&6; } - if test "${fu_cv_sys_stat_statfs2_bsize+set}" = set; then : + if ${fu_cv_sys_stat_statfs2_bsize+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : @@ -6418,7 +6447,7 @@ if test $space = no; then # SVR3 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for four-argument statfs (AIX-3.2.5, SVR3)" >&5 $as_echo_n "checking for four-argument statfs (AIX-3.2.5, SVR3)... " >&6; } - if test "${fu_cv_sys_stat_statfs4+set}" = set; then : + if ${fu_cv_sys_stat_statfs4+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : @@ -6459,7 +6488,7 @@ if test $space = no; then # 4.4BSD and NetBSD { $as_echo "$as_me:${as_lineno-$LINENO}: checking for two-argument statfs with statfs.fsize member (4.4BSD and NetBSD)" >&5 $as_echo_n "checking for two-argument statfs with statfs.fsize member (4.4BSD and NetBSD)... " >&6; } - if test "${fu_cv_sys_stat_statfs2_fsize+set}" = set; then : + if ${fu_cv_sys_stat_statfs2_fsize+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : @@ -6506,7 +6535,7 @@ if test $space = no; then # Ultrix { $as_echo "$as_me:${as_lineno-$LINENO}: checking for two-argument statfs with struct fs_data (Ultrix)" >&5 $as_echo_n "checking for two-argument statfs with struct fs_data (Ultrix)... " >&6; } - if test "${fu_cv_sys_stat_fs_data+set}" = set; then : + if ${fu_cv_sys_stat_fs_data+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : @@ -6577,7 +6606,7 @@ $ac_includes_default ac_fn_c_check_member "$LINENO" "struct statfs" "f_namemax" "ac_cv_member_struct_statfs_f_namemax" "$statxfs_includes " -if test "x$ac_cv_member_struct_statfs_f_namemax" = x""yes; then : +if test "x$ac_cv_member_struct_statfs_f_namemax" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_STATFS_F_NAMEMAX 1 @@ -6588,7 +6617,7 @@ fi ac_fn_c_check_member "$LINENO" "struct statvfs" "f_namemax" "ac_cv_member_struct_statvfs_f_namemax" "$statxfs_includes " -if test "x$ac_cv_member_struct_statvfs_f_namemax" = x""yes; then : +if test "x$ac_cv_member_struct_statvfs_f_namemax" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_STATVFS_F_NAMEMAX 1 @@ -6599,7 +6628,7 @@ fi ac_fn_c_check_member "$LINENO" "struct statfs" "f_namelen" "ac_cv_member_struct_statfs_f_namelen" "$statxfs_includes " -if test "x$ac_cv_member_struct_statfs_f_namelen" = x""yes; then : +if test "x$ac_cv_member_struct_statfs_f_namelen" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_STATFS_F_NAMELEN 1 @@ -6610,7 +6639,7 @@ fi ac_fn_c_check_member "$LINENO" "struct statvfs" "f_namelen" "ac_cv_member_struct_statvfs_f_namelen" "$statxfs_includes " -if test "x$ac_cv_member_struct_statvfs_f_namelen" = x""yes; then : +if test "x$ac_cv_member_struct_statvfs_f_namelen" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_STATVFS_F_NAMELEN 1 @@ -6632,7 +6661,7 @@ if test "$enable_largefile" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5 $as_echo_n "checking for special C compiler options needed for large files... " >&6; } -if test "${ac_cv_sys_largefile_CC+set}" = set; then : +if ${ac_cv_sys_largefile_CC+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_sys_largefile_CC=no @@ -6683,7 +6712,7 @@ $as_echo "$ac_cv_sys_largefile_CC" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5 $as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } -if test "${ac_cv_sys_file_offset_bits+set}" = set; then : +if ${ac_cv_sys_file_offset_bits+:} false; then : $as_echo_n "(cached) " >&6 else while :; do @@ -6752,7 +6781,7 @@ rm -rf conftest* if test $ac_cv_sys_file_offset_bits = unknown; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5 $as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; } -if test "${ac_cv_sys_large_files+set}" = set; then : +if ${ac_cv_sys_large_files+:} false; then : $as_echo_n "(cached) " >&6 else while :; do @@ -6826,7 +6855,7 @@ fi # mntent # ac_fn_c_check_header_mongrel "$LINENO" "mntent.h" "ac_cv_header_mntent_h" "$ac_includes_default" -if test "x$ac_cv_header_mntent_h" = x""yes; then : +if test "x$ac_cv_header_mntent_h" = xyes; then : $as_echo "#define HAVE_MNTENT_H 1" >>confdefs.h fi @@ -6835,7 +6864,7 @@ fi for ac_func in setmntent do : ac_fn_c_check_func "$LINENO" "setmntent" "ac_cv_func_setmntent" -if test "x$ac_cv_func_setmntent" = x""yes; then : +if test "x$ac_cv_func_setmntent" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SETMNTENT 1 _ACEOF @@ -6981,7 +7010,7 @@ $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } -if test "${ac_cv_build+set}" = set; then : +if ${ac_cv_build+:} false; then : $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias @@ -6997,7 +7026,7 @@ fi $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; -*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5 ;; +*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' @@ -7015,7 +7044,7 @@ case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } -if test "${ac_cv_host+set}" = set; then : +if ${ac_cv_host+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then @@ -7030,7 +7059,7 @@ fi $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; -*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5 ;; +*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' @@ -7129,10 +7158,21 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then - test "x$cache_file" != "x/dev/null" && + if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} - cat confcache >$cache_file + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} @@ -7201,7 +7241,7 @@ LTLIBOBJS=$ac_ltlibobjs -: ${CONFIG_STATUS=./config.status} +: "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" @@ -7302,6 +7342,7 @@ fi IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. +as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -7608,8 +7649,8 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by rdesktop $as_me 1.6.0, which was -generated by GNU Autoconf 2.67. Invocation command line was +This file was extended by rdesktop $as_me 1.7.0, which was +generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -7661,8 +7702,8 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -rdesktop config.status 1.6.0 -configured by $0, generated by GNU Autoconf 2.67, +rdesktop config.status 1.7.0 +configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" Copyright (C) 2010 Free Software Foundation, Inc. @@ -7774,7 +7815,7 @@ do case $ac_config_target in "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; - *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5 ;; + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done @@ -7795,9 +7836,10 @@ fi # after its creation but before its name has been assigned to `$tmp'. $debug || { - tmp= + tmp= ac_tmp= trap 'exit_status=$? - { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } @@ -7805,12 +7847,13 @@ $debug || { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && - test -n "$tmp" && test -d "$tmp" + test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. @@ -7832,7 +7875,7 @@ else ac_cs_awk_cr=$ac_cr fi -echo 'BEGIN {' >"$tmp/subs1.awk" && +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF @@ -7860,7 +7903,7 @@ done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -cat >>"\$tmp/subs1.awk" <<\\_ACAWK && +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h @@ -7908,7 +7951,7 @@ t delim rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK -cat >>"\$tmp/subs1.awk" <<_ACAWK && +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" @@ -7940,7 +7983,7 @@ if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat -fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF @@ -7980,7 +8023,7 @@ do esac case $ac_mode$ac_tag in :[FHL]*:*);; - :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5 ;; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac @@ -7999,7 +8042,7 @@ do for ac_f do case $ac_f in - -) ac_f="$tmp/stdin";; + -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. @@ -8008,7 +8051,7 @@ do [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || - as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5 ;; + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" @@ -8034,8 +8077,8 @@ $as_echo "$as_me: creating $ac_file" >&6;} esac case $ac_tag in - *:-:* | *:-) cat >"$tmp/stdin" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac @@ -8165,21 +8208,22 @@ s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t $ac_datarootdir_hack " -eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && - { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && - { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} - rm -f "$tmp/stdin" + rm -f "$ac_tmp/stdin" case $ac_file in - -) cat "$tmp/out" && rm -f "$tmp/out";; - *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; diff --git a/src/VBox/RDP/client/configure.ac b/src/VBox/RDP/client/configure.ac index c5056f525..2f7249a97 100644 --- a/src/VBox/RDP/client/configure.ac +++ b/src/VBox/RDP/client/configure.ac @@ -1,4 +1,4 @@ -AC_INIT(rdesktop, 1.6.0) +AC_INIT(rdesktop, 1.7.0) AC_CONFIG_SRCDIR([rdesktop.c]) @@ -38,6 +38,7 @@ AC_CHECK_HEADER(sys/filio.h, AC_DEFINE(HAVE_SYS_FILIO_H)) AC_CHECK_HEADER(sys/strtio.h, AC_DEFINE(HAVE_SYS_STRTIO_H)) AC_CHECK_HEADER(locale.h, AC_DEFINE(HAVE_LOCALE_H)) AC_CHECK_HEADER(langinfo.h, AC_DEFINE(HAVE_LANGINFO_H)) +AC_CHECK_HEADER(sysexits.h, AC_DEFINE(HAVE_SYSEXITS_H)) AC_CHECK_TOOL(STRIP, strip, :) @@ -106,6 +107,15 @@ LIBS="$LIBS $ssldir/lib/libcrypto.a" LIBS="$LIBS -L$ssldir/lib -lcrypto" rpath="$rpath:$ssldir/lib" ]) +# xrandr +if test -n "$PKG_CONFIG"; then + PKG_CHECK_MODULES(XRANDR, xrandr, [HAVE_XRANDR=1], [HAVE_XRANDR=0]) +fi +if test x"$HAVE_XRANDR" = "x1"; then + CFLAGS="$CFLAGS $XRANDR_CFLAGS" + LIBS="$LIBS $XRANDR_LIBS" + AC_DEFINE(HAVE_XRANDR) +fi AC_ARG_ENABLE(smartcard, [ --enable-smartcard Enables smart-card support. @@ -527,11 +537,11 @@ AC_DEFUN([TYPE_SOCKLEN_T], [ AC_CHECK_TYPE([socklen_t], ,[ AC_MSG_CHECKING([for socklen_t equivalent]) - AC_CACHE_VAL([socklen_t_equiv], + AC_CACHE_VAL([socklen_t_cv_equiv], [ # Systems have either "struct sockaddr *" or # "void *" as the second argument to getpeername - socklen_t_equiv= + socklen_t_cv_equiv= for arg2 in "struct sockaddr" void; do for t in int size_t unsigned long "unsigned long"; do AC_TRY_COMPILE([ @@ -543,18 +553,18 @@ AC_DEFUN([TYPE_SOCKLEN_T], $t len; getpeername(0,0,&len); ],[ - socklen_t_equiv="$t" + socklen_t_cv_equiv="$t" break ]) done done - if test "x$socklen_t_equiv" = x; then + if test "x$socklen_t_cv_equiv" = x; then AC_MSG_ERROR([Cannot find a type to use in place of socklen_t]) fi ]) - AC_MSG_RESULT($socklen_t_equiv) - AC_DEFINE_UNQUOTED(socklen_t, $socklen_t_equiv, + AC_MSG_RESULT($socklen_t_cv_equiv) + AC_DEFINE_UNQUOTED(socklen_t, $socklen_t_cv_equiv, [type to use in place of socklen_t if not defined])], [#include #include ]) diff --git a/src/VBox/RDP/client/constants.h b/src/VBox/RDP/client/constants.h index 560d92d5a..ee49c951a 100644 --- a/src/VBox/RDP/client/constants.h +++ b/src/VBox/RDP/client/constants.h @@ -1,11 +1,11 @@ /* rdesktop: A Remote Desktop Protocol client. Miscellaneous protocol constants - Copyright (C) Matthew Chapman 1999-2007 + Copyright (C) Matthew Chapman 1999-2008 - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or + the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + along with this program. If not, see . */ /* @@ -131,12 +130,26 @@ enum RDP_DATA_PDU_TYPE RDP_DATA_PDU_SYNCHRONISE = 31, RDP_DATA_PDU_BELL = 34, RDP_DATA_PDU_CLIENT_WINDOW_STATUS = 35, - RDP_DATA_PDU_LOGON = 38, + RDP_DATA_PDU_LOGON = 38, /* PDUTYPE2_SAVE_SESSION_INFO */ RDP_DATA_PDU_FONT2 = 39, RDP_DATA_PDU_KEYBOARD_INDICATORS = 41, RDP_DATA_PDU_DISCONNECT = 47 }; +enum RDP_SAVE_SESSION_PDU_TYPE +{ + INFOTYPE_LOGON = 0, + INFOTYPE_LOGON_LONG = 1, + INFOTYPE_LOGON_PLAINNOTIFY = 2, + INFOTYPE_LOGON_EXTENDED_INF = 3 +}; + +enum RDP_LOGON_INFO_EXTENDED_TYPE +{ + LOGON_EX_AUTORECONNECTCOOKIE = 1, + LOGON_EX_LOGONERRORS = 2 +}; + enum RDP_CONTROL_PDU_TYPE { RDP_CTL_REQUEST_CONTROL = 1, @@ -158,7 +171,8 @@ enum RDP_POINTER_PDU_TYPE RDP_POINTER_SYSTEM = 1, RDP_POINTER_MOVE = 3, RDP_POINTER_COLOR = 6, - RDP_POINTER_CACHED = 7 + RDP_POINTER_CACHED = 7, + RDP_POINTER_NEW = 8 }; enum RDP_SYSTEM_POINTER_TYPE @@ -254,6 +268,7 @@ enum RDP_INPUT_DEVICE #define RDP_CAPSET_POINTER 8 #define RDP_CAPLEN_POINTER 0x08 +#define RDP_CAPLEN_NEWPOINTER 0x0a #define RDP_CAPSET_SHARE 9 #define RDP_CAPLEN_SHARE 0x08 @@ -261,6 +276,9 @@ enum RDP_INPUT_DEVICE #define RDP_CAPSET_COLCACHE 10 #define RDP_CAPLEN_COLCACHE 0x08 +#define RDP_CAPSET_BRUSHCACHE 15 +#define RDP_CAPLEN_BRUSHCACHE 0x08 + #define RDP_CAPSET_BMPCACHE2 19 #define RDP_CAPLEN_BMPCACHE2 0x28 #define BMPCACHE2_FLAG_PERSIST ((uint32)1<<31) @@ -389,6 +407,7 @@ enum RDP_INPUT_DEVICE #define RD_STATUS_TIMEOUT 0xc0000102 #define RD_STATUS_NOTIFY_ENUM_DIR 0xc000010c #define RD_STATUS_CANCELLED 0xc0000120 +#define RD_STATUS_DIRECTORY_NOT_EMPTY 0xc0000101 /* RDPDR constants */ @@ -415,6 +434,7 @@ enum RDP_INPUT_DEVICE #define exDiscReasonOutOfMemory 0x0006 #define exDiscReasonServerDeniedConnection 0x0007 #define exDiscReasonServerDeniedConnectionFips 0x0008 +#define exDiscReasonWindows7Disconnect 0x000b /* unofficial */ #define exDiscReasonLicenseInternal 0x0100 #define exDiscReasonLicenseNoLicenseServer 0x0101 #define exDiscReasonLicenseNoLicense 0x0102 @@ -446,3 +466,20 @@ enum RDP_INPUT_DEVICE #define SCARD_LOCK_CHANNEL 2 #define SCARD_LOCK_RDPDR 3 #define SCARD_LOCK_LAST 4 + + +/* redirect flags, from [MS-RDPBCGR] 2.2.13.1 */ +enum RDP_PDU_REDIRECT_FLAGS +{ + PDU_REDIRECT_HAS_IP = 0x1, + PDU_REDIRECT_HAS_COOKIE = 0x2, + PDU_REDIRECT_HAS_USERNAME = 0x4, + PDU_REDIRECT_HAS_DOMAIN = 0x8, + PDU_REDIRECT_HAS_PASSWORD = 0x10, + PDU_REDIRECT_DONT_STORE_USERNAME = 0x20, + PDU_REDIRECT_USE_SMARTCARD = 0x40, + PDU_REDIRECT_INFORMATIONAL = 0x80, + PDU_REDIRECT_HAS_TARGET_FQDN = 0x100, + PDU_REDIRECT_HAS_TARGET_NETBIOS = 0x200, + PDU_REDIRECT_HAS_TARGET_IP_ARRAY = 0x800 +}; diff --git a/src/VBox/RDP/client/disk.c b/src/VBox/RDP/client/disk.c index ccf59d051..3f8bd083a 100644 --- a/src/VBox/RDP/client/disk.c +++ b/src/VBox/RDP/client/disk.c @@ -1,11 +1,12 @@ /* -*- c-basic-offset: 8 -*- rdesktop: A Remote Desktop Protocol client. Disk Redirection - Copyright (C) Jeroen Meijer 2003-2007 + Copyright (C) Jeroen Meijer 2003-2008 + Copyright 2003-2011 Peter Astrand for Cendio AB - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or + the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -14,8 +15,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + along with this program. If not, see . */ /* @@ -369,6 +369,19 @@ disk_create(uint32 device_id, uint32 accessmask, uint32 sharemode, uint32 create sprintf(path, "%s%s", g_rdpdr_device[device_id].local_path, filename); #endif + /* Protect against mailicous servers: + somelongpath/.. not allowed + somelongpath/../b not allowed + somelongpath/..b in principle ok, but currently not allowed + somelongpath/b.. ok + somelongpath/b..b ok + somelongpath/b../c ok + */ + if (strstr(path, "/..")) + { + return RD_STATUS_ACCESS_DENIED; + } + switch (create_disposition) { case CREATE_ALWAYS: @@ -493,7 +506,7 @@ disk_create(uint32 device_id, uint32 accessmask, uint32 sharemode, uint32 create { error("Maximum number of open files (%s) reached. Increase MAX_OPEN_FILES!\n", handle); - exit(1); + exit(EX_SOFTWARE); } if (dirp) @@ -713,7 +726,7 @@ disk_query_information(RD_NTHANDLE handle, uint32 info_class, STREAM out) RD_NTSTATUS disk_set_information(RD_NTHANDLE handle, uint32 info_class, STREAM in, STREAM out) { - uint32 length, file_attributes, ft_high, ft_low, delete_on_close; + uint32 length, file_attributes, ft_high, ft_low; char newname[PATH_MAX], fullpath[PATH_MAX]; struct fileinfo *pfinfo; int mode; @@ -848,12 +861,45 @@ disk_set_information(RD_NTHANDLE handle, uint32 info_class, STREAM in, STREAM ou the delete. See http://www.osronline.com/article.cfm?article=245. */ - in_uint32_le(in, delete_on_close); + /* FileDispositionInformation always sets delete_on_close to true. + "STREAM in" includes Length(4bytes) , Padding(24bytes) and SetBuffer(zero byte). + Length is always set to zero. + [MS-RDPEFS] http://msdn.microsoft.com/en-us/library/cc241305%28PROT.10%29.aspx + - 2.2.3.3.9 Server Drive Set Information Request + */ + in_uint8s(in, 4); /* length of SetBuffer */ + in_uint8s(in, 24); /* padding */ + - if (delete_on_close || - (pfinfo-> - accessmask & (FILE_DELETE_ON_CLOSE | FILE_COMPLETE_IF_OPLOCKED))) + if ((pfinfo->accessmask & + (FILE_DELETE_ON_CLOSE | FILE_COMPLETE_IF_OPLOCKED))) { + /* if file exists in directory , necessary to return RD_STATUS_DIRECTORY_NOT_EMPTY with win2008 + [MS-RDPEFS] http://msdn.microsoft.com/en-us/library/cc241305%28PROT.10%29.aspx + - 2.2.3.3.9 Server Drive Set Information Request + - 2.2.3.4.9 Client Drive Set Information Response + [MS-FSCC] http://msdn.microsoft.com/en-us/library/cc231987%28PROT.10%29.aspx + - 2.4.11 FileDispositionInformation + [FSBO] http://msdn.microsoft.com/en-us/library/cc246487%28PROT.13%29.aspx + - 4.3.2 Set Delete-on-close using FileDispositionInformation Information Class (IRP_MJ_SET_INFORMATION) + */ + if (pfinfo->pdir) + { + DIR *dp = opendir(pfinfo->path); + struct dirent *dir; + + while ((dir = readdir(dp)) != NULL) + { + if (strcmp(dir->d_name, ".") != 0 + && strcmp(dir->d_name, "..") != 0) + { + closedir(dp); + return RD_STATUS_DIRECTORY_NOT_EMPTY; + } + } + closedir(dp); + } + pfinfo->delete_on_close = True; } @@ -1105,6 +1151,18 @@ disk_query_volume_information(RD_NTHANDLE handle, uint32 info_class, STREAM out) out_uint32_le(out, 0x200); /* Bytes per sector */ break; + case FileFsFullSizeInformation: + + out_uint32_le(out, stat_fs.f_blocks); /* Total allocation units low */ + out_uint32_le(out, 0); /* Total allocation units high */ + out_uint32_le(out, stat_fs.f_blocks); /* Caller allocation units low */ + out_uint32_le(out, 0); /* Caller allocation units high */ + out_uint32_le(out, stat_fs.f_bfree); /* Available allocation units */ + out_uint32_le(out, 0); /* Available allowcation units */ + out_uint32_le(out, stat_fs.f_bsize / 0x200); /* Sectors per allocation unit */ + out_uint32_le(out, 0x200); /* Bytes per sector */ + break; + case FileFsAttributeInformation: out_uint32_le(out, FS_CASE_SENSITIVE | FS_CASE_IS_PRESERVED); /* fs attributes */ @@ -1117,7 +1175,6 @@ disk_query_volume_information(RD_NTHANDLE handle, uint32 info_class, STREAM out) case FileFsLabelInformation: case FileFsDeviceInformation: case FileFsControlInformation: - case FileFsFullSizeInformation: case FileFsObjectIdInformation: case FileFsMaximumInformation: @@ -1144,9 +1201,13 @@ disk_query_directory(RD_NTHANDLE handle, uint32 info_class, char *pattern, STREA dirname = pfinfo->path; file_attributes = 0; + switch (info_class) { case FileBothDirectoryInformation: + case FileDirectoryInformation: + case FileFullDirectoryInformation: + case FileNamesInformation: /* If a search pattern is received, remember this pattern, and restart search */ if (pattern[0] != 0) @@ -1199,7 +1260,82 @@ disk_query_directory(RD_NTHANDLE handle, uint32 info_class, char *pattern, STREA file_attributes |= FILE_ATTRIBUTE_READONLY; /* Return requested information */ - out_uint8s(out, 8); /* unknown zero */ + out_uint32_le(out, 0); /* NextEntryOffset */ + out_uint32_le(out, 0); /* FileIndex zero */ + break; + + default: + unimpl("IRP Query Directory sub: 0x%x\n", info_class); + return RD_STATUS_INVALID_PARAMETER; + } + + switch (info_class) + { + case FileBothDirectoryInformation: + + seconds_since_1970_to_filetime(get_create_time(&filestat), &ft_high, + &ft_low); + out_uint32_le(out, ft_low); /* create time */ + out_uint32_le(out, ft_high); + + seconds_since_1970_to_filetime(filestat.st_atime, &ft_high, &ft_low); + out_uint32_le(out, ft_low); /* last_access_time */ + out_uint32_le(out, ft_high); + + seconds_since_1970_to_filetime(filestat.st_mtime, &ft_high, &ft_low); + out_uint32_le(out, ft_low); /* last_write_time */ + out_uint32_le(out, ft_high); + + seconds_since_1970_to_filetime(filestat.st_ctime, &ft_high, &ft_low); + out_uint32_le(out, ft_low); /* change_write_time */ + out_uint32_le(out, ft_high); + + out_uint32_le(out, filestat.st_size); /* filesize low */ + out_uint32_le(out, 0); /* filesize high */ + out_uint32_le(out, filestat.st_size); /* filesize low */ + out_uint32_le(out, 0); /* filesize high */ + out_uint32_le(out, file_attributes); /* FileAttributes */ + out_uint32_le(out, 2 * strlen(pdirent->d_name) + 2); /* unicode length */ + out_uint32_le(out, 0); /* EaSize */ + out_uint8(out, 0); /* ShortNameLength */ + /* this should be correct according to MS-FSCC specification + but it only works when commented out... */ + /* out_uint8(out, 0); *//* Reserved/Padding */ + out_uint8s(out, 2 * 12); /* ShortName (8.3 name) */ + rdp_out_unistr(out, pdirent->d_name, 2 * strlen(pdirent->d_name)); + break; + + + case FileDirectoryInformation: + + seconds_since_1970_to_filetime(get_create_time(&filestat), &ft_high, + &ft_low); + out_uint32_le(out, ft_low); /* create time */ + out_uint32_le(out, ft_high); + + seconds_since_1970_to_filetime(filestat.st_atime, &ft_high, &ft_low); + out_uint32_le(out, ft_low); /* last_access_time */ + out_uint32_le(out, ft_high); + + seconds_since_1970_to_filetime(filestat.st_mtime, &ft_high, &ft_low); + out_uint32_le(out, ft_low); /* last_write_time */ + out_uint32_le(out, ft_high); + + seconds_since_1970_to_filetime(filestat.st_ctime, &ft_high, &ft_low); + out_uint32_le(out, ft_low); /* change_write_time */ + out_uint32_le(out, ft_high); + + out_uint32_le(out, filestat.st_size); /* filesize low */ + out_uint32_le(out, 0); /* filesize high */ + out_uint32_le(out, filestat.st_size); /* filesize low */ + out_uint32_le(out, 0); /* filesize high */ + out_uint32_le(out, file_attributes); + out_uint32_le(out, 2 * strlen(pdirent->d_name) + 2); /* unicode length */ + rdp_out_unistr(out, pdirent->d_name, 2 * strlen(pdirent->d_name)); + break; + + + case FileFullDirectoryInformation: seconds_since_1970_to_filetime(get_create_time(&filestat), &ft_high, &ft_low); @@ -1223,17 +1359,20 @@ disk_query_directory(RD_NTHANDLE handle, uint32 info_class, char *pattern, STREA out_uint32_le(out, filestat.st_size); /* filesize low */ out_uint32_le(out, 0); /* filesize high */ out_uint32_le(out, file_attributes); - out_uint8(out, 2 * strlen(pdirent->d_name) + 2); /* unicode length */ - out_uint8s(out, 7); /* pad? */ - out_uint8(out, 0); /* 8.3 file length */ - out_uint8s(out, 2 * 12); /* 8.3 unicode length */ + out_uint32_le(out, 2 * strlen(pdirent->d_name) + 2); /* unicode length */ + out_uint32_le(out, 0); /* EaSize */ rdp_out_unistr(out, pdirent->d_name, 2 * strlen(pdirent->d_name)); break; + + case FileNamesInformation: + + out_uint32_le(out, 2 * strlen(pdirent->d_name) + 2); /* unicode length */ + rdp_out_unistr(out, pdirent->d_name, 2 * strlen(pdirent->d_name)); + break; + + default: - /* FIXME: Support FileDirectoryInformation, - FileFullDirectoryInformation, and - FileNamesInformation */ unimpl("IRP Query Directory sub: 0x%x\n", info_class); return RD_STATUS_INVALID_PARAMETER; diff --git a/src/VBox/RDP/client/disk.h b/src/VBox/RDP/client/disk.h index 7b7136295..93fed91a2 100644 --- a/src/VBox/RDP/client/disk.h +++ b/src/VBox/RDP/client/disk.h @@ -1,12 +1,12 @@ /* rdesktop: A Remote Desktop Protocol client. Disk Redirection definitions - Copyright (C) Jeroen Meijer 2003-2007 - Copyright (C) Peter Astrand 2004-2007 + Copyright (C) Jeroen Meijer 2003-2008 + Copyright (C) Peter Astrand 2004-2008 - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or + the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -15,8 +15,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + along with this program. If not, see . */ /* diff --git a/src/VBox/RDP/client/doc/AUTHORS b/src/VBox/RDP/client/doc/AUTHORS deleted file mode 100644 index e3cef4664..000000000 --- a/src/VBox/RDP/client/doc/AUTHORS +++ /dev/null @@ -1,14 +0,0 @@ -This is an attempt at a list of people who have made significant -contributions to the code. If you have been unintentionally omitted -please let one of the team members know. - -Matt Chapman -Peter Kallden -Hugo Trippaers -Jay Sorg -Peter Ã…strand -Michal Mihalik -Norbert Federa -Erik Forsberg -Michael Gernoth -Jeroen Meijer diff --git a/src/VBox/RDP/client/doc/ChangeLog b/src/VBox/RDP/client/doc/ChangeLog deleted file mode 100644 index ab05b3bc7..000000000 --- a/src/VBox/RDP/client/doc/ChangeLog +++ /dev/null @@ -1,103 +0,0 @@ -rdesktop (1.6.0) - * Fix for crash with recent versions of X.Org - * Fix for potential vulnerability against compromised/malicious servers (reported by iDefense) - * Fix for Windows 2008 Server - * ALSA driver added - * Sound drivers can now be selected at runtime - * Smartcard support (Alexi Volkov ) - * Send physical mouse buttons rather than logical ones - - -- Matthew Chapman Sat, 11 May 2008 16:12:20 +1100 (AEDT) - -rdesktop (1.5.0) - * SeamlessRDP - seamless windows support - * Keymap fixes - * Fix connection issues with Windows XP RTM - * Keyboard handling improvements and fixes - * SGI/Irix sound-driver fixes - * Support for clipboard INCR protocol - * Session Directory support (patch from Brian Chapeau ) - * Support for long filenames on redirected drives - * XOR ellipse drawing fix - * Clipboard unicode support (Ilya Konstantinov) - * Fix display issues with exotic color depths (30bpp, 32bpp, etc) (Ilya Konstantinov) - * Large file support - * The default color depth is now the depth of the root window - * Basic support for Windows Vista Beta 2 - * Fix high cpu-usage in OSS-driver - - -- Peter Astrand Wed, 13 Sep 2006 15:11:39 +0200 (CEST) - -rdesktop (1.4.1) - * persistent bitmap cache optimisations - * support for more RDP-orders (ellipse, polygon) - * libao sound-driver (for Mac OSX and others) - * Unicode support for transmitted strings/filenames - * Added korean keymap - * Xembed fixes to work with krdc correctly - * Portability fixes - * Support for RDP-compression (all bpps) - * process RDP recv queue if send queue is full (Debian bug #246461) - * SGI/Irix sound-driver fixes - - -- Michael Gernoth Sun, 8 May 2005 19:55:35 +0200 (CEST) - -rdesktop (1.4.0) - * Basic disk-, parallel-, printer- and serial-redirection - * Fix timezone-redirection - * Backing-store fixes - * Fix client-IP sent to TS - * XEmbed support for embedding rdesktop in other applications (KRDC) - * Support for setting the RDP5 experience - * Keyboard and keymap fixes - * Performance improvements - * Report disconnect-reason - * Support for RDP-compression (currently only for 8bpp) - * Support for persistent bitmap caching - * Sound-driver for SGI/Irix - - -- Michael Gernoth Sun, 6 Mar 2005 22:09:55 +0100 (CET) - -rdesktop (1.3.1) - * Crypto fixes for RDP5 - * Keyboard and keymap fixes - * some endianess fixes for high color - * portability enhancements - - -- Matthew Chapman Tue, 21 Jan 2004 20:34 - -rdesktop (1.3.0) - - * RDP5 - * 15, 16 and 24 bit color depths - * Basic clipboard redirection - * Sound - * IPv6 - * Attaching to console on Windows 2003 - - -- Peter Astrand Wed, 29 Oct 2003 16:40:58 +0100 (CET) - -rdesktop (1.2.0) - - * new - more portable - key mapping code - * support for "high" (128-bit) encryption - * toggling out of full-screen mode with Ctrl-Alt-Enter - * a few extra options including host:port syntax - * many, many bug fixes and optimisations - - -- Matthew Chapman Thu, 30 Jan 2003 04:29 - -rdesktop (1.1.0) - - * solves arith.c licensing issue by taking big number routines from - OpenSSL - * keyboard support not merged from unified patches yet - * still no manpage - - -- Matthew Chapman Mon, 17 Sep 2001 23:14:28 +1000 (AEST) - -rdesktop (1.0.0) - - * initial release - - -- Matthew Chapman diff --git a/src/VBox/RDP/client/doc/HACKING b/src/VBox/RDP/client/doc/HACKING deleted file mode 100644 index 27d8a33b8..000000000 --- a/src/VBox/RDP/client/doc/HACKING +++ /dev/null @@ -1,45 +0,0 @@ - -Code style / indentation ------------------------- -The file indent-all.sh contains information about the current code -style. Run this script before commits. - - -Variable argument macros ------------------------- -Variable argument macros are non-portable in general, and should be -avoided. Either use a second set of parentheses like DEBUG, or create -a variable argument function like error. - - -Structure ---------- -The core protocol stack should be system-independent (i.e. ANSI C89 -only) so that it is easy to port. This currently applies to the -following files: - -bitmap.c licence.c orders.c rdp.c rdp5.c cache.c iso.c mcs.c -secure.c mppc.c channels.c -rdesktop.c - - -Compiler support ----------------- - -The source code should be compatible with ANSI C89. One exception is -the SeamlessRDP ServerEXE and ClientDLL, which should be compatible -with ANSI C99. - - -RDP resources -------------- -http://dev.remotenetworktechnology.com/refdata.htm - - -Checking for out of memory conditions -------------------------------------- -Try to handle out of memory conditions gracefully. Use the xmalloc -routines from rdesktop.c, instead of calling malloc manually. Also, -remember that several Xlib functions can return NULL. This includes -XGetImage. Use exit_if_null to verify returned pointers. - diff --git a/src/VBox/RDP/client/doc/TODO b/src/VBox/RDP/client/doc/TODO deleted file mode 100644 index 65232b356..000000000 --- a/src/VBox/RDP/client/doc/TODO +++ /dev/null @@ -1,102 +0,0 @@ -* General - - * Rework main loop to a generic event handler (i.e. move select() to - the top of the stack, not the end). Also means rewriting the connect - procedure as a state machine. - - * Stop using static objects for packets and make it more clear when it - is in use (explicit allocation and free). - -* Clipboard: - - * Support other data types than plain text. - - * Conversion between different character sets. - - -* Drive Redirection: - - * Real support for file locking - - * Handle reconnections correctly. - - * Various deficiencies; see FIXMEs in source code. - - -* Serial Port Redirection: - - * More testing needed. - - -* Printer Redirection: - - * More testing needed. - - -* Keymapping: - - -* Sound redirection - - * Use timestamps in audio packets. - - * Add resampling to supported samplerates of audio-hardware. - - * Lower CPU-usage with an audio thread. - - -* Smartcard redirection - - * Merge patches currently implementing sc-redirection. - - -* Miscellaneous - - * Clean up header files. The current "proto.h" and "xproto.h" is far - from optimal. - - * Go through the many trackers (bugs/patches/RFEs) at SourceForge. - - * More fancy homepage. - - * Enhance documentation. Write a FAQ. - - -* SeamlessRDP mode - - * Add a client to server message for starting additional - applications. - - * Support cmd.exe. - - * Support for Input Contexts. - - * Enhanced support for WM_DELETE_WINDOW: Instead of terminating - rdesktop, close the window on the server side. - - * Systray support. - - * Better support for non-EWMH window managers. - - * Support for non-rectangular windows. - - * The focus handling of menus is a bit crude. - - * Support for sending focus information from client to server. - - * Implement something similiar to explhook.dll - support for running - explorer.exe in non-shell mode. - - * Better compatibility with Task Manager. - - * XINERAMA support. - - * When enumerating windows, make sure to send info about windows - that are transient for other windows after the referred window. - - * We support topmost windows at creating time, but we do not detect - when this property is added or removed. This can be verified with - task manager, which has an "Always on top" option. - - * Window icons are not set when reconnecting. get_icon/update_icon - needs to be called from enum_cb. diff --git a/src/VBox/RDP/client/doc/ipv6.txt b/src/VBox/RDP/client/doc/ipv6.txt deleted file mode 100644 index 1d3ef2341..000000000 --- a/src/VBox/RDP/client/doc/ipv6.txt +++ /dev/null @@ -1,29 +0,0 @@ - -IPv6 support in rdesktop -======================== -The IPv6 support was developed by Mike Dawson : - - Attached is a patch to tcp.c to enable IPv6 support. Build with - 'IPv6' defined to enable it. It's so far only been tested on - Linux 2.4.21 connecting to Windows XP SP1. - - Since terminal services doesn't seem to bind to the ipv6 interface - on XP I had to run 'netsh interface portproxy add v6tov4 - listenport=3389 connectport=3389' from the windows command prompt - to get it to work. - - -rdesktop now supports numeric IPv6 addresses: - - It checks for two or more colons in an address to decide what it's - dealing with so you can now do: - - rdesktop 2001:1:2:3::4 - - without it getting confused with an ipv4:port specification. I've - also followed the square bracket convention used by browsers - (http://www.ietf.org/rfc/rfc2732.txt) so if you want to specify a - non-standard port with an ipv6 address you can use the format: - - rdesktop [2001:1:2:3::4]:3390 - diff --git a/src/VBox/RDP/client/doc/keymap-names.txt b/src/VBox/RDP/client/doc/keymap-names.txt deleted file mode 100644 index 3da698b29..000000000 --- a/src/VBox/RDP/client/doc/keymap-names.txt +++ /dev/null @@ -1,124 +0,0 @@ - -0x0436 af Afrikaans -0x041C sq Albanian -0x0001 ar Arabic -0x0401 ar-sa Arabic (Saudi Arabia) -0x0801 ar-iq Arabic (Iraq) -0x0C01 ar-eg Arabic (Egypt) -0x1001 ar-ly Arabic (Libya) -0x1401 ar-dz Arabic (Algeria) -0x1801 ar-ma Arabic (Morocco) -0x1C01 ar-tn Arabic (Tunisia) -0x2001 ar-om Arabic (Oman) -0x2401 ar-ye Arabic (Yemen) -0x2801 ar-sy Arabic (Syria) -0x2C01 ar-jo Arabic (Jordan) -0x3001 ar-lb Arabic (Lebanon) -0x3401 ar-kw Arabic (Kuwait) -0x3801 ar-ae Arabic (U.A.E.) -0x3C01 ar-bh Arabic (Bahrain) -0x4001 ar-qa Arabic (Qatar) -0x042D eu Basque -0x0402 bg Bulgarian -0x0423 be Belarusian -0x0403 ca Catalan -0x0004 zh Chinese -0x0404 zh-tw Chinese (Taiwan) -0x0804 zh-cn Chinese (China) -0x0C04 zh-hk Chinese (Hong Kong SAR) -0x1004 zh-sg Chinese (Singapore) -0x041A hr Croatian -0x0405 cs Czech -0x0406 da Danish -0x0413 nl Dutch (Netherlands) -0x0813 nl-be Dutch (Belgium) -0x0009 en English -0x0409 en-us English (United States) -0x0809 en-gb English (United Kingdom) -0x0C09 en-au English (Australia) -0x1009 en-ca English (Canada) -0x1409 en-nz English (New Zealand) -0x1809 en-ie English (Ireland) -0x1C09 en-za English (South Africa) -0x2009 en-jm English (Jamaica) -0x2809 en-bz English (Belize) -0x2C09 en-tt English (Trinidad) -0x0425 et Estonian -0x0438 fo Faeroese -0x0429 fa Farsi -0x040B fi Finnish -0x040C fr French (France) -0x080C fr-be French (Belgium) -0x0C0C fr-ca French (Canada) -0x100C fr-ch French (Switzerland) -0x140C fr-lu French (Luxembourg) -0x043C gd Gaelic -0x0407 de German (Germany) -0x0807 de-ch German (Switzerland) -0x0C07 de-at German (Austria) -0x1007 de-lu German (Luxembourg) -0x1407 de-li German (Liechtenstein) -0x0408 el Greek -0x040D he Hebrew -0x0439 hi Hindi -0x040E hu Hungarian -0x040F is Icelandic -0x0421 in Indonesian -0x0410 it Italian (Italy) -0x0810 it-ch Italian (Switzerland) -0x0411 ja Japanese -0x0412 ko Korean -0x0426 lv Latvian -0x0427 lt Lithuanian -0x042F mk FYRO Macedonian -0x043E ms Malay (Malaysia) -0x043A mt Maltese -0x0414 no Norwegian (Bokmal) -0x0814 no Norwegian (Nynorsk) -0x0415 pl Polish -0x0416 pt-br Portuguese (Brazil) -0x0816 pt Portuguese (Portugal) -0x0417 rm Rhaeto-Romanic -0x0418 ro Romanian -0x0818 ro-mo Romanian (Moldova) -0x0419 ru Russian -0x0819 ru-mo Russian (Moldova) -0x0C1A sr Serbian (Cyrillic) -0x081A sr Serbian (Latin) -0x041B sk Slovak -0x0424 sl Slovenian -0x042E sb Sorbian -0x040A es Spanish (Traditional Sort) -0x080A es-mx Spanish (Mexico) -0x0C0A es Spanish (International Sort) -0x100A es-gt Spanish (Guatemala) -0x140A es-cr Spanish (Costa Rica) -0x180A es-pa Spanish (Panama) -0x1C0A es-do Spanish (Dominican Republic) -0x200A es-ve Spanish (Venezuela) -0x240A es-co Spanish (Colombia) -0x280A es-pe Spanish (Peru) -0x2C0A es-ar Spanish (Argentina) -0x300A es-ec Spanish (Ecuador) -0x340A es-cl Spanish (Chile) -0x380A es-uy Spanish (Uruguay) -0x3C0A es-py Spanish (Paraguay) -0x400A es-bo Spanish (Bolivia) -0x440A es-sv Spanish (El Salvador) -0x480A es-hn Spanish (Honduras) -0x4C0A es-ni Spanish (Nicaragua) -0x500A es-pr Spanish (Puerto Rico) -0x0430 sx Sutu -0x041D sv Swedish -0x081D sv-fi Swedish (Finland) -0x041E th Thai -0x0431 ts Tsonga -0x0432 tn Tswana -0x041F tr Turkish -0x0422 uk Ukrainian -0x0420 ur Urdu -0x042A vi Vietnamese -0x0434 xh Xhosa -0x043D ji Yiddish -0x0435 zu Zulu - diff --git a/src/VBox/RDP/client/doc/keymapping.txt b/src/VBox/RDP/client/doc/keymapping.txt deleted file mode 100644 index 7d5a8515d..000000000 --- a/src/VBox/RDP/client/doc/keymapping.txt +++ /dev/null @@ -1,259 +0,0 @@ -Keyboard mapping -================ -This release of rdesktop uses a new, portable keyboard mapping -implementation. It should hopefully work on all X11 systems. This new -implementation only looks at X11 keysyms: Not on (nonportable) -keycodes or modifier status. This means that rdesktop will obey your -local keyboard configuration. For example, if you have swapped -CapsLock and Control, rdesktop will use this mapping. - -XKB is currently not used. It seems like a good idea to me, but since -some X servers (like Xvnc) does not support XKB, we still need to use -the plain old interface as well, at least. - -There are still some small problems. - -* CapsLock: CapsLock changes are never sent to the RDP - server. rdesktop does not know which keys that are modified by - CapsLock and which are not. So, the CapsLock indicator in Wordpad - etc will always be off. - -Composing/Multi_key is supported. For more information, see: - - MIT: $SRC/xc/nls/X11/locale/Compose/iso8859-1 - XFree86: /usr/X11R6/lib/X11/locale/*/Compose - Solaris' Openwin: /usr/openwin/include/X11/Suncompose.h - /usr/openwin/lib/locale/*/Compose - Irix6: compose(5) - - -Keymap files -============ -The names of the keymaps follows RFC1766. - -(You can find a translation from Windows keyboard layout numbers to -keymap names by looking at -HKEY_LOCAL_MACHINE\SOFTWARE\Classes\MIME\Database\RFC1766 in the -registry.) - - -Contents of keymap files -======================== -The keymaps are line based. There are four different types of lines: - -1) include lines -Syntax: -include - -Example: -include common - - -2) map lines -Syntax: -map - -Example: -map 0x41d - -Map-lines specifies how the remote RDP server should interpret the -sent scancodes. - - -3) Translation lines -Syntax: - [flags..] - -Example: -onehalf 0x29 shift - -The scancode can be found in scancodes.h. Note: The scancode value for -extended keys can be calculated by OR:ing with 0x80. Example: The -Delete key have the scancode sequence 0xe0, 0x52. You can get the -scancode value to put into the map file by running: - -python -c "print hex(0x80 | 0x52)" - -If flags are "altgr", "shift", the scancode sent for this keysym will -be prefixed with AltGr, or Shift. - -If flags includes "addupper", a translation for this keysyms uppercase -name will be added as well, in addition to the non-uppercase -name. Example: - -x 2d addupper - -...will add an translation for "X" automatically, just like if you -would specify: - -X 2d shift - -If flags include "localstate", the modifier to send will be determined -by the local modifier state. - -If flags is "inhibit", nothing will be sent to the server. - -If flags is "numlock", rdesktop will make sure that the remote NumLock -state is on before generating the key event. Otherwise, it will make -sure NumLock is off. - - -4) enable_compose - -If any line starts with the keyword "enable_compose", rdesktop will -enable local Compose/Multi_key handling. Enabling this will often make -it impossible to compose characters with dead keys (on the remote -side). This is because when local compose support is enabled, dead -keys will not be sent to the remote side. - - -5) sequence lines -Syntax: -sequence ... - -Examples: -sequence eacute dead_acute e -sequence F12 f o o at e x a m p l e period c o m - -Sequence lines allows you to specify that multiple scancodes should be -sent to the RDP server, in response to one X11 keyboard event. Note: -The sequence is sent at the X11 KeyPress event. Nothing is sent at -KeyRelease. - - -6) keyboard_type lines -Syntax: -keyboard_type - -keyboard_type lines specifies the keyboard type. Default value is 0x4 -(en-us 101/104 keys keyboard). - - -7) keyboard_subtype lines -Syntax: -keyboard_subtype - -keyboard_subtype lines specifies the keyboard subtype. Default value -is 0x0 (en-us 101/104 keys keyboard). - - -8) keyboard_functionkeys lines -Syntax: -keyboard_functionkeys - -keyboard_functionkeys specifies the number of keyboard function -keys. Default value is 0xc (12, for standard 101/104 keys keyboard). - - - - -Suggested X11 keysym mapping on PCs -=================================== -Unfortunately, there is no standard for which keysyms a given key -should generate. If you have a PC-keyboard with Windows keys, I suggest this mapping: - -Keyboard keys: -CtrlLeft WinLeft AltLeft Space AltGr WinRight Menu CtrlRight - -...should generate keysyms: -Control_L Super_L Alt_L space Mode_switch Super_R Menu Control_R - -Additionally: -Shift-Alt should produce Meta_L -Shift-AltGr should produce Multi_Key. - -Use a modifier-map like this: - -shift Shift_L (0x32), Shift_R (0x3e) -lock Caps_Lock (0x25) -control Control_L (0x42), Control_R (0x6d) -mod1 Alt_L (0x40) -mod2 Num_Lock (0x4d) -mod3 Mode_switch (0x71) -mod4 Super_L (0x73), Super_R (0x74) -mod5 Scroll_Lock (0x4e) - - -Updating / writing keymap files -=============================== -When writing new or updating keymap files, please use comments and -blanks, to increase readability. The "sv" keymap is a good template. - -When you need to add a translation to a keymap file, do: - - 1. Get the "key number" for this key, by looking at keynums.png. - - 2. Take a look at scancodes.h, and look for - SCANCODE_KEY_. The scancode value is at the end of - the line. If the line contains (SCANCODE_EXTENDED | 0xsomething), - then you should OR 0x80 to this value. For example, you can do: - - python -c "print hex(0x80 | 0xsomething)" - - 3. Put the scancode (from step 2) and keysym name (found in the - error message) into the keymap file. - - -Special keys -============ - -* The combination Ctrl-Alt-Enter toggles between fullscreen and - non-fullscreen mode. - -* Meta, Hyper and Super are treated as windows keys. RDP4 does not - support the windows keys though, so if you are running RDP4, these - keys will translate to Ctrl-Esc. - - -Links -===== -http://www.win.tue.nl/~aeb/linux/kbd/scancodes.html - - -Test cases -========== -When changing the keyboard code, make sure all these tests in Notepad -works: - -1. Ctrl+f should bring up Find dialog, with CapsLock both on and off. - -2. Ctrl+Shift+arrows should mark text, with CapsLock both on and off. - -3. Test a sequence, like egrave. - -4. Test a char generated with AltGr, such as @ on a swedish keyboard. - -5. Test Ctrl-Alt-Delete. - -6. Ctrl-Alt-Enter should toggle fullscreen. - -7. Test NumLock synchronization using the -N option. Excel is able to - indicate the current NumLock state. Verify that the status is - updated correctly on reconnects. - -8. Test the Windows keys, standalone as well as in combination with, - say, E. - -9. Make sure the system menu (via Alt-space) cannot be accessed in - single app mode. - -10. Make sure keymaps can be loaded from ~/.rdesktop/keymaps, - KEYMAP_PATH, $CWD/keymaps, and from an absolute path. - -11. Press Shift, then press a key modified by shift, the release - shift, then release the other key. Do this in a speedy fasion. - Make sure the shift state is not stuck down. - -12. Test all numpad keys, when not using the -N option. - -13. Map a single, un-shifted key (such as F1) to XK_A: - xmodmap -e "keycode 67 = A A" - - Perform in Notepad: - * Write some text - * Press F1 - * Press b - * Release b - * Release F1 - - Verify that shift is not stuck down, by clicking on the text. diff --git a/src/VBox/RDP/client/doc/licensing.txt b/src/VBox/RDP/client/doc/licensing.txt deleted file mode 100644 index 1bf6b0c33..000000000 --- a/src/VBox/RDP/client/doc/licensing.txt +++ /dev/null @@ -1,56 +0,0 @@ - -To be able to connect to Microsoft Windows 2000 Terminal Services (and -probably later versions), you'll need to deal with licensing. This is -complicated. This file is supposed to contain some information about -how rdesktop works with Microsofts license systems. - -There's a lot of information on the MS web site, for example, -http://support.microsoft.com/default.aspx?scid=kb;EN-US;287687. - -From the rdesktop mailing list: - -Peter Ã…strand , 2003-02-06 - -> We are running rdesktop 1.2 on machine A and connects to a Windows 2000 -> Server (machine B). The W2K machine has 5 real licenses installed ("Windows -> 2000 Terminal Services Client Access License", "Open" type). This can be -> verifier by using "Terminal Services Licensing". The problem is that all -> issued licenses have an expire-date. The expire date for the license issued -> to A was reached today, and no more connections could be made until we -> changed the client name (by using -n). -> -> We also have another similiar systems, with Linux machine C and W2K server -> D. This server has 200 licenses installed of the type "Select". On this -> server, the issued licenses seems to be permanent: The expire date is set -> to "-", and we have no problem with this system. -> -> The question of course is why the first system issues license with -> expiration date, while the second system issues permanent licenses. - - -Darryn Capes-Davis, 2003-02-07 - -> I have been through the problems and can tell you what is going -> on. The main difference of Machine B (Server 1) and Machine D (Server -> 2) is that from what I see Machine B has Service Pack 3 installed and -> Machine D does not. You see in Service Pack 3 there was a change made -> to TS Licencing in that Microsoft introduced a licence recovery -> mechanism. To cut to the point (I don't know the details) rdesktop 1.2 -> with SAVE_LICENCE defined works fine. In the new lic method the -> terminal server expects a valid licence to be presented to renew -> it. Otherwise it just expires it - and a day later you will see it -> actually gone (it does housekeeping once a day)! So if SAVE_LICENCE -> code is not enabled then it just expires and you can't use the licence -> until it cleans it away - and this is where a little gotcha is - if -> you move from using an rdesktop without SAVE_LICENCE to one with -> SAVE_LICENCE then it still won't recover an 'expired' licence. You -> have to wait for the daily housekeeping to clean it up - this really -> had me going for half a day or so! This is exactly what happened to -> you. -> -> The Server pre Spk 3 has the old model where licences never expire. To -> recover a licence that you never wanted to use again you have to call -> the Microsoft Clearing House. That's why they introduced the new -> method. And if you upgrade a Pre Spk3 server to Spk3 then the licences -> granted still stay with the old method - only new licences granted -> will use the new expiry method. diff --git a/src/VBox/RDP/client/doc/patches.txt b/src/VBox/RDP/client/doc/patches.txt deleted file mode 100644 index 08ffe59f7..000000000 --- a/src/VBox/RDP/client/doc/patches.txt +++ /dev/null @@ -1,340 +0,0 @@ -This file documents some of all patches for rdesktop, floating around -the net, and how they are related to the current (CVS) version of -rdesktop. Things left to do are marked with TBD (To Be Done). - - -URL: -http://bibl4.oru.se/projects/rdesktop/patch19/patches/Makefile.diff -Description: -Makefile changes which makes it possible to compile rdesktop on SunOS -and OSF1. -Status: -Applied (slightly modified) - - -URL: -http://bibl4.oru.se/projects/rdesktop/patch19/patches/assar_19-7-2.hostlen.patch -Description: -Fix for hostnames longer than 30 chars. -Status: -Applied (revision 1.11 of secure.c) - - -URL: -http://bibl4.oru.se/projects/rdesktop/patch19/patches/backingstore+privatecolormap-for-19-3-9.patch -Description: -This adds support for 1) Private color maps (useful for 8 bpp mode) -and 2) backingstore selection. -Status: -1) is not needed anymore; rdesktop automatically uses Private color -map in 8 bpp mode. 2) is, as far as I understand, also not -need. rdesktop automatically uses a software backing store if the -Xserver does not provide one. - - -URL: -http://bibl4.oru.se/projects/rdesktop/patch19/patches/ben_xwin.c.diff -Description: -Fixes for CapsLock and NumLock. -Status: -Not needed anymore, with the new keyboard mapping implementation. - - -URL: -http://bibl4.oru.se/projects/rdesktop/patch19/patches/ctrl1nohang.diff -Description: -Fixes problem with ctrl1 hangs. -Status: -Not needed anymore, with the new keyboard mapping implementation. - - -URL: -http://bibl4.oru.se/projects/rdesktop/patch19/patches/downkeypatch.diff -Description: -Seems to keep track of the remote modifier status. -Status: -Not needed anymore, with the new keyboard mapping implementation. - - -URL: -http://bibl4.oru.se/projects/rdesktop/patch19/patches/fasttext2+nobackpixmap.patch -Description: -(From http://mail.rdesktop.org/archive/2001/msg00218.html): - -1) Added --no-backpixmap option to disable the ugly double drawing in -xwin.c (I have a very robust backing storage in my X, so I don't need -it ;) - -2) More optimizations to text draw (previous fast-text patch was -included in 192-3-6-2). In text drawing with solid background the -glyphs are drawn with stippled fill instead of XCopyPlane (runs faster -on my S3Trio64 with XFree 3.3.6, please test it on other -configurations to validate this). The WinTach not show any improvement -with this change, it seems to use all transparent background text -draws, but with a old PC Magazine Winbench (3.1) doing the scroll text -test the speed gain is significative. - -3) My Previous patch to disable backing storage in fullscreen - -Status: -1) is not relevant any more, since rdesktop only uses backing store if -the Xserver does not provide backing store. -Need to examine if 2) and 3) are still useful. TBD. - - -URL: -http://bibl4.oru.se/projects/rdesktop/patch19/patches/francisco_fix_patblt.html -Description: -The colors in patterns drawn with "pattern blt" order was inverted (fg -& bg). (See the background of the yellow help banners) -Status: -Applied (in revision 1.29, 2002/07/14) - - -URL: -http://bibl4.oru.se/projects/rdesktop/patch19/patches/frank_1linerfix.html -Description: -ui_create_glyph was not called with ipattern. -Status: -Applied (in revision 1.29, 2002/07/14). - - -URL: -http://bibl4.oru.se/projects/rdesktop/patch19/patches/frank_fasttext.patch.txt -Description: -Some kind of performence improvements. -Status: -From what I can tell, this patch is no longer necessary. - - -URL: -http://bibl4.oru.se/projects/rdesktop/patch19/patches/hostname-patch -Description: -(From http://mail.rdesktop.org/archive/2001/msg00163.html): - -rdesktop uses gethostname to figure out the hostname, but gethostname -under linux returns an error when the hostname is longer than the -buffer. This hack gives gethostname a 64 char buffer and then strips -the first 16 chars or upto the first '.' and puts the result in -hostname[16]. - -Status: -Applied in version 1.10 of rdesktop.c. - - -URL: -http://bibl4.oru.se/projects/rdesktop/patch19/patches/hove-19-7-2endian.diff -Description: -Includes a program for testing endianness. -Status: -rdesktop determines endianness at runtime. This patch is not needed -anymore. - - -URL: -http://bibl4.oru.se/projects/rdesktop/patch19/patches/mmihalik_19-7-3-keyfix-4.patch -Description: -Some kind of new alternative keyboard mapping imlementation. -Status: -Not needed anymore, with the new keyboard mapping implementation. - - -URL: -http://bibl4.oru.se/projects/rdesktop/patch19/patches/norbert_fullscreen.patch -Description: -Fullscreen mode. -Status: -Applied. - - -URL: -http://bibl4.oru.se/projects/rdesktop/patch19/patches/norbert_percent.txt -Description: -Makes is possible to specify RDP geometry based a percent value of the -current desktop size. -Status: -Not applied. I don't think many people will need this. - - -URL: -http://bibl4.oru.se/projects/rdesktop/patch19/patches/norbert_rdp_tcp_port.diff -Description: -Command line tcp port argument. -Status: -Applied. - - -URL: -http://bibl4.oru.se/projects/rdesktop/patch19/patches/patch19-7-2.xyPos.emptyPassword.patch -Description: -This patch adds: -1) Support for empty passwords -2) Support for asking for password interactively -3) Support for ++ geometry. - -Status: -1) and 2) can be solved by the -P parameter; patch not needed. -Functionality for 3) is currently missing. - - -URL: -http://bibl4.oru.se/projects/rdesktop/patch19/patches/rdesktop-1.0.0-19-7-1-mmihalik-3.diff -Description: -Defines DO_GLYPH() etc. -Status: -As far as I understand, this patch is applied. - - -URL: -http://bibl4.oru.se/projects/rdesktop/patch19/patches/rdesktop-1.0.0-mmihalik-1.diff -Description: -Misc drawing changes. -Status: -As far as I understand, this patch is applied. - - -URL: -http://bibl4.oru.se/projects/rdesktop/patch19/patches/rdesktop-1.0.0-pl19-7-2-mmihalik-1.diff -Description: -Some kind of new alternative keyboard mapping implementation. -Status: -Not needed anymore, with the new keyboard mapping implementation. - - -URL: -http://bibl4.oru.se/projects/rdesktop/patch19/patches/rdesktop-gmp.patch -Description: -Use GMP for RSA crypto. -Status: -Not needed since rdesktop now use OpenSSL for all of the crypto. - - -URL: -http://bibl4.oru.se/projects/rdesktop/patch19/patches/rdesktop-new_kb.patch -Description: -Modifies one of the old keyboard mapping implementations in some way. -Status: -Not needed anymore, with the new keyboard mapping implementation. - - -URL: -http://bibl4.oru.se/projects/rdesktop/patch19/patches/rdesktop-openssl.patch -Description: -Support for linking rdesktop with OpenSSL. -Status: -Not needed anymore, rdesktop can optionally use system -OpenSSL. - - -URL: -http://bibl4.oru.se/projects/rdesktop/patch19/patches/rdesktop.vncviewer_patch -Description: -Hack for making the old (broken) keyboard mapping implementation work -with the VNC Xserver. -Status: -Not needed anymore, with the new keyboard mapping implementation. - - -URL: -http://bibl4.oru.se/projects/rdesktop/patch19/patches/rdesktop_keymap.patch -Description: -Some kind of new alternative keyboard mapping implementation. -Status: -Not needed anymore, with the new keyboard mapping implementation. - - -URL: -http://bibl4.oru.se/projects/rdesktop/patch19/patches/rdp-srvr-19-6-6.diff -Description: -Basic RDP server. -Status: -Not applied. - - -URL: -http://bibl4.oru.se/projects/rdesktop/patch19/patches/scroll-to-death-patch.txt -Description: -Fixes scroll-to-death problem in Excel and other applications. -Status: -Not needed; fixed in another way in recent versions of rdesktop. - - -URL: -http://bibl4.oru.se/projects/rdesktop/patch19/patches/spark-manpage-patch-19.4 -Description: -Adds a manual page. -Status: -Not needed; rdesktop contains a manual page now. - - -URL: -http://bibl4.oru.se/projects/rdesktop/patch19/patches/spark-manpage-patch-19.4-1 -Description: -Adds a manual page. -Status: -Not needed; rdesktop contains a manual page now. - - -URL: -http://bibl4.oru.se/projects/rdesktop/patch19/patches/spark_xinerama-patch2 -Description: -Adds XINERAMA support to rdesktop. -Status: -Not applied yet. TBD. - - -URL: -http://bibl4.oru.se/projects/rdesktop/patch19/patches/svenni_dis_wmkeybnds.patch -Description: -Commandline flag to disable keyboard grabbing. -Status: -Applied. - - -URL: -http://bibl4.oru.se/projects/rdesktop/patch19/patches/svenni_disable_bs_in_x-tiny-patch -Description: -Disables backing store for TinyX. -Status: -As far as I understand, this patch is not need any longer. - - -URL: -http://bibl4.oru.se/projects/rdesktop/patch19/patches/vincent_19-7-2.license.patch -Description: -TBD -Status: -Not yet examined. - - -URL: -http://bibl4.oru.se/projects/rdesktop/patch19/patches/vincent_19-7-2.secure.patch -Description: -Fixes a problem during the connection to a French NT4 TSE (a French -NT4 TSE doesn't use encryptation). -Status: -Applied. - - -URL: -http://bibl4.oru.se/projects/rdesktop/patch19/patches/vincent_19-7-3_excel.patch -Description: -Makes matrixes appear better, such as those found in Excel/toad etc. -Status: -Applied. - - -URL: -http://bibl4.oru.se/projects/rdesktop/patch19/patches/vincent_8bpp.patch -Description: -Support a 8bpp display (256 colours). -Status: -An enhanced version is included in rdesktop; this patch is not needed any more. - - -URL: -http://bibl4.oru.se/projects/rdesktop/patch19/patches/vpypatch.txt -Description: -Various changes for one of the old keyboard stuff. -Status: -Not needed anymore, with the new keyboard mapping implementation. diff --git a/src/VBox/RDP/client/doc/rdesktop.1 b/src/VBox/RDP/client/doc/rdesktop.1 deleted file mode 100644 index 68f213968..000000000 --- a/src/VBox/RDP/client/doc/rdesktop.1 +++ /dev/null @@ -1,228 +0,0 @@ -.TH rdesktop 1 "November 2005" -.SH NAME -.I rdesktop -\- Remote Desktop Protocol client -.SH SYNOPSIS -.B rdesktop [options] server[:port] -.br -.SH DESCRIPTION -.I rdesktop -is a client for Remote Desktop Protocol (RDP), used in a number of Microsoft -products including Windows NT Terminal Server, Windows 2000 Server, Windows XP -and Windows 2003 Server. - -.SH OPTIONS -.TP -.BR "-u " -Username for authentication on the server. -.TP -.BR "-d " -Domain for authentication. -.TP -.BR "-s " -Startup shell for the user - starts a specific application instead of Explorer. -.TP -.BR "-c " -The initial working directory for the user. Often used in combination with -s -to set up a fixed login environment. -.TP -.BR "-p " -The password to authenticate with. Note that this may have no effect if -"Always prompt for password" is enabled on the server. WARNING: if you specify -a password on the command line it may be visible to other users when they use -tools like ps. Use -p - to make rdesktop request a password at startup (from -standard input). -.TP -.BR "-n " -Client hostname. Normally rdesktop automatically obtains the hostname of the -client. -.TP -.BR "-k " -Keyboard layout to emulate. This requires a corresponding keymap file to be -installed. The standard keymaps provided with rdesktop follow the RFC1766 -naming scheme: a language code followed by a country code if necessary - e.g. -en-us, en-gb, de, fr, sv, etc. - -The default keyboard map depends on the current locale (LC_* and LANG -environment variables). If the current locale is unknown, the default -keyboard map is en-us (a US English keyboard). - -The keyboard maps are file names, which means that they are case -sensitive. The standard keymaps are all in lowercase. - -The keyboard maps are searched relative to the directories -$HOME/.rdesktop/keymaps, KEYMAP_PATH (specified at build time), and -$CWD/keymaps, in this order. The keyboard-map argument can also be an -absolute filename. - -The special value `none' can be used instead of a keyboard map. -In this case, rdesktop will guess the scancodes from the X11 event key -codes using an internal mapping method. This method only supports the -basic alphanumeric keys and may not work properly on all platforms -so its use is discouraged. -.TP -.BR "-g " -Desktop geometry (WxH). If geometry is the special word "workarea", the geometry -will be fetched from the extended window manager hints property _NET_WORKAREA, from -the root window. The geometry can also be specified as a percentage of the whole -screen, e.g. "-g 80%". -.TP -.BR "-f" -Enable fullscreen mode. This overrides the window manager and causes the -rdesktop window to fully cover the current screen. Fullscreen mode can be -toggled at any time using Ctrl-Alt-Enter. -.TP -.BR "-b" -Force the server to send screen updates as bitmaps rather than using -higher-level drawing operations. -.TP -.BR "-A" -Enable SeamlessRDP. In this mode, rdesktop creates a X11 window for -each window on the server side. This mode requires the SeamlessRDP -server side component, which is available from -\fIhttp://www.cendio.com/seamlessrdp/\fR. -When using this option, you should specify a startup shell which -launches the desired application through SeamlessRDP. - -Example: rdesktop -A -s 'seamlessrdpshell notepad'. -.TP -.BR "-B" -Use the BackingStore of the Xserver instead of the integrated one in -rdesktop. -.TP -.BR "-e" -Disable encryption. This option is only needed (and will only work) if you -have a French version of NT TSE. -.TP -.BR "-E" -Disable encryption from client to server. This sends an encrypted login packet, -but everything after this is unencrypted (including interactive logins). -.TP -.BR "-m" -Do not send mouse motion events. This saves bandwidth, although some Windows -applications may rely on receiving mouse motion. -.TP -.BR "-C" -Use private colourmap. This will improve colour accuracy on an 8-bit display, -but rdesktop will appear in false colour when not focused. -.TP -.BR "-D" -Hide window manager decorations, by using MWM hints. -.TP -.BR "-K" -Do not override window manager key bindings. By default rdesktop attempts -to grab all keyboard input when it is in focus. -.TP -.BR "-S