Changeset 26155 in vbox
- Timestamp:
- Feb 2, 2010 4:20:05 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 57169
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/PDMLdr.cpp
r26151 r26155 1270 1270 while (pszCur) 1271 1271 { 1272 /* Find the end of the current symbol name. */ 1272 /* 1273 * Find the end of the current symbol name. 1274 */ 1273 1275 size_t cchSym; 1274 1276 const char *pszNext = strchr(pszCur, ';'); … … 1280 1282 else 1281 1283 cchSym = strlen(pszCur); 1282 Assert Return(cchSym > 0,VERR_INVALID_PARAMETER);1283 1284 /* check for skip instructions*/1284 AssertBreakStmt(cchSym > 0, rc = VERR_INVALID_PARAMETER); 1285 1286 /* Is it a skip instruction? */ 1285 1287 const char *pszColon = (const char *)memchr(pszCur, ':', cchSym); 1286 1288 if (pszColon) 1287 1289 { 1290 /* 1291 * String switch on the instruction and execute it, checking 1292 * that we didn't overshoot the interface structure. 1293 */ 1288 1294 #define IS_SKIP_INSTR(szInstr) \ 1289 1295 ( cchSkip == sizeof(szInstr) - 1 \ … … 1310 1316 offInterface += sizeof(RTGCPHYS); 1311 1317 else 1312 AssertMsgFailed Return(("Invalid skip instruction %.*s (prefix=%s)\n", cchSym, pszCur, pszSymPrefix),1313 VERR_INVALID_PARAMETER);1314 AssertMsg Return(offInterface <= cbInterface,1315 ("off=%#x cb=%#x (sym=%.*s prefix=%s)\n", offInterface, cbInterface, cchSym, pszCur, pszSymPrefix),1316 VERR_BUFFER_OVERFLOW);1318 AssertMsgFailedBreakStmt(("Invalid skip instruction %.*s (prefix=%s)\n", cchSym, pszCur, pszSymPrefix), 1319 rc = VERR_INVALID_PARAMETER); 1320 AssertMsgBreakStmt(offInterface <= cbInterface, 1321 ("off=%#x cb=%#x (sym=%.*s prefix=%s)\n", offInterface, cbInterface, cchSym, pszCur, pszSymPrefix), 1322 rc = VERR_BUFFER_OVERFLOW); 1317 1323 #undef IS_SKIP_INSTR 1318 1324 } 1319 1325 else 1320 1326 { 1327 /* 1328 * Construct the symbol name, get its value, store it and 1329 * advance the interface cursor. 1330 */ 1321 1331 AssertReturn(cchSymPrefix + cchSym >= sizeof(szSymbol), VERR_SYMBOL_NOT_FOUND); 1322 1332 memcmp(&szSymbol[cchSymPrefix], pszCur, cchSym); 1323 1333 szSymbol[cchSymPrefix + cchSym] = '\0'; 1324 1334 1325 // rc = resume coding here... 1335 RTUINTPTR Value; 1336 rc = RTLdrGetSymbolEx(pModule->hLdrMod, pModule->pvBits, pModule->ImageBase, szSymbol, &Value); 1337 AssertMsgRCBreak(rc, ("Couldn't find symbol '%s' in module '%s'\n", szSymbol, pModule->szName)); 1338 1339 if (fRing0OrRC) 1340 { 1341 PRTR0PTR pValue = (PRTR0PTR)((uintptr_t)pvInterface + offInterface); 1342 AssertMsgBreakStmt(offInterface + sizeof(*pValue) <= cbInterface, 1343 ("off=%#x cb=%#x sym=%s\n", offInterface, cbInterface, szSymbol), 1344 rc = VERR_BUFFER_OVERFLOW); 1345 *pValue = (RTR0PTR)Value; 1346 Assert(*pValue == Value); 1347 offInterface += sizeof(*pValue); 1348 } 1349 else 1350 { 1351 PRTRCPTR pValue = (PRTRCPTR)((uintptr_t)pvInterface + offInterface); 1352 AssertMsgBreakStmt(offInterface + sizeof(*pValue) <= cbInterface, 1353 ("off=%#x cb=%#x sym=%s\n", offInterface, cbInterface, szSymbol), 1354 rc = VERR_BUFFER_OVERFLOW); 1355 *pValue = (RTRCPTR)Value; 1356 Assert(*pValue == Value); 1357 offInterface += sizeof(*pValue); 1358 } 1326 1359 } 1327 1360
Note:
See TracChangeset
for help on using the changeset viewer.