Index: trunk/src/VBox/VMM/VMMR0/GMMR0.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMR0/GMMR0.cpp	(revision 30013)
+++ trunk/src/VBox/VMM/VMMR0/GMMR0.cpp	(revision 30027)
@@ -3546,5 +3546,5 @@
         if (!pRecVM)
         {
-            pRecVM = (PGMMSHAREDMODULEPERVM)RTMemAllocZ(sizeof(*pRecVM));
+            pRecVM = (PGMMSHAREDMODULEPERVM)RTMemAllocZ(RT_OFFSETOF(GMMSHAREDMODULEPERVM, aRegions[cRegions]));
             if (!pRecVM)
             {
@@ -3554,4 +3554,14 @@
             }
             pRecVM->Core.Key = GCBaseAddr;
+            pRecVM->cRegions = cRegions;
+
+            /* Save the region data as they can differ between VMs (address space scrambling or simply different loading order) */
+            for (unsigned i = 0; i < cRegions; i++)
+            {
+                pRecVM->aRegions[i].GCRegionAddr      = pRegions[i].GCRegionAddr;
+                pRecVM->aRegions[i].cbRegion          = RT_ALIGN_T(pRegions[i].cbRegion, PAGE_SIZE, uint32_t);
+                pRecVM->aRegions[i].u32Alignment      = 0;
+                pRecVM->aRegions[i].paHCPhysPageID    = NULL; /* unused */
+            }
 
             bool ret = RTAvlGCPtrInsert(&pGVM->gmm.s.pSharedModuleTree, &pRecVM->Core);
@@ -4053,6 +4063,6 @@
 typedef struct
 {
-    PGVM    pGVM;
-    VMCPUID idCpu;
+    PGVM                    pGVM;
+    VMCPUID                 idCpu;
 } GMMCHECKSHAREDMODULEINFO, *PGMMCHECKSHAREDMODULEINFO;
 
@@ -4070,5 +4080,5 @@
     {
         Log(("gmmR0CheckSharedModule: check %s %s base=%RGv size=%x collision=%d\n", pGlobalModule->szName, pGlobalModule->szVersion, pGlobalModule->Core.Key, pGlobalModule->cbModule, pLocalModule->fCollision));
-        PGMR0SharedModuleCheck(pInfo->pGVM->pVM, pInfo->idCpu, pGlobalModule, pInfo->pGVM);
+        PGMR0SharedModuleCheck(pInfo->pGVM->pVM, pInfo->pGVM, pInfo->idCpu, pGlobalModule, pLocalModule->cRegions, pLocalModule->aRegions);
     }
     return 0;
@@ -4155,6 +4165,6 @@
 
         Log(("GMMR0CheckSharedModules\n"));
-        Info.pGVM = pGVM;
-        Info.idCpu = pVCpu->idCpu;
+        Info.pGVM     = pGVM;
+        Info.idCpu    = pVCpu->idCpu;
 
         RTAvlGCPtrDoWithAll(&pGVM->gmm.s.pSharedModuleTree, true /* fFromLeft */, gmmR0CheckSharedModule, &Info);
Index: trunk/src/VBox/VMM/VMMR0/GMMR0Internal.h
===================================================================
--- trunk/src/VBox/VMM/VMMR0/GMMR0Internal.h	(revision 30013)
+++ trunk/src/VBox/VMM/VMMR0/GMMR0Internal.h	(revision 30027)
@@ -38,4 +38,5 @@
 typedef GMMVMSIZES *PGMMVMSIZES;
 
+
 /**
  * Shared module registration info (per VM)
@@ -52,5 +53,11 @@
     bool                        fCollision;
     /** Alignment. */
-    bool                        bAlignment[7];
+    bool                        bAlignment[3];
+
+    /** Number of included region descriptors */
+    uint32_t                    cRegions;
+
+    /** Shared region descriptor(s). */
+    GMMSHAREDREGIONDESC         aRegions[1];
 } GMMSHAREDMODULEPERVM;
 /** Pointer to a GMMSHAREDMODULEPERVM. */
Index: trunk/src/VBox/VMM/VMMR0/PGMR0SharedPage.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMR0/PGMR0SharedPage.cpp	(revision 30013)
+++ trunk/src/VBox/VMM/VMMR0/PGMR0SharedPage.cpp	(revision 30027)
@@ -40,7 +40,9 @@
  * @param   idCpu       VCPU id
  * @param   pModule     Module description
+ * @param   cRegions    Number of regions
+ * @param   pRegions    Region array
  * @param   pGVM        Pointer to the GVM instance data.
  */
-VMMR0DECL(int) PGMR0SharedModuleCheck(PVM pVM, VMCPUID idCpu, PGMMSHAREDMODULE pModule, PGVM pGVM)
+VMMR0DECL(int) PGMR0SharedModuleCheck(PVM pVM, PGVM pGVM, VMCPUID idCpu, PGMMSHAREDMODULE pModule, uint32_t cRegions, PGMMSHAREDREGIONDESC pRegions)
 {
     int                rc = VINF_SUCCESS;
@@ -55,11 +57,11 @@
 
     /* Check every region of the shared module. */
-    for (unsigned idxModule = 0; idxModule < pModule->cRegions; idxModule++)
+    for (unsigned idxRegion = 0; idxRegion < cRegions; idxRegion++)
     {
-        Assert((pModule->aRegions[idxModule].cbRegion & 0xfff) == 0);
-        Assert((pModule->aRegions[idxModule].GCRegionAddr & 0xfff) == 0);
+        Assert((pRegions[idxRegion].cbRegion & 0xfff) == 0);
+        Assert((pRegions[idxRegion].GCRegionAddr & 0xfff) == 0);
 
-        RTGCPTR  GCRegion  = pModule->aRegions[idxModule].GCRegionAddr;
-        unsigned cbRegion = pModule->aRegions[idxModule].cbRegion & ~0xfff;
+        RTGCPTR  GCRegion  = pRegions[idxRegion].GCRegionAddr;
+        unsigned cbRegion = pRegions[idxRegion].cbRegion & ~0xfff;
         unsigned idxPage = 0;
         bool     fValidChanges = false;
@@ -111,5 +113,5 @@
         if (fValidChanges)
         {
-            rc = GMMR0SharedModuleCheckRange(pGVM, pModule, idxModule, idxPage, paPageDesc);
+            rc = GMMR0SharedModuleCheckRange(pGVM, pModule, idxRegion, idxPage, paPageDesc);
             AssertRC(rc);
             if (RT_FAILURE(rc))
@@ -132,5 +134,5 @@
                     Assert(!PGM_PAGE_IS_SHARED(pPage));
 
-                    Log(("PGMR0SharedModuleCheck: shared page gc virt=%RGv phys %RGp host %RHp->%RHp\n", pModule->aRegions[idxModule].GCRegionAddr + i * PAGE_SIZE, paPageDesc[i].GCPhys, PGM_PAGE_GET_HCPHYS(pPage), paPageDesc[i].HCPhys));
+                    Log(("PGMR0SharedModuleCheck: shared page gc virt=%RGv phys %RGp host %RHp->%RHp\n", pRegions[idxRegion].GCRegionAddr + i * PAGE_SIZE, paPageDesc[i].GCPhys, PGM_PAGE_GET_HCPHYS(pPage), paPageDesc[i].HCPhys));
                     if (paPageDesc[i].HCPhys != PGM_PAGE_GET_HCPHYS(pPage))
                     {
