Index: trunk/include/Makefile.kmk
===================================================================
--- trunk/include/Makefile.kmk	(revision 68669)
+++ trunk/include/Makefile.kmk	(revision 68670)
@@ -30,5 +30,6 @@
 	VBox/VBoxCrHgsmi.h \
 	VBox/VBoxUhgsmi.h \
-       VBox/dbus.h
+       VBox/dbus.h \
+       VBox/VBoxPktDmp.h
 
 # Omit headers that are C++ and ring-3.
@@ -43,13 +44,20 @@
 r3_only_hdrs := \
 	VBox/vrdpapi.h \
-        VBox/vrdpusb.h \
+	VBox/vrdpusb.h \
 	VBox/VBoxHDD.h \
 	VBox/VBoxHDD-Plugin.h \
 	VBox/VBoxCrHgsmi.h \
 	VBox/VBoxUhgsmi.h \
+	VBox/VBoxNetCfg-win.h \
 	VBox/dbus.h \
+	VBox/usblib-win.h \
 	VBox/vd.h \
+	VBox/vd-cache-backend.h \
+	VBox/vd-ifs.h \
+	VBox/vd-ifs-internal.h \
+	VBox/vd-image-backend.h \
 	VBox/vd-plugin.h \
-	VBox/vd-cache-plugin.h \
+	VBox/vd-filter-backend.h \
+	VBox/vddbg.h \
 	VBox/vmm/uvm.h \
 	VBox/vscsi.h \
@@ -62,4 +70,8 @@
 	iprt/socket.h
 
+# Ring-0 only headers.
+r0_only_hdrs := \
+	VBox/VBoxGuestLibSharedFolders.h
+
 # We omit a few headers which have platform specific issues or are templates.
 hdrs := $(filter-out \
@@ -69,14 +81,15 @@
 	VBox/VBoxGL2D.h \
 	VBox/WinNetConfig.h \
-	VBox/usblib-win.h \
 	VBox/usblib-solaris.h \
 	VBox/VDEPlug.h \
+	VBox/VDEPlugSymDefs.h \
+	VBox/VBoxNetCmn-win.h \
 	$(if-expr "$(KBUILD_TARGET)" != "win", \
 		VBox/VBoxDrvCfg-win.h \
 		VBox/VBoxNetCfg-win.h \
+		VBox/usblib-win.h \
 	,) \
 	\
 	VBox/dbus-calls.h \
-	VBox/VDEPlugSymDefs.h \
 	VBox/VBoxKeyboard.h \
 	VBox/vmm/pdmpcidevint.h \
@@ -89,6 +102,6 @@
 
 # ring-3, ring-0 and raw-mode context specific exclusions.
-hdrs.r3   := $(filter-out , $(hdrs))
-hdrs-c.r3 := $(filter-out $(cpp_features_hdrs) $(r3_cpp_hdrs), $(hdrs.r3))
+hdrs.r3   := $(filter-out $(r0_only_hdrs), $(hdrs))
+hdrs-c.r3 := $(filter-out $(cpp_features_hdrs) $(r3_cpp_hdrs) $(r0_only_hdrs), $(hdrs.r3))
 hdrs.r0   := $(filter-out $(r3_cpp_hdrs) $(r3_only_hdrs), $(hdrs))
 hdrs-c.r0 := $(filter-out $(cpp_features_hdrs), $(hdrs.r0))
@@ -102,4 +115,5 @@
 	$(r3_cpp_hdrs) \
 	$(r3_only_hdrs) \
+	$(r0_only_hdrs) \
 	, $(hdrs))
 hdrs-c.rc := $(filter-out $(cpp_features_hdrs), $(hdrs.rc))
Index: trunk/include/VBox/VBoxGuestLib.h
===================================================================
--- trunk/include/VBox/VBoxGuestLib.h	(revision 68669)
+++ trunk/include/VBox/VBoxGuestLib.h	(revision 68670)
@@ -31,5 +31,4 @@
 #include <VBox/VBoxGuestCoreTypes.h>
 
-
 /** @defgroup grp_vboxguest_lib     VirtualBox Guest Additions Library
  * @ingroup grp_vboxguest
@@ -84,5 +83,5 @@
  * @{
  */
-#if defined(IN_RING0) && !defined(IN_RING0_AGNOSTIC)
+#ifdef IN_RING0
 /** @def DECLR0VBGL
  * Declare a VBGL ring-0 API with the right calling convention and visibilitiy.
@@ -471,5 +470,5 @@
 # endif /* VBOX_GUEST */
 
-#endif /* IN_RING0 && !IN_RING0_AGNOSTIC */
+#endif /* IN_RING0 */
 
 /** @} */
Index: trunk/include/VBox/VBoxGuestLibSharedFolders.h
===================================================================
--- trunk/include/VBox/VBoxGuestLibSharedFolders.h	(revision 68669)
+++ trunk/include/VBox/VBoxGuestLibSharedFolders.h	(revision 68670)
@@ -30,4 +30,8 @@
 #include <VBox/VBoxGuestLib.h>
 #include <VBox/shflsvc.h>
+
+#ifndef IN_RING0
+# error "ring-0 only"
+#endif
 
 RT_C_DECLS_BEGIN
Index: trunk/include/VBox/VBoxNetCfg-win.h
===================================================================
--- trunk/include/VBox/VBoxNetCfg-win.h	(revision 68669)
+++ trunk/include/VBox/VBoxNetCfg-win.h	(revision 68670)
@@ -42,4 +42,5 @@
 #include <iprt/win/Setupapi.h>
 #include <VBox/cdefs.h>
