Changeset 96164 in vbox for trunk/src/VBox/Runtime/win
- Timestamp:
- Aug 12, 2022 11:40:11 AM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/win/errmsgwin.cpp
r95547 r96164 41 41 * Defined Constants And Macros * 42 42 *********************************************************************************************************************************/ 43 #if !defined(IPRT_ERRMSG_DEFINES_ONLY) && defined(IN_RT_STATIC) /* No message text in static builds to save space. */ 44 # define IPRT_ERRMSG_DEFINES_ONLY 45 #endif 46 47 #ifdef IPRT_ERRMSG_DEFINES_ONLY 48 # define ENTRY(a_pszMsg, a_pszDefine, a_iCode) \ 43 #define ENTRY(a_pszMsg, a_pszDefine, a_iCode) \ 49 44 { a_pszDefine, a_pszDefine, a_iCode } 50 #else51 # define ENTRY(a_pszMsg, a_pszDefine, a_iCode) \52 { a_pszMsg, a_pszDefine, a_iCode }53 #endif54 45 55 46 … … 72 63 { 0, 0, 13, 0, 13, }, 73 64 }; 74 #el if defined(IPRT_ERRMSG_DEFINES_ONLY)65 #else 75 66 # include "errmsgwindata-only-defines.h" 76 #else77 # include "errmsgwindata-all.h"78 67 #endif 79 68 … … 201 190 RTDECL(size_t) RTErrWinFormatMsg(long rc, PFNRTSTROUTPUT pfnOutput, void *pvArgOutput, char *pszTmp, size_t cbTmp) 202 191 { 203 #ifdef IPRT_ERRMSG_DEFINES_ONLY204 192 return RTErrWinFormatDefine(rc, pfnOutput, pvArgOutput, pszTmp, cbTmp); 205 #else206 size_t idx = rtErrWinLookup(rc);207 if (idx != ~(size_t)0)208 return RTBldProgStrTabQueryOutput(&g_WinMsgStrTab,209 g_aWinMsgs[idx].offMsgFull, g_aWinMsgs[idx].cchMsgFull,210 pfnOutput, pvArgOutput);211 212 /*213 * If FACILITY_WIN32 kind of status, look up the win32 code.214 */215 const char *pszTail = NULL;216 size_t cchRet;217 if ( SCODE_FACILITY(rc) == FACILITY_WIN32218 && (idx = rtErrWinLookup(HRESULT_CODE(rc))) != ~(size_t)0)219 {220 /* Append the incoming rc, so we know it's not a regular WIN32 status: */221 cchRet = RTBldProgStrTabQueryOutput(&g_WinMsgStrTab,222 g_aWinMsgs[idx].offMsgFull, g_aWinMsgs[idx].cchMsgFull,223 pfnOutput, pvArgOutput);224 cchRet += pfnOutput(pvArgOutput, RT_STR_TUPLE(" ("));225 pszTail = ")";226 }227 else228 cchRet = pfnOutput(pvArgOutput, RT_STR_TUPLE("Unknown Status "));229 230 ssize_t cchValue = RTStrFormatU32(pszTmp, cbTmp, rc, 16, 0, 0, RTSTR_F_SPECIAL);231 Assert(cchValue > 0);232 cchRet += pfnOutput(pvArgOutput, pszTmp, cchValue);233 234 if (pszTail)235 cchRet += pfnOutput(pvArgOutput, pszTail, 1);236 return cchRet;237 #endif238 193 } 239 194 … … 260 215 cchRet += pfnOutput(pvArgOutput, pszTmp, cchValue); 261 216 262 #ifndef IPRT_ERRMSG_DEFINES_ONLY263 if (idx != ~(size_t)0)264 {265 cchRet += pfnOutput(pvArgOutput, RT_STR_TUPLE(") - "));266 cchRet += RTBldProgStrTabQueryOutput(&g_WinMsgStrTab,267 g_aWinMsgs[idx].offMsgFull, g_aWinMsgs[idx].cchMsgFull,268 pfnOutput, pvArgOutput);269 }270 #endif271 217 return cchRet; 272 218 }
Note:
See TracChangeset
for help on using the changeset viewer.