VirtualBox

Changeset 34241 in vbox


Ignore:
Timestamp:
Nov 22, 2010 2:26:53 PM (14 years ago)
Author:
vboxsync
Message:

PDM: Added search paths to the device and driver DLL CFGM nodes so that VBoxEhciR0.r0/RC.rc can be found.

Location:
trunk
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/pdmapi.h

    r32935 r34241  
    9797VMMR3DECL(int)  PDMR3LdrGetSymbolR3(PVM pVM, const char *pszModule, const char *pszSymbol, void **ppvValue);
    9898VMMR3DECL(int)  PDMR3LdrGetSymbolR0(PVM pVM, const char *pszModule, const char *pszSymbol, PRTR0PTR ppvValue);
    99 VMMR3DECL(int)  PDMR3LdrGetSymbolR0Lazy(PVM pVM, const char *pszModule, const char *pszSymbol, PRTR0PTR ppvValue);
     99VMMR3DECL(int)  PDMR3LdrGetSymbolR0Lazy(PVM pVM, const char *pszModule, const char *pszSearchPath, const char *pszSymbol, PRTR0PTR ppvValue);
    100100VMMR3DECL(int)  PDMR3LdrLoadRC(PVM pVM, const char *pszFilename, const char *pszName);
    101101VMMR3DECL(int)  PDMR3LdrGetSymbolRC(PVM pVM, const char *pszModule, const char *pszSymbol, PRTRCPTR pRCPtrValue);
    102 VMMR3DECL(int)  PDMR3LdrGetSymbolRCLazy(PVM pVM, const char *pszModule, const char *pszSymbol, PRTRCPTR pRCPtrValue);
     102VMMR3DECL(int)  PDMR3LdrGetSymbolRCLazy(PVM pVM, const char *pszModule, const char *pszSearchPath, const char *pszSymbol, PRTRCPTR pRCPtrValue);
    103103VMMR3DECL(int)  PDMR3LdrQueryRCModFromPC(PVM pVM, RTRCPTR uPC,
    104104                                         char *pszModName,  size_t cchModName,  PRTRCPTR pMod,
     
    109109                                         char *pszNearSym1, size_t cchNearSym1, PRTR0PTR pNearSym1,
    110110                                         char *pszNearSym2, size_t cchNearSym2, PRTR0PTR pNearSym2);
    111 VMMR3DECL(int)  PDMR3LdrGetInterfaceSymbols(PVM pVM, void *pvInterface, size_t cbInterface,
    112                                             const char *pszModule, const char *pszSymPrefix,
    113                                             const char *pszSymList, bool fRing0OrRC);
     111VMMR3DECL(int)  PDMR3LdrGetInterfaceSymbols(PVM pVM,
     112                                            void *pvInterface, size_t cbInterface,
     113                                            const char *pszModule, const char *pszSearchPath,
     114                                            const char *pszSymPrefix, const char *pszSymList,
     115                                            bool fRing0OrRC);
    114116
    115117VMMR3DECL(int)  PDMR3QueryDevice(PVM pVM, const char *pszDevice, unsigned iInstance, PPPDMIBASE ppBase);
  • trunk/include/VBox/sup.h

    r33806 r34241  
    893893 * @param   pszFilename     The path to the image file.
    894894 * @param   pszModule       The module name. Max 32 bytes.
    895  * @param   ppvImageBase        Where to store the image address.
    896  */
    897 SUPR3DECL(int) SUPR3LoadModule(const char *pszFilename, const char *pszModule, void **ppvImageBase);
     895 * @param   ppvImageBase    Where to store the image address.
     896 * @param   pszErr          Where to return error message on failure.
     897 * @param   cbErr           The size of the error buffer.
     898 */
     899SUPR3DECL(int) SUPR3LoadModule(const char *pszFilename, const char *pszModule,
     900                               void **ppvImageBase, char *pszErr, size_t cbErr);
    898901
    899902/**
     
    10511054SUPR3DECL(int) SUPR3HardenedLdrLoadAppPriv(const char *pszFilename, PRTLDRMOD phLdrMod);
    10521055
     1056/**
     1057 * Same as RTLdrLoad() but will verify the files it loads (hardened builds).
     1058 *
     1059 * This differs from SUPR3HardenedLdrLoad() in that it can load modules from
     1060 * extension packs and anything else safely installed on the system, provided
     1061 * they pass the hardening tests.
     1062 *
     1063 * @returns iprt status code.
     1064 * @param   pszFilename     The full path to the module, with extension.
     1065 * @param   phLdrMod        Where to store the handle to the loaded module.
     1066 * @param   pszErr          Where to return error message on failure.
     1067 * @param   cbErr           The size of the error buffer.
     1068 */
     1069SUPR3DECL(int) SUPR3HardenedLdrLoadPlugIn(const char *pszFilename, PRTLDRMOD phLdrMod, char *pszErr, size_t cbErr);
    10531070
    10541071/**
     
    10581075 */
    10591076SUPR3DECL(int) SUPR3QueryVTxSupported(void);
    1060 
    10611077
    10621078/**
  • trunk/src/VBox/HostDrivers/Support/SUPLib.cpp

    r33878 r34241  
    15561556
    15571557
    1558 SUPR3DECL(int) SUPR3LoadModule(const char *pszFilename, const char *pszModule, void **ppvImageBase)
    1559 {
    1560     int rc = VINF_SUCCESS;
    1561 #ifdef VBOX_WITH_HARDENING
     1558SUPR3DECL(int) SUPR3LoadModule(const char *pszFilename, const char *pszModule, void **ppvImageBase, char *pszErr, size_t cbErr)
     1559{
    15621560    /*
    15631561     * Check that the module can be trusted.
    15641562     */
    1565     rc = supR3HardenedVerifyFixedFile(pszFilename, false /* fFatal */);
    1566 #endif
     1563    int rc = SUPR3HardenedVerifyPlugIn(pszFilename, pszErr, cbErr);
    15671564    if (RT_SUCCESS(rc))
     1565    {
    15681566        rc = supLoadModule(pszFilename, pszModule, NULL, ppvImageBase);
    1569     else
    1570         LogRel(("SUPR3LoadModule: Verification of \"%s\" failed, rc=%Rrc\n", rc));
     1567        if (RT_FAILURE(rc))
     1568            RTStrPrintf(pszErr, cbErr, "supLoadModule returned %Rrc", rc);
     1569    }
    15711570    return rc;
    15721571}
     
    20562055{
    20572056    void *pvImageBase;
    2058     return SUPR3LoadModule(pszFilename, "VMMR0.r0", &pvImageBase);
     2057    return SUPR3LoadModule(pszFilename, "VMMR0.r0", &pvImageBase, NULL, 0);
    20592058}
    20602059
     
    21892188
    21902189    LogFlow(("SUPR3HardenedLdrLoadAppPriv: returns %Rrc\n", rc));
     2190    return rc;
     2191}
     2192
     2193
     2194SUPR3DECL(int) SUPR3HardenedLdrLoadPlugIn(const char *pszFilename, PRTLDRMOD phLdrMod, char *pszErr, size_t cbErr)
     2195{
     2196    int rc;
     2197
     2198    /*
     2199     * Validate input.
     2200     */
     2201    AssertPtr(pszErr);
     2202    Assert(cbErr > 32);
     2203    AssertPtrReturn(phLdrMod, VERR_INVALID_PARAMETER);
     2204    *phLdrMod = NIL_RTLDRMOD;
     2205    AssertPtrReturn(pszFilename, VERR_INVALID_PARAMETER);
     2206    AssertReturn(RTPathStartsWithRoot(pszFilename), VERR_INVALID_PARAMETER);
     2207
     2208#ifdef VBOX_WITH_HARDENING
     2209    /*
     2210     * Verify the image file.
     2211     */
     2212    rc = supR3HardenedVerifyFile(pszFilename, RTHCUINTPTR_MAX, pszErr, cbErr);
     2213    if (RT_FAILURE(rc))
     2214    {
     2215        if (!pszErr || !cbErr)
     2216            LogRel(("supR3HardenedVerifyFile: Verification of \"%s\" failed, rc=%Rrc\n", pszFilename, rc));
     2217        return rc;
     2218    }
     2219#endif
     2220
     2221    /*
     2222     * Try load it.
     2223     */
     2224    rc = RTLdrLoad(pszFilename, phLdrMod);
     2225    if (RT_FAILURE(rc))
     2226        RTStrPrintf(pszErr, cbErr, "RTLdrLoad returned %Rrc", rc);
    21912227    return rc;
    21922228}
  • trunk/src/VBox/HostDrivers/Support/testcase/tstSupLoadModule.cpp

    r28800 r34241  
    7070            case VINF_GETOPT_NOT_OPTION:
    7171            {
     72                char szErr[4096+1024];
    7273                void *pvImageBase;
    73                 rc = SUPR3LoadModule(ValueUnion.psz, RTPathFilename(ValueUnion.psz), &pvImageBase);
     74                rc = SUPR3LoadModule(ValueUnion.psz, RTPathFilename(ValueUnion.psz), &pvImageBase, szErr, sizeof(szErr));
    7475                if (RT_FAILURE(rc))
    7576                {
    76                     RTMsgError("%Rrc when attempting to load '%s'\n", rc, ValueUnion.psz);
     77                    RTMsgError("%Rrc when attempting to load '%s': %s\n", rc, ValueUnion.psz, szErr);
    7778                    return 1;
    7879                }
  • trunk/src/VBox/VMM/IOM.cpp

    r33540 r34241  
    14171417    if (pVM->iom.s.pfnMMIOHandlerR0 == NIL_RTR0PTR)
    14181418    {
    1419         rc = PDMR3LdrGetSymbolRCLazy(pVM, NULL, "IOMMMIOHandler", &pVM->iom.s.pfnMMIOHandlerRC);
     1419        rc = PDMR3LdrGetSymbolRC(pVM, NULL, "IOMMMIOHandler", &pVM->iom.s.pfnMMIOHandlerRC);
    14201420        AssertLogRelRCReturn(rc, rc);
    1421         rc = PDMR3LdrGetSymbolR0Lazy(pVM, NULL, "IOMMMIOHandler", &pVM->iom.s.pfnMMIOHandlerR0);
     1421        rc = PDMR3LdrGetSymbolR0(pVM, NULL, "IOMMMIOHandler", &pVM->iom.s.pfnMMIOHandlerR0);
    14221422        AssertLogRelRCReturn(rc, rc);
    14231423    }
  • trunk/src/VBox/VMM/PDMDevHlp.cpp

    r34163 r34241  
    5454
    5555
    56 /*******************************************************************************
    57 *   Defined Constants And Macros                                               *
    58 *******************************************************************************/
     56
     57/**
     58 * Wrapper around PDMR3LdrGetSymbolRCLazy.
     59 */
     60DECLINLINE(int) pdmR3DevGetSymbolRCLazy(PPDMDEVINS pDevIns, const char *pszSymbol, PRTRCPTR ppvValue)
     61{
     62    return PDMR3LdrGetSymbolRCLazy(pDevIns->Internal.s.pVMR3,
     63                                   pDevIns->Internal.s.pDevR3->pReg->szRCMod,
     64                                   pDevIns->Internal.s.pDevR3->pszRCSearchPath,
     65                                   pszSymbol, ppvValue);
     66}
     67
     68
     69/**
     70 * Wrapper around PDMR3LdrGetSymbolR0Lazy.
     71 */
     72DECLINLINE(int) pdmR3DevGetSymbolR0Lazy(PPDMDEVINS pDevIns, const char *pszSymbol, PRTR0PTR ppvValue)
     73{
     74    return PDMR3LdrGetSymbolR0Lazy(pDevIns->Internal.s.pVMR3,
     75                                   pDevIns->Internal.s.pDevR3->pReg->szR0Mod,
     76                                   pDevIns->Internal.s.pDevR3->pszR0SearchPath,
     77                                   pszSymbol, ppvValue);
     78}
     79
     80
    5981/** @name R3 DevHlp
    6082 * @{
     
    107129        if (pszIn)
    108130        {
    109             rc = PDMR3LdrGetSymbolRCLazy(pDevIns->Internal.s.pVMR3, pDevIns->pReg->szRCMod, pszIn, &RCPtrIn);
     131            rc = pdmR3DevGetSymbolRCLazy(pDevIns, pszIn, &RCPtrIn);
    110132            AssertMsgRC(rc, ("Failed to resolve %s.%s (pszIn)\n", pDevIns->pReg->szRCMod, pszIn));
    111133        }
     
    113135        if (pszOut && RT_SUCCESS(rc))
    114136        {
    115             rc = PDMR3LdrGetSymbolRCLazy(pDevIns->Internal.s.pVMR3, pDevIns->pReg->szRCMod, pszOut, &RCPtrOut);
     137            rc = pdmR3DevGetSymbolRCLazy(pDevIns, pszOut, &RCPtrOut);
    116138            AssertMsgRC(rc, ("Failed to resolve %s.%s (pszOut)\n", pDevIns->pReg->szRCMod, pszOut));
    117139        }
     
    119141        if (pszInStr && RT_SUCCESS(rc))
    120142        {
    121             rc = PDMR3LdrGetSymbolRCLazy(pDevIns->Internal.s.pVMR3, pDevIns->pReg->szRCMod, pszInStr, &RCPtrInStr);
     143            rc = pdmR3DevGetSymbolRCLazy(pDevIns, pszInStr, &RCPtrInStr);
    122144            AssertMsgRC(rc, ("Failed to resolve %s.%s (pszInStr)\n", pDevIns->pReg->szRCMod, pszInStr));
    123145        }
     
    125147        if (pszOutStr && RT_SUCCESS(rc))
    126148        {
    127             rc = PDMR3LdrGetSymbolRCLazy(pDevIns->Internal.s.pVMR3, pDevIns->pReg->szRCMod, pszOutStr, &RCPtrOutStr);
     149            rc = pdmR3DevGetSymbolRCLazy(pDevIns, pszOutStr, &RCPtrOutStr);
    128150            AssertMsgRC(rc, ("Failed to resolve %s.%s (pszOutStr)\n", pDevIns->pReg->szRCMod, pszOutStr));
    129151        }
     
    174196        if (pszIn)
    175197        {
    176             rc = PDMR3LdrGetSymbolR0Lazy(pDevIns->Internal.s.pVMR3, pDevIns->pReg->szR0Mod, pszIn, &pfnR0PtrIn);
     198            rc = pdmR3DevGetSymbolR0Lazy(pDevIns, pszIn, &pfnR0PtrIn);
    177199            AssertMsgRC(rc, ("Failed to resolve %s.%s (pszIn)\n", pDevIns->pReg->szR0Mod, pszIn));
    178200        }
     
    180202        if (pszOut && RT_SUCCESS(rc))
    181203        {
    182             rc = PDMR3LdrGetSymbolR0Lazy(pDevIns->Internal.s.pVMR3, pDevIns->pReg->szR0Mod, pszOut, &pfnR0PtrOut);
     204            rc = pdmR3DevGetSymbolR0Lazy(pDevIns, pszOut, &pfnR0PtrOut);
    183205            AssertMsgRC(rc, ("Failed to resolve %s.%s (pszOut)\n", pDevIns->pReg->szR0Mod, pszOut));
    184206        }
     
    186208        if (pszInStr && RT_SUCCESS(rc))
    187209        {
    188             rc = PDMR3LdrGetSymbolR0Lazy(pDevIns->Internal.s.pVMR3, pDevIns->pReg->szR0Mod, pszInStr, &pfnR0PtrInStr);
     210            rc = pdmR3DevGetSymbolR0Lazy(pDevIns, pszInStr, &pfnR0PtrInStr);
    189211            AssertMsgRC(rc, ("Failed to resolve %s.%s (pszInStr)\n", pDevIns->pReg->szR0Mod, pszInStr));
    190212        }
     
    192214        if (pszOutStr && RT_SUCCESS(rc))
    193215        {
    194             rc = PDMR3LdrGetSymbolR0Lazy(pDevIns->Internal.s.pVMR3, pDevIns->pReg->szR0Mod, pszOutStr, &pfnR0PtrOutStr);
     216            rc = pdmR3DevGetSymbolR0Lazy(pDevIns, pszOutStr, &pfnR0PtrOutStr);
    195217            AssertMsgRC(rc, ("Failed to resolve %s.%s (pszOutStr)\n", pDevIns->pReg->szR0Mod, pszOutStr));
    196218        }
     
    276298        RTRCPTR RCPtrWrite = NIL_RTRCPTR;
    277299        if (pszWrite)
    278             rc = PDMR3LdrGetSymbolRCLazy(pDevIns->Internal.s.pVMR3, pDevIns->pReg->szRCMod, pszWrite, &RCPtrWrite);
     300            rc = pdmR3DevGetSymbolRCLazy(pDevIns, pszWrite, &RCPtrWrite);
    279301
    280302        RTRCPTR RCPtrRead = NIL_RTRCPTR;
    281303        int rc2 = VINF_SUCCESS;
    282304        if (pszRead)
    283             rc2 = PDMR3LdrGetSymbolRCLazy(pDevIns->Internal.s.pVMR3, pDevIns->pReg->szRCMod, pszRead, &RCPtrRead);
     305            rc2 = pdmR3DevGetSymbolRCLazy(pDevIns, pszRead, &RCPtrRead);
    284306
    285307        RTRCPTR RCPtrFill = NIL_RTRCPTR;
    286308        int rc3 = VINF_SUCCESS;
    287309        if (pszFill)
    288             rc3 = PDMR3LdrGetSymbolRCLazy(pDevIns->Internal.s.pVMR3, pDevIns->pReg->szRCMod, pszFill, &RCPtrFill);
     310            rc3 = pdmR3DevGetSymbolRCLazy(pDevIns, pszFill, &RCPtrFill);
    289311
    290312        if (RT_SUCCESS(rc) && RT_SUCCESS(rc2) && RT_SUCCESS(rc3))
     
    333355        R0PTRTYPE(PFNIOMMMIOWRITE) pfnR0PtrWrite = 0;
    334356        if (pszWrite)
    335             rc = PDMR3LdrGetSymbolR0Lazy(pDevIns->Internal.s.pVMR3, pDevIns->pReg->szR0Mod, pszWrite, &pfnR0PtrWrite);
     357            rc = pdmR3DevGetSymbolR0Lazy(pDevIns, pszWrite, &pfnR0PtrWrite);
    336358        R0PTRTYPE(PFNIOMMMIOREAD) pfnR0PtrRead = 0;
    337359        int rc2 = VINF_SUCCESS;
    338360        if (pszRead)
    339             rc2 = PDMR3LdrGetSymbolR0Lazy(pDevIns->Internal.s.pVMR3, pDevIns->pReg->szR0Mod, pszRead, &pfnR0PtrRead);
     361            rc2 = pdmR3DevGetSymbolR0Lazy(pDevIns, pszRead, &pfnR0PtrRead);
    340362        R0PTRTYPE(PFNIOMMMIOFILL) pfnR0PtrFill = 0;
    341363        int rc3 = VINF_SUCCESS;
    342364        if (pszFill)
    343             rc3 = PDMR3LdrGetSymbolR0Lazy(pDevIns->Internal.s.pVMR3, pDevIns->pReg->szR0Mod, pszFill, &pfnR0PtrFill);
     365            rc3 = pdmR3DevGetSymbolR0Lazy(pDevIns, pszFill, &pfnR0PtrFill);
    344366        if (RT_SUCCESS(rc) && RT_SUCCESS(rc2) && RT_SUCCESS(rc3))
    345367            rc = IOMR3MMIORegisterR0(pDevIns->Internal.s.pVMR3, pDevIns, GCPhysStart, cbRange, pvUser, pfnR0PtrWrite, pfnR0PtrRead, pfnR0PtrFill);
     
    18721894    {
    18731895        if (pDevIns->pReg->fFlags & PDM_DEVREG_FLAGS_RC)
    1874             rc = PDMR3LdrGetInterfaceSymbols(pDevIns->Internal.s.pVMR3, pvInterface, cbInterface,
    1875                                              pDevIns->pReg->szRCMod, pszSymPrefix, pszSymList,
     1896            rc = PDMR3LdrGetInterfaceSymbols(pDevIns->Internal.s.pVMR3,
     1897                                             pvInterface, cbInterface,
     1898                                             pDevIns->pReg->szRCMod, pDevIns->Internal.s.pDevR3->pszRCSearchPath,
     1899                                             pszSymPrefix, pszSymList,
    18761900                                             false /*fRing0OrRC*/);
    18771901        else
     
    19081932    {
    19091933        if (pDevIns->pReg->fFlags & PDM_DEVREG_FLAGS_R0)
    1910             rc = PDMR3LdrGetInterfaceSymbols(pDevIns->Internal.s.pVMR3, pvInterface, cbInterface,
    1911                                              pDevIns->pReg->szR0Mod, pszSymPrefix, pszSymList,
     1934            rc = PDMR3LdrGetInterfaceSymbols(pDevIns->Internal.s.pVMR3,
     1935                                             pvInterface, cbInterface,
     1936                                             pDevIns->pReg->szR0Mod, pDevIns->Internal.s.pDevR3->pszR0SearchPath,
     1937                                             pszSymPrefix, pszSymList,
    19121938                                             true /*fRing0OrRC*/);
    19131939        else
     
    19521978
    19531979        PFNPDMDRVREQHANDLERR0 pfnReqHandlerR0;
    1954         rc = PDMR3LdrGetSymbolR0Lazy(pVM, pDevIns->pReg->szR0Mod, szSymbol, &pfnReqHandlerR0);
     1980        rc = pdmR3DevGetSymbolR0Lazy(pDevIns, szSymbol, &pfnReqHandlerR0);
    19551981        if (RT_SUCCESS(rc))
    19561982        {
     
    20762102    if (pPciBusReg->pszSetIrqRC)
    20772103    {
    2078         int rc = PDMR3LdrGetSymbolRCLazy(pVM, pDevIns->pReg->szRCMod, pPciBusReg->pszSetIrqRC, &pPciBus->pfnSetIrqRC);
     2104        int rc = pdmR3DevGetSymbolRCLazy(pDevIns, pPciBusReg->pszSetIrqRC, &pPciBus->pfnSetIrqRC);
    20792105        AssertMsgRC(rc, ("%s::%s rc=%Rrc\n", pDevIns->pReg->szRCMod, pPciBusReg->pszSetIrqRC, rc));
    20802106        if (RT_FAILURE(rc))
     
    20962122    if (pPciBusReg->pszSetIrqR0)
    20972123    {
    2098         int rc = PDMR3LdrGetSymbolR0Lazy(pVM, pDevIns->pReg->szR0Mod, pPciBusReg->pszSetIrqR0, &pPciBus->pfnSetIrqR0);
     2124        int rc = pdmR3DevGetSymbolR0Lazy(pDevIns, pPciBusReg->pszSetIrqR0, &pPciBus->pfnSetIrqR0);
    20992125        AssertMsgRC(rc, ("%s::%s rc=%Rrc\n", pDevIns->pReg->szR0Mod, pPciBusReg->pszSetIrqR0, rc));
    21002126        if (RT_FAILURE(rc))
     
    22102236    if (pPicReg->pszSetIrqRC)
    22112237    {
    2212         int rc = PDMR3LdrGetSymbolRCLazy(pVM, pDevIns->pReg->szRCMod, pPicReg->pszSetIrqRC, &pVM->pdm.s.Pic.pfnSetIrqRC);
     2238        int rc = pdmR3DevGetSymbolRCLazy(pDevIns, pPicReg->pszSetIrqRC, &pVM->pdm.s.Pic.pfnSetIrqRC);
    22132239        AssertMsgRC(rc, ("%s::%s rc=%Rrc\n", pDevIns->pReg->szRCMod, pPicReg->pszSetIrqRC, rc));
    22142240        if (RT_SUCCESS(rc))
    22152241        {
    2216             rc = PDMR3LdrGetSymbolRCLazy(pVM, pDevIns->pReg->szRCMod, pPicReg->pszGetInterruptRC, &pVM->pdm.s.Pic.pfnGetInterruptRC);
     2242            rc = pdmR3DevGetSymbolRCLazy(pDevIns, pPicReg->pszGetInterruptRC, &pVM->pdm.s.Pic.pfnGetInterruptRC);
    22172243            AssertMsgRC(rc, ("%s::%s rc=%Rrc\n", pDevIns->pReg->szRCMod, pPicReg->pszGetInterruptRC, rc));
    22182244        }
     
    22362262    if (pPicReg->pszSetIrqR0)
    22372263    {
    2238         int rc = PDMR3LdrGetSymbolR0Lazy(pVM, pDevIns->pReg->szR0Mod, pPicReg->pszSetIrqR0, &pVM->pdm.s.Pic.pfnSetIrqR0);
     2264        int rc = pdmR3DevGetSymbolR0Lazy(pDevIns, pPicReg->pszSetIrqR0, &pVM->pdm.s.Pic.pfnSetIrqR0);
    22392265        AssertMsgRC(rc, ("%s::%s rc=%Rrc\n", pDevIns->pReg->szR0Mod, pPicReg->pszSetIrqR0, rc));
    22402266        if (RT_SUCCESS(rc))
    22412267        {
    2242             rc = PDMR3LdrGetSymbolR0Lazy(pVM, pDevIns->pReg->szR0Mod, pPicReg->pszGetInterruptR0, &pVM->pdm.s.Pic.pfnGetInterruptR0);
     2268            rc = pdmR3DevGetSymbolR0Lazy(pDevIns, pPicReg->pszGetInterruptR0, &pVM->pdm.s.Pic.pfnGetInterruptR0);
    22432269            AssertMsgRC(rc, ("%s::%s rc=%Rrc\n", pDevIns->pReg->szR0Mod, pPicReg->pszGetInterruptR0, rc));
    22442270        }
     
    24142440    if (pApicReg->pszGetInterruptRC)
    24152441    {
    2416         int rc = PDMR3LdrGetSymbolRCLazy(pVM, pDevIns->pReg->szRCMod, pApicReg->pszGetInterruptRC, &pVM->pdm.s.Apic.pfnGetInterruptRC);
     2442        int rc = pdmR3DevGetSymbolRCLazy(pDevIns, pApicReg->pszGetInterruptRC, &pVM->pdm.s.Apic.pfnGetInterruptRC);
    24172443        AssertMsgRC(rc, ("%s::%s rc=%Rrc\n", pDevIns->pReg->szRCMod, pApicReg->pszGetInterruptRC, rc));
    24182444        if (RT_SUCCESS(rc))
    24192445        {
    2420             rc = PDMR3LdrGetSymbolRCLazy(pVM, pDevIns->pReg->szRCMod, pApicReg->pszHasPendingIrqRC, &pVM->pdm.s.Apic.pfnHasPendingIrqRC);
     2446            rc = pdmR3DevGetSymbolRCLazy(pDevIns, pApicReg->pszHasPendingIrqRC, &pVM->pdm.s.Apic.pfnHasPendingIrqRC);
    24212447            AssertMsgRC(rc, ("%s::%s rc=%Rrc\n", pDevIns->pReg->szRCMod, pApicReg->pszHasPendingIrqRC, rc));
    24222448        }
    24232449        if (RT_SUCCESS(rc))
    24242450        {
    2425             rc = PDMR3LdrGetSymbolRCLazy(pVM, pDevIns->pReg->szRCMod, pApicReg->pszSetBaseRC, &pVM->pdm.s.Apic.pfnSetBaseRC);
     2451            rc = pdmR3DevGetSymbolRCLazy(pDevIns, pApicReg->pszSetBaseRC, &pVM->pdm.s.Apic.pfnSetBaseRC);
    24262452            AssertMsgRC(rc, ("%s::%s rc=%Rrc\n", pDevIns->pReg->szRCMod, pApicReg->pszSetBaseRC, rc));
    24272453        }
    24282454        if (RT_SUCCESS(rc))
    24292455        {
    2430             rc = PDMR3LdrGetSymbolRCLazy(pVM, pDevIns->pReg->szRCMod, pApicReg->pszGetBaseRC, &pVM->pdm.s.Apic.pfnGetBaseRC);
     2456            rc = pdmR3DevGetSymbolRCLazy(pDevIns, pApicReg->pszGetBaseRC, &pVM->pdm.s.Apic.pfnGetBaseRC);
    24312457            AssertMsgRC(rc, ("%s::%s rc=%Rrc\n", pDevIns->pReg->szRCMod, pApicReg->pszGetBaseRC, rc));
    24322458        }
    24332459        if (RT_SUCCESS(rc))
    24342460        {
    2435             rc = PDMR3LdrGetSymbolRCLazy(pVM, pDevIns->pReg->szRCMod, pApicReg->pszSetTPRRC, &pVM->pdm.s.Apic.pfnSetTPRRC);
     2461            rc = pdmR3DevGetSymbolRCLazy(pDevIns, pApicReg->pszSetTPRRC, &pVM->pdm.s.Apic.pfnSetTPRRC);
    24362462            AssertMsgRC(rc, ("%s::%s rc=%Rrc\n", pDevIns->pReg->szRCMod, pApicReg->pszSetTPRRC, rc));
    24372463        }
    24382464        if (RT_SUCCESS(rc))
    24392465        {
    2440             rc = PDMR3LdrGetSymbolRCLazy(pVM, pDevIns->pReg->szRCMod, pApicReg->pszGetTPRRC, &pVM->pdm.s.Apic.pfnGetTPRRC);
     2466            rc = pdmR3DevGetSymbolRCLazy(pDevIns, pApicReg->pszGetTPRRC, &pVM->pdm.s.Apic.pfnGetTPRRC);
    24412467            AssertMsgRC(rc, ("%s::%s rc=%Rrc\n", pDevIns->pReg->szRCMod, pApicReg->pszGetTPRRC, rc));
    24422468        }
    24432469        if (RT_SUCCESS(rc))
    24442470        {
    2445             rc = PDMR3LdrGetSymbolRCLazy(pVM, pDevIns->pReg->szRCMod, pApicReg->pszWriteMSRRC, &pVM->pdm.s.Apic.pfnWriteMSRRC);
     2471            rc = pdmR3DevGetSymbolRCLazy(pDevIns, pApicReg->pszWriteMSRRC, &pVM->pdm.s.Apic.pfnWriteMSRRC);
    24462472            AssertMsgRC(rc, ("%s::%s rc=%Rrc\n", pDevIns->pReg->szRCMod, pApicReg->pszWriteMSRRC, rc));
    24472473        }
    24482474        if (RT_SUCCESS(rc))
    24492475        {
    2450             rc = PDMR3LdrGetSymbolRCLazy(pVM, pDevIns->pReg->szRCMod, pApicReg->pszReadMSRRC, &pVM->pdm.s.Apic.pfnReadMSRRC);
     2476            rc = pdmR3DevGetSymbolRCLazy(pDevIns, pApicReg->pszReadMSRRC, &pVM->pdm.s.Apic.pfnReadMSRRC);
    24512477            AssertMsgRC(rc, ("%s::%s rc=%Rrc\n", pDevIns->pReg->szRCMod, pApicReg->pszReadMSRRC, rc));
    24522478        }
    24532479        if (RT_SUCCESS(rc))
    24542480        {
    2455             rc = PDMR3LdrGetSymbolRCLazy(pVM, pDevIns->pReg->szRCMod, pApicReg->pszBusDeliverRC, &pVM->pdm.s.Apic.pfnBusDeliverRC);
     2481            rc = pdmR3DevGetSymbolRCLazy(pDevIns, pApicReg->pszBusDeliverRC, &pVM->pdm.s.Apic.pfnBusDeliverRC);
    24562482            AssertMsgRC(rc, ("%s::%s rc=%Rrc\n", pDevIns->pReg->szRCMod, pApicReg->pszBusDeliverRC, rc));
    24572483        }
    24582484        if (RT_SUCCESS(rc))
    24592485        {
    2460             rc = PDMR3LdrGetSymbolRCLazy(pVM, pDevIns->pReg->szRCMod, pApicReg->pszLocalInterruptRC, &pVM->pdm.s.Apic.pfnLocalInterruptRC);
     2486            rc = pdmR3DevGetSymbolRCLazy(pDevIns, pApicReg->pszLocalInterruptRC, &pVM->pdm.s.Apic.pfnLocalInterruptRC);
    24612487            AssertMsgRC(rc, ("%s::%s rc=%Rrc\n", pDevIns->pReg->szRCMod, pApicReg->pszLocalInterruptRC, rc));
    24622488        }
     
    24882514    if (pApicReg->pszGetInterruptR0)
    24892515    {
    2490         int rc = PDMR3LdrGetSymbolR0Lazy(pVM, pDevIns->pReg->szR0Mod, pApicReg->pszGetInterruptR0, &pVM->pdm.s.Apic.pfnGetInterruptR0);
     2516        int rc = pdmR3DevGetSymbolR0Lazy(pDevIns, pApicReg->pszGetInterruptR0, &pVM->pdm.s.Apic.pfnGetInterruptR0);
    24912517        AssertMsgRC(rc, ("%s::%s rc=%Rrc\n", pDevIns->pReg->szR0Mod, pApicReg->pszGetInterruptR0, rc));
    24922518        if (RT_SUCCESS(rc))
    24932519        {
    2494             rc = PDMR3LdrGetSymbolR0Lazy(pVM, pDevIns->pReg->szR0Mod, pApicReg->pszHasPendingIrqR0, &pVM->pdm.s.Apic.pfnHasPendingIrqR0);
     2520            rc = pdmR3DevGetSymbolR0Lazy(pDevIns, pApicReg->pszHasPendingIrqR0, &pVM->pdm.s.Apic.pfnHasPendingIrqR0);
    24952521            AssertMsgRC(rc, ("%s::%s rc=%Rrc\n", pDevIns->pReg->szR0Mod, pApicReg->pszHasPendingIrqR0, rc));
    24962522        }
    24972523        if (RT_SUCCESS(rc))
    24982524        {
    2499             rc = PDMR3LdrGetSymbolR0Lazy(pVM, pDevIns->pReg->szR0Mod, pApicReg->pszSetBaseR0, &pVM->pdm.s.Apic.pfnSetBaseR0);
     2525            rc = pdmR3DevGetSymbolR0Lazy(pDevIns, pApicReg->pszSetBaseR0, &pVM->pdm.s.Apic.pfnSetBaseR0);
    25002526            AssertMsgRC(rc, ("%s::%s rc=%Rrc\n", pDevIns->pReg->szR0Mod, pApicReg->pszSetBaseR0, rc));
    25012527        }
    25022528        if (RT_SUCCESS(rc))
    25032529        {
    2504             rc = PDMR3LdrGetSymbolR0Lazy(pVM, pDevIns->pReg->szR0Mod, pApicReg->pszGetBaseR0, &pVM->pdm.s.Apic.pfnGetBaseR0);
     2530            rc = pdmR3DevGetSymbolR0Lazy(pDevIns, pApicReg->pszGetBaseR0, &pVM->pdm.s.Apic.pfnGetBaseR0);
    25052531            AssertMsgRC(rc, ("%s::%s rc=%Rrc\n", pDevIns->pReg->szR0Mod, pApicReg->pszGetBaseR0, rc));
    25062532        }
    25072533        if (RT_SUCCESS(rc))
    25082534        {
    2509             rc = PDMR3LdrGetSymbolR0Lazy(pVM, pDevIns->pReg->szR0Mod, pApicReg->pszSetTPRR0, &pVM->pdm.s.Apic.pfnSetTPRR0);
     2535            rc = pdmR3DevGetSymbolR0Lazy(pDevIns, pApicReg->pszSetTPRR0, &pVM->pdm.s.Apic.pfnSetTPRR0);
    25102536            AssertMsgRC(rc, ("%s::%s rc=%Rrc\n", pDevIns->pReg->szR0Mod, pApicReg->pszSetTPRR0, rc));
    25112537        }
    25122538        if (RT_SUCCESS(rc))
    25132539        {
    2514             rc = PDMR3LdrGetSymbolR0Lazy(pVM, pDevIns->pReg->szR0Mod, pApicReg->pszGetTPRR0, &pVM->pdm.s.Apic.pfnGetTPRR0);
     2540            rc = pdmR3DevGetSymbolR0Lazy(pDevIns, pApicReg->pszGetTPRR0, &pVM->pdm.s.Apic.pfnGetTPRR0);
    25152541            AssertMsgRC(rc, ("%s::%s rc=%Rrc\n", pDevIns->pReg->szR0Mod, pApicReg->pszGetTPRR0, rc));
    25162542        }
    25172543        if (RT_SUCCESS(rc))
    25182544        {
    2519             rc = PDMR3LdrGetSymbolR0Lazy(pVM, pDevIns->pReg->szR0Mod, pApicReg->pszWriteMSRR0, &pVM->pdm.s.Apic.pfnWriteMSRR0);
     2545            rc = pdmR3DevGetSymbolR0Lazy(pDevIns, pApicReg->pszWriteMSRR0, &pVM->pdm.s.Apic.pfnWriteMSRR0);
    25202546            AssertMsgRC(rc, ("%s::%s rc=%Rrc\n", pDevIns->pReg->szR0Mod, pApicReg->pszWriteMSRR0, rc));
    25212547        }
    25222548        if (RT_SUCCESS(rc))
    25232549        {
    2524             rc = PDMR3LdrGetSymbolR0Lazy(pVM, pDevIns->pReg->szR0Mod, pApicReg->pszReadMSRR0, &pVM->pdm.s.Apic.pfnReadMSRR0);
     2550            rc = pdmR3DevGetSymbolR0Lazy(pDevIns, pApicReg->pszReadMSRR0, &pVM->pdm.s.Apic.pfnReadMSRR0);
    25252551            AssertMsgRC(rc, ("%s::%s rc=%Rrc\n", pDevIns->pReg->szR0Mod, pApicReg->pszReadMSRR0, rc));
    25262552        }
    25272553        if (RT_SUCCESS(rc))
    25282554        {
    2529             rc = PDMR3LdrGetSymbolR0Lazy(pVM, pDevIns->pReg->szR0Mod, pApicReg->pszBusDeliverR0, &pVM->pdm.s.Apic.pfnBusDeliverR0);
     2555            rc = pdmR3DevGetSymbolR0Lazy(pDevIns, pApicReg->pszBusDeliverR0, &pVM->pdm.s.Apic.pfnBusDeliverR0);
    25302556            AssertMsgRC(rc, ("%s::%s rc=%Rrc\n", pDevIns->pReg->szR0Mod, pApicReg->pszBusDeliverR0, rc));
    25312557        }
    25322558        if (RT_SUCCESS(rc))
    25332559        {
    2534             rc = PDMR3LdrGetSymbolR0Lazy(pVM, pDevIns->pReg->szR0Mod, pApicReg->pszLocalInterruptR0, &pVM->pdm.s.Apic.pfnLocalInterruptR0);
     2560            rc = pdmR3DevGetSymbolR0Lazy(pDevIns, pApicReg->pszLocalInterruptR0, &pVM->pdm.s.Apic.pfnLocalInterruptR0);
    25352561            AssertMsgRC(rc, ("%s::%s rc=%Rrc\n", pDevIns->pReg->szR0Mod, pApicReg->pszLocalInterruptR0, rc));
    25362562        }
     
    26742700    if (pIoApicReg->pszSetIrqRC)
    26752701    {
    2676         int rc = PDMR3LdrGetSymbolRCLazy(pVM, pDevIns->pReg->szRCMod, pIoApicReg->pszSetIrqRC, &pVM->pdm.s.IoApic.pfnSetIrqRC);
     2702        int rc = pdmR3DevGetSymbolRCLazy(pDevIns, pIoApicReg->pszSetIrqRC, &pVM->pdm.s.IoApic.pfnSetIrqRC);
    26772703        AssertMsgRC(rc, ("%s::%s rc=%Rrc\n", pDevIns->pReg->szRCMod, pIoApicReg->pszSetIrqRC, rc));
    26782704        if (RT_FAILURE(rc))
     
    26912717    if (pIoApicReg->pszSendMsiRC)
    26922718    {
    2693         int rc = PDMR3LdrGetSymbolRCLazy(pVM, pDevIns->pReg->szRCMod, pIoApicReg->pszSetIrqRC, &pVM->pdm.s.IoApic.pfnSendMsiRC);
     2719        int rc = pdmR3DevGetSymbolRCLazy(pDevIns, pIoApicReg->pszSetIrqRC, &pVM->pdm.s.IoApic.pfnSendMsiRC);
    26942720        AssertMsgRC(rc, ("%s::%s rc=%Rrc\n", pDevIns->pReg->szRCMod, pIoApicReg->pszSendMsiRC, rc));
    26952721        if (RT_FAILURE(rc))
     
    27092735    if (pIoApicReg->pszSetIrqR0)
    27102736    {
    2711         int rc = PDMR3LdrGetSymbolR0Lazy(pVM, pDevIns->pReg->szR0Mod, pIoApicReg->pszSetIrqR0, &pVM->pdm.s.IoApic.pfnSetIrqR0);
     2737        int rc = pdmR3DevGetSymbolR0Lazy(pDevIns, pIoApicReg->pszSetIrqR0, &pVM->pdm.s.IoApic.pfnSetIrqR0);
    27122738        AssertMsgRC(rc, ("%s::%s rc=%Rrc\n", pDevIns->pReg->szR0Mod, pIoApicReg->pszSetIrqR0, rc));
    27132739        if (RT_FAILURE(rc))
     
    27272753    if (pIoApicReg->pszSendMsiR0)
    27282754    {
    2729         int rc = PDMR3LdrGetSymbolR0Lazy(pVM, pDevIns->pReg->szR0Mod, pIoApicReg->pszSetIrqR0, &pVM->pdm.s.IoApic.pfnSendMsiR0);
     2755        int rc = pdmR3DevGetSymbolR0Lazy(pDevIns, pIoApicReg->pszSetIrqR0, &pVM->pdm.s.IoApic.pfnSendMsiR0);
    27302756        AssertMsgRC(rc, ("%s::%s rc=%Rrc\n", pDevIns->pReg->szR0Mod, pIoApicReg->pszSendMsiR0, rc));
    27312757        if (RT_FAILURE(rc))
     
    34433469
    34443470/** @} */
     3471
  • trunk/src/VBox/VMM/PDMDevice.cpp

    r33595 r34241  
    6161    /** VM Handle. */
    6262    PVM             pVM;
     63    /** Pointer to the configuration node the registrations should be
     64     * associated with.  Can be NULL. */
     65    PCFGMNODE       pCfgNode;
    6366} PDMDEVREGCBINT;
    6467/** Pointer to a PDMDEVREGCBINT structure. */
     
    483486     */
    484487    PDMDEVREGCBINT RegCB;
    485     RegCB.Core.u32Version = PDM_DEVREG_CB_VERSION;
     488    RegCB.Core.u32Version  = PDM_DEVREG_CB_VERSION;
    486489    RegCB.Core.pfnRegister = pdmR3DevReg_Register;
    487     RegCB.pVM = pVM;
     490    RegCB.pVM              = pVM;
     491    RegCB.pCfgNode         = NULL;
    488492
    489493    /*
     
    503507    {
    504508        /* make filename */
    505         char *pszFilename = pdmR3FileR3("VBoxDD", /* fShared = */ true);
     509        char *pszFilename = pdmR3FileR3("VBoxDD", true /*fShared*/);
    506510        if (!pszFilename)
    507511            return VERR_NO_TMP_MEMORY;
     
    512516
    513517        /* make filename */
    514         pszFilename = pdmR3FileR3("VBoxDD2", /* fShared = */ true);
     518        pszFilename = pdmR3FileR3("VBoxDD2", true /*fShared*/);
    515519        if (!pszFilename)
    516520            return VERR_NO_TMP_MEMORY;
     
    557561        if (!RTPathHavePath(szFilename))
    558562        {
    559             char *psz = pdmR3FileR3(szFilename);
     563            char *psz = pdmR3FileR3(szFilename, false /*fShared*/);
    560564            if (!psz)
    561565                return VERR_NO_TMP_MEMORY;
     
    574578         * Load the module and register it's devices.
    575579         */
     580        RegCB.pCfgNode = pCur;
    576581        rc = pdmR3DevLoad(pVM, &RegCB, szFilename, szName);
    577582        if (RT_FAILURE(rc))
     
    691696
    692697    /*
    693      * Allocate new device structure and insert it into the list.
    694      */
     698     * Allocate new device structure, initialize and insert it into the list.
     699     */
     700    int rc;
    695701    pDev = (PPDMDEV)MMR3HeapAlloc(pRegCB->pVM, MM_TAG_PDM_DEVICE, sizeof(*pDev));
    696702    if (pDev)
    697703    {
    698         pDev->pNext = NULL;
     704        pDev->pNext      = NULL;
    699705        pDev->cInstances = 0;
    700706        pDev->pInstances = NULL;
    701         pDev->pReg = pReg;
    702         pDev->cchName = (uint32_t)strlen(pReg->szName);
    703 
    704         if (pDevPrev)
    705             pDevPrev->pNext = pDev;
    706         else
    707             pRegCB->pVM->pdm.s.pDevs = pDev;
    708         Log(("PDM: Registered device '%s'\n", pReg->szName));
    709         return VINF_SUCCESS;
    710     }
    711     return VERR_NO_MEMORY;
     707        pDev->pReg       = pReg;
     708        pDev->cchName    = (uint32_t)strlen(pReg->szName);
     709        rc = CFGMR3QueryStringAllocDef(    pRegCB->pCfgNode, "RCSearchPath", &pDev->pszRCSearchPath, NULL);
     710        if (RT_SUCCESS(rc))
     711            rc = CFGMR3QueryStringAllocDef(pRegCB->pCfgNode, "R0SearchPath", &pDev->pszR0SearchPath, NULL);
     712        if (RT_SUCCESS(rc))
     713        {
     714            if (pDevPrev)
     715                pDevPrev->pNext = pDev;
     716            else
     717                pRegCB->pVM->pdm.s.pDevs = pDev;
     718            Log(("PDM: Registered device '%s'\n", pReg->szName));
     719            return VINF_SUCCESS;
     720        }
     721
     722        MMR3HeapFree(pDev);
     723    }
     724    else
     725        rc = VERR_NO_MEMORY;
     726    return rc;
    712727}
    713728
  • trunk/src/VBox/VMM/PDMDriver.cpp

    r34222 r34241  
    5858    /** VM Handle. */
    5959    PVM             pVM;
     60    /** Pointer to the configuration node the registrations should be
     61     * associated with.  Can be NULL. */
     62    PCFGMNODE       pCfgNode;
    6063} PDMDRVREGCBINT, *PPDMDRVREGCBINT;
    6164typedef const PDMDRVREGCBINT *PCPDMDRVREGCBINT;
     
    120123    RegCB.Core.pfnRegister  = pdmR3DrvRegister;
    121124    RegCB.pVM               = pVM;
     125    RegCB.pCfgNode          = NULL;
    122126
    123127    /*
     
    137141    {
    138142        /* make filename */
    139         char *pszFilename = pdmR3FileR3("VBoxDD", /*fShared=*/true);
     143        char *pszFilename = pdmR3FileR3("VBoxDD", true /*fShared*/);
    140144        if (!pszFilename)
    141145            return VERR_NO_TMP_MEMORY;
     
    181185        if (!RTPathHavePath(szFilename))
    182186        {
    183             char *psz = pdmR3FileR3(szFilename);
     187            char *psz = pdmR3FileR3(szFilename, false /*fShared*/);
    184188            if (!psz)
    185189                return VERR_NO_TMP_MEMORY;
     
    198202         * Load the module and register it's drivers.
    199203         */
     204        RegCB.pCfgNode = pCur;
    200205        rc = pdmR3DrvLoad(pVM, &RegCB, szFilename, szName);
    201206        if (RT_FAILURE(rc))
     
    322327     * Allocate new driver structure and insert it into the list.
    323328     */
     329    int rc;
    324330    pDrv = (PPDMDRV)MMR3HeapAlloc(pRegCB->pVM, MM_TAG_PDM_DRIVER, sizeof(*pDrv));
    325331    if (pDrv)
    326332    {
    327         pDrv->pNext = NULL;
    328         pDrv->cInstances = 0;
     333        pDrv->pNext         = NULL;
     334        pDrv->cInstances    = 0;
    329335        pDrv->iNextInstance = 0;
    330         pDrv->pReg = pReg;
    331 
    332         if (pDrvPrev)
    333             pDrvPrev->pNext = pDrv;
    334         else
    335             pRegCB->pVM->pdm.s.pDrvs = pDrv;
    336         Log(("PDM: Registered driver '%s'\n", pReg->szName));
    337         return VINF_SUCCESS;
    338     }
    339     return VERR_NO_MEMORY;
     336        pDrv->pReg          = pReg;
     337        rc = CFGMR3QueryStringAllocDef(    pRegCB->pCfgNode, "RCSearchPath", &pDrv->pszRCSearchPath, NULL);
     338        if (RT_SUCCESS(rc))
     339            rc = CFGMR3QueryStringAllocDef(pRegCB->pCfgNode, "R0SearchPath", &pDrv->pszR0SearchPath, NULL);
     340        if (RT_SUCCESS(rc))
     341        {
     342            if (pDrvPrev)
     343                pDrvPrev->pNext = pDrv;
     344            else
     345                pRegCB->pVM->pdm.s.pDrvs = pDrv;
     346            Log(("PDM: Registered driver '%s'\n", pReg->szName));
     347            return VINF_SUCCESS;
     348        }
     349        MMR3HeapFree(pDrv);
     350    }
     351    else
     352        rc = VERR_NO_MEMORY;
     353    return rc;
    340354}
    341355
     
    12621276    {
    12631277        if (pDrvIns->pReg->fFlags & PDM_DRVREG_FLAGS_RC)
    1264             rc = PDMR3LdrGetInterfaceSymbols(pDrvIns->Internal.s.pVMR3, pvInterface, cbInterface,
    1265                                              pDrvIns->pReg->szRCMod, pszSymPrefix, pszSymList,
     1278            rc = PDMR3LdrGetInterfaceSymbols(pDrvIns->Internal.s.pVMR3,
     1279                                             pvInterface, cbInterface,
     1280                                             pDrvIns->pReg->szRCMod, pDrvIns->Internal.s.pDrv->pszRCSearchPath,
     1281                                             pszSymPrefix, pszSymList,
    12661282                                             false /*fRing0OrRC*/);
    12671283        else
     
    12981314    {
    12991315        if (pDrvIns->pReg->fFlags & PDM_DRVREG_FLAGS_R0)
    1300             rc = PDMR3LdrGetInterfaceSymbols(pDrvIns->Internal.s.pVMR3, pvInterface, cbInterface,
    1301                                              pDrvIns->pReg->szR0Mod, pszSymPrefix, pszSymList,
     1316            rc = PDMR3LdrGetInterfaceSymbols(pDrvIns->Internal.s.pVMR3,
     1317                                             pvInterface, cbInterface,
     1318                                             pDrvIns->pReg->szR0Mod, pDrvIns->Internal.s.pDrv->pszR0SearchPath,
     1319                                             pszSymPrefix, pszSymList,
    13021320                                             true /*fRing0OrRC*/);
    13031321        else
     
    13591377            szSymbol[sizeof("drvR0") - 1] = RT_C_TO_UPPER(szSymbol[sizeof("drvR0") - 1]);
    13601378
    1361             rc = PDMR3LdrGetSymbolR0Lazy(pVM, pDrvIns->pReg->szR0Mod, szSymbol, &pfnReqHandlerR0);
     1379            rc = PDMR3LdrGetSymbolR0Lazy(pVM, pDrvIns->pReg->szR0Mod, pDrvIns->Internal.s.pDrv->pszR0SearchPath, szSymbol,
     1380                                         &pfnReqHandlerR0);
    13621381            if (RT_SUCCESS(rc))
    13631382                pDrvIns->Internal.s.pfnReqHandlerR0 = pfnReqHandlerR0;
  • trunk/src/VBox/VMM/PDMInternal.h

    r34219 r34241  
    392392    /** Pointer to chain of instances (R3 Ptr). */
    393393    PPDMDEVINSR3                    pInstances;
     394    /** The search path for raw-mode context modules (';' as separator). */
     395    char                           *pszRCSearchPath;
     396    /** The search path for ring-0 context modules (';' as separator). */
     397    char                           *pszR0SearchPath;
    394398} PDMDEV;
    395399
     
    426430    /** The next instance number. */
    427431    uint32_t                        iNextInstance;
     432    /** The search path for raw-mode context modules (';' as separator). */
     433    char                           *pszRCSearchPath;
     434    /** The search path for ring-0 context modules (';' as separator). */
     435    char                           *pszR0SearchPath;
    428436} PDMDRV;
    429437
     
    11441152int         pdmR3LdrInitU(PUVM pUVM);
    11451153void        pdmR3LdrTermU(PUVM pUVM);
    1146 char *      pdmR3FileR3(const char *pszFile, bool fShared = false);
     1154char       *pdmR3FileR3(const char *pszFile, bool fShared);
    11471155int         pdmR3LoadR3U(PUVM pUVM, const char *pszFilename, const char *pszName);
    11481156
  • trunk/src/VBox/VMM/PDMLdr.cpp

    r33877 r34241  
    3535#include <VBox/log.h>
    3636#include <iprt/assert.h>
    37 #include <iprt/alloc.h>
     37#include <iprt/ctype.h>
     38#include <iprt/file.h>
    3839#include <iprt/ldr.h>
     40#include <iprt/mem.h>
    3941#include <iprt/path.h>
    4042#include <iprt/string.h>
     
    6163*******************************************************************************/
    6264static DECLCALLBACK(int) pdmR3GetImportRC(RTLDRMOD hLdrMod, const char *pszModule, const char *pszSymbol, unsigned uSymbol, RTUINTPTR *pValue, void *pvUser);
    63 static int      pdmR3LoadR0U(PUVM pUVM, const char *pszFilename, const char *pszName);
    64 static char *   pdmR3FileRC(const char *pszFile);
    65 static char *   pdmR3FileR0(const char *pszFile);
    66 static char *   pdmR3File(const char *pszFile, const char *pszDefaultExt, bool fShared);
     65static int      pdmR3LoadR0U(PUVM pUVM, const char *pszFilename, const char *pszName, const char *pszSearchPath);
     66static char    *pdmR3FileRC(const char *pszFile, const char *pszSearchPath);
     67static char    *pdmR3FileR0(const char *pszFile, const char *pszSearchPath);
     68static char    *pdmR3File(const char *pszFile, const char *pszDefaultExt, const char *pszSearchPath, bool fShared);
    6769
    6870
     
    7678VMMR3DECL(int) PDMR3LdrLoadVMMR0U(PUVM pUVM)
    7779{
    78     return pdmR3LoadR0U(pUVM, NULL, VMMR0_MAIN_MODULE_NAME);
     80    return pdmR3LoadR0U(pUVM, NULL, VMMR0_MAIN_MODULE_NAME, NULL);
    7981}
    8082
     
    293295         * Load the loader item.
    294296         */
    295         rc = SUPR3HardenedVerifyFile(pModule->szFilename, "pdmR3LoadR3U", NULL);
    296         if (RT_SUCCESS(rc))
    297             rc = RTLdrLoad(pModule->szFilename, &pModule->hLdrMod);
     297        char szErr[4096+1024];
     298        rc = SUPR3HardenedLdrLoadPlugIn(pModule->szFilename, &pModule->hLdrMod, szErr, sizeof(szErr));
    298299        if (RT_SUCCESS(rc))
    299300        {
     
    304305        {
    305306            /* Something went wrong, most likely module not found. Don't consider other unlikely errors */
    306             rc = VMSetError(pUVM->pVM, rc, RT_SRC_POS, N_("Unable to load R3 module %s (%s)"), pModule->szFilename, pszName);
     307            rc = VMSetError(pUVM->pVM, rc, RT_SRC_POS,
     308                            N_("Unable to load R3 module %s (%s): %s"), pModule->szFilename, pszName, szErr);
    307309            RTMemFree(pModule);
    308310        }
     
    459461    char *pszFile = NULL;
    460462    if (!pszFilename)
    461         pszFilename = pszFile = pdmR3FileRC(pszName);
     463        pszFilename = pszFile = pdmR3FileRC(pszName, NULL);
    462464
    463465    /*
     
    481483     * Open the loader item.
    482484     */
    483     int rc = SUPR3HardenedVerifyFile(pszFilename, "PDMR3LdrLoadRC", NULL);
     485    char szErr[4096+1024];
     486    int rc = SUPR3HardenedVerifyPlugIn(pszFilename, szErr, sizeof(szErr));
    484487    if (RT_SUCCESS(rc))
     488    {
     489        szErr[0] = '\0';
    485490        rc = RTLdrOpen(pszFilename, 0, RTLDRARCH_X86_32, &pModule->hLdrMod);
     491    }
    486492    if (RT_SUCCESS(rc))
    487493    {
     
    559565
    560566    /* Don't consider VERR_PDM_MODULE_NAME_CLASH and VERR_NO_MEMORY above as these are very unlikely. */
    561     if (RT_FAILURE(rc))
     567    if (RT_FAILURE(rc) && szErr[0])
     568        rc = VMSetError(pVM, rc, RT_SRC_POS, N_("Cannot load GC module %s: %s"), pszFilename, szErr);
     569    else if (RT_FAILURE(rc))
    562570        rc = VMSetError(pVM, rc, RT_SRC_POS, N_("Cannot load GC module %s"), pszFilename);
    563571
     
    576584 * @param   pszFilename     Filename of the module binary.
    577585 * @param   pszName         Module name. Case sensitive and the length is limited!
    578  */
    579 static int pdmR3LoadR0U(PUVM pUVM, const char *pszFilename, const char *pszName)
     586 * @param   pszSearchPath   List of directories to search if @a pszFilename is
     587 *                          not specified.  Can be NULL, in which case the arch
     588 *                          dependent install dir is searched.
     589 */
     590static int pdmR3LoadR0U(PUVM pUVM, const char *pszFilename, const char *pszName, const char *pszSearchPath)
    580591{
    581592    /*
     
    601612    char *pszFile = NULL;
    602613    if (!pszFilename)
    603         pszFilename = pszFile = pdmR3FileR0(pszName);
     614        pszFilename = pszFile = pdmR3FileR0(pszName, pszSearchPath);
    604615
    605616    /*
     
    622633     * Ask the support library to load it.
    623634     */
     635    char szErr[4096+1024];
    624636    void *pvImageBase;
    625     int rc = SUPR3LoadModule(pszFilename, pszName, &pvImageBase);
     637    int rc = SUPR3LoadModule(pszFilename, pszName, &pvImageBase, szErr, sizeof(szErr));
    626638    if (RT_SUCCESS(rc))
    627639    {
     
    650662    RTCritSectLeave(&pUVM->pdm.s.ListCritSect);
    651663    RTMemFree(pModule);
    652     LogRel(("pdmR3LoadR0U: pszName=\"%s\" rc=%Rrc\n", pszName, rc));
     664    LogRel(("pdmR3LoadR0U: pszName=\"%s\" rc=%Rrc szErr=\"%s\"\n", pszName, rc, szErr));
    653665
    654666    /* Don't consider VERR_PDM_MODULE_NAME_CLASH and VERR_NO_MEMORY above as these are very unlikely. */
    655667    if (RT_FAILURE(rc) && pUVM->pVM) /** @todo VMR3SetErrorU. */
    656         rc = VMSetError(pUVM->pVM, rc, RT_SRC_POS, N_("Cannot load R0 module %s"), pszFilename);
     668        rc = VMSetError(pUVM->pVM, rc, RT_SRC_POS, N_("Cannot load R0 module %s: %s"), pszFilename, szErr);
    657669
    658670    RTMemTmpFree(pszFile); /* might be reference thru pszFilename in the above VMSetError call. */
     
    770782 * @param   pVM             VM handle.
    771783 * @param   pszModule       Module name. If NULL the main R0 module (VMMR0.r0) is assumed.
     784 * @param   pszSearchPath   List of directories to search if @a pszFile is
     785 *                          not qualified with a path.  Can be NULL, in which
     786 *                          case the arch dependent install dir is searched.
    772787 * @param   pszSymbol       Symbol name. If it's value is less than 64k it's treated like a
    773788 *                          ordinal value rather than a string pointer.
    774789 * @param   ppvValue        Where to store the symbol value.
    775790 */
    776 VMMR3DECL(int) PDMR3LdrGetSymbolR0Lazy(PVM pVM, const char *pszModule, const char *pszSymbol, PRTR0PTR ppvValue)
     791VMMR3DECL(int) PDMR3LdrGetSymbolR0Lazy(PVM pVM, const char *pszModule, const char *pszSearchPath, const char *pszSymbol,
     792                                       PRTR0PTR ppvValue)
    777793{
    778794#ifdef PDMLDR_FAKE_MODE
     
    799815        if (!pModule)
    800816        {
    801             int rc = pdmR3LoadR0U(pUVM, NULL, pszModule);
     817            int rc = pdmR3LoadR0U(pUVM, NULL, pszModule, pszSearchPath);
    802818            AssertMsgRCReturn(rc, ("pszModule=%s rc=%Rrc\n", pszModule, rc), VERR_MODULE_NOT_FOUND);
    803819        }
     
    873889 * @param   pVM             VM handle.
    874890 * @param   pszModule       Module name. If NULL the main R0 module (VMMGC.gc) is assumes.
     891 * @param   pszSearchPath   List of directories to search if @a pszFile is
     892 *                          not qualified with a path.  Can be NULL, in which
     893 *                          case the arch dependent install dir is searched.
    875894 * @param   pszSymbol       Symbol name. If it's value is less than 64k it's treated like a
    876895 *                          ordinal value rather than a string pointer.
    877896 * @param   pRCPtrValue     Where to store the symbol value.
    878897 */
    879 VMMR3DECL(int) PDMR3LdrGetSymbolRCLazy(PVM pVM, const char *pszModule, const char *pszSymbol, PRTRCPTR pRCPtrValue)
     898VMMR3DECL(int) PDMR3LdrGetSymbolRCLazy(PVM pVM, const char *pszModule, const char *pszSearchPath, const char *pszSymbol,
     899                                       PRTRCPTR pRCPtrValue)
    880900{
    881901#if defined(PDMLDR_FAKE_MODE) || !defined(VBOX_WITH_RAW_MODE)
     
    902922        if (!pModule)
    903923        {
    904             char *pszFilename = pdmR3FileRC(pszModule);
     924            char *pszFilename = pdmR3FileRC(pszModule, pszSearchPath);
    905925            AssertMsgReturn(pszFilename, ("pszModule=%s\n", pszModule), VERR_MODULE_NOT_FOUND);
    906926            int rc = PDMR3LdrLoadRC(pVM, pszFilename, pszModule);
     
    925945char *pdmR3FileR3(const char *pszFile, bool fShared)
    926946{
    927     return pdmR3File(pszFile, NULL, fShared);
     947    return pdmR3File(pszFile, NULL, NULL, fShared);
    928948}
    929949
     
    936956 * @returns NULL on failure.
    937957 *
    938  * @param   pszFile     File name (no path).
    939  */
    940 char *pdmR3FileR0(const char *pszFile)
    941 {
    942     return pdmR3File(pszFile, NULL, /*fShared=*/false);
     958 * @param   pszFile         File name (no path).
     959 * @param   pszSearchPath   List of directories to search if @a pszFile is
     960 *                          not qualified with a path.  Can be NULL, in which
     961 *                          case the arch dependent install dir is searched.
     962 */
     963char *pdmR3FileR0(const char *pszFile, const char *pszSearchPath)
     964{
     965    return pdmR3File(pszFile, NULL, pszSearchPath, /*fShared=*/false);
    943966}
    944967
     
    951974 * @returns NULL on failure.
    952975 *
    953  * @param   pszFile     File name (no path).
    954  */
    955 char *pdmR3FileRC(const char *pszFile)
    956 {
    957     return pdmR3File(pszFile, NULL, /*fShared=*/false);
     976 * @param   pszFile         File name (no path).
     977 * @param   pszSearchPath   List of directories to search if @a pszFile is
     978 *                          not qualified with a path.  Can be NULL, in which
     979 *                          case the arch dependent install dir is searched.
     980 */
     981char *pdmR3FileRC(const char *pszFile, const char *pszSearchPath)
     982{
     983    return pdmR3File(pszFile, NULL, pszSearchPath, /*fShared=*/false);
    958984}
    959985
     
    10141040 * @param   pszFile         File name (no path).
    10151041 * @param   pszDefaultExt   The default extention, NULL if none.
     1042 * @param   pszSearchPath   List of directories to search if @a pszFile is
     1043 *                          not qualified with a path.  Can be NULL, in which
     1044 *                          case the arch dependent install dir is searched.
    10161045 * @param   fShared         If true, search in the shared directory (/usr/lib on Unix), else
    10171046 *                          search in the private directory (/usr/lib/virtualbox on Unix).
     
    10201049 * @todo    Remove the fShared hack again once we don't need to link against VBoxDD anymore!
    10211050 */
    1022 static char *pdmR3File(const char *pszFile, const char *pszDefaultExt, bool fShared)
     1051static char *pdmR3File(const char *pszFile, const char *pszDefaultExt, const char *pszSearchPath, bool fShared)
    10231052{
    10241053    char szPath[RTPATH_MAX];
    10251054    int  rc;
    10261055
     1056    AssertLogRelReturn(!fShared || !pszSearchPath, NULL);
     1057    Assert(!RTPathHavePath(pszFile));
     1058
     1059    /*
     1060     * If there is a path, search it.
     1061     */
     1062    if (   pszSearchPath
     1063        && *pszSearchPath)
     1064    {
     1065        /* Check the filename length. */
     1066        size_t const    cchFile = strlen(pszFile);
     1067        if (cchFile >= sizeof(szPath))
     1068            return NULL;
     1069
     1070        /*
     1071         * Walk the search path.
     1072         */
     1073        const char *psz = pszSearchPath;
     1074        while (*psz)
     1075        {
     1076            /* Skip leading blanks - no directories with leading spaces, thank you. */
     1077            while (RT_C_IS_BLANK(*psz))
     1078                psz++;
     1079
     1080            /* Find the end of this element. */
     1081            const char *pszNext;
     1082            const char *pszEnd = strchr(psz, ';');
     1083            if (!pszEnd)
     1084                pszEnd = pszNext = strchr(psz, '\0');
     1085            else
     1086                pszNext = pszEnd + 1;
     1087            if (pszEnd != psz)
     1088            {
     1089                rc = RTPathJoinEx(szPath, sizeof(szPath), psz, pszEnd - psz, pszFile, cchFile);
     1090                if (RT_SUCCESS(rc))
     1091                {
     1092                    if (RTFileExists(szPath))
     1093                    {
     1094                        size_t cchPath = strlen(szPath) + 1;
     1095                        char *pszRet = (char *)RTMemTmpAlloc(cchPath);
     1096                        if (pszRet)
     1097                            memcpy(pszRet, szPath, cchPath);
     1098                        return pszRet;
     1099                    }
     1100                }
     1101            }
     1102
     1103            /* advance */
     1104            psz = pszNext;
     1105        }
     1106    }
     1107
     1108    /*
     1109     * Use the default location.
     1110     */
    10271111    rc = fShared ? RTPathSharedLibs(szPath, sizeof(szPath))
    10281112                 : RTPathAppPrivateArch(szPath, sizeof(szPath));
     
    13241408 * @param   enmType         The module type.
    13251409 * @param   fLazy           Lazy loading the module if set.
    1326  */
    1327 static PPDMMOD pdmR3LdrFindModule(PUVM pUVM, const char *pszModule, PDMMODTYPE enmType, bool fLazy)
     1410 * @param   pszSearchPath   Search path for use when lazy loading.
     1411 */
     1412static PPDMMOD pdmR3LdrFindModule(PUVM pUVM, const char *pszModule, PDMMODTYPE enmType,
     1413                                  bool fLazy, const char *pszSearchPath)
    13281414{
    13291415    RTCritSectEnter(&pUVM->pdm.s.ListCritSect);
     
    13431429            case PDMMOD_TYPE_RC:
    13441430            {
    1345                 char *pszFilename = pdmR3FileRC(pszModule);
     1431                char *pszFilename = pdmR3FileRC(pszModule, pszSearchPath);
    13461432                if (pszFilename)
    13471433                {
     
    13491435                    RTMemTmpFree(pszFilename);
    13501436                    if (RT_SUCCESS(rc))
    1351                         return pdmR3LdrFindModule(pUVM, pszModule, enmType, false);
     1437                        return pdmR3LdrFindModule(pUVM, pszModule, enmType, false, NULL);
    13521438                }
    13531439                break;
     
    13571443            case PDMMOD_TYPE_R0:
    13581444            {
    1359                 int rc = pdmR3LoadR0U(pUVM, NULL, pszModule);
     1445                int rc = pdmR3LoadR0U(pUVM, NULL, pszModule, pszSearchPath);
    13601446                if (RT_SUCCESS(rc))
    1361                     return pdmR3LdrFindModule(pUVM, pszModule, enmType, false);
     1447                    return pdmR3LdrFindModule(pUVM, pszModule, enmType, false, NULL);
    13621448                break;
    13631449            }
     
    13841470 *                          load the module if it isn't found in the module
    13851471 *                          list.
     1472 * @param   pszSearchPath   The module search path.  If NULL, search the
     1473 *                          architecture dependent install directory.
    13861474 * @param   pszSymPrefix    What to prefix the symbols in the list with.  The
    13871475 *                          idea is that you define a list that goes with an
     
    14071495 */
    14081496VMMR3DECL(int) PDMR3LdrGetInterfaceSymbols(PVM pVM, void *pvInterface, size_t cbInterface,
    1409                                            const char *pszModule, const char *pszSymPrefix,
    1410                                            const char *pszSymList, bool fRing0)
     1497                                           const char *pszModule, const char *pszSearchPath,
     1498                                           const char *pszSymPrefix, const char *pszSymList,
     1499                                           bool fRing0)
    14111500{
    14121501    /*
     
    14171506                                         pszModule ? pszModule : fRing0 ? "VMMR0.r0" : "VMMGC.gc",
    14181507                                         fRing0 ? PDMMOD_TYPE_R0 : PDMMOD_TYPE_RC,
    1419                                          true /*fLazy*/);
     1508                                         true /*fLazy*/, pszSearchPath);
    14201509    if (pModule)
    14211510    {
  • trunk/src/VBox/VMM/PDMUsb.cpp

    r33595 r34241  
    308308    {
    309309        /* make filename */
    310         char *pszFilename = pdmR3FileR3("VBoxDD", /* fShared = */ true);
     310        char *pszFilename = pdmR3FileR3("VBoxDD", true /*fShared*/);
    311311        if (!pszFilename)
    312312            return VERR_NO_TMP_MEMORY;
     
    353353        if (!RTPathHavePath(szFilename))
    354354        {
    355             char *psz = pdmR3FileR3(szFilename);
     355            char *psz = pdmR3FileR3(szFilename, false /*fShared*/);
    356356            if (!psz)
    357357                return VERR_NO_TMP_MEMORY;
  • trunk/src/VBox/VMM/PGMHandler.cpp

    r32540 r34241  
    109109    R0PTRTYPE(PFNPGMR0PHYSHANDLER) pfnHandlerR0 = NIL_RTR0PTR;
    110110    int rc = VINF_SUCCESS;
    111     rc = PDMR3LdrGetSymbolR0Lazy(pVM, pszModR0, pszHandlerR0, &pfnHandlerR0);
     111    rc = PDMR3LdrGetSymbolR0Lazy(pVM, pszModR0, NULL /*pszSearchPath*/, pszHandlerR0, &pfnHandlerR0);
    112112    if (RT_SUCCESS(rc))
    113113    {
     
    116116         */
    117117        RTRCPTR pfnHandlerRC = NIL_RTRCPTR;
    118         rc = PDMR3LdrGetSymbolRCLazy(pVM, pszModRC, pszHandlerRC, &pfnHandlerRC);
     118        rc = PDMR3LdrGetSymbolRCLazy(pVM, pszModRC, NULL /*pszSearchPath*/, pszHandlerRC, &pfnHandlerRC);
    119119        if (RT_SUCCESS(rc))
    120120            return PGMHandlerPhysicalRegisterEx(pVM, enmType, GCPhys, GCPhysLast, pfnHandlerR3, pvUserR3,
     
    254254     */
    255255    RTRCPTR pfnHandlerRC;
    256     int rc = PDMR3LdrGetSymbolRCLazy(pVM, pszModRC, pszHandlerRC, &pfnHandlerRC);
     256    int rc = PDMR3LdrGetSymbolRCLazy(pVM, pszModRC, NULL /*pszSearchPath*/, pszHandlerRC, &pfnHandlerRC);
    257257    if (RT_SUCCESS(rc))
    258258        return PGMR3HandlerVirtualRegisterEx(pVM, enmType, GCPtr, GCPtrLast, pfnInvalidateR3, pfnHandlerR3, pfnHandlerRC, pszDesc);
  • trunk/src/VBox/VMM/TM.cpp

    r33595 r34241  
    908908     * Resolve symbols.
    909909     */
    910     rc = PDMR3LdrGetSymbolRCLazy(pVM, NULL, "tmVirtualNanoTSBad",          &pVM->tm.s.VirtualGetRawDataRC.pfnBad);
     910    rc = PDMR3LdrGetSymbolRC(pVM, NULL, "tmVirtualNanoTSBad",          &pVM->tm.s.VirtualGetRawDataRC.pfnBad);
    911911    AssertRCReturn(rc, rc);
    912     rc = PDMR3LdrGetSymbolRCLazy(pVM, NULL, "tmVirtualNanoTSRediscover",   &pVM->tm.s.VirtualGetRawDataRC.pfnRediscover);
     912    rc = PDMR3LdrGetSymbolRC(pVM, NULL, "tmVirtualNanoTSRediscover",   &pVM->tm.s.VirtualGetRawDataRC.pfnRediscover);
    913913    AssertRCReturn(rc, rc);
    914914    if (pVM->tm.s.pfnVirtualGetRawR3       == RTTimeNanoTSLFenceSync)
    915         rc = PDMR3LdrGetSymbolRCLazy(pVM, NULL, "RTTimeNanoTSLFenceSync",  &pVM->tm.s.pfnVirtualGetRawRC);
     915        rc = PDMR3LdrGetSymbolRC(pVM, NULL, "RTTimeNanoTSLFenceSync",  &pVM->tm.s.pfnVirtualGetRawRC);
    916916    else if (pVM->tm.s.pfnVirtualGetRawR3  == RTTimeNanoTSLFenceAsync)
    917         rc = PDMR3LdrGetSymbolRCLazy(pVM, NULL, "RTTimeNanoTSLFenceAsync", &pVM->tm.s.pfnVirtualGetRawRC);
     917        rc = PDMR3LdrGetSymbolRC(pVM, NULL, "RTTimeNanoTSLFenceAsync", &pVM->tm.s.pfnVirtualGetRawRC);
    918918    else if (pVM->tm.s.pfnVirtualGetRawR3  == RTTimeNanoTSLegacySync)
    919         rc = PDMR3LdrGetSymbolRCLazy(pVM, NULL, "RTTimeNanoTSLegacySync",  &pVM->tm.s.pfnVirtualGetRawRC);
     919        rc = PDMR3LdrGetSymbolRC(pVM, NULL, "RTTimeNanoTSLegacySync",  &pVM->tm.s.pfnVirtualGetRawRC);
    920920    else if (pVM->tm.s.pfnVirtualGetRawR3  == RTTimeNanoTSLegacyAsync)
    921         rc = PDMR3LdrGetSymbolRCLazy(pVM, NULL, "RTTimeNanoTSLegacyAsync", &pVM->tm.s.pfnVirtualGetRawRC);
     921        rc = PDMR3LdrGetSymbolRC(pVM, NULL, "RTTimeNanoTSLegacyAsync", &pVM->tm.s.pfnVirtualGetRawRC);
    922922    else
    923923        AssertFatalFailed();
    924924    AssertRCReturn(rc, rc);
    925925
    926     rc = PDMR3LdrGetSymbolR0Lazy(pVM, NULL, "tmVirtualNanoTSBad",          &pVM->tm.s.VirtualGetRawDataR0.pfnBad);
     926    rc = PDMR3LdrGetSymbolR0(pVM, NULL, "tmVirtualNanoTSBad",          &pVM->tm.s.VirtualGetRawDataR0.pfnBad);
    927927    AssertRCReturn(rc, rc);
    928     rc = PDMR3LdrGetSymbolR0Lazy(pVM, NULL, "tmVirtualNanoTSRediscover",   &pVM->tm.s.VirtualGetRawDataR0.pfnRediscover);
     928    rc = PDMR3LdrGetSymbolR0(pVM, NULL, "tmVirtualNanoTSRediscover",   &pVM->tm.s.VirtualGetRawDataR0.pfnRediscover);
    929929    AssertRCReturn(rc, rc);
    930930    if (pVM->tm.s.pfnVirtualGetRawR3       == RTTimeNanoTSLFenceSync)
    931         rc = PDMR3LdrGetSymbolR0Lazy(pVM, NULL, "RTTimeNanoTSLFenceSync",  &pVM->tm.s.pfnVirtualGetRawR0);
     931        rc = PDMR3LdrGetSymbolR0(pVM, NULL, "RTTimeNanoTSLFenceSync",  &pVM->tm.s.pfnVirtualGetRawR0);
    932932    else if (pVM->tm.s.pfnVirtualGetRawR3  == RTTimeNanoTSLFenceAsync)
    933         rc = PDMR3LdrGetSymbolR0Lazy(pVM, NULL, "RTTimeNanoTSLFenceAsync", &pVM->tm.s.pfnVirtualGetRawR0);
     933        rc = PDMR3LdrGetSymbolR0(pVM, NULL, "RTTimeNanoTSLFenceAsync", &pVM->tm.s.pfnVirtualGetRawR0);
    934934    else if (pVM->tm.s.pfnVirtualGetRawR3  == RTTimeNanoTSLegacySync)
    935         rc = PDMR3LdrGetSymbolR0Lazy(pVM, NULL, "RTTimeNanoTSLegacySync",  &pVM->tm.s.pfnVirtualGetRawR0);
     935        rc = PDMR3LdrGetSymbolR0(pVM, NULL, "RTTimeNanoTSLegacySync",  &pVM->tm.s.pfnVirtualGetRawR0);
    936936    else if (pVM->tm.s.pfnVirtualGetRawR3  == RTTimeNanoTSLegacyAsync)
    937         rc = PDMR3LdrGetSymbolR0Lazy(pVM, NULL, "RTTimeNanoTSLegacyAsync", &pVM->tm.s.pfnVirtualGetRawR0);
     937        rc = PDMR3LdrGetSymbolR0(pVM, NULL, "RTTimeNanoTSLegacyAsync", &pVM->tm.s.pfnVirtualGetRawR0);
    938938    else
    939939        AssertFatalFailed();
     
    973973    pVM->tm.s.VirtualGetRawDataRC.pu64Prev = MMHyperR3ToRC(pVM, (void *)&pVM->tm.s.u64VirtualRawPrev);
    974974    AssertFatal(pVM->tm.s.VirtualGetRawDataRC.pu64Prev);
    975     rc = PDMR3LdrGetSymbolRCLazy(pVM, NULL, "tmVirtualNanoTSBad",          &pVM->tm.s.VirtualGetRawDataRC.pfnBad);
     975    rc = PDMR3LdrGetSymbolRC(pVM, NULL, "tmVirtualNanoTSBad",          &pVM->tm.s.VirtualGetRawDataRC.pfnBad);
    976976    AssertFatalRC(rc);
    977     rc = PDMR3LdrGetSymbolRCLazy(pVM, NULL, "tmVirtualNanoTSRediscover",   &pVM->tm.s.VirtualGetRawDataRC.pfnRediscover);
     977    rc = PDMR3LdrGetSymbolRC(pVM, NULL, "tmVirtualNanoTSRediscover",   &pVM->tm.s.VirtualGetRawDataRC.pfnRediscover);
    978978    AssertFatalRC(rc);
    979979
    980980    if (pVM->tm.s.pfnVirtualGetRawR3       == RTTimeNanoTSLFenceSync)
    981         rc = PDMR3LdrGetSymbolRCLazy(pVM, NULL, "RTTimeNanoTSLFenceSync",  &pVM->tm.s.pfnVirtualGetRawRC);
     981        rc = PDMR3LdrGetSymbolRC(pVM, NULL, "RTTimeNanoTSLFenceSync",  &pVM->tm.s.pfnVirtualGetRawRC);
    982982    else if (pVM->tm.s.pfnVirtualGetRawR3  == RTTimeNanoTSLFenceAsync)
    983         rc = PDMR3LdrGetSymbolRCLazy(pVM, NULL, "RTTimeNanoTSLFenceAsync", &pVM->tm.s.pfnVirtualGetRawRC);
     983        rc = PDMR3LdrGetSymbolRC(pVM, NULL, "RTTimeNanoTSLFenceAsync", &pVM->tm.s.pfnVirtualGetRawRC);
    984984    else if (pVM->tm.s.pfnVirtualGetRawR3  == RTTimeNanoTSLegacySync)
    985         rc = PDMR3LdrGetSymbolRCLazy(pVM, NULL, "RTTimeNanoTSLegacySync",  &pVM->tm.s.pfnVirtualGetRawRC);
     985        rc = PDMR3LdrGetSymbolRC(pVM, NULL, "RTTimeNanoTSLegacySync",  &pVM->tm.s.pfnVirtualGetRawRC);
    986986    else if (pVM->tm.s.pfnVirtualGetRawR3  == RTTimeNanoTSLegacyAsync)
    987         rc = PDMR3LdrGetSymbolRCLazy(pVM, NULL, "RTTimeNanoTSLegacyAsync", &pVM->tm.s.pfnVirtualGetRawRC);
     987        rc = PDMR3LdrGetSymbolRC(pVM, NULL, "RTTimeNanoTSLegacyAsync", &pVM->tm.s.pfnVirtualGetRawRC);
    988988    else
    989989        AssertFatalFailed();
Note: See TracChangeset for help on using the changeset viewer.

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