Changeset 83166 in vbox for trunk/src/VBox/Runtime/common/string
- Timestamp:
- Feb 26, 2020 11:16:55 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/string/strformatrt.cpp
r82968 r83166 273 273 RTSF_MAC, 274 274 RTSF_NETADDR, 275 RTSF_UUID 275 RTSF_UUID, 276 RTSF_ERRINFO, 277 RTSF_ERRINFO_MSG_ONLY 276 278 } RTSF; 277 279 static const struct … … 313 315 { STRMEM("Rv"), sizeof(RTRCPTR), 16, RTSF_INTW, 0 }, 314 316 { STRMEM("Tbool"), sizeof(bool), 10, RTSF_BOOL, 0 }, 317 { STRMEM("Teic"), sizeof(PCRTERRINFO), 16, RTSF_ERRINFO, 0 }, 318 { STRMEM("Teim"), sizeof(PCRTERRINFO), 16, RTSF_ERRINFO_MSG_ONLY, 0 }, 315 319 { STRMEM("Tfile"), sizeof(RTFILE), 10, RTSF_INT, 0 }, 316 320 { STRMEM("Tfmode"), sizeof(RTFMODE), 16, RTSF_INTW, 0 }, … … 379 383 PCRTNETADDR pNetAddr; 380 384 PCRTUUID pUuid; 385 PCRTERRINFO pErrInfo; 381 386 } u; 382 387 … … 657 662 } 658 663 return pfnOutput(pvArgOutput, s_szNull, sizeof(s_szNull) - 1); 664 } 665 666 case RTSF_ERRINFO: 667 case RTSF_ERRINFO_MSG_ONLY: 668 { 669 if (VALID_PTR(u.pErrInfo) && RTErrInfoIsSet(u.pErrInfo)) 670 { 671 cch = 0; 672 if (s_aTypes[i].enmFormat == RTSF_ERRINFO) 673 { 674 #ifdef IN_RING3 /* we don't want this anywhere else yet. */ 675 PCRTSTATUSMSG pMsg = RTErrGet(u.pErrInfo->rc); 676 cch += pfnOutput(pvArgOutput, pMsg->pszMsgShort, strlen(pMsg->pszMsgShort)); 677 #else 678 cch += RTStrFormat(pfnOutput, pvArgOutput, NULL, 0, "%d", u.pErrInfo->rc); 679 #endif 680 } 681 682 if (u.pErrInfo->cbMsg > 0) 683 { 684 if (fFlags & RTSTR_F_SPECIAL) 685 cch = pfnOutput(pvArgOutput, RT_STR_TUPLE(" - ")); 686 else 687 cch = pfnOutput(pvArgOutput, RT_STR_TUPLE(": ")); 688 cch += pfnOutput(pvArgOutput, u.pErrInfo->pszMsg, u.pErrInfo->cbMsg); 689 } 690 return cch; 691 } 692 return 0; 659 693 } 660 694
Note:
See TracChangeset
for help on using the changeset viewer.