Index: trunk/src/VBox/VMM/CPUM.cpp
===================================================================
--- trunk/src/VBox/VMM/CPUM.cpp	(revision 11309)
+++ trunk/src/VBox/VMM/CPUM.cpp	(revision 11311)
@@ -508,5 +508,5 @@
      */
     PCPUMCPUID  pCpuId = &pCPUM->aGuestCpuIdStd[0];
-    uint32_t    cElements = ELEMENTS(pCPUM->aGuestCpuIdStd);
+    uint32_t    cElements = RT_ELEMENTS(pCPUM->aGuestCpuIdStd);
     for (i=0;; )
     {
@@ -732,11 +732,11 @@
     SSMR3PutU32(pSSM, pVM->cpum.s.fChanged);
 
-    SSMR3PutU32(pSSM, ELEMENTS(pVM->cpum.s.aGuestCpuIdStd));
+    SSMR3PutU32(pSSM, RT_ELEMENTS(pVM->cpum.s.aGuestCpuIdStd));
     SSMR3PutMem(pSSM, &pVM->cpum.s.aGuestCpuIdStd[0], sizeof(pVM->cpum.s.aGuestCpuIdStd));
 
-    SSMR3PutU32(pSSM, ELEMENTS(pVM->cpum.s.aGuestCpuIdExt));
+    SSMR3PutU32(pSSM, RT_ELEMENTS(pVM->cpum.s.aGuestCpuIdExt));
     SSMR3PutMem(pSSM, &pVM->cpum.s.aGuestCpuIdExt[0], sizeof(pVM->cpum.s.aGuestCpuIdExt));
 
-    SSMR3PutU32(pSSM, ELEMENTS(pVM->cpum.s.aGuestCpuIdCentaur));
+    SSMR3PutU32(pSSM, RT_ELEMENTS(pVM->cpum.s.aGuestCpuIdCentaur));
     SSMR3PutMem(pSSM, &pVM->cpum.s.aGuestCpuIdCentaur[0], sizeof(pVM->cpum.s.aGuestCpuIdCentaur));
 
@@ -785,10 +785,10 @@
     int rc = SSMR3GetU32(pSSM, &cElements); AssertRCReturn(rc, rc);
     /* Support old saved states with a smaller standard cpuid array. */
-    if (cElements > ELEMENTS(pVM->cpum.s.aGuestCpuIdStd))
+    if (cElements > RT_ELEMENTS(pVM->cpum.s.aGuestCpuIdStd))
         return VERR_SSM_DATA_UNIT_FORMAT_CHANGED;
     SSMR3GetMem(pSSM, &pVM->cpum.s.aGuestCpuIdStd[0], cElements*sizeof(pVM->cpum.s.aGuestCpuIdStd[0]));
 
     rc = SSMR3GetU32(pSSM, &cElements); AssertRCReturn(rc, rc);
-    if (cElements != ELEMENTS(pVM->cpum.s.aGuestCpuIdExt))
+    if (cElements != RT_ELEMENTS(pVM->cpum.s.aGuestCpuIdExt))
         return VERR_SSM_DATA_UNIT_FORMAT_CHANGED;
     SSMR3GetMem(pSSM, &pVM->cpum.s.aGuestCpuIdExt[0], sizeof(pVM->cpum.s.aGuestCpuIdExt));
@@ -876,5 +876,5 @@
     };
     char *psz = pszEFlags;
-    for (unsigned i = 0; i < ELEMENTS(s_aFlags); i++)
+    for (unsigned i = 0; i < RT_ELEMENTS(s_aFlags); i++)
     {
         const char *pszAdd = s_aFlags[i].fFlag & efl ? s_aFlags[i].pszSet : s_aFlags[i].pszClear;
@@ -1542,5 +1542,5 @@
                     "         RAW Extended CPUIDs\n"
                     "     Function  eax      ebx      ecx      edx\n");
