VirtualBox

Changeset 8402 in vbox for trunk/src/VBox/Runtime/win


Ignore:
Timestamp:
Apr 26, 2008 5:13:38 AM (17 years ago)
Author:
vboxsync
Message:

Added %Rhrc, %Rhrf and %Rhra for formatting COM/XPCOM status codes. Added RTErrCOMGet() for looking up these status codes. Note that we're not yet generating the XPCOM database, only the win32/64 one.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/win/errmsgwin.cpp

    r8245 r8402  
    3838#include <iprt/string.h>
    3939#include <iprt/err.h>
    40 #include <VBox/err.h>
    4140
    4241
     
    7978{
    8079    unsigned i;
    81     for (i = 0; i < ELEMENTS(g_aStatusMsgs); i++)
    82     {
     80    for (i = 0; i < RT_ELEMENTS(g_aStatusMsgs); i++)
    8381        if (g_aStatusMsgs[i].iCode == rc)
    84         {
    8582            return &g_aStatusMsgs[i];
    86         }
    87     }
    8883
    8984    /*
    9085     * Need to use the temporary stuff.
    9186     */
    92     int iMsg = ASMAtomicXchgU32(&g_iUnknownMsgs, (g_iUnknownMsgs + 1) % ELEMENTS(g_aUnknownMsgs));
     87    int32_t iMsg = (ASMAtomicIncU32(&g_iUnknownMsgs) - 1) % RT_ELEMENTS(g_aUnknownMsgs);
    9388    RTStrPrintf(&g_aszUnknownStr[iMsg][0], sizeof(g_aszUnknownStr[iMsg]), "Unknown Status 0x%X\n", rc);
    9489    return &g_aUnknownMsgs[iMsg];
    9590}
     91
     92
     93RTDECL(PCRTCOMERRMSG) RTErrCOMGet(uint32_t rc)
     94{
     95    return RTErrWinGet((long)rc);
     96}
     97
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette