[Pkg-virtualbox-commits] [virtualbox] 01/03: Imported Upstream version 4.3.24-dfsg

Gianfranco Costamagna locutusofborg-guest at moszumanska.debian.org
Tue Mar 3 13:16:32 UTC 2015


This is an automated email from the git hooks/post-receive script.

locutusofborg-guest pushed a commit to branch master
in repository virtualbox.

commit 7853b9219e547bb401e89df34e3898d8b632f75e
Author: Gianfranco Costamagna <costamagnagianfranco at yahoo.it>
Date:   Tue Mar 3 12:48:13 2015 +0100

    Imported Upstream version 4.3.24-dfsg
---
 Config.kmk                                         |   4 +-
 doc/manual/en_US/user_Troubleshooting.xml          | 105 ++++-
 doc/manual/user_ChangeLogImpl.xml                  |  76 +++-
 include/VBox/VBoxVideo.h                           |   2 +-
 include/VBox/settings.h                            |  23 +-
 include/VBox/shflsvc.h                             |  12 +-
 include/iprt/log.h                                 |  66 ++-
 .../Additions/common/VBoxControl/VBoxControl.cpp   |   2 +-
 src/VBox/Additions/common/VBoxGuest/Makefile.kmk   |   2 +-
 .../common/VBoxGuest/VBoxGuest-darwin.cpp          |   6 +-
 .../common/VBoxGuest/VBoxGuest-haiku-stubs.c       |   6 +-
 .../Additions/common/VBoxGuest/VBoxGuest-haiku.c   |   3 +-
 .../Additions/common/VBoxGuest/VBoxGuest-haiku.h   |   3 +-
 .../Additions/common/VBoxGuest/VBoxGuest-os2.cpp   |  12 +-
 .../Additions/common/VBoxGuest/VBoxGuest-win.cpp   | 120 +++---
 src/VBox/Additions/common/VBoxGuest/VBoxGuest.cpp  | 347 +++++++---------
 .../Additions/common/VBoxGuest/VBoxGuestInternal.h |   4 -
 .../VBoxGuestLib/VBoxGuestR3LibSharedFolders.cpp   |   5 +-
 src/VBox/Additions/linux/sharedfolders/utils.c     |   9 +-
 .../Additions/solaris/Installer/postinstall.sh     |  22 +-
 src/VBox/Additions/x11/Installer/x11config15sol.pl |  30 +-
 src/VBox/Additions/x11/VBoxClient/VBoxClient.h     |   2 +-
 src/VBox/Additions/x11/VBoxClient/display.cpp      |   2 +-
 src/VBox/Additions/x11/VBoxClient/main.cpp         |   3 +-
 src/VBox/Additions/x11/vboxmouse/Makefile.kmk      |   6 -
 src/VBox/Additions/x11/vboxvideo/Makefile.kmk      |  36 +-
 src/VBox/Additions/x11/vboxvideo/vboxvideo.c       |  17 +-
 src/VBox/Additions/x11/vboxvideo/vboxvideo.h       |   4 +-
 src/VBox/Devices/Audio/dsoundaudio.c               |  22 +-
 src/VBox/Devices/EFI/FirmwareBin/VBoxEFI32.fd      | Bin 1048576 -> 1048576 bytes
 src/VBox/Devices/EFI/FirmwareBin/VBoxEFI64.fd      | Bin 1048576 -> 1048576 bytes
 .../Graphics/BIOS/VBoxVgaBiosAlternative.asm       |   6 +-
 .../Graphics/BIOS/VBoxVgaBiosAlternative.md5sum    |   2 +-
 src/VBox/Devices/Graphics/DevVGA-SVGA.cpp          |   2 +-
 src/VBox/Devices/Graphics/DevVGA-SVGA3d-cocoa.h    |   2 +-
 src/VBox/Devices/Graphics/DevVGA-SVGA3d-cocoa.m    |  28 +-
 src/VBox/Devices/Graphics/DevVGA-SVGA3d-ogl.cpp    |   6 +
 src/VBox/Devices/Network/slirp/slirp.c             |   4 +-
 src/VBox/Devices/PC/BIOS/VBoxBiosAlternative.asm   |   4 +-
 .../Devices/PC/BIOS/VBoxBiosAlternative.md5sum     |   2 +-
 src/VBox/Devices/PC/BIOS/boot.c                    |   4 +
 src/VBox/ExtPacks/VNC/VBoxVNC.cpp                  |  30 +-
 .../Frontends/VBoxManage/VBoxManageControlVM.cpp   |  37 +-
 .../Frontends/VBoxManage/VBoxManageDHCPServer.cpp  |  21 +-
 .../Support/win/SUPHardenedVerify-win.h            |   3 +-
 .../Support/win/SUPHardenedVerifyProcess-win.cpp   | 222 +++++++++-
 .../Support/win/SUPR3HardenedMain-win.cpp          | 160 +------
 .../Support/win/import-template-kernel32.h         |   1 +
 .../VBoxNetFlt/linux/VBoxNetFlt-linux.c            |   5 +
 src/VBox/Installer/win/VBoxMergeApp.wxi            |   2 +-
 src/VBox/Main/include/DHCPServerImpl.h             |  30 +-
 src/VBox/Main/include/DisplayImpl.h                |   5 +
 src/VBox/Main/src-client/ConsoleImpl.cpp           |  12 +-
 src/VBox/Main/src-client/DisplayImpl.cpp           |   2 +-
 src/VBox/Main/src-client/MouseImpl.cpp             |   2 +-
 src/VBox/Main/src-server/DHCPServerImpl.cpp        | 175 +++++++-
 src/VBox/Main/src-server/HostDnsService.cpp        |  38 +-
 src/VBox/Main/src-server/HostDnsService.h          |   1 +
 src/VBox/Main/testcase/Makefile.kmk                |  29 +-
 src/VBox/Main/testcase/tstMouseImpl.cpp            | 462 ---------------------
 src/VBox/Main/xml/Settings.cpp                     |  23 +-
 src/VBox/NetworkServices/DHCP/Config.cpp           | 188 ++++++++-
 src/VBox/NetworkServices/DHCP/Config.h             |   8 +-
 src/VBox/NetworkServices/DHCP/VBoxNetDHCP.cpp      |  33 +-
 src/VBox/Runtime/common/asn1/asn1-ut-bitstring.cpp |   2 +-
 .../Runtime/common/asn1/asn1-ut-octetstring.cpp    |   2 +-
 src/VBox/Runtime/common/zip/tarvfs.cpp             |   2 +-
 src/VBox/VMM/VMMAll/IEMAllCImpl.cpp.h              |   4 +-
 src/VBox/VMM/VMMR0/CPUMR0.cpp                      |   3 -
 src/VBox/VMM/VMMR0/HMR0.cpp                        |   4 +-
 src/VBox/VMM/VMMRZ/PGMRZDynMap.cpp                 |   3 +-
 src/VBox/VMM/VMMSwitcher/AMD64andLegacy.mac        |   8 +-
 src/VBox/VMM/VMMSwitcher/LegacyandAMD64.mac        |   7 +-
 src/VBox/VMM/VMMSwitcher/PAEand32Bit.mac           |   8 +-
 src/bldprogs/VBoxDef2LazyLoad.cpp                  |   7 +-
 75 files changed, 1385 insertions(+), 1165 deletions(-)

diff --git a/Config.kmk b/Config.kmk
index e08e969..dbf0b87 100644
--- a/Config.kmk
+++ b/Config.kmk
@@ -208,7 +208,7 @@ VBOX_VERSION_MINOR = 3
 # 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 = 22
+VBOX_VERSION_BUILD = 24
 # 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.
@@ -5724,7 +5724,7 @@ endif
 SVN                    ?= svn$(HOSTSUFF_EXE)
 VBOX_SVN_REV_KMK        = $(PATH_OUT)/revision.kmk
 ifndef VBOX_SVN_REV
- VBOX_SVN_REV_FALLBACK := $(patsubst %:,,  $Rev: 98236 $  )
+ VBOX_SVN_REV_FALLBACK := $(patsubst %:,,  $Rev: 98716 $  )
  VBOX_SVN_DEP          := $(firstword $(wildcard $(PATH_ROOT)/.svn/wc.db $(abspath $(PATH_ROOT)/../.svn/wc.db) $(abspath $(PATH_ROOT)/../../.svn/wc.db) $(PATH_ROOT)/.svn/entries))
  ifeq ($(which $(SVN)),)
   VBOX_SVN_DEP         :=
diff --git a/doc/manual/en_US/user_Troubleshooting.xml b/doc/manual/en_US/user_Troubleshooting.xml
index 8ea768d..65280c6 100644
--- a/doc/manual/en_US/user_Troubleshooting.xml
+++ b/doc/manual/en_US/user_Troubleshooting.xml
@@ -548,6 +548,72 @@
       key.</para>
     </sect2>
 
+    <sect2 id="ts_host-freq-boost">
+      <title>Performance variation with frequency boosting</title>
+
+      <para>
+          Many newer multi-core processors support some form of frequency
+          boosting, which means that if only one core is utilized, it can run
+          faster (possibly 50% faster or even more) than the rated CPU frequency.
+          This causes measured performance to vary somewhat as a function of the
+          momentary overall system load. The exact behavior depends strongly
+          on the specific processor model.
+      </para>
+
+      <para>
+          As a consequence, benchmarking on systems which utilize frequency
+          boosting may produce unstable and non-repeatable results, especially
+          if benchmark runs are short (on the order of seconds). To obtain stable
+          results, benchmarks must be run over longer periods of time and with a
+          constant system load apart from the VM being tested.
+      </para>
+    </sect2>
+
+    <sect2 id="ts_host-freq-scaling">
+      <title>Frequency scaling effect on CPU usage</title>
+
+      <para>
+          On some hardware platforms and operating systems, CPU frequency
+          scaling may cause CPU usage reporting to be highly misleading. This
+          happens in situations when the host CPU load is significant but not
+          heavy, such as 15-30% of the maximum.
+      </para>
+
+      <para>
+          Most operating systems determine CPU usage in terms of time spent,
+          measuring for example how many nanoseconds the systems or a process
+          was active within one second. However, in order to save energy, modern
+          systems can significantly scale down CPU speed when the system is not
+          fully loaded. Naturally, when the CPU is running at (for example) one
+          half of its maximum speed, the same number of instructions will take
+          roughly twice as long to execute compared to running at full speed.
+      </para>
+
+      <para>
+          Depending on the specific hardware and host OS, this effect can very
+          significantly skew the CPU usage reported by the OS; the reported CPU
+          usage can be several times higher than what it would have been had the
+          CPU been running at full speed. The effect can be observed both on
+          the host OS and in a guest OS.
+      </para>
+    </sect2>
+
+    <sect2 id="ts_win-cpu-usage-rept">
+      <title>Inaccurate Windows CPU usage reporting</title>
+
+      <para>
+          CPU usage reporting tools which come with Windows (Task Manager, Resource
+          Monitor) do not take the time spent processing hardware interrupts into
+          account. If the interrupt load is heavy (thousands of interrupts per second),
+          CPU usage may be significantly underreported.
+      </para>
+
+      <para>
+          This problem affects Windows as both host and guest OS. Sysinternals tools
+          (e.g. Process Explorer) do not suffer from this problem.
+      </para>
+    </sect2>
+
     <sect2 id="ts_host-powermgmt">
       <title>Poor performance caused by host power management</title>
 
@@ -589,7 +655,7 @@
     </sect2>
   </sect1>
 
-  <sect1>
+  <sect1 id="ts_win-guests">
     <title>Windows guests</title>
 
     <sect2>
@@ -888,7 +954,7 @@
 
   </sect1>
 
-  <sect1>
+  <sect1 id="ts_lin-x11-guests">
     <title>Linux and X11 guests</title>
 
     <sect2>
@@ -974,17 +1040,17 @@ VBoxClient --seamless</screen> when your X11 user session is started if you
     </sect2>
   </sect1>
 
-  <sect1>
+  <sect1 id="ts_sol-guests">
     <title>Solaris guests</title>
 
     <sect2>
-      <title>Older Solaris 10 releases hang in 64-bit mode</title>
+      <title>Older Solaris 10 releases crash in 64-bit mode</title>
 
       <para>Solaris 10 releases up to and including Solaris 10 8/07 ("S10U4")
           incorrectly detect newer Intel processors produced since 2007. This 
-          problem leads to the 64-bit Solaris kernel hanging or crashing almost 
-          immediately during startup, in both virtualized and physical 
-          environments.
+          problem leads to the 64-bit Solaris kernel crashing (and usually causing
+          a triple fault) almost immediately during startup, in both virtualized
+          and physical environments.
       </para>
       <para>
           The recommended solution is upgrading to at least Solaris 10 5/08 
@@ -994,9 +1060,28 @@ VBoxClient --seamless</screen> when your X11 user session is started if you
       </para>
     
     </sect2>
+
+    <sect2>
+      <title>Solaris 8 5/01 and earlier may crash on startup</title>
+
+      <para>
+          Solaris 2.6, 7 and 8 releases up to and including Solaris 8 4/01 ("S8U4")
+          incorrectly set up Machine Check Exception (MCE) MSRs on Pentium 4 and
+          somene later Intel CPUs. The problem leads to the Solaris kernel crashing
+          (and usually causing a triple fault) almost immediately during startup, in both
+          virtualized and physical environments. Solaris 9 and later releases are
+          not affected by this problem, and neither is Solaris 2.5.1 and earlier.
+      </para>
+      <para>
+          The recommended solution is upgrading to at least Solaris 8 7/01 
+          ("S8U5"). Alternative solutions include applying a patch for bugs 4408508
+          and 4414557 (on an unaffected system).
+      </para>
+
+    </sect2>
   </sect1>
 
-  <sect1>
+  <sect1 id="ts_win-hosts">
     <title>Windows hosts</title>
 
     <sect2>
@@ -1147,7 +1232,7 @@ VirtualBox</screen>
     </sect2>
   </sect1>
 
-  <sect1>
+  <sect1 id="ts_lin-hosts">
     <title>Linux hosts</title>
 
     <sect2 id="ts_linux-kernelmodule-fails-to-load">
@@ -1379,7 +1464,7 @@ none     /proc/bus/usb     usbfs      devgid=85,devmode=664    0    0</screen>Re
     </sect2>
   </sect1>
 
-  <sect1>
+  <sect1 id="ts_sol-hosts">
     <title>Solaris hosts</title>
 
     <sect2>
diff --git a/doc/manual/user_ChangeLogImpl.xml b/doc/manual/user_ChangeLogImpl.xml
index 921bdaa..a6ae82b 100644
--- a/doc/manual/user_ChangeLogImpl.xml
+++ b/doc/manual/user_ChangeLogImpl.xml
@@ -1,7 +1,75 @@
 <?xml version="1.0" encoding="UTF-8"?>
 
   <sect1>