-    for (unsigned i = 0; i < ELEMENTS(pVM->cpum.s.aGuestCpuIdExt); i++)
+    for (unsigned i = 0; i < RT_ELEMENTS(pVM->cpum.s.aGuestCpuIdExt); i++)
     {
         Guest = pVM->cpum.s.aGuestCpuIdExt[i];
Index: trunk/src/VBox/VMM/DBGF.cpp
===================================================================
--- trunk/src/VBox/VMM/DBGF.cpp	(revision 11309)
+++ trunk/src/VBox/VMM/DBGF.cpp	(revision 11311)
@@ -562,5 +562,5 @@
         RTGCPTR eip = pCtx->rip + pCtx->csHid.u64Base;
 #endif
-        for (iBp = 0; iBp < ELEMENTS(pVM->dbgf.s.aBreakpoints); iBp++)
+        for (iBp = 0; iBp < RT_ELEMENTS(pVM->dbgf.s.aBreakpoints); iBp++)
             if (    pVM->dbgf.s.aBreakpoints[iBp].enmType == DBGFBPTYPE_REM
                 &&  pVM->dbgf.s.aBreakpoints[iBp].GCPtr == eip)
Index: trunk/src/VBox/VMM/DBGFBp.cpp
===================================================================
--- trunk/src/VBox/VMM/DBGFBp.cpp	(revision 11309)
+++ trunk/src/VBox/VMM/DBGFBp.cpp	(revision 11311)
@@ -68,5 +68,5 @@
      */
     unsigned i;
-    for (i = 0; i < ELEMENTS(pVM->dbgf.s.aHwBreakpoints); i++)
+    for (i = 0; i < RT_ELEMENTS(pVM->dbgf.s.aHwBreakpoints); i++)
     {
         pVM->dbgf.s.aHwBreakpoints[i].iBp = i;
@@ -75,7 +75,7 @@
     }
 
-    for (i = 0; i < ELEMENTS(pVM->dbgf.s.aBreakpoints); i++)
-    {
-        pVM->dbgf.s.aBreakpoints[i].iBp = i + ELEMENTS(pVM->dbgf.s.aHwBreakpoints);
+    for (i = 0; i < RT_ELEMENTS(pVM->dbgf.s.aBreakpoints); i++)
+    {
+        pVM->dbgf.s.aBreakpoints[i].iBp = i + RT_ELEMENTS(pVM->dbgf.s.aHwBreakpoints);
         pVM->dbgf.s.aBreakpoints[i].enmType = DBGFBPTYPE_FREE;
     }
@@ -110,5 +110,5 @@
     {
         case DBGFBPTYPE_REG:
-            cBps = ELEMENTS(pVM->dbgf.s.aHwBreakpoints);
+            cBps = RT_ELEMENTS(pVM->dbgf.s.aHwBreakpoints);
             paBps = &pVM->dbgf.s.aHwBreakpoints[0];
             pcBpsCur = &pVM->dbgf.s.cHwBreakpoints;
@@ -117,5 +117,5 @@
         case DBGFBPTYPE_INT3:
         case DBGFBPTYPE_REM:
-            cBps = ELEMENTS(pVM->dbgf.s.aBreakpoints);
+            cBps = RT_ELEMENTS(pVM->dbgf.s.aBreakpoints);
             paBps = &pVM->dbgf.s.aBreakpoints[0];
             pcBpsCur = &pVM->dbgf.s.cBreakpoints;
@@ -156,10 +156,10 @@
     /* Find it. */
     PDBGFBP pBp;
-    if (iBp < ELEMENTS(pVM->dbgf.s.aHwBreakpoints))
+    if (iBp < RT_ELEMENTS(pVM->dbgf.s.aHwBreakpoints))
         pBp = &pVM->dbgf.s.aHwBreakpoints[iBp];
     else
     {
-        iBp -= ELEMENTS(pVM->dbgf.s.aHwBreakpoints);
-        if (iBp >= ELEMENTS(pVM->dbgf.s.aBreakpoints))
+        iBp -= RT_ELEMENTS(pVM->dbgf.s.aHwBreakpoints);
+        if (iBp >= RT_ELEMENTS(pVM->dbgf.s.aBreakpoints))
             return NULL;
         pBp = &pVM->dbgf.s.aBreakpoints[iBp];
@@ -205,5 +205,5 @@
     {
         case DBGFBPTYPE_REG:
-            cBps = ELEMENTS(pVM->dbgf.s.aHwBreakpoints);
+            cBps = RT_ELEMENTS(pVM->dbgf.s.aHwBreakpoints);
             paBps = &pVM->dbgf.s.aHwBreakpoints[0];
             break;
@@ -211,5 +211,5 @@
         case DBGFBPTYPE_INT3:
         case DBGFBPTYPE_REM:
-            cBps = ELEMENTS(pVM->dbgf.s.aBreakpoints);
+            cBps = RT_ELEMENTS(pVM->dbgf.s.aBreakpoints);
             paBps = &pVM->dbgf.s.aBreakpoints[0];
             break;
@@ -957,5 +957,5 @@
      */
     unsigned i;
-    for (i = 0; i < ELEMENTS(pVM->dbgf.s.aHwBreakpoints); i++)
+    for (i = 0; i < RT_ELEMENTS(pVM->dbgf.s.aHwBreakpoints); i++)
         if (pVM->dbgf.s.aHwBreakpoints[i].enmType != DBGFBPTYPE_FREE)
         {
@@ -968,5 +968,5 @@
      * Enumerate the other breakpoints.
      */
-    for (i = 0; i < ELEMENTS(pVM->dbgf.s.aBreakpoints); i++)
+    for (i = 0; i < RT_ELEMENTS(pVM->dbgf.s.aBreakpoints); i++)
         if (pVM->dbgf.s.aBreakpoints[i].enmType != DBGFBPTYPE_FREE)
         {
Index: trunk/src/VBox/VMM/PATM/CSAM.cpp
===================================================================
--- trunk/src/VBox/VMM/PATM/CSAM.cpp	(revision 11309)
+++ trunk/src/VBox/VMM/PATM/CSAM.cpp	(revision 11311)
@@ -198,5 +198,5 @@
     if (!fRegisteredCmds)
     {
-        int rc = DBGCRegisterCommands(&g_aCmds[0], ELEMENTS(g_aCmds));
+        int rc = DBGCRegisterCommands(&g_aCmds[0], RT_ELEMENTS(g_aCmds));
         if (VBOX_SUCCESS(rc))
             fRegisteredCmds = true;
@@ -2405,5 +2405,5 @@
                 AssertRC(rc);   /* can't fail */
 
-                for (unsigned i=0;i<ELEMENTS(aOpenBsdPushCSOffset);i++)
+                for (unsigned i=0;i<RT_ELEMENTS(aOpenBsdPushCSOffset);i++)
                 {
                     rc = CPUMR3DisasmInstrCPU(pVM, pCtx, pHandler - aOpenBsdPushCSOffset[i], &cpu, NULL);
Index: trunk/src/VBox/VMM/PATM/PATM.cpp
===================================================================
--- trunk/src/VBox/VMM/PATM/PATM.cpp	(revision 11309)
+++ trunk/src/VBox/VMM/PATM/PATM.cpp	(revision 11311)
@@ -184,5 +184,5 @@
     if (!fRegisteredCmds)
     {
-        int rc = DBGCRegisterCommands(&g_aCmds[0], ELEMENTS(g_aCmds));
+        int rc = DBGCRegisterCommands(&g_aCmds[0], RT_ELEMENTS(g_aCmds));
         if (VBOX_SUCCESS(rc))
             fRegisteredCmds = true;
@@ -324,5 +324,5 @@
     memset(pVM->patm.s.pGCStateHC, 0, PAGE_SIZE);
     AssertReleaseMsg(pVM->patm.s.pGCStateGC, ("Impossible! MMHyperHC2GC(%p) failed!\n", pVM->patm.s.pGCStateGC));
-    
+
     Log(("Patch memory allocated at %p - %VRv\n", pVM->patm.s.pPatchMemHC, pVM->patm.s.pPatchMemGC));
     pVM->patm.s.pGCStateHC->uVMFlags = X86_EFL_IF;
Index: trunk/src/VBox/VMM/PDM.cpp
===================================================================
--- trunk/src/VBox/VMM/PDM.cpp	(revision 11309)
+++ trunk/src/VBox/VMM/PDM.cpp	(revision 11311)
@@ -298,5 +298,5 @@
      * The register PCI Buses.
      */
-    for (unsigned i = 0; i < ELEMENTS(pVM->pdm.s.aPciBuses); i++)
+    for (unsigned i = 0; i < RT_ELEMENTS(pVM->pdm.s.aPciBuses); i++)
     {
         if (pVM->pdm.s.aPciBuses[i].pDevInsRC)
Index: trunk/src/VBox/VMM/PDMDevice.cpp
===================================================================
--- trunk/src/VBox/VMM/PDMDevice.cpp	(revision 11309)
+++ trunk/src/VBox/VMM/PDMDevice.cpp	(revision 11311)
@@ -2411,10 +2411,10 @@
      */
     unsigned iBus = 0;
-    for (iBus = 0; iBus < ELEMENTS(pVM->pdm.s.aPciBuses); iBus++)
+    for (iBus = 0; iBus < RT_ELEMENTS(pVM->pdm.s.aPciBuses); iBus++)
         if (!pVM->pdm.s.aPciBuses[iBus].pDevInsR3)
             break;
-    if (iBus >= ELEMENTS(pVM->pdm.s.aPciBuses))
-    {
-        AssertMsgFailed(("Too many PCI buses. Max=%u\n", ELEMENTS(pVM->pdm.s.aPciBuses)));
+    if (iBus >= RT_ELEMENTS(pVM->pdm.s.aPciBuses))
+    {
+        AssertMsgFailed(("Too many PCI buses. Max=%u\n", RT_ELEMENTS(pVM->pdm.s.aPciBuses)));
         LogFlow(("pdmR3DevHlp_PCIBusRegister: caller='%s'/%d: returns %Vrc (pci bus)\n", pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, VERR_INVALID_PARAMETER));
         return VERR_INVALID_PARAMETER;
Index: trunk/src/VBox/VMM/PDMDriver.cpp
===================================================================
--- trunk/src/VBox/VMM/PDMDriver.cpp	(revision 11309)
+++ trunk/src/VBox/VMM/PDMDriver.cpp	(revision 11311)
@@ -906,5 +906,5 @@
     int rc = VINF_SUCCESS;
     PVM pVM = pDrvIns->Internal.s.pVM;
-    if (pVM->pdm.s.cPollers < ELEMENTS(pVM->pdm.s.apfnPollers))
+    if (pVM->pdm.s.cPollers < RT_ELEMENTS(pVM->pdm.s.apfnPollers))
     {
         pVM->pdm.s.apfnPollers[pVM->pdm.s.cPollers] = pfnPoller;
Index: trunk/src/VBox/VMM/PGM.cpp
===================================================================
--- trunk/src/VBox/VMM/PGM.cpp	(revision 11309)
+++ trunk/src/VBox/VMM/PGM.cpp	(revision 11311)
@@ -1130,5 +1130,5 @@
     pVM->pgm.s.pGstPaePDPTHC    = NULL;
     pVM->pgm.s.pGstPaePDPTGC    = 0;
-    for (unsigned i = 0; i < ELEMENTS(pVM->pgm.s.apGstPaePDsHC); i++)
+    for (unsigned i = 0; i < RT_ELEMENTS(pVM->pgm.s.apGstPaePDsHC); i++)
     {
         pVM->pgm.s.apGstPaePDsHC[i]             = NULL;
@@ -1250,5 +1250,5 @@
         if (!fRegisteredCmds)
         {
-            int rc = DBGCRegisterCommands(&g_aCmds[0], ELEMENTS(g_aCmds));
+            int rc = DBGCRegisterCommands(&g_aCmds[0], RT_ELEMENTS(g_aCmds));
             if (VBOX_SUCCESS(rc))
                 fRegisteredCmds = true;
@@ -1352,5 +1352,5 @@
 
     ASMMemZeroPage(pVM->pgm.s.pInterPaePDPT);
-    for (unsigned i = 0; i < ELEMENTS(pVM->pgm.s.apInterPaePDs); i++)
+    for (unsigned i = 0; i < RT_ELEMENTS(pVM->pgm.s.apInterPaePDs); i++)
     {
         ASMMemZeroPage(pVM->pgm.s.apInterPaePDs[i]);
@@ -1359,7 +1359,7 @@
     }
 
-    for (unsigned i = 0; i < ELEMENTS(pVM->pgm.s.pInterPaePDPT64->a); i++)
-    {
-        const unsigned iPD = i % ELEMENTS(pVM->pgm.s.apInterPaePDs);
+    for (unsigned i = 0; i < RT_ELEMENTS(pVM->pgm.s.pInterPaePDPT64->a); i++)
+    {
+        const unsigned iPD = i % RT_ELEMENTS(pVM->pgm.s.apInterPaePDs);
         pVM->pgm.s.pInterPaePDPT64->a[i].u = X86_PDPE_P | X86_PDPE_RW | X86_PDPE_US | X86_PDPE_A | PGM_PLXFLAGS_PERMANENT
                                             | MMPage2Phys(pVM, pVM->pgm.s.apInterPaePDs[iPD]);
@@ -1367,5 +1367,5 @@
 
     RTHCPHYS HCPhysInterPaePDPT64 = MMPage2Phys(pVM, pVM->pgm.s.pInterPaePDPT64);
-    for (unsigned i = 0; i < ELEMENTS(pVM->pgm.s.pInterPaePML4->a); i++)
+    for (unsigned i = 0; i < RT_ELEMENTS(pVM->pgm.s.pInterPaePML4->a); i++)
         pVM->pgm.s.pInterPaePML4->a[i].u = X86_PML4E_P | X86_PML4E_RW | X86_PML4E_US | X86_PML4E_A | PGM_PLXFLAGS_PERMANENT
                                          | HCPhysInterPaePDPT64;
@@ -1417,5 +1417,5 @@
     ASMMemZero32(pVM->pgm.s.pHCPaePDPT, PAGE_SIZE);
     ASMMemZero32(pVM->pgm.s.pHCNestedRoot, PAGE_SIZE);
-    for (unsigned i = 0; i < ELEMENTS(pVM->pgm.s.apHCPaePDs); i++)
+    for (unsigned i = 0; i < RT_ELEMENTS(pVM->pgm.s.apHCPaePDs); i++)
     {
         ASMMemZero32(pVM->pgm.s.apHCPaePDs[i], PAGE_SIZE);
@@ -1712,5 +1712,5 @@
      * Reserve space for mapping the paging pages into guest context.
      */
-    int rc = MMR3HyperReserve(pVM, PAGE_SIZE * (2 + ELEMENTS(pVM->pgm.s.apHCPaePDs) + 1 + 2 + 2), "Paging", &GCPtr);
+    int rc = MMR3HyperReserve(pVM, PAGE_SIZE * (2 + RT_ELEMENTS(pVM->pgm.s.apHCPaePDs) + 1 + 2 + 2), "Paging", &GCPtr);
     AssertRCReturn(rc, rc);
     pVM->pgm.s.pGC32BitPD = GCPtr;
@@ -1761,5 +1761,5 @@
     GCPtr += PAGE_SIZE; /* reserved page */
 
-    for (unsigned i = 0; i < ELEMENTS(pVM->pgm.s.apHCPaePDs); i++)
+    for (unsigned i = 0; i < RT_ELEMENTS(pVM->pgm.s.apHCPaePDs); i++)
     {
         rc = PGMMap(pVM, GCPtr, pVM->pgm.s.aHCPhysPaePDs[i], PAGE_SIZE, 0);
@@ -1796,5 +1796,5 @@
     /* init cache */
     RTHCPHYS HCPhysDummy = MMR3PageDummyHCPhys(pVM);
-    for (unsigned i = 0; i < ELEMENTS(pVM->pgm.s.aHCPhysDynPageMapCache); i++)
+    for (unsigned i = 0; i < RT_ELEMENTS(pVM->pgm.s.aHCPhysDynPageMapCache); i++)
         pVM->pgm.s.aHCPhysDynPageMapCache[i] = HCPhysDummy;
 
@@ -1829,6 +1829,6 @@
     pVM->pgm.s.pGC32BitPD    += offDelta;
     pVM->pgm.s.pGuestPDGC    += offDelta;
-    AssertCompile(ELEMENTS(pVM->pgm.s.apGCPaePDs) == ELEMENTS(pVM->pgm.s.apGstPaePDsGC));
-    for (unsigned i = 0; i < ELEMENTS(pVM->pgm.s.apGCPaePDs); i++)
+    AssertCompile(RT_ELEMENTS(pVM->pgm.s.apGCPaePDs) == RT_ELEMENTS(pVM->pgm.s.apGstPaePDsGC));
+    for (unsigned i = 0; i < RT_ELEMENTS(pVM->pgm.s.apGCPaePDs); i++)
     {
         pVM->pgm.s.apGCPaePDs[i]    += offDelta;
@@ -2539,5 +2539,5 @@
      * Iterate the page directory.
      */
-    for (unsigned iPD = 0; iPD < ELEMENTS(pPDSrc->a); iPD++)
+    for (unsigned iPD = 0; iPD < RT_ELEMENTS(pPDSrc->a); iPD++)
     {
         X86PDE PdeSrc = pPDSrc->a[iPD];
@@ -3422,5 +3422,5 @@
 static int  pgmR3DumpHierarchyHCPaePT(PVM pVM, PX86PTPAE pPT, uint64_t u64Address, bool fLongMode, unsigned cMaxDepth, PCDBGFINFOHLP pHlp)
 {
-    for (unsigned i = 0; i < ELEMENTS(pPT->a); i++)
+    for (unsigned i = 0; i < RT_ELEMENTS(pPT->a); i++)
     {
         X86PTEPAE Pte = pPT->a[i];
@@ -3475,5 +3475,5 @@
 
     int rc = VINF_SUCCESS;
-    for (unsigned i = 0; i < ELEMENTS(pPD->a); i++)
+    for (unsigned i = 0; i < RT_ELEMENTS(pPD->a); i++)
     {
         X86PDEPAE Pde = pPD->a[i];
@@ -3582,5 +3582,5 @@
 
     int rc = VINF_SUCCESS;
-    const unsigned c = fLongMode ? ELEMENTS(pPDPT->a) : X86_PG_PAE_PDPE_ENTRIES;
+    const unsigned c = fLongMode ? RT_ELEMENTS(pPDPT->a) : X86_PG_PAE_PDPE_ENTRIES;
     for (unsigned i = 0; i < c; i++)
     {
@@ -3651,5 +3651,5 @@
 
     int rc = VINF_SUCCESS;
-    for (unsigned i = 0; i < ELEMENTS(pPML4->a); i++)
+    for (unsigned i = 0; i < RT_ELEMENTS(pPML4->a); i++)
     {
         X86PML4E Pml4e = pPML4->a[i];
@@ -3697,5 +3697,5 @@
 int  pgmR3DumpHierarchyHC32BitPT(PVM pVM, PX86PT pPT, uint32_t u32Address, PCDBGFINFOHLP pHlp)
 {
-    for (unsigned i = 0; i < ELEMENTS(pPT->a); i++)
+    for (unsigned i = 0; i < RT_ELEMENTS(pPT->a); i++)
     {
         X86PTE Pte = pPT->a[i];
@@ -3743,5 +3743,5 @@
 
     int rc = VINF_SUCCESS;
-    for (unsigned i = 0; i < ELEMENTS(pPD->a); i++)
+    for (unsigned i = 0; i < RT_ELEMENTS(pPD->a); i++)
     {
         X86PDE Pde = pPD->a[i];
@@ -3827,5 +3827,5 @@
 int pgmR3DumpHierarchyGC32BitPT(PVM pVM, PX86PT pPT, uint32_t u32Address, RTGCPHYS PhysSearch)
 {
-    for (unsigned i = 0; i < ELEMENTS(pPT->a); i++)
+    for (unsigned i = 0; i < RT_ELEMENTS(pPT->a); i++)
     {
         X86PTE Pte = pPT->a[i];
@@ -3905,5 +3905,5 @@
          cch, "", cch, "", cch, "", cch, "", cch, "", cch, "", cch, "Address"));
 
-    for (unsigned i = 0; i < ELEMENTS(pPD->a); i++)
+    for (unsigned i = 0; i < RT_ELEMENTS(pPD->a); i++)
     {
         X86PDE Pde = pPD->a[i];
Index: trunk/src/VBox/VMM/PGMMap.cpp
===================================================================
--- trunk/src/VBox/VMM/PGMMap.cpp	(revision 11309)
+++ trunk/src/VBox/VMM/PGMMap.cpp	(revision 11311)
@@ -894,5 +894,5 @@
      */
     const unsigned  cPTs = pMapping->cPTs;
-    unsigned        iPDNew = ELEMENTS(pPDSrc->a) - cPTs; /* (+ 1 - 1) */
+    unsigned        iPDNew = RT_ELEMENTS(pPDSrc->a) - cPTs; /* (+ 1 - 1) */
     while (iPDNew-- > 0)
     {
@@ -963,5 +963,5 @@
          */
         const unsigned  cPTs = pMapping->cb >> X86_PD_PAE_SHIFT;
-        unsigned        iPDNew = ELEMENTS(pPDSrc->a) - cPTs; /* (+ 1 - 1) */
+        unsigned        iPDNew = RT_ELEMENTS(pPDSrc->a) - cPTs; /* (+ 1 - 1) */
 
         while (iPDNew-- > 0)
@@ -1150,5 +1150,5 @@
             unsigned iPT  = off >> X86_PD_SHIFT;
             unsigned iPTE = (off >> PAGE_SHIFT) & X86_PT_MASK;
-            while (cb > 0 && iPTE < ELEMENTS(CTXALLSUFF(pCur->aPTs[iPT].pPT)->a))
+            while (cb > 0 && iPTE < RT_ELEMENTS(CTXALLSUFF(pCur->aPTs[iPT].pPT)->a))
             {
                 if (!CTXALLSUFF(pCur->aPTs[iPT].paPaePTs)[iPTE / 512].a[iPTE % 512].n.u1Present)
Index: trunk/src/VBox/VMM/PGMPool.cpp
===================================================================
--- trunk/src/VBox/VMM/PGMPool.cpp	(revision 11309)
+++ trunk/src/VBox/VMM/PGMPool.cpp	(revision 11311)
@@ -220,5 +220,5 @@
 #endif
 #ifdef PGMPOOL_WITH_CACHE
-    for (unsigned i = 0; i < ELEMENTS(pPool->aiHash); i++)
+    for (unsigned i = 0; i < RT_ELEMENTS(pPool->aiHash); i++)
         pPool->aiHash[i] = NIL_PGMPOOL_IDX;
     pPool->iAgeHead = NIL_PGMPOOL_IDX;
@@ -259,5 +259,5 @@
         pPool->aPages[PGMPOOL_IDX_PAE_PD_0 + i].idx       = PGMPOOL_IDX_PAE_PD_0 + i;
     }
-  
+
     /* The Shadow PDPT. */
     pPool->aPages[PGMPOOL_IDX_PDPT].Core.Key  = NIL_RTHCPHYS;
Index: trunk/src/VBox/VMM/STAM.cpp
===================================================================
--- trunk/src/VBox/VMM/STAM.cpp	(revision 11309)
+++ trunk/src/VBox/VMM/STAM.cpp	(revision 11311)
@@ -148,6 +148,6 @@
 {
     /* pszCmd,      cArgsMin, cArgsMax, paArgDesc,          cArgDescs,                  pResultDesc,        fFlags,     pfnHandler          pszSyntax,          ....pszDescription */
-    { "stats",      0,        1,        &g_aArgPat[0],      ELEMENTS(g_aArgPat),        NULL,               0,          stamR3CmdStats,     "[pattern]",        "Display statistics." },
-    { "statsreset", 0,        1,        &g_aArgPat[0],      ELEMENTS(g_aArgPat),        NULL,               0,          stamR3CmdStatsReset,"[pattern]",        "Resets statistics." }
+    { "stats",      0,        1,        &g_aArgPat[0],      RT_ELEMENTS(g_aArgPat),        NULL,               0,          stamR3CmdStats,     "[pattern]",        "Display statistics." },
+    { "statsreset", 0,        1,        &g_aArgPat[0],      RT_ELEMENTS(g_aArgPat),        NULL,               0,          stamR3CmdStatsReset,"[pattern]",        "Resets statistics." }
 };
 #endif
@@ -221,5 +221,5 @@
     if (!fRegisteredCmds)
     {
-        int rc = DBGCRegisterCommands(&g_aCmds[0], ELEMENTS(g_aCmds));
+        int rc = DBGCRegisterCommands(&g_aCmds[0], RT_ELEMENTS(g_aCmds));
         if (VBOX_SUCCESS(rc))
             fRegisteredCmds = true;
Index: trunk/src/VBox/VMM/TM.cpp
===================================================================
--- trunk/src/VBox/VMM/TM.cpp	(revision 11309)
+++ trunk/src/VBox/VMM/TM.cpp	(revision 11311)
@@ -647,5 +647,5 @@
     uint64_t                au64Samples[5];
     unsigned                i;
-    for (i = 0; i < ELEMENTS(au64Samples); i++)
+    for (i = 0; i < RT_ELEMENTS(au64Samples); i++)
     {
         unsigned    cMillies;
@@ -674,5 +674,5 @@
     unsigned iHigh = 0;
     unsigned iLow = 0;
-    for (i = 1; i < ELEMENTS(au64Samples); i++)
+    for (i = 1; i < RT_ELEMENTS(au64Samples); i++)
     {
         if (au64Samples[i] < au64Samples[iLow])
@@ -685,7 +685,7 @@
 
     u64Hz = au64Samples[0];
-    for (i = 1; i < ELEMENTS(au64Samples); i++)
+    for (i = 1; i < RT_ELEMENTS(au64Samples); i++)
         u64Hz += au64Samples[i];
-    u64Hz /= ELEMENTS(au64Samples) - 2;
+    u64Hz /= RT_ELEMENTS(au64Samples) - 2;
 
     return u64Hz;
Index: trunk/src/VBox/VMM/TRPM.cpp
===================================================================
--- trunk/src/VBox/VMM/TRPM.cpp	(revision 11309)
+++ trunk/src/VBox/VMM/TRPM.cpp	(revision 11311)
@@ -431,5 +431,5 @@
     AssertRelease(!(RT_OFFSETOF(VM, trpm.s.aIdt) & 15));
     AssertRelease(sizeof(pVM->trpm.s) <= sizeof(pVM->trpm.padding));
-    AssertRelease(ELEMENTS(pVM->trpm.s.aGuestTrapHandler) == sizeof(pVM->trpm.s.au32IdtPatched)*8);
+    AssertRelease(RT_ELEMENTS(pVM->trpm.s.aGuestTrapHandler) == sizeof(pVM->trpm.s.au32IdtPatched)*8);
 
     /*
@@ -573,5 +573,5 @@
     PVBOXIDTE pIdte = &pVM->trpm.s.aIdt[0];
     PVBOXIDTE_GENERIC pIdteTemplate = &g_aIdt[0];
-    for (unsigned i = 0; i < ELEMENTS(pVM->trpm.s.aIdt); i++, pIdte++, pIdteTemplate++)
+    for (unsigned i = 0; i < RT_ELEMENTS(pVM->trpm.s.aIdt); i++, pIdte++, pIdteTemplate++)
     {
         if (    pIdte->Gen.u1Present
@@ -631,5 +631,5 @@
 
     /* Relocate IDT handlers for forwarding guest traps/interrupts. */
-    for (uint32_t iTrap = 0; iTrap < ELEMENTS(pVM->trpm.s.aGuestTrapHandler); iTrap++)
+    for (uint32_t iTrap = 0; iTrap < RT_ELEMENTS(pVM->trpm.s.aGuestTrapHandler); iTrap++)
     {
         if (pVM->trpm.s.aGuestTrapHandler[iTrap] != TRPM_INVALID_HANDLER)
@@ -748,5 +748,5 @@
      * Save any trampoline gates.
      */
-    for (uint32_t iTrap = 0; iTrap < ELEMENTS(pTrpm->aGuestTrapHandler); iTrap++)
+    for (uint32_t iTrap = 0; iTrap < RT_ELEMENTS(pTrpm->aGuestTrapHandler); iTrap++)
     {
         if (pTrpm->aGuestTrapHandler[iTrap])
@@ -847,5 +847,5 @@
         if (iTrap == (uint32_t)~0)
             break;
-        if (    iTrap >= ELEMENTS(pTrpm->aIdt)
+        if (    iTrap >= RT_ELEMENTS(pTrpm->aIdt)
             ||  pTrpm->aGuestTrapHandler[iTrap])
         {
@@ -1060,5 +1060,5 @@
 
     if (    iTrap < TRPM_HANDLER_INT_BASE
-        ||  iTrap >= ELEMENTS(pVM->trpm.s.aIdt))
+        ||  iTrap >= RT_ELEMENTS(pVM->trpm.s.aIdt))
     {
         AssertMsg(iTrap < TRPM_HANDLER_INT_BASE, ("Illegal gate number %#x!\n", iTrap));
@@ -1109,5 +1109,5 @@
 TRPMR3DECL(uint32_t) TRPMR3QueryGateByHandler(PVM pVM, RTRCPTR GCPtr)
 {
-    for (uint32_t iTrap = 0; iTrap < ELEMENTS(pVM->trpm.s.aGuestTrapHandler); iTrap++)
+    for (uint32_t iTrap = 0; iTrap < RT_ELEMENTS(pVM->trpm.s.aGuestTrapHandler); iTrap++)
     {
         if (pVM->trpm.s.aGuestTrapHandler[iTrap] == GCPtr)
@@ -1137,5 +1137,5 @@
 TRPMR3DECL(RTRCPTR) TRPMR3GetGuestTrapHandler(PVM pVM, unsigned iTrap)
 {
-    AssertReturn(iTrap < ELEMENTS(pVM->trpm.s.aIdt), TRPM_INVALID_HANDLER);
+    AssertReturn(iTrap < RT_ELEMENTS(pVM->trpm.s.aIdt), TRPM_INVALID_HANDLER);
 
     return pVM->trpm.s.aGuestTrapHandler[iTrap];
@@ -1157,5 +1157,5 @@
      * Validate.
      */
-    if (iTrap >= ELEMENTS(pVM->trpm.s.aIdt))
+    if (iTrap >= RT_ELEMENTS(pVM->trpm.s.aIdt))
     {
         AssertMsg(iTrap < TRPM_HANDLER_INT_BASE, ("Illegal gate number %d!\n", iTrap));
Index: trunk/src/VBox/VMM/VMM.cpp
===================================================================
--- trunk/src/VBox/VMM/VMM.cpp	(revision 11309)
+++ trunk/src/VBox/VMM/VMM.cpp	(revision 11311)
@@ -225,5 +225,5 @@
      */
     unsigned cbCoreCode = 0;
-    for (unsigned iSwitcher = 0; iSwitcher < ELEMENTS(s_apSwitchers); iSwitcher++)
+    for (unsigned iSwitcher = 0; iSwitcher < RT_ELEMENTS(s_apSwitchers); iSwitcher++)
     {
         pVM->vmm.s.aoffSwitchers[iSwitcher] = cbCoreCode;
@@ -298,5 +298,5 @@
          * copy the code.
          */
-        for (unsigned iSwitcher = 0; iSwitcher < ELEMENTS(s_apSwitchers); iSwitcher++)
+        for (unsigned iSwitcher = 0; iSwitcher < RT_ELEMENTS(s_apSwitchers); iSwitcher++)
         {
             PVMMSWITCHERDEF pSwitcher = s_apSwitchers[iSwitcher];
@@ -817,5 +817,5 @@
      * All the switchers.
      */
-    for (unsigned iSwitcher = 0; iSwitcher < ELEMENTS(s_apSwitchers); iSwitcher++)
+    for (unsigned iSwitcher = 0; iSwitcher < RT_ELEMENTS(s_apSwitchers); iSwitcher++)
     {
         PVMMSWITCHERDEF pSwitcher = s_apSwitchers[iSwitcher];
@@ -2654,5 +2654,5 @@
         { "cfgm",           NULL },
     };
-    for (unsigned i = 0; i < ELEMENTS(aInfo); i++)
+    for (unsigned i = 0; i < RT_ELEMENTS(aInfo); i++)
     {
         if (fDoneHyper && !strcmp(aInfo[i].pszInfo, "cpumhyper"))
Index: trunk/src/VBox/VMM/VMMAll/CPUMAllRegs.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMAll/CPUMAllRegs.cpp	(revision 11309)
+++ trunk/src/VBox/VMM/VMMAll/CPUMAllRegs.cpp	(revision 11311)
@@ -966,5 +966,5 @@
 {
     PCCPUMCPUID pCpuId;
-    if (iLeaf < ELEMENTS(pVM->cpum.s.aGuestCpuIdStd))
+    if (iLeaf < RT_ELEMENTS(pVM->cpum.s.aGuestCpuIdStd))
         pCpuId = &pVM->cpum.s.aGuestCpuIdStd[iLeaf];
     else if (iLeaf - UINT32_C(0x80000000) < RT_ELEMENTS(pVM->cpum.s.aGuestCpuIdExt))
Index: trunk/src/VBox/VMM/VMMAll/DBGFAll.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMAll/DBGFAll.cpp	(revision 11309)
+++ trunk/src/VBox/VMM/VMMAll/DBGFAll.cpp	(revision 11311)
@@ -41,5 +41,5 @@
     RTGCUINTREG uDr7 = X86_DR7_GD | X86_DR7_GE | X86_DR7_LE | X86_DR7_MB1_MASK;
     PDBGFBP     pBp = &pVM->dbgf.s.aHwBreakpoints[0];
-    unsigned    cLeft = ELEMENTS(pVM->dbgf.s.aHwBreakpoints);
+    unsigned    cLeft = RT_ELEMENTS(pVM->dbgf.s.aHwBreakpoints);
     while (cLeft-- > 0)
     {
Index: trunk/src/VBox/VMM/VMMAll/MMAllHyper.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMAll/MMAllHyper.cpp	(revision 11309)
+++ trunk/src/VBox/VMM/VMMAll/MMAllHyper.cpp	(revision 11311)
@@ -809,5 +809,5 @@
      * Check poison.
      */
-    unsigned i = ELEMENTS(pHeap->aDelayedFrees);
+    unsigned i = RT_ELEMENTS(pHeap->aDelayedFrees);
     while (i-- > 0)
         if (pHeap->aDelayedFrees[i].offChunk)
@@ -836,5 +836,5 @@
     pHeap->aDelayedFrees[pHeap->iDelayedFree].offChunk = (uintptr_t)pChunk - (uintptr_t)pHeap;
     pHeap->aDelayedFrees[pHeap->iDelayedFree].uCaller = (uintptr_t)ASMReturnAddress();
-    pHeap->iDelayedFree = (pHeap->iDelayedFree + 1) % ELEMENTS(pHeap->aDelayedFrees);
+    pHeap->iDelayedFree = (pHeap->iDelayedFree + 1) % RT_ELEMENTS(pHeap->aDelayedFrees);
 
 #else   /* !MMHYPER_HEAP_FREE_POISON */
Index: trunk/src/VBox/VMM/VMMAll/PGMAllBth.h
===================================================================
--- trunk/src/VBox/VMM/VMMAll/PGMAllBth.h	(revision 11309)
+++ trunk/src/VBox/VMM/VMMAll/PGMAllBth.h	(revision 11311)
@@ -1607,5 +1607,5 @@
                         const unsigned  offPTSrc  = 0;
 #  endif
-                        const unsigned  iPTDstEnd = RT_MIN(iPTDst + PGM_SYNC_NR_PAGES / 2, ELEMENTS(pPTDst->a));
+                        const unsigned  iPTDstEnd = RT_MIN(iPTDst + PGM_SYNC_NR_PAGES / 2, RT_ELEMENTS(pPTDst->a));
                         if (iPTDst < PGM_SYNC_NR_PAGES / 2)
                             iPTDst = 0;
@@ -1808,5 +1808,5 @@
          */
         unsigned        iPTDst    = (GCPtrPage >> SHW_PT_SHIFT) & SHW_PT_MASK;
-        const unsigned  iPTDstEnd = RT_MIN(iPTDst + PGM_SYNC_NR_PAGES / 2, ELEMENTS(pPTDst->a));
+        const unsigned  iPTDstEnd = RT_MIN(iPTDst + PGM_SYNC_NR_PAGES / 2, RT_ELEMENTS(pPTDst->a));
         if (iPTDst < PGM_SYNC_NR_PAGES / 2)
             iPTDst = 0;
@@ -2408,5 +2408,5 @@
                 unsigned        iPTBase   = (GCPtrPage >> SHW_PT_SHIFT) & SHW_PT_MASK;
                 unsigned        iPTDst    = iPTBase;
-                const unsigned  iPTDstEnd = RT_MIN(iPTDst + PGM_SYNC_NR_PAGES / 2, ELEMENTS(pPTDst->a));
+                const unsigned  iPTDstEnd = RT_MIN(iPTDst + PGM_SYNC_NR_PAGES / 2, RT_ELEMENTS(pPTDst->a));
                 if (iPTDst <= PGM_SYNC_NR_PAGES / 2)
                     iPTDst = 0;
@@ -2415,5 +2415,5 @@
 # else /* !PGM_SYNC_N_PAGES */
                 unsigned        iPTDst    = 0;
-                const unsigned  iPTDstEnd = ELEMENTS(pPTDst->a);
+                const unsigned  iPTDstEnd = RT_ELEMENTS(pPTDst->a);
 # endif /* !PGM_SYNC_N_PAGES */
 # if PGM_SHW_TYPE == PGM_TYPE_PAE && PGM_GST_TYPE == PGM_TYPE_32BIT
@@ -2508,5 +2508,5 @@
             PPGMRAMRANGE      pRam   = CTXALLSUFF(pVM->pgm.s.pRamRanges);
             unsigned          iPTDst = 0;
-            while (iPTDst < ELEMENTS(pPTDst->a))
+            while (iPTDst < RT_ELEMENTS(pPTDst->a))
             {
                 /* Advance ram range list. */
@@ -2573,5 +2573,5 @@
                         iHCPage++;
                         iPTDst++;
-                    } while (   iPTDst < ELEMENTS(pPTDst->a)
+                    } while (   iPTDst < RT_ELEMENTS(pPTDst->a)
                              && GCPhys <= pRam->GCPhysLast);
                 }
@@ -2584,5 +2584,5 @@
                         GCPhys += PAGE_SIZE;
                         iPTDst++;
-                    } while (   iPTDst < ELEMENTS(pPTDst->a)
+                    } while (   iPTDst < RT_ELEMENTS(pPTDst->a)
                              && GCPhys < pRam->GCPhys);
                 }
@@ -2590,5 +2590,5 @@
                 {
                     Log(("Invalid pages at %VGp (2)\n", GCPhys));
-                    for ( ; iPTDst < ELEMENTS(pPTDst->a); iPTDst++)
+                    for ( ; iPTDst < RT_ELEMENTS(pPTDst->a); iPTDst++)
                         pPTDst->a[iPTDst].u = 0; /* MMIO or invalid page, we must handle them manually. */
                 }
@@ -3021,5 +3021,5 @@
     PGM_GST_NAME(HandlerVirtualUpdate)(pVM, cr4);
     STAM_PROFILE_STOP(&pVM->pgm.s.CTXMID(Stat,SyncCR3Handlers), h);
-#endif 
+#endif
 
 #ifdef PGMPOOL_WITH_MONITORING
@@ -3141,5 +3141,5 @@
                     LogFlow(("SyncCR3: guest PDPE %d not present; clear shw pdpe\n", iPdpte));
  	                /* for each page directory entry */
- 	                for (unsigned iPD = 0; iPD < ELEMENTS(pPDSrc->a); iPD++)
+ 	                for (unsigned iPD = 0; iPD < RT_ELEMENTS(pPDSrc->a); iPD++)
  	                {
  	                    if (   pPDEDst[iPD].n.u1Present
@@ -3183,5 +3183,5 @@
 
             /* Fetch the pgm pool shadow descriptor if the shadow pdpte is present. */
-            if (!pPdpeDst->n.u1Present) 
+            if (!pPdpeDst->n.u1Present)
                 continue;   /* next PDPTE */
 
@@ -3189,5 +3189,5 @@
             GCPhysPdeSrc = PdpeSrc.u & X86_PDPE_PG_MASK;
 
-            /* Anything significant changed? */            
+            /* Anything significant changed? */
             if (    PdpeSrc.n.u1Present != pPdpeDst->n.u1Present
                 ||  GCPhysPdeSrc != pShwPde->GCPhys)
@@ -3212,5 +3212,5 @@
         {
 #  endif /* PGM_GST_TYPE != PGM_TYPE_PAE && PGM_GST_TYPE != PGM_TYPE_AMD64 */
-            for (unsigned iPD = 0; iPD < ELEMENTS(pPDSrc->a); iPD++)
+            for (unsigned iPD = 0; iPD < RT_ELEMENTS(pPDSrc->a); iPD++)
             {
 #  if PGM_SHW_TYPE == PGM_TYPE_32BIT
@@ -3689,5 +3689,5 @@
             pPdpeDst = &pPdptDst->a[iPdpte];
 
-            if (!pPdpeDst->n.u1Present) 
+            if (!pPdpeDst->n.u1Present)
             {
                 GCPtr += 512 * _2M;
@@ -3891,5 +3891,5 @@
 # endif
                         for (unsigned iPT = 0, off = 0;
-                            iPT < ELEMENTS(pPTDst->a);
+                            iPT < RT_ELEMENTS(pPTDst->a);
                             iPT++, off += PAGE_SIZE)
                         {
@@ -4133,5 +4133,5 @@
                         /* iterate the page table. */
                         for (unsigned iPT = 0, off = 0;
-                            iPT < ELEMENTS(pPTDst->a);
+                            iPT < RT_ELEMENTS(pPTDst->a);
                             iPT++, off += PAGE_SIZE, GCPhysGst += PAGE_SIZE)
                         {
Index: trunk/src/VBox/VMM/VMMAll/PGMAllMap.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMAll/PGMAllMap.cpp	(revision 11309)
+++ trunk/src/VBox/VMM/VMMAll/PGMAllMap.cpp	(revision 11311)
@@ -189,5 +189,5 @@
                 unsigned iPT  = off >> X86_PD_SHIFT;
                 unsigned iPTE = (off >> PAGE_SHIFT) & X86_PT_MASK;
-                while (cb > 0 && iPTE < ELEMENTS(CTXALLSUFF(pCur->aPTs[iPT].pPT)->a))
+                while (cb > 0 && iPTE < RT_ELEMENTS(CTXALLSUFF(pCur->aPTs[iPT].pPT)->a))
                 {
                     /* 32-Bit */
Index: trunk/src/VBox/VMM/VMMAll/PGMAllPool.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMAll/PGMAllPool.cpp	(revision 11309)
+++ trunk/src/VBox/VMM/VMMAll/PGMAllPool.cpp	(revision 11311)
@@ -326,5 +326,5 @@
                 {
                     const unsigned iShw2 = (off + cbWrite - 1) / sizeof(X86PTEPAE);
-                    AssertReturnVoid(iShw2 < ELEMENTS(uShw.pPTPae->a));
+                    AssertReturnVoid(iShw2 < RT_ELEMENTS(uShw.pPTPae->a));
 
                     if (uShw.pPTPae->a[iShw2].n.u1Present)
@@ -360,5 +360,5 @@
                     const unsigned iShw2 = (off + cbWrite - 1) / sizeof(X86PTE);
                     if (    iShw2 != iShw
-                        &&  iShw2 < ELEMENTS(uShw.pPD->a)
+                        &&  iShw2 < RT_ELEMENTS(uShw.pPD->a)
                         &&  uShw.pPD->a[iShw2].u & PGM_PDFLAGS_MAPPING)
                     {
@@ -400,5 +400,5 @@
                     {
                         const unsigned iShw2 = iShw + 2;
-                        if (    iShw2 < ELEMENTS(uShw.pPDPae->a)
+                        if (    iShw2 < RT_ELEMENTS(uShw.pPDPae->a)
                             &&  (uShw.pPDPae->a[iShw2].u & (PGM_PDFLAGS_MAPPING | X86_PDE_P)) == (PGM_PDFLAGS_MAPPING | X86_PDE_P))
                         {
@@ -458,5 +458,5 @@
                 {
                     const unsigned iShw2 = (off + cbWrite - 1) / sizeof(X86PDEPAE);
-                    AssertReturnVoid(iShw2 < ELEMENTS(uShw.pPDPae->a));
+                    AssertReturnVoid(iShw2 < RT_ELEMENTS(uShw.pPDPae->a));
 
                     if (    iShw2 != iShw
@@ -491,5 +491,5 @@
                  */
                 const unsigned iShw = off / sizeof(X86PDPE);
-                if (iShw < X86_PG_PAE_PDPE_ENTRIES)          /* don't use ELEMENTS(uShw.pPDPT->a), because that's for long mode only */
+                if (iShw < X86_PG_PAE_PDPE_ENTRIES)          /* don't use RT_ELEMENTS(uShw.pPDPT->a), because that's for long mode only */
                 {
                     if (uShw.pPDPT->a[iShw].u & PGM_PLXFLAGS_MAPPING)
@@ -548,5 +548,5 @@
                 {
                     const unsigned iShw2 = (off + cbWrite - 1) / sizeof(X86PDEPAE);
-                    AssertReturnVoid(iShw2 < ELEMENTS(uShw.pPDPae->a));
+                    AssertReturnVoid(iShw2 < RT_ELEMENTS(uShw.pPDPae->a));
 
                     if (    iShw2 != iShw
@@ -2349,5 +2349,5 @@
             const uint32_t  u32 = PGM_PAGE_GET_HCPHYS(pPhysPage) | X86_PTE_P;
             PX86PT          pPT = (PX86PT)PGMPOOL_PAGE_2_PTR(pVM, pPage);
-            for (unsigned i = pPage->iFirstPresent; i < ELEMENTS(pPT->a); i++)
+            for (unsigned i = pPage->iFirstPresent; i < RT_ELEMENTS(pPT->a); i++)
                 if ((pPT->a[i].u & (X86_PTE_PG_MASK | X86_PTE_P)) == u32)
                 {
@@ -2360,5 +2360,5 @@
 #if defined(DEBUG) && !defined(IN_RING0) ///@todo RTLogPrintf is missing in R0.
             RTLogPrintf("cRefs=%d iFirstPresent=%d cPresent=%d\n", cRefs, pPage->iFirstPresent, pPage->cPresent);
-            for (unsigned i = 0; i < ELEMENTS(pPT->a); i++)
+            for (unsigned i = 0; i < RT_ELEMENTS(pPT->a); i++)
                 if ((pPT->a[i].u & (X86_PTE_PG_MASK | X86_PTE_P)) == u32)
                 {
@@ -2379,5 +2379,5 @@
             const uint64_t  u64 = PGM_PAGE_GET_HCPHYS(pPhysPage) | X86_PTE_P;
             PX86PTPAE       pPT = (PX86PTPAE)PGMPOOL_PAGE_2_PTR(pVM, pPage);
-            for (unsigned i = pPage->iFirstPresent; i < ELEMENTS(pPT->a); i++)
+            for (unsigned i = pPage->iFirstPresent; i < RT_ELEMENTS(pPT->a); i++)
                 if ((pPT->a[i].u & (X86_PTE_PAE_PG_MASK | X86_PTE_P)) == u64)
                 {
@@ -2390,5 +2390,5 @@
 #if defined(DEBUG) && !defined(IN_RING0) ///@todo RTLogPrintf is missing in R0.
             RTLogPrintf("cRefs=%d iFirstPresent=%d cPresent=%d\n", cRefs, pPage->iFirstPresent, pPage->cPresent);
-            for (unsigned i = 0; i < ELEMENTS(pPT->a); i++)
+            for (unsigned i = 0; i < RT_ELEMENTS(pPT->a); i++)
                 if ((pPT->a[i].u & (X86_PTE_PAE_PG_MASK | X86_PTE_P)) == u64)
                 {
@@ -2445,5 +2445,5 @@
         Assert(iPhysExt < pPool->cMaxPhysExts);
         pPhysExt = &pPool->CTXSUFF(paPhysExts)[iPhysExt];
-        for (unsigned i = 0; i < ELEMENTS(pPhysExt->aidx); i++)
+        for (unsigned i = 0; i < RT_ELEMENTS(pPhysExt->aidx); i++)
             if (pPhysExt->aidx[i] != NIL_PGMPOOL_IDX)
             {
@@ -2523,5 +2523,5 @@
                     unsigned    cPresent = pPage->cPresent;
                     PX86PT      pPT = (PX86PT)PGMPOOL_PAGE_2_PTR(pVM, pPage);
-                    for (unsigned i = pPage->iFirstPresent; i < ELEMENTS(pPT->a); i++)
+                    for (unsigned i = pPage->iFirstPresent; i < RT_ELEMENTS(pPT->a); i++)
                         if (pPT->a[i].n.u1Present)
                         {
@@ -2545,5 +2545,5 @@
                     unsigned  cPresent = pPage->cPresent;
                     PX86PTPAE pPT = (PX86PTPAE)PGMPOOL_PAGE_2_PTR(pVM, pPage);
-                    for (unsigned i = pPage->iFirstPresent; i < ELEMENTS(pPT->a); i++)
+                    for (unsigned i = pPage->iFirstPresent; i < RT_ELEMENTS(pPT->a); i++)
                         if (pPT->a[i].n.u1Present)
                         {
@@ -2730,5 +2730,5 @@
     Assert(iPhysExt < pPool->cMaxPhysExts);
     PPGMPOOLPHYSEXT pPhysExt = &pPool->CTXSUFF(paPhysExts)[iPhysExt];
-    for (unsigned i = 0; i < ELEMENTS(pPhysExt->aidx); i++)
+    for (unsigned i = 0; i < RT_ELEMENTS(pPhysExt->aidx); i++)
         pPhysExt->aidx[i] = NIL_PGMPOOL_IDX;
     pPhysExt->iNext = pPool->iPhysExtFreeHead;
@@ -2753,5 +2753,5 @@
         Assert(iPhysExt < pPool->cMaxPhysExts);
         pPhysExt = &pPool->CTXSUFF(paPhysExts)[iPhysExt];
-        for (unsigned i = 0; i < ELEMENTS(pPhysExt->aidx); i++)
+        for (unsigned i = 0; i < RT_ELEMENTS(pPhysExt->aidx); i++)
             pPhysExt->aidx[i] = NIL_PGMPOOL_IDX;
 
@@ -2794,5 +2794,5 @@
     {
         Assert(iPhysExt < pPool->cMaxPhysExts);
-        for (unsigned i = 0; i < ELEMENTS(paPhysExts[iPhysExt].aidx); i++)
+        for (unsigned i = 0; i < RT_ELEMENTS(paPhysExts[iPhysExt].aidx); i++)
             if (paPhysExts[iPhysExt].aidx[i] == NIL_PGMPOOL_IDX)
             {
@@ -2893,5 +2893,5 @@
              * Look for the shadow page and check if it's all freed.
              */
-            for (unsigned i = 0; i < ELEMENTS(paPhysExts[iPhysExt].aidx); i++)
+            for (unsigned i = 0; i < RT_ELEMENTS(paPhysExts[iPhysExt].aidx); i++)
             {
                 if (paPhysExts[iPhysExt].aidx[i] == pPage->idx)
@@ -2899,5 +2899,5 @@
                     paPhysExts[iPhysExt].aidx[i] = NIL_PGMPOOL_IDX;
 
-                    for (i = 0; i < ELEMENTS(paPhysExts[iPhysExt].aidx); i++)
+                    for (i = 0; i < RT_ELEMENTS(paPhysExts[iPhysExt].aidx); i++)
                         if (paPhysExts[iPhysExt].aidx[i] != NIL_PGMPOOL_IDX)
                         {
@@ -3059,5 +3059,5 @@
 DECLINLINE(void) pgmPoolTrackDerefPT32Bit32Bit(PPGMPOOL pPool, PPGMPOOLPAGE pPage, PX86PT pShwPT, PCX86PT pGstPT)
 {
-    for (unsigned i = pPage->iFirstPresent; i < ELEMENTS(pShwPT->a); i++)
+    for (unsigned i = pPage->iFirstPresent; i < RT_ELEMENTS(pShwPT->a); i++)
         if (pShwPT->a[i].n.u1Present)
         {
@@ -3081,5 +3081,5 @@
 DECLINLINE(void) pgmPoolTrackDerefPTPae32Bit(PPGMPOOL pPool, PPGMPOOLPAGE pPage, PX86PTPAE pShwPT, PCX86PT pGstPT)
 {
-    for (unsigned i = 0; i < ELEMENTS(pShwPT->a); i++)
+    for (unsigned i = 0; i < RT_ELEMENTS(pShwPT->a); i++)
         if (pShwPT->a[i].n.u1Present)
         {
@@ -3101,5 +3101,5 @@
 DECLINLINE(void) pgmPoolTrackDerefPTPaePae(PPGMPOOL pPool, PPGMPOOLPAGE pPage, PX86PTPAE pShwPT, PCX86PTPAE pGstPT)
 {
-    for (unsigned i = 0; i < ELEMENTS(pShwPT->a); i++)
+    for (unsigned i = 0; i < RT_ELEMENTS(pShwPT->a); i++)
         if (pShwPT->a[i].n.u1Present)
         {
@@ -3121,5 +3121,5 @@
 {
     RTGCPHYS GCPhys = pPage->GCPhys;
-    for (unsigned i = 0; i < ELEMENTS(pShwPT->a); i++, GCPhys += PAGE_SIZE)
+    for (unsigned i = 0; i < RT_ELEMENTS(pShwPT->a); i++, GCPhys += PAGE_SIZE)
         if (pShwPT->a[i].n.u1Present)
         {
@@ -3141,5 +3141,5 @@
 {
     RTGCPHYS GCPhys = pPage->GCPhys;
-    for (unsigned i = 0; i < ELEMENTS(pShwPT->a); i++, GCPhys += PAGE_SIZE)
+    for (unsigned i = 0; i < RT_ELEMENTS(pShwPT->a); i++, GCPhys += PAGE_SIZE)
         if (pShwPT->a[i].n.u1Present)
         {
@@ -3161,5 +3161,5 @@
 DECLINLINE(void) pgmPoolTrackDerefPDPae(PPGMPOOL pPool, PPGMPOOLPAGE pPage, PX86PDPAE pShwPD)
 {
-    for (unsigned i = 0; i < ELEMENTS(pShwPD->a); i++)
+    for (unsigned i = 0; i < RT_ELEMENTS(pShwPD->a); i++)
     {
         if (pShwPD->a[i].n.u1Present)
@@ -3185,5 +3185,5 @@
 DECLINLINE(void) pgmPoolTrackDerefPDPT64Bit(PPGMPOOL pPool, PPGMPOOLPAGE pPage, PX86PDPT pShwPDPT)
 {
-    for (unsigned i = 0; i < ELEMENTS(pShwPDPT->a); i++)
+    for (unsigned i = 0; i < RT_ELEMENTS(pShwPDPT->a); i++)
     {
         if (pShwPDPT->a[i].n.u1Present)
@@ -3208,5 +3208,5 @@
 DECLINLINE(void) pgmPoolTrackDerefPML464Bit(PPGMPOOL pPool, PPGMPOOLPAGE pPage, PX86PML4 pShwPML4)
 {
-    for (unsigned i = 0; i < ELEMENTS(pShwPML4->a); i++)
+    for (unsigned i = 0; i < RT_ELEMENTS(pShwPML4->a); i++)
     {
         if (pShwPML4->a[i].n.u1Present)
@@ -3506,5 +3506,5 @@
      * Clear the GCPhys hash and the age list.
      */
-    for (unsigned i = 0; i < ELEMENTS(pPool->aiHash); i++)
+    for (unsigned i = 0; i < RT_ELEMENTS(pPool->aiHash); i++)
         pPool->aiHash[i] = NIL_PGMPOOL_IDX;
     pPool->iAgeHead = NIL_PGMPOOL_IDX;
Index: trunk/src/VBox/VMM/VMMAll/PGMAllShw.h
===================================================================
--- trunk/src/VBox/VMM/VMMAll/PGMAllShw.h	(revision 11309)
+++ trunk/src/VBox/VMM/VMMAll/PGMAllShw.h	(revision 11311)
@@ -303,5 +303,5 @@
 
         unsigned iPTE = (GCPtr >> SHW_PT_SHIFT) & SHW_PT_MASK;
-        while (iPTE < ELEMENTS(pPT->a))
+        while (iPTE < RT_ELEMENTS(pPT->a))
         {
             if (pPT->a[iPTE].n.u1Present)
Index: trunk/src/VBox/VMM/VMMAll/REMAll.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMAll/REMAll.cpp	(revision 11309)
+++ trunk/src/VBox/VMM/VMMAll/REMAll.cpp	(revision 11311)
@@ -46,5 +46,5 @@
 REMDECL(int) REMNotifyInvalidatePage(PVM pVM, RTGCPTR GCPtrPage)
 {
-    if (pVM->rem.s.cInvalidatedPages < ELEMENTS(pVM->rem.s.aGCPtrInvalidatedPages))
+    if (pVM->rem.s.cInvalidatedPages < RT_ELEMENTS(pVM->rem.s.aGCPtrInvalidatedPages))
     {
         /*
@@ -94,5 +94,5 @@
 REMDECL(void) REMNotifyHandlerPhysicalRegister(PVM pVM, PGMPHYSHANDLERTYPE enmType, RTGCPHYS GCPhys, RTGCPHYS cb, bool fHasHCHandler)
 {
-    if (pVM->rem.s.cHandlerNotifications >= ELEMENTS(pVM->rem.s.aHandlerNotifications))
+    if (pVM->rem.s.cHandlerNotifications >= RT_ELEMENTS(pVM->rem.s.aHandlerNotifications))
         remFlushHandlerNotifications(pVM);
     PREMHANDLERNOTIFICATION pRec = &pVM->rem.s.aHandlerNotifications[pVM->rem.s.cHandlerNotifications++];
@@ -118,5 +118,5 @@
 REMDECL(void) REMNotifyHandlerPhysicalDeregister(PVM pVM, PGMPHYSHANDLERTYPE enmType, RTGCPHYS GCPhys, RTGCPHYS cb, bool fHasHCHandler, bool fRestoreAsRAM)
 {
-    if (pVM->rem.s.cHandlerNotifications >= ELEMENTS(pVM->rem.s.aHandlerNotifications))
+    if (pVM->rem.s.cHandlerNotifications >= RT_ELEMENTS(pVM->rem.s.aHandlerNotifications))
         remFlushHandlerNotifications(pVM);
     PREMHANDLERNOTIFICATION pRec = &pVM->rem.s.aHandlerNotifications[pVM->rem.s.cHandlerNotifications++];
@@ -144,5 +144,5 @@
 REMDECL(void) REMNotifyHandlerPhysicalModify(PVM pVM, PGMPHYSHANDLERTYPE enmType, RTGCPHYS GCPhysOld, RTGCPHYS GCPhysNew, RTGCPHYS cb, bool fHasHCHandler, bool fRestoreAsRAM)
 {
-    if (pVM->rem.s.cHandlerNotifications >= ELEMENTS(pVM->rem.s.aHandlerNotifications))
+    if (pVM->rem.s.cHandlerNotifications >= RT_ELEMENTS(pVM->rem.s.aHandlerNotifications))
         remFlushHandlerNotifications(pVM);
     PREMHANDLERNOTIFICATION pRec = &pVM->rem.s.aHandlerNotifications[pVM->rem.s.cHandlerNotifications++];
Index: trunk/src/VBox/VMM/VMMAll/TRPMAll.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMAll/TRPMAll.cpp	(revision 11309)
+++ trunk/src/VBox/VMM/VMMAll/TRPMAll.cpp	(revision 11311)
@@ -835,5 +835,5 @@
      * Validate.
      */
-    if (iTrap >= ELEMENTS(pVM->trpm.s.aIdt))
+    if (iTrap >= RT_ELEMENTS(pVM->trpm.s.aIdt))
     {
         AssertMsg(iTrap < TRPM_HANDLER_INT_BASE, ("Illegal gate number %d!\n", iTrap));
Index: trunk/src/VBox/VMM/VMMGC/PGMGC.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMGC/PGMGC.cpp	(revision 11309)
+++ trunk/src/VBox/VMM/VMMGC/PGMGC.cpp	(revision 11311)
@@ -266,5 +266,5 @@
         ||  pVM->pgm.s.aHCPhysDynPageMapCache[iCache = 3] == HCPhys)
     {
-        static const uint8_t au8Trans[MM_HYPER_DYNAMIC_SIZE >> PAGE_SHIFT][ELEMENTS(pVM->pgm.s.aHCPhysDynPageMapCache)] =
+        static const uint8_t au8Trans[MM_HYPER_DYNAMIC_SIZE >> PAGE_SHIFT][RT_ELEMENTS(pVM->pgm.s.aHCPhysDynPageMapCache)] =
         {
             { 0, 5, 6, 7 },
@@ -277,6 +277,6 @@
             { 4, 5, 6, 7 },
         };
-        Assert(ELEMENTS(au8Trans) == 8);
-        Assert(ELEMENTS(au8Trans[0]) == 4);
+        Assert(RT_ELEMENTS(au8Trans) == 8);
+        Assert(RT_ELEMENTS(au8Trans[0]) == 4);
         int iPage = au8Trans[pVM->pgm.s.iDynPageMapLast][iCache];
         void *pv = pVM->pgm.s.pbDynPageMapBaseGC + (iPage << PAGE_SHIFT);
@@ -286,5 +286,5 @@
         return VINF_SUCCESS;
     }
-    Assert(ELEMENTS(pVM->pgm.s.aHCPhysDynPageMapCache) == 4);
+    Assert(RT_ELEMENTS(pVM->pgm.s.aHCPhysDynPageMapCache) == 4);
     STAM_COUNTER_INC(&pVM->pgm.s.StatDynMapCacheMisses);
 
@@ -296,5 +296,5 @@
     Assert((MM_HYPER_DYNAMIC_SIZE >> PAGE_SHIFT) == 8);
 
-    pVM->pgm.s.aHCPhysDynPageMapCache[iPage & (ELEMENTS(pVM->pgm.s.aHCPhysDynPageMapCache) - 1)] = HCPhys;
+    pVM->pgm.s.aHCPhysDynPageMapCache[iPage & (RT_ELEMENTS(pVM->pgm.s.aHCPhysDynPageMapCache) - 1)] = HCPhys;
     pVM->pgm.s.paDynPageMap32BitPTEsGC[iPage].u = (uint32_t)HCPhys | X86_PTE_P | X86_PTE_A | X86_PTE_D;
     pVM->pgm.s.paDynPageMapPaePTEsGC[iPage].u   =           HCPhys | X86_PTE_P | X86_PTE_A | X86_PTE_D;
Index: trunk/src/VBox/VMM/VMMGC/TRPMGC.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMGC/TRPMGC.cpp	(revision 11309)
+++ trunk/src/VBox/VMM/VMMGC/TRPMGC.cpp	(revision 11311)
@@ -60,5 +60,5 @@
      * Validate input.
      */
-    if (iTrap >= ELEMENTS(pVM->trpm.s.aTmpTrapHandlers))
+    if (iTrap >= RT_ELEMENTS(pVM->trpm.s.aTmpTrapHandlers))
     {
         AssertMsgFailed(("Trap handler iTrap=%u is out of range!\n", iTrap));
@@ -120,5 +120,5 @@
     /** @note this causes problems in Windows XP as instructions following the update can be dangerous (str eax has been seen) */
     /** @note not going back to ring 3 could make the code scanner miss them. */
-    /* Check if we can handle the write here. */    
+    /* Check if we can handle the write here. */
     if (     iGate != 3                                         /* Gate 3 is handled differently; could do it here as well, but let ring 3 handle this case for now. */
         &&  !ASMBitTest(&pVM->trpm.s.au32IdtPatched[0], iGate)) /* Passthru gates need special attention too. */
Index: trunk/src/VBox/VMM/VMMR0/DBGFR0.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMR0/DBGFR0.cpp	(revision 11309)
+++ trunk/src/VBox/VMM/VMMR0/DBGFR0.cpp	(revision 11311)
@@ -54,5 +54,5 @@
     {
         Assert(X86_DR6_B0 == 1 && X86_DR6_B1 == 2 && X86_DR6_B2 == 4 && X86_DR6_B3 == 8);
-        for (unsigned iBp = 0; iBp < ELEMENTS(pVM->dbgf.s.aHwBreakpoints); iBp++)
+        for (unsigned iBp = 0; iBp < RT_ELEMENTS(pVM->dbgf.s.aHwBreakpoints); iBp++)
         {
             if (    (uDr6 & RT_BIT(iBp))
@@ -113,9 +113,9 @@
         RTGCPTR pPc;
         int rc = SELMValidateAndConvertCSAddr(pVM, pRegFrame->eflags, pRegFrame->ss, pRegFrame->cs, &pRegFrame->csHid,
-                                              (RTGCPTR)((RTGCUINTPTR)pRegFrame->eip - 1),                                              
+                                              (RTGCPTR)((RTGCUINTPTR)pRegFrame->eip - 1),
                                               &pPc);
         AssertRCReturn(rc, rc);
 
-        for (unsigned iBp = 0; iBp < ELEMENTS(pVM->dbgf.s.aBreakpoints); iBp++)
+        for (unsigned iBp = 0; iBp < RT_ELEMENTS(pVM->dbgf.s.aBreakpoints); iBp++)
         {
             if (    pVM->dbgf.s.aBreakpoints[iBp].GCPtr == (RTGCUINTPTR)pPc
Index: trunk/src/VBox/VMM/VMMR0/HWACCMR0.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMR0/HWACCMR0.cpp	(revision 11309)
+++ trunk/src/VBox/VMM/VMMR0/HWACCMR0.cpp	(revision 11311)
@@ -990,5 +990,5 @@
     char *psz = szEFlags;
     uint32_t efl = pCtx->eflags.u32;
-    for (unsigned i = 0; i < ELEMENTS(aFlags); i++)
+    for (unsigned i = 0; i < RT_ELEMENTS(aFlags); i++)
     {
         const char *pszAdd = aFlags[i].fFlag & efl ? aFlags[i].pszSet : aFlags[i].pszClear;
Index: trunk/src/VBox/VMM/testcase/tstAnimate.cpp
===================================================================
--- trunk/src/VBox/VMM/testcase/tstAnimate.cpp	(revision 11309)
+++ trunk/src/VBox/VMM/testcase/tstAnimate.cpp	(revision 11311)
@@ -176,5 +176,5 @@
 
         rc = -1;
-        for (unsigned i = 0; i < ELEMENTS(aVars); i++)
+        for (unsigned i = 0; i < RT_ELEMENTS(aVars); i++)
         {
             if (!strcmp(psz, aVars[i].pszVar))
Index: trunk/src/VBox/VMM/testcase/tstMMHyperHeap.cpp
===================================================================
--- trunk/src/VBox/VMM/testcase/tstMMHyperHeap.cpp	(revision 11309)
+++ trunk/src/VBox/VMM/testcase/tstMMHyperHeap.cpp	(revision 11311)
@@ -133,5 +133,5 @@
 
     /* allocate */
-    for (i = 0; i < ELEMENTS(aOps); i++)
+    for (i = 0; i < RT_ELEMENTS(aOps); i++)
     {
         rc = MMHyperAlloc(pVM, aOps[i].cb, aOps[i].uAlignment, MM_TAG_VM, &aOps[i].pvAlloc);
@@ -150,5 +150,5 @@
 
     /* free and allocate the same node again. */
-    for (i = 0; i < ELEMENTS(aOps); i++)
+    for (i = 0; i < RT_ELEMENTS(aOps); i++)
     {
         if (    !aOps[i].pvAlloc
@@ -188,8 +188,8 @@
     /* free it in a specific order. */
     int cFreed = 0;
-    for (i = 0; i < ELEMENTS(aOps); i++)
+    for (i = 0; i < RT_ELEMENTS(aOps); i++)
     {
         unsigned j;
-        for (j = 0; j < ELEMENTS(aOps); j++)
+        for (j = 0; j < RT_ELEMENTS(aOps); j++)
         {
             if (    aOps[j].iFreeOrder != i
@@ -212,5 +212,5 @@
         }
     }
-    Assert(cFreed == ELEMENTS(aOps));
+    Assert(cFreed == RT_ELEMENTS(aOps));
     RTPrintf("i=done free=%d\n", MMHyperHeapGetFreeSize(pVM));
 
Index: trunk/src/VBox/VMM/testcase/tstVMREQ.cpp
===================================================================
--- trunk/src/VBox/VMM/testcase/tstVMREQ.cpp	(revision 11309)
+++ trunk/src/VBox/VMM/testcase/tstVMREQ.cpp	(revision 11311)
@@ -49,5 +49,5 @@
 
 
-/** 
+/**
  * Testings va_list passing in VMSetRuntimeError.
  */
@@ -119,6 +119,6 @@
 
 
-/** 
- * Functions that tests passing a va_list * argument in a request, 
+/**
+ * Functions that tests passing a va_list * argument in a request,
  * similar to VMSetRuntimeError.
  */
@@ -129,7 +129,7 @@
 #else
     va_list va2;
-    va_copy(va2, va); 
+    va_copy(va2, va);
     void *pvVA = va2;
-#endif 
+#endif
 
     PVMREQ pReq;
@@ -142,10 +142,10 @@
 #if 1
     va_end(va2);
-#endif 
-}
-
-
-/** 
- * Functions that tests passing a va_list * argument in a request, 
+#endif
+}
+
+
+/**
+ * Functions that tests passing a va_list * argument in a request,
  * similar to VMSetRuntimeError.
  */
@@ -181,5 +181,5 @@
     {
         PVMREQ          apReq[17];
-        const unsigned  cReqs = i % ELEMENTS(apReq);
+        const unsigned  cReqs = i % RT_ELEMENTS(apReq);
         unsigned        iReq;
         for (iReq = 0; iReq < cReqs; iReq++)
