- Timestamp:
- Jul 10, 2007 2:13:54 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/Support/SUPLib.cpp
r3511 r3529 1228 1228 ModuleTerm = 0; 1229 1229 } 1230 1231 /*1232 * Create the symbol and string tables.1233 */1234 SUPLDRCREATETABSARGS CreateArgs;1235 CreateArgs.cbImage = CalcArgs.cbImage;1236 CreateArgs.pSym = (PSUPLDRSYM)&pIn->achImage[offSymTab];1237 CreateArgs.pszBase = (char *)&pIn->achImage[offStrTab];1238 CreateArgs.psz = CreateArgs.pszBase;1239 rc = RTLdrEnumSymbols(hLdrMod, 0, NULL, 0, supLoadModuleCreateTabsCB, &CreateArgs);1240 1230 if (VBOX_SUCCESS(rc)) 1241 1231 { 1242 AssertRelease((size_t)(CreateArgs.psz - CreateArgs.pszBase) <= CalcArgs.cbStrings);1243 AssertRelease((size_t)(CreateArgs.pSym - (PSUPLDRSYM)&pIn->achImage[offSymTab]) <= CalcArgs.cSymbols);1244 1245 1232 /* 1246 * Upload the image.1233 * Create the symbol and string tables. 1247 1234 */ 1248 pIn->u32Cookie = g_u32Cookie; 1249 pIn->u32SessionCookie = g_u32SessionCookie; 1250 pIn->pfnModuleInit = (RTR0PTR)ModuleInit; 1251 pIn->pfnModuleTerm = (RTR0PTR)ModuleTerm; 1252 if (fIsVMMR0) 1235 SUPLDRCREATETABSARGS CreateArgs; 1236 CreateArgs.cbImage = CalcArgs.cbImage; 1237 CreateArgs.pSym = (PSUPLDRSYM)&pIn->achImage[offSymTab]; 1238 CreateArgs.pszBase = (char *)&pIn->achImage[offStrTab]; 1239 CreateArgs.psz = CreateArgs.pszBase; 1240 rc = RTLdrEnumSymbols(hLdrMod, 0, NULL, 0, supLoadModuleCreateTabsCB, &CreateArgs); 1241 if (VBOX_SUCCESS(rc)) 1253 1242 { 1254 pIn->eEPType = pIn->EP_VMMR0; 1255 pIn->EP.VMMR0.pvVMMR0 = OpenOut.pvImageBase; 1256 pIn->EP.VMMR0.pvVMMR0Entry = (RTR0PTR)VMMR0Entry; 1257 } 1258 else 1259 pIn->eEPType = pIn->EP_NOTHING; 1260 pIn->offStrTab = offStrTab; 1261 pIn->cbStrTab = (uint32_t)CalcArgs.cbStrings; 1262 AssertRelease(pIn->cbStrTab == CalcArgs.cbStrings); 1263 pIn->offSymbols = offSymTab; 1264 pIn->cSymbols = CalcArgs.cSymbols; 1265 pIn->cbImage = cbImage; 1266 pIn->pvImageBase = OpenOut.pvImageBase; 1267 if (!g_u32FakeMode) 1268 rc = suplibOsIOCtl(SUP_IOCTL_LDR_LOAD, pIn, cbIn, NULL, 0); 1269 else 1270 rc = VINF_SUCCESS; 1271 if ( VBOX_SUCCESS(rc) 1272 || rc == VERR_ALREADY_LOADED /* this is because of a competing process. */ 1273 ) 1274 { 1243 AssertRelease((size_t)(CreateArgs.psz - CreateArgs.pszBase) <= CalcArgs.cbStrings); 1244 AssertRelease((size_t)(CreateArgs.pSym - (PSUPLDRSYM)&pIn->achImage[offSymTab]) <= CalcArgs.cSymbols); 1245 1246 /* 1247 * Upload the image. 1248 */ 1249 pIn->u32Cookie = g_u32Cookie; 1250 pIn->u32SessionCookie = g_u32SessionCookie; 1251 pIn->pfnModuleInit = (RTR0PTR)ModuleInit; 1252 pIn->pfnModuleTerm = (RTR0PTR)ModuleTerm; 1275 1253 if (fIsVMMR0) 1276 g_pvVMMR0 = OpenOut.pvImageBase; 1277 RTMemTmpFree(pIn); 1278 RTLdrClose(hLdrMod); 1279 return VINF_SUCCESS; 1254 { 1255 pIn->eEPType = pIn->EP_VMMR0; 1256 pIn->EP.VMMR0.pvVMMR0 = OpenOut.pvImageBase; 1257 pIn->EP.VMMR0.pvVMMR0Entry = (RTR0PTR)VMMR0Entry; 1258 } 1259 else 1260 pIn->eEPType = pIn->EP_NOTHING; 1261 pIn->offStrTab = offStrTab; 1262 pIn->cbStrTab = (uint32_t)CalcArgs.cbStrings; 1263 AssertRelease(pIn->cbStrTab == CalcArgs.cbStrings); 1264 pIn->offSymbols = offSymTab; 1265 pIn->cSymbols = CalcArgs.cSymbols; 1266 pIn->cbImage = cbImage; 1267 pIn->pvImageBase = OpenOut.pvImageBase; 1268 if (!g_u32FakeMode) 1269 rc = suplibOsIOCtl(SUP_IOCTL_LDR_LOAD, pIn, cbIn, NULL, 0); 1270 else 1271 rc = VINF_SUCCESS; 1272 if ( VBOX_SUCCESS(rc) 1273 || rc == VERR_ALREADY_LOADED /* this is because of a competing process. */ 1274 ) 1275 { 1276 if (fIsVMMR0) 1277 g_pvVMMR0 = OpenOut.pvImageBase; 1278 RTMemTmpFree(pIn); 1279 RTLdrClose(hLdrMod); 1280 return VINF_SUCCESS; 1281 } 1280 1282 } 1281 1283 }
Note:
See TracChangeset
for help on using the changeset viewer.