Changeset 26151 in vbox for trunk/src/VBox
- Timestamp:
- Feb 2, 2010 4:00:15 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 57164
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/PDMDriver.cpp
r26112 r26151 269 269 270 270 271 /** @ copydoc PDMDRVREGCB::pfnRegister*/271 /** @interface_method_impl{PDMDRVREGCB,pfnRegister} */ 272 272 static DECLCALLBACK(int) pdmR3DrvRegister(PCPDMDRVREGCB pCallbacks, PCPDMDRVREG pDrvReg) 273 273 { … … 687 687 */ 688 688 689 /** @ copydoc PDMDRVHLP::pfnAttach*/689 /** @interface_method_impl{PDMDRVHLP,pfnAttach} */ 690 690 static DECLCALLBACK(int) pdmR3DrvHlp_Attach(PPDMDRVINS pDrvIns, uint32_t fFlags, PPDMIBASE *ppBaseInterface) 691 691 { … … 725 725 726 726 727 /** @ copydoc PDMDRVHLP::pfnDetach*/727 /** @interface_method_impl{PDMDRVHLP,pfnDetach} */ 728 728 static DECLCALLBACK(int) pdmR3DrvHlp_Detach(PPDMDRVINS pDrvIns, uint32_t fFlags) 729 729 { … … 751 751 752 752 753 /** @ copydoc PDMDRVHLP::pfnDetachSelf*/753 /** @interface_method_impl{PDMDRVHLP,pfnDetachSelf} */ 754 754 static DECLCALLBACK(int) pdmR3DrvHlp_DetachSelf(PPDMDRVINS pDrvIns, uint32_t fFlags) 755 755 { … … 766 766 767 767 768 /** @ copydoc PDMDRVHLP::pfnMountPrepare*/768 /** @interface_method_impl{PDMDRVHLP,pfnMountPrepare} */ 769 769 static DECLCALLBACK(int) pdmR3DrvHlp_MountPrepare(PPDMDRVINS pDrvIns, const char *pszFilename, const char *pszCoreDriver) 770 770 { … … 840 840 841 841 842 /** @ copydoc PDMDRVHLP::pfnAssertEMT*/842 /** @interface_method_impl{PDMDRVHLP,pfnAssertEMT} */ 843 843 static DECLCALLBACK(bool) pdmR3DrvHlp_AssertEMT(PPDMDRVINS pDrvIns, const char *pszFile, unsigned iLine, const char *pszFunction) 844 844 { … … 856 856 857 857 858 /** @ copydoc PDMDRVHLP::pfnAssertOther*/858 /** @interface_method_impl{PDMDRVHLP,pfnAssertOther} */ 859 859 static DECLCALLBACK(bool) pdmR3DrvHlp_AssertOther(PPDMDRVINS pDrvIns, const char *pszFile, unsigned iLine, const char *pszFunction) 860 860 { … … 872 872 873 873 874 /** @ copydoc PDMDRVHLP::pfnVMSetError*/874 /** @interface_method_impl{PDMDRVHLP,pfnVMSetError} */ 875 875 static DECLCALLBACK(int) pdmR3DrvHlp_VMSetError(PPDMDRVINS pDrvIns, int rc, RT_SRC_POS_DECL, const char *pszFormat, ...) 876 876 { … … 884 884 885 885 886 /** @ copydoc PDMDRVHLP::pfnVMSetErrorV*/886 /** @interface_method_impl{PDMDRVHLP,pfnVMSetErrorV} */ 887 887 static DECLCALLBACK(int) pdmR3DrvHlp_VMSetErrorV(PPDMDRVINS pDrvIns, int rc, RT_SRC_POS_DECL, const char *pszFormat, va_list va) 888 888 { … … 893 893 894 894 895 /** @ copydoc PDMDRVHLP::pfnVMSetRuntimeError*/895 /** @interface_method_impl{PDMDRVHLP,pfnVMSetRuntimeError} */ 896 896 static DECLCALLBACK(int) pdmR3DrvHlp_VMSetRuntimeError(PPDMDRVINS pDrvIns, uint32_t fFlags, const char *pszErrorId, const char *pszFormat, ...) 897 897 { … … 905 905 906 906 907 /** @ copydoc PDMDRVHLP::pfnVMSetRuntimeErrorV*/907 /** @interface_method_impl{PDMDRVHLP,pfnVMSetRuntimeErrorV} */ 908 908 static DECLCALLBACK(int) pdmR3DrvHlp_VMSetRuntimeErrorV(PPDMDRVINS pDrvIns, uint32_t fFlags, const char *pszErrorId, const char *pszFormat, va_list va) 909 909 { … … 914 914 915 915 916 /** @ copydoc PDMDEVHLPR3::pfnVMState*/916 /** @interface_method_impl{PDMDEVHLPR3,pfnVMState} */ 917 917 static DECLCALLBACK(VMSTATE) pdmR3DrvHlp_VMState(PPDMDRVINS pDrvIns) 918 918 { … … 927 927 928 928 929 /** @ copydoc PDMDEVHLPR3::pfnVMTeleportedAndNotFullyResumedYet*/929 /** @interface_method_impl{PDMDEVHLPR3,pfnVMTeleportedAndNotFullyResumedYet} */ 930 930 static DECLCALLBACK(bool) pdmR3DrvHlp_VMTeleportedAndNotFullyResumedYet(PPDMDRVINS pDrvIns) 931 931 { … … 940 940 941 941 942 /** @ copydoc PDMDRVHLP::pfnPDMQueueCreate*/942 /** @interface_method_impl{PDMDRVHLP,pfnPDMQueueCreate} */ 943 943 static DECLCALLBACK(int) pdmR3DrvHlp_PDMQueueCreate(PPDMDRVINS pDrvIns, uint32_t cbItem, uint32_t cItems, uint32_t cMilliesInterval, 944 944 PFNPDMQUEUEDRV pfnCallback, const char *pszName, PPDMQUEUE *ppQueue) … … 963 963 964 964 965 /** @ copydoc PDMDRVHLP::pfnTMGetVirtualFreq*/965 /** @interface_method_impl{PDMDRVHLP,pfnTMGetVirtualFreq} */ 966 966 static DECLCALLBACK(uint64_t) pdmR3DrvHlp_TMGetVirtualFreq(PPDMDRVINS pDrvIns) 967 967 { … … 972 972 973 973 974 /** @ copydoc PDMDRVHLP::pfnTMGetVirtualTime*/974 /** @interface_method_impl{PDMDRVHLP,pfnTMGetVirtualTime} */ 975 975 static DECLCALLBACK(uint64_t) pdmR3DrvHlp_TMGetVirtualTime(PPDMDRVINS pDrvIns) 976 976 { … … 981 981 982 982 983 /** @ copydoc PDMDRVHLP::pfnTMTimerCreate*/983 /** @interface_method_impl{PDMDRVHLP,pfnTMTimerCreate} */ 984 984 static DECLCALLBACK(int) pdmR3DrvHlp_TMTimerCreate(PPDMDRVINS pDrvIns, TMCLOCK enmClock, PFNTMTIMERDRV pfnCallback, void *pvUser, uint32_t fFlags, const char *pszDesc, PPTMTIMERR3 ppTimer) 985 985 { … … 996 996 997 997 998 /** @ copydoc PDMDRVHLP::pfnSSMRegister*/998 /** @interface_method_impl{PDMDRVHLP,pfnSSMRegister} */ 999 999 static DECLCALLBACK(int) pdmR3DrvHlp_SSMRegister(PPDMDRVINS pDrvIns, uint32_t uVersion, size_t cbGuess, 1000 1000 PFNSSMDRVLIVEPREP pfnLivePrep, PFNSSMDRVLIVEEXEC pfnLiveExec, PFNSSMDRVLIVEVOTE pfnLiveVote, … … 1021 1021 1022 1022 1023 /** @ copydoc PDMDRVHLP::pfnSSMDeregister*/1023 /** @interface_method_impl{PDMDRVHLP,pfnSSMDeregister} */ 1024 1024 static DECLCALLBACK(int) pdmR3DrvHlp_SSMDeregister(PPDMDRVINS pDrvIns, const char *pszName, uint32_t u32Instance) 1025 1025 { … … 1036 1036 1037 1037 1038 /** @ copydoc PDMDRVHLP::pfnSTAMRegister*/1038 /** @interface_method_impl{PDMDRVHLP,pfnSTAMRegister} */ 1039 1039 static DECLCALLBACK(void) pdmR3DrvHlp_STAMRegister(PPDMDRVINS pDrvIns, void *pvSample, STAMTYPE enmType, const char *pszName, STAMUNIT enmUnit, const char *pszDesc) 1040 1040 { … … 1048 1048 1049 1049 1050 /** @ copydoc PDMDRVHLP::pfnSTAMRegisterF*/1050 /** @interface_method_impl{PDMDRVHLP,pfnSTAMRegisterF} */ 1051 1051 static DECLCALLBACK(void) pdmR3DrvHlp_STAMRegisterF(PPDMDRVINS pDrvIns, void *pvSample, STAMTYPE enmType, STAMVISIBILITY enmVisibility, 1052 1052 STAMUNIT enmUnit, const char *pszDesc, const char *pszName, ...) … … 1063 1063 1064 1064 1065 /** @ copydoc PDMDRVHLP::pfnSTAMRegisterV*/1065 /** @interface_method_impl{PDMDRVHLP,pfnSTAMRegisterV} */ 1066 1066 static DECLCALLBACK(void) pdmR3DrvHlp_STAMRegisterV(PPDMDRVINS pDrvIns, void *pvSample, STAMTYPE enmType, STAMVISIBILITY enmVisibility, 1067 1067 STAMUNIT enmUnit, const char *pszDesc, const char *pszName, va_list args) … … 1075 1075 1076 1076 1077 /** @ copydoc PDMDRVHLP::pfnSTAMDeregister*/1077 /** @interface_method_impl{PDMDRVHLP,pfnSTAMDeregister} */ 1078 1078 static DECLCALLBACK(int) pdmR3DrvHlp_STAMDeregister(PPDMDRVINS pDrvIns, void *pvSample) 1079 1079 { … … 1087 1087 1088 1088 1089 /** @ copydoc PDMDRVHLP::pfnSUPCallVMMR0Ex*/1089 /** @interface_method_impl{PDMDRVHLP,pfnSUPCallVMMR0Ex} */ 1090 1090 static DECLCALLBACK(int) pdmR3DrvHlp_SUPCallVMMR0Ex(PPDMDRVINS pDrvIns, unsigned uOperation, void *pvArg, unsigned cbArg) 1091 1091 { … … 1108 1108 1109 1109 1110 /** @ copydoc PDMDRVHLP::pfnUSBRegisterHub*/1110 /** @interface_method_impl{PDMDRVHLP,pfnUSBRegisterHub} */ 1111 1111 static DECLCALLBACK(int) pdmR3DrvHlp_USBRegisterHub(PPDMDRVINS pDrvIns, uint32_t fVersions, uint32_t cPorts, PCPDMUSBHUBREG pUsbHubReg, PPCPDMUSBHUBHLP ppUsbHubHlp) 1112 1112 { … … 1127 1127 1128 1128 1129 /** @ copydoc PDMDRVHLP::pfnSetAsyncNotification*/1129 /** @interface_method_impl{PDMDRVHLP,pfnSetAsyncNotification} */ 1130 1130 static DECLCALLBACK(int) pdmR3DrvHlp_SetAsyncNotification(PPDMDRVINS pDrvIns, PFNPDMDRVASYNCNOTIFY pfnAsyncNotify) 1131 1131 { … … 1156 1156 1157 1157 1158 /** @ copydoc PDMDRVHLP::pfnAsyncNotificationCompleted*/1158 /** @interface_method_impl{PDMDRVHLP,pfnAsyncNotificationCompleted} */ 1159 1159 static DECLCALLBACK(void) pdmR3DrvHlp_AsyncNotificationCompleted(PPDMDRVINS pDrvIns) 1160 1160 { … … 1179 1179 1180 1180 1181 /** @ copydoc PDMDRVHLP::pfnPDMThreadCreate*/1181 /** @interface_method_impl{PDMDRVHLP,pfnPDMThreadCreate} */ 1182 1182 static DECLCALLBACK(int) pdmR3DrvHlp_PDMThreadCreate(PPDMDRVINS pDrvIns, PPPDMTHREAD ppThread, void *pvUser, PFNPDMTHREADDRV pfnThread, 1183 1183 PFNPDMTHREADWAKEUPDRV pfnWakeup, size_t cbStack, RTTHREADTYPE enmType, const char *pszName) … … 1196 1196 1197 1197 1198 #ifdef VBOX_WITH_PDM_ASYNC_COMPLETION 1199 /** @copydoc PDMDRVHLP::pfnPDMAsyncCompletionTemplateCreate */ 1198 /** @interface_method_impl{PDMDRVHLP,pfnPDMAsyncCompletionTemplateCreate} */ 1200 1199 static DECLCALLBACK(int) pdmR3DrvHlp_PDMAsyncCompletionTemplateCreate(PPDMDRVINS pDrvIns, PPPDMASYNCCOMPLETIONTEMPLATE ppTemplate, 1201 1200 PFNPDMASYNCCOMPLETEDRV pfnCompleted, void *pvTemplateUser, … … 1213 1212 return rc; 1214 1213 } 1215 #endif 1214 1215 1216 /** @interface_method_impl{PDMDRVHLP,pfnPDMLdrGetRCInterfaceSymbols} */ 1217 static DECLCALLBACK(int) pdmR3DrvHlp_PDMLdrGetRCInterfaceSymbols(PPDMDRVINS pDrvIns, void *pvInterface, size_t cbInterface, 1218 const char *pszSymPrefix, const char *pszSymList) 1219 { 1220 PDMDRV_ASSERT_DRVINS(pDrvIns); 1221 VM_ASSERT_EMT(pDrvIns->Internal.s.pVMR3); 1222 LogFlow(("pdmR3DrvHlp_PDMLdrGetRCInterfaceSymbols: caller='%s'/%d: pvInterface=%p cbInterface=%zu pszSymPrefix=%p:{%s} pszSymList=%p:{%s}\n", 1223 pDrvIns->pDrvReg->szDriverName, pDrvIns->iInstance, pvInterface, cbInterface, pszSymPrefix, pszSymPrefix, pszSymList, pszSymList)); 1224 1225 int rc; 1226 if ( strncmp(pszSymPrefix, "drv", 3) == 0 1227 && RTStrIStr(pszSymPrefix + 3, pDrvIns->pDrvReg->szDriverName) != NULL) 1228 { 1229 if (pDrvIns->pDrvReg->fFlags & PDM_DRVREG_FLAGS_RC) 1230 rc = PDMR3LdrGetInterfaceSymbols(pDrvIns->Internal.s.pVMR3, pvInterface, cbInterface, 1231 pDrvIns->pDrvReg->szDriverName, pszSymPrefix, pszSymList, 1232 false /*fRing0OrRC*/); 1233 else 1234 { 1235 AssertMsgFailed(("Not a raw-mode enabled driver\n")); 1236 rc = VERR_PERMISSION_DENIED; 1237 } 1238 } 1239 else 1240 { 1241 AssertMsgFailed(("Invalid prefix '%s' for '%s'; must start with 'drv' and contain the driver name!\n", 1242 pszSymPrefix, pDrvIns->pDrvReg->szDriverName)); 1243 rc = VERR_INVALID_NAME; 1244 } 1245 1246 LogFlow(("pdmR3DrvHlp_PDMLdrGetRCInterfaceSymbols: caller='%s'/%d: returns %Rrc\n", pDrvIns->pDrvReg->szDriverName, 1247 pDrvIns->iInstance, rc)); 1248 return rc; 1249 } 1250 1251 1252 /** @interface_method_impl{PDMDRVHLP,pfnPDMLdrGetR0InterfaceSymbols} */ 1253 static DECLCALLBACK(int) pdmR3DrvHlp_PDMLdrGetR0InterfaceSymbols(PPDMDRVINS pDrvIns, void *pvInterface, size_t cbInterface, 1254 const char *pszSymPrefix, const char *pszSymList) 1255 { 1256 PDMDRV_ASSERT_DRVINS(pDrvIns); 1257 VM_ASSERT_EMT(pDrvIns->Internal.s.pVMR3); 1258 LogFlow(("pdmR3DrvHlp_PDMLdrGetR0InterfaceSymbols: caller='%s'/%d: pvInterface=%p cbInterface=%zu pszSymPrefix=%p:{%s} pszSymList=%p:{%s}\n", 1259 pDrvIns->pDrvReg->szDriverName, pDrvIns->iInstance, pvInterface, cbInterface, pszSymPrefix, pszSymPrefix, pszSymList, pszSymList)); 1260 1261 int rc; 1262 if ( strncmp(pszSymPrefix, "drv", 3) == 0 1263 && RTStrIStr(pszSymPrefix + 3, pDrvIns->pDrvReg->szDriverName) != NULL) 1264 { 1265 if (pDrvIns->pDrvReg->fFlags & PDM_DRVREG_FLAGS_R0) 1266 rc = PDMR3LdrGetInterfaceSymbols(pDrvIns->Internal.s.pVMR3, pvInterface, cbInterface, 1267 pDrvIns->pDrvReg->szDriverName, pszSymPrefix, pszSymList, 1268 true /*fRing0OrRC*/); 1269 else 1270 { 1271 AssertMsgFailed(("Not a ring-0 enabled driver\n")); 1272 rc = VERR_PERMISSION_DENIED; 1273 } 1274 } 1275 else 1276 { 1277 AssertMsgFailed(("Invalid prefix '%s' for '%s'; must start with 'drv' and contain the driver name!\n", 1278 pszSymPrefix, pDrvIns->pDrvReg->szDriverName)); 1279 rc = VERR_INVALID_NAME; 1280 } 1281 1282 LogFlow(("pdmR3DrvHlp_PDMLdrGetR0InterfaceSymbols: caller='%s'/%d: returns %Rrc\n", pDrvIns->pDrvReg->szDriverName, 1283 pDrvIns->iInstance, rc)); 1284 return rc; 1285 } 1216 1286 1217 1287 … … 1249 1319 pdmR3DrvHlp_AsyncNotificationCompleted, 1250 1320 pdmR3DrvHlp_PDMThreadCreate, 1251 #ifdef VBOX_WITH_PDM_ASYNC_COMPLETION1252 1321 pdmR3DrvHlp_PDMAsyncCompletionTemplateCreate, 1253 #endif 1322 pdmR3DrvHlp_PDMLdrGetRCInterfaceSymbols, 1323 pdmR3DrvHlp_PDMLdrGetR0InterfaceSymbols, 1254 1324 PDM_DRVHLPR3_VERSION /* u32TheEnd */ 1255 1325 }; -
trunk/src/VBox/VMM/PDMLdr.cpp
r25015 r26151 1159 1159 } 1160 1160 1161 1162 /** 1163 * Locates a module. 1164 * 1165 * @returns Pointer to the module if found. 1166 * @param pUVM Pointer to the user mode VM structure. 1167 * @param pszModule The module name. 1168 * @param enmType The module type. 1169 * @param fLazy Lazy loading the module if set. 1170 */ 1171 static PPDMMOD pdmR3LdrFindModule(PUVM pUVM, const char *pszModule, PDMMODTYPE enmType, bool fLazy) 1172 { 1173 for (PPDMMOD pModule = pUVM->pdm.s.pModules; pModule; pModule = pModule->pNext) 1174 if ( pModule->eType == enmType 1175 && !strcmp(pModule->szName, pszModule)) 1176 return pModule; 1177 if (fLazy) 1178 { 1179 switch (enmType) 1180 { 1181 case PDMMOD_TYPE_RC: 1182 { 1183 char *pszFilename = pdmR3FileRC(pszModule); 1184 if (pszFilename) 1185 { 1186 int rc = PDMR3LdrLoadRC(pUVM->pVM, pszFilename, pszModule); 1187 RTMemTmpFree(pszFilename); 1188 if (RT_SUCCESS(rc)) 1189 return pdmR3LdrFindModule(pUVM, pszModule, enmType, false); 1190 } 1191 break; 1192 } 1193 1194 case PDMMOD_TYPE_R0: 1195 { 1196 int rc = pdmR3LoadR0U(pUVM, NULL, pszModule); 1197 if (RT_SUCCESS(rc)) 1198 return pdmR3LdrFindModule(pUVM, pszModule, enmType, false); 1199 break; 1200 } 1201 1202 default: 1203 AssertFailed(); 1204 } 1205 } 1206 return NULL; 1207 } 1208 1209 1210 /** 1211 * Resolves a ring-0 or raw-mode context interface. 1212 * 1213 * @returns VBox status code. 1214 * @param pVM The VM handle. 1215 * @param pvInterface Pointer to the interface structure. The symbol list 1216 * describes the layout. 1217 * @param cbInterface The size of the structure pvInterface is pointing 1218 * to. For bounds checking. 1219 * @param pszModule The module name. If NULL we assume it's the default 1220 * R0 or RC module (@a fRing0OrRC). We'll attempt to 1221 * load the module if it isn't found in the module 1222 * list. 1223 * @param pszSymPrefix What to prefix the symbols in the list with. The 1224 * idea is that you define a list that goes with an 1225 * interface (INTERFACE_SYM_LIST) and reuse it with 1226 * each implementation. 1227 * @param pszSymList The symbol list for the interface. This is a 1228 * semi-colon separated list of symbol base names. As 1229 * mentioned above, each is prefixed with @a 1230 * pszSymPrefix before resolving. There are a couple 1231 * of special symbol names that will cause us to skip 1232 * ahead a little bit: 1233 * - U8:whatever, 1234 * - U16:whatever, 1235 * - U32:whatever, 1236 * - U64:whatever, 1237 * - RCPTR:whatever, 1238 * - R3PTR:whatever, 1239 * - R0PTR:whatever, 1240 * - GCPHYS:whatever, 1241 * - HCPHYS:whatever. 1242 * @param fRing0OrRC Set if it's a ring-0 context interface, clear if 1243 * it's raw-mode context interface. 1244 */ 1245 VMMR3DECL(int) PDMR3LdrGetInterfaceSymbols(PVM pVM, void *pvInterface, size_t cbInterface, 1246 const char *pszModule, const char *pszSymPrefix, 1247 const char *pszSymList, bool fRing0OrRC) 1248 { 1249 /* 1250 * Find the module. 1251 */ 1252 int rc; 1253 PPDMMOD pModule = pdmR3LdrFindModule(pVM->pUVM, 1254 pszModule ? pszModule : fRing0OrRC ? "VMMR0.r0" : "VMMGC.gc", 1255 fRing0OrRC ? PDMMOD_TYPE_R0 : PDMMOD_TYPE_RC, 1256 true /*fLazy*/); 1257 if (pModule) 1258 { 1259 /* Prep the symbol name. */ 1260 char szSymbol[256]; 1261 size_t const cchSymPrefix = strlen(pszSymPrefix); 1262 AssertReturn(cchSymPrefix + 5 >= sizeof(szSymbol), VERR_SYMBOL_NOT_FOUND); 1263 memcpy(szSymbol, pszSymPrefix, cchSymPrefix); 1264 1265 /* 1266 * Iterate the symbol list. 1267 */ 1268 uint32_t offInterface = 0; 1269 const char *pszCur = pszSymList; 1270 while (pszCur) 1271 { 1272 /* Find the end of the current symbol name. */ 1273 size_t cchSym; 1274 const char *pszNext = strchr(pszCur, ';'); 1275 if (pszNext) 1276 { 1277 cchSym = pszNext - pszCur; 1278 pszNext++; 1279 } 1280 else 1281 cchSym = strlen(pszCur); 1282 AssertReturn(cchSym > 0, VERR_INVALID_PARAMETER); 1283 1284 /* check for skip instructions */ 1285 const char *pszColon = (const char *)memchr(pszCur, ':', cchSym); 1286 if (pszColon) 1287 { 1288 #define IS_SKIP_INSTR(szInstr) \ 1289 ( cchSkip == sizeof(szInstr) - 1 \ 1290 && !memcmp(pszCur, szInstr, sizeof(szInstr) - 1) ) 1291 1292 size_t const cchSkip = pszColon - pszCur; 1293 if (IS_SKIP_INSTR("U8")) 1294 offInterface += sizeof(uint8_t); 1295 else if (IS_SKIP_INSTR("U16")) 1296 offInterface += sizeof(uint16_t); 1297 else if (IS_SKIP_INSTR("U32")) 1298 offInterface += sizeof(uint32_t); 1299 else if (IS_SKIP_INSTR("U64")) 1300 offInterface += sizeof(uint64_t); 1301 else if (IS_SKIP_INSTR("RCPTR")) 1302 offInterface += sizeof(RTRCPTR); 1303 else if (IS_SKIP_INSTR("R3PTR")) 1304 offInterface += sizeof(RTR3PTR); 1305 else if (IS_SKIP_INSTR("R0PTR")) 1306 offInterface += sizeof(RTR0PTR); 1307 else if (IS_SKIP_INSTR("HCPHYS")) 1308 offInterface += sizeof(RTHCPHYS); 1309 else if (IS_SKIP_INSTR("GCPHYS")) 1310 offInterface += sizeof(RTGCPHYS); 1311 else 1312 AssertMsgFailedReturn(("Invalid skip instruction %.*s (prefix=%s)\n", cchSym, pszCur, pszSymPrefix), 1313 VERR_INVALID_PARAMETER); 1314 AssertMsgReturn(offInterface <= cbInterface, 1315 ("off=%#x cb=%#x (sym=%.*s prefix=%s)\n", offInterface, cbInterface, cchSym, pszCur, pszSymPrefix), 1316 VERR_BUFFER_OVERFLOW); 1317 #undef IS_SKIP_INSTR 1318 } 1319 else 1320 { 1321 AssertReturn(cchSymPrefix + cchSym >= sizeof(szSymbol), VERR_SYMBOL_NOT_FOUND); 1322 memcmp(&szSymbol[cchSymPrefix], pszCur, cchSym); 1323 szSymbol[cchSymPrefix + cchSym] = '\0'; 1324 1325 // rc = resume coding here... 1326 } 1327 1328 /* advance */ 1329 pszCur = pszNext; 1330 } 1331 1332 } 1333 else 1334 rc = VERR_MODULE_NOT_FOUND; 1335 return rc; 1336 } 1337
Note:
See TracChangeset
for help on using the changeset viewer.