Index: trunk/src/VBox/HostDrivers/Support/SUPDrv.c
===================================================================
--- trunk/src/VBox/HostDrivers/Support/SUPDrv.c	(revision 25472)
+++ trunk/src/VBox/HostDrivers/Support/SUPDrv.c	(revision 25484)
@@ -337,6 +337,10 @@
  * @returns IPRT status code.
  * @param   pDevExt     The device extension to initialize.
- */
-int VBOXCALL supdrvInitDevExt(PSUPDRVDEVEXT pDevExt)
+ * @param   cbSession   The size of the session structure.  The size of
+ *                      SUPDRVSESSION may be smaller when SUPDRV_AGNOSTIC is
+ *                      defined because we're skipping the OS specific members
+ *                      then.
+ */
+int VBOXCALL supdrvInitDevExt(PSUPDRVDEVEXT pDevExt, size_t cbSession)
 {
     int rc;
@@ -385,4 +389,5 @@
                     {
                         pDevExt->u32Cookie = BIRD;  /** @todo make this random? */
+                        pDevExt->cbSession = cbSession;
 
                         /*
@@ -554,6 +559,6 @@
      * Allocate memory for the session data.
      */
-    int rc = VERR_NO_MEMORY;
-    PSUPDRVSESSION pSession = *ppSession = (PSUPDRVSESSION)RTMemAllocZ(sizeof(*pSession));
+    int             rc;
+    PSUPDRVSESSION  pSession = *ppSession = (PSUPDRVSESSION)RTMemAllocZ(pDevExt->cbSession);
     if (pSession)
     {
@@ -599,4 +604,6 @@
         Log(("Failed to create spinlock, rc=%d!\n", rc));
     }
+    else
+        rc = VERR_NO_MEMORY;
 
     return rc;
Index: trunk/src/VBox/HostDrivers/Support/SUPDrvInternal.h
===================================================================
--- trunk/src/VBox/HostDrivers/Support/SUPDrvInternal.h	(revision 25472)
+++ trunk/src/VBox/HostDrivers/Support/SUPDrvInternal.h	(revision 25484)
@@ -465,8 +465,6 @@
     /** Global cookie. */
     uint32_t                        u32Cookie;
-
-    /** The IDT entry number.
-     * Only valid if pIdtPatches is set. */
-    uint8_t volatile                u8Idt;
+    /** The actual size of SUPDRVSESSION. (SUPDRV_AGNOSTIC) */
+    uint32_t                        cbSession;
 
     /** Loader mutex.
@@ -600,5 +598,5 @@
 int  VBOXCALL   supdrvIOCtlFast(uintptr_t uIOCtl, VMCPUID idCpu, PSUPDRVDEVEXT pDevExt, PSUPDRVSESSION pSession);
 int  VBOXCALL   supdrvIDC(uintptr_t uIOCtl, PSUPDRVDEVEXT pDevExt, PSUPDRVSESSION pSession, PSUPDRVIDCREQHDR pReqHdr);
-int  VBOXCALL   supdrvInitDevExt(PSUPDRVDEVEXT pDevExt);
+int  VBOXCALL   supdrvInitDevExt(PSUPDRVDEVEXT pDevExt, size_t cbSession);
 void VBOXCALL   supdrvDeleteDevExt(PSUPDRVDEVEXT pDevExt);
 int  VBOXCALL   supdrvCreateSession(PSUPDRVDEVEXT pDevExt, bool fUser, PSUPDRVSESSION *ppSession);
Index: trunk/src/VBox/HostDrivers/Support/darwin/SUPDrv-darwin.cpp
===================================================================
--- trunk/src/VBox/HostDrivers/Support/darwin/SUPDrv-darwin.cpp	(revision 25472)
+++ trunk/src/VBox/HostDrivers/Support/darwin/SUPDrv-darwin.cpp	(revision 25484)
@@ -235,5 +235,5 @@
          * Initialize the device extension.
          */
-        rc = supdrvInitDevExt(&g_DevExt);
+        rc = supdrvInitDevExt(&g_DevExt, sizeof(SUPDRVSESSION));
         if (RT_SUCCESS(rc))
         {
Index: trunk/src/VBox/HostDrivers/Support/freebsd/SUPDrv-freebsd.c
===================================================================
--- trunk/src/VBox/HostDrivers/Support/freebsd/SUPDrv-freebsd.c	(revision 25472)
+++ trunk/src/VBox/HostDrivers/Support/freebsd/SUPDrv-freebsd.c	(revision 25484)
@@ -172,5 +172,5 @@
          * Initialize the device extension.
          */
-        rc = supdrvInitDevExt(&g_VBoxDrvFreeBSDDevExt);
+        rc = supdrvInitDevExt(&g_VBoxDrvFreeBSDDevExt, sizeof(SUPDRVSESSION));
         if (RT_SUCCESS(rc))
         {
Index: trunk/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c
===================================================================
--- trunk/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c	(revision 25472)
+++ trunk/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c	(revision 25484)
@@ -609,5 +609,5 @@
              */
             if (RT_SUCCESS(rc))
-                rc = supdrvInitDevExt(&g_DevExt);
+                rc = supdrvInitDevExt(&g_DevExt, sizeof(SUPDRVSESSION));
             if (RT_SUCCESS(rc))
             {
@@ -732,5 +732,5 @@
      * Call common code for the rest.
      */
-    rc = supdrvCreateSession(&g_DevExt, true /* fUser */, (PSUPDRVSESSION *)&pSession);
+    rc = supdrvCreateSession(&g_DevExt, true /* fUser */, &pSession);
     if (!rc)
     {
Index: trunk/src/VBox/HostDrivers/Support/os2/SUPDrv-os2.cpp
===================================================================
--- trunk/src/VBox/HostDrivers/Support/os2/SUPDrv-os2.cpp	(revision 25472)
+++ trunk/src/VBox/HostDrivers/Support/os2/SUPDrv-os2.cpp	(revision 25484)
@@ -102,5 +102,5 @@
          * Initialize the device extension.
          */
-        rc = supdrvInitDevExt(&g_DevExt);
+        rc = supdrvInitDevExt(&g_DevExt, sizeof(SUPDRVSESSION));
         if (RT_SUCCESS(rc))
         {
Index: trunk/src/VBox/HostDrivers/Support/solaris/SUPDrv-solaris.c
===================================================================
--- trunk/src/VBox/HostDrivers/Support/solaris/SUPDrv-solaris.c	(revision 25472)
+++ trunk/src/VBox/HostDrivers/Support/solaris/SUPDrv-solaris.c	(revision 25484)
@@ -212,5 +212,5 @@
          * Initialize the device extension
          */
-        rc = supdrvInitDevExt(&g_DevExt);
+        rc = supdrvInitDevExt(&g_DevExt, sizeof(SUPDRVSESSION));
         if (RT_SUCCESS(rc))
         {
Index: trunk/src/VBox/HostDrivers/Support/win/SUPDrv-win.cpp
===================================================================
--- trunk/src/VBox/HostDrivers/Support/win/SUPDrv-win.cpp	(revision 25472)
+++ trunk/src/VBox/HostDrivers/Support/win/SUPDrv-win.cpp	(revision 25484)
@@ -134,5 +134,5 @@
                 memset(pDevExt, 0, sizeof(*pDevExt));
 
-                vrc = supdrvInitDevExt(pDevExt);
+                vrc = supdrvInitDevExt(pDevExt, sizeof(SUPDRVSESSION));
                 if (!vrc)
                 {
