Changeset 26178 in vbox
- Timestamp:
- Feb 2, 2010 10:30:28 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 57195
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/VBox/strformat-vbox.cpp
r25645 r26178 69 69 { 70 70 /* 71 * iprt status code: %Vrc, %Vrs, %Vrf, %Vra.72 */73 case 'r':74 {75 int rc = va_arg(*pArgs, int);76 ch = *(*ppszFormat)++;77 #ifdef IN_RING3 /* we don't want this anywhere else yet. */78 PCRTSTATUSMSG pMsg = RTErrGet(rc);79 switch (ch)80 {81 case 'c':82 return pfnOutput(pvArgOutput, pMsg->pszDefine, strlen(pMsg->pszDefine));83 case 's':84 return pfnOutput(pvArgOutput, pMsg->pszMsgShort, strlen(pMsg->pszMsgShort));85 case 'f':86 return pfnOutput(pvArgOutput, pMsg->pszMsgFull, strlen(pMsg->pszMsgFull));87 case 'a':88 return RTStrFormat(pfnOutput, pvArgOutput, NULL, 0, "%s (%d) - %s", pMsg->pszDefine, rc, pMsg->pszMsgFull);89 default:90 AssertMsgFailed(("Invalid status code format type '%%Vr%c%.10s'!\n", ch, *ppszFormat));91 return 0;92 }93 #else /* !IN_RING3 */94 switch (ch)95 {96 case 'c':97 case 's':98 case 'f':99 case 'a':100 return RTStrFormat(pfnOutput, pvArgOutput, NULL, 0, "%d", rc);101 default:102 AssertMsgFailed(("Invalid status code format type '%%Vr%c%.10s'!\n", ch, *ppszFormat));103 return 0;104 }105 #endif /* !IN_RING3 */106 break;107 }108 109 /*110 71 * Current thread. 111 72 */ … … 116 77 return pfnOutput(pvArgOutput, "0xffffffff", sizeof("0xffffffff") - 1); 117 78 #endif /* !IN_RING3 || RT_MINI */ 79 118 80 119 81 case 'h': … … 412 374 413 375 /* 414 * UUID.415 */416 case 'u':417 if ( (*ppszFormat)[0] == 'u'418 && (*ppszFormat)[1] == 'i'419 && (*ppszFormat)[2] == 'd')420 {421 PRTUUID pUuid = va_arg(*pArgs, PRTUUID);422 static const char szNull[] = "<NULL>";423 424 (*ppszFormat) += 3;425 if (VALID_PTR(pUuid))426 {427 /* cannot call RTUuidToStr because of GC/R0. */428 return RTStrFormat(pfnOutput, pvArgOutput, NULL, 0,429 "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",430 pUuid->Gen.u32TimeLow,431 pUuid->Gen.u16TimeMid,432 pUuid->Gen.u16TimeHiAndVersion,433 pUuid->Gen.u8ClockSeqHiAndReserved,434 pUuid->Gen.u8ClockSeqLow,435 pUuid->Gen.au8Node[0],436 pUuid->Gen.au8Node[1],437 pUuid->Gen.au8Node[2],438 pUuid->Gen.au8Node[3],439 pUuid->Gen.au8Node[4],440 pUuid->Gen.au8Node[5]);441 }442 443 return pfnOutput(pvArgOutput, szNull, sizeof(szNull) - 1);444 }445 /* fall thru */446 447 /*448 376 * Invalid/Unknown. Bitch about it. 449 377 */
Note:
See TracChangeset
for help on using the changeset viewer.