+#include <iprt/types.h>
 
 /** @defgroup grp_vboxnetcfgwin     The Windows Network Configration Library
Index: trunk/include/VBox/VBoxNetCmn-win.h
===================================================================
--- trunk/include/VBox/VBoxNetCmn-win.h	(revision 68669)
+++ trunk/include/VBox/VBoxNetCmn-win.h	(revision 68670)
@@ -25,7 +25,13 @@
  */
 
+#ifndef ___VBox_VBoxNetCmn_win_h
+#define ___VBox_VBoxNetCmn_win_h
+
+#include <iprt/log.h> /* for LOG_ENABLED */
+
+
 DECLHIDDEN(void) vboxNetCmnWinDumpOidRequest(const char *pcszFunction, PNDIS_OID_REQUEST pRequest)
 {
-#ifdef LOG_ENABLED
+# ifdef LOG_ENABLED
     const char *pszType;
     const char *pszOid  = "unknown";
@@ -137,6 +143,8 @@
     }
     Log(("%s: %s(0x%x) %s(0x%x)\n", pcszFunction, pszType, pRequest->RequestType, pszOid, pRequest->DATA.SET_INFORMATION.Oid));
-#else
+# else
     RT_NOREF2(pcszFunction, pRequest);
+# endif
+}
+
 #endif
-}
Index: trunk/include/VBox/VBoxPktDmp.h
===================================================================
--- trunk/include/VBox/VBoxPktDmp.h	(revision 68669)
+++ trunk/include/VBox/VBoxPktDmp.h	(revision 68670)
@@ -27,4 +27,11 @@
 #ifndef ___VBox_vboxpktdmp_h
 #define ___VBox_vboxpktdmp_h
+
+#include <iprt/net.h>
+#include <iprt/log.h>
+#if defined(LOG_ENABLED) && !defined(VBOX_DEVICE_STRUCT_TESTCASE)
+# include <iprt/asm.h>
+#endif
+
 
 DECLINLINE(const char *) vboxEthTypeStr(uint16_t uType)
Index: trunk/include/VBox/usblib-win.h
===================================================================
--- trunk/include/VBox/usblib-win.h	(revision 68669)
+++ trunk/include/VBox/usblib-win.h	(revision 68670)
@@ -302,7 +302,7 @@
 USBLIB_DECL(int) USBLibWaitChange(RTMSINTERVAL cMillies);
 
-USBLIB_DECL(int) USBLibInterruptWaitChange();
-
-USBLIB_DECL(int) USBLibRunFilters();
+USBLIB_DECL(int) USBLibInterruptWaitChange(void);
+
+USBLIB_DECL(int) USBLibRunFilters(void);
 
 /** @} */
Index: trunk/include/VBox/vd-ifs.h
===================================================================
--- trunk/include/VBox/vd-ifs.h	(revision 68669)
+++ trunk/include/VBox/vd-ifs.h	(revision 68670)
@@ -651,4 +651,6 @@
 VBOXDDU_DECL(int) VDIfCreateVfsStream(PVDINTERFACEIO pVDIfsIo, void *pvStorage, uint32_t fFlags, PRTVFSIOSTREAM phVfsIos);
 
+struct VDINTERFACEIOINT;
+
 /**
  * Create a VFS file handle around a VD I/O interface.
@@ -668,5 +670,6 @@
  * @param   phVfsFile       Where to return the VFS file handle on success.
  */
-VBOXDDU_DECL(int) VDIfCreateVfsFile(PVDINTERFACEIO pVDIfs, struct VDINTERFACEIOINT *pVDIfsInt, void *pvStorage, uint32_t fFlags, PRTVFSFILE phVfsFile);
+VBOXDDU_DECL(int) VDIfCreateVfsFile(PVDINTERFACEIO pVDIfs, struct VDINTERFACEIOINT *pVDIfsInt, void *pvStorage,
+                                    uint32_t fFlags, PRTVFSFILE phVfsFile);
 
 /**
Index: trunk/include/VBox/vd.h
===================================================================
--- trunk/include/VBox/vd.h	(revision 68669)
+++ trunk/include/VBox/vd.h	(revision 68670)
@@ -286,7 +286,7 @@
 DECLINLINE(uint32_t) VDOpenFlagsToFileOpenFlags(unsigned fOpenFlags, bool fCreate)
 {
+    uint32_t fOpen;
     AssertMsg(!(fOpenFlags & VD_OPEN_FLAGS_READONLY) || !fCreate, ("Image can't be opened readonly while being created\n"));
 
-    uint32_t fOpen;
     if (fOpenFlags & VD_OPEN_FLAGS_READONLY)
         fOpen = RTFILE_O_READ | RTFILE_O_DENY_NONE;
@@ -1514,5 +1514,5 @@
 typedef struct VDIOBUFCALLBACKS *PVDIOBUFCALLBACKS;
 /** Pointer to const VD I/O buffer callbacks. */
-typedef const VDIOBUFCALLBACKS *PCVDIOBUFCALLBACKS;
+typedef const struct VDIOBUFCALLBACKS *PCVDIOBUFCALLBACKS;
 
 /**
Index: trunk/include/VBox/vdmedia.h
===================================================================
--- trunk/include/VBox/vdmedia.h	(revision 68669)
+++ trunk/include/VBox/vdmedia.h	(revision 68670)
@@ -23,6 +23,9 @@
  * terms and conditions of either the GPL or the CDDL or both.
  */
+
 #ifndef ___VBox_vdmedia_h
 #define ___VBox_vdmedia_h
+
+#include <iprt/types.h>
 
 /** @name VD container type.
@@ -208,2 +211,3 @@
 
 #endif /* !___VBox_vdmedia_h */
+
