Index: /trunk/include/VBox/pdmifs.h
===================================================================
--- /trunk/include/VBox/pdmifs.h	(revision 26136)
+++ /trunk/include/VBox/pdmifs.h	(revision 26137)
@@ -65,6 +65,10 @@
 
 
-/**
- * PDM Driver Base Interface.
+/** @name PDMIBASE
+ * @{
+ */
+
+/**
+ * PDM Base Interface.
  *
  * Everyone implements this.
@@ -117,4 +121,147 @@
         } \
     } while (0)
+
+/** @} */
+
+
+/** @name PDMIBASERC
+ * @{
+ */
+
+/**
+ * PDM Base Interface for querying ring-mode context interfaces in
+ * ring-3.
+ *
+ * This is mandatory for drivers present in raw-mode context.
+ */
+typedef struct PDMIBASERC
+{
+    /**
+     * Queries an ring-mode context interface to the driver.
+     *
+     * @returns Pointer to interface.
+     * @returns NULL if the interface was not supported by the driver.
+     * @param   pInterface          Pointer to this interface structure.
+     * @param   pszIID              The interface ID, a UUID string.
+     * @thread  Any thread.
+     */
+    DECLR3CALLBACKMEMBER(RTRCPTR, pfnQueryInterface,(struct PDMIBASERC *pInterface, const char *pszIID));
+} PDMIBASERC;
+/** Pointer to a PDM Base Interface for query ring-mode context interfaces. */
+typedef PDMIBASERC *PPDMIBASERC;
+/** PDMIBASERC interface ID. */
+#define PDMIBASERC_IID                          "f6a6c649-6cb3-493f-9737-4653f221aeca"
+
+/**
+ * Helper macro for quering an interface from PDMIBASERC.
+ *
+ * @returns PDMIBASERC::pfnQueryInterface return value.
+ *
+ * @param   pIBaseRC        Pointer to the base ring-0 interface.
+ * @param   InterfaceType   The interface type name.  The interface ID is
+ *                          derived from this by appending _IID.
+ *
+ * @remarks Unlike PDMIBASE_QUERY_INTERFACE, this macro is not able to do any
+ *          implicit type checking for you.
+ */
+#define PDMIBASERC_QUERY_INTERFACE(pIBaseRC, InterfaceType)  \
+    ( (InterfaceType *)(pIBaseRC)->pfnQueryInterface(pIBaseRC, InterfaceType##_IID ) )
+
+/**
+ * Helper macro for implementing PDMIBASERC::pfnQueryInterface.
+ *
+ * Return @a pInterface if @a pszIID matches the @a InterfaceType.  This will
+ * perform basic type checking.
+ *
+ * @param   pIns            Pointer to the instance data.
+ * @param   pszIID          The ID of the interface that is being queried.
+ * @param   InterfaceType   The interface type name.  The interface ID is
+ *                          derived from this by appending _IID.
+ * @param   pInterface      The interface address expression.  This must resolve
+ *                          to some address within the instance data.
+ */
+#define PDMIBASERC_RETURN_INTERFACE(pIns, pszIID, InterfaceType, pInterface)  \
+    do { \
+        Assert((uintptr_t)pInterface - PDMINS_2_DATA(pIns, uintptr_t) < _4M); \
+        if (RTUuidCompare2Strs((pszIID), InterfaceType##_IID) == 0) \
+        { \
+            InterfaceType *pReturnInterfaceTypeCheck = (pInterface); \
+            return (uintptr_t)pReturnInterfaceTypeCheck \
+                 - PDMINS_2_DATA(pIns, uintptr_t) \
+                 + PDMINS_2_DATA_RCPTR(pIns); \
+        } \
+    } while (0)
+
+/** @} */
+
+
+/** @name PDMIBASER0
+ * @{
+ */
+
+/**
+ * PDM Base Interface for querying ring-0 interfaces in ring-3.
+ *
+ * This is mandatory for drivers present in ring-0 context.
+ */
+typedef struct PDMIBASER0
+{
+    /**
+     * Queries an ring-0 interface to the driver.
+     *
+     * @returns Pointer to interface.
+     * @returns NULL if the interface was not supported by the driver.
+     * @param   pInterface          Pointer to this interface structure.
+     * @param   pszIID              The interface ID, a UUID string.
+     * @thread  Any thread.
+     */
+    DECLR3CALLBACKMEMBER(RTR0PTR, pfnQueryInterface,(struct PDMIBASER0 *pInterface, const char *pszIID));
+} PDMIBASER0;
+/** Pointer to a PDM Base Interface for query ring-0 context interfaces. */
+typedef PDMIBASER0 *PPDMIBASER0;
+/** PDMIBASER0 interface ID. */
+#define PDMIBASER0_IID                          "9c9b99b8-7f53-4f59-a3c2-5bc9659c7944"
+
+/**
+ * Helper macro for quering an interface from PDMIBASER0.
+ *
+ * @returns PDMIBASER0::pfnQueryInterface return value.
+ *
+ * @param   pIBaseR0        Pointer to the base ring-0 interface.
+ * @param   InterfaceType   The interface type name.  The interface ID is
+ *                          derived from this by appending _IID.
+ *
+ * @remarks Unlike PDMIBASE_QUERY_INTERFACE, this macro is not able to do any
+ *          implicit type checking for you.
+ */
+#define PDMIBASER0_QUERY_INTERFACE(pIBaseR0, InterfaceType)  \
+    ( (InterfaceType *)(pIBaseR0)->pfnQueryInterface(pIBaseR0, InterfaceType##_IID ) )
+
+/**
+ * Helper macro for implementing PDMIBASER0::pfnQueryInterface.
+ *
+ * Return @a pInterface if @a pszIID matches the @a InterfaceType.  This will
+ * perform basic type checking.
+ *
+ * @param   pIns            Pointer to the instance data.
+ * @param   pszIID          The ID of the interface that is being queried.
+ * @param   InterfaceType   The interface type name.  The interface ID is
+ *                          derived from this by appending _IID.
+ * @param   pInterface      The interface address expression.  This must resolve
+ *                          to some address within the instance data.
+ */
+#define PDMIBASER0_RETURN_INTERFACE(pIns, pszIID, InterfaceType, pInterface)  \
+    do { \
+        Assert((uintptr_t)pInterface - PDMINS_2_DATA(pIns, uintptr_t) < _4M); \
+        if (RTUuidCompare2Strs((pszIID), InterfaceType##_IID) == 0) \
+        { \
+            InterfaceType *pReturnInterfaceTypeCheck = (pInterface); \
+            return (uintptr_t)pReturnInterfaceTypeCheck \
+                 - PDMINS_2_DATA(pIns, uintptr_t) \
+                 + PDMINS_2_DATA_R0PTR(pIns); \
+        } \
+    } while (0)
+
+/** @} */
 
 
Index: /trunk/include/VBox/types.h
===================================================================
--- /trunk/include/VBox/types.h	(revision 26136)
+++ /trunk/include/VBox/types.h	(revision 26137)
@@ -315,7 +315,7 @@
 
 
-/** Pointer to a PDM Driver Base Interface. */
+/** Pointer to a PDM Base Interface. */
 typedef struct PDMIBASE *PPDMIBASE;
-/** Pointer to a pointer to a PDM Driver Base Interface. */
+/** Pointer to a pointer to a PDM Base Interface. */
 typedef PPDMIBASE *PPPDMIBASE;
 
Index: /trunk/src/VBox/Devices/Network/DrvIntNet.cpp
===================================================================
--- /trunk/src/VBox/Devices/Network/DrvIntNet.cpp	(revision 26136)
+++ /trunk/src/VBox/Devices/Network/DrvIntNet.cpp	(revision 26137)
@@ -99,4 +99,9 @@
     /** The network name. */
     char                            szNetwork[INTNET_MAX_NETWORK_NAME];
+
+    /** Base interface for ring-0. */
+    PDMIBASER0                      IBaseR0;
+    /** Base interface for ring-0. */
+    PDMIBASERC                      IBaseRC;
 
 #ifdef LOG_ENABLED
@@ -584,10 +589,36 @@
 }
 
-/* -=-=-=-=- PDMINETWORKCONNECTOR -=-=-=-=- */
+/* -=-=-=-=- PDMIBASERC -=-=-=-=- */
+
+/**
+ * @interface_method_impl{PDMIBASERC,pfnQueryInterface}
+ */
+static DECLCALLBACK(RTRCPTR) drvR3IntNetIBaseRC_QueryInterface(PPDMIBASERC pInterface, const char *pszIID)
+{
+    PDRVINTNET pThis = RT_FROM_MEMBER(pInterface, DRVINTNET, IBaseRC);
+
+    PDMIBASERC_RETURN_INTERFACE(pThis->pDrvInsR3, pszIID, PDMIBASERC, &pThis->IBaseRC);
+    return NIL_RTRCPTR;
+}
+
+/* -=-=-=-=- PDMIBASER0 -=-=-=-=- */
+
+/**
+ * @interface_method_impl{PDMIBASER0,pfnQueryInterface}
+ */
+static DECLCALLBACK(RTR0PTR) drvR3IntNetIBaseR0_QueryInterface(PPDMIBASER0 pInterface, const char *pszIID)
+{
+    PDRVINTNET pThis = RT_FROM_MEMBER(pInterface, DRVINTNET, IBaseR0);
+
+    PDMIBASER0_RETURN_INTERFACE(pThis->pDrvInsR3, pszIID, PDMIBASER0, &pThis->IBaseR0);
+    return NIL_RTR0PTR;
+}
+
+/* -=-=-=-=- PDMIBASE -=-=-=-=- */
 
 /**
  * @interface_method_impl{PDMIBASE,pfnQueryInterface}
  */
-static DECLCALLBACK(void *) drvR3IntNetQueryInterface(PPDMIBASE pInterface, const char *pszIID)
+static DECLCALLBACK(void *) drvR3IntNetIBase_QueryInterface(PPDMIBASE pInterface, const char *pszIID)
 {
     PPDMDRVINS pDrvIns = PDMIBASE_2_PDMDRV(pInterface);
@@ -595,4 +626,6 @@
 
     PDMIBASE_RETURN_INTERFACE(pszIID, PDMIBASE, &pDrvIns->IBase);
+    PDMIBASE_RETURN_INTERFACE(pszIID, PDMIBASER0, &pThis->IBaseR0);
+    PDMIBASE_RETURN_INTERFACE(pszIID, PDMIBASERC, &pThis->IBaseRC);
     PDMIBASE_RETURN_INTERFACE(pszIID, PDMINETWORKCONNECTOR, &pThis->INetworkConnectorR3);
     return NULL;
@@ -790,6 +823,8 @@
     pThis->enmState                                 = ASYNCSTATE_SUSPENDED;
     pThis->fActivateEarlyDeactivateLate             = false;
-    /* IBase */
-    pDrvIns->IBase.pfnQueryInterface                = drvR3IntNetQueryInterface;
+    /* IBase* */
+    pDrvIns->IBase.pfnQueryInterface                = drvR3IntNetIBase_QueryInterface;
+    pThis->IBaseR0.pfnQueryInterface                = drvR3IntNetIBaseR0_QueryInterface;
+    pThis->IBaseRC.pfnQueryInterface                = drvR3IntNetIBaseRC_QueryInterface;
     /* INetwork */
     pThis->INetworkConnectorR3.pfnSend              = drvR3IntNetSend;
