Index: /trunk/src/VBox/HostDrivers/Support/SUPDrv.c
===================================================================
--- /trunk/src/VBox/HostDrivers/Support/SUPDrv.c	(revision 10264)
+++ /trunk/src/VBox/HostDrivers/Support/SUPDrv.c	(revision 10265)
@@ -1162,6 +1162,9 @@
  * Inter-Driver Communcation (IDC) worker.
  *
- * @returns 0 on success.
- * @returns VERR_INVALID_PARAMETER if the request is invalid.
+ * @returns VBox status code.
+ * @retval  VINF_SUCCESS on success.
+ * @retval  VERR_NOT_SUPPORTED if the request isn't supported.
+ * @retval  VERR_NOT_IMPLEMENTED if during development.
+ * @retval  VERR_INVALID_PARAMETER if the request is invalid.
  *
  * @param   uReq        The request (function) code.
@@ -1172,5 +1175,76 @@
 int VBOXCALL supdrvIDC(uintptr_t uReq, PSUPDRVDEVEXT pDevExt, PSUPDRVSESSION pSession, PSUPDRVIDCREQHDR pReqHdr)
 {
-    return VERR_NOT_IMPLEMENTED;
+    /*
+     * The OS specific code has already validated the pSession
+     * pointer, and the request size being greater or equal to
+     * size of the header.
+     *
+     * So, just check that pSession is a kernel context session.
+     */
+    if (RT_UNLIKELY(    pSession
+                    &&  pSession->R0Process != NIL_RTR0PROCESS))
+        return VERR_INVALID_PARAMETER;
+
+/*
+ * Validation macro.
+ */
+#define REQ_CHECK_IDC_SIZE(Name, cbExpect) \
+    do { \
+        if (RT_UNLIKELY(pReqHdr->cb != (cbExpect))) \
+        { \
+            OSDBGPRINT(( #Name ": Invalid input/output sizes. cb=%ld expected %ld.\n", \
+                        (long)pReqHdr->cb, (long)(cbExpect))); \
+            return pReqHdr->rc = VERR_INVALID_PARAMETER; \
+        } \
+    } while (0)
+
+    switch (uReq)
+    {
+        case SUPDRV_IDC_REQ_CONNECT:
+        {
+            PSUPDRVIDCREQCONNECT pReq = (PSUPDRVIDCREQCONNECT)pReqHdr;
+            REQ_CHECK_IDC_SIZE(SUPDRV_IDC_REQ_CONNECT, sizeof(*pReq));
+
+            return VERR_NOT_IMPLEMENTED;
+        }
+
+        case SUPDRV_IDC_REQ_DISCONNECT:
+        {
+            REQ_CHECK_IDC_SIZE(SUPDRV_IDC_REQ_DISCONNECT, sizeof(*pReqHdr));
+
+            return VERR_NOT_IMPLEMENTED;
+        }
+
+        case SUPDRV_IDC_REQ_GET_SYMBOL:
+        {
+            PSUPDRVIDCREQGETSYM pReq;
+            REQ_CHECK_IDC_SIZE(SUPDRV_IDC_REQ_GET_SYMBOL, sizeof(*pReq));
+
+            return VERR_NOT_IMPLEMENTED;
+        }
+
+        case SUPDRV_IDC_REQ_COMPONENT_REGISTER_FACTORY:
+        {
+            PSUPDRVIDCREQCOMPREGFACTORY pReq;
+            REQ_CHECK_IDC_SIZE(SUPDRV_IDC_REQ_COMPONENT_REGISTER_FACTORY, sizeof(*pReq));
+
+            return VERR_NOT_IMPLEMENTED;
+        }
+
+        case SUPDRV_IDC_REQ_COMPONENT_DEREGISTER_FACTORY:
+        {
+            PSUPDRVIDCREQCOMPDEREGFACTORY pReq;
+            REQ_CHECK_IDC_SIZE(SUPDRV_IDC_REQ_COMPONENT_DEREGISTER_FACTORY, sizeof(*pReq));
+
+            return VERR_NOT_IMPLEMENTED;
+        }
+
+        default:
+            Log(("Unknown IDC %#lx\n", (long)uReq));
+            break;
+    }
+
+#undef REQ_CHECK_IDC_SIZE
+    return VERR_NOT_SUPPORTED;
 }
 
Index: /trunk/src/VBox/HostDrivers/Support/SUPDrvInternal.h
===================================================================
--- /trunk/src/VBox/HostDrivers/Support/SUPDrvInternal.h	(revision 10264)
+++ /trunk/src/VBox/HostDrivers/Support/SUPDrvInternal.h	(revision 10265)
@@ -541,5 +541,6 @@
     /** The process (id) of the session. (Set by the OS part.) */
     RTPROCESS                   Process;
-    /** Which process this session is associated with. */
+    /** Which process this session is associated with.
+     * This is NIL_RTR0PROCESS for kernel sessions and valid for user ones. */
     RTR0PROCESS                 R0Process;
 #if defined(RT_OS_OS2)
Index: /trunk/src/VBox/HostDrivers/Support/win/SUPDrv-win.cpp
===================================================================
--- /trunk/src/VBox/HostDrivers/Support/win/SUPDrv-win.cpp	(revision 10264)
+++ /trunk/src/VBox/HostDrivers/Support/win/SUPDrv-win.cpp	(revision 10265)
@@ -430,8 +430,14 @@
              pStack->Parameters.DeviceIoControl.OutputBufferLength, pSession));
 
-    if (pSession)
-    {
-        /* Verify that it's a buffered CTL. */
-        if ((pStack->Parameters.DeviceIoControl.IoControlCode & 0x3) == METHOD_BUFFERED)
+/** @todo IDC on NT: figure when to create the session and that stuff... */
+
+    /* Verify that it's a buffered CTL. */
+    if ((pStack->Parameters.DeviceIoControl.IoControlCode & 0x3) == METHOD_BUFFERED)
+    {
+        /* Verify the pDevExt in the session. */
+        if (    (   !pSession
+                 && pStack->Parameters.DeviceIoControl.IoControlCode == SUPDRV_IDC_REQ_CONNECT)
+            ||  (   VALID_PTR(pSession)
+                 && pSession->pDevExt == pDevExt))
         {
             /* Verify that the size in the request header is correct. */
@@ -465,9 +471,11 @@
         }
         else
-        {
-            dprintf(("VBoxDrvNtInternalDeviceControl: not buffered request (%#x) - not supported\n",
-                     pStack->Parameters.DeviceIoControl.IoControlCode));
             rcNt = STATUS_NOT_SUPPORTED;
-        }
+    }
+    else
+    {
+        dprintf(("VBoxDrvNtInternalDeviceControl: not buffered request (%#x) - not supported\n",
+                 pStack->Parameters.DeviceIoControl.IoControlCode));
+        rcNt = STATUS_NOT_SUPPORTED;
     }
 
