Changeset 28330 in vbox
- Timestamp:
- Apr 14, 2010 9:47:47 PM (15 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/PDMDevHlp.cpp
r27254 r28330 1799 1799 if (pDevIns->pReg->fFlags & PDM_DEVREG_FLAGS_RC) 1800 1800 rc = PDMR3LdrGetInterfaceSymbols(pDevIns->Internal.s.pVMR3, pvInterface, cbInterface, 1801 pDevIns->pReg->sz Name, pszSymPrefix, pszSymList,1801 pDevIns->pReg->szRCMod, pszSymPrefix, pszSymList, 1802 1802 false /*fRing0OrRC*/); 1803 1803 else … … 1835 1835 if (pDevIns->pReg->fFlags & PDM_DEVREG_FLAGS_R0) 1836 1836 rc = PDMR3LdrGetInterfaceSymbols(pDevIns->Internal.s.pVMR3, pvInterface, cbInterface, 1837 pDevIns->pReg->sz Name, pszSymPrefix, pszSymList,1837 pDevIns->pReg->szR0Mod, pszSymPrefix, pszSymList, 1838 1838 true /*fRing0OrRC*/); 1839 1839 else -
trunk/src/VBox/VMM/PDMDriver.cpp
r28327 r28330 1230 1230 if (pDrvIns->pReg->fFlags & PDM_DRVREG_FLAGS_RC) 1231 1231 rc = PDMR3LdrGetInterfaceSymbols(pDrvIns->Internal.s.pVMR3, pvInterface, cbInterface, 1232 pDrvIns->pReg->sz Name, pszSymPrefix, pszSymList,1232 pDrvIns->pReg->szRCMod, pszSymPrefix, pszSymList, 1233 1233 false /*fRing0OrRC*/); 1234 1234 else … … 1266 1266 if (pDrvIns->pReg->fFlags & PDM_DRVREG_FLAGS_R0) 1267 1267 rc = PDMR3LdrGetInterfaceSymbols(pDrvIns->Internal.s.pVMR3, pvInterface, cbInterface, 1268 pDrvIns->pReg->sz Name, pszSymPrefix, pszSymList,1268 pDrvIns->pReg->szR0Mod, pszSymPrefix, pszSymList, 1269 1269 true /*fRing0OrRC*/); 1270 1270 else -
trunk/src/VBox/VMM/PDMLdr.cpp
r28317 r28330 1304 1304 * - GCPHYS:whatever, 1305 1305 * - HCPHYS:whatever. 1306 * @param fRing0 OrRCSet if it's a ring-0 context interface, clear if1306 * @param fRing0 Set if it's a ring-0 context interface, clear if 1307 1307 * it's raw-mode context interface. 1308 1308 */ 1309 1309 VMMR3DECL(int) PDMR3LdrGetInterfaceSymbols(PVM pVM, void *pvInterface, size_t cbInterface, 1310 1310 const char *pszModule, const char *pszSymPrefix, 1311 const char *pszSymList, bool fRing0 OrRC)1311 const char *pszSymList, bool fRing0) 1312 1312 { 1313 1313 /* … … 1316 1316 int rc = VINF_SUCCESS; 1317 1317 PPDMMOD pModule = pdmR3LdrFindModule(pVM->pUVM, 1318 pszModule ? pszModule : fRing0 OrRC? "VMMR0.r0" : "VMMGC.gc",1319 fRing0 OrRC? PDMMOD_TYPE_R0 : PDMMOD_TYPE_RC,1318 pszModule ? pszModule : fRing0 ? "VMMR0.r0" : "VMMGC.gc", 1319 fRing0 ? PDMMOD_TYPE_R0 : PDMMOD_TYPE_RC, 1320 1320 true /*fLazy*/); 1321 1321 if (pModule) … … 1324 1324 char szSymbol[256]; 1325 1325 size_t const cchSymPrefix = strlen(pszSymPrefix); 1326 AssertReturn(cchSymPrefix + 5 >=sizeof(szSymbol), VERR_SYMBOL_NOT_FOUND);1326 AssertReturn(cchSymPrefix + 5 < sizeof(szSymbol), VERR_SYMBOL_NOT_FOUND); 1327 1327 memcpy(szSymbol, pszSymPrefix, cchSymPrefix); 1328 1328 … … 1394 1394 */ 1395 1395 AssertReturn(cchSymPrefix + cchSym < sizeof(szSymbol), VERR_SYMBOL_NOT_FOUND); 1396 memc mp(&szSymbol[cchSymPrefix], pszCur, cchSym);1396 memcpy(&szSymbol[cchSymPrefix], pszCur, cchSym); 1397 1397 szSymbol[cchSymPrefix + cchSym] = '\0'; 1398 1398 1399 RTUINTPTR Value; 1400 rc = RTLdrGetSymbolEx(pModule->hLdrMod, pModule->pvBits, pModule->ImageBase, szSymbol, &Value); 1401 AssertMsgRCBreak(rc, ("Couldn't find symbol '%s' in module '%s'\n", szSymbol, pModule->szName)); 1402 1403 if (fRing0OrRC) 1399 if (fRing0) 1404 1400 { 1401 void *pvValue; 1402 rc = SUPR3GetSymbolR0((void *)(RTR0PTR)pModule->ImageBase, szSymbol, &pvValue); 1403 AssertMsgRCBreak(rc, ("Couldn't find symbol '%s' in module '%s'\n", szSymbol, pModule->szName)); 1404 1405 1405 PRTR0PTR pValue = (PRTR0PTR)((uintptr_t)pvInterface + offInterface); 1406 1406 AssertMsgBreakStmt(offInterface + sizeof(*pValue) <= cbInterface, 1407 1407 ("off=%#x cb=%#x sym=%s\n", offInterface, cbInterface, szSymbol), 1408 1408 rc = VERR_BUFFER_OVERFLOW); 1409 *pValue = (RTR0PTR) Value;1410 Assert( *pValue ==Value);1409 *pValue = (RTR0PTR)pvValue; 1410 Assert((void *)*pValue == pvValue); 1411 1411 offInterface += sizeof(*pValue); 1412 1412 } 1413 1413 else 1414 1414 { 1415 RTUINTPTR Value; 1416 rc = RTLdrGetSymbolEx(pModule->hLdrMod, pModule->pvBits, pModule->ImageBase, szSymbol, &Value); 1417 AssertMsgRCBreak(rc, ("Couldn't find symbol '%s' in module '%s'\n", szSymbol, pModule->szName)); 1418 1415 1419 PRTRCPTR pValue = (PRTRCPTR)((uintptr_t)pvInterface + offInterface); 1416 1420 AssertMsgBreakStmt(offInterface + sizeof(*pValue) <= cbInterface,
Note:
See TracChangeset
for help on using the changeset viewer.