-    <title>Version 4.3.22 (2014-02-12)</title>
+    <title>Version 4.3.24 (2015-03-02)</title>
+
+    <para>This is a maintenance release. The following items were fixed and/or
+      added:</para>
+
+    <itemizedlist>
+
+      <listitem>
+        <para>VMM: emulation fix for the <emphasis>ENTER</emphasis> instruction
+          under certain conditions; fixes Solaris 10 guests (VT-x without
+          unrestricted guest execution)</para>
+      </listitem>
+
+      <listitem>
+        <para>VMM: fix for handling NMIs on Linux hosts with X2APIC enabled</para>
+      </listitem>
+
+      <listitem>
+        <para>NAT/NAT Network: fix connection drops when the host's DHCP lease
+          was renewed (4.3.22 regression; Windows hosts only; bug #13839)</para>
+      </listitem>
+
+      <listitem>
+        <para>NAT: don't crash on an empty domain list when switching the
+          DNS host configuration (4.3.22 regression; Mac OS X hosts only;
+          bug #13874)</para>
+      </listitem>
+
+      <listitem>
+        <para>PXE: re-enable it on Windows hosts (4.3.22 regression; Windows hosts
+          only; bug #13842)
+        </para>
+      </listitem>
+
+      <listitem>
+        <para>Shared Folders: fixed a problem with Windows guests (4.3.22 regression;
+          bug #13786)</para>
+      </listitem>
+
+      <listitem>
+        <para>Audio: improved record quality when using the DirectSound audio
+          backend</para>
+      </listitem>
+
+      <listitem>
+        <para>VBoxManage: when executing the <emphasis>controlvm</emphasis> command
+          take care that the corresponding VM runtime changes are saved permanently
+          (bug #13892)</para>
+      </listitem>
+
+      <listitem>
+        <para>Windows Installer: properly install the 32-bit version of VBoxRes.dll
+          on 32-bit hosts (bug #13876)</para>
+      </listitem>
+
+      <listitem>
+        <para>Linux hosts / guests: Linux 4.0 fixes (bug #13835)</para>
+      </listitem>
+
+      <listitem>
+        <para>OS/2 Additions: fixed mouse integration (4.3.22 regression;
+          bug #13825)</para>
+      </listitem>
+
+    </itemizedlist>
+  </sect1>
+
+  <sect1>
+    <title>Version 4.3.22 (2015-02-12)</title>
 
     <para>This is a maintenance release. The following items were fixed and/or
       added:</para>
@@ -102,6 +170,12 @@
       </listitem>
 
       <listitem>
+        <para>Settings: on Windows host, do not use environment variable HOME
+          at all, the settings location is derived from the user profile
+          directory (bug #7689)</para>
+      </listitem>
+
+      <listitem>
         <para>API: fixed 2 deadlock opportunities related to medium handling
           (bugs #13789, #13801, thank you Alexander Urakov)</para>
       </listitem>
diff --git a/include/VBox/VBoxVideo.h b/include/VBox/VBoxVideo.h
index 7a8b3c7..3982747 100644
--- a/include/VBox/VBoxVideo.h
+++ b/include/VBox/VBoxVideo.h
@@ -1164,7 +1164,7 @@ typedef struct VBVAMODEHINT
 /** Report the rectangle relative to which absolute pointer events should be
  *  expressed.  This information remains valid until the next VBVA resize event
  *  for any screen, at which time it is reset to the bounding rectangle of all
- *  virtual screens. 
+ *  virtual screens and must be re-set. 
  *  @see VBVA_REPORT_INPUT_MAPPING. */
 typedef struct VBVAREPORTINPUTMAPPING
 {
diff --git a/include/VBox/settings.h b/include/VBox/settings.h
index eb931d6..03018f5 100644
--- a/include/VBox/settings.h
+++ b/include/VBox/settings.h
@@ -311,7 +311,24 @@ struct MachineRegistryEntry
 };
 typedef std::list<MachineRegistryEntry> MachinesRegistry;
 
-typedef std::map<DhcpOpt_T, com::Utf8Str> DhcpOptionMap;
+struct DhcpOptValue
+{
+    enum Encoding {
+	LEGACY,
+	HEX
+    };
+
+    com::Utf8Str text;
+    Encoding encoding;
+
+    DhcpOptValue()
+      : text(), encoding(LEGACY) {}
+
+    DhcpOptValue(const com::Utf8Str &aText, Encoding aEncoding = LEGACY)
+      : text(aText), encoding(aEncoding) {}
+};
+
+typedef std::map<DhcpOpt_T, DhcpOptValue> DhcpOptionMap;
 typedef DhcpOptionMap::value_type DhcpOptValuePair;
 typedef DhcpOptionMap::iterator DhcpOptIterator;
 typedef DhcpOptionMap::const_iterator DhcpOptConstIterator;
@@ -345,7 +362,7 @@ struct DHCPServer
                     strIPLower,
                     strIPUpper;
     bool            fEnabled;
-    std::map<DhcpOpt_T, com::Utf8Str>  GlobalDhcpOptions;
+    DhcpOptionMap     GlobalDhcpOptions;
     VmSlot2OptionsMap VmSlot2OptionsM;
 };
 typedef std::list<DHCPServer> DHCPServersList;
@@ -958,6 +975,8 @@ struct AttachedDevice
           fPassThrough(false),
           fTempEject(false),
           fNonRotational(false),
+          fDiscard(false),
+          fHotPluggable(false),
           lPort(0),
           lDevice(0)
     {}
diff --git a/include/VBox/shflsvc.h b/include/VBox/shflsvc.h
index ac65a2e..bf8c1bc 100644
--- a/include/VBox/shflsvc.h
+++ b/include/VBox/shflsvc.h
@@ -152,9 +152,10 @@ typedef uint64_t SHFLHANDLE;
 /**
  * Shared folder string buffer structure.
  */
+#pragma pack(1)
 typedef struct _SHFLSTRING
 {
-    /** Size of the String member in bytes. */
+    /** Allocated size of the String member in bytes. */
     uint16_t u16Size;
 
     /** Length of string without trailing nul in bytes. */
@@ -167,6 +168,9 @@ typedef struct _SHFLSTRING
         uint16_t ucs2[1];
     } String;
 } SHFLSTRING;
+#pragma pack()
+
+#define SHFLSTRING_HEADER_SIZE RT_UOFFSETOF(SHFLSTRING, String)
 
 /** Pointer to a shared folder string buffer. */
 typedef SHFLSTRING *PSHFLSTRING;
@@ -187,7 +191,7 @@ DECLINLINE(uint32_t) ShflStringLength(PCSHFLSTRING pString)
 DECLINLINE(PSHFLSTRING) ShflStringInitBuffer(void *pvBuffer, uint32_t u32Size)
 {
     PSHFLSTRING pString = NULL;
-    const uint32_t u32HeaderSize = sizeof(SHFLSTRING);
+    const uint32_t u32HeaderSize = SHFLSTRING_HEADER_SIZE;
 
     /* 
      * Check that the buffer size is big enough to hold a zero sized string
@@ -198,6 +202,10 @@ DECLINLINE(PSHFLSTRING) ShflStringInitBuffer(void *pvBuffer, uint32_t u32Size)
         pString = (PSHFLSTRING)pvBuffer;
         pString->u16Size = u32Size - u32HeaderSize;
         pString->u16Length = 0;
+        if (pString->u16Size >= sizeof(pString->String.ucs2[0]))
+            pString->String.ucs2[0] = 0;
+        else if (pString->u16Size >= sizeof(pString->String.utf8[0]))
+            pString->String.utf8[0] = 0;
     }
 
     return pString;
diff --git a/include/iprt/log.h b/include/iprt/log.h
index 059a7c7..f3b3b63 100644
--- a/include/iprt/log.h
+++ b/include/iprt/log.h
@@ -705,6 +705,38 @@ RTDECL(void) RTLogPrintfEx(void *pvInstance, unsigned fFlags, unsigned iGroup, c
     do { Log((LOG_FN_FMT ": ", __PRETTY_FUNCTION__)); Log(a); } while (0)
 #endif
 
+/** @def Log2Func
+ * Level 2 logging inside C/C++ functions.
+ *
+ * Prepends the given log message with the function name followed by a
+ * semicolon and space.
+ *
+ * @param   a   Log message in format <tt>("string\n" [, args])</tt>.
+ */
+#ifdef LOG_USE_C99
+# define Log2Func(a) \
+    _LogIt(LOG_INSTANCE, RTLOGGRPFLAGS_LEVEL_2, LOG_GROUP, LOG_FN_FMT ": %M", __PRETTY_FUNCTION__, _LogRemoveParentheseis a )
+#else
+# define Log2Func(a) \
+    do { Log2((LOG_FN_FMT ": ", __PRETTY_FUNCTION__)); Log2(a); } while (0)
+#endif
+
+/** @def Log3Func
+ * Level 3 logging inside C/C++ functions.
+ *
+ * Prepends the given log message with the function name followed by a
+ * semicolon and space.
+ *
+ * @param   a   Log message in format <tt>("string\n" [, args])</tt>.
+ */
+#ifdef LOG_USE_C99
+# define Log3Func(a) \
+    _LogIt(LOG_INSTANCE, RTLOGGRPFLAGS_LEVEL_3, LOG_GROUP, LOG_FN_FMT ": %M", __PRETTY_FUNCTION__, _LogRemoveParentheseis a )
+#else
+# define Log3Func(a) \
+    do { Log3((LOG_FN_FMT ": ", __PRETTY_FUNCTION__)); Log3(a); } while (0)
+#endif
+
 /** @def Log4Func
  * Level 4 logging inside C/C++ functions.
  *
@@ -718,7 +750,39 @@ RTDECL(void) RTLogPrintfEx(void *pvInstance, unsigned fFlags, unsigned iGroup, c
     _LogIt(LOG_INSTANCE, RTLOGGRPFLAGS_LEVEL_4, LOG_GROUP, LOG_FN_FMT ": %M", __PRETTY_FUNCTION__, _LogRemoveParentheseis a )
 #else
 # define Log4Func(a) \
-    do { Log((LOG_FN_FMT ": ", __PRETTY_FUNCTION__)); Log(a); } while (0)
+    do { Log4((LOG_FN_FMT ": ", __PRETTY_FUNCTION__)); Log4(a); } while (0)
+#endif
+
+/** @def Log5Func
+ * Level 5 logging inside C/C++ functions.
+ *
+ * Prepends the given log message with the function name followed by a
+ * semicolon and space.
+ *
+ * @param   a   Log message in format <tt>("string\n" [, args])</tt>.
+ */
+#ifdef LOG_USE_C99
+# define Log5Func(a) \
+    _LogIt(LOG_INSTANCE, RTLOGGRPFLAGS_LEVEL_5, LOG_GROUP, LOG_FN_FMT ": %M", __PRETTY_FUNCTION__, _LogRemoveParentheseis a )
+#else
+# define Log5Func(a) \
+    do { Log5((LOG_FN_FMT ": ", __PRETTY_FUNCTION__)); Log5(a); } while (0)
+#endif
+
+/** @def Log6Func
+ * Level 6 logging inside C/C++ functions.
+ *
+ * Prepends the given log message with the function name followed by a
+ * semicolon and space.
+ *
+ * @param   a   Log message in format <tt>("string\n" [, args])</tt>.
+ */
+#ifdef LOG_USE_C99
+# define Log6Func(a) \
+    _LogIt(LOG_INSTANCE, RTLOGGRPFLAGS_LEVEL_6, LOG_GROUP, LOG_FN_FMT ": %M", __PRETTY_FUNCTION__, _LogRemoveParentheseis a )
+#else
+# define Log6Func(a) \
+    do { Log6((LOG_FN_FMT ": ", __PRETTY_FUNCTION__)); Log6(a); } while (0)
 #endif
 
 /** @def LogThisFunc
diff --git a/src/VBox/Additions/common/VBoxControl/VBoxControl.cpp b/src/VBox/Additions/common/VBoxControl/VBoxControl.cpp
index 010a004..1cbabab 100644
--- a/src/VBox/Additions/common/VBoxControl/VBoxControl.cpp
+++ b/src/VBox/Additions/common/VBoxControl/VBoxControl.cpp
@@ -102,7 +102,7 @@ enum VBoxControlUsage
 static void usage(enum VBoxControlUsage eWhich = USAGE_ALL)
 {
     RTPrintf("Usage:\n\n");
-    doUsage("print version number and exit", g_pszProgName, "[-v|--version]");
+    doUsage("print version number and exit", g_pszProgName, "[-V|--version]");
     doUsage("suppress the logo", g_pszProgName, "--nologo ...");
     RTPrintf("\n");
 
diff --git a/src/VBox/Additions/common/VBoxGuest/Makefile.kmk b/src/VBox/Additions/common/VBoxGuest/Makefile.kmk
index 7740185..1bcc2c0 100644
--- a/src/VBox/Additions/common/VBoxGuest/Makefile.kmk
+++ b/src/VBox/Additions/common/VBoxGuest/Makefile.kmk
@@ -37,7 +37,7 @@ if1of ($(KBUILD_TARGET), darwin freebsd haiku $(if $(defined VBOX_WITH_ADDITION_
  VBoxGuest_DEFS.haiku    = VBOX_SVN_REV=$(VBOX_SVN_REV) _KERNEL_MODE=1
  VBoxGuest_DEFS.linux    = KBUILD_MODNAME=KBUILD_STR\(vboxguest\) KBUILD_BASENAME=KBUILD_STR\(vboxguest\) DEBUG_HASH=2 DEBUG_HASH2=3 EXPORT_SYMTAB
  VBoxGuest_DEFS.solaris  = VBOX_SVN_REV=$(VBOX_SVN_REV)
- VBoxGuest_DEFS.win      = VBOX_GUESTDRV_WITH_RELEASE_LOGGER # VBOX_WITH_VRDP_SESSION_HANDLING
+ VBoxGuest_DEFS.win      = VBOX_GUESTDRV_WITH_RELEASE_LOGGER
  VBoxGuest_DEFS.darwin   = VBOX_GUESTDRV_WITH_RELEASE_LOGGER
  ifeq ($(KBUILD_TYPE),release)
   # Allow stopping/removing the driver without a reboot
diff --git a/src/VBox/Additions/common/VBoxGuest/VBoxGuest-darwin.cpp b/src/VBox/Additions/common/VBoxGuest/VBoxGuest-darwin.cpp
index 256b38c..3a5cb79 100644
--- a/src/VBox/Additions/common/VBoxGuest/VBoxGuest-darwin.cpp
+++ b/src/VBox/Additions/common/VBoxGuest/VBoxGuest-darwin.cpp
@@ -4,7 +4,7 @@
  */
 
 /*
- * Copyright (C) 2006-2013 Oracle Corporation
+ * Copyright (C) 2006-2014 Oracle Corporation
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
  * available from http://www.virtualbox.org. This file is free software;
@@ -374,7 +374,7 @@ static int VbgdDarwinOpen(dev_t Dev, int fFlags, int fDevType, struct proc *pPro
         else
             rc = VERR_GENERAL_FAILURE;
 
-        RTSpinlockReleaseNoInts(g_Spinlock);
+        RTSpinlockRelease(g_Spinlock);
 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050
         kauth_cred_unref(&pCred);
 #else  /* 10.4 */
@@ -431,7 +431,7 @@ static int VbgdDarwinIOCtl(dev_t Dev, u_long iCmd, caddr_t pData, int fFlags, st
     pSession = g_apSessionHashTab[iHash];
     while (pSession && pSession->Process != Process /*later: && pSession->fUnrestricted == fUnrestricted*/ && pSession->fOpened)
         pSession = pSession->pNextHash;
-    RTSpinlockReleaseNoInts(g_Spinlock);
+    RTSpinlockRelease(g_Spinlock);
     if (!pSession)
     {
         Log(("VBoxDrvDarwinIOCtl: WHAT?!? pSession == NULL! This must be a mistake... pid=%d iCmd=%#lx\n",
diff --git a/src/VBox/Additions/common/VBoxGuest/VBoxGuest-haiku-stubs.c b/src/VBox/Additions/common/VBoxGuest/VBoxGuest-haiku-stubs.c
index 122df9e..ee2b9e3 100644
--- a/src/VBox/Additions/common/VBoxGuest/VBoxGuest-haiku-stubs.c
+++ b/src/VBox/Additions/common/VBoxGuest/VBoxGuest-haiku-stubs.c
@@ -4,7 +4,7 @@
  */
 
 /*
- * Copyright (C) 2012 Oracle Corporation
+ * Copyright (C) 2012-2014 Oracle Corporation
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
  * available from http://www.virtualbox.org. This file is free software;
@@ -318,10 +318,6 @@ void RTSpinlockRelease(RTSPINLOCK Spinlock)
 {
     g_VBoxGuest->_RTSpinlockRelease(Spinlock);
 }
-void RTSpinlockReleaseNoInts(RTSPINLOCK Spinlock)
-{
-    g_VBoxGuest->_RTSpinlockReleaseNoInts(Spinlock);
-}
 void* RTMemTmpAllocTag(size_t cb, const char *pszTag)
 {
     return g_VBoxGuest->_RTMemTmpAllocTag(cb, pszTag);
diff --git a/src/VBox/Additions/common/VBoxGuest/VBoxGuest-haiku.c b/src/VBox/Additions/common/VBoxGuest/VBoxGuest-haiku.c
index 5aa3170..a35329b 100644
--- a/src/VBox/Additions/common/VBoxGuest/VBoxGuest-haiku.c
+++ b/src/VBox/Additions/common/VBoxGuest/VBoxGuest-haiku.c
@@ -4,7 +4,7 @@
  */
 
 /*
- * Copyright (C) 2012 Oracle Corporation
+ * Copyright (C) 2012-2014 Oracle Corporation
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
  * available from http://www.virtualbox.org. This file is free software;
@@ -173,7 +173,6 @@ static struct vboxguest_module_info g_VBoxGuest =
     RTTimerRequestSystemGranularity,
     RTSpinlockAcquire,
     RTSpinlockRelease,
-    RTSpinlockReleaseNoInts,
     RTMemTmpAllocTag,
     RTMemTmpFree,
     RTLogDefaultInstance,
diff --git a/src/VBox/Additions/common/VBoxGuest/VBoxGuest-haiku.h b/src/VBox/Additions/common/VBoxGuest/VBoxGuest-haiku.h
index d577448..8678028 100644
--- a/src/VBox/Additions/common/VBoxGuest/VBoxGuest-haiku.h
+++ b/src/VBox/Additions/common/VBoxGuest/VBoxGuest-haiku.h
@@ -4,7 +4,7 @@
  */
 
 /*
- * Copyright (C) 2012 Oracle Corporation
+ * Copyright (C) 2012-2014 Oracle Corporation
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
  * available from http://www.virtualbox.org. This file is free software;
@@ -176,7 +176,6 @@ struct vboxguest_module_info
     int (*_RTTimerRequestSystemGranularity)(uint32_t u32Request, uint32_t *pu32Granted);
     void (*_RTSpinlockAcquire)(RTSPINLOCK Spinlock);
     void (*_RTSpinlockRelease)(RTSPINLOCK Spinlock);
-    void (*_RTSpinlockReleaseNoInts)(RTSPINLOCK Spinlock);
     void* (*_RTMemTmpAllocTag)(size_t cb, const char *pszTag);
     void (*_RTMemTmpFree)(void *pv);
     PRTLOGGER(*_RTLogDefaultInstance)(void);
diff --git a/src/VBox/Additions/common/VBoxGuest/VBoxGuest-os2.cpp b/src/VBox/Additions/common/VBoxGuest/VBoxGuest-os2.cpp
index c4ba221..5fae1ab 100644
--- a/src/VBox/Additions/common/VBoxGuest/VBoxGuest-os2.cpp
+++ b/src/VBox/Additions/common/VBoxGuest/VBoxGuest-os2.cpp
@@ -4,7 +4,7 @@
  */
 
 /*
- * Copyright (C) 2007-2013 Oracle Corporation
+ * Copyright (C) 2007-2015 Oracle Corporation
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
  * available from http://www.virtualbox.org. This file is free software;
@@ -188,7 +188,7 @@ DECLASM(int) VBoxGuestOS2Init(const char *pszArgs)
                             strcpy(&g_szInitText[0],
                                    "\r\n"
                                    "VirtualBox Guest Additions Driver for OS/2 version " VBOX_VERSION_STRING "\r\n"
-                                   "Copyright (C) 2008-2010 Oracle Corporation\r\n");
+                                   "Copyright (C) 2008-" VBOX_C_YEAR " " VBOX_VENDOR "\r\n");
                             g_cchInitText = strlen(&g_szInitText[0]);
                         }
                         Log(("VBoxGuestOS2Init: Successfully loaded\n%s", g_szInitText));
@@ -372,7 +372,7 @@ DECLASM(int) VBoxGuestOS2Open(uint16_t sfn)
         RTSpinlockAcquire(g_Spinlock);
         pSession->pNextHash = g_apSessionHashTab[iHash];
         g_apSessionHashTab[iHash] = pSession;
-        RTSpinlockReleaseNoInts(g_Spinlock);
+        RTSpinlockRelease(g_Spinlock);
     }
 
     Log(("VBoxGuestOS2Open: g_DevExt=%p pSession=%p rc=%d pid=%d\n", &g_DevExt, pSession, rc, (int)RTProcSelf()));
@@ -421,7 +421,7 @@ DECLASM(int) VBoxGuestOS2Close(uint16_t sfn)
             }
         }
     }
-    RTSpinlockReleaseNoInts(g_Spinlock);
+    RTSpinlockRelease(g_Spinlock);
     if (!pSession)
     {
         Log(("VBoxGuestIoctl: WHUT?!? pSession == NULL! This must be a mistake... pid=%d sfn=%d\n", (int)Process, sfn));
@@ -454,7 +454,7 @@ DECLASM(int) VBoxGuestOS2IOCtlFast(uint16_t sfn, uint8_t iFunction, int32_t *prc
                &&   (   pSession->sfn != sfn
                      || pSession->Process != Process));
     }
-    RTSpinlockReleaseNoInts(g_Spinlock);
+    RTSpinlockRelease(g_Spinlock);
     if (RT_UNLIKELY(!pSession))
     {
         Log(("VBoxGuestIoctl: WHAT?!? pSession == NULL! This must be a mistake... pid=%d\n", (int)Process));
@@ -545,7 +545,7 @@ DECLASM(int) VBoxGuestOS2IOCtl(uint16_t sfn, uint8_t iCat, uint8_t iFunction, vo
                &&   (   pSession->sfn != sfn
                      || pSession->Process != Process));
     }
-    RTSpinlockReleaseNoInts(g_Spinlock);
+    RTSpinlockRelease(g_Spinlock);
     if (!pSession)
     {
         Log(("VBoxGuestIoctl: WHAT?!? pSession == NULL! This must be a mistake... pid=%d\n", (int)Process));
diff --git a/src/VBox/Additions/common/VBoxGuest/VBoxGuest-win.cpp b/src/VBox/Additions/common/VBoxGuest/VBoxGuest-win.cpp
index da21ce5..26809fe 100644
--- a/src/VBox/Additions/common/VBoxGuest/VBoxGuest-win.cpp
+++ b/src/VBox/Additions/common/VBoxGuest/VBoxGuest-win.cpp
@@ -282,7 +282,7 @@ static NTSTATUS vbgdNtAddDevice(PDRIVER_OBJECT pDrvObj, PDEVICE_OBJECT pDevObj)
             }
             else
             {
-                LogFlowFunc(("IoAttachDeviceToDeviceStack did not give a nextLowerDriver!\n"));
+                LogFunc(("IoAttachDeviceToDeviceStack did not give a nextLowerDriver!\n"));
                 rc = STATUS_DEVICE_NOT_CONNECTED;
             }
 
@@ -290,13 +290,13 @@ static NTSTATUS vbgdNtAddDevice(PDRIVER_OBJECT pDrvObj, PDEVICE_OBJECT pDevObj)
             IoDeleteSymbolicLink(&DosName);
         }
         else
-            LogFlowFunc(("IoCreateSymbolicLink failed with rc=%#x!\n", rc));
+            LogFunc(("IoCreateSymbolicLink failed with rc=%#x!\n", rc));
         IoDeleteDevice(pDeviceObject);
     }
     else
-        LogFlowFunc(("IoCreateDevice failed with rc=%#x!\n", rc));
+        LogFunc(("IoCreateDevice failed with rc=%#x!\n", rc));
 
-    LogFlowFunc(("Returning with rc=0x%x\n", rc));
+    LogFunc(("Returning with rc=0x%x\n", rc));
     return rc;
 }
 #endif
@@ -330,31 +330,30 @@ static void vbgdNtShowDeviceResources(PCM_PARTIAL_RESOURCE_LIST pResourceList)
             "CmResourceTypeSubAllocateFrom",
         };
 
-        LogFlowFunc(("Type=%s",
-                     uType < RT_ELEMENTS(s_apszName) ? s_apszName[uType] : "Unknown"));
+        LogFunc(("Type=%s", uType < RT_ELEMENTS(s_apszName) ? s_apszName[uType] : "Unknown"));
 
         switch (uType)
         {
             case CmResourceTypePort:
             case CmResourceTypeMemory:
-                LogFlowFunc(("Start %8X%8.8lX, length=%X\n",
-                             pResource->u.Port.Start.HighPart, pResource->u.Port.Start.LowPart,
-                             pResource->u.Port.Length));
+                LogFunc(("Start %8X%8.8lX, length=%X\n",
+                         pResource->u.Port.Start.HighPart, pResource->u.Port.Start.LowPart,
+                         pResource->u.Port.Length));
                 break;
 
             case CmResourceTypeInterrupt:
-                LogFlowFunc(("Level=%X, vector=%X, affinity=%X\n",
-                             pResource->u.Interrupt.Level, pResource->u.Interrupt.Vector,
-                             pResource->u.Interrupt.Affinity));
+                LogFunc(("Level=%X, vector=%X, affinity=%X\n",
+                         pResource->u.Interrupt.Level, pResource->u.Interrupt.Vector,
+                         pResource->u.Interrupt.Affinity));
                 break;
 
             case CmResourceTypeDma:
-                LogFlowFunc(("Channel %d, Port %X\n",
-                             pResource->u.Dma.Channel, pResource->u.Dma.Port));
+                LogFunc(("Channel %d, Port %X\n",
+                         pResource->u.Dma.Channel, pResource->u.Dma.Port));
                 break;
 
             default:
-                LogFlowFunc(("\n"));
+                LogFunc(("\n"));
                 break;
         }
     }
@@ -381,7 +380,7 @@ NTSTATUS vbgdNtInit(PDRIVER_OBJECT pDrvObj, PDEVICE_OBJECT pDevObj, PUNICODE_STR
 
     LogFlowFuncEnter();
 
-    int rc = STATUS_SUCCESS;
+    int rc = STATUS_SUCCESS; /** @todo r=bird: s/rc/rcNt/ and s/int/NTSTATUS/. gee. */
 #ifdef TARGET_NT4
     /*
      * Let's have a look at what our PCI adapter offers.
@@ -423,8 +422,8 @@ NTSTATUS vbgdNtInit(PDRIVER_OBJECT pDrvObj, PDEVICE_OBJECT pDevObj, PUNICODE_STR
         {
             pDevExt->Core.pVMMDevMemory = (VMMDevMemory *)pvMMIOBase;
 
-            LogFlowFunc(("pvMMIOBase=0x%p, pDevExt=0x%p, pDevExt->Core.pVMMDevMemory=0x%p\n",
-                         pvMMIOBase, pDevExt, pDevExt ? pDevExt->Core.pVMMDevMemory : NULL));
+            LogFunc(("pvMMIOBase=0x%p, pDevExt=0x%p, pDevExt->Core.pVMMDevMemory=0x%p\n",
+                     pvMMIOBase, pDevExt, pDevExt ? pDevExt->Core.pVMMDevMemory : NULL));
 
             int vrc = VBoxGuestInitDevExt(&pDevExt->Core,
                                           pDevExt->Core.IOPortBase,
@@ -433,12 +432,12 @@ NTSTATUS vbgdNtInit(PDRIVER_OBJECT pDrvObj, PDEVICE_OBJECT pDevObj, PUNICODE_STR
                                           VMMDEV_EVENT_MOUSE_POSITION_CHANGED);
             if (RT_FAILURE(vrc))
             {
-                LogFlowFunc(("Could not init device extension, rc=%Rrc\n", vrc));
+                LogFunc(("Could not init device extension, rc=%Rrc\n", vrc));
                 rc = STATUS_DEVICE_CONFIGURATION_ERROR;
             }
         }
         else
-            LogFlowFunc(("Could not map physical address of VMMDev, rc=0x%x\n", rc));
+            LogFunc(("Could not map physical address of VMMDev, rc=0x%x\n", rc));
     }
 
     if (NT_SUCCESS(rc))
@@ -447,7 +446,7 @@ NTSTATUS vbgdNtInit(PDRIVER_OBJECT pDrvObj, PDEVICE_OBJECT pDevObj, PUNICODE_STR
                               sizeof(VMMDevPowerStateRequest), VMMDevReq_SetPowerStatus);
         if (RT_FAILURE(vrc))
         {
-            LogFlowFunc(("Alloc for pPowerStateRequest failed, rc=%Rrc\n", vrc));
+            LogFunc(("Alloc for pPowerStateRequest failed, rc=%Rrc\n", vrc));
             rc = STATUS_UNSUCCESSFUL;
         }
     }
@@ -482,7 +481,7 @@ NTSTATUS vbgdNtInit(PDRIVER_OBJECT pDrvObj, PDEVICE_OBJECT pDevObj, PUNICODE_STR
                 LogFunc(("No interrupt vector found!\n"));
         }
         else
-            LogFlowFunc(("Device does not provide an interrupt!\n"));
+            LogFunc(("Device does not provide an interrupt!\n"));
 #endif
         if (pDevExt->interruptVector)
         {
@@ -506,10 +505,10 @@ NTSTATUS vbgdNtInit(PDRIVER_OBJECT pDrvObj, PDEVICE_OBJECT pDevObj, PUNICODE_STR
                                     pDevExt->interruptAffinity,                 /* CPU affinity. */
                                     FALSE);                                     /* Don't save FPU stack. */
             if (NT_ERROR(rc))
-                LogFlowFunc(("Could not connect interrupt, rc=0x%x\n", rc));
+                LogFunc(("Could not connect interrupt, rc=0x%x\n", rc));
         }
         else
-            LogFlowFunc(("No interrupt vector found!\n"));
+            LogFunc(("No interrupt vector found!\n"));
     }
 
 
@@ -518,7 +517,7 @@ NTSTATUS vbgdNtInit(PDRIVER_OBJECT pDrvObj, PDEVICE_OBJECT pDevObj, PUNICODE_STR
     int vrc = VBoxGuestCreateKernelSession(&pDevExt->Core, &pDevExt->pKernelSession);
     if (RT_FAILURE(vrc))
     {
-        LogFlowFunc(("Failed to allocated kernel session data, rc=%Rrc\n", rc));
+        LogFunc(("Failed to allocated kernel session data, rc=%Rrc\n", rc));
         rc = STATUS_UNSUCCESSFUL;
     }
 #endif
@@ -545,7 +544,7 @@ NTSTATUS vbgdNtInit(PDRIVER_OBJECT pDrvObj, PDEVICE_OBJECT pDevObj, PUNICODE_STR
     /** @todo r=bird: The error cleanup here is completely missing. We'll leak a
      *        whole bunch of things... */
 
-    LogFlowFunc(("Returned with rc=0x%x\n", rc));
+    LogFunc(("Returned with rc=0x%x\n", rc));
     return rc;
 }
 
@@ -646,7 +645,7 @@ static NTSTATUS vbgdNtCreate(PDEVICE_OBJECT pDevObj, PIRP pIrp)
 
     if (pDevExt->devState != WORKING)
     {
-        LogFlowFunc(("Device is not working currently, state=%d\n", pDevExt->devState));
+        LogFunc(("Device is not working currently, state=%d\n", pDevExt->devState));
         rc = STATUS_UNSUCCESSFUL;
     }
     else if (pStack->Parameters.Create.Options & FILE_DIRECTORY_FILE)
@@ -759,7 +758,10 @@ static NTSTATUS vbgdNtIOCtl(PDEVICE_OBJECT pDevObj, PIRP pIrp)
      *        shall have its own context of course, no hacks, pleeease. */
     if (pSession == NULL)
     {
-        LogFlowFunc(("Using kernel session data ...\n"));
+        LogFunc(("XXX: BUGBUG: FIXME: Using ugly kernel session data hack ...\n"));
+#ifdef DEBUG_andy
+        RTLogBackdoorPrintf("XXX: BUGBUG: FIXME: Using ugly kernel session data hack ... Please don't forget to fix this one, Andy!\n");
+#endif
         pSession = pDevExt->pKernelSession;
     }
 
@@ -780,7 +782,7 @@ static NTSTATUS vbgdNtIOCtl(PDEVICE_OBJECT pDevObj, PIRP pIrp)
             if (RT_UNLIKELY(   cbDataReturned > cbData
                             || cbDataReturned > pStack->Parameters.DeviceIoControl.OutputBufferLength))
             {
-                Log(("VBoxGuest::vbgdNtGuestDeviceControl: Too much output data %u - expected %u!\n", cbDataReturned, cbData));
+                LogFunc(("Too much output data %u - expected %u!\n", cbDataReturned, cbData));
                 cbDataReturned = cbData;
                 Status = STATUS_BUFFER_TOO_SMALL;
             }
@@ -800,8 +802,7 @@ static NTSTATUS vbgdNtIOCtl(PDEVICE_OBJECT pDevObj, PIRP pIrp)
     }
     else
     {
-        Log(("VBoxGuest::vbgdNtGuestDeviceControl: Not buffered request (%#x) - not supported\n",
-             pStack->Parameters.DeviceIoControl.IoControlCode));
+        LogFunc(("Not buffered request (%#x) - not supported\n", pStack->Parameters.DeviceIoControl.IoControlCode));
         Status = STATUS_NOT_SUPPORTED;
     }
 
@@ -919,7 +920,7 @@ NTSTATUS vbgdNtShutdown(PDEVICE_OBJECT pDevObj, PIRP pIrp)
 
         int rc = VbglGRPerform(&pReq->header);
         if (RT_FAILURE(rc))
-            LogFlowFunc(("Error performing request to VMMDev, rc=%Rrc\n", rc));
+            LogFunc(("Error performing request to VMMDev, rc=%Rrc\n", rc));
     }
 
     return STATUS_SUCCESS;
@@ -956,9 +957,7 @@ NTSTATUS vbgdNtNotSupportedStub(PDEVICE_OBJECT pDevObj, PIRP pIrp)
 void vbgdNtDpcHandler(PKDPC pDPC, PDEVICE_OBJECT pDevObj, PIRP pIrp, PVOID pContext)
 {
     PVBOXGUESTDEVEXTWIN pDevExt = (PVBOXGUESTDEVEXTWIN)pDevObj->DeviceExtension;
-#ifndef DEBUG_andy
-    LogFlowFunc(("pDevExt=0x%p\n", pDevExt));
-#endif
+    Log3Func(("pDevExt=0x%p\n", pDevExt));
 
     /* Test & reset the counter. */
     if (ASMAtomicXchgU32(&pDevExt->Core.u32MousePosChangedSeq, 0))
@@ -993,8 +992,7 @@ BOOLEAN vbgdNtIsrHandler(PKINTERRUPT pInterrupt, PVOID pServiceContext)
     if (pDevExt == NULL)
         return FALSE;
 
-    /*LogFlowFunc(("pDevExt=0x%p, pVMMDevMemory=0x%p\n",
-                   pDevExt, pDevExt ? pDevExt->pVMMDevMemory : NULL));*/
+    /*Log3Func(("pDevExt=0x%p, pVMMDevMemory=0x%p\n", pDevExt, pDevExt ? pDevExt->pVMMDevMemory : NULL));*/
 
     /* Enter the common ISR routine and do the actual work. */
     BOOLEAN fIRQTaken = VBoxGuestCommonISR(&pDevExt->Core);
@@ -1003,16 +1001,11 @@ BOOLEAN vbgdNtIsrHandler(PKINTERRUPT pInterrupt, PVOID pServiceContext)
      * sure we're called at the right IRQL. */
     if (fIRQTaken)
     {
-#ifndef DEBUG_andy
-        LogFlowFunc(("IRQ was taken! pInterrupt=0x%p, pDevExt=0x%p\n",
-                     pInterrupt, pDevExt));
-#endif
+        Log3Func(("IRQ was taken! pInterrupt=0x%p, pDevExt=0x%p\n", pInterrupt, pDevExt));
         if (ASMAtomicUoReadU32(   &pDevExt->Core.u32MousePosChangedSeq)
                                || !RTListIsEmpty(&pDevExt->Core.WakeUpList))
         {
-#ifndef DEBUG_andy
-            LogFlowFunc(("Requesting DPC ...\n"));
-#endif
+            Log3Func(("Requesting DPC ...\n"));
             IoRequestDpc(pDevExt->pDeviceObject, pDevExt->pCurrentIrp, NULL);
         }
     }
@@ -1113,10 +1106,10 @@ NTSTATUS vbgdNtScanPCIResourceList(PCM_RESOURCE_LIST pResList, PVBOXGUESTDEVEXTW
                     pBaseAddress->RangeInMemory  = FALSE;
                     pBaseAddress->ResourceMapped = FALSE;
 
-                    LogFlowFunc(("I/O range for VMMDev found! Base=%08x:%08x, length=%08x\n",
-                                 pPartialData->u.Port.Start.HighPart,
-                                 pPartialData->u.Port.Start.LowPart,
-                                 pPartialData->u.Port.Length));
+                    LogFunc(("I/O range for VMMDev found! Base=%08x:%08x, length=%08x\n",
+                             pPartialData->u.Port.Start.HighPart,
+                             pPartialData->u.Port.Start.LowPart,
+                             pPartialData->u.Port.Length));
 
                     /* Next item ... */
                     rangeCount++; pBaseAddress++;
@@ -1126,10 +1119,10 @@ NTSTATUS vbgdNtScanPCIResourceList(PCM_RESOURCE_LIST pResList, PVBOXGUESTDEVEXTW
 
             case CmResourceTypeInterrupt:
             {
-                LogFlowFunc(("Interrupt: Level=%x, vector=%x, mode=%x\n",
-                             pPartialData->u.Interrupt.Level,
-                             pPartialData->u.Interrupt.Vector,
-                             pPartialData->Flags));
+                LogFunc(("Interrupt: Level=%x, vector=%x, mode=%x\n",
+                         pPartialData->u.Interrupt.Level,
+                         pPartialData->u.Interrupt.Vector,
+                         pPartialData->Flags));
 
                 /* Save information. */
                 pDevExt->interruptLevel    = pPartialData->u.Interrupt.Level;
@@ -1169,23 +1162,23 @@ NTSTATUS vbgdNtScanPCIResourceList(PCM_RESOURCE_LIST pResList, PVBOXGUESTDEVEXTW
                         pBaseAddress->RangeInMemory  = TRUE;
                         pBaseAddress->ResourceMapped = FALSE;
 
-                        LogFlowFunc(("Memory range for VMMDev found! Base = %08x:%08x, Length = %08x\n",
-                                     pPartialData->u.Memory.Start.HighPart,
-                                     pPartialData->u.Memory.Start.LowPart,
-                                     pPartialData->u.Memory.Length));
+                        LogFunc(("Memory range for VMMDev found! Base = %08x:%08x, Length = %08x\n",
+                                 pPartialData->u.Memory.Start.HighPart,
+                                 pPartialData->u.Memory.Start.LowPart,
+                                 pPartialData->u.Memory.Length));
 
                         /* Next item ... */
                         rangeCount++; pBaseAddress++; cMMIORange++;
                     }
                     else
-                        LogFlowFunc(("Ignoring memory: Flags=%08x\n", pPartialData->Flags));
+                        LogFunc(("Ignoring memory: Flags=%08x\n", pPartialData->Flags));
                 }
                 break;
             }
 
             default:
             {
-                LogFlowFunc(("Unhandled resource found, type=%d\n", pPartialData->Type));
+                LogFunc(("Unhandled resource found, type=%d\n", pPartialData->Type));
                 break;
             }
         }
@@ -1222,8 +1215,7 @@ NTSTATUS vbgdNtMapVMMDevMemory(PVBOXGUESTDEVEXTWIN pDevExt, PHYSICAL_ADDRESS Phy
          LogFlowFunc(("pVMMDevMemory = 0x%x\n", pVMMDevMemory));
          if (pVMMDevMemory)
          {
-             LogFlowFunc(("VMMDevMemory: Version = 0x%x, Size = %d\n",
-                          pVMMDevMemory->u32Version, pVMMDevMemory->u32Size));
+             LogFunc(("VMMDevMemory: Version = 0x%x, Size = %d\n", pVMMDevMemory->u32Version, pVMMDevMemory->u32Size));
 
              /* Check version of the structure; do we have the right memory version? */
              if (pVMMDevMemory->u32Version == VMMDEV_MEMORY_VERSION)
@@ -1233,13 +1225,12 @@ NTSTATUS vbgdNtMapVMMDevMemory(PVBOXGUESTDEVEXTWIN pDevExt, PHYSICAL_ADDRESS Phy
                  if (pcbMMIO) /* Optional. */
                      *pcbMMIO = pVMMDevMemory->u32Size;
 
-                 LogFlowFunc(("VMMDevMemory found and mapped! pvMMIOBase = 0x%p\n",
-                              *ppvMMIOBase));
+                 LogFlowFunc(("VMMDevMemory found and mapped! pvMMIOBase = 0x%p\n", *ppvMMIOBase));
              }
              else
              {
                  /* Not our version, refuse operation and unmap the memory. */
-                 LogFlowFunc(("Wrong version (%u), refusing operation!\n", pVMMDevMemory->u32Version));
+                 LogFunc(("Wrong version (%u), refusing operation!\n", pVMMDevMemory->u32Version));
 
                  vbgdNtUnmapVMMDevMemory(pDevExt);
                  rc = STATUS_UNSUCCESSFUL;
@@ -1349,6 +1340,7 @@ VBOXOSTYPE vbgdNtVersionToOSType(VBGDNTVER enmNtVer)
 }
 
 #ifdef DEBUG
+
 /**
  * A quick implementation of AtomicTestAndClear for uint32_t and multiple bits.
  */
@@ -1397,6 +1389,7 @@ static void vbgdNtDoTests(void)
     vbgdNtTestAtomicTestAndClearBitsU32(0x11, 0x32, 0x10);
     vbgdNtTestAtomicTestAndClearBitsU32(0x22, 0x23, 0x22);
 }
+
 #endif /* DEBUG */
 
 #ifdef VBOX_WITH_DPC_LATENCY_CHECKER
@@ -1545,5 +1538,6 @@ int VbgdNtIOCtl_DpcLatencyChecker(void)
     ExFreePoolWithTag(pData, VBOXGUEST_DPC_TAG);
     return VINF_SUCCESS;
 }
+
 #endif /* VBOX_WITH_DPC_LATENCY_CHECKER */
 
diff --git a/src/VBox/Additions/common/VBoxGuest/VBoxGuest.cpp b/src/VBox/Additions/common/VBoxGuest/VBoxGuest.cpp
index a828bb8..2952a42 100644
--- a/src/VBox/Additions/common/VBoxGuest/VBoxGuest.cpp
+++ b/src/VBox/Additions/common/VBoxGuest/VBoxGuest.cpp
@@ -4,7 +4,7 @@
  */
 
 /*
- * Copyright (C) 2007-2014 Oracle Corporation
+ * Copyright (C) 2007-2015 Oracle Corporation
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
  * available from http://www.virtualbox.org. This file is free software;
@@ -116,7 +116,7 @@ DECLINLINE(bool) VBoxGuestCommonGuestCapsModeSet(PVBOXGUESTDEVEXT pDevExt, uint3
         fResult = false;
     }
 
-    RTSpinlockReleaseNoInts(pDevExt->EventSpinlock);
+    RTSpinlockRelease(pDevExt->EventSpinlock);
 
     if (pu32OtherVal)
         *pu32OtherVal = fNotVal;
@@ -286,7 +286,7 @@ static int vboxGuestUpdateHostFlags(PVBOXGUESTDEVEXT pDevExt,
         if (enmFlags & HostFlags_MouseStatus)
             vboxGuestSetMouseStatus(pStatusReq, fMouseStatus);
     }
-    RTSpinlockReleaseNoInts(pDevExt->SessionSpinlock);
+    RTSpinlockRelease(pDevExt->SessionSpinlock);
     if (pFilterReq)
         VbglGRFree(&pFilterReq->header);
     if (pCapabilitiesReq)
@@ -359,7 +359,7 @@ static int vboxGuestInitFixateGuestMappings(PVBOXGUESTDEVEXT pDevExt)
      * instance in VT-x and AMD-V mode.
      */
     if (pReq->hypervisorSize == 0)
-        LogFlowFunc(("Nothing to do\n"));
+        Log(("vboxGuestInitFixateGuestMappings: nothing to do\n"));
     else
     {
         /*
@@ -371,7 +371,7 @@ static int vboxGuestInitFixateGuestMappings(PVBOXGUESTDEVEXT pDevExt)
         RTR0MEMOBJ  ahTries[5];
         uint32_t    iTry;
         bool        fBitched = false;
-        LogFlowFunc(("cbHypervisor=%#x\n", cbHypervisor));
+        Log(("vboxGuestInitFixateGuestMappings: cbHypervisor=%#x\n", cbHypervisor));
         for (iTry = 0; iTry < RT_ELEMENTS(ahTries); iTry++)
         {
             /*
@@ -698,12 +698,11 @@ int VBoxGuestReinitDevExtAfterHibernation(PVBOXGUESTDEVEXT pDevExt, VBOXOSTYPE e
     {
         rc = VBoxGuestReportDriverStatus(true /* Driver is active */);
         if (RT_FAILURE(rc))
-            LogFlowFunc(("Could not report guest driver status, rc=%Rrc\n", rc));
+            Log(("VBoxGuestReinitDevExtAfterHibernation: could not report guest driver status, rc=%Rrc\n", rc));
     }
     else
-        LogFlowFunc(("Could not report guest information to host, rc=%Rrc\n", rc));
-
-    LogFlowFunc(("Returned with rc=%Rrc\n", rc));
+        Log(("VBoxGuestReinitDevExtAfterHibernation: could not report guest information to host, rc=%Rrc\n", rc));
+    LogFlow(("VBoxGuestReinitDevExtAfterHibernation: returned with rc=%Rrc\n", rc));
     return rc;
 }
 
@@ -806,7 +805,7 @@ static int vboxGuestSetBalloonSizeFromUser(PVBOXGUESTDEVEXT pDevExt, PVBOXGUESTS
                 pDevExt->MemBalloon.cChunks++;
             else
             {
-                LogFlowFunc(("Inflating failed, rc=%Rrc\n", rc));
+                Log(("vboxGuestSetBalloonSize(inflate): failed, rc=%Rrc!\n", rc));
                 RTR0MemObjFree(*pMemObj, true);
                 *pMemObj = NIL_RTR0MEMOBJ;
             }
@@ -818,7 +817,7 @@ static int vboxGuestSetBalloonSizeFromUser(PVBOXGUESTDEVEXT pDevExt, PVBOXGUESTS
         if (RT_SUCCESS(rc))
             pDevExt->MemBalloon.cChunks--;
         else
-            LogFlowFunc(("Deflating failed, rc=%Rrc\n", rc));
+            Log(("vboxGuestSetBalloonSize(deflate): failed, rc=%Rrc!\n", rc));
     }
 
     VbglGRFree(&pReq->header);
@@ -853,8 +852,8 @@ static void vboxGuestCloseMemBalloon(PVBOXGUESTDEVEXT pDevExt, PVBOXGUESTSESSION
                     rc = vboxGuestBalloonDeflate(&pDevExt->MemBalloon.paMemObj[i], pReq);
                     if (RT_FAILURE(rc))
                     {
-                        LogRelFunc(("Deflating balloon failed with rc=%Rrc; will leak %u chunks\n",
-                                    rc, pDevExt->MemBalloon.cChunks));
+                        LogRel(("vboxGuestCloseMemBalloon: Deflate failed with rc=%Rrc.  Will leak %u chunks.\n",
+                                rc, pDevExt->MemBalloon.cChunks));
                         break;
                     }
                     pDevExt->MemBalloon.paMemObj[i] = NIL_RTR0MEMOBJ;
@@ -863,8 +862,8 @@ static void vboxGuestCloseMemBalloon(PVBOXGUESTDEVEXT pDevExt, PVBOXGUESTSESSION
                 VbglGRFree(&pReq->header);
             }
             else
-                LogRelFunc(("Failed to allocate VMMDev request buffer, rc=%Rrc; will leak %u chunks\n",
-                            rc, pDevExt->MemBalloon.cChunks));
+                LogRel(("vboxGuestCloseMemBalloon: Failed to allocate VMMDev request buffer (rc=%Rrc).  Will leak %u chunks.\n",
+                        rc, pDevExt->MemBalloon.cChunks));
             RTMemFree(pDevExt->MemBalloon.paMemObj);
             pDevExt->MemBalloon.paMemObj = NULL;
         }
@@ -900,33 +899,19 @@ int VBoxGuestInitDevExt(PVBOXGUESTDEVEXT pDevExt, uint16_t IOPortBase,
                         void *pvMMIOBase, uint32_t cbMMIO, VBOXOSTYPE enmOSType, uint32_t fFixedEvents)
 {
     int rc, rc2;
-    unsigned i;
 
 #ifdef VBOX_GUESTDRV_WITH_RELEASE_LOGGER
     /*
      * Create the release log.
      */
     static const char * const s_apszGroups[] = VBOX_LOGGROUP_NAMES;
-    RTUINT fFlags =   RTLOGFLAGS_PREFIX_TIME | RTLOGFLAGS_PREFIX_TID
-                    | RTLOGFLAGS_PREFIX_THREAD | RTLOGFLAGS_PREFIX_TIME_PROG;
     PRTLOGGER pRelLogger;
-    rc = RTLogCreate(&pRelLogger, fFlags, "all",
-#ifdef DEBUG
-                     "VBOXGUEST_LOG",
-#else
-                     "VBOXGUEST_RELEASE_LOG",
-#endif
-                     RT_ELEMENTS(s_apszGroups), s_apszGroups,
+    rc = RTLogCreate(&pRelLogger, 0 /*fFlags*/, "all", "VBOXGUEST_RELEASE_LOG", RT_ELEMENTS(s_apszGroups), s_apszGroups,
                      RTLOGDEST_STDOUT | RTLOGDEST_DEBUGGER, NULL);
     if (RT_SUCCESS(rc))
-    {
         RTLogRelSetDefaultInstance(pRelLogger);
-
-        /* Explicitly flush the log in case of VBOXGUEST_RELEASE_LOG=buffered. */
-        RTLogFlush(pRelLogger);
-    }
     /** @todo Add native hook for getting logger config parameters and setting
-     *        them. On Linux we use the module parameter stuff (see vboxguestLinuxModInit). */
+     *        them.  On linux we should use the module parameter stuff... */
 #endif
 
     /*
@@ -981,12 +966,12 @@ int VBoxGuestInitDevExt(PVBOXGUESTDEVEXT pDevExt, uint16_t IOPortBase,
             &&  pVMMDev->u32Size <= cbMMIO)
         {
             pDevExt->pVMMDevMemory = pVMMDev;
-            LogFlowFunc(("VMMDevMemory: mapping=%p size=%#RX32 (%#RX32), version=%#RX32\n",
-                         pVMMDev, pVMMDev->u32Size, cbMMIO, pVMMDev->u32Version));
+            Log(("VBoxGuestInitDevExt: VMMDevMemory: mapping=%p size=%#RX32 (%#RX32) version=%#RX32\n",
+                 pVMMDev, pVMMDev->u32Size, cbMMIO, pVMMDev->u32Version));
         }
         else /* try live without it. */
-            LogRelFunc(("Bogus VMMDev memory; u32Version=%RX32 (expected %RX32), u32Size=%RX32 (expected <= %RX32)\n",
-                        pVMMDev->u32Version, VMMDEV_MEMORY_VERSION, pVMMDev->u32Size, cbMMIO));
+            LogRel(("VBoxGuestInitDevExt: Bogus VMMDev memory; u32Version=%RX32 (expected %RX32) u32Size=%RX32 (expected <= %RX32)\n",
+                    pVMMDev->u32Version, VMMDEV_MEMORY_VERSION, pVMMDev->u32Size, cbMMIO));
     }
 
     pDevExt->u32AcquireModeGuestCaps = 0;
@@ -1001,7 +986,7 @@ int VBoxGuestInitDevExt(PVBOXGUESTDEVEXT pDevExt, uint16_t IOPortBase,
         rc = RTSpinlockCreate(&pDevExt->SessionSpinlock, RTSPINLOCK_FLAGS_INTERRUPT_SAFE, "VBoxGuestSession");
     if (RT_FAILURE(rc))
     {
-        LogRelFunc(("Failed to create spinlock, rc=%Rrc\n", rc));
+        LogRel(("VBoxGuestInitDevExt: failed to create spinlock, rc=%Rrc!\n", rc));
         if (pDevExt->EventSpinlock != NIL_RTSPINLOCK)
             RTSpinlockDestroy(pDevExt->EventSpinlock);
         return rc;
@@ -1010,7 +995,7 @@ int VBoxGuestInitDevExt(PVBOXGUESTDEVEXT pDevExt, uint16_t IOPortBase,
     rc = RTSemFastMutexCreate(&pDevExt->MemBalloon.hMtx);
     if (RT_FAILURE(rc))
     {
-        LogRelFunc(("Failed to create mutex, rc=%Rrc\n", rc));
+        LogRel(("VBoxGuestInitDevExt: failed to create mutex, rc=%Rrc!\n", rc));
         RTSpinlockDestroy(pDevExt->SessionSpinlock);
         RTSpinlockDestroy(pDevExt->EventSpinlock);
         return rc;
@@ -1045,25 +1030,25 @@ int VBoxGuestInitDevExt(PVBOXGUESTDEVEXT pDevExt, uint16_t IOPortBase,
 
                     rc = VBoxGuestReportDriverStatus(true /* Driver is active */);
                     if (RT_FAILURE(rc))
-                        LogRelFunc(("VBoxReportGuestDriverStatus failed, rc=%Rrc\n", rc));
+                        LogRel(("VBoxGuestInitDevExt: VBoxReportGuestDriverStatus failed, rc=%Rrc\n", rc));
 
                     LogFlowFunc(("VBoxGuestInitDevExt: returns success\n"));
                     return VINF_SUCCESS;
                 }
-                else
-                    LogRelFunc(("Failed to set host flags, rc=%Rrc\n", rc));
+
+                LogRel(("VBoxGuestInitDevExt: failed to set host flags, rc=%Rrc\n", rc));
             }
             else
-                LogRelFunc(("VBoxGuestInitDevExt: VBoxReportGuestInfo failed, rc=%Rrc\n", rc));
+                LogRel(("VBoxGuestInitDevExt: VBoxReportGuestInfo failed, rc=%Rrc\n", rc));
             VbglGRFree((VMMDevRequestHeader *)pDevExt->pIrqAckEvents);
         }
         else
-            LogRelFunc(("VBoxGRAlloc failed, rc=%Rrc\n", rc));
+            LogRel(("VBoxGuestInitDevExt: VBoxGRAlloc failed, rc=%Rrc\n", rc));
 
         VbglTerminate();
     }
     else
-        LogRelFunc(("VbglInit failed, rc=%Rrc\n", rc));
+        LogRel(("VBoxGuestInitDevExt: VbglInit failed, rc=%Rrc\n", rc));
 
     rc2 = RTSemFastMutexDestroy(pDevExt->MemBalloon.hMtx); AssertRC(rc2);
     rc2 = RTSpinlockDestroy(pDevExt->EventSpinlock); AssertRC(rc2);
@@ -1181,7 +1166,7 @@ int VBoxGuestCreateUserSession(PVBOXGUESTDEVEXT pDevExt, PVBOXGUESTSESSION *ppSe
     pSession->pDevExt = pDevExt;
     RTSpinlockAcquire(pDevExt->SessionSpinlock);
     RTListAppend(&pDevExt->SessionList, &pSession->ListNode);
-    RTSpinlockReleaseNoInts(pDevExt->SessionSpinlock);
+    RTSpinlockRelease(pDevExt->SessionSpinlock);
 
     *ppSession = pSession;
     LogFlow(("VBoxGuestCreateUserSession: pSession=%p proc=%RTproc (%d) r0proc=%p\n",
@@ -1214,11 +1199,11 @@ int VBoxGuestCreateKernelSession(PVBOXGUESTDEVEXT pDevExt, PVBOXGUESTSESSION *pp
     pSession->pDevExt = pDevExt;
     RTSpinlockAcquire(pDevExt->SessionSpinlock);
     RTListAppend(&pDevExt->SessionList, &pSession->ListNode);
-    RTSpinlockReleaseNoInts(pDevExt->SessionSpinlock);
+    RTSpinlockRelease(pDevExt->SessionSpinlock);
 
     *ppSession = pSession;
-    LogFlowFunc(("pSession=%p proc=%RTproc (%d) r0proc=%p\n",
-                 pSession, pSession->Process, (int)pSession->Process, (uintptr_t)pSession->R0Process)); /** @todo %RTr0proc */
+    LogFlow(("VBoxGuestCreateKernelSession: pSession=%p proc=%RTproc (%d) r0proc=%p\n",
+             pSession, pSession->Process, (int)pSession->Process, (uintptr_t)pSession->R0Process)); /** @todo %RTr0proc */
     return VINF_SUCCESS;
 }
 
@@ -1233,12 +1218,12 @@ static int VBoxGuestCommonIOCtl_CancelAllWaitEvents(PVBOXGUESTDEVEXT pDevExt, PV
 void VBoxGuestCloseSession(PVBOXGUESTDEVEXT pDevExt, PVBOXGUESTSESSION pSession)
 {
     unsigned i; NOREF(i);
-    LogFlowFunc(("pSession=%p proc=%RTproc (%d) r0proc=%p\n",
-                 pSession, pSession->Process, (int)pSession->Process, (uintptr_t)pSession->R0Process)); /** @todo %RTr0proc */
+    LogFlow(("VBoxGuestCloseSession: pSession=%p proc=%RTproc (%d) r0proc=%p\n",
+             pSession, pSession->Process, (int)pSession->Process, (uintptr_t)pSession->R0Process)); /** @todo %RTr0proc */
 
     RTSpinlockAcquire(pDevExt->SessionSpinlock);
     RTListNodeRemove(&pSession->ListNode);
-    RTSpinlockReleaseNoInts(pDevExt->SessionSpinlock);
+    RTSpinlockRelease(pDevExt->SessionSpinlock);
     VBoxGuestCommonGuestCapsAcquire(pDevExt, pSession, 0, UINT32_MAX, VBOXGUESTCAPSACQUIRE_FLAGS_NONE);
 
     VBoxGuestCommonIOCtl_CancelAllWaitEvents(pDevExt, pSession);
@@ -1251,7 +1236,7 @@ void VBoxGuestCloseSession(PVBOXGUESTDEVEXT pDevExt, PVBOXGUESTSESSION pSession)
             Info.result = 0;
             Info.u32ClientID = pSession->aHGCMClientIds[i];
             pSession->aHGCMClientIds[i] = 0;
-            LogFlowFunc(("Disconnecting client ID=%#RX32\n", Info.u32ClientID));
+            Log(("VBoxGuestCloseSession: disconnecting client id %#RX32\n", Info.u32ClientID));
             VbglR0HGCMInternalDisconnect(&Info, VBoxGuestHGCMAsyncWaitCallback, pDevExt, RT_INDEFINITE_WAIT);
         }
 #endif
@@ -1291,26 +1276,23 @@ static PVBOXGUESTWAIT VBoxGuestWaitAlloc(PVBOXGUESTDEVEXT pDevExt, PVBOXGUESTSES
         if (pWait)
             RTListNodeRemove(&pWait->ListNode);
 
-        RTSpinlockReleaseNoInts(pDevExt->EventSpinlock);
+        RTSpinlockRelease(pDevExt->EventSpinlock);
     }
     if (!pWait)
     {
-        static unsigned s_cErrors = 0;
         int rc;
 
         pWait = (PVBOXGUESTWAIT)RTMemAlloc(sizeof(*pWait));
         if (!pWait)
         {
-            if (s_cErrors++ < 32)
-                LogRelFunc(("Out of memory, returning NULL\n"));
+            LogRelMax(32, ("VBoxGuestWaitAlloc: out-of-memory!\n"));
             return NULL;
         }
 
         rc = RTSemEventMultiCreate(&pWait->Event);
         if (RT_FAILURE(rc))
         {
-            if (s_cErrors++ < 32)
-                LogRelFunc(("RTSemEventMultiCreate failed with rc=%Rrc\n", rc));
+            LogRelMax(32, ("VBoxGuestCommonIOCtl: RTSemEventMultiCreate failed with rc=%Rrc!\n", rc));
             RTMemFree(pWait);
             return NULL;
         }
@@ -1376,7 +1358,7 @@ static void VBoxGuestWaitFreeUnlocked(PVBOXGUESTDEVEXT pDevExt, PVBOXGUESTWAIT p
 {
     RTSpinlockAcquire(pDevExt->EventSpinlock);
     VBoxGuestWaitFreeLocked(pDevExt, pWait);
-    RTSpinlockReleaseNoInts(pDevExt->EventSpinlock);
+    RTSpinlockRelease(pDevExt->EventSpinlock);
 }
 
 
@@ -1401,7 +1383,7 @@ void VBoxGuestWaitDoWakeUps(PVBOXGUESTDEVEXT pDevExt)
             if (!pWait)
                 break;
             pWait->fPendingWakeUp = true;
-            RTSpinlockReleaseNoInts(pDevExt->EventSpinlock);
+            RTSpinlockRelease(pDevExt->EventSpinlock);
 
             rc = RTSemEventMultiSignal(pWait->Event);
             AssertRC(rc);
@@ -1419,7 +1401,7 @@ void VBoxGuestWaitDoWakeUps(PVBOXGUESTDEVEXT pDevExt)
                 VBoxGuestWaitFreeLocked(pDevExt, pWait);
             }
         }
-        RTSpinlockReleaseNoInts(pDevExt->EventSpinlock);
+        RTSpinlockRelease(pDevExt->EventSpinlock);
     }
 }
 #endif /* VBOXGUEST_USE_DEFERRED_WAKE_UP */
@@ -1440,8 +1422,8 @@ int VBoxGuestSetGuestCapabilities(uint32_t fOr, uint32_t fNot)
     int rc = VbglGRAlloc((VMMDevRequestHeader **)&pReq, sizeof(*pReq), VMMDevReq_SetGuestCapabilities);
     if (RT_FAILURE(rc))
     {
-        LogFlowFunc(("Failed to allocate %u (%#x) bytes to cache the request; rc=%Rrc\n",
-                     sizeof(*pReq), sizeof(*pReq), rc));
+        Log(("VBoxGuestSetGuestCapabilities: failed to allocate %u (%#x) bytes to cache the request. rc=%Rrc!!\n",
+             sizeof(*pReq), sizeof(*pReq), rc));
         return rc;
     }
 
@@ -1450,7 +1432,7 @@ int VBoxGuestSetGuestCapabilities(uint32_t fOr, uint32_t fNot)
 
     rc = VbglGRPerform(&pReq->header);
     if (RT_FAILURE(rc))
-        LogFlowFunc(("VbglGRPerform failed, rc=%Rrc\n", rc));
+        Log(("VBoxGuestSetGuestCapabilities: VbglGRPerform failed, rc=%Rrc!\n", rc));
 
     VbglGRFree(&pReq->header);
     return rc;
@@ -1469,7 +1451,7 @@ int VBoxGuestSetGuestCapabilities(uint32_t fOr, uint32_t fNot)
  */
 int  VBoxGuestCommonIOCtlFast(unsigned iFunction, PVBOXGUESTDEVEXT pDevExt, PVBOXGUESTSESSION pSession)
 {
-    LogFlowFunc(("iFunction=%#x pDevExt=%p pSession=%p\n", iFunction, pDevExt, pSession));
+    LogFlow(("VBoxGuestCommonIOCtlFast: iFunction=%#x pDevExt=%p pSession=%p\n", iFunction, pDevExt, pSession));
 
     NOREF(iFunction);
     NOREF(pDevExt);
@@ -1488,7 +1470,7 @@ int  VBoxGuestCommonIOCtlFast(unsigned iFunction, PVBOXGUESTDEVEXT pDevExt, PVBO
  */
 static int VBoxGuestCommonIOCtl_GetVMMDevPort(PVBOXGUESTDEVEXT pDevExt, VBoxGuestPortInfo *pInfo, size_t *pcbDataReturned)
 {
-    LogFlowFuncEnter();
+    LogFlow(("VBoxGuestCommonIOCtl: GETVMMDEVPORT\n"));
 
     pInfo->portAddress = pDevExt->IOPortBase;
     pInfo->pVMMDevMemory = (VMMDevMemory *)pDevExt->pVMMDevMemory;
@@ -1508,11 +1490,11 @@ static int VBoxGuestCommonIOCtl_GetVMMDevPort(PVBOXGUESTDEVEXT pDevExt, VBoxGues
  */
 int VBoxGuestCommonIOCtl_SetMouseNotifyCallback(PVBOXGUESTDEVEXT pDevExt, VBoxGuestMouseSetNotifyCallback *pNotify)
 {
-    LogFlowFuncEnter();
+    LogFlow(("VBoxGuestCommonIOCtl: SET_MOUSE_NOTIFY_CALLBACK\n"));
 
     RTSpinlockAcquire(pDevExt->EventSpinlock);
     pDevExt->MouseNotifyCallback = *pNotify;
-    RTSpinlockReleaseNoInts(pDevExt->EventSpinlock);
+    RTSpinlockRelease(pDevExt->EventSpinlock);
     return VINF_SUCCESS;
 }
 #endif
@@ -1531,19 +1513,19 @@ DECLINLINE(int) WaitEventCheckCondition(PVBOXGUESTDEVEXT pDevExt, PVBOXGUESTSESS
     uint32_t fMatches = VBoxGuestCommonGetAndCleanPendingEventsLocked(pDevExt, pSession, fReqEvents);
     if (fMatches || pSession->fPendingCancelWaitEvents)
     {
-        RTSpinlockReleaseNoInts(pDevExt->EventSpinlock);
+        RTSpinlockRelease(pDevExt->EventSpinlock);
 
         pInfo->u32EventFlagsOut = fMatches;
         pInfo->u32Result = VBOXGUEST_WAITEVENT_OK;
         if (fReqEvents & ~((uint32_t)1 << iEvent))
-            LogFlowFunc(("WAITEVENT: returns %#x\n", pInfo->u32EventFlagsOut));
+            LogFlow(("VBoxGuestCommonIOCtl: WAITEVENT: returns %#x\n", pInfo->u32EventFlagsOut));
         else
-            LogFlowFunc(("WAITEVENT: returns %#x/%d\n", pInfo->u32EventFlagsOut, iEvent));
+            LogFlow(("VBoxGuestCommonIOCtl: WAITEVENT: returns %#x/%d\n", pInfo->u32EventFlagsOut, iEvent));
         pSession->fPendingCancelWaitEvents = false;
         return VINF_SUCCESS;
     }
 
-    RTSpinlockReleaseNoInts(pDevExt->EventSpinlock);
+    RTSpinlockRelease(pDevExt->EventSpinlock);
     return VERR_TIMEOUT;
 }
 
@@ -1568,7 +1550,7 @@ static int VBoxGuestCommonIOCtl_WaitEvent(PVBOXGUESTDEVEXT pDevExt, PVBOXGUESTSE
     iEvent = ASMBitFirstSetU32(fReqEvents) - 1;
     if (RT_UNLIKELY(iEvent < 0))
     {
-        LogRel(("Invalid input mask %#x\n", fReqEvents));
+        LogRel(("VBoxGuestCommonIOCtl: WAITEVENT: Invalid input mask %#x!!\n", fReqEvents));
         return VERR_INVALID_PARAMETER;
     }
 
@@ -1583,7 +1565,7 @@ static int VBoxGuestCommonIOCtl_WaitEvent(PVBOXGUESTDEVEXT pDevExt, PVBOXGUESTSE
     if (!pInfo->u32TimeoutIn)
     {
         pInfo->u32Result = VBOXGUEST_WAITEVENT_TIMEOUT;
-        LogFlowFunc(("Returning VERR_TIMEOUT\n"));
+        LogFlow(("VBoxGuestCommonIOCtl: WAITEVENT: returns VERR_TIMEOUT\n"));
         return VERR_TIMEOUT;
     }
 
@@ -1627,7 +1609,7 @@ static int VBoxGuestCommonIOCtl_WaitEvent(PVBOXGUESTDEVEXT pDevExt, PVBOXGUESTSE
     RTSpinlockAcquire(pDevExt->EventSpinlock);
     fResEvents = pWait->fResEvents;
     VBoxGuestWaitFreeLocked(pDevExt, pWait);
-    RTSpinlockReleaseNoInts(pDevExt->EventSpinlock);
+    RTSpinlockRelease(pDevExt->EventSpinlock);
 
     /*
      * Now deal with the return code.
@@ -1638,9 +1620,9 @@ static int VBoxGuestCommonIOCtl_WaitEvent(PVBOXGUESTDEVEXT pDevExt, PVBOXGUESTSE
         pInfo->u32EventFlagsOut = fResEvents;
         pInfo->u32Result = VBOXGUEST_WAITEVENT_OK;
         if (fReqEvents & ~((uint32_t)1 << iEvent))
-            LogFlowFunc(("Returning %#x\n", pInfo->u32EventFlagsOut));
+            LogFlow(("VBoxGuestCommonIOCtl: WAITEVENT: returns %#x\n", pInfo->u32EventFlagsOut));
         else
-            LogFlowFunc(("Returning %#x/%d\n", pInfo->u32EventFlagsOut, iEvent));
+            LogFlow(("VBoxGuestCommonIOCtl: WAITEVENT: returns %#x/%d\n", pInfo->u32EventFlagsOut, iEvent));
         rc = VINF_SUCCESS;
     }
     else if (   fResEvents == UINT32_MAX
@@ -1648,24 +1630,22 @@ static int VBoxGuestCommonIOCtl_WaitEvent(PVBOXGUESTDEVEXT pDevExt, PVBOXGUESTSE
     {
         pInfo->u32Result = VBOXGUEST_WAITEVENT_INTERRUPTED;
         rc = VERR_INTERRUPTED;
-        LogFlowFunc(("Returning VERR_INTERRUPTED\n"));
+        LogFlow(("VBoxGuestCommonIOCtl: WAITEVENT: returns VERR_INTERRUPTED\n"));
     }
     else if (rc == VERR_TIMEOUT)
     {
         pInfo->u32Result = VBOXGUEST_WAITEVENT_TIMEOUT;
-        LogFlowFunc(("Returning VERR_TIMEOUT (2)\n"));
+        LogFlow(("VBoxGuestCommonIOCtl: WAITEVENT: returns VERR_TIMEOUT (2)\n"));
     }
     else
     {
         if (RT_SUCCESS(rc))
         {
-            static unsigned s_cErrors = 0;
-            if (s_cErrors++ < 32)
-                LogRelFunc(("Returning %Rrc but no events\n", rc));
+            LogRelMax(32, ("VBoxGuestCommonIOCtl: WAITEVENT: returns %Rrc but no events!\n", rc));
             rc = VERR_INTERNAL_ERROR;
         }
         pInfo->u32Result = VBOXGUEST_WAITEVENT_ERROR;
-        LogFlowFunc(("Returning %Rrc\n", rc));
+        LogFlow(("VBoxGuestCommonIOCtl: WAITEVENT: returns %Rrc\n", rc));
     }
 
     return rc;
@@ -1683,7 +1663,7 @@ static int VBoxGuestCommonIOCtl_CancelAllWaitEvents(PVBOXGUESTDEVEXT pDevExt, PV
      * WAITEVENT loop. */
     bool                    fCancelledOne = false;
 
-    LogFlowFunc(("CANCEL_ALL_WAITEVENTS\n"));
+    LogFlow(("VBoxGuestCommonIOCtl: CANCEL_ALL_WAITEVENTS\n"));
 
     /*
      * Walk the event list and wake up anyone with a matching session.
@@ -1706,7 +1686,7 @@ static int VBoxGuestCommonIOCtl_CancelAllWaitEvents(PVBOXGUESTDEVEXT pDevExt, PV
     }
     if (!fCancelledOne)
         pSession->fPendingCancelWaitEvents = true;
-    RTSpinlockReleaseNoInts(pDevExt->EventSpinlock);
+    RTSpinlockRelease(pDevExt->EventSpinlock);
     Assert(rc == 0);
     NOREF(rc);
 
@@ -1801,7 +1781,7 @@ static int VBoxGuestCheckIfVMMReqAllowed(PVBOXGUESTDEVEXT pDevExt, PVBOXGUESTSES
             if (!VBoxGuestCommonGuestCapsModeSet(pDevExt, pCaps->u32OrMask, false, &fAcquireCaps))
             {
                 AssertFailed();
-                LogRel(("calling caps set for acquired caps %d\n", pCaps->u32OrMask));
+                LogRel(("VBoxDrv: calling caps set for acquired caps %d\n", pCaps->u32OrMask));
                 enmRequired = kLevel_NoOne;
                 break;
             }
@@ -1903,32 +1883,32 @@ static int VBoxGuestCommonIOCtl_VMMRequest(PVBOXGUESTDEVEXT pDevExt, PVBOXGUESTS
     const uint32_t          cbReq     = pReqHdr->size;
     const uint32_t          cbMinSize = (uint32_t)vmmdevGetRequestSize(enmType);
 
-    LogFlowFunc(("Type=%d\n", pReqHdr->requestType));
+    LogFlow(("VBoxGuestCommonIOCtl: VMMREQUEST type %d\n", pReqHdr->requestType));
 
     if (cbReq < cbMinSize)
     {
-        LogRelFunc(("Invalid hdr size %#x, expected >= %#x; type=%#x!!\n",
-                    cbReq, cbMinSize, enmType));
+        LogRel(("VBoxGuestCommonIOCtl: VMMREQUEST: invalid hdr size %#x, expected >= %#x; type=%#x!!\n",
+                cbReq, cbMinSize, enmType));
         return VERR_INVALID_PARAMETER;
     }
     if (cbReq > cbData)
     {
-        LogRelFunc(("Invalid size %#x, expected >= %#x (hdr); type=%#x!!\n",
-                    cbData, cbReq, enmType));
+        LogRel(("VBoxGuestCommonIOCtl: VMMREQUEST: invalid size %#x, expected >= %#x (hdr); type=%#x!!\n",
+                cbData, cbReq, enmType));
         return VERR_INVALID_PARAMETER;
     }
     rc = VbglGRVerify(pReqHdr, cbData);
     if (RT_FAILURE(rc))
     {
-        LogFlowFunc(("Invalid header: size %#x, expected >= %#x (hdr); type=%#x; rc=%Rrc\n",
-                     cbData, cbReq, enmType, rc));
+        Log(("VBoxGuestCommonIOCtl: VMMREQUEST: invalid header: size %#x, expected >= %#x (hdr); type=%#x; rc=%Rrc!!\n",
+             cbData, cbReq, enmType, rc));
         return rc;
     }
 
     rc = VBoxGuestCheckIfVMMReqAllowed(pDevExt, pSession, enmType, pReqHdr);
     if (RT_FAILURE(rc))
     {
-        LogFlowFunc(("Operation not allowed! type=%#x, rc=%Rrc\n", enmType, rc));
+        Log(("VBoxGuestCommonIOCtl: VMMREQUEST: Operation not allowed! type=%#x rc=%Rrc\n", enmType, rc));
         return rc;
     }
 
@@ -1942,8 +1922,8 @@ static int VBoxGuestCommonIOCtl_VMMRequest(PVBOXGUESTDEVEXT pDevExt, PVBOXGUESTS
     rc = VbglGRAlloc(&pReqCopy, cbReq, enmType);
     if (RT_FAILURE(rc))
     {
-        LogFlowFunc(("Failed to allocate %u (%#x) bytes to cache the request; rc=%Rrc\n",
-                     cbReq, cbReq, rc));
+        Log(("VBoxGuestCommonIOCtl: VMMREQUEST: failed to allocate %u (%#x) bytes to cache the request. rc=%Rrc!!\n",
+             cbReq, cbReq, rc));
         return rc;
     }
     memcpy(pReqCopy, pReqHdr, cbReq);
@@ -1963,11 +1943,10 @@ static int VBoxGuestCommonIOCtl_VMMRequest(PVBOXGUESTDEVEXT pDevExt, PVBOXGUESTS
             *pcbDataReturned = cbReq;
     }
     else if (RT_FAILURE(rc))
-        LogFlowFunc(("VbglGRPerform failed; rc=%Rrc\n", rc));
+        Log(("VBoxGuestCommonIOCtl: VMMREQUEST: VbglGRPerform - rc=%Rrc!\n", rc));
     else
     {
-        LogFlowFunc(("Request execution failed; VMMDev rc=%Rrc\n",
-                     pReqCopy->rc));
+        Log(("VBoxGuestCommonIOCtl: VMMREQUEST: request execution failed; VMMDev rc=%Rrc!\n", pReqCopy->rc));
         rc = pReqCopy->rc;
     }
 
@@ -1987,7 +1966,7 @@ static int VBoxGuestCommonIOCtl_CtlFilterMask(PVBOXGUESTDEVEXT pDevExt,
     RTSpinlockAcquire(pDevExt->SessionSpinlock);
     pSession->fFilterMask |= pInfo->u32OrMask;
     pSession->fFilterMask &= ~pInfo->u32NotMask;
-    RTSpinlockReleaseNoInts(pDevExt->SessionSpinlock);
+    RTSpinlockRelease(pDevExt->SessionSpinlock);
     rc = vboxGuestUpdateHostFlags(pDevExt, pSession, HostFlags_FilterMask);
     return rc;
 }
@@ -2005,7 +1984,7 @@ static int VBoxGuestCommonIOCtl_SetCapabilities(PVBOXGUESTDEVEXT pDevExt,
     RTSpinlockAcquire(pDevExt->SessionSpinlock);
     pSession->fCapabilities |= pInfo->u32OrMask;
     pSession->fCapabilities &= ~pInfo->u32NotMask;
-    RTSpinlockReleaseNoInts(pDevExt->SessionSpinlock);
+    RTSpinlockRelease(pDevExt->SessionSpinlock);
     rc = vboxGuestUpdateHostFlags(pDevExt, pSession, HostFlags_Capabilities);
     return rc;
 }
@@ -2034,7 +2013,7 @@ static int vboxGuestCommonIOCtl_SetMouseStatus(PVBOXGUESTDEVEXT pDevExt,
     fFeatures ^= VMMDEV_MOUSE_GUEST_NEEDS_HOST_CURSOR;
     RTSpinlockAcquire(pDevExt->SessionSpinlock);
     pSession->fMouseStatus = fFeatures;
-    RTSpinlockReleaseNoInts(pDevExt->SessionSpinlock);
+    RTSpinlockRelease(pDevExt->SessionSpinlock);
     rc = vboxGuestUpdateHostFlags(pDevExt, pSession, HostFlags_MouseStatus);
     return rc;
 }
@@ -2062,10 +2041,10 @@ static int VBoxGuestHGCMAsyncWaitCallbackWorker(VMMDevHGCMRequestHeader volatile
         RTSpinlockAcquire(pDevExt->EventSpinlock);
         if ((pHdr->fu32Flags & VBOX_HGCM_REQ_DONE) != 0)
         {
-            RTSpinlockReleaseNoInts(pDevExt->EventSpinlock);
+            RTSpinlockRelease(pDevExt->EventSpinlock);
             return VINF_SUCCESS;
         }
-        RTSpinlockReleaseNoInts(pDevExt->EventSpinlock);
+        RTSpinlockRelease(pDevExt->EventSpinlock);
 
         pWait = VBoxGuestWaitAlloc(pDevExt, NULL);
         if (pWait)
@@ -2087,10 +2066,10 @@ static int VBoxGuestHGCMAsyncWaitCallbackWorker(VMMDevHGCMRequestHeader volatile
     if ((pHdr->fu32Flags & VBOX_HGCM_REQ_DONE) != 0)
     {
         VBoxGuestWaitFreeLocked(pDevExt, pWait);
-        RTSpinlockReleaseNoInts(pDevExt->EventSpinlock);
+        RTSpinlockRelease(pDevExt->EventSpinlock);
         return VINF_SUCCESS;
     }
-    RTSpinlockReleaseNoInts(pDevExt->EventSpinlock);
+    RTSpinlockRelease(pDevExt->EventSpinlock);
 
     if (fInterruptible)
         rc = RTSemEventMultiWaitNoResume(pWait->Event, cMillies);
@@ -2106,7 +2085,7 @@ static int VBoxGuestHGCMAsyncWaitCallbackWorker(VMMDevHGCMRequestHeader volatile
         &&  rc != VERR_TIMEOUT
         &&  (    !fInterruptible
              ||  rc != VERR_INTERRUPTED))
-        LogRelFlow(("wait failed! %Rrc\n", rc));
+        LogRel(("VBoxGuestHGCMAsyncWaitCallback: wait failed! %Rrc\n", rc));
 
     VBoxGuestWaitFreeUnlocked(pDevExt, pWait);
     return rc;
@@ -2121,7 +2100,7 @@ static int VBoxGuestHGCMAsyncWaitCallbackWorker(VMMDevHGCMRequestHeader volatile
 static DECLCALLBACK(int) VBoxGuestHGCMAsyncWaitCallback(VMMDevHGCMRequestHeader *pHdr, void *pvUser, uint32_t u32User)
 {
     PVBOXGUESTDEVEXT pDevExt = (PVBOXGUESTDEVEXT)pvUser;
-    LogFlowFunc(("requestType=%d\n", pHdr->header.requestType));
+    LogFlow(("VBoxGuestHGCMAsyncWaitCallback: requestType=%d\n", pHdr->header.requestType));
     return VBoxGuestHGCMAsyncWaitCallbackWorker((VMMDevHGCMRequestHeader volatile *)pHdr,
                                                 pDevExt,
                                                 false /* fInterruptible */,
@@ -2138,7 +2117,7 @@ static DECLCALLBACK(int) VBoxGuestHGCMAsyncWaitCallbackInterruptible(VMMDevHGCMR
                                                                       void *pvUser, uint32_t u32User)
 {
     PVBOXGUESTDEVEXT pDevExt = (PVBOXGUESTDEVEXT)pvUser;
-    LogFlowFunc(("requestType=%d\n", pHdr->header.requestType));
+    LogFlow(("VBoxGuestHGCMAsyncWaitCallbackInterruptible: requestType=%d\n", pHdr->header.requestType));
     return VBoxGuestHGCMAsyncWaitCallbackWorker((VMMDevHGCMRequestHeader volatile *)pHdr,
                                                 pDevExt,
                                                 true /* fInterruptible */,
@@ -2157,15 +2136,15 @@ static int VBoxGuestCommonIOCtl_HGCMConnect(PVBOXGUESTDEVEXT pDevExt, PVBOXGUEST
      * call is performed in an ASYNC fashion. The function is not able
      * to deal with cancelled requests.
      */
-    LogFlowFunc(("%.128s\n",
-                   pInfo->Loc.type == VMMDevHGCMLoc_LocalHost || pInfo->Loc.type == VMMDevHGCMLoc_LocalHost_Existing
-                 ? pInfo->Loc.u.host.achName : "<not local host>"));
+    Log(("VBoxGuestCommonIOCtl: HGCM_CONNECT: %.128s\n",
+         pInfo->Loc.type == VMMDevHGCMLoc_LocalHost || pInfo->Loc.type == VMMDevHGCMLoc_LocalHost_Existing
+         ? pInfo->Loc.u.host.achName : "<not local host>"));
 
     rc = VbglR0HGCMInternalConnect(pInfo, VBoxGuestHGCMAsyncWaitCallback, pDevExt, RT_INDEFINITE_WAIT);
     if (RT_SUCCESS(rc))
     {
-        LogFlowFunc(("u32Client=%RX32 result=%Rrc (rc=%Rrc)\n",
-                     pInfo->u32ClientID, pInfo->result, rc));
+        Log(("VBoxGuestCommonIOCtl: HGCM_CONNECT: u32Client=%RX32 result=%Rrc (rc=%Rrc)\n",
+             pInfo->u32ClientID, pInfo->result, rc));
         if (RT_SUCCESS(pInfo->result))
         {
             /*
@@ -2180,15 +2159,11 @@ static int VBoxGuestCommonIOCtl_HGCMConnect(PVBOXGUESTDEVEXT pDevExt, PVBOXGUEST
                     pSession->aHGCMClientIds[i] = pInfo->u32ClientID;
                     break;
                 }
-            RTSpinlockReleaseNoInts(pDevExt->SessionSpinlock);
+            RTSpinlockRelease(pDevExt->SessionSpinlock);
             if (i >= RT_ELEMENTS(pSession->aHGCMClientIds))
             {
-                static unsigned             s_cErrors = 0;
                 VBoxGuestHGCMDisconnectInfo Info;
-
-                if (s_cErrors++ < 32)
-                    LogRelFunc(("Too many HGCMConnect calls for one session\n"));
-
+                LogRelMax(32, ("VBoxGuestCommonIOCtl: HGCM_CONNECT: too many HGCMConnect calls for one session!\n"));
                 Info.result = 0;
                 Info.u32ClientID = pInfo->u32ClientID;
                 VbglR0HGCMInternalDisconnect(&Info, VBoxGuestHGCMAsyncWaitCallback, pDevExt, RT_INDEFINITE_WAIT);
@@ -2220,12 +2195,10 @@ static int VBoxGuestCommonIOCtl_HGCMDisconnect(PVBOXGUESTDEVEXT pDevExt, PVBOXGU
             pSession->aHGCMClientIds[i] = UINT32_MAX;
             break;
         }
-    RTSpinlockReleaseNoInts(pDevExt->SessionSpinlock);
+    RTSpinlockRelease(pDevExt->SessionSpinlock);
     if (i >= RT_ELEMENTS(pSession->aHGCMClientIds))
     {
-        static unsigned s_cErrors = 0;
-        if (s_cErrors++ > 32)
-            LogRelFunc(("u32Client=%RX32\n", u32ClientId));
+        LogRelMax(32, ("VBoxGuestCommonIOCtl: HGCM_DISCONNECT: u32Client=%RX32\n", u32ClientId));
         return VERR_INVALID_HANDLE;
     }
 
@@ -2234,11 +2207,11 @@ static int VBoxGuestCommonIOCtl_HGCMDisconnect(PVBOXGUESTDEVEXT pDevExt, PVBOXGU
      * call is performed in an ASYNC fashion. The function is not able
      * to deal with cancelled requests.
      */
-    LogFlowFunc(("u32Client=%RX32\n", pInfo->u32ClientID));
+    Log(("VBoxGuestCommonIOCtl: HGCM_DISCONNECT: u32Client=%RX32\n", pInfo->u32ClientID));
     rc = VbglR0HGCMInternalDisconnect(pInfo, VBoxGuestHGCMAsyncWaitCallback, pDevExt, RT_INDEFINITE_WAIT);
     if (RT_SUCCESS(rc))
     {
-        LogFlowFunc(("Disconnected with rc=%Rrc\n", pInfo->result)); /** int32_t vs. int! */
+        LogFlow(("VBoxGuestCommonIOCtl: HGCM_DISCONNECT: result=%Rrc\n", pInfo->result));
         if (pcbDataReturned)
             *pcbDataReturned = sizeof(*pInfo);
     }
@@ -2247,7 +2220,7 @@ static int VBoxGuestCommonIOCtl_HGCMDisconnect(PVBOXGUESTDEVEXT pDevExt, PVBOXGU
     RTSpinlockAcquire(pDevExt->SessionSpinlock);
     if (pSession->aHGCMClientIds[i] == UINT32_MAX)
         pSession->aHGCMClientIds[i] = RT_SUCCESS(rc) && RT_SUCCESS(pInfo->result) ? 0 : u32ClientId;
-    RTSpinlockReleaseNoInts(pDevExt->SessionSpinlock);
+    RTSpinlockRelease(pDevExt->SessionSpinlock);
 
     return rc;
 }
@@ -2270,7 +2243,7 @@ static int VBoxGuestCommonIOCtl_HGCMCall(PVBOXGUESTDEVEXT pDevExt,
      */
     if (pInfo->cParms > 4096) /* (Just make sure it doesn't overflow the next check.) */
     {
-        LogRelFunc(("cParm=%RX32 is not sane\n", pInfo->cParms));
+        LogRel(("VBoxGuestCommonIOCtl: HGCM_CALL: cParm=%RX32 is not sane\n", pInfo->cParms));
         return VERR_INVALID_PARAMETER;
     }
 
@@ -2283,8 +2256,8 @@ static int VBoxGuestCommonIOCtl_HGCMCall(PVBOXGUESTDEVEXT pDevExt,
         cbActual += pInfo->cParms * sizeof(HGCMFunctionParameter);
     if (cbData < cbActual)
     {
-        LogRelFunc(("cbData=%#zx (%zu) required size is %#zx (%zu)\n",
-                    cbData, cbData, cbActual, cbActual));
+        LogRel(("VBoxGuestCommonIOCtl: HGCM_CALL: cbData=%#zx (%zu) required size is %#zx (%zu)\n",
+               cbData, cbData, cbActual, cbActual));
         return VERR_INVALID_PARAMETER;
     }
 
@@ -2295,12 +2268,10 @@ static int VBoxGuestCommonIOCtl_HGCMCall(PVBOXGUESTDEVEXT pDevExt,
     for (i = 0; i < RT_ELEMENTS(pSession->aHGCMClientIds); i++)
         if (pSession->aHGCMClientIds[i] == u32ClientId)
             break;
-    RTSpinlockReleaseNoInts(pDevExt->SessionSpinlock);
+    RTSpinlockRelease(pDevExt->SessionSpinlock);
     if (RT_UNLIKELY(i >= RT_ELEMENTS(pSession->aHGCMClientIds)))
     {
-        static unsigned s_cErrors = 0;
-        if (s_cErrors++ > 32)
-            LogRelFunc(("Invalid handle; u32Client=%RX32\n", u32ClientId));
+        LogRelMax(32, ("VBoxGuestCommonIOCtl: HGCM_CALL: Invalid handle. u32Client=%RX32\n", u32ClientId));
         return VERR_INVALID_HANDLE;
     }
 
@@ -2310,7 +2281,7 @@ static int VBoxGuestCommonIOCtl_HGCMCall(PVBOXGUESTDEVEXT pDevExt,
      * deal with cancelled requests, so we let user more requests
      * be interruptible (should add a flag for this later I guess).
      */
-    LogFlowFunc(("u32Client=%RX32\n", pInfo->u32ClientID));
+    LogFlow(("VBoxGuestCommonIOCtl: HGCM_CALL: u32Client=%RX32\n", pInfo->u32ClientID));
     fFlags = !fUserData && pSession->R0Process == NIL_RTR0PROCESS ? VBGLR0_HGCMCALL_F_KERNEL : VBGLR0_HGCMCALL_F_USER;
     uint32_t cbInfo = (uint32_t)(cbData - cbExtra);
 #ifdef RT_ARCH_AMD64
@@ -2331,7 +2302,7 @@ static int VBoxGuestCommonIOCtl_HGCMCall(PVBOXGUESTDEVEXT pDevExt,
     }
     if (RT_SUCCESS(rc))
     {
-        LogFlowFunc(("Result rc=%Rrc\n", pInfo->result)); /** int32_t vs. int! */
+        LogFlow(("VBoxGuestCommonIOCtl: HGCM_CALL: result=%Rrc\n", pInfo->result));
         if (pcbDataReturned)
             *pcbDataReturned = cbActual;
     }
@@ -2339,20 +2310,14 @@ static int VBoxGuestCommonIOCtl_HGCMCall(PVBOXGUESTDEVEXT pDevExt,
     {
         if (   rc != VERR_INTERRUPTED
             && rc != VERR_TIMEOUT)
-        {
-            static unsigned s_cErrors = 0;
-            if (s_cErrors++ < 32)
-                LogRelFunc(("%s-bit call failed; rc=%Rrc\n",
-                            f32bit ? "32" : "64", rc));
-        }
+            LogRelMax(32, ("VBoxGuestCommonIOCtl: HGCM_CALL: %s Failed. rc=%Rrc.\n", f32bit ? "32" : "64", rc));
         else
-            LogFlowFunc(("%s-bit call failed; rc=%Rrc\n",
-                         f32bit ? "32" : "64", rc));
+            Log(("VBoxGuestCommonIOCtl: HGCM_CALL: %s Failed. rc=%Rrc.\n", f32bit ? "32" : "64", rc));
     }
     return rc;
 }
-#endif /* VBOX_WITH_HGCM */
 
+#endif /* VBOX_WITH_HGCM */
 
 /**
  * Handle VBOXGUEST_IOCTL_CHECK_BALLOON from R3.
@@ -2372,9 +2337,11 @@ static int VBoxGuestCommonIOCtl_HGCMCall(PVBOXGUESTDEVEXT pDevExt,
 static int VBoxGuestCommonIOCtl_CheckMemoryBalloon(PVBOXGUESTDEVEXT pDevExt, PVBOXGUESTSESSION pSession,
                                                    VBoxGuestCheckBalloonInfo *pInfo, size_t *pcbDataReturned)
 {
-    LogFlowFuncEnter();
+    VMMDevGetMemBalloonChangeRequest *pReq;
+    int rc;
 
-    int rc = RTSemFastMutexRequest(pDevExt->MemBalloon.hMtx);
+    LogFlow(("VBoxGuestCommonIOCtl: CHECK_MEMORY_BALLOON\n"));
+    rc = RTSemFastMutexRequest(pDevExt->MemBalloon.hMtx);
     AssertRCReturn(rc, rc);
 
     /*
@@ -2383,15 +2350,11 @@ static int VBoxGuestCommonIOCtl_CheckMemoryBalloon(PVBOXGUESTDEVEXT pDevExt, PVB
      */
     if (   pDevExt->MemBalloon.pOwner != pSession
         && pDevExt->MemBalloon.pOwner == NULL)
-    {
         pDevExt->MemBalloon.pOwner = pSession;
-    }
 
     if (pDevExt->MemBalloon.pOwner == pSession)
     {
-        VMMDevGetMemBalloonChangeRequest *pReq;
-        rc = VbglGRAlloc((VMMDevRequestHeader **)&pReq, sizeof(VMMDevGetMemBalloonChangeRequest),
-                         VMMDevReq_GetMemBalloonChangeRequest);
+        rc = VbglGRAlloc((VMMDevRequestHeader **)&pReq, sizeof(VMMDevGetMemBalloonChangeRequest), VMMDevReq_GetMemBalloonChangeRequest);
         if (RT_SUCCESS(rc))
         {
             /*
@@ -2420,7 +2383,7 @@ static int VBoxGuestCommonIOCtl_CheckMemoryBalloon(PVBOXGUESTDEVEXT pDevExt, PVB
                     *pcbDataReturned = sizeof(VBoxGuestCheckBalloonInfo);
             }
             else
-                LogRelFunc(("VbglGRPerform failed; rc=%Rrc\n", rc));
+                LogRel(("VBoxGuestCommonIOCtl: CHECK_MEMORY_BALLOON: VbglGRPerform failed. rc=%Rrc\n", rc));
             VbglGRFree(&pReq->header);
         }
     }
@@ -2428,8 +2391,7 @@ static int VBoxGuestCommonIOCtl_CheckMemoryBalloon(PVBOXGUESTDEVEXT pDevExt, PVB
         rc = VERR_PERMISSION_DENIED;
 
     RTSemFastMutexRelease(pDevExt->MemBalloon.hMtx);
-
-    LogFlowFunc(("Returns %Rrc\n", rc));
+    LogFlow(("VBoxGuestCommonIOCtl: CHECK_MEMORY_BALLOON returns %Rrc\n", rc));
     return rc;
 }
 
@@ -2448,7 +2410,10 @@ static int VBoxGuestCommonIOCtl_CheckMemoryBalloon(PVBOXGUESTDEVEXT pDevExt, PVB
 static int VBoxGuestCommonIOCtl_ChangeMemoryBalloon(PVBOXGUESTDEVEXT pDevExt, PVBOXGUESTSESSION pSession,
                                                     VBoxGuestChangeBalloonInfo *pInfo, size_t *pcbDataReturned)
 {
-    int rc = RTSemFastMutexRequest(pDevExt->MemBalloon.hMtx);
+    int rc;
+
+    LogFlow(("VBoxGuestCommonIOCtl: CHANGE_BALLOON\n"));
+    rc = RTSemFastMutexRequest(pDevExt->MemBalloon.hMtx);
     AssertRCReturn(rc, rc);
 
     if (!pDevExt->MemBalloon.fUseKernelAPI)
@@ -2463,8 +2428,7 @@ static int VBoxGuestCommonIOCtl_ChangeMemoryBalloon(PVBOXGUESTDEVEXT pDevExt, PV
 
         if (pDevExt->MemBalloon.pOwner == pSession)
         {
-            rc = vboxGuestSetBalloonSizeFromUser(pDevExt, pSession, pInfo->u64ChunkAddr,
-                                                 !!pInfo->fInflate);
+            rc = vboxGuestSetBalloonSizeFromUser(pDevExt, pSession, pInfo->u64ChunkAddr, !!pInfo->fInflate);
             if (pcbDataReturned)
                 *pcbDataReturned = 0;
         }
@@ -2490,19 +2454,21 @@ static int VBoxGuestCommonIOCtl_ChangeMemoryBalloon(PVBOXGUESTDEVEXT pDevExt, PV
 static int VBoxGuestCommonIOCtl_WriteCoreDump(PVBOXGUESTDEVEXT pDevExt, VBoxGuestWriteCoreDump *pInfo)
 {
     VMMDevReqWriteCoreDump *pReq = NULL;
-    int rc = VbglGRAlloc((VMMDevRequestHeader **)&pReq, sizeof(VMMDevReqWriteCoreDump),
-                         VMMDevReq_WriteCoreDump);
+    int rc;
+
+    LogFlow(("VBoxGuestCommonIOCtl: WRITE_CORE_DUMP\n"));
+    rc = VbglGRAlloc((VMMDevRequestHeader **)&pReq, sizeof(*pReq), VMMDevReq_WriteCoreDump);
     if (RT_FAILURE(rc))
     {
-        LogFlowFunc(("Failed to allocate %u (%#x) bytes to cache the request; rc=%Rrc\n",
-                     sizeof(VMMDevReqWriteCoreDump), sizeof(VMMDevReqWriteCoreDump), rc));
+        Log(("VBoxGuestCommonIOCtl: WRITE_CORE_DUMP: failed to allocate %u (%#x) bytes to cache the request. rc=%Rrc!!\n",
+             sizeof(*pReq), sizeof(*pReq), rc));
         return rc;
     }
 
     pReq->fFlags = pInfo->fFlags;
     rc = VbglGRPerform(&pReq->header);
     if (RT_FAILURE(rc))
-        LogFlowFunc(("VbglGRPerform failed, rc=%Rrc\n", rc));
+        Log(("VBoxGuestCommonIOCtl: WRITE_CORE_DUMP: VbglGRPerform failed, rc=%Rrc!\n", rc));
 
     VbglGRFree(&pReq->header);
     return rc;
@@ -2535,6 +2501,7 @@ static int VBoxGuestCommonIOCtl_Log(PVBOXGUESTDEVEXT pDevExt, const char *pch, s
     return VINF_SUCCESS;
 }
 
+
 static bool VBoxGuestCommonGuestCapsValidateValues(uint32_t fCaps)
 {
     if (fCaps & (~(VMMDEV_GUEST_SUPPORTS_SEAMLESS | VMMDEV_GUEST_SUPPORTS_GUEST_HOST_WINDOW_MAPPING | VMMDEV_GUEST_SUPPORTS_GRAPHICS)))
@@ -2543,6 +2510,7 @@ static bool VBoxGuestCommonGuestCapsValidateValues(uint32_t fCaps)
     return true;
 }
 
+
 /** Check whether any unreported VMM device events should be reported to any of
  * the currently listening sessions.  In addition, report any events in
  * @a fGenFakeEvents.
@@ -2585,7 +2553,7 @@ static void VBoxGuestCommonCheckEvents(PVBOXGUESTDEVEXT pDevExt, PVBOXGUESTSESSI
     }
     ASMAtomicWriteU32(&pDevExt->f32PendingEvents, fEvents);
 
-    RTSpinlockReleaseNoInts(pDevExt->EventSpinlock);
+    RTSpinlockRelease(pDevExt->EventSpinlock);
 
 #ifdef VBOXGUEST_USE_DEFERRED_WAKE_UP
     VBoxGuestWaitDoWakeUps(pDevExt);
@@ -2602,30 +2570,30 @@ static int VBoxGuestCommonGuestCapsAcquire(PVBOXGUESTDEVEXT pDevExt, PVBOXGUESTS
 
     if (!VBoxGuestCommonGuestCapsValidateValues(fOrMask))
     {
-        LogRelFunc(("pSession(0x%p), OR(0x%x), NOT(0x%x), flags(0x%x) -- invalid fOrMask\n",
-                    pSession, fOrMask, fNotMask, enmFlags));
+        LogRel(("VBoxGuestCommonGuestCapsAcquire: pSession(0x%p), OR(0x%x), NOT(0x%x), flags(0x%x) -- invalid fOrMask\n",
+                pSession, fOrMask, fNotMask, enmFlags));
         return VERR_INVALID_PARAMETER;
     }
 
     if (   enmFlags != VBOXGUESTCAPSACQUIRE_FLAGS_CONFIG_ACQUIRE_MODE
         && enmFlags != VBOXGUESTCAPSACQUIRE_FLAGS_NONE)
     {
-        LogRelFunc(("pSession(0x%p), OR(0x%x), NOT(0x%x), flags(0x%x) -- invalid enmFlags %d\n",
-                    pSession, fOrMask, fNotMask, enmFlags));
+        LogRel(("VBoxGuestCommonGuestCapsAcquire: pSession(0x%p), OR(0x%x), NOT(0x%x), flags(0x%x) -- invalid enmFlags %d\n",
+                pSession, fOrMask, fNotMask, enmFlags));
         return VERR_INVALID_PARAMETER;
     }
 
     if (!VBoxGuestCommonGuestCapsModeSet(pDevExt, fOrMask, true, &fSetCaps))
     {
-        LogRelFunc(("pSession(0x%p), OR(0x%x), NOT(0x%x), flags(0x%x) -- calling caps acquire for set caps\n",
-                    pSession, fOrMask, fNotMask, enmFlags));
+        LogRel(("VBoxGuestCommonGuestCapsAcquire: pSession(0x%p), OR(0x%x), NOT(0x%x), flags(0x%x) -- calling caps acquire for set caps\n",
+                pSession, fOrMask, fNotMask, enmFlags));
         return VERR_INVALID_STATE;
     }
 
     if (enmFlags & VBOXGUESTCAPSACQUIRE_FLAGS_CONFIG_ACQUIRE_MODE)
     {
-        LogRelFunc(("pSession(0x%p), OR(0x%x), NOT(0x%x), flags(0x%x) -- configured acquire caps: 0x%x\n",
-                    pSession, fOrMask, fNotMask, enmFlags));
+        Log(("VBoxGuestCommonGuestCapsAcquire: pSession(0x%p), OR(0x%x), NOT(0x%x), flags(0x%x) -- configured acquire caps: 0x%x\n",
+             pSession, fOrMask, fNotMask, enmFlags));
         return VINF_SUCCESS;
     }
 
@@ -2661,11 +2629,11 @@ static int VBoxGuestCommonGuestCapsAcquire(PVBOXGUESTDEVEXT pDevExt, PVBOXGUESTS
         }
     }
 
-    RTSpinlockReleaseNoInts(pDevExt->EventSpinlock);
+    RTSpinlockRelease(pDevExt->EventSpinlock);
 
     if (fOtherConflictingCaps)
     {
-        LogFlowFunc(("Caps 0x%x were busy\n", fOtherConflictingCaps));
+        Log(("VBoxGuestCommonGuestCapsAcquire: Caps 0x%x were busy\n", fOtherConflictingCaps));
         return VERR_RESOURCE_BUSY;
     }
 
@@ -2679,7 +2647,7 @@ static int VBoxGuestCommonGuestCapsAcquire(PVBOXGUESTDEVEXT pDevExt, PVBOXGUESTS
     int rc = VBoxGuestSetGuestCapabilities(fSessionOrCaps, fSessionNotCaps);
     if (RT_FAILURE(rc))
     {
-        LogRelFunc(("VBoxGuestSetGuestCapabilities failed, rc=%Rrc\n", rc));
+        LogRel(("VBoxGuestCommonGuestCapsAcquire: VBoxGuestSetGuestCapabilities failed, rc=%Rrc\n", rc));
 
         /* Failure branch
          * this is generally bad since e.g. failure to release the caps may result in other sessions not being able to use it
@@ -2706,11 +2674,12 @@ static int VBoxGuestCommonGuestCapsAcquire(PVBOXGUESTDEVEXT pDevExt, PVBOXGUESTS
     return VINF_SUCCESS;
 }
 
+
 static int VBoxGuestCommonIOCTL_GuestCapsAcquire(PVBOXGUESTDEVEXT pDevExt, PVBOXGUESTSESSION pSession, VBoxGuestCapsAquire *pAcquire)
 {
     int rc = VBoxGuestCommonGuestCapsAcquire(pDevExt, pSession, pAcquire->u32OrMask, pAcquire->u32NotMask, pAcquire->enmFlags);
     if (RT_FAILURE(rc))
-        LogRelFunc(("Failed, rc=%Rrc\n", rc));
+        LogRel(("VBoxGuestCommonIOCtl: GUEST_CAPS_ACQUIRE failed rc=%Rrc\n", rc));
     pAcquire->rc = rc;
     return VINF_SUCCESS;
 }
@@ -2735,8 +2704,8 @@ int VBoxGuestCommonIOCtl(unsigned iFunction, PVBOXGUESTDEVEXT pDevExt, PVBOXGUES
                          void *pvData, size_t cbData, size_t *pcbDataReturned)
 {
     int rc;
-    LogFlowFunc(("iFunction=%#x, pDevExt=%p, pSession=%p, pvData=%p, cbData=%zu\n",
-                 iFunction, pDevExt, pSession, pvData, cbData));
+    LogFlow(("VBoxGuestCommonIOCtl: iFunction=%#x pDevExt=%p pSession=%p pvData=%p cbData=%zu\n",
+             iFunction, pDevExt, pSession, pvData, cbData));
 
     /*
      * Make sure the returned data size is set to zero.
@@ -2947,15 +2916,15 @@ int VBoxGuestCommonIOCtl(unsigned iFunction, PVBOXGUESTDEVEXT pDevExt, PVBOXGUES
 
             default:
             {
-                LogRelFunc(("Unknown request iFunction=%#x, stripped size=%#x\n",
-                            iFunction, VBOXGUEST_IOCTL_STRIP_SIZE(iFunction)));
+                LogRel(("VBoxGuestCommonIOCtl: Unknown request iFunction=%#x stripped size=%#x\n",
+                        iFunction, VBOXGUEST_IOCTL_STRIP_SIZE(iFunction)));
                 rc = VERR_NOT_SUPPORTED;
                 break;
             }
         }
     }
 
-    LogFlowFunc(("Returning %Rrc *pcbDataReturned=%zu\n", rc, pcbDataReturned ? *pcbDataReturned : 0));
+    LogFlow(("VBoxGuestCommonIOCtl: returns %Rrc *pcbDataReturned=%zu\n", rc, pcbDataReturned ? *pcbDataReturned : 0));
     return rc;
 }
 
@@ -3004,9 +2973,8 @@ bool VBoxGuestCommonISR(PVBOXGUESTDEVEXT pDevExt)
             PVBOXGUESTWAIT  pWait;
             PVBOXGUESTWAIT  pSafe;
 
-#ifndef DEBUG_andy
-            LogFlowFunc(("Acknowledge events succeeded: %#RX32\n", fEvents));
-#endif
+            Log3(("VBoxGuestCommonISR: acknowledge events succeeded %#RX32\n", fEvents));
+
             /*
              * VMMDEV_EVENT_MOUSE_POSITION_CHANGED can only be polled for.
              */
@@ -3016,8 +2984,7 @@ bool VBoxGuestCommonISR(PVBOXGUESTDEVEXT pDevExt)
                 fEvents &= ~VMMDEV_EVENT_MOUSE_POSITION_CHANGED;
 #ifndef RT_OS_WINDOWS
                 if (pDevExt->MouseNotifyCallback.pfnNotify)
-                    pDevExt->MouseNotifyCallback.pfnNotify
-                                          (pDevExt->MouseNotifyCallback.pvUser);
+                    pDevExt->MouseNotifyCallback.pfnNotify(pDevExt->MouseNotifyCallback.pvUser);
 #endif
             }
 
@@ -3071,15 +3038,13 @@ bool VBoxGuestCommonISR(PVBOXGUESTDEVEXT pDevExt)
             ASMAtomicWriteU32(&pDevExt->f32PendingEvents, fEvents);
         }
         else /* something is serious wrong... */
-            LogFlowFunc(("Acknowledging events failed, rc=%Rrc (events=%#x)\n",
-                         pReq->header.rc, pReq->events));
+            Log(("VBoxGuestCommonISR: acknowledge events failed rc=%Rrc (events=%#x)!!\n",
+                 pReq->header.rc, pReq->events));
     }
-#ifndef DEBUG_andy
     else
-        LogFlowFunc(("Not ours\n"));
-#endif
+        Log3(("VBoxGuestCommonISR: not ours\n"));
 
-    RTSpinlockReleaseNoInts(pDevExt->EventSpinlock);
+    RTSpinlockRelease(pDevExt->EventSpinlock);
 
 #if defined(VBOXGUEST_USE_DEFERRED_WAKE_UP) && !defined(RT_OS_WINDOWS)
     /*
diff --git a/src/VBox/Additions/common/VBoxGuest/VBoxGuestInternal.h b/src/VBox/Additions/common/VBoxGuest/VBoxGuestInternal.h
index 79bdc74..f681f40 100644
--- a/src/VBox/Additions/common/VBoxGuest/VBoxGuestInternal.h
+++ b/src/VBox/Additions/common/VBoxGuest/VBoxGuestInternal.h
@@ -185,10 +185,6 @@ typedef VBOXGUESTDEVEXT *PVBOXGUESTDEVEXT;
 
 /**
  * The VBoxGuest per session data.
- *
- * @remark  Not quite sure whether this will be useful or not, but since
- *          its already there let's keep it for now in case it might come
- *          in handy later.
  */
 typedef struct VBOXGUESTSESSION
 {
diff --git a/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibSharedFolders.cpp b/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibSharedFolders.cpp
index 776af7b..2516220 100644
--- a/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibSharedFolders.cpp
+++ b/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibSharedFolders.cpp
@@ -244,12 +244,11 @@ VBGLR3DECL(int) VbglR3SharedFolderGetName(uint32_t u32ClientId, uint32_t u32Root
     Msg.callInfo.cParms = 2;
 
     int         rc;
-    uint32_t    cbString = sizeof(SHFLSTRING) + SHFL_MAX_LEN;
+    uint32_t    cbString = SHFLSTRING_HEADER_SIZE + SHFL_MAX_LEN;
     PSHFLSTRING pString = (PSHFLSTRING)RTMemAlloc(cbString);
     if (pString)
     {
-        RT_ZERO(*pString);
-        if (!ShflStringInitBuffer(pString, SHFL_MAX_LEN))
+        if (!ShflStringInitBuffer(pString, cbString))
         {
             RTMemFree(pString);
             return VERR_INVALID_PARAMETER;
diff --git a/src/VBox/Additions/linux/sharedfolders/utils.c b/src/VBox/Additions/linux/sharedfolders/utils.c
index 674af7a..1b72bd0 100644
--- a/src/VBox/Additions/linux/sharedfolders/utils.c
+++ b/src/VBox/Additions/linux/sharedfolders/utils.c
@@ -98,7 +98,10 @@ void sf_init_inode(struct sf_glob_info *sf_g, struct inode *inode,
 
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0)
     inode->i_mapping->a_ops = &sf_reg_aops;
+# if LINUX_VERSION_CODE <= KERNEL_VERSION(3, 19, 0)
+    /* XXX Was this ever necessary? */
     inode->i_mapping->backing_dev_info = &sf_g->bdi;
+# endif
 #endif
 
     if (RTFS_IS_DIRECTORY(attr->fMode))
@@ -863,12 +866,12 @@ struct dentry_operations sf_dentry_ops =
 int sf_init_backing_dev(struct sf_glob_info *sf_g)
 {
     int rc = 0;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0) && LINUX_VERSION_CODE <= KERNEL_VERSION(3, 19, 0)
     /* Each new shared folder map gets a new uint64_t identifier,
      * allocated in sequence.  We ASSUME the sequence will not wrap. */
     static uint64_t s_u64Sequence = 0;
     uint64_t u64CurrentSequence = ASMAtomicIncU64(&s_u64Sequence);
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0)
     sf_g->bdi.ra_pages = 0; /* No readahead */
 # if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 12)
     sf_g->bdi.capabilities  = BDI_CAP_MAP_DIRECT    /* MAP_SHARED */
@@ -885,13 +888,13 @@ int sf_init_backing_dev(struct sf_glob_info *sf_g)
                           (unsigned long long)u64CurrentSequence);
 #  endif /* >= 2.6.26 */
 # endif /* >= 2.6.24 */
-#endif /* >= 2.6.0 */
+#endif /* >= 2.6.0 && <= 3.19.0 */
     return rc;
 }
 
 void sf_done_backing_dev(struct sf_glob_info *sf_g)
 {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 24)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 24) && LINUX_VERSION_CODE <= KERNEL_VERSION(3, 19, 0)
     bdi_destroy(&sf_g->bdi); /* includes bdi_unregister() */
 #endif
 }
diff --git a/src/VBox/Additions/solaris/Installer/postinstall.sh b/src/VBox/Additions/solaris/Installer/postinstall.sh
index 9ddd152..6e3fffb 100755
--- a/src/VBox/Additions/solaris/Installer/postinstall.sh
+++ b/src/VBox/Additions/solaris/Installer/postinstall.sh
@@ -241,8 +241,26 @@ if test ! -z "$xorgbin"; then
                 rm -f $vboxadditions_path/$xorgconf_unfit
             fi
 
-            # Adjust xorg.conf with video driver sections
-            $vboxadditions_path/x11config15sol.pl
+            # Check for VirtualBox graphics card
+            is_vboxgraphics=`prtconf -d | grep -i pci80ee,beef`
+            if test "$?" -eq 0; then
+                drivername="vboxvideo"
+            else
+                # Check for VMware graphics card
+                is_vmwaregraphics=`prtconf -d | grep -i pci15ad,405`
+                if test "$?" -eq 0; then
+                    echo "Configuring X.Org to use VMware SVGA graphics driver..."
+                    drivername="vmware"
+                fi
+            fi
+
+            # Adjust xorg.conf with video driver sections if a supported graphics card is found
+            if test ! -z "$drivername"; then
+                $vboxadditions_path/x11config15sol.pl "$drivername"
+            else
+                # No supported graphics card found, do nothing.
+                echo "## No supported graphics card found. Skipped configuring of X.org drivers."
+            fi
         fi
     fi
 
diff --git a/src/VBox/Additions/x11/Installer/x11config15sol.pl b/src/VBox/Additions/x11/Installer/x11config15sol.pl
index c76e350..8981251 100755
--- a/src/VBox/Additions/x11/Installer/x11config15sol.pl
+++ b/src/VBox/Additions/x11/Installer/x11config15sol.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -w
+#!/usr/bin/perl
 #
 # Guest Additions X11 config update script
 #
@@ -13,21 +13,36 @@
 # hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
 #
 
+use strict;
+use warnings;
+
 my $temp="/tmp/xorg.conf";
 my $os_type=`uname -s`;
-my @cfg_files = ("/etc/X11/xorg.conf-4", "/etc/X11/xorg.conf", "/etc/X11/.xorg.conf", "/etc/xorg.conf",
+my @cfg_files = ("/etc/X11/xorg.conf", "/etc/X11/.xorg.conf", "/etc/X11/xorg.conf-4", "/etc/xorg.conf",
                  "/usr/etc/X11/xorg.conf-4", "/usr/etc/X11/xorg.conf", "/usr/lib/X11/xorg.conf-4",
                  "/usr/lib/X11/xorg.conf", "/etc/X11/XF86Config-4", "/etc/X11/XF86Config",
                  "/etc/XF86Config", "/usr/X11R6/etc/X11/XF86Config-4", "/usr/X11R6/etc/X11/XF86Config",
                  "/usr/X11R6/lib/X11/XF86Config-4", "/usr/X11R6/lib/X11/XF86Config");
+
+## @todo: r=ramshankar: Hmm, why do we use the same variable name with upper/lower case for different variables?
+my $cfg;
 my $CFG;
 my $TMP;
-
+my $line;
 my $config_count = 0;
 
-foreach $cfg (@cfg_files)
+# Command line options
+if ($#ARGV < 0)
 {
+   die "x11config15sol.pl: Missing driver name argument to configure for X.org";
+}
+my $driver_name = $ARGV[0];
 
+# Loop through all possible config files and change them. It's done this wasy for hysterical raisins
+# as we didn't know what the correct config file is so we update all of them. However, for Solaris it's
+# most likely -only- one of the 2 config files (/etc/X11/xorg.conf, /etc/X11/.xorg.conf).
+foreach $cfg (@cfg_files)
+{
     if (open(CFG, $cfg))
     {
         open(TMP, ">$temp") or die "Can't create $TMP: $!\n";
@@ -43,7 +58,9 @@ foreach $cfg (@cfg_files)
                 {
                     $in_section = 1;
                 }
-            } else {
+            }
+			else
+		    {
                 if ($line =~ /^\s*EndSection/i)
                 {
                     $in_section = 0;
@@ -54,7 +71,7 @@ foreach $cfg (@cfg_files)
             {
                 if ($line =~ /^\s*driver\s+\"(?:fbdev|vga|vesa|vboxvideo|ChangeMe)\"/i)
                 {
-                    $line = "    Driver      \"vboxvideo\"\n";
+                    $line = "    Driver      \"$driver_name\"\n";
                 }
             }
             print TMP $line;
@@ -77,3 +94,4 @@ foreach $cfg (@cfg_files)
 }
 
 $config_count != 0 or die "Could not find any X11 configuration files";
+
diff --git a/src/VBox/Additions/x11/VBoxClient/VBoxClient.h b/src/VBox/Additions/x11/VBoxClient/VBoxClient.h
index f52522f..2ca8f1d 100644
--- a/src/VBox/Additions/x11/VBoxClient/VBoxClient.h
+++ b/src/VBox/Additions/x11/VBoxClient/VBoxClient.h
@@ -31,7 +31,7 @@ do { \
 } while(0)
 
 /** Exit with a fatal error. */
-extern void vbclFatalError(char *pszMessage);
+extern DECLNORETURN(void) vbclFatalError(char *pszMessage);
 
 /** Call clean-up for the current service and exit. */
 extern void VBClCleanUp();
diff --git a/src/VBox/Additions/x11/VBoxClient/display.cpp b/src/VBox/Additions/x11/VBoxClient/display.cpp
index 534bfeb..b637c65 100644
--- a/src/VBox/Additions/x11/VBoxClient/display.cpp
+++ b/src/VBox/Additions/x11/VBoxClient/display.cpp
@@ -173,7 +173,7 @@ static void updateScreenInformation(struct DISPLAYSTATE *pState, unsigned cx, un
 
 static void updateSizeHintsProperty(struct DISPLAYSTATE *pState)
 {
-    int32_t *paSizeHints = (int32_t *)RTMemTmpAllocZ(pState->cScreensTracked * sizeof(int32_t));
+    long *paSizeHints = (long *)RTMemTmpAllocZ(pState->cScreensTracked * sizeof(long));
     unsigned i;
 
     if (paSizeHints == NULL)
diff --git a/src/VBox/Additions/x11/VBoxClient/main.cpp b/src/VBox/Additions/x11/VBoxClient/main.cpp
index b07d833..2b071ac 100644
--- a/src/VBox/Additions/x11/VBoxClient/main.cpp
+++ b/src/VBox/Additions/x11/VBoxClient/main.cpp
@@ -68,8 +68,7 @@ void vbclFatalError(char *pszMessage)
     char *pszCommand;
     if (pszMessage && cRespawn == 0)
     {
-        pszCommand = RTStrAPrintf2("notify-send -t 5 \"VBoxClient: %s\"",
-                                   pszMessage);
+        pszCommand = RTStrAPrintf2("notify-send \"VBoxClient: %s\"", pszMessage);
         if (pszCommand)
             system(pszCommand);
     }
diff --git a/src/VBox/Additions/x11/vboxmouse/Makefile.kmk b/src/VBox/Additions/x11/vboxmouse/Makefile.kmk
index 6a3b0d1..e53ea79 100644
--- a/src/VBox/Additions/x11/vboxmouse/Makefile.kmk
+++ b/src/VBox/Additions/x11/vboxmouse/Makefile.kmk
@@ -159,7 +159,6 @@ ifneq ($(KBUILD_TARGET), linux)
 DLLS += vboxmouse_drv_17
 vboxmouse_drv_17_TEMPLATE = VBOXGUESTR3XORGMOD
 vboxmouse_drv_17_DEFS := $(vboxmouse_drv_70_DEFS) NO_ANSIC
-## @todo replace $(VBOX_PATH_X11_ROOT)/xorg-server-1.6.0-local
 vboxmouse_drv_17_INCS := \
 	$(vboxmouse_xorg_INCS) \
 	$(VBOX_PATH_X11_ROOT)/xorg-server-1.7.7 \
@@ -174,7 +173,6 @@ vboxmouse_drv_17_SOURCES = \
 DLLS += vboxmouse_drv_18
 vboxmouse_drv_18_TEMPLATE = VBOXGUESTR3XORGMOD
 vboxmouse_drv_18_DEFS := $(vboxmouse_drv_70_DEFS) NO_ANSIC
-## @todo replace $(VBOX_PATH_X11_ROOT)/xorg-server-1.6.0-local
 vboxmouse_drv_18_INCS := \
 	$(vboxmouse_xorg_INCS) \
 	$(VBOX_PATH_X11_ROOT)/xorg-server-1.8.0 \
@@ -189,7 +187,6 @@ vboxmouse_drv_18_SOURCES = \
 DLLS += vboxmouse_drv_19
 vboxmouse_drv_19_TEMPLATE = VBOXGUESTR3XORGMOD
 vboxmouse_drv_19_DEFS := $(vboxmouse_drv_70_DEFS) NO_ANSIC
-## @todo replace $(VBOX_PATH_X11_ROOT)/xorg-server-1.6.0-local
 vboxmouse_drv_19_INCS := \
 	$(vboxmouse_xorg_INCS) \
 	$(VBOX_PATH_X11_ROOT)/xorg-server-1.9.0 \
@@ -204,7 +201,6 @@ vboxmouse_drv_19_SOURCES = \
 DLLS += vboxmouse_drv_110
 vboxmouse_drv_110_TEMPLATE = VBOXGUESTR3XORGMOD
 vboxmouse_drv_110_DEFS := $(vboxmouse_drv_70_DEFS) NO_ANSIC
-## @todo replace $(VBOX_PATH_X11_ROOT)/xorg-server-1.6.0-local
 vboxmouse_drv_110_INCS := \
 	$(vboxmouse_xorg_INCS) \
 	$(VBOX_PATH_X11_ROOT)/xorg-server-1.10.0 \
@@ -215,7 +211,6 @@ vboxmouse_drv_110_SOURCES = \
 DLLS += vboxmouse_drv_111
 vboxmouse_drv_111_TEMPLATE = VBOXGUESTR3XORGMOD
 vboxmouse_drv_111_DEFS := $(vboxmouse_drv_70_DEFS) NO_ANSIC
-## @todo replace $(VBOX_PATH_X11_ROOT)/xorg-server-1.6.0-local
 vboxmouse_drv_111_INCS := \
 	$(vboxmouse_xorg_INCS) \
 	$(VBOX_PATH_X11_ROOT)/xorg-server-1.11.0 \
@@ -226,7 +221,6 @@ vboxmouse_drv_111_SOURCES = \
 DLLS += vboxmouse_drv_112
 vboxmouse_drv_112_TEMPLATE = VBOXGUESTR3XORGMOD
 vboxmouse_drv_112_DEFS := $(vboxmouse_drv_70_DEFS) NO_ANSIC
-## @todo replace $(VBOX_PATH_X11_ROOT)/xorg-server-1.6.0-local
 vboxmouse_drv_112_INCS := \
     $(vboxmouse_xorg_INCS) \
 	$(VBOX_PATH_X11_ROOT)/xorg-server-1.12.0 \
diff --git a/src/VBox/Additions/x11/vboxvideo/Makefile.kmk b/src/VBox/Additions/x11/vboxvideo/Makefile.kmk
index 592d65e..6cdf46b 100644
--- a/src/VBox/Additions/x11/vboxvideo/Makefile.kmk
+++ b/src/VBox/Additions/x11/vboxvideo/Makefile.kmk
@@ -130,7 +130,7 @@ vboxvideo_drv_SOURCES = \
 #
 DLLS += vboxvideo_drv_70
 vboxvideo_drv_70_TEMPLATE = VBOXGUESTR3XORGMOD
-vboxvideo_drv_70_DEFS = $(vboxvideo_70_DEFS) XORG_VERSION_CURRENT=700000000
+vboxvideo_drv_70_DEFS = $(vboxvideo_70_DEFS) XORG_VERSION_CURRENT=70000000
 ifeq ($(KBUILD_TARGET),solaris) # don't use .solaris or anything here.
  vboxvideo_drv_70_CFLAGS += -D_XPG6 -Wno-shadow # Use XPG6 until we have moved the C++ bits into a library.
 endif
@@ -147,7 +147,7 @@ vboxvideo_drv_70_SOURCES  = $(vboxvideo_drv_SOURCES)
 DLLS += vboxvideo_drv_71
 vboxvideo_drv_71_TEMPLATE = VBOXGUESTR3XORGMOD
 vboxvideo_drv_71_CFLAGS := $(vboxvideo_drv_70_CFLAGS)
-vboxvideo_drv_71_DEFS := $(vboxvideo_70_DEFS) XORG_VERSION_CURRENT=700100000
+vboxvideo_drv_71_DEFS := $(vboxvideo_70_DEFS) XORG_VERSION_CURRENT=70100000
 vboxvideo_drv_71_INCS = \
 	$(vboxvideo_xorg_INCS) \
 	$(VBOX_PATH_X11_ROOT)/xorg-server-1.1.0
@@ -161,7 +161,7 @@ vboxvideo_drv_71_SOURCES  = $(vboxvideo_drv_SOURCES)
 DLLS += vboxvideo_drv_13
 vboxvideo_drv_13_TEMPLATE = VBOXGUESTR3XORGMOD
 vboxvideo_drv_13_CFLAGS := $(vboxvideo_drv_70_CFLAGS)
-vboxvideo_drv_13_DEFS := $(vboxvideo_13_DEFS) XORG_VERSION_CURRENT=100300000
+vboxvideo_drv_13_DEFS := $(vboxvideo_13_DEFS) XORG_VERSION_CURRENT=10300000
 vboxvideo_drv_13_INCS = \
 	$(vboxvideo_xorg_INCS) \
 	$(VBOX_PATH_X11_ROOT)/xorg-server-1.3.0.0
@@ -175,7 +175,7 @@ vboxvideo_drv_13_SOURCES = $(vboxvideo_drv_SOURCES) edid.c
 DLLS += vboxvideo_drv_14
 vboxvideo_drv_14_TEMPLATE = VBOXGUESTR3XORGMOD
 vboxvideo_drv_14_CFLAGS := $(vboxvideo_drv_70_CFLAGS)
-vboxvideo_drv_14_DEFS := $(vboxvideo_13_DEFS) XORG_VERSION_CURRENT=100400000
+vboxvideo_drv_14_DEFS := $(vboxvideo_13_DEFS) XORG_VERSION_CURRENT=10400000
 vboxvideo_drv_14_INCS = \
 	$(vboxvideo_xorg_INCS) \
 	$(VBOX_PATH_X11_ROOT)/xorg-server-1.4.2
@@ -189,7 +189,7 @@ vboxvideo_drv_14_SOURCES  = $(vboxvideo_drv_13_SOURCES)
 DLLS += vboxvideo_drv_15
 vboxvideo_drv_15_TEMPLATE = VBOXGUESTR3XORGMOD
 vboxvideo_drv_15_CFLAGS := $(vboxvideo_drv_70_CFLAGS)
-vboxvideo_drv_15_DEFS := $(vboxvideo_15_DEFS) XORG_VERSION_CURRENT=100503000
+vboxvideo_drv_15_DEFS := $(vboxvideo_15_DEFS) XORG_VERSION_CURRENT=10503000
 if1of ($(KBUILD_TARGET), linux solaris)
  vboxvideo_drv_15_DEFS += \
  	VBOX_DRI_OLD
@@ -211,7 +211,7 @@ endif
 DLLS += vboxvideo_drv_16
 vboxvideo_drv_16_TEMPLATE = VBOXGUESTR3XORGMOD
 vboxvideo_drv_16_CFLAGS := $(vboxvideo_drv_70_CFLAGS)
-vboxvideo_drv_16_DEFS := $(vboxvideo_15_DEFS) XORG_VERSION_CURRENT=100600000
+vboxvideo_drv_16_DEFS := $(vboxvideo_15_DEFS) XORG_VERSION_CURRENT=10600000
 if1of ($(KBUILD_TARGET), linux solaris)
  vboxvideo_drv_16_DEFS += \
  	VBOX_DRI_OLD
@@ -229,7 +229,7 @@ vboxvideo_drv_16_SOURCES := $(vboxvideo_drv_15_SOURCES)
 DLLS += vboxvideo_drv_17
 vboxvideo_drv_17_TEMPLATE = VBOXGUESTR3XORGMOD
 vboxvideo_drv_17_CFLAGS := $(vboxvideo_drv_70_CFLAGS)
-vboxvideo_drv_17_DEFS := $(vboxvideo_15_DEFS) XORG_VERSION_CURRENT=100699000
+vboxvideo_drv_17_DEFS := $(vboxvideo_15_DEFS) XORG_VERSION_CURRENT=10699000
 vboxvideo_drv_17_INCS = \
 	$(vboxvideo_xorg_INCS) \
 	$(VBOX_PATH_X11_ROOT)/xorg-server-1.7.7
@@ -247,7 +247,7 @@ endif
 DLLS += vboxvideo_drv_18
 vboxvideo_drv_18_TEMPLATE = VBOXGUESTR3XORGMOD
 vboxvideo_drv_18_CFLAGS := $(vboxvideo_drv_70_CFLAGS)
-vboxvideo_drv_18_DEFS := $(vboxvideo_15_DEFS) XORG_VERSION_CURRENT=100800000
+vboxvideo_drv_18_DEFS := $(vboxvideo_15_DEFS) XORG_VERSION_CURRENT=10800000
 vboxvideo_drv_18_INCS = \
 	$(vboxvideo_xorg_INCS) \
 	$(VBOX_PATH_X11_ROOT)/xorg-server-1.8.0
@@ -261,7 +261,7 @@ vboxvideo_drv_18_SOURCES := $(vboxvideo_drv_17_SOURCES)
 DLLS += vboxvideo_drv_19
 vboxvideo_drv_19_TEMPLATE = VBOXGUESTR3XORGMOD
 vboxvideo_drv_19_CFLAGS := $(vboxvideo_drv_70_CFLAGS)
-vboxvideo_drv_19_DEFS := $(vboxvideo_15_DEFS) XORG_VERSION_CURRENT=100900000
+vboxvideo_drv_19_DEFS := $(vboxvideo_15_DEFS) XORG_VERSION_CURRENT=10900000
 vboxvideo_drv_19_INCS = \
 	$(vboxvideo_xorg_INCS) \
 	$(VBOX_PATH_X11_ROOT)/xorg-server-1.9.0
@@ -275,7 +275,7 @@ vboxvideo_drv_19_SOURCES := $(vboxvideo_drv_17_SOURCES)
 DLLS += vboxvideo_drv_110
 vboxvideo_drv_110_TEMPLATE = VBOXGUESTR3XORGMOD
 vboxvideo_drv_110_CFLAGS := $(vboxvideo_drv_70_CFLAGS)
-vboxvideo_drv_110_DEFS := $(vboxvideo_15_DEFS) XORG_VERSION_CURRENT=101000000
+vboxvideo_drv_110_DEFS := $(vboxvideo_15_DEFS) XORG_VERSION_CURRENT=11000000
 vboxvideo_drv_110_INCS = \
 	$(vboxvideo_xorg_INCS) \
 	$(VBOX_PATH_X11_ROOT)/xorg-server-1.10.0
@@ -289,7 +289,7 @@ vboxvideo_drv_110_SOURCES := $(vboxvideo_drv_17_SOURCES)
 DLLS += vboxvideo_drv_111
 vboxvideo_drv_111_TEMPLATE = VBOXGUESTR3XORGMOD
 vboxvideo_drv_111_CFLAGS := $(vboxvideo_drv_70_CFLAGS)
-vboxvideo_drv_111_DEFS := $(vboxvideo_15_DEFS) XORG_VERSION_CURRENT=101100000
+vboxvideo_drv_111_DEFS := $(vboxvideo_15_DEFS) XORG_VERSION_CURRENT=11100000
 vboxvideo_drv_111_INCS = \
 	$(vboxvideo_xorg_INCS) \
 	$(VBOX_PATH_X11_ROOT)/xorg-server-1.11.0
@@ -303,7 +303,7 @@ vboxvideo_drv_111_SOURCES := $(vboxvideo_drv_17_SOURCES)
 DLLS += vboxvideo_drv_112
 vboxvideo_drv_112_TEMPLATE = VBOXGUESTR3XORGMOD
 vboxvideo_drv_112_CFLAGS := $(vboxvideo_drv_70_CFLAGS)
-vboxvideo_drv_112_DEFS := $(vboxvideo_15_DEFS) XORG_VERSION_CURRENT=101200000
+vboxvideo_drv_112_DEFS := $(vboxvideo_15_DEFS) XORG_VERSION_CURRENT=11200000
 vboxvideo_drv_112_INCS = \
 	$(vboxvideo_xorg_INCS) \
 	$(VBOX_PATH_X11_ROOT)/xorg-server-1.12.0
@@ -317,7 +317,7 @@ vboxvideo_drv_112_SOURCES := $(vboxvideo_drv_17_SOURCES)
 DLLS += vboxvideo_drv_113
 vboxvideo_drv_113_TEMPLATE = VBOXGUESTR3XORGMOD
 vboxvideo_drv_113_CFLAGS := $(vboxvideo_drv_70_CFLAGS)
-vboxvideo_drv_113_DEFS := $(vboxvideo_15_DEFS) XORG_VERSION_CURRENT=101300000
+vboxvideo_drv_113_DEFS := $(vboxvideo_15_DEFS) XORG_VERSION_CURRENT=11300000
 vboxvideo_drv_113_INCS = \
 	$(vboxvideo_xorg_INCS) \
 	$(VBOX_PATH_X11_ROOT)/xorg-server-1.13.0
@@ -331,7 +331,7 @@ vboxvideo_drv_113_SOURCES := $(vboxvideo_drv_17_SOURCES)
 DLLS += vboxvideo_drv_114
 vboxvideo_drv_114_TEMPLATE = VBOXGUESTR3XORGMOD
 vboxvideo_drv_114_CFLAGS := $(vboxvideo_drv_70_CFLAGS)
-vboxvideo_drv_114_DEFS := $(vboxvideo_15_DEFS) XORG_VERSION_CURRENT=101400000
+vboxvideo_drv_114_DEFS := $(vboxvideo_15_DEFS) XORG_VERSION_CURRENT=11400000
 vboxvideo_drv_114_INCS = \
 	$(vboxvideo_xorg_INCS) \
 	$(VBOX_PATH_X11_ROOT)/xorg-server-1.14.0
@@ -345,7 +345,7 @@ vboxvideo_drv_114_SOURCES := $(vboxvideo_drv_17_SOURCES)
 DLLS += vboxvideo_drv_115
 vboxvideo_drv_115_TEMPLATE = VBOXGUESTR3XORGMOD
 vboxvideo_drv_115_CFLAGS := $(vboxvideo_drv_70_CFLAGS)
-vboxvideo_drv_115_DEFS := $(vboxvideo_15_DEFS) XORG_VERSION_CURRENT=101500000
+vboxvideo_drv_115_DEFS := $(vboxvideo_15_DEFS) XORG_VERSION_CURRENT=11500000
 vboxvideo_drv_115_INCS = \
 	$(vboxvideo_xorg_INCS) \
 	$(VBOX_PATH_X11_ROOT)/xorg-server-1.15.0
@@ -359,7 +359,7 @@ vboxvideo_drv_115_SOURCES := $(vboxvideo_drv_17_SOURCES)
 DLLS += vboxvideo_drv_116
 vboxvideo_drv_116_TEMPLATE = VBOXGUESTR3XORGMOD
 vboxvideo_drv_116_CFLAGS := $(vboxvideo_drv_70_CFLAGS)
-vboxvideo_drv_116_DEFS := $(vboxvideo_15_DEFS) XORG_VERSION_CURRENT=101600000
+vboxvideo_drv_116_DEFS := $(vboxvideo_15_DEFS) XORG_VERSION_CURRENT=11600000
 vboxvideo_drv_116_INCS = \
 	$(vboxvideo_xorg_INCS) \
 	$(VBOX_PATH_X11_ROOT)/xorg-server-1.16.0
@@ -373,7 +373,7 @@ vboxvideo_drv_116_SOURCES := $(vboxvideo_drv_17_SOURCES)
 DLLS += vboxvideo_drv_117
 vboxvideo_drv_117_TEMPLATE = VBOXGUESTR3XORGMOD
 vboxvideo_drv_117_CFLAGS := $(vboxvideo_drv_70_CFLAGS)
-vboxvideo_drv_117_DEFS := $(vboxvideo_15_DEFS) XORG_VERSION_CURRENT=101700000
+vboxvideo_drv_117_DEFS := $(vboxvideo_15_DEFS) XORG_VERSION_CURRENT=11700000
 vboxvideo_drv_117_INCS = \
 	$(vboxvideo_xorg_INCS) \
 	$(VBOX_PATH_X11_ROOT)/xorg-server-1.17.1
@@ -388,7 +388,7 @@ ifdef VBOX_USE_SYSTEM_XORG_HEADERS
  vboxvideo_drv_system_TEMPLATE = VBOXGUESTR3XORGMOD
  vboxvideo_drv_system_CFLAGS := \
         $(vboxvideo_drv_70_CFLAGS) -include xorg-server.h
- vboxvideo_drv_system_DEFS := $(vboxvideo_15_DEFS)
+ vboxvideo_drv_system_DEFS := $(filter-out _XORG_SERVER_H_ _DIX_CONFIG_H_, $(vboxvideo_15_DEFS))
  vboxvideo_drv_system_INCS += \
         $(PATH_ROOT)/src/VBox/Runtime/include \
         /usr/include/x11 \
diff --git a/src/VBox/Additions/x11/vboxvideo/vboxvideo.c b/src/VBox/Additions/x11/vboxvideo/vboxvideo.c
index 43bcf7d..186d892 100644
--- a/src/VBox/Additions/x11/vboxvideo/vboxvideo.c
+++ b/src/VBox/Additions/x11/vboxvideo/vboxvideo.c
@@ -297,8 +297,6 @@ vbox_crtc_dpms(xf86CrtcPtr crtc, int mode)
     bool fEnabled = (mode != DPMSModeOff);
 
     TRACE_LOG("cDisplay=%u, mode=%i\n", cDisplay, mode);
-    if (pVBox->pScreens[cDisplay].fCrtcEnabled == fEnabled)
-        return;
     pVBox->pScreens[cDisplay].fCrtcEnabled = fEnabled;
     /* Don't fiddle with the hardware if we are switched
      * to a virtual terminal. */
@@ -408,8 +406,6 @@ vbox_output_dpms (xf86OutputPtr output, int mode)
     bool fEnabled = (mode == DPMSModeOn);
 
     TRACE_LOG("cDisplay=%u, mode=%i\n", cDisplay, mode);
-    if (pVBox->pScreens[cDisplay].fOutputEnabled == fEnabled)
-        return;
     pVBox->pScreens[cDisplay].fOutputEnabled = fEnabled;
     /* Don't fiddle with the hardware if we are switched
      * to a virtual terminal. */
@@ -1223,8 +1219,15 @@ static Bool VBOXEnterVT(ScrnInfoPtr pScrn)
 static void VBOXLeaveVT(ScrnInfoPtr pScrn)
 {
     VBOXPtr pVBox = VBOXGetRec(pScrn);
+#ifdef VBOXVIDEO_13
+    unsigned i;
+#endif
 
     TRACE_ENTRY();
+#ifdef VBOXVIDEO_13
+    for (i = 0; i < pVBox->cScreens; ++i)
+        vbox_output_dpms(pVBox->pScreens[i].paOutputs, DPMSModeOff);
+#endif
     vboxDisableVbva(pScrn);
     vboxClearVRAM(pScrn, 0, 0);
 #ifdef VBOX_DRI_OLD
@@ -1250,6 +1253,12 @@ static Bool VBOXCloseScreen(ScreenPtr pScreen)
 #endif
     if (pScrn->vtSema)
     {
+#ifdef VBOXVIDEO_13
+        unsigned i;
+
+        for (i = 0; i < pVBox->cScreens; ++i)
+            vbox_output_dpms(pVBox->pScreens[i].paOutputs, DPMSModeOff);
+#endif
         vboxDisableVbva(pScrn);
         vboxClearVRAM(pScrn, 0, 0);
     }
diff --git a/src/VBox/Additions/x11/vboxvideo/vboxvideo.h b/src/VBox/Additions/x11/vboxvideo/vboxvideo.h
index 381479c..29ff888 100644
--- a/src/VBox/Additions/x11/vboxvideo/vboxvideo.h
+++ b/src/VBox/Additions/x11/vboxvideo/vboxvideo.h
@@ -133,8 +133,8 @@ extern void GlxSetVisualConfigs(int nconfigs, __GLXvisualConfig *configs,
 
 /** Helper to work round different ways of getting the root window in different
  * server versions. */
-#if defined(XORG_VERSION_CURRENT) && XORG_VERSION_CURRENT < 700000000 \
-    && XORG_VERSION_CURRENT >= 100900000
+#if defined(XORG_VERSION_CURRENT) && XORG_VERSION_CURRENT < 70000000 \
+    && XORG_VERSION_CURRENT >= 10900000
 # define ROOT_WINDOW(pScrn) screenInfo.screens[(pScrn)->scrnIndex]->root
 #else
 # define ROOT_WINDOW(pScrn) WindowTable[(pScrn)->scrnIndex]
diff --git a/src/VBox/Devices/Audio/dsoundaudio.c b/src/VBox/Devices/Audio/dsoundaudio.c
index e6a1d6e..c4033c5 100644
--- a/src/VBox/Devices/Audio/dsoundaudio.c
+++ b/src/VBox/Devices/Audio/dsoundaudio.c
@@ -515,7 +515,7 @@ static int dsoundCaptureOpen (DSoundVoiceIn *ds)
     WAVEFORMATEX wfx;
     DSCBUFFERDESC bd;
     DSCBCAPS bc;
-    DWORD cpos;
+    DWORD rpos;
 
     DSLOGF(("DSound: capture open %p size %d samples, freq %d, chan %d, bits %d, sign %d\n",
             ds,
@@ -556,9 +556,9 @@ static int dsoundCaptureOpen (DSoundVoiceIn *ds)
 
     /* Query the actual parameters. */
 
-    hr = IDirectSoundCaptureBuffer_GetCurrentPosition (ds->dsound_capture_buffer, &cpos, NULL);
+    hr = IDirectSoundCaptureBuffer_GetCurrentPosition (ds->dsound_capture_buffer, NULL, &rpos);
     if (FAILED (hr)) {
-        cpos = 0;
+        rpos = 0;
         DSLOGF(("DSound: open GetCurrentPosition %Rhrc\n", hr));
     }
 
@@ -606,7 +606,7 @@ static int dsoundCaptureOpen (DSoundVoiceIn *ds)
 
     /* Initial state: reading at the initial capture position. */
     ds->hw.wpos = 0;
-    ds->last_read_pos = cpos >> ds->hw.info.shift;
+    ds->last_read_pos = rpos >> ds->hw.info.shift;
     ds->capture_buffer_size = bc.dwBufferBytes >> ds->hw.info.shift;
     DSLOGF(("DSound: open last_read_pos %d, capture_buffer_size %d\n", ds->last_read_pos, ds->capture_buffer_size));
 
@@ -1119,7 +1119,7 @@ static int dsound_run_in (HWVoiceIn *hw)
     DWORD blen1, blen2;
     int len1, len2;
     int decr;
-    DWORD cpos;
+    DWORD rpos;
     LPVOID p1, p2;
     int hwshift;
 
@@ -1138,8 +1138,8 @@ static int dsound_run_in (HWVoiceIn *hw)
 
     hr = IDirectSoundCaptureBuffer_GetCurrentPosition (
         dscb,
-        &cpos,
-        NULL
+        NULL,
+        &rpos
         );
     if (FAILED (hr)) {
         if (hr != ds->hr_last_run_in) {
@@ -1150,14 +1150,14 @@ static int dsound_run_in (HWVoiceIn *hw)
     }
     ds->hr_last_run_in = hr;
 
-    if (cpos & hw->info.align) {
-        DSLOGF(("DSound: run_in misaligned capture position %ld(%d)\n", cpos, hw->info.align));
+    if (rpos & hw->info.align) {
+        DSLOGF(("DSound: run_in misaligned read position %ld(%d)\n", rpos, hw->info.align));
     }
 
-    cpos >>= hwshift;
+    rpos >>= hwshift;
 
     /* Number of samples available in the capture buffer. */
-    len = audio_ring_dist (cpos, ds->last_read_pos, ds->capture_buffer_size);
+    len = audio_ring_dist (rpos, ds->last_read_pos, ds->capture_buffer_size);
     if (!len) {
         return 0;
     }
diff --git a/src/VBox/Devices/EFI/FirmwareBin/VBoxEFI32.fd b/src/VBox/Devices/EFI/FirmwareBin/VBoxEFI32.fd
index 44a2ac3..73c6b59 100644
Binary files a/src/VBox/Devices/EFI/FirmwareBin/VBoxEFI32.fd and b/src/VBox/Devices/EFI/FirmwareBin/VBoxEFI32.fd differ
diff --git a/src/VBox/Devices/EFI/FirmwareBin/VBoxEFI64.fd b/src/VBox/Devices/EFI/FirmwareBin/VBoxEFI64.fd
index 7ef4975..7821508 100644
Binary files a/src/VBox/Devices/EFI/FirmwareBin/VBoxEFI64.fd and b/src/VBox/Devices/EFI/FirmwareBin/VBoxEFI64.fd differ
diff --git a/src/VBox/Devices/Graphics/BIOS/VBoxVgaBiosAlternative.asm b/src/VBox/Devices/Graphics/BIOS/VBoxVgaBiosAlternative.asm
index afcc5c7..bff629f 100644
--- a/src/VBox/Devices/Graphics/BIOS/VBoxVgaBiosAlternative.asm
+++ b/src/VBox/Devices/Graphics/BIOS/VBoxVgaBiosAlternative.asm
@@ -6781,7 +6781,7 @@ vesa_pm_end:                                 ; 0xc4714 LB 0x1
 
 section _DATA progbits vstart=0x4800 align=1 ; size=0x36e1 class=DATA group=DGROUP
 _msg_vga_init:                               ; 0xc4800 LB 0x2f
-    db  'Oracle VM VirtualBox Version 4.3.22 VGA BIOS', 00dh, 00ah, 000h
+    db  'Oracle VM VirtualBox Version 4.3.24 VGA BIOS', 00dh, 00ah, 000h
 _vga_modes:                                  ; 0xc482f LB 0x80
     db  000h, 000h, 000h, 004h, 000h, 0b8h, 0ffh, 002h, 001h, 000h, 000h, 004h, 000h, 0b8h, 0ffh, 002h
     db  002h, 000h, 000h, 004h, 000h, 0b8h, 0ffh, 002h, 003h, 000h, 000h, 004h, 000h, 0b8h, 0ffh, 002h
@@ -7669,7 +7669,7 @@ _vbebios_vendor_name:                        ; 0xc7e35 LB 0x13
 _vbebios_product_name:                       ; 0xc7e48 LB 0x21
     db  'Oracle VM VirtualBox VBE Adapter', 000h
 _vbebios_product_revision:                   ; 0xc7e69 LB 0x24
-    db  'Oracle VM VirtualBox Version 4.3.22', 000h
+    db  'Oracle VM VirtualBox Version 4.3.24', 000h
 _vbebios_info_string:                        ; 0xc7e8d LB 0x2b
     db  'VirtualBox VBE Display Adapter enabled', 00dh, 00ah, 00dh, 00ah, 000h
 _no_vbebios_info_string:                     ; 0xc7eb8 LB 0x29
@@ -7700,4 +7700,4 @@ section CONST2 progbits vstart=0x7ee2 align=1 ; size=0x0 class=DATA group=DGROUP
     db  000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
     db  000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
     db  000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
-    db  000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 062h
+    db  000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 05eh
diff --git a/src/VBox/Devices/Graphics/BIOS/VBoxVgaBiosAlternative.md5sum b/src/VBox/Devices/Graphics/BIOS/VBoxVgaBiosAlternative.md5sum
index 618c8a3..c15db79 100644
--- a/src/VBox/Devices/Graphics/BIOS/VBoxVgaBiosAlternative.md5sum
+++ b/src/VBox/Devices/Graphics/BIOS/VBoxVgaBiosAlternative.md5sum
@@ -1 +1 @@
-c9b5281c79cc70a72c6e4cb1591d673e *VBoxVgaBios.rom
+2c0ba7379b392d71f7cd61d98b5d9693 *VBoxVgaBios.rom
diff --git a/src/VBox/Devices/Graphics/DevVGA-SVGA.cpp b/src/VBox/Devices/Graphics/DevVGA-SVGA.cpp
index c91c013..2e01a8d 100644
--- a/src/VBox/Devices/Graphics/DevVGA-SVGA.cpp
+++ b/src/VBox/Devices/Graphics/DevVGA-SVGA.cpp
@@ -4098,7 +4098,7 @@ DECLCALLBACK(void) vmsvgaR3PowerOn(PPDMDEVINS pDevIns)
                     if (g_apszVmSvgaDevCapNames[i][0] == 'x')
                         LogRel(("VMSVGA3d: cap[%u]=%#010x {%s}\n", i, val, &g_apszVmSvgaDevCapNames[i][1]));
                     else
-                        LogRel(("VMSVGA3d: cap[%u]=%d.%04u {%s}\n", i, (int)(float)val, (unsigned)((float)val * 10000) % 10000,
+                        LogRel(("VMSVGA3d: cap[%u]=%d.%04u {%s}\n", i, (int)*(float *)&val, (unsigned)(*(float *)&val * 10000) % 10000,
                                 &g_apszVmSvgaDevCapNames[i][1]));
                 }
                 else
diff --git a/src/VBox/Devices/Graphics/DevVGA-SVGA3d-cocoa.h b/src/VBox/Devices/Graphics/DevVGA-SVGA3d-cocoa.h
index cb1dc01..854ca24 100644
--- a/src/VBox/Devices/Graphics/DevVGA-SVGA3d-cocoa.h
+++ b/src/VBox/Devices/Graphics/DevVGA-SVGA3d-cocoa.h
@@ -17,7 +17,7 @@
 #ifndef __DevVGA_SVGA3d_cocoa_h
 #define __DevVGA_SVGA3d_cocoa_h
 
-#include <iprt/cdefs.h>
+#include <iprt/types.h>
 #include <VBox/VBoxCocoa.h>
 #include <OpenGL/OpenGL.h>
 
diff --git a/src/VBox/Devices/Graphics/DevVGA-SVGA3d-cocoa.m b/src/VBox/Devices/Graphics/DevVGA-SVGA3d-cocoa.m
index c789c04..dfb0ea1 100644
--- a/src/VBox/Devices/Graphics/DevVGA-SVGA3d-cocoa.m
+++ b/src/VBox/Devices/Graphics/DevVGA-SVGA3d-cocoa.m
@@ -1,3 +1,4 @@
+/* $Id: DevVGA-SVGA3d-cocoa.m $ */
 /** @file
  * VirtualBox OpenGL Cocoa Window System Helper Implementation. 
  *  
@@ -21,6 +22,7 @@
 #import <OpenGL/gl.h>
 
 #include <iprt/thread.h>
+#include <iprt/assert.h>
 
 /* Debug macros */
 #if 0 /*def DEBUG_VERBOSE*/
@@ -628,39 +630,32 @@ void vmsvga3dCocoaCreateContext(NativeNSOpenGLContextRef *ppCtx, NativeNSOpenGLC
     NSOpenGLPixelFormat *pFmt = nil;
     NSAutoreleasePool *pPool = [[NSAutoreleasePool alloc] init];
 
-#if 1
-    // @todo galitsyn: NSOpenGLPFAWindow was deprecated starting from OSX 10.9.
     // Consider to remove it and check if it's harmless.
     NSOpenGLPixelFormatAttribute attribs[] =
     {
-        NSOpenGLPFAWindow,
-        NSOpenGLPFADoubleBuffer,
+        NSOpenGLPFAOpenGLProfile, (NSOpenGLPixelFormatAttribute)0,
+        //NSOpenGLPFAWindow, - obsolete/deprecated, try work without it...
         NSOpenGLPFAAccelerated,
+        NSOpenGLPFADoubleBuffer,
         NSOpenGLPFAColorSize, (NSOpenGLPixelFormatAttribute)24,
         NSOpenGLPFAAlphaSize, (NSOpenGLPixelFormatAttribute)8,
         NSOpenGLPFADepthSize, (NSOpenGLPixelFormatAttribute)24,
         0
     };
-#else
-    NSOpenGLPixelFormatAttribute attribs[] =
-    {
-        NSOpenGLPFADoubleBuffer,
-        NSOpenGLPFAAccelerated,
-        NSOpenGLPFAColorSize, (NSOpenGLPixelFormatAttribute)24,
-        NSOpenGLPFADepthSize, 24,
-        NSOpenGLPFAOpenGLProfile, NSOpenGLProfileVersion3_2Core,
-        0
-    };
-#endif
+    attribs[1] = fOtherProfile ? NSOpenGLProfileVersion3_2Core : NSOpenGLProfileVersionLegacy;
 
     /* Choose a pixel format */
     pFmt = [[NSOpenGLPixelFormat alloc] initWithAttributes:attribs];
-
     if (pFmt)
     {
         *ppCtx = [[VMSVGA3DOpenGLContext alloc] initWithFormat:pFmt shareContext:pShareCtx];
         DEBUG_MSG(("New context %p\n", (void *)*ppCtx));
     }
+    else
+    {
+        AssertFailed();
+        *ppCtx = NULL;
+    }
 
     [pPool release];
 
@@ -764,3 +759,4 @@ void vmsvga3dCocoaSwapBuffers(NativeNSViewRef pView, NativeNSOpenGLContextRef pC
     [pPool release];
     DEBUG_FUNC_LEAVE();
 }
+
diff --git a/src/VBox/Devices/Graphics/DevVGA-SVGA3d-ogl.cpp b/src/VBox/Devices/Graphics/DevVGA-SVGA3d-ogl.cpp
index 9a7cfb9..e579bf5 100644
--- a/src/VBox/Devices/Graphics/DevVGA-SVGA3d-ogl.cpp
+++ b/src/VBox/Devices/Graphics/DevVGA-SVGA3d-ogl.cpp
@@ -1345,7 +1345,13 @@ int vmsvga3dPowerOn(PVGASTATE pThis)
     VMSVGA3D_INIT_CHECKED_BOTH(pState, pContext, pOtherCtx, glGetIntegerv(GL_MAX_LIGHTS, &pState->caps.maxActiveLights));
     VMSVGA3D_INIT_CHECKED_BOTH(pState, pContext, pOtherCtx, glGetIntegerv(GL_MAX_TEXTURE_BUFFER_SIZE, &pState->caps.maxTextureBufferSize));
     VMSVGA3D_INIT_CHECKED_BOTH(pState, pContext, pOtherCtx, glGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB, &pState->caps.maxTextures));
+#ifdef VBOX_VMSVGA3D_DUAL_OPENGL_PROFILE /* The alternative profile has a higher number here (ati/darwin). */
+    VMSVGA3D_SET_CURRENT_CONTEXT(pState, pOtherCtx);
+    VMSVGA3D_INIT_CHECKED_BOTH(pState, pOtherCtx, pContext, glGetIntegerv(GL_MAX_CLIP_DISTANCES, &pState->caps.maxClipDistances));
+    VMSVGA3D_SET_CURRENT_CONTEXT(pState, pContext);
+#else
     VMSVGA3D_INIT_CHECKED(glGetIntegerv(GL_MAX_CLIP_DISTANCES, &pState->caps.maxClipDistances));
+#endif
     VMSVGA3D_INIT_CHECKED(glGetIntegerv(GL_MAX_COLOR_ATTACHMENTS, &pState->caps.maxColorAttachments));
     VMSVGA3D_INIT_CHECKED(glGetIntegerv(GL_MAX_RECTANGLE_TEXTURE_SIZE, &pState->caps.maxRectangleTextureSize));
     VMSVGA3D_INIT_CHECKED(glGetIntegerv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &pState->caps.maxTextureAnisotropy));
diff --git a/src/VBox/Devices/Network/slirp/slirp.c b/src/VBox/Devices/Network/slirp/slirp.c
index 986d3b3..88e8593 100644
--- a/src/VBox/Devices/Network/slirp/slirp.c
+++ b/src/VBox/Devices/Network/slirp/slirp.c
@@ -2122,7 +2122,9 @@ int slirp_host_network_configuration_change_strategy_selector(const PNATState pD
         rcp_state.rcps_flags |= RCPSF_IGNORE_IPV6;
         rc = rcp_parse(&rcp_state, RESOLV_CONF_FILE);
         LogRelFunc(("NAT: rcp_parse:%Rrc old domain:%s new domain:%s\n",
-                    rc, LIST_FIRST(&pData->pDomainList)->dd_pszDomain,
+                    rc, LIST_EMPTY(&pData->pDomainList)
+                      ? "(null)"
+                      : LIST_FIRST(&pData->pDomainList)->dd_pszDomain,
                     rcp_state.rcps_domain));
         if (   RT_FAILURE(rc)
             || LIST_EMPTY(&pData->pDomainList))
diff --git a/src/VBox/Devices/PC/BIOS/VBoxBiosAlternative.asm b/src/VBox/Devices/PC/BIOS/VBoxBiosAlternative.asm
index d9fffa3..9cdb3cb 100644
--- a/src/VBox/Devices/PC/BIOS/VBoxBiosAlternative.asm
+++ b/src/VBox/Devices/PC/BIOS/VBoxBiosAlternative.asm
@@ -965,7 +965,7 @@ section CONST progbits vstart=0xb0 align=1 ; size=0xcf8 class=DATA group=DGROUP
 
 section CONST2 progbits vstart=0xda8 align=1 ; size=0x3fa class=DATA group=DGROUP
 _bios_cvs_version_string:                    ; 0xf0da8 LB 0x12
-    db  'VirtualBox 4.3.22', 000h
+    db  'VirtualBox 4.3.24', 000h
 _bios_prefix_string:                         ; 0xf0dba LB 0x8
     db  'BIOS: ', 000h, 000h
 _isotag:                                     ; 0xf0dc2 LB 0x6
@@ -16070,4 +16070,4 @@ dummy_iret:                                  ; 0xfff53 LB 0x9d
     db  'XM'
 cpu_reset:                                   ; 0xffff0 LB 0x10
     jmp far 0f000h:0e05bh                     ; ea 5b e0 00 f0
-    db  030h, 036h, 02fh, 032h, 033h, 02fh, 039h, 039h, 000h, 0fch, 001h
+    db  030h, 036h, 02fh, 032h, 033h, 02fh, 039h, 039h, 000h, 0fch, 0ffh
diff --git a/src/VBox/Devices/PC/BIOS/VBoxBiosAlternative.md5sum b/src/VBox/Devices/PC/BIOS/VBoxBiosAlternative.md5sum
index b69e107..50866d4 100644
--- a/src/VBox/Devices/PC/BIOS/VBoxBiosAlternative.md5sum
+++ b/src/VBox/Devices/PC/BIOS/VBoxBiosAlternative.md5sum
@@ -1 +1 @@
-326fd38fc077b04f5130d31a86caf685 *VBoxPcBios.rom
+712c9714414476d4d2d3fe4aa37c72c1 *VBoxPcBios.rom
diff --git a/src/VBox/Devices/PC/BIOS/boot.c b/src/VBox/Devices/PC/BIOS/boot.c
index 37daeac..00aea7c 100644
--- a/src/VBox/Devices/PC/BIOS/boot.c
+++ b/src/VBox/Devices/PC/BIOS/boot.c
@@ -45,6 +45,10 @@
 #include "biosint.h"
 #include "ebda.h"
 
+/* Sanity check the LAN boot segment definition. */
+#if VBOX_LANBOOT_SEG < 0xA000
+#error VBOX_LANBOOT_SEG incorrect!
+#endif
 
 /* PnP header used with LAN boot ROMs. */
 typedef struct {
diff --git a/src/VBox/ExtPacks/VNC/VBoxVNC.cpp b/src/VBox/ExtPacks/VNC/VBoxVNC.cpp
index 58a03fb..04aa5e1 100644
--- a/src/VBox/ExtPacks/VNC/VBoxVNC.cpp
+++ b/src/VBox/ExtPacks/VNC/VBoxVNC.cpp
@@ -78,7 +78,7 @@ public:
             RTMemFree(mFrameBuffer);
         if (mCursor)
             rfbFreeCursor(mCursor);
-        memset(szVNCPassword, '\0', sizeof(szVNCPassword));
+        RT_ZERO(szVNCPassword);
     }
 
     int Init(const VRDEINTERFACEHDR *pCallbacks, void *pvCallback);
@@ -257,12 +257,24 @@ DECLCALLBACK(int) VNCServerImpl::VRDEEnableConnections(HVRDESERVER hServer, bool
 #endif
     LogFlowFunc(("enter\n"));
 
-    // query server for the framebuffer
-    VRDEFRAMEBUFFERINFO info;
-    int rc = instance->mCallbacks->VRDECallbackFramebufferQuery(instance->mCallback, 0, &info);
+    // At this point, VRDECallbackFramebufferQuery will not succeed.
+    // Initialize VNC with 640x480 and wait for VRDEResize to get actual size.
+    int dummyWidth = 640, dummyHeight = 480;
 
-    rfbScreenInfoPtr vncServer = rfbGetScreen(0, NULL, info.cWidth, info.cHeight, 8, 3, VNC_SIZEOFRGBA);
+    rfbScreenInfoPtr vncServer = rfbGetScreen(0, NULL, dummyWidth, dummyHeight, 8, 3, VNC_SIZEOFRGBA);
     instance->mVNCServer = vncServer;
+
+    VRDEFRAMEBUFFERINFO info;
+    RT_ZERO(info);
+    info.cWidth = dummyWidth, info.cHeight = dummyHeight;
+    info.cBitsPerPixel = 24;
+    info.pu8Bits = NULL;
+    unsigned char *FrameBuffer = (unsigned char *)RTMemAlloc(info.cWidth * info.cHeight * VNC_SIZEOFRGBA); // RGBA
+    rfbNewFramebuffer(instance->mVNCServer, (char *)FrameBuffer, info.cWidth, info.cHeight, 8, 3, VNC_SIZEOFRGBA);
+    instance->mFrameBuffer = FrameBuffer;
+    instance->mScreenBuffer = (unsigned char *)info.pu8Bits;
+    instance->FrameInfo = info;
+
     vncServer->serverFormat.redShift = 16;
     vncServer->serverFormat.greenShift = 8;
     vncServer->serverFormat.blueShift = 0;
@@ -274,7 +286,7 @@ DECLCALLBACK(int) VNCServerImpl::VRDEEnableConnections(HVRDESERVER hServer, bool
     // get listen address
     char szAddress[VNC_ADDRESSSIZE + 1] = {0};
     uint32_t cbOut = 0;
-    rc = instance->mCallbacks->VRDECallbackProperty(instance->mCallback,
+    int rc = instance->mCallbacks->VRDECallbackProperty(instance->mCallback,
                                                     VRDE_QP_NETWORK_ADDRESS,
                                                     &szAddress, sizeof(szAddress), &cbOut);
     Assert(cbOut <= sizeof(szAddress));
@@ -712,11 +724,9 @@ DECLCALLBACK(void) VNCServerImpl::VRDEResize(HVRDESERVER hServer)
 {
     VNCServerImpl *instance = (VNCServerImpl *)hServer;
     VRDEFRAMEBUFFERINFO info;
-    int rc = instance->mCallbacks->VRDECallbackFramebufferQuery(instance->mCallback, 0, &info);
-    if (!RT_SUCCESS(rc))
-    {
+    bool fAvail = instance->mCallbacks->VRDECallbackFramebufferQuery(instance->mCallback, 0, &info);
+    if (!fAvail)
         return;
-    }
 
     LogRel(("VNCServerImpl::VRDEResize to %dx%dx%dbpp\n", info.cWidth, info.cHeight, info.cBitsPerPixel));
 
diff --git a/src/VBox/Frontends/VBoxManage/VBoxManageControlVM.cpp b/src/VBox/Frontends/VBoxManage/VBoxManageControlVM.cpp
index 31982d0..eb7e4b8 100644
--- a/src/VBox/Frontends/VBoxManage/VBoxManageControlVM.cpp
+++ b/src/VBox/Frontends/VBoxManage/VBoxManageControlVM.cpp
@@ -84,6 +84,7 @@ unsigned int getMaxNics(IVirtualBox* vbox, IMachine* mach)
 int handleControlVM(HandlerArg *a)
 {
     using namespace com;
+    bool fNeedsSaving = false;
     HRESULT rc;
 
     if (a->argc < 2)
@@ -99,13 +100,14 @@ int handleControlVM(HandlerArg *a)
     /* open a session for the VM */
     CHECK_ERROR_RET(machine, LockMachine(a->session, LockType_Shared), 1);
 
+    ComPtr<IConsole> console;
+    ComPtr<IMachine> sessionMachine;
+
     do
     {
         /* get the associated console */
-        ComPtr<IConsole> console;
         CHECK_ERROR_BREAK(a->session, COMGETTER(Console)(console.asOutParam()));
         /* ... and session machine */
-        ComPtr<IMachine> sessionMachine;
         CHECK_ERROR_BREAK(a->session, COMGETTER(Machine)(sessionMachine.asOutParam()));
 
         /* which command? */
@@ -186,6 +188,8 @@ int handleControlVM(HandlerArg *a)
             if (SUCCEEDED(rc))
             {
                 CHECK_ERROR_BREAK(sessionMachine, COMSETTER(ClipboardMode)(mode));
+                if (SUCCEEDED(rc))
+                    fNeedsSaving = true;
             }
         }
         else if (!strcmp(a->argv[1], "draganddrop"))
@@ -214,6 +218,8 @@ int handleControlVM(HandlerArg *a)
             if (SUCCEEDED(rc))
             {
                 CHECK_ERROR_BREAK(sessionMachine, COMSETTER(DragAndDropMode)(mode));
+                if (SUCCEEDED(rc))
+                    fNeedsSaving = true;
             }
         }
         else if (!strcmp(a->argv[1], "poweroff"))
@@ -377,6 +383,8 @@ int handleControlVM(HandlerArg *a)
                     rc = E_FAIL;
                     break;
                 }
+                if (SUCCEEDED(rc))
+                    fNeedsSaving = true;
             }
         }
         /* here the order in which strncmp is called is important
@@ -420,6 +428,8 @@ int handleControlVM(HandlerArg *a)
                         rc = E_FAIL;
                         break;
                     }
+                    if (SUCCEEDED(rc))
+                        fNeedsSaving = true;
                 }
                 else
                     RTMsgError("The NIC %d is currently disabled and thus its tracefile can't be changed", n);
@@ -466,6 +476,8 @@ int handleControlVM(HandlerArg *a)
                         rc = E_FAIL;
                         break;
                     }
+                    if (SUCCEEDED(rc))
+                        fNeedsSaving = true;
                 }
                 else
                     RTMsgError("The NIC %d is currently disabled and thus its trace flag can't be changed", n);
@@ -562,9 +574,8 @@ int handleControlVM(HandlerArg *a)
                         RTStrToUInt16(strHostPort), Bstr(strGuestIp).raw(), RTStrToUInt16(strGuestPort)));
 #undef ITERATE_TO_NEXT_TERM
             }
-            /* commit changes */
             if (SUCCEEDED(rc))
-                CHECK_ERROR(sessionMachine, SaveSettings());
+                fNeedsSaving = true;
         }
         else if (!strncmp(a->argv[1], "nicproperty", 11))
         {
@@ -604,6 +615,8 @@ int handleControlVM(HandlerArg *a)
                             Bstr bstrName = pszProperty;
                             Bstr bstrValue = &pDelimiter[1];
                             CHECK_ERROR(adapter, SetProperty(bstrName.raw(), bstrValue.raw()));
+                            if (SUCCEEDED(rc))
+                                fNeedsSaving = true;
                         }
                         else
                         {
@@ -666,6 +679,8 @@ int handleControlVM(HandlerArg *a)
                     }
 
                     CHECK_ERROR(adapter, COMSETTER(PromiscModePolicy)(enmPromiscModePolicy));
+                    if (SUCCEEDED(rc))
+                        fNeedsSaving = true;
                 }
                 else
                     RTMsgError("The NIC %d is currently disabled and thus its promiscuous mode can't be changed", n);
@@ -791,6 +806,8 @@ int handleControlVM(HandlerArg *a)
                         rc = E_FAIL;
                         break;
                     }
+                    if (SUCCEEDED(rc))
+                        fNeedsSaving = true;
                 }
                 else
                     RTMsgError("The NIC %d is currently disabled and thus its attachment type can't be changed", n);
@@ -827,6 +844,8 @@ int handleControlVM(HandlerArg *a)
                     rc = E_FAIL;
                     break;
                 }
+                if (SUCCEEDED(rc))
+                    fNeedsSaving = true;
             }
         }
         else if (   !strcmp(a->argv[1], "vrdeport")
@@ -855,6 +874,8 @@ int handleControlVM(HandlerArg *a)
                     ports = a->argv[2];
 
                 CHECK_ERROR_BREAK(vrdeServer, SetVRDEProperty(Bstr("TCP/Ports").raw(), ports.raw()));
+                if (SUCCEEDED(rc))
+                    fNeedsSaving = true;
             }
         }
         else if (   !strcmp(a->argv[1], "vrdevideochannelquality")
@@ -877,6 +898,8 @@ int handleControlVM(HandlerArg *a)
                 Bstr value = a->argv[2];
 
                 CHECK_ERROR(vrdeServer, SetVRDEProperty(Bstr("VideoChannel/Quality").raw(), value.raw()));
+                if (SUCCEEDED(rc))
+                    fNeedsSaving = true;
             }
         }
         else if (!strcmp(a->argv[1], "vrdeproperty"))
@@ -904,6 +927,8 @@ int handleControlVM(HandlerArg *a)
                         Bstr bstrName = pszProperty;
                         Bstr bstrValue = &pDelimiter[1];
                         CHECK_ERROR(vrdeServer, SetVRDEProperty(bstrName.raw(), bstrValue.raw()));
+                        if (SUCCEEDED(rc))
+                            fNeedsSaving = true;
                     }
                     else
                     {
@@ -1478,6 +1503,10 @@ int handleControlVM(HandlerArg *a)
         }
     } while (0);
 
+    /* The client has to trigger saving the state explicitely. */
+    if (fNeedsSaving)
+        CHECK_ERROR(sessionMachine, SaveSettings());
+
     a->session->UnlockMachine();
 
     return SUCCEEDED(rc) ? 0 : 1;
diff --git a/src/VBox/Frontends/VBoxManage/VBoxManageDHCPServer.cpp b/src/VBox/Frontends/VBoxManage/VBoxManageDHCPServer.cpp
index e680cfe..c908daa 100644
--- a/src/VBox/Frontends/VBoxManage/VBoxManageDHCPServer.cpp
+++ b/src/VBox/Frontends/VBoxManage/VBoxManageDHCPServer.cpp
@@ -53,19 +53,16 @@ typedef enum enMainOpCodes
     OP_MODIFY
 } OPCODE;
 
-typedef std::map<DhcpOpt_T, std::string> DhcpOptMap;
-typedef DhcpOptMap::iterator DhcpOptIterator;
-typedef DhcpOptMap::value_type DhcpOptValuePair;
-
-struct VmNameSlotKey;
-typedef struct VmNameSlotKey VmNameSlotKey;
+typedef std::pair<DhcpOpt_T, std::string> DhcpOptSpec;
+typedef std::vector<DhcpOptSpec> DhcpOpts;
+typedef DhcpOpts::iterator DhcpOptIterator;
 
 struct VmNameSlotKey
 {
-    std::string VmName;
+    const std::string VmName;
     uint8_t u8Slot;
 
-    VmNameSlotKey(std::string aVmName, uint8_t aSlot) :
+    VmNameSlotKey(const std::string &aVmName, uint8_t aSlot) :
       VmName(aVmName),
       u8Slot(aSlot) {}
 
@@ -78,7 +75,7 @@ struct VmNameSlotKey
     }
 };
 
-typedef std::map<VmNameSlotKey, DhcpOptMap> VmSlot2OptionsM;
+typedef std::map<VmNameSlotKey, DhcpOpts> VmSlot2OptionsM;
 typedef VmSlot2OptionsM::iterator VmSlot2OptionsIterator;
 typedef VmSlot2OptionsM::value_type VmSlot2OptionsPair;
 
@@ -138,7 +135,7 @@ static int handleOp(HandlerArg *a, OPCODE enmCode, int iStart, int *pcProcessed)
 
     int enable = -1;
 
-    DhcpOptMap GlobalDhcpOptions;
+    DhcpOpts        GlobalDhcpOptions;
     VmSlot2OptionsM VmSlot2Options;
     VmConfigs       VmConfigs2Delete;
 
@@ -291,10 +288,10 @@ static int handleOp(HandlerArg *a, OPCODE enmCode, int iStart, int *pcProcessed)
                         return errorSyntax(USAGE_DHCPSERVER,
                                            "--slot wasn't found");
 
-                    DhcpOptMap& map = fVmOptionRead ? VmSlot2Options[VmNameSlotKey(pszVmName, u8Slot)]
+                    DhcpOpts &opts = fVmOptionRead ? VmSlot2Options[VmNameSlotKey(pszVmName, u8Slot)]
                                                     : GlobalDhcpOptions;
                     std::string strVal = ValueUnion.psz;
-                    map.insert(DhcpOptValuePair((DhcpOpt_T)u8OptId, strVal));
+                    opts.push_back(DhcpOptSpec((DhcpOpt_T)u8OptId, strVal));
 
                 }
                 break; // --end of value
diff --git a/src/VBox/HostDrivers/Support/win/SUPHardenedVerify-win.h b/src/VBox/HostDrivers/Support/win/SUPHardenedVerify-win.h
index 1a27a1c..9b18df8 100644
--- a/src/VBox/HostDrivers/Support/win/SUPHardenedVerify-win.h
+++ b/src/VBox/HostDrivers/Support/win/SUPHardenedVerify-win.h
@@ -75,7 +75,8 @@ DECLHIDDEN(int)     supHardenedWinVerifyProcess(HANDLE hProcess, HANDLE hThread,
                                                 uint32_t *pcFixes, PRTERRINFO pErrInfo);
 DECLHIDDEN(int)     supHardNtVpThread(HANDLE hProcess, HANDLE hThread, PRTERRINFO pErrInfo);
 DECLHIDDEN(int)     supHardNtVpDebugger(HANDLE hProcess, PRTERRINFO pErrInfo);
-
+DECLHIDDEN(PRTUTF16) supHardNtVpIsPossible8dot3Path(PCRTUTF16 pwszPath);
+DECLHIDDEN(void)    supHardNtVpFix8dot3Path(PUNICODE_STRING pUniStr, bool fPathOnly);
 
 DECLHIDDEN(bool)    supHardViUtf16PathIsEqualEx(PCRTUTF16 pawcLeft, size_t cwcLeft, const char *pszRight);
 DECLHIDDEN(bool)    supHardViUniStrPathStartsWithUniStr(UNICODE_STRING const *pUniStrLeft,
diff --git a/src/VBox/HostDrivers/Support/win/SUPHardenedVerifyProcess-win.cpp b/src/VBox/HostDrivers/Support/win/SUPHardenedVerifyProcess-win.cpp
index 0c08b26..17ab34b 100644
--- a/src/VBox/HostDrivers/Support/win/SUPHardenedVerifyProcess-win.cpp
+++ b/src/VBox/HostDrivers/Support/win/SUPHardenedVerifyProcess-win.cpp
@@ -1089,6 +1089,170 @@ DECLHIDDEN(int) supHardNtVpDebugger(HANDLE hProcess, PRTERRINFO pErrInfo)
 
 
 /**
+ * Checks whether the path could be containing alternative 8.3 names generated
+ * by NTFS, FAT, or other similar file systems.
+ *
+ * @returns Pointer to the first component that might be an 8.3 name, NULL if
+ *          not 8.3 path.
+ * @param   pwszPath        The path to check.
+ *
+ * @remarks This is making bad ASSUMPTION wrt to the naming scheme of 8.3 names,
+ *          however, non-tilde 8.3 aliases are probably rare enough to not be
+ *          worth all the extra code necessary to open each path component and
+ *          check if we've got the short name or not.
+ */
+DECLHIDDEN(PRTUTF16) supHardNtVpIsPossible8dot3Path(PCRTUTF16 pwszPath)
+{
+    PCRTUTF16 pwszName = pwszPath;
+    for (;;)
+    {
+        RTUTF16 wc = *pwszPath++;
+        if (wc == '~')
+        {
+            /* Could check more here before jumping to conclusions... */
+            if (pwszPath - pwszName <= 8+1+3)
+                return (PRTUTF16)pwszName;
+        }
+        else if (wc == '\\' || wc == '/' || wc == ':')
+            pwszName = pwszPath;
+        else if (wc == 0)
+            break;
+    }
+    return NULL;
+}
+
+
+/**
+ * Fixes up a path possibly containing one or more alternative 8-dot-3 style
+ * components.
+ *
+ * The path is fixed up in place.  Errors are ignored.
+ *
+ * @param   pUniStr     The path to fix up. MaximumLength is the max buffer
+ *                      length.
+ */
+DECLHIDDEN(void) supHardNtVpFix8dot3Path(PUNICODE_STRING pUniStr, bool fPathOnly)
+{
+    /*
+     * We could use FileNormalizedNameInformation here and slap the volume device
+     * path in front of the result, but it's only supported since windows 8.0
+     * according to some docs... So we expand all supicious names.
+     */
+    union fix8dot3tmp
+    {
+        FILE_BOTH_DIR_INFORMATION Info;
+        uint8_t abBuffer[sizeof(FILE_BOTH_DIR_INFORMATION) + 2048 * sizeof(WCHAR)];
+    } *puBuf = NULL;
+
+
+    PRTUTF16 pwszFix = pUniStr->Buffer;
+    while (*pwszFix)
+    {
+        pwszFix = supHardNtVpIsPossible8dot3Path(pwszFix);
+        if (pwszFix == NULL)
+            break;
+
+        RTUTF16 wc;
+        PRTUTF16 pwszFixEnd = pwszFix;
+        while ((wc = *pwszFixEnd) != '\0' && wc != '\\' && wc != '/')
+            pwszFixEnd++;
+        if (wc == '\0' && fPathOnly)
+            break;
+
+        if (!puBuf)
+        {
+            puBuf = (union fix8dot3tmp *)RTMemAlloc(sizeof(*puBuf));
+            if (!puBuf)
+                break;
+        }
+
+        RTUTF16 const wcSaved = *pwszFix;
+        *pwszFix = '\0';                     /* paranoia. */
+
+        UNICODE_STRING      NtDir;
+        NtDir.Buffer = pUniStr->Buffer;
+        NtDir.Length = NtDir.MaximumLength = (USHORT)((pwszFix - pUniStr->Buffer) * sizeof(WCHAR));
+
+        HANDLE              hDir  = RTNT_INVALID_HANDLE_VALUE;
+        IO_STATUS_BLOCK     Ios   = RTNT_IO_STATUS_BLOCK_INITIALIZER;
+
+        OBJECT_ATTRIBUTES   ObjAttr;
+        InitializeObjectAttributes(&ObjAttr, &NtDir, OBJ_CASE_INSENSITIVE, NULL /*hRootDir*/, NULL /*pSecDesc*/);
+#ifdef IN_RING0
+        ObjAttr.Attributes |= OBJ_KERNEL_HANDLE;
+#endif
+
+        NTSTATUS rcNt = NtCreateFile(&hDir,
+                                     FILE_READ_DATA | SYNCHRONIZE,
+                                     &ObjAttr,
+                                     &Ios,
+                                     NULL /* Allocation Size*/,
+                                     FILE_ATTRIBUTE_NORMAL,
+                                     FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
+                                     FILE_OPEN,
+                                     FILE_DIRECTORY_FILE | FILE_OPEN_FOR_BACKUP_INTENT | FILE_SYNCHRONOUS_IO_NONALERT,
+                                     NULL /*EaBuffer*/,
+                                     0 /*EaLength*/);
+        *pwszFix = wcSaved;
+        if (NT_SUCCESS(rcNt))
+        {
+            RT_ZERO(*puBuf);
+
+            IO_STATUS_BLOCK Ios = RTNT_IO_STATUS_BLOCK_INITIALIZER;
+            UNICODE_STRING  NtFilterStr;
+            NtFilterStr.Buffer = pwszFix;
+            NtFilterStr.Length = (USHORT)((uintptr_t)pwszFixEnd - (uintptr_t)pwszFix);
+            NtFilterStr.MaximumLength = NtFilterStr.Length;
+            rcNt = NtQueryDirectoryFile(hDir,
+                                        NULL /* Event */,
+                                        NULL /* ApcRoutine */,
+                                        NULL /* ApcContext */,
+                                        &Ios,
+                                        puBuf,
+                                        sizeof(*puBuf) - sizeof(WCHAR),
+                                        FileBothDirectoryInformation,
+                                        FALSE /*ReturnSingleEntry*/,
+                                        &NtFilterStr,
+                                        FALSE /*RestartScan */);
+            if (NT_SUCCESS(rcNt) && puBuf->Info.NextEntryOffset == 0) /* There shall only be one entry matching... */
+            {
+                uint32_t offName = puBuf->Info.FileNameLength / sizeof(WCHAR);
+                while (offName > 0  && puBuf->Info.FileName[offName - 1] != '\\' && puBuf->Info.FileName[offName - 1] != '/')
+                    offName--;
+                uint32_t cwcNameNew = (puBuf->Info.FileNameLength / sizeof(WCHAR)) - offName;
+                uint32_t cwcNameOld = (uint32_t)(pwszFixEnd - pwszFix);
+
+                if (cwcNameOld == cwcNameNew)
+                    memcpy(pwszFix, &puBuf->Info.FileName[offName], cwcNameNew * sizeof(WCHAR));
+                else if (   pUniStr->Length + cwcNameNew * sizeof(WCHAR) - cwcNameOld * sizeof(WCHAR) + sizeof(WCHAR)
+                         <= pUniStr->MaximumLength)
+                {
+                    size_t cwcLeft = pUniStr->Length - (pwszFixEnd - pUniStr->Buffer) * sizeof(WCHAR) + sizeof(WCHAR);
+                    memmove(&pwszFix[cwcNameNew], pwszFixEnd, cwcLeft * sizeof(WCHAR));
+                    pUniStr->Length -= (USHORT)(cwcNameOld * sizeof(WCHAR));
+                    pUniStr->Length += (USHORT)(cwcNameNew * sizeof(WCHAR));
+                    pwszFixEnd      -= cwcNameOld;
+                    pwszFixEnd      -= cwcNameNew;
+                    memcpy(pwszFix, &puBuf->Info.FileName[offName], cwcNameNew * sizeof(WCHAR));
+                }
+                /* else: ignore overflow. */
+            }
+            /* else: ignore failure. */
+
+            NtClose(hDir);
+        }
+
+        /* Advance */
+        pwszFix = pwszFixEnd;
+    }
+
+    if (puBuf)
+        RTMemFree(puBuf);
+}
+
+
+
+/**
  * Matches two UNICODE_STRING structures in a case sensitive fashion.
  *
  * @returns true if equal, false if not.
@@ -1132,39 +1296,63 @@ static bool supHardNtVpAreNamesEqual(const char *pszName1, PCRTUTF16 pwszName2)
 /**
  * Records an additional memory region for an image.
  *
+ * May trash pThis->abMemory.
+ *
  * @returns VBox status code.
  * @retval  VINF_OBJECT_DESTROYED if we've unmapped the image (child
  *          purification only).
  * @param   pThis               The process scanning state structure.
  * @param   pImage              The new image structure.  Only the unicode name
- *                              buffer is valid.
+ *                              buffer is valid (it's zero-terminated).
  * @param   pMemInfo            The memory information for the image.
  */
 static int supHardNtVpNewImage(PSUPHNTVPSTATE pThis, PSUPHNTVPIMAGE pImage, PMEMORY_BASIC_INFORMATION pMemInfo)
 {
     /*
+     * If the filename or path contains short names, we have to get the long
+     * path so that we will recognize the DLLs and their location.
+     */
+    PUNICODE_STRING pLongName = &pImage->Name.UniStr;
+    if (supHardNtVpIsPossible8dot3Path(pLongName->Buffer))
+    {
+        AssertCompile(sizeof(pThis->abMemory) > sizeof(pImage->Name));
+        PUNICODE_STRING pTmp = (PUNICODE_STRING)pThis->abMemory;
+        pTmp->MaximumLength = (USHORT)RT_MIN(_64K - 1, sizeof(pThis->abMemory) - sizeof(*pTmp)) - sizeof(RTUTF16);
+        pTmp->Length = pImage->Name.UniStr.Length;
+        pTmp->Buffer = (PRTUTF16)(pTmp + 1);
+        memcpy(pTmp->Buffer, pLongName->Buffer, pLongName->Length + sizeof(RTUTF16));
+
+        supHardNtVpFix8dot3Path(pTmp, false /*fPathOnly*/);
+        Assert(pTmp->Buffer[pTmp->Length / sizeof(RTUTF16)] == '\0');
+
+        pLongName = pTmp;
+    }
+
+    /*
      * Extract the final component.
      */
-    unsigned  cwcDirName   = pImage->Name.UniStr.Length / sizeof(WCHAR);
-    PCRTUTF16 pwszFilename = &pImage->Name.UniStr.Buffer[cwcDirName];
+    RTUTF16   wc;
+    unsigned  cwcDirName   = pLongName->Length / sizeof(WCHAR);
+    PCRTUTF16 pwcDirName   = &pLongName->Buffer[cwcDirName];
+    PCRTUTF16 pwszFilename = &pLongName->Buffer[cwcDirName];
     while (   cwcDirName > 0
-           && pwszFilename[-1] != '\\'
-           && pwszFilename[-1] != '/'
-           && pwszFilename[-1] != ':')
+           && (wc = pwszFilename[-1]) != '\\'
+           && wc != '/'
+           && wc != ':')
     {
         pwszFilename--;
         cwcDirName--;
     }
     if (!*pwszFilename)
         return supHardNtVpSetInfo2(pThis, VERR_SUP_VP_NO_IMAGE_MAPPING_NAME,
-                                   "Empty filename (len=%u) for image at %p.", pImage->Name.UniStr.Length, pMemInfo->BaseAddress);
+                                   "Empty filename (len=%u) for image at %p.", pLongName->Length, pMemInfo->BaseAddress);
 
     /*
      * Drop trailing slashes from the directory name.
      */
     while (   cwcDirName > 0
-           && (   pImage->Name.UniStr.Buffer[cwcDirName - 1] == '\\'
-               || pImage->Name.UniStr.Buffer[cwcDirName - 1] == '/'))
+           && (   pLongName->Buffer[cwcDirName - 1] == '\\'
+               || pLongName->Buffer[cwcDirName - 1] == '/'))
         cwcDirName--;
 
     /*
@@ -1180,18 +1368,16 @@ static int supHardNtVpNewImage(PSUPHNTVPSTATE pThis, PSUPHNTVPIMAGE pImage, PMEM
 #ifndef VBOX_PERMIT_VISUAL_STUDIO_PROFILING
             /* The directory name must match the one we've got for System32. */
             if (   (   cwcDirName * sizeof(WCHAR) != g_System32NtPath.UniStr.Length
-                    || suplibHardenedMemComp(pImage->Name.UniStr.Buffer,
-                                            g_System32NtPath.UniStr.Buffer,
-                                            cwcDirName * sizeof(WCHAR)) )
+                    || suplibHardenedMemComp(pLongName->Buffer, g_System32NtPath.UniStr.Buffer, cwcDirName * sizeof(WCHAR)) )
 # ifdef VBOX_PERMIT_MORE
                 && (   pImage->pszName[0] != 'a'
                     || pImage->pszName[1] != 'c'
-                    || !supHardViIsAppPatchDir(pImage->Name.UniStr.Buffer, pImage->Name.UniStr.Length / sizeof(WCHAR)) )
+                    || !supHardViIsAppPatchDir(pLongName->Buffer, pLongName->Length / sizeof(WCHAR)) )
 # endif
                 )
                 return supHardNtVpSetInfo2(pThis, VERR_SUP_VP_NON_SYSTEM32_DLL,
                                            "Expected %ls to be loaded from %ls.",
-                                           pImage->Name.UniStr.Buffer, g_System32NtPath.UniStr.Buffer);
+                                           pLongName->Buffer, g_System32NtPath.UniStr.Buffer);
 # ifdef VBOX_PERMIT_MORE
             if (g_uNtVerCombined < SUP_NT_VER_W70 && i >= VBOX_PERMIT_MORE_FIRST_IDX)
                 pImage->pszName = NULL; /* hard limit: user32.dll is unwanted prior to w7. */
@@ -1227,7 +1413,7 @@ static int supHardNtVpNewImage(PSUPHNTVPSTATE pThis, PSUPHNTVPIMAGE pImage, PMEM
             && pThis->enmKind == SUPHARDNTVPKIND_CHILD_PURIFICATION)
         {
             SUP_DPRINTF(("supHardNtVpScanVirtualMemory: Unmapping image mem at %p (%p LB %#zx) - '%ls'\n",
-                         pMemInfo->AllocationBase, pMemInfo->BaseAddress, pMemInfo->RegionSize));
+                         pMemInfo->AllocationBase, pMemInfo->BaseAddress, pMemInfo->RegionSize, pwszFilename));
             NTSTATUS rcNt = NtUnmapViewOfSection(pThis->hProcess, pMemInfo->AllocationBase);
             if (NT_SUCCESS(rcNt))
                 return VINF_OBJECT_DESTROYED;
@@ -1249,11 +1435,11 @@ static int supHardNtVpNewImage(PSUPHNTVPSTATE pThis, PSUPHNTVPIMAGE pImage, PMEM
                                 "You or your admin need to add and exception to the Application and Device Control (ADC) "
                                 "component (or disable it) to prevent ADC from injecting itself into the VirtualBox VM processes. "
                                 "See http://www.symantec.com/connect/articles/creating-application-control-exclusions-symantec-endpoint-protection-121"
-                                , pImage->Name.UniStr.Buffer, pMemInfo->BaseAddress);
+                                , pLongName->Buffer, pMemInfo->BaseAddress);
             return pThis->rcResult = VERR_SUP_VP_SYSFER_DLL; /* Try make sure this is what the user sees first! */
         }
         return supHardNtVpSetInfo2(pThis, VERR_SUP_VP_NOT_KNOWN_DLL_OR_EXE,
-                                   "Unknown image file %ls at %p.", pImage->Name.UniStr.Buffer, pMemInfo->BaseAddress);
+                                   "Unknown image file %ls at %p.", pLongName->Buffer, pMemInfo->BaseAddress);
     }
 
     /*
@@ -1358,7 +1544,7 @@ static int supHardNtVpAddRegion(PSUPHNTVPSTATE pThis, PSUPHNTVPIMAGE pImage, PME
  * Scans the virtual memory of the process.
  *
  * This collects the locations of DLLs and the EXE, and verifies that executable
- * memory is only associated with these.
+ * memory is only associated with these.  May trash pThis->abMemory.
  *
  * @returns VBox status code.
  * @param   pThis               The process scanning state structure. Details
diff --git a/src/VBox/HostDrivers/Support/win/SUPR3HardenedMain-win.cpp b/src/VBox/HostDrivers/Support/win/SUPR3HardenedMain-win.cpp
index 32c747c..c0f8e6c 100644
--- a/src/VBox/HostDrivers/Support/win/SUPR3HardenedMain-win.cpp
+++ b/src/VBox/HostDrivers/Support/win/SUPR3HardenedMain-win.cpp
@@ -1131,150 +1131,6 @@ static void supR3HardenedWinVerifyCacheProcessWvtTodos(void)
 
 
 /**
- * Checks whether the path could be containing alternative 8.3 names generated
- * by NTFS, FAT, or other similar file systems.
- *
- * @returns Pointer to the first component that might be an 8.3 name, NULL if
- *          not 8.3 path.
- * @param   pwszPath        The path to check.
- */
-static PRTUTF16 supR3HardenedWinIsPossible8dot3Path(PCRTUTF16 pwszPath)
-{
-    PCRTUTF16 pwszName = pwszPath;
-    for (;;)
-    {
-        RTUTF16 wc = *pwszPath++;
-        if (wc == '~')
-        {
-            /* Could check more here before jumping to conclusions... */
-            if (pwszPath - pwszName <= 8+1+3)
-                return (PRTUTF16)pwszName;
-        }
-        else if (wc == '\\' || wc == '/' || wc == ':')
-            pwszName = pwszPath;
-        else if (wc == 0)
-            break;
-    }
-    return NULL;
-}
-
-
-/**
- * Fixes up a path possibly containing one or more alternative 8-dot-3 style
- * components.
- *
- * The path is fixed up in place.  Errors are ignored.
- *
- * @param   hFile       The handle to the file which path we're fixing up.
- * @param   pUniStr     The path to fix up. MaximumLength is the max buffer
- *                      length.
- */
-static void supR3HardenedWinFix8dot3Path(HANDLE hFile, PUNICODE_STRING pUniStr)
-{
-    /*
-     * We could use FileNormalizedNameInformation here and slap the volume device
-     * path in front of the result, but it's only supported since windows 8.0
-     * according to some docs... So we expand all supicious names.
-     */
-    PRTUTF16 pwszFix = pUniStr->Buffer;
-    while (*pwszFix)
-    {
-        pwszFix = supR3HardenedWinIsPossible8dot3Path(pwszFix);
-        if (pwszFix == NULL)
-            break;
-
-        RTUTF16 wc;
-        PRTUTF16 pwszFixEnd = pwszFix;
-        while ((wc = *pwszFixEnd) != '\0' && wc != '\\' && wc != '/')
-            pwszFixEnd++;
-        if (wc == '\0')
-            break;
-
-        RTUTF16 const wcSaved = *pwszFix;
-        *pwszFix = '\0';                     /* paranoia. */
-
-        UNICODE_STRING      NtDir;
-        NtDir.Buffer = pUniStr->Buffer;
-        NtDir.Length = NtDir.MaximumLength = (USHORT)((pwszFix - pUniStr->Buffer) * sizeof(WCHAR));
-
-        HANDLE              hDir  = RTNT_INVALID_HANDLE_VALUE;
-        IO_STATUS_BLOCK     Ios   = RTNT_IO_STATUS_BLOCK_INITIALIZER;
-
-        OBJECT_ATTRIBUTES   ObjAttr;
-        InitializeObjectAttributes(&ObjAttr, &NtDir, OBJ_CASE_INSENSITIVE, NULL /*hRootDir*/, NULL /*pSecDesc*/);
-
-        NTSTATUS rcNt = NtCreateFile(&hDir,
-                                     FILE_READ_DATA | SYNCHRONIZE,
-                                     &ObjAttr,
-                                     &Ios,
-                                     NULL /* Allocation Size*/,
-                                     FILE_ATTRIBUTE_NORMAL,
-                                     FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
-                                     FILE_OPEN,
-                                     FILE_DIRECTORY_FILE | FILE_OPEN_FOR_BACKUP_INTENT | FILE_SYNCHRONOUS_IO_NONALERT,
-                                     NULL /*EaBuffer*/,
-                                     0 /*EaLength*/);
-        *pwszFix = wcSaved;
-        if (NT_SUCCESS(rcNt))
-        {
-            union
-            {
-                FILE_BOTH_DIR_INFORMATION Info;
-                uint8_t abBuffer[sizeof(FILE_BOTH_DIR_INFORMATION) + 2048 * sizeof(WCHAR)];
-            } uBuf;
-            RT_ZERO(uBuf);
-
-            IO_STATUS_BLOCK Ios = RTNT_IO_STATUS_BLOCK_INITIALIZER;
-            UNICODE_STRING  NtFilterStr;
-            NtFilterStr.Buffer = pwszFix;
-            NtFilterStr.Length = (USHORT)((uintptr_t)pwszFixEnd - (uintptr_t)pwszFix);
-            NtFilterStr.MaximumLength = NtFilterStr.Length;
-            rcNt = NtQueryDirectoryFile(hDir,
-                                        NULL /* Event */,
-                                        NULL /* ApcRoutine */,
-                                        NULL /* ApcContext */,
-                                        &Ios,
-                                        &uBuf,
-                                        sizeof(uBuf) - sizeof(WCHAR),
-                                        FileBothDirectoryInformation,
-                                        FALSE /*ReturnSingleEntry*/,
-                                        &NtFilterStr,
-                                        FALSE /*RestartScan */);
-            if (NT_SUCCESS(rcNt) && uBuf.Info.NextEntryOffset == 0) /* There shall only be one entry matching... */
-            {
-                uint32_t offName = uBuf.Info.FileNameLength / sizeof(WCHAR);
-                while (offName > 0  && uBuf.Info.FileName[offName - 1] != '\\' && uBuf.Info.FileName[offName - 1] != '/')
-                    offName--;
-                uint32_t cwcNameNew = (uBuf.Info.FileNameLength / sizeof(WCHAR)) - offName;
-                uint32_t cwcNameOld = pwszFixEnd - pwszFix;
-
-                if (cwcNameOld == cwcNameNew)
-                    memcpy(pwszFix, &uBuf.Info.FileName[offName], cwcNameNew * sizeof(WCHAR));
-                else if (   pUniStr->Length + cwcNameNew * sizeof(WCHAR) - cwcNameOld * sizeof(WCHAR) + sizeof(WCHAR)
-                         <= pUniStr->MaximumLength)
-                {
-                    size_t cwcLeft = pUniStr->Length - (pwszFixEnd - pUniStr->Buffer) * sizeof(WCHAR) + sizeof(WCHAR);
-                    memmove(&pwszFix[cwcNameNew], pwszFixEnd, cwcLeft * sizeof(WCHAR));
-                    pUniStr->Length -= (USHORT)(cwcNameOld * sizeof(WCHAR));
-                    pUniStr->Length += (USHORT)(cwcNameNew * sizeof(WCHAR));
-                    pwszFixEnd      -= cwcNameOld;
-                    pwszFixEnd      -= cwcNameNew;
-                    memcpy(pwszFix, &uBuf.Info.FileName[offName], cwcNameNew * sizeof(WCHAR));
-                }
-                /* else: ignore overflow. */
-            }
-            /* else: ignore failure. */
-
-            NtClose(hDir);
-        }
-
-        /* Advance */
-        pwszFix = pwszFixEnd;
-    }
-}
-
-
-/**
  * Screens an image file or file mapped with execute access.
  *
  * @returns NT status code.
@@ -1323,10 +1179,10 @@ static NTSTATUS supR3HardenedScreenImage(HANDLE hFile, bool fImage, bool fIgnore
         return rcNt;
     }
 
-    if (supR3HardenedWinIsPossible8dot3Path(uBuf.UniStr.Buffer))
+    if (supHardNtVpIsPossible8dot3Path(uBuf.UniStr.Buffer))
     {
         uBuf.UniStr.MaximumLength = sizeof(uBuf) - 128;
-        supR3HardenedWinFix8dot3Path(hFile, &uBuf.UniStr);
+        supHardNtVpFix8dot3Path(&uBuf.UniStr, true /*fPathOnly*/);
     }
 
     /*
@@ -5477,7 +5333,7 @@ extern "C" void __stdcall suplibHardenedWindowsMain(void)
     g_fSupAdversaries = supR3HardenedWinFindAdversaries();
 
     /*
-     * Get the executable name.
+     * Get the executable name, make sure it's the long version.
      */
     DWORD cwcExecName = GetModuleFileNameW(GetModuleHandleW(NULL), g_wszSupLibHardenedExePath,
                                            RT_ELEMENTS(g_wszSupLibHardenedExePath));
@@ -5485,7 +5341,15 @@ extern "C" void __stdcall suplibHardenedWindowsMain(void)
         supR3HardenedFatalMsg("suplibHardenedWindowsMain", kSupInitOp_Integrity, VERR_BUFFER_OVERFLOW,
                               "The executable path is too long.");
 
-    /* The NT version. */
+    RTUTF16 wszLong[RT_ELEMENTS(g_wszSupLibHardenedExePath)];
+    DWORD cwcLong = GetLongPathNameW(g_wszSupLibHardenedExePath, wszLong, RT_ELEMENTS(wszLong));
+    if (cwcLong > 0)
+    {
+        memcpy(g_wszSupLibHardenedExePath, wszLong, (cwcLong + 1) * sizeof(RTUTF16));
+        cwcExecName = cwcLong;
+    }
+
+    /* The NT version of it. */
     HANDLE hFile = CreateFileW(g_wszSupLibHardenedExePath, GENERIC_READ, FILE_SHARE_READ, NULL /*pSecurityAttributes*/,
                                OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL /*hTemplateFile*/);
     if (hFile == NULL || hFile == INVALID_HANDLE_VALUE)
diff --git a/src/VBox/HostDrivers/Support/win/import-template-kernel32.h b/src/VBox/HostDrivers/Support/win/import-template-kernel32.h
index 1466d94..f761d73 100644
--- a/src/VBox/HostDrivers/Support/win/import-template-kernel32.h
+++ b/src/VBox/HostDrivers/Support/win/import-template-kernel32.h
@@ -4,6 +4,7 @@ SUPHARNT_IMPORT_STDCALL(ExitProcess, 4)
 SUPHARNT_IMPORT_STDCALL(GetFullPathNameA, 16)
 SUPHARNT_IMPORT_STDCALL(GetFullPathNameW, 16)
 SUPHARNT_IMPORT_STDCALL(GetCurrentDirectoryW, 8)
+SUPHARNT_IMPORT_STDCALL(GetLongPathNameW, 12)
 SUPHARNT_IMPORT_STDCALL(GetModuleFileNameW, 12)
 SUPHARNT_IMPORT_STDCALL(GetModuleHandleA, 4)
 SUPHARNT_IMPORT_STDCALL(GetModuleHandleW, 4)
diff --git a/src/VBox/HostDrivers/VBoxNetFlt/linux/VBoxNetFlt-linux.c b/src/VBox/HostDrivers/VBoxNetFlt/linux/VBoxNetFlt-linux.c
index ff62274..18d4910 100644
--- a/src/VBox/HostDrivers/VBoxNetFlt/linux/VBoxNetFlt-linux.c
+++ b/src/VBox/HostDrivers/VBoxNetFlt/linux/VBoxNetFlt-linux.c
@@ -51,6 +51,11 @@
 #define VBOXNETFLT_OS_SPECFIC 1
 #include "../VBoxNetFltInternal.h"
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 20, 0)
+# define vlan_tx_tag_get(skb)       skb_vlan_tag_get(skb)
+# define vlan_tx_tag_present(skb)   skb_vlan_tag_present(skb)
+#endif
+
 
 /*******************************************************************************
 *   Defined Constants And Macros                                               *
diff --git a/src/VBox/Installer/win/VBoxMergeApp.wxi b/src/VBox/Installer/win/VBoxMergeApp.wxi
index bb8e5db..714eee4 100644
--- a/src/VBox/Installer/win/VBoxMergeApp.wxi
+++ b/src/VBox/Installer/win/VBoxMergeApp.wxi
@@ -230,7 +230,7 @@
               Source="$(env.PATH_OUT)\bin\VBoxAuthSimple.dll" />
 
         <!-- Include resource DLL (icons, ...) -->
-        <File Id="file_VBoxRes.dll" Name="VBoxRes.dll" DiskId="$(var.Property_DiskIdCommon)"
+        <File Id="file_VBoxRes.dll" Name="VBoxRes.dll"
               Source="$(env.PATH_OUT)\bin\VBoxRes.dll" />
 
         <File Id="file_VMMGC.gc" Name="VMMGC.gc"
diff --git a/src/VBox/Main/include/DHCPServerImpl.h b/src/VBox/Main/include/DHCPServerImpl.h
index f326405..99d8c79 100644
--- a/src/VBox/Main/include/DHCPServerImpl.h
+++ b/src/VBox/Main/include/DHCPServerImpl.h
@@ -21,16 +21,12 @@
 #define ____H_H_DHCPSERVERIMPL
 
 #include "VirtualBoxBase.h"
+#include <VBox/settings.h>
 
 #ifdef VBOX_WITH_HOSTNETIF_API
 struct NETIFINFO;
 #endif
 
-namespace settings
-{
-    struct DHCPServer;
-    struct VmNameSlotKey;
-}
 #ifdef RT_OS_WINDOWS
 # define DHCP_EXECUTABLE_NAME "VBoxNetDHCP.exe"
 #else
@@ -61,14 +57,16 @@ public:
  *  the middle.
  */
 
-typedef std::map<DhcpOpt_T, com::Utf8Str> DhcpOptionMap;
-typedef DhcpOptionMap::value_type DhcpOptValuePair;
-typedef DhcpOptionMap::const_iterator DhcpOptConstIterator;
-typedef DhcpOptionMap::iterator DhcpOptIterator;
+using settings::DhcpOptValue;
+using settings::DhcpOptionMap;
+using settings::DhcpOptValuePair;
+using settings::DhcpOptConstIterator;
+using settings::DhcpOptIterator;
 
-typedef std::map<settings::VmNameSlotKey, DhcpOptionMap> VmSlot2OptionsMap;
-typedef VmSlot2OptionsMap::value_type VmSlot2OptionsPair;
-typedef VmSlot2OptionsMap::iterator VmSlot2OptionsIterator;
+using settings::VmNameSlotKey;
+using settings::VmSlot2OptionsMap;
+using settings::VmSlot2OptionsPair;
+using settings::VmSlot2OptionsIterator;
 
 
 class ATL_NO_VTABLE DHCPServer :
@@ -110,8 +108,8 @@ public:
     STDMETHOD(COMGETTER(UpperIP))(BSTR *aIPAddress);
 
     STDMETHOD(AddGlobalOption)(DhcpOpt_T aOption, IN_BSTR aValue);
-    STDMETHOD(COMGETTER(GlobalOptions))(ComSafeArrayOut(BSTR, aValue));
-    STDMETHOD(COMGETTER(VmConfigs))(ComSafeArrayOut(BSTR, aValue));
+    STDMETHOD(COMGETTER(GlobalOptions))(ComSafeArrayOut(BSTR, aValues));
+    STDMETHOD(COMGETTER(VmConfigs))(ComSafeArrayOut(BSTR, aValues));
     STDMETHOD(AddVmSlotOption)(IN_BSTR aVmName, LONG aSlot, DhcpOpt_T aOption, IN_BSTR aValue);
     STDMETHOD(RemoveVmSlotOptions)(IN_BSTR aVmName, LONG aSlot);
     STDMETHOD(GetVmSlotOptions)(IN_BSTR aVmName, LONG aSlot, ComSafeArrayOut(BSTR, aValues));
@@ -132,6 +130,10 @@ private:
 
     DhcpOptionMap& findOptMapByVmNameSlot(const com::Utf8Str& aVmName,
                                           LONG Slot);
+    HRESULT encodeOption(com::Utf8Str &aEncoded,
+			 uint32_t aOptCode, const DhcpOptValue &aOptValue);
+    int addOption(DhcpOptionMap &aMap,
+		  DhcpOpt_T aOption, const com::Utf8Str &aValue);
 };
 
 #endif // ____H_H_DHCPSERVERIMPL
diff --git a/src/VBox/Main/include/DisplayImpl.h b/src/VBox/Main/include/DisplayImpl.h
index e21e1be..ad75347 100644
--- a/src/VBox/Main/include/DisplayImpl.h
+++ b/src/VBox/Main/include/DisplayImpl.h
@@ -128,6 +128,7 @@ public:
                                           int32_t *px2, int32_t *py2) = 0;
     virtual HRESULT i_reportHostCursorCapabilities(uint32_t fCapabilitiesAdded, uint32_t fCapabilitiesRemoved) = 0;
     virtual HRESULT i_reportHostCursorPosition(int32_t x, int32_t y) = 0;
+    virtual bool i_isInputMappingSet(void) = 0;
 };
 
 class VMMDev;
@@ -234,6 +235,10 @@ public:
     STDMETHOD(CompleteVHWACommand)(BYTE *pCommand);
     virtual HRESULT i_reportHostCursorCapabilities(uint32_t fCapabilitiesAdded, uint32_t fCapabilitiesRemoved);
     virtual HRESULT i_reportHostCursorPosition(int32_t x, int32_t y);
+    virtual bool i_isInputMappingSet(void)
+    {
+        return cxInputMapping != 0 && cyInputMapping != 0;
+    }
 
     STDMETHOD(ViewportChanged)(ULONG aScreenId, ULONG x, ULONG y, ULONG width, ULONG height);
 
diff --git a/src/VBox/Main/src-client/ConsoleImpl.cpp b/src/VBox/Main/src-client/ConsoleImpl.cpp
index b3d6e2b..f1df733 100644
--- a/src/VBox/Main/src-client/ConsoleImpl.cpp
+++ b/src/VBox/Main/src-client/ConsoleImpl.cpp
@@ -8058,7 +8058,7 @@ HRESULT Console::createSharedFolder(const Utf8Str &strName, const SharedFolderDa
     cbString = (bstrHostPath.length() + 1) * sizeof(RTUTF16);
     if (cbString >= UINT16_MAX)
         return setError(E_INVALIDARG, tr("The name is too long"));
-    pFolderName = (SHFLSTRING*)RTMemAllocZ(sizeof(SHFLSTRING) + cbString);
+    pFolderName = (SHFLSTRING*)RTMemAllocZ(SHFLSTRING_HEADER_SIZE + cbString);
     Assert(pFolderName);
     memcpy(pFolderName->String.ucs2, bstrHostPath.raw(), cbString);
 
@@ -8067,7 +8067,7 @@ HRESULT Console::createSharedFolder(const Utf8Str &strName, const SharedFolderDa
 
     parms[0].type = VBOX_HGCM_SVC_PARM_PTR;
     parms[0].u.pointer.addr = pFolderName;
-    parms[0].u.pointer.size = sizeof(SHFLSTRING) + (uint16_t)cbString;
+    parms[0].u.pointer.size = ShflStringSizeOfBuffer(pFolderName);
 
     cbString = (bstrName.length() + 1) * sizeof(RTUTF16);
     if (cbString >= UINT16_MAX)
@@ -8075,7 +8075,7 @@ HRESULT Console::createSharedFolder(const Utf8Str &strName, const SharedFolderDa
         RTMemFree(pFolderName);
         return setError(E_INVALIDARG, tr("The host path is too long"));
     }
-    pMapName = (SHFLSTRING*)RTMemAllocZ(sizeof(SHFLSTRING) + cbString);
+    pMapName = (SHFLSTRING*)RTMemAllocZ(SHFLSTRING_HEADER_SIZE + cbString);
     Assert(pMapName);
     memcpy(pMapName->String.ucs2, bstrName.raw(), cbString);
 
@@ -8084,7 +8084,7 @@ HRESULT Console::createSharedFolder(const Utf8Str &strName, const SharedFolderDa
 
     parms[1].type = VBOX_HGCM_SVC_PARM_PTR;
     parms[1].u.pointer.addr = pMapName;
-    parms[1].u.pointer.size = sizeof(SHFLSTRING) + (uint16_t)cbString;
+    parms[1].u.pointer.size = ShflStringSizeOfBuffer(pMapName);
 
     parms[2].type = VBOX_HGCM_SVC_PARM_32BIT;
     parms[2].u.uint32 = (aData.m_fWritable ? SHFL_ADD_MAPPING_F_WRITABLE : 0)
@@ -8138,7 +8138,7 @@ HRESULT Console::removeSharedFolder(const Utf8Str &strName)
     cbString = (bstrName.length() + 1) * sizeof(RTUTF16);
     if (cbString >= UINT16_MAX)
         return setError(E_INVALIDARG, tr("The name is too long"));
-    pMapName = (SHFLSTRING *) RTMemAllocZ(sizeof(SHFLSTRING) + cbString);
+    pMapName = (SHFLSTRING *) RTMemAllocZ(SHFLSTRING_HEADER_SIZE + cbString);
     Assert(pMapName);
     memcpy(pMapName->String.ucs2, bstrName.raw(), cbString);
 
@@ -8147,7 +8147,7 @@ HRESULT Console::removeSharedFolder(const Utf8Str &strName)
 
     parms.type = VBOX_HGCM_SVC_PARM_PTR;
     parms.u.pointer.addr = pMapName;
-    parms.u.pointer.size = sizeof(SHFLSTRING) + (uint16_t)cbString;
+    parms.u.pointer.size = ShflStringSizeOfBuffer(pMapName);
 
     int vrc = m_pVMMDev->hgcmHostCall("VBoxSharedFolders",
                                       SHFL_FN_REMOVE_MAPPING,
diff --git a/src/VBox/Main/src-client/DisplayImpl.cpp b/src/VBox/Main/src-client/DisplayImpl.cpp
index fc723bb..b5ab211 100644
--- a/src/VBox/Main/src-client/DisplayImpl.cpp
+++ b/src/VBox/Main/src-client/DisplayImpl.cpp
@@ -1390,7 +1390,7 @@ void Display::getFramebufferDimensions(int32_t *px1, int32_t *py1,
         x1 = xInputMappingOrigin;
         y1 = yInputMappingOrigin;
         x2 = xInputMappingOrigin + cxInputMapping;
-        y2 = xInputMappingOrigin + cyInputMapping;
+        y2 = yInputMappingOrigin + cyInputMapping;
     }
     else
         for (unsigned i = 1; i < mcMonitors; ++i)
diff --git a/src/VBox/Main/src-client/MouseImpl.cpp b/src/VBox/Main/src-client/MouseImpl.cpp
index 7648331..37e7bfc 100644
--- a/src/VBox/Main/src-client/MouseImpl.cpp
+++ b/src/VBox/Main/src-client/MouseImpl.cpp
@@ -605,7 +605,7 @@ HRESULT Mouse::convertDisplayRes(LONG x, LONG y, int32_t *pxAdj, int32_t *pyAdj,
 
     if (pfValid)
         *pfValid = true;
-    if (!(mfVMMDevGuestCaps & VMMDEV_MOUSE_NEW_PROTOCOL))
+    if (!(mfVMMDevGuestCaps & VMMDEV_MOUSE_NEW_PROTOCOL) && !pDisplay->i_isInputMappingSet())
     {
         ULONG displayWidth, displayHeight;
         /* Takes the display lock */
diff --git a/src/VBox/Main/src-server/DHCPServerImpl.cpp b/src/VBox/Main/src-server/DHCPServerImpl.cpp
index 1cd7ce7..93eea8f 100644
--- a/src/VBox/Main/src-server/DHCPServerImpl.cpp
+++ b/src/VBox/Main/src-server/DHCPServerImpl.cpp
@@ -107,7 +107,7 @@ HRESULT DHCPServer::init(VirtualBox *aVirtualBox, IN_BSTR aName)
 
     unconst(mName) = aName;
     m->IPAddress = "0.0.0.0";
-    m->GlobalDhcpOptions.insert(DhcpOptValuePair(DhcpOpt_SubnetMask, Bstr("0.0.0.0")));
+    m->GlobalDhcpOptions[DhcpOpt_SubnetMask] = DhcpOptValue("0.0.0.0");
     m->enabled = FALSE;
 
     m->lowerIP = "0.0.0.0";
@@ -183,8 +183,9 @@ STDMETHODIMP DHCPServer::COMGETTER(NetworkName) (BSTR *aName)
     AutoCaller autoCaller(this);
     if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
-    mName.cloneTo(aName);
+    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
 
+    mName.cloneTo(aName);
     return S_OK;
 }
 
@@ -196,8 +197,9 @@ STDMETHODIMP DHCPServer::COMGETTER(Enabled) (BOOL *aEnabled)
     AutoCaller autoCaller(this);
     if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
-    *aEnabled = m->enabled;
+    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
 
+    *aEnabled = m->enabled;
     return S_OK;
 }
 
@@ -226,8 +228,9 @@ STDMETHODIMP DHCPServer::COMGETTER(IPAddress) (BSTR *aIPAddress)
     AutoCaller autoCaller(this);
     if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
-    m->IPAddress.cloneTo(aIPAddress);
+    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
 
+    m->IPAddress.cloneTo(aIPAddress);
     return S_OK;
 }
 
@@ -239,8 +242,9 @@ STDMETHODIMP DHCPServer::COMGETTER(NetworkMask) (BSTR *aNetworkMask)
     AutoCaller autoCaller(this);
     if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
-    m->GlobalDhcpOptions[DhcpOpt_SubnetMask].cloneTo(aNetworkMask);
+    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
 
+    m->GlobalDhcpOptions[DhcpOpt_SubnetMask].text.cloneTo(aNetworkMask);
     return S_OK;
 }
 
@@ -252,8 +256,9 @@ STDMETHODIMP DHCPServer::COMGETTER(LowerIP) (BSTR *aIPAddress)
     AutoCaller autoCaller(this);
     if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
-    m->lowerIP.cloneTo(aIPAddress);
+    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
 
+    m->lowerIP.cloneTo(aIPAddress);
     return S_OK;
 }
 
@@ -265,8 +270,9 @@ STDMETHODIMP DHCPServer::COMGETTER(UpperIP) (BSTR *aIPAddress)
     AutoCaller autoCaller(this);
     if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
-    m->upperIP.cloneTo(aIPAddress);
+    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
 
+    m->upperIP.cloneTo(aIPAddress);
     return S_OK;
 }
 
@@ -283,7 +289,7 @@ STDMETHODIMP DHCPServer::SetConfiguration (IN_BSTR aIPAddress, IN_BSTR aNetworkM
 
     AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
     m->IPAddress = aIPAddress;
-    m->GlobalDhcpOptions[DhcpOpt_SubnetMask] = aNetworkMask;
+    m->GlobalDhcpOptions[DhcpOpt_SubnetMask] = DhcpOptValue(aNetworkMask);
 
     m->lowerIP = aLowerIP;
     m->upperIP = aUpperIP;
@@ -295,6 +301,118 @@ STDMETHODIMP DHCPServer::SetConfiguration (IN_BSTR aIPAddress, IN_BSTR aNetworkM
 }
 
 
+HRESULT DHCPServer::encodeOption(com::Utf8Str &aEncoded,
+                                 uint32_t aOptCode, const DhcpOptValue &aOptValue)
+{
+    switch (aOptValue.encoding)
+    {
+        case DhcpOptValue::LEGACY:
+        {
+            /*
+             * This is original encoding which assumed that for each
+             * option we know its format and so we know how option
+             * "value" text is to be interpreted.
+             *
+             *   "2:10800"           # integer 32
+             *   "6:1.2.3.4 8.8.8.8" # array of ip-address
+             */
+            aEncoded = Utf8StrFmt("%d:%s", aOptCode, aOptValue.text.c_str());
+            break;
+        }
+
+        case DhcpOptValue::HEX:
+        {
+            /*
+             * This is a bypass for any option - preformatted value as
+             * hex string with no semantic involved in formatting the
+             * value for the DHCP reply.
+             *
+             *   234=68:65:6c:6c:6f:2c:20:77:6f:72:6c:64
+             */
+            aEncoded = Utf8StrFmt("%d=%s", aOptCode, aOptValue.text.c_str());
+            break;
+        }
+
+        default:
+        {
+            /*
+             * Try to be forward compatible.
+             *
+             *   "254 at 42=i hope you know what this means"
+             */
+            aEncoded = Utf8StrFmt("%d@%d=%s", aOptCode, (int)aOptValue.encoding,
+                                  aOptValue.text.c_str());
+            break;
+        }
+    }
+
+    return S_OK;
+}
+
+
+int DHCPServer::addOption(DhcpOptionMap &aMap,
+                          DhcpOpt_T aOption, const com::Utf8Str &aValue)
+{
+    DhcpOptValue OptValue;
+
+    if (aOption != 0)
+    {
+        OptValue = DhcpOptValue(aValue, DhcpOptValue::LEGACY);
+    }
+    /*
+     * This is a kludge to sneak in option encoding information
+     * through existing API.  We use option 0 and supply the real
+     * option/value in the same format that encodeOption() above
+     * produces for getter methods.
+     */
+    else
+    {
+        uint8_t u8Code;
+        uint32_t u32Enc;
+        char *pszNext;
+        int rc;
+
+        rc = RTStrToUInt8Ex(aValue.c_str(), &pszNext, 10, &u8Code);
+        if (!RT_SUCCESS(rc))
+            return VERR_PARSE_ERROR;
+
+        switch (*pszNext)
+        {
+            case ':':           /* support legacy format too */
+            {
+                u32Enc = DhcpOptValue::LEGACY;
+                break;
+            }
+
+            case '=':
+            {
+                u32Enc = DhcpOptValue::HEX;
+                break;
+            }
+
+            case '@':
+            {
+                rc = RTStrToUInt32Ex(pszNext + 1, &pszNext, 10, &u32Enc);
+                if (!RT_SUCCESS(rc))
+                    return VERR_PARSE_ERROR;
+                if (*pszNext != '=')
+                    return VERR_PARSE_ERROR;
+                break;
+            }
+
+            default:
+                return VERR_PARSE_ERROR;
+        }
+
+        aOption = (DhcpOpt_T)u8Code;
+        OptValue = DhcpOptValue(pszNext + 1, (DhcpOptValue::Encoding)u32Enc);
+    }
+
+    aMap[aOption] = OptValue;
+    return VINF_SUCCESS;
+}
+
+
 STDMETHODIMP DHCPServer::AddGlobalOption(DhcpOpt_T aOption, IN_BSTR aValue)
 {
     CheckComArgStr(aValue);
@@ -304,8 +422,9 @@ STDMETHODIMP DHCPServer::AddGlobalOption(DhcpOpt_T aOption, IN_BSTR aValue)
 
     AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
 
-    m->GlobalDhcpOptions.insert(
-      DhcpOptValuePair(aOption, Utf8Str(aValue)));
+    int rc = addOption(m->GlobalDhcpOptions, aOption, aValue);
+    if (!RT_SUCCESS(rc))
+        return E_INVALIDARG;
 
     /* Indirect way to understand that we're on NAT network */
     if (aOption == DhcpOpt_Router)
@@ -318,9 +437,9 @@ STDMETHODIMP DHCPServer::AddGlobalOption(DhcpOpt_T aOption, IN_BSTR aValue)
 }
 
 
-STDMETHODIMP DHCPServer::COMGETTER(GlobalOptions)(ComSafeArrayOut(BSTR, aValue))
+STDMETHODIMP DHCPServer::COMGETTER(GlobalOptions)(ComSafeArrayOut(BSTR, aValues))
 {
-    CheckComArgOutSafeArrayPointerValid(aValue);
+    CheckComArgOutSafeArrayPointerValid(aValues);
 
     AutoCaller autoCaller(this);
     if (FAILED(autoCaller.rc())) return autoCaller.rc();
@@ -333,19 +452,24 @@ STDMETHODIMP DHCPServer::COMGETTER(GlobalOptions)(ComSafeArrayOut(BSTR, aValue))
     for (DhcpOptIterator it = m->GlobalDhcpOptions.begin();
          it != m->GlobalDhcpOptions.end(); ++it)
     {
-        Bstr(Utf8StrFmt("%d:%s", (*it).first, (*it).second.c_str())).detachTo(&sf[i]);
+        uint32_t OptCode = (*it).first;
+        const DhcpOptValue &OptValue = (*it).second;
+
+        com::Utf8Str value;
+        encodeOption(value, OptCode, OptValue);
+        Bstr(value).detachTo(&sf[i]);
         i++;
     }
 
-    sf.detachTo(ComSafeArrayOutArg(aValue));
+    sf.detachTo(ComSafeArrayOutArg(aValues));
 
     return S_OK;
 }
 
 
-STDMETHODIMP DHCPServer::COMGETTER(VmConfigs)(ComSafeArrayOut(BSTR, aValue))
+STDMETHODIMP DHCPServer::COMGETTER(VmConfigs)(ComSafeArrayOut(BSTR, aValues))
 {
-    CheckComArgOutSafeArrayPointerValid(aValue);
+    CheckComArgOutSafeArrayPointerValid(aValues);
 
     AutoCaller autoCaller(this);
     if (FAILED(autoCaller.rc())) return autoCaller.rc();
@@ -363,7 +487,7 @@ STDMETHODIMP DHCPServer::COMGETTER(VmConfigs)(ComSafeArrayOut(BSTR, aValue))
         i++;
     }
 
-    sf.detachTo(ComSafeArrayOutArg(aValue));
+    sf.detachTo(ComSafeArrayOutArg(aValues));
 
     return S_OK;
 }
@@ -375,10 +499,10 @@ STDMETHODIMP DHCPServer::AddVmSlotOption(IN_BSTR aVmName, LONG aSlot, DhcpOpt_T
     if (FAILED(autoCaller.rc())) return autoCaller.rc();
     AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
 
-    m->VmSlot2Options[settings::VmNameSlotKey(
-          com::Utf8Str(aVmName),
-          aSlot)][aOption] = com::Utf8Str(aValue);
-
+    DhcpOptionMap &map = m->VmSlot2Options[VmNameSlotKey(com::Utf8Str(aVmName), aSlot)];
+    int rc = addOption(map, aOption, aValue);
+    if (!RT_SUCCESS(rc))
+        return E_INVALIDARG;
 
     alock.release();
 
@@ -425,7 +549,12 @@ STDMETHODIMP DHCPServer::GetVmSlotOptions(IN_BSTR aVmName,
     for (DhcpOptIterator it = map.begin();
          it != map.end(); ++it)
     {
-        Bstr(Utf8StrFmt("%d:%s", (*it).first, (*it).second.c_str())).detachTo(&sf[i]);
+        uint32_t OptCode = (*it).first;
+        const DhcpOptValue &OptValue = (*it).second;
+
+        com::Utf8Str value;
+        encodeOption(value, OptCode, OptValue);
+        Bstr(value).detachTo(&sf[i]);
         i++;
     }
 
@@ -519,7 +648,7 @@ STDMETHODIMP DHCPServer::Start(IN_BSTR aNetworkName, IN_BSTR aTrunkName, IN_BSTR
                  guid.raw()->au8[2]);
     m->dhcp.setOption(NetworkServiceRunner::kNsrMacAddress, strMAC);
     m->dhcp.setOption(NetworkServiceRunner::kNsrIpAddress,  Utf8Str(m->IPAddress).c_str());
-    m->dhcp.setOption(NetworkServiceRunner::kNsrIpNetmask, Utf8Str(m->GlobalDhcpOptions[DhcpOpt_SubnetMask]).c_str());
+    m->dhcp.setOption(NetworkServiceRunner::kNsrIpNetmask, Utf8Str(m->GlobalDhcpOptions[DhcpOpt_SubnetMask].text).c_str());
     m->dhcp.setOption(DHCPServerRunner::kDsrKeyLowerIp, Utf8Str(m->lowerIP).c_str());
     m->dhcp.setOption(DHCPServerRunner::kDsrKeyUpperIp, Utf8Str(m->upperIP).c_str());
 
diff --git a/src/VBox/Main/src-server/HostDnsService.cpp b/src/VBox/Main/src-server/HostDnsService.cpp
index cd56461..9138762 100644
--- a/src/VBox/Main/src-server/HostDnsService.cpp
+++ b/src/VBox/Main/src-server/HostDnsService.cpp
@@ -4,7 +4,7 @@
  */
 
 /*
- * Copyright (C) 2013 Oracle Corporation
+ * Copyright (C) 2013-2015 Oracle Corporation
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
  * available from http://www.virtualbox.org. This file is free software;
@@ -65,6 +65,15 @@ ALock::~ALock()
     RTCritSectLeave(const_cast<PRTCRITSECT>(lockee->lock()));
 }
 
+/* HostDnsInformation */
+
+bool HostDnsInformation::equals(const HostDnsInformation &info) const
+{
+    return    (servers == info.servers)
+           && (domain == info.domain)
+           && (searchList == info.searchList);
+}
+
 inline static void detachVectorOfString(const std::vector<std::string>& v,
                                         ComSafeArrayOut(BSTR, aBstrArray))
 {
@@ -82,10 +91,14 @@ inline static void detachVectorOfString(const std::vector<std::string>& v,
 
 struct HostDnsMonitor::Data
 {
-    Data(bool aThreaded):fThreaded(aThreaded){}
+    Data(bool aThreaded) :
+        fInfoModified(false),
+        fThreaded(aThreaded)
+    {}
 
     std::vector<PCHostDnsMonitorProxy> proxies;
     HostDnsInformation info;
+    bool fInfoModified;
     const bool fThreaded;
     RTTHREAD hMonitoringThread;
     RTSEMEVENT hDnsInitEvent;
@@ -193,15 +206,27 @@ const HostDnsInformation &HostDnsMonitor::getInfo() const
 void HostDnsMonitor::notifyAll() const
 {
     ALock l(this);
-    std::vector<PCHostDnsMonitorProxy>::const_iterator it;
-    for (it = m->proxies.begin(); it != m->proxies.end(); ++it)
-        (*it)->notify();
+    if (m->fInfoModified)
+    {
+        m->fInfoModified = false;
+        std::vector<PCHostDnsMonitorProxy>::const_iterator it;
+        for (it = m->proxies.begin(); it != m->proxies.end(); ++it)
+            (*it)->notify();
+    }
 }
 
 void HostDnsMonitor::setInfo(const HostDnsInformation &info)
 {
     ALock l(this);
-    m->info = info;
+    // Check for actual modifications, as the Windows specific code seems to
+    // often set the same information as before, without any change to the
+    // previous state. Here we have the previous state, so make sure we don't
+    // ever tell our clients about unchanged info.
+    if (info.equals(m->info))
+    {
+        m->info = info;
+        m->fInfoModified = true;
+    }
 }
 
 HRESULT HostDnsMonitor::init()
@@ -260,6 +285,7 @@ void HostDnsMonitorProxy::init(const HostDnsMonitor *mon, const VirtualBox* aPar
 
 void HostDnsMonitorProxy::notify() const
 {
+    LogRel(("HostDnsMonitorProxy::notify\n"));
     m->fModified = true;
     const_cast<VirtualBox *>(m->virtualbox)->onHostNameResolutionConfigurationChange();
 }
diff --git a/src/VBox/Main/src-server/HostDnsService.h b/src/VBox/Main/src-server/HostDnsService.h
index d7e1978..48d7c62 100644
--- a/src/VBox/Main/src-server/HostDnsService.h
+++ b/src/VBox/Main/src-server/HostDnsService.h
@@ -59,6 +59,7 @@ class HostDnsInformation
     std::vector<std::string> servers;
     std::string domain;
     std::vector<std::string> searchList;
+    bool equals(const HostDnsInformation &) const;
 };
 
 /**
diff --git a/src/VBox/Main/testcase/Makefile.kmk b/src/VBox/Main/testcase/Makefile.kmk
index e08f597..e9b7cc8 100644
--- a/src/VBox/Main/testcase/Makefile.kmk
+++ b/src/VBox/Main/testcase/Makefile.kmk
@@ -31,8 +31,7 @@ ifndef VBOX_ONLY_SDK
 	$(if $(VBOX_WITH_RESOURCE_USAGE_API),tstCollector,) \
 	$(if $(VBOX_WITH_GUEST_CONTROL),tstGuestCtrlParseBuffer,) \
 	$(if $(VBOX_WITH_GUEST_CONTROL),tstGuestCtrlContextID,) \
-	tstMediumLock \
-	tstMouseImpl
+	tstMediumLock
   PROGRAMS.linux += \
 	$(if $(VBOX_WITH_USB),tstUSBProxyLinux,)
  endif # !VBOX_WITH_TESTCASES
@@ -175,32 +174,6 @@ tstMediumLock_TEMPLATE = VBOXMAINCLIENTTSTEXE
 tstMediumLock_SOURCES  = tstMediumLock.cpp
 
 
-#
-# tstMouseImpl
-#
-tstMouseImpl_TEMPLATE = VBOXMAINTSTEXE
-tstMouseImpl_SOURCES  = \
-	tstMouseImpl.cpp \
-	../src-client/MouseImpl.cpp \
-	../src-all/EventImpl.cpp \
-	../src-all/VirtualBoxBase.cpp \
-	../src-all/VirtualBoxErrorInfoImpl.cpp \
-	$(VBOX_AUTOGEN_EVENT_CPP) \
-	$(VBOX_XML_SCHEMADEFS_CPP)
-tstMouseImpl_INCS      = ../include \
-	$(VBOX_PATH_SDK)/bindings/xpcom/include \
-	$(VBOX_PATH_SDK)/bindings/xpcom/include/nsprpub \
-	$(VBOX_PATH_SDK)/bindings/xpcom/include/xpcom \
-	$(dir $(VBOX_XML_SCHEMADEFS_H))
-tstMouseImpl_LIBS      = \
-	$(PATH_STAGE_LIB)/VBoxAPIWrap$(VBOX_SUFF_LIB) \
-	$(LIB_VMM)
-# Super ugly hack to make the code work well enough without having ATL/COM
-# completely initialized, without it there are crashes caused by ComObjPtr
-# and many other pieces of glue code, as the inproc code path is more picky.
-tstMouseImpl_DEFS.win  += VBOX_COM_OUTOFPROC_MODULE
-
-
 # generate rules.
 include $(FILE_KBUILD_SUB_FOOTER)
 
diff --git a/src/VBox/Main/testcase/tstMouseImpl.cpp b/src/VBox/Main/testcase/tstMouseImpl.cpp
deleted file mode 100644
index cd03f02..0000000
--- a/src/VBox/Main/testcase/tstMouseImpl.cpp
+++ /dev/null
@@ -1,462 +0,0 @@
-/* $Id: tstMouseImpl.cpp $ */
-/** @file
- * Main unit test - Mouse class.
- */
-
-/*
- * Copyright (C) 2011-2013 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.
- */
-
-/******************************************************************************
-*   Header Files                                                              *
-******************************************************************************/
-#define IN_VMM_R3 /* Kill most Windows warnings on CFGMR3* implementations. */
-#include "MouseImpl.h"
-#include "VMMDev.h"
-#include "DisplayImpl.h"
-
-#include <VBox/vmm/cfgm.h>
-#include <VBox/vmm/pdmdrv.h>
-#include <VBox/VMMDev.h>
-#include <iprt/assert.h>
-#include <iprt/test.h>
-
-#ifndef RT_OS_WINDOWS
-NS_DECL_CLASSINFO(Mouse)
-NS_IMPL_THREADSAFE_ISUPPORTS1_CI(Mouse, IMouse)
-#endif
-
-PDMIVMMDEVPORT VMMDevPort;
-
-class TestVMMDev : public VMMDevMouseInterface
-{
-    PPDMIVMMDEVPORT getVMMDevPort(void) { return &VMMDevPort; }
-};
-
-class TestDisplay : public DisplayMouseInterface
-{
-    void getFramebufferDimensions(int32_t *px1, int32_t *py1,
-                                  int32_t *px2, int32_t *py2);
-    int getScreenResolution(uint32_t cScreen, ULONG *pcx, ULONG *pcy,
-                            ULONG *pcBPP, LONG *pXOrigin, LONG *pYOrigin);
-    virtual HRESULT i_reportHostCursorCapabilities(uint32_t fCapabilitiesAdded, uint32_t fCapabilitiesRemoved)
-    { return S_OK; }
-    virtual HRESULT i_reportHostCursorPosition(int32_t x, int32_t y) { return S_OK; }
-};
-
-class TestConsole : public ConsoleMouseInterface
-{
-public:
-    VMMDevMouseInterface *getVMMDevMouseInterface() { return &mVMMDev; }
-    DisplayMouseInterface *getDisplayMouseInterface() { return &mDisplay; }
-    /** @todo why on earth is this not implemented? */
-    void onMouseCapabilityChange(BOOL supportsAbsolute, BOOL supportsRelative,
-                                 BOOL supportsMT, BOOL needsHostCursor) {}
-
-private:
-    TestVMMDev mVMMDev;
-    TestDisplay mDisplay;
-};
-
-static int pdmdrvhlpAttach(PPDMDRVINS pDrvIns, uint32_t fFlags,
-                           PPDMIBASE *ppBaseInterface)
-{
-    return VERR_PDM_NO_ATTACHED_DRIVER;
-}
-
-static struct PDMDRVHLPR3 pdmHlpR3 =
-{
-    PDM_DRVHLPR3_VERSION,
-    pdmdrvhlpAttach,
-    NULL,                    /* pfnDetach */
-    NULL,                    /* pfnDetachSelf */
-    NULL,                    /* pfnMountPrepare */
-    NULL,                    /* pfnAssertEMT */
-    NULL,                    /* pfnAssertOther */
-    NULL,                    /* pfnVMSetError */
-    NULL,                    /* pfnVMSetErrorV */
-    NULL,                    /* pfnVMSetRuntimeError */
-    NULL,                    /* pfnVMSetRuntimeErrorV */
-    NULL,                    /* pfnVMState */
-    NULL,                    /* pfnVMTeleportedAndNotFullyResumedYet */
-    NULL,                    /* pfnGetSupDrvSession */
-    NULL,                    /* pfnQueueCreate */
-    NULL,                    /* pfnTMGetVirtualFreq */
-    NULL,                    /* pfnTMGetVirtualTime */
-    NULL,                    /* pfnTMTimerCreate */
-    NULL,                    /* pfnSSMRegister */
-    NULL,                    /* pfnSSMDeregister */
-    NULL,                    /* pfnDBGFInfoRegister */
-    NULL,                    /* pfnDBGFInfoDeregister */
-    NULL,                    /* pfnSTAMRegister */
-    NULL,                    /* pfnSTAMRegisterF */
-    NULL,                    /* pfnSTAMRegisterV */
-    NULL,                    /* pfnSTAMDeregister */
-    NULL,                    /* pfnSUPCallVMMR0Ex */
-    NULL,                    /* pfnUSBRegisterHub */
-    NULL,                    /* pfnSetAsyncNotification */
-    NULL,                    /* pfnAsyncNotificationCompleted */
-    NULL,                    /* pfnThreadCreate */
-    NULL,                    /* pfnAsyncCompletionTemplateCreate */
-#ifdef VBOX_WITH_NETSHAPER
-    NULL,                    /* pfnNetShaperAttach */
-    NULL,                    /* pfnNetShaperDetach */
-#endif
-    NULL,                    /* pfnLdrGetRCInterfaceSymbols */
-    NULL,                    /* pfnLdrGetR0InterfaceSymbols */
-    NULL,                    /* pfnCritSectInit */
-    NULL,                    /* pfnCallR0 */
-    NULL,                    /* pfnFTSetCheckpoint */
-    NULL,                    /* pfnBlkCacheRetain */
-    NULL,                    /* pfnVMGetSuspendReason */
-    NULL,                    /* pfnVMGetResumeReason */
-    NULL,                    /* pfnReserved0 */
-    NULL,                    /* pfnReserved1 */
-    NULL,                    /* pfnReserved2 */
-    NULL,                    /* pfnReserved3 */
-    NULL,                    /* pfnReserved4 */
-    NULL,                    /* pfnReserved5 */
-    NULL,                    /* pfnReserved6 */
-    NULL,                    /* pfnReserved7 */
-    NULL,                    /* pfnReserved8 */
-    NULL,                    /* pfnReserved9 */
-    PDM_DRVHLPR3_VERSION     /* u32TheEnd */
-};
-
-static struct
-{
-    int32_t dx;
-    int32_t dy;
-    int32_t dz;
-    int32_t dw;
-} mouseEvent;
-
-static int mousePutEvent(PPDMIMOUSEPORT pInterface, int32_t iDeltaX,
-                         int32_t iDeltaY, int32_t iDeltaZ, int32_t iDeltaW,
-                         uint32_t fButtonStates)
-{
-    mouseEvent.dx = iDeltaX;
-    mouseEvent.dy = iDeltaY;
-    mouseEvent.dz = iDeltaZ;
-    mouseEvent.dw = iDeltaW;
-    return VINF_SUCCESS;
-}
-
-static struct
-{
-    uint32_t cx;
-    uint32_t cy;
-    int32_t  dz;
-    int32_t  dw;
-    uint32_t fButtonStates;
-} mouseEventAbs;
-
-static int mousePutEventAbs(PPDMIMOUSEPORT pInterface, uint32_t uX,
-                            uint32_t uY, int32_t iDeltaZ, int32_t iDeltaW,
-                            uint32_t fButtonStates)
-{
-    mouseEventAbs.cx            = uX;
-    mouseEventAbs.cy            = uY;
-    mouseEventAbs.dz            = iDeltaZ;
-    mouseEventAbs.dw            = iDeltaW;
-    mouseEventAbs.fButtonStates = fButtonStates;
-    return VINF_SUCCESS;
-}
-
-static struct PDMIMOUSEPORT pdmiMousePort =
-{
-    mousePutEvent,
-    mousePutEventAbs,
-    NULL                     /* pfnPutEventMT */
-};
-
-static void *pdmiBaseQuery(struct PDMIBASE *pInterface, const char *pszIID)
-{
-    return &pdmiMousePort;
-}
-
-static struct PDMIBASE pdmiBase =
-{
-    pdmiBaseQuery
-};
-
-static struct PDMDRVINS pdmdrvInsCore =
-{
-    PDM_DRVINS_VERSION,
-    0,                       /* iInstance */
-    NIL_RTRCPTR,             /* pHlpRC */
-    NIL_RTRCPTR,             /* pvInstanceDataRC */
-    NIL_RTR0PTR,             /* pHelpR0 */
-    NIL_RTR0PTR,             /* pvInstanceDataR0 */
-    &pdmHlpR3,
-    NULL,                    /* pvInstanceDataR3 */
-    NIL_RTR3PTR,             /* pReg */
-    NIL_RTR3PTR,             /* pCfg */
-    &pdmiBase,
-    NULL,                    /* pDownBase */
-    {                        /* IBase */
-        NULL                 /* pfnQueryInterface */
-    },
-    0,                       /* fTracing */
-    0,                       /* idTracing */
-#if HC_ARCH_BITS == 32
-    { 0 },                   /* au32Padding */
-#endif
-    {
-        { 0 }                /* padding */
-    },                       /* Internal */
-    { 0 }                    /* achInstanceData */
-};
-
-static struct PDMDRVINS *ppdmdrvIns = NULL;
-
-ComObjPtr<Mouse> pMouse;
-ConsoleMouseInterface *pConsole = NULL;
-
-static struct
-{
-    int32_t x;
-    int32_t y;
-} absoluteMouse;
-
-static int setAbsoluteMouse(PPDMIVMMDEVPORT, int32_t x, int32_t y)
-{
-    absoluteMouse.x = x;
-    absoluteMouse.y = y;
-    return VINF_SUCCESS;
-}
-
-static int updateMouseCapabilities(PPDMIVMMDEVPORT, uint32_t, uint32_t)
-{
-    return VINF_SUCCESS;
-}
-
-void TestDisplay::getFramebufferDimensions(int32_t *px1, int32_t *py1,
-                                           int32_t *px2, int32_t *py2)
-{
-    if (px1)
-        *px1 = -320;
-    if (py1)
-        *py1 = -240;
-    if (px2)
-        *px2 = 320;
-    if (py2)
-        *py2 = 240;
-}
-
-int TestDisplay::getScreenResolution(uint32_t cScreen, ULONG *pcx,
-                                     ULONG *pcy, ULONG *pcBPP, LONG *pXOrigin, LONG *pYOrigin)
-{
-    NOREF(cScreen);
-    if (pcx)
-        *pcx = 640;
-    if (pcy)
-        *pcy = 480;
-    if (pcBPP)
-        *pcBPP = 32;
-    if (pXOrigin)
-        *pXOrigin = 0;
-    if (pYOrigin)
-        *pYOrigin = 0;
-    return S_OK;
-}
-
-/******************************************************************************
-*   Main test code                                                            *
-******************************************************************************/
-
-static int setup(void)
-{
-    PCFGMNODE pCfg = NULL;
-    Mouse *pMouse2;
-    int rc = VERR_NO_MEMORY;
-    VMMDevPort.pfnSetAbsoluteMouse = setAbsoluteMouse;
-    VMMDevPort.pfnUpdateMouseCapabilities = updateMouseCapabilities;
-    HRESULT hrc = pMouse.createObject();
-    AssertComRC(hrc);
-    if (FAILED(hrc))
-        return VERR_GENERAL_FAILURE;
-    pConsole = new TestConsole;
-    pMouse->init(pConsole);
-    ppdmdrvIns = (struct PDMDRVINS *) RTMemAllocZ(  sizeof(struct PDMDRVINS)
-                                                  + Mouse::DrvReg.cbInstance);
-    *ppdmdrvIns = pdmdrvInsCore;
-    pMouse2 = pMouse;
-    pCfg = CFGMR3CreateTree(NULL);
-    if (pCfg)
-    {
-        rc = CFGMR3InsertInteger(pCfg, "Object", (uintptr_t)pMouse2);
-        if (RT_SUCCESS(rc))
-            Mouse::DrvReg.pfnConstruct(ppdmdrvIns, pCfg, 0);
-    }
-    return rc;
-}
-
-static void teardown(void)
-{
-    pMouse.setNull();
-    if (pConsole)
-        delete pConsole;
-    if (ppdmdrvIns)
-        RTMemFree(ppdmdrvIns);
-}
-
-static bool approxEq(int a, int b, int prec)
-{
-    return a - b < prec && b - a < prec;
-}
-
-/** @test testAbsToVMMDevNewProtocol */
-static void testAbsToVMMDevNewProtocol(RTTEST hTest)
-{
-    PPDMIBASE pBase;
-    PPDMIMOUSECONNECTOR pConnector;
-
-    RTTestSub(hTest, "Absolute event to VMMDev, new protocol");
-    pBase = &ppdmdrvIns->IBase;
-    pConnector = (PPDMIMOUSECONNECTOR)pBase->pfnQueryInterface(pBase,
-                                                 PDMIMOUSECONNECTOR_IID);
-    pConnector->pfnReportModes(pConnector, true, false, false);
-    pMouse->onVMMDevGuestCapsChange(  VMMDEV_MOUSE_GUEST_CAN_ABSOLUTE
-                                    | VMMDEV_MOUSE_NEW_PROTOCOL);
-    pMouse->PutMouseEventAbsolute(0, 0, 0, 0, 0);
-    RTTESTI_CHECK_MSG(approxEq(absoluteMouse.x, 0x8000, 200),
-                      ("absoluteMouse.x=%d\n", absoluteMouse.x));
-    RTTESTI_CHECK_MSG(approxEq(absoluteMouse.y, 0x8000, 200),
-                      ("absoluteMouse.y=%d\n", absoluteMouse.y));
-    pMouse->PutMouseEventAbsolute(-319, -239, 0, 0, 0);
-    RTTESTI_CHECK_MSG(approxEq(absoluteMouse.x, 0, 200),
-                      ("absoluteMouse.x=%d\n", absoluteMouse.x));
-    RTTESTI_CHECK_MSG(approxEq(absoluteMouse.y, 0, 200),
-                      ("absoluteMouse.y=%d\n", absoluteMouse.y));
-    pMouse->PutMouseEventAbsolute(320, 240, 0, 0, 0);
-    RTTESTI_CHECK_MSG(approxEq(absoluteMouse.x, 0xffff, 200),
-                      ("absoluteMouse.x=%d\n", absoluteMouse.x));
-    RTTESTI_CHECK_MSG(approxEq(absoluteMouse.y, 0xffff, 200),
-                      ("absoluteMouse.y=%d\n", absoluteMouse.y));
-    RTTestSubDone(hTest);
-}
-
-/** @test testAbsToVMMDevOldProtocol */
-static void testAbsToVMMDevOldProtocol(RTTEST hTest)
-{
-    PPDMIBASE pBase;
-    PPDMIMOUSECONNECTOR pConnector;
-
-    RTTestSub(hTest, "Absolute event to VMMDev, old protocol");
-    pBase = &ppdmdrvIns->IBase;
-    pConnector = (PPDMIMOUSECONNECTOR)pBase->pfnQueryInterface(pBase,
-                                                 PDMIMOUSECONNECTOR_IID);
-    pConnector->pfnReportModes(pConnector, true, false, false);
-    pMouse->onVMMDevGuestCapsChange(VMMDEV_MOUSE_GUEST_CAN_ABSOLUTE);
-    pMouse->PutMouseEventAbsolute(320, 240, 0, 0, 0);
-    RTTESTI_CHECK_MSG(approxEq(absoluteMouse.x, 0x8000, 200),
-                      ("absoluteMouse.x=%d\n", absoluteMouse.x));
-    RTTESTI_CHECK_MSG(approxEq(absoluteMouse.y, 0x8000, 200),
-                      ("absoluteMouse.y=%d\n", absoluteMouse.y));
-    pMouse->PutMouseEventAbsolute(0, 0, 0, 0, 0);
-    RTTESTI_CHECK_MSG(approxEq(absoluteMouse.x, 0, 200),
-                      ("absoluteMouse.x=%d\n", absoluteMouse.x));
-    RTTESTI_CHECK_MSG(approxEq(absoluteMouse.y, 0, 200),
-                      ("absoluteMouse.y=%d\n", absoluteMouse.y));
-    pMouse->PutMouseEventAbsolute(-319, -239, 0, 0, 0);
-    RTTESTI_CHECK_MSG(approxEq(absoluteMouse.x, -0x8000, 200),
-                      ("absoluteMouse.x=%d\n", absoluteMouse.x));
-    RTTESTI_CHECK_MSG(approxEq(absoluteMouse.y, -0x8000, 200),
-                      ("absoluteMouse.y=%d\n", absoluteMouse.y));
-    RTTestSubDone(hTest);
-}
-
-/** @test testAbsToAbsDev */
-static void testAbsToAbsDev(RTTEST hTest)
-{
-    PPDMIBASE pBase;
-    PPDMIMOUSECONNECTOR pConnector;
-
-    RTTestSub(hTest, "Absolute event to absolute device");
-    pBase = &ppdmdrvIns->IBase;
-    pConnector = (PPDMIMOUSECONNECTOR)pBase->pfnQueryInterface(pBase,
-                                                 PDMIMOUSECONNECTOR_IID);
-    pConnector->pfnReportModes(pConnector, false, true, false);
-    pMouse->onVMMDevGuestCapsChange(VMMDEV_MOUSE_NEW_PROTOCOL);
-    pMouse->PutMouseEventAbsolute(0, 0, 0, 0, 0);
-    RTTESTI_CHECK_MSG(approxEq(mouseEventAbs.cx, 0x8000, 200),
-                      ("mouseEventAbs.cx=%d\n", mouseEventAbs.cx));
-    RTTESTI_CHECK_MSG(approxEq(mouseEventAbs.cy, 0x8000, 200),
-                      ("mouseEventAbs.cy=%d\n", mouseEventAbs.cy));
-    pMouse->PutMouseEventAbsolute(-319, -239, 0, 0, 3);
-    RTTESTI_CHECK_MSG(approxEq(mouseEventAbs.cx, 0, 200),
-                      ("mouseEventAbs.cx=%d\n", mouseEventAbs.cx));
-    RTTESTI_CHECK_MSG(approxEq(mouseEventAbs.cy, 0, 200),
-                      ("mouseEventAbs.cy=%d\n", mouseEventAbs.cy));
-    RTTESTI_CHECK_MSG(mouseEventAbs.fButtonStates == 3,
-                      ("mouseEventAbs.fButtonStates=%u\n",
-                      (unsigned) mouseEventAbs.fButtonStates));
-    pMouse->PutMouseEventAbsolute(320, 240, -3, 2, 1);
-    RTTESTI_CHECK_MSG(approxEq(mouseEventAbs.cx, 0xffff, 200),
-                      ("mouseEventAbs.cx=%d\n", mouseEventAbs.cx));
-    RTTESTI_CHECK_MSG(approxEq(mouseEventAbs.cy, 0xffff, 200),
-                      ("mouseEventAbs.cy=%d\n", mouseEventAbs.cy));
-    RTTESTI_CHECK_MSG(mouseEventAbs.fButtonStates == 1,
-                      ("mouseEventAbs.fButtonStates=%u\n",
-                      (unsigned) mouseEventAbs.fButtonStates));
-    RTTESTI_CHECK_MSG(mouseEventAbs.dz == -3,
-                      ("mouseEventAbs.dz=%d\n", (int) mouseEvent.dz));
-    RTTESTI_CHECK_MSG(mouseEventAbs.dw == 2,
-                      ("mouseEventAbs.dw=%d\n", (int) mouseEvent.dw));
-    mouseEventAbs.cx = mouseEventAbs.cy = 0xffff;
-    pMouse->PutMouseEventAbsolute(-640, -480, 0, 0, 0);
-    RTTESTI_CHECK_MSG(mouseEventAbs.cx == 0xffff,
-                      ("mouseEventAbs.cx=%d\n", mouseEventAbs.cx));
-    RTTESTI_CHECK_MSG(mouseEventAbs.cy == 0xffff,
-                      ("mouseEventAbs.cy=%d\n", mouseEventAbs.cy));
-    RTTestSubDone(hTest);
-}
-
-/** @todo generate this using the @test blocks above */
-typedef void (*PFNTEST)(RTTEST);
-static PFNTEST g_tests[] =
-{
-    testAbsToVMMDevNewProtocol,
-    testAbsToVMMDevOldProtocol,
-    testAbsToAbsDev,
-    NULL
-};
-
-int main(void)
-{
-    /*
-     * Init the runtime, test and say hello.
-     */
-    RTTEST hTest;
-    RTEXITCODE rcExit = RTTestInitAndCreate("tstMouseImpl", &hTest);
-    if (rcExit != RTEXITCODE_SUCCESS)
-        return rcExit;
-    RTTestBanner(hTest);
-
-    /*
-     * Run the tests.
-     */
-    for (unsigned i = 0; g_tests[i]; ++i)
-    {
-        int rc = setup();
-        AssertRC(rc);
-        if (RT_SUCCESS(rc))
-            g_tests[i](hTest);
-        teardown();
-    }
-
-    /*
-     * Summary
-     */
-    return RTTestSummaryAndDestroy(hTest);
-}
-
diff --git a/src/VBox/Main/xml/Settings.cpp b/src/VBox/Main/xml/Settings.cpp
index e988800..5bc08bd 100644
--- a/src/VBox/Main/xml/Settings.cpp
+++ b/src/VBox/Main/xml/Settings.cpp
@@ -1325,7 +1325,7 @@ void MainConfigFile::readDHCPServers(const xml::ElementNode &elmDHCPServers)
             DHCPServer srv;
             if (   pelmServer->getAttributeValue("networkName", srv.strNetworkName)
                 && pelmServer->getAttributeValue("IPAddress", srv.strIPAddress)
-                && pelmServer->getAttributeValue("networkMask", srv.GlobalDhcpOptions[DhcpOpt_SubnetMask])
+                && pelmServer->getAttributeValue("networkMask", srv.GlobalDhcpOptions[DhcpOpt_SubnetMask].text)
                 && pelmServer->getAttributeValue("lowerIP", srv.strIPLower)
                 && pelmServer->getAttributeValue("upperIP", srv.strIPUpper)
                 && pelmServer->getAttributeValue("enabled", srv.fEnabled) )
@@ -1364,15 +1364,18 @@ void MainConfigFile::readDhcpOptions(DhcpOptionMap& map,
     while ((opt = nl2.forAllNodes()))
     {
         DhcpOpt_T OptName;
-        com::Utf8Str OptValue;
+        com::Utf8Str OptText;
+        int32_t OptEnc = DhcpOptValue::LEGACY;
+
         opt->getAttributeValue("name", (uint32_t&)OptName);
 
         if (OptName == DhcpOpt_SubnetMask)
             continue;
 
-        opt->getAttributeValue("value", OptValue);
+        opt->getAttributeValue("value", OptText);
+        opt->getAttributeValue("encoding", OptEnc);
 
-        map.insert(std::map<DhcpOpt_T, Utf8Str>::value_type(OptName, OptValue));
+        map[OptName] = DhcpOptValue(OptText, (DhcpOptValue::Encoding)OptEnc);
     } /* end of forall("Option") */
 
 }
@@ -1514,7 +1517,7 @@ MainConfigFile::MainConfigFile(const Utf8Str *pstrFilename)
             "HostInterfaceNetworking-vboxnet0";
 #endif
         srv.strIPAddress = "192.168.56.100";
-        srv.GlobalDhcpOptions[DhcpOpt_SubnetMask] = "255.255.255.0";
+        srv.GlobalDhcpOptions[DhcpOpt_SubnetMask] = DhcpOptValue("255.255.255.0");
         srv.strIPLower = "192.168.56.101";
         srv.strIPUpper = "192.168.56.254";
         srv.fEnabled = true;
@@ -1576,7 +1579,7 @@ void MainConfigFile::write(const com::Utf8Str strFilename)
         pelmThis->setAttribute("networkName", d.strNetworkName);
         pelmThis->setAttribute("IPAddress", d.strIPAddress);
         if (itOpt != d.GlobalDhcpOptions.end())
-            pelmThis->setAttribute("networkMask", itOpt->second);
+            pelmThis->setAttribute("networkMask", itOpt->second.text);
         pelmThis->setAttribute("lowerIP", d.strIPLower);
         pelmThis->setAttribute("upperIP", d.strIPUpper);
         pelmThis->setAttribute("enabled", (d.fEnabled) ? 1 : 0);        // too bad we chose 1 vs. 0 here
@@ -1601,7 +1604,9 @@ void MainConfigFile::write(const com::Utf8Str strFilename)
                     break;
 
                 pelmOpt->setAttribute("name", itOpt->first);
-                pelmOpt->setAttribute("value", itOpt->second);
+                pelmOpt->setAttribute("value", itOpt->second.text);
+                if (itOpt->second.encoding != DhcpOptValue::LEGACY)
+                    pelmOpt->setAttribute("encoding", (int)itOpt->second.encoding);
             }
         } /* end of if */
 
@@ -1623,7 +1628,9 @@ void MainConfigFile::write(const com::Utf8Str strFilename)
                 {
                     xml::ElementNode *pelmOpt = pelmCfg->createChild("Option");
                     pelmOpt->setAttribute("name", itOpt1->first);
-                    pelmOpt->setAttribute("value", itOpt1->second);
+                    pelmOpt->setAttribute("value", itOpt1->second.text);
+                    if (itOpt1->second.encoding != DhcpOptValue::LEGACY)
+                        pelmOpt->setAttribute("encoding", (int)itOpt1->second.encoding);
                 }
             }
         } /* and of if */
diff --git a/src/VBox/NetworkServices/DHCP/Config.cpp b/src/VBox/NetworkServices/DHCP/Config.cpp
index 2c76b5e..840d3bb 100644
--- a/src/VBox/NetworkServices/DHCP/Config.cpp
+++ b/src/VBox/NetworkServices/DHCP/Config.cpp
@@ -31,6 +31,7 @@
 #include <VBox/vmm/vmm.h>
 #include <VBox/version.h>
 
+#include <VBox/com/array.h>
 #include <VBox/com/string.h>
 
 #include <iprt/cpp/xml.h>
@@ -73,7 +74,7 @@ const ClientMatchCriteria *g_AnyClient = new AnyClientMatchCriteria();
 
 static ConfigurationManager *g_ConfigurationManager = ConfigurationManager::getConfigurationManager();
 
-static NetworkManager *g_NetworkManager = NetworkManager::getNetworkManager();
+NetworkManager *NetworkManager::g_NetworkManager;
 
 bool MACClientMatchCriteria::check(const Client& client) const
 {
@@ -698,6 +699,8 @@ struct NetworkManager::Data
     RTNETADDRIPV4 m_OurAddress;
     RTNETADDRIPV4 m_OurNetmask;
     RTMAC m_OurMac;
+
+    ComPtr<IDHCPServer>  m_DhcpServer;
     const VBoxNetHlpUDPService *m_service;
 };
 
@@ -715,10 +718,13 @@ NetworkManager::~NetworkManager()
 }
 
 
-NetworkManager *NetworkManager::getNetworkManager()
+NetworkManager *NetworkManager::getNetworkManager(ComPtr<IDHCPServer> aDhcpServer)
 {
     if (!g_NetworkManager)
+    {
         g_NetworkManager = new NetworkManager();
+        g_NetworkManager->m->m_DhcpServer = aDhcpServer;
+    }
 
     return g_NetworkManager;
 }
@@ -994,13 +1000,169 @@ int NetworkManager::doReply(const Client& client, const std::vector<RawOption>&
 }
 
 
+/*
+ * XXX: TODO: Share decoding code with DHCPServer::addOption.
+ */
+static int parseDhcpOptionText(const char *pszText,
+                               int *pOptCode, char **ppszOptText, int *pOptEncoding)
+{
+    uint8_t u8Code;
+    uint32_t u32Enc;
+    char *pszNext;
+    int rc;
+
+    rc = RTStrToUInt8Ex(pszText, &pszNext, 10, &u8Code);
+    if (!RT_SUCCESS(rc))
+        return VERR_PARSE_ERROR;
+
+    switch (*pszNext)
+    {
+        case ':':           /* support legacy format too */
+        {
+            u32Enc = 0;
+            break;
+        }
+
+        case '=':
+        {
+            u32Enc = 1;
+            break;
+        }
+
+        case '@':
+        {
+            rc = RTStrToUInt32Ex(pszNext + 1, &pszNext, 10, &u32Enc);
+            if (!RT_SUCCESS(rc))
+                return VERR_PARSE_ERROR;
+            if (*pszNext != '=')
+                return VERR_PARSE_ERROR;
+            break;
+        }
+
+        default:
+            return VERR_PARSE_ERROR;
+    }
+
+    *pOptCode = u8Code;
+    *ppszOptText = pszNext + 1;
+    *pOptEncoding = (int)u32Enc;
+
+    return VINF_SUCCESS;
+}
+
+
+/*
+ * XXX: Since encoding info is "smuggled" through the API and is not
+ * exposed properly we don't have a common definition we can use here.
+ *
+ * TODO: We can define the encodings enum in the IDL without breaking
+ * backward compatibility.  This will provide the authoritative
+ * definition.
+ */
+static int fillDhcpOption(RawOption &opt, const std::string &OptText, int OptEncoding)
+{
+    int rc;
+ 
+    if (OptEncoding == /* HEX */ 1)
+    {
+        if (OptText.empty())
+            return VERR_INVALID_PARAMETER;
+
+        size_t cbRawOpt = 0;
+        char *pszNext = const_cast<char *>(OptText.c_str());
+        while (*pszNext != '\0')
+        {
+            if (cbRawOpt == 256)
+                return VERR_INVALID_PARAMETER;
+
+            uint8_t u8Byte;
+            rc = RTStrToUInt8Ex(pszNext, &pszNext, 16, &u8Byte);
+            if (!RT_SUCCESS(rc))
+                return rc;
+
+            if (*pszNext == ':')
+                ++pszNext;
+            else if (*pszNext != '\0')
+                return VERR_PARSE_ERROR;
+
+            opt.au8RawOpt[cbRawOpt] = u8Byte;
+            ++cbRawOpt;
+        }
+        opt.cbRawOpt = (uint8_t)cbRawOpt;
+    }
+    else if (OptEncoding == /* LEGACY */ 0)
+    {
+        /*
+         * XXX: TODO: encode "known" option opt.u8OptId
+         */
+        return VERR_INVALID_PARAMETER;
+    }
+
+    return VINF_SUCCESS;
+}
+
+
 int NetworkManager::processParameterReqList(const Client& client, const uint8_t *pu8ReqList, 
                                             int cReqList, std::vector<RawOption>& extra)
 {
+    int rc;
+
     const Lease l = client.lease();
 
     const NetworkConfigEntity *pNetCfg = l.getConfig();
 
+    /*
+     * XXX: Brute-force.  Unfortunately, there's no notification event
+     * for changes.  Should at least cache the options for a short
+     * time, enough to last discover/offer/request/ack cycle.
+     */
+    typedef std::map< int, std::pair<std::string, int> > DhcpOptionMap;
+    DhcpOptionMap OptMap;
+
+    if (!m->m_DhcpServer.isNull())
+    {
+        com::SafeArray<BSTR> strings;
+        com::Bstr str;
+        HRESULT hrc;
+        int OptCode, OptEncoding;
+        char *pszOptText;
+
+        strings.setNull();
+        hrc = m->m_DhcpServer->COMGETTER(GlobalOptions)(ComSafeArrayAsOutParam(strings));
+        AssertComRC(hrc);
+        for (size_t i = 0; i < strings.size(); ++i)
+        {
+            com::Utf8Str encoded(strings[i]);
+            rc = parseDhcpOptionText(encoded.c_str(),
+                                     &OptCode, &pszOptText, &OptEncoding);
+            if (!RT_SUCCESS(rc))
+                continue;
+
+            OptMap[OptCode] = std::make_pair(pszOptText, OptEncoding);
+        }
+
+        const RTMAC &mac = client.getMacAddress();
+        char strMac[6*2+1] = "";
+        RTStrPrintf(strMac, sizeof(strMac), "%02x%02x%02x%02x%02x%02x",
+                    mac.au8[0], mac.au8[1], mac.au8[2],
+                    mac.au8[3], mac.au8[4], mac.au8[5]);
+
+        strings.setNull();
+        hrc = m->m_DhcpServer->GetMacOptions(com::Bstr(strMac).raw(),
+                                             ComSafeArrayAsOutParam(strings));
+        AssertComRC(hrc);
+        for (size_t i = 0; i < strings.size(); ++i)
+        {
+            com::Utf8Str text(strings[i]);
+            rc = parseDhcpOptionText(text.c_str(),
+                                     &OptCode, &pszOptText, &OptEncoding);
+            if (!RT_SUCCESS(rc))
+                continue;
+
+            OptMap[OptCode] = std::make_pair(pszOptText, OptEncoding);
+        }
+    }
+
     /* request parameter list */
     RawOption opt;
     bool fIgnore;
@@ -1055,8 +1217,26 @@ int NetworkManager::processParameterReqList(const Client& client, const uint8_t
                 }
                 break;
             default:
-                Log(("opt: %d is ignored\n", u8Req));
-                fIgnore = true;
+                {
+                    DhcpOptionMap::const_iterator it = OptMap.find((int)u8Req);
+                    if (it == OptMap.end())
+                    {
+                        Log(("opt: %d is ignored\n", u8Req));
+                        fIgnore = true;
+                    }
+                    else
+                    {
+                        std::string OptText((*it).second.first);
+                        int OptEncoding((*it).second.second);
+
+                        rc = fillDhcpOption(opt, OptText, OptEncoding);
+                        if (!RT_SUCCESS(rc))
+                        {
+                            fIgnore = true;
+                            break;
+                        }
+                    }
+                }
                 break;
         }
 
diff --git a/src/VBox/NetworkServices/DHCP/Config.h b/src/VBox/NetworkServices/DHCP/Config.h
index 7d20a72..1278df8 100644
--- a/src/VBox/NetworkServices/DHCP/Config.h
+++ b/src/VBox/NetworkServices/DHCP/Config.h
@@ -8,7 +8,10 @@
 
 #include <iprt/asm-math.h>
 #include <iprt/cpp/utils.h>
+
+#include <VBox/com/ptr.h>
 #include <VBox/com/string.h>
+#include <VBox/com/VirtualBox.h>
 
 #include "../NetLib/cpp/utils.h"
 
@@ -477,7 +480,7 @@ private:
 class NetworkManager
 {
 public:
-    static NetworkManager *getNetworkManager();
+    static NetworkManager *getNetworkManager(ComPtr<IDHCPServer> aDhcpServer = ComPtr<IDHCPServer>());
 
     const RTNETADDRIPV4& getOurAddress() const;
     const RTNETADDRIPV4& getOurNetmask() const;
@@ -506,6 +509,9 @@ private:
     int processParameterReqList(const Client& client, const uint8_t *pu8ReqList, int cReqList, std::vector<RawOption>& extra);
 
 private:
+    static NetworkManager *g_NetworkManager;
+
+private:
     struct Data;
     Data *m;
 
diff --git a/src/VBox/NetworkServices/DHCP/VBoxNetDHCP.cpp b/src/VBox/NetworkServices/DHCP/VBoxNetDHCP.cpp
index 6496b8a..4dcad96 100644
--- a/src/VBox/NetworkServices/DHCP/VBoxNetDHCP.cpp
+++ b/src/VBox/NetworkServices/DHCP/VBoxNetDHCP.cpp
@@ -133,6 +133,9 @@ protected:
 
     /** Listener for Host DNS changes */
     ComPtr<NATNetworkListenerImpl> m_vboxListener;
+
+    NetworkManager *m_NetworkManager;
+
     /*
      * We will ignore cmd line parameters IFF there will be some DHCP specific arguments
      * otherwise all paramters will come from Main.
@@ -195,7 +198,9 @@ static RTGETOPTDEF g_aOptionDefs[] =
 /**
  * Construct a DHCP server with a default configuration.
  */
-VBoxNetDhcp::VBoxNetDhcp():VBoxNetBaseService("VBoxNetDhcp", "VBoxNetDhcp")
+VBoxNetDhcp::VBoxNetDhcp()
+  : VBoxNetBaseService("VBoxNetDhcp", "VBoxNetDhcp"),
+    m_NetworkManager(NULL)
 {
     /*   m_enmTrunkType          = kIntNetTrunkType_WhateverNone; */
     RTMAC mac;
@@ -284,20 +289,20 @@ int VBoxNetDhcp::init()
     int rc = this->VBoxNetBaseService::init();
     AssertRCReturn(rc, rc);
 
-    NetworkManager *netManager = NetworkManager::getNetworkManager();
-
-    netManager->setOurAddress(getIpv4Address());
-    netManager->setOurNetmask(getIpv4Netmask());
-    netManager->setOurMac(getMacAddress());
-    netManager->setService(this);
-
     if (isMainNeeded())
         rc = initWithMain();
     else
         rc = initNoMain();
-
     AssertRCReturn(rc, rc);
 
+    m_NetworkManager = NetworkManager::getNetworkManager(m_DhcpServer);
+    AssertPtrReturn(m_NetworkManager, VERR_INTERNAL_ERROR);
+
+    m_NetworkManager->setOurAddress(getIpv4Address());
+    m_NetworkManager->setOurNetmask(getIpv4Netmask());
+    m_NetworkManager->setOurMac(getMacAddress());
+    m_NetworkManager->setService(this);
+
     return VINF_SUCCESS;
 }
 
@@ -341,21 +346,21 @@ bool VBoxNetDhcp::handleDhcpMsg(uint8_t uMsgType, PCRTNETBOOTP pDhcpMsg, size_t
 {
     if (pDhcpMsg->bp_op == RTNETBOOTP_OP_REQUEST)
     {
-        NetworkManager *networkManager = NetworkManager::getNetworkManager();
+        AssertPtrReturn(m_NetworkManager, false);
 
         switch (uMsgType)
         {
             case RTNET_DHCP_MT_DISCOVER:
-                return networkManager->handleDhcpReqDiscover(pDhcpMsg, cb);
+                return m_NetworkManager->handleDhcpReqDiscover(pDhcpMsg, cb);
 
             case RTNET_DHCP_MT_REQUEST:
-                return networkManager->handleDhcpReqRequest(pDhcpMsg, cb);
+                return m_NetworkManager->handleDhcpReqRequest(pDhcpMsg, cb);
 
             case RTNET_DHCP_MT_DECLINE:
-                return networkManager->handleDhcpReqDecline(pDhcpMsg, cb);
+                return m_NetworkManager->handleDhcpReqDecline(pDhcpMsg, cb);
 
             case RTNET_DHCP_MT_RELEASE:
-                return networkManager->handleDhcpReqRelease(pDhcpMsg, cb);
+                return m_NetworkManager->handleDhcpReqRelease(pDhcpMsg, cb);
 
             case RTNET_DHCP_MT_INFORM:
                 debugPrint(0, true, "Should we handle this?");
diff --git a/src/VBox/Runtime/common/asn1/asn1-ut-bitstring.cpp b/src/VBox/Runtime/common/asn1/asn1-ut-bitstring.cpp
index 5e16466..fc9ae89 100644
--- a/src/VBox/Runtime/common/asn1/asn1-ut-bitstring.cpp
+++ b/src/VBox/Runtime/common/asn1/asn1-ut-bitstring.cpp
@@ -77,7 +77,7 @@ static DECLCALLBACK(int) rtAsn1BitStringEncodeCompare(const void *pvBuf, size_t
 {
     RTASN1BITSTRINGWRITERCTX *pCtx = (RTASN1BITSTRINGWRITERCTX *)pvUser;
     AssertReturn(cbToWrite <= pCtx->cbBuf - pCtx->offBuf, VERR_BUFFER_OVERFLOW);
-    if (!memcmp(&pCtx->pbBuf[pCtx->offBuf], pvBuf, cbToWrite) != 0)
+    if (memcmp(&pCtx->pbBuf[pCtx->offBuf], pvBuf, cbToWrite) != 0)
         return VERR_NOT_EQUAL;
     pCtx->offBuf += (uint32_t)cbToWrite;
     return VINF_SUCCESS;
diff --git a/src/VBox/Runtime/common/asn1/asn1-ut-octetstring.cpp b/src/VBox/Runtime/common/asn1/asn1-ut-octetstring.cpp
index 63d5857..9c5ed37 100644
--- a/src/VBox/Runtime/common/asn1/asn1-ut-octetstring.cpp
+++ b/src/VBox/Runtime/common/asn1/asn1-ut-octetstring.cpp
@@ -77,7 +77,7 @@ static DECLCALLBACK(int) rtAsn1OctetStringEncodeCompare(const void *pvBuf, size_
 {
     RTASN1OCTETSTRINGWRITERCTX *pCtx = (RTASN1OCTETSTRINGWRITERCTX *)pvUser;
     AssertReturn(cbToWrite <= pCtx->cbBuf - pCtx->offBuf, VERR_BUFFER_OVERFLOW);
-    if (!memcmp(&pCtx->pbBuf[pCtx->offBuf], pvBuf, cbToWrite) != 0)
+    if (memcmp(&pCtx->pbBuf[pCtx->offBuf], pvBuf, cbToWrite) != 0)
         return VERR_NOT_EQUAL;
     pCtx->offBuf += (uint32_t)cbToWrite;
     return VINF_SUCCESS;
diff --git a/src/VBox/Runtime/common/zip/tarvfs.cpp b/src/VBox/Runtime/common/zip/tarvfs.cpp
index 67200fe..878b403 100644
--- a/src/VBox/Runtime/common/zip/tarvfs.cpp
+++ b/src/VBox/Runtime/common/zip/tarvfs.cpp
@@ -366,7 +366,7 @@ static int rtZipTarHdrValidate(PCRTZIPTARHDR pTar, PRTZIPTARTYPE penmType)
     {
         case RTZIPTARTYPE_POSIX:
             if (   !RT_C_IS_ALNUM(pTar->Common.typeflag)
-                && !pTar->Common.typeflag == '\0')
+                && pTar->Common.typeflag != '\0')
                 return VERR_TAR_UNKNOWN_TYPE_FLAG;
             break;
 
diff --git a/src/VBox/VMM/VMMAll/IEMAllCImpl.cpp.h b/src/VBox/VMM/VMMAll/IEMAllCImpl.cpp.h
index 69ae5d3..b5e865e 100644
--- a/src/VBox/VMM/VMMAll/IEMAllCImpl.cpp.h
+++ b/src/VBox/VMM/VMMAll/IEMAllCImpl.cpp.h
@@ -1869,7 +1869,7 @@ IEM_CIMPL_DEF_3(iemCImpl_enter, IEMMODE, enmEffOpSize, uint16_t, cbFrame, uint8_
         rcStrict = iemMemStackPushU64Ex(pIemCpu, TmpRbp.u, &NewRsp);
         NewRbp = NewRsp;
     }
-    else if (pCtx->ss.Attr.n.u1DefBig)
+    else if (enmEffOpSize == IEMMODE_32BIT)
     {
         rcStrict = iemMemStackPushU32Ex(pIemCpu, TmpRbp.DWords.dw0, &NewRsp);
         NewRbp = NewRsp;
@@ -1939,7 +1939,7 @@ IEM_CIMPL_DEF_3(iemCImpl_enter, IEMMODE, enmEffOpSize, uint16_t, cbFrame, uint8_
         /* Push the new RBP */
         if (enmEffOpSize == IEMMODE_64BIT)
             rcStrict = iemMemStackPushU64Ex(pIemCpu, NewRbp.u, &NewRsp);
-        else if (pCtx->ss.Attr.n.u1DefBig)
+        else if (enmEffOpSize == IEMMODE_32BIT)
             rcStrict = iemMemStackPushU32Ex(pIemCpu, NewRbp.DWords.dw0, &NewRsp);
         else
             rcStrict = iemMemStackPushU16Ex(pIemCpu, NewRbp.Words.w0, &NewRsp);
diff --git a/src/VBox/VMM/VMMR0/CPUMR0.cpp b/src/VBox/VMM/VMMR0/CPUMR0.cpp
index d428938..c3e75de 100644
--- a/src/VBox/VMM/VMMR0/CPUMR0.cpp
+++ b/src/VBox/VMM/VMMR0/CPUMR0.cpp
@@ -51,8 +51,6 @@ typedef struct CPUMHOSTLAPIC
     bool        fX2Apic;
     /** The APIC version number. */
     uint32_t    uVersion;
-    /** Has APIC_REG_LVT_THMR. Not used. */
-    uint32_t    fHasThermal;
     /** The physical address of the APIC registers. */
     RTHCPHYS    PhysBase;
     /** The memory object entering the physical address. */
@@ -857,7 +855,6 @@ static DECLCALLBACK(void) cpumR0MapLocalApicCpuChecker(RTCPUID idCpu, void *pvUs
     if ((APIC_REG_VERSION_GET_VER(uApicVersion) & 0xF0) == 0x10)
     {
         g_aLApics[iCpu].uVersion    = uApicVersion;
-        g_aLApics[iCpu].fHasThermal = APIC_REG_VERSION_GET_MAX_LVT(uApicVersion) >= 5;
 
 #if 0 /* enable if you need it. */
         if (g_aLApics[iCpu].fX2Apic)
diff --git a/src/VBox/VMM/VMMR0/HMR0.cpp b/src/VBox/VMM/VMMR0/HMR0.cpp
index 43fb1a5..4aa3b38 100644
--- a/src/VBox/VMM/VMMR0/HMR0.cpp
+++ b/src/VBox/VMM/VMMR0/HMR0.cpp
@@ -1088,7 +1088,8 @@ static int hmR0DisableCpu(RTCPUID idCpu)
         return pCpu->fConfigured ? VERR_NO_MEMORY : VINF_SUCCESS /* not initialized. */;
 
     int rc;
-    if (pCpu->fConfigured)
+    if (   pCpu->fConfigured
+        && idCpu == RTMpCpuId())    /* We may not be firing on the CPU being disabled/going offline. */
     {
         void    *pvCpuPage     = RTR0MemObjAddress(pCpu->hMemObj);
         RTHCPHYS HCPhysCpuPage = RTR0MemObjGetPagePhysAddr(pCpu->hMemObj, 0);
@@ -1100,7 +1101,6 @@ static int hmR0DisableCpu(RTCPUID idCpu)
     }
     else
         rc = VINF_SUCCESS; /* nothing to do */
-
     return rc;
 }
 
diff --git a/src/VBox/VMM/VMMRZ/PGMRZDynMap.cpp b/src/VBox/VMM/VMMRZ/PGMRZDynMap.cpp
index eccc1f5..1329ef2 100644
--- a/src/VBox/VMM/VMMRZ/PGMRZDynMap.cpp
+++ b/src/VBox/VMM/VMMRZ/PGMRZDynMap.cpp
@@ -1589,7 +1589,6 @@ static int pgmRZDynMapAssertIntegrity(PPGMRZDYNMAP pThis)
     uint32_t            cGuard      = 0;
     uint32_t            cLoad       = 0;
     PPGMRZDYNMAPENTRY   paPages     = pThis->paPages;
-    uint32_t            iPage       = pThis->cPages;
 
 #ifndef IN_RC
     if (pThis->fLegacyMode)
@@ -1598,6 +1597,7 @@ static int pgmRZDynMapAssertIntegrity(PPGMRZDYNMAP pThis)
 #ifdef IN_RING0
         PCX86PGUINT     paSavedPTEs = (PCX86PGUINT)pThis->pvSavedPTEs; NOREF(paSavedPTEs);
 #endif
+        uint32_t        iPage       = pThis->cPages;
         while (iPage-- > 0)
         {
             CHECK_RET(!((uintptr_t)paPages[iPage].pvPage & PAGE_OFFSET_MASK), ("#%u: %p\n", iPage, paPages[iPage].pvPage));
@@ -1640,6 +1640,7 @@ static int pgmRZDynMapAssertIntegrity(PPGMRZDYNMAP pThis)
 #ifdef IN_RING0
         PCX86PGPAEUINT  paSavedPTEs = (PCX86PGPAEUINT)pThis->pvSavedPTEs; NOREF(paSavedPTEs);
 #endif
+        uint32_t        iPage       = pThis->cPages;
         while (iPage-- > 0)
         {
             CHECK_RET(!((uintptr_t)paPages[iPage].pvPage & PAGE_OFFSET_MASK), ("#%u: %p\n", iPage, paPages[iPage].pvPage));
diff --git a/src/VBox/VMM/VMMSwitcher/AMD64andLegacy.mac b/src/VBox/VMM/VMMSwitcher/AMD64andLegacy.mac
index a5c7da2..ed2b87a 100644
--- a/src/VBox/VMM/VMMSwitcher/AMD64andLegacy.mac
+++ b/src/VBox/VMM/VMMSwitcher/AMD64andLegacy.mac
@@ -108,7 +108,7 @@ BEGINPROC vmmR0ToRawMode
     cmp     byte [rdx + r8 + CPUMCPU.fX2Apic], 1
     je      gth64_x2apic
 
-    ; Legacy APIC mode:
+    ; Legacy xAPIC mode:
     mov     r8, [rdx + r8 + CPUMCPU.pvApicBase]
     shr     ecx, 1
     jnc     gth64_nolint0
@@ -132,7 +132,7 @@ gth64_notherm:
 gth64_nocmci:
     jmp     gth64_apic_done
 
-    ; X2 APIC mode:
+    ; x2APIC mode:
 gth64_x2apic:
     mov     r8, rax                     ; save rax
     mov     r10, rcx
@@ -337,6 +337,8 @@ BEGINPROC vmmR0ToRawModeAsm
     ; Block Local APIC NMI vectors
     cmp     byte [rdx + r8 + CPUMCPU.fX2Apic], 1
     je      htg_x2apic
+
+    ; Legacy xAPIC mode:
     mov     rbx, [rdx + r8 + CPUMCPU.pvApicBase]
     or      rbx, rbx
     jz      htg_apic_done
@@ -399,7 +401,7 @@ htg_notherm:
     mov     [rdx + r8 + CPUMCPU.fApicDisVectors], edi
     jmp     htg_apic_done
 
-    ; X2APIC?
+    ; x2APIC mode:
 htg_x2apic:
     mov     r15, rdx                    ; save rdx
     xor     edi, edi                    ; fApicDisVectors
diff --git a/src/VBox/VMM/VMMSwitcher/LegacyandAMD64.mac b/src/VBox/VMM/VMMSwitcher/LegacyandAMD64.mac
index 5e6ed8a..b396e9a 100644
--- a/src/VBox/VMM/VMMSwitcher/LegacyandAMD64.mac
+++ b/src/VBox/VMM/VMMSwitcher/LegacyandAMD64.mac
@@ -177,6 +177,7 @@ BEGINPROC vmmR0ToRawMode
     cmp     byte [edx + CPUMCPU.fX2Apic], 1
     je      gth_x2apic
 
+    ; Legacy xAPIC mode:
     mov     edx, [edx + CPUMCPU.pvApicBase]
     shr     ecx, 1
     jnc     gth_nolint0
@@ -200,6 +201,7 @@ gth_notherm:
 gth_nocmci:
     jmp     gth_apic_done
 
+    ; x2APIC mode:
 gth_x2apic:
     ;DEBUG_CMOS_STACK32 7ch
     push    eax                         ; save eax
@@ -323,11 +325,13 @@ BEGINPROC vmmR0ToRawModeAsm
 %endif
 
 %ifdef VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI
+    ; Block Local APIC NMI vectors
     DEBUG32_S_CHAR('f')
     DEBUG32_S_CHAR(';')
-    cmp     byte [edx + CPUMCPU.pvApicBase], 1
+    cmp     byte [edx + CPUMCPU.fX2Apic], 1
     je      htg_x2apic
 
+    ; Legacy xAPIC mode:
     mov     ebx, [edx + CPUMCPU.pvApicBase]
     or      ebx, ebx
     jz      htg_apic_done
@@ -389,6 +393,7 @@ htg_notherm:
     mov     [edx + CPUMCPU.fApicDisVectors], edi
     jmp     htg_apic_done
 
+    ; x2APIC mode:
 htg_x2apic:
     mov     esi, edx                    ; Save edx.
     xor     edi, edi                    ; fApicDisVectors
diff --git a/src/VBox/VMM/VMMSwitcher/PAEand32Bit.mac b/src/VBox/VMM/VMMSwitcher/PAEand32Bit.mac
index fdb63f2..adc3c7b 100644
--- a/src/VBox/VMM/VMMSwitcher/PAEand32Bit.mac
+++ b/src/VBox/VMM/VMMSwitcher/PAEand32Bit.mac
@@ -90,6 +90,7 @@ BEGINPROC vmmR0ToRawMode
     cmp     byte [edx + CPUMCPU.fX2Apic], 1
     je      gth_x2apic
 
+    ; Legacy xAPIC mode:
     mov     edx, [edx + CPUMCPU.pvApicBase]
     shr     ecx, 1
     jnc     gth_nolint0
@@ -113,6 +114,7 @@ gth_notherm:
 gth_nocmci:
     jmp     gth_apic_done
 
+    ; x2APIC mode:
 gth_x2apic:
     push    eax                         ; save eax
     push    ebx                         ; save it for fApicDisVectors
@@ -217,11 +219,12 @@ BEGINPROC vmmR0ToRawModeAsm
     pushfd
     pop     dword [edx + CPUMCPU.Host.eflags]
 
-    ; Block Local APIC NMI vectors
 %ifdef VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI
-    cmp     byte [edx + CPUMCPU.pvApicBase], 1
+    ; Block Local APIC NMI vectors
+    cmp     byte [edx + CPUMCPU.fX2Apic], 1
     je      htg_x2apic
 
+    ; Legacy xAPIC mode:
     mov     ebx, [edx + CPUMCPU.pvApicBase]
     or      ebx, ebx
     jz      htg_apic_done
@@ -285,6 +288,7 @@ htg_notherm:
     mov     [edx + CPUMCPU.fApicDisVectors], edi
     jmp     htg_apic_done
 
+    ; x2APIC mode:
 htg_x2apic:
     mov     esi, edx                    ; Save edx.
     xor     edi, edi                    ; fApicDisVectors
diff --git a/src/bldprogs/VBoxDef2LazyLoad.cpp b/src/bldprogs/VBoxDef2LazyLoad.cpp
index 4f6870a..a513bc8 100644
--- a/src/bldprogs/VBoxDef2LazyLoad.cpp
+++ b/src/bldprogs/VBoxDef2LazyLoad.cpp
@@ -736,9 +736,8 @@ static RTEXITCODE generateOutputInner(FILE *pOutput)
                 "    "
                 "\n"
                 ".return:\n"
-                "    lea    xSP, [xBP - xCB * 3]\n"
-                "    pop    pszCurStr\n"
-                "    pop    xBX\n"
+                "    mov    pszCurStr, [xBP - xCB * 2]\n"
+                "    mov    xBX,       [xBP - xCB * 1]\n"
                 "    leave\n"
                 "    ret\n"
                 "ENDPROC   ExplicitlyLoad%.*s\n"
@@ -844,7 +843,7 @@ int main(int argc, char **argv)
             else if (   !strcmp(psz, "--version")
                      || !strcmp(psz, "-V"))
             {
-                printf("$Revision: 98182 $\n");
+                printf("$Revision: 98272 $\n");
                 return RTEXITCODE_SUCCESS;
             }
             else

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-virtualbox/virtualbox.git



More information about the Pkg-virtualbox-commits mailing list