Changeset 58772 in vbox for trunk/src/VBox/Runtime/r0drv
- Timestamp:
- Nov 19, 2015 3:57:35 PM (9 years ago)
- svn:sync-xref-src-repo-rev:
- 104219
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r0drv/solaris/dbgkrnlinfo-r0drv-solaris.c
r57358 r58772 247 247 } 248 248 249 250 RTR0DECL(int) RTR0DbgKrnlInfoQuerySize(RTDBGKRNLINFO hKrnlInfo, const char *pszModule, const char *pszType, size_t *pcbType) 251 { 252 PRTDBGKRNLINFOINT pThis = hKrnlInfo; 253 AssertPtrReturn(pThis, VERR_INVALID_HANDLE); 254 AssertMsgReturn(pThis->u32Magic == RTDBGKRNLINFO_MAGIC, ("%p: u32Magic=%RX32\n", pThis, pThis->u32Magic), VERR_INVALID_HANDLE); 255 AssertPtrReturn(pszType, VERR_INVALID_PARAMETER); 256 AssertPtrReturn(pcbType, VERR_INVALID_PARAMETER); 257 if (g_frtSolInitDone) 258 RT_ASSERT_PREEMPTIBLE(); 259 260 modctl_t *pMod; 261 ctf_file_t *pCtf; 262 if (!pszModule) 263 { 264 pCtf = pThis->pGenUnixCTF; 265 pMod = pThis->pGenUnixMod; 266 NOREF(pMod); 267 } 268 else 269 { 270 char *pszMod = RTStrDup(pszModule); 271 int rc = rtR0DbgKrnlInfoModRetain(pszMod, &pMod, &pCtf); 272 RTStrFree(pszMod); 273 if (RT_FAILURE(rc)) 274 return VERR_MODULE_NOT_FOUND; 275 AssertPtrReturn(pMod, VERR_INTERNAL_ERROR_5); 276 AssertPtrReturn(pCtf, VERR_INTERNAL_ERROR_4); 277 } 278 279 int rc = VERR_NOT_FOUND; 280 ctf_id_t TypeIdent = ctf_lookup_by_name(pCtf, pszType); 281 if (TypeIdent != CTF_ERR) 282 { 283 ssize_t cbType = ctf_type_size(pCtf, TypeIdent); 284 if (cbType > 0) 285 { 286 *pcbType = cbType; 287 if (pszModule) 288 rtR0DbgKrnlInfoModRelease(pMod, pCtf); 289 return VINF_SUCCESS; 290 } 291 rc = VERR_WRONG_TYPE; 292 } 293 294 if (pszModule) 295 rtR0DbgKrnlInfoModRelease(pMod, pCtf); 296 return rc; 297 } 298
Note:
See TracChangeset
for help on using the changeset viewer.