VirtualBox

Changeset 75186 in vbox for trunk/src/VBox/HostDrivers


Ignore:
Timestamp:
Oct 30, 2018 4:43:05 PM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
126269
Message:

SUPDrv/darwin: Fixed import search order to match ring-3 and allow VMMR0 to overload stuff. bugref:9232

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/Support/darwin/SUPDrv-darwin.cpp

    r75180 r75186  
    12341234
    12351235    /*
    1236      * Consult the SUPDrv export table first.
     1236     * First consult the VMMR0 module if there is one fully loaded.
     1237     * This is necessary as VMMR0 may overload assertion and logger symbols.
     1238     */
     1239    if (pDevExt->pvVMMR0)
     1240        for (PSUPDRVLDRIMAGE pImage = pDevExt->pLdrImages; pImage; pImage = pImage->pNext)
     1241            if (pImage->pvImage == pDevExt->pvVMMR0)
     1242            {
     1243                if (   pImage->uState == SUP_IOCTL_LDR_LOAD
     1244                    && pImage->hLdrMod != NIL_RTLDRMOD)
     1245                {
     1246                    int rc = RTLdrGetSymbolEx(pImage->hLdrMod, pImage->pvImage, (uintptr_t)pImage->pvImage,
     1247                                              UINT32_MAX, pszSymbol, pValue);
     1248                    if (RT_SUCCESS(rc))
     1249                        return VINF_SUCCESS;
     1250                }
     1251                break;
     1252            }
     1253
     1254    /*
     1255     * Then we consult the SUPDrv export table.
    12371256     */
    12381257    uintptr_t uValue = 0;
     
    12431262        return VINF_SUCCESS;
    12441263    }
    1245 
    1246     /*
    1247      * Check already loaded modules.
    1248      */
    1249     for (PSUPDRVLDRIMAGE pImage = pDevExt->pLdrImages; pImage; pImage = pImage->pNext)
    1250         if (   pImage->uState == SUP_IOCTL_LDR_LOAD
    1251             && pImage->hLdrMod != NIL_RTLDRMOD)
    1252         {
    1253             rc = RTLdrGetSymbolEx(pImage->hLdrMod, pImage->pvImage, (uintptr_t)pImage->pvImage, UINT32_MAX, pszSymbol, pValue);
    1254             if (RT_SUCCESS(rc))
    1255                 return VINF_SUCCESS;
    1256         }
    12571264
    12581265    /*
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette