Changeset 146 for trunk/Utilities


Ignore:
Timestamp:
Nov 18, 2012, 9:35:14 AM (11 years ago)
Author:
roman
Message:

Added FACILITY_AUDCLNT

Location:
trunk/Utilities/ShowHresult
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Utilities/ShowHresult/NotifyIconWindow.h

    r136 r146  
    1919#include <wia_lh.h> // FACILITY_WIA
    2020#include <corerror.h> // FACILITY_URT
     21#include <audioclient.h> // FACILITY_AUDCLNT
    2122#include "rowinhttp.h"
    2223#include "AboutDialog.h"
     
    149150                        #define A(x) { x, #x },
    150151                        #include "MfIdentifier.inc"
     152                        #undef A
     153                };
     154                for(SIZE_T nIndex = 0; nIndex < DIM(g_pMap); nIndex++)
     155                        if(g_pMap[nIndex].nValue == nValue)
     156                        {
     157                                sIdentifier = CString(g_pMap[nIndex].pszName);
     158                                return TRUE;
     159                        }
     160                return FALSE;
     161        }
     162        static BOOL IsAudioClientResult(HRESULT nResult, CString* psMessage = NULL, CString* psIdentifier = NULL)
     163        {
     164                if(HRESULT_FACILITY(nResult) != FACILITY_AUDCLNT)
     165                        return FALSE;
     166                psMessage;
     167                CString sIdentifier;
     168                if(!LookupAudioClientIdentifier(nResult, sIdentifier))
     169                        return FALSE;
     170                if(psIdentifier)
     171                        *psIdentifier = sIdentifier;
     172                return TRUE;
     173        }
     174        static BOOL LookupAudioClientIdentifier(HRESULT nValue, CString& sIdentifier)
     175        {
     176                static const struct { HRESULT nValue; LPCSTR pszName; } g_pMap[] =
     177                {
     178                        #define A(x) { x, #x },
     179                        #include "AudioClientIdentifier.inc"
    151180                        #undef A
    152181                };
     
    524553                        LookupMfIdentifier(nResult, sIdentifier);
    525554                        sTitle = _T("Media Foundation");
    526                 }
     555                } else if(IsAudioClientResult(nResult, &sMessage, &sIdentifier) || LookupAudioClientIdentifier(nResult, sIdentifier))
     556                        sTitle = _T("Audio Client");
    527557                #pragma region Obsolete?
    528558                // NOTE: These are perhaps useless in Windows 7, but I am under impression they are helpful in earlier systems
  • trunk/Utilities/ShowHresult/ShowHresult.vcxproj

    r136 r146  
    291291  </ItemGroup>
    292292  <ItemGroup>
     293    <None Include="AudioClientIdentifier.inc" />
    293294    <None Include="WmIdentifier.inc">
    294295      <FileType>Document</FileType>
  • trunk/Utilities/ShowHresult/ShowHresult.vcxproj.filters

    r136 r146  
    9595      <Filter>Header Files</Filter>
    9696    </None>
     97    <None Include="AudioClientIdentifier.inc">
     98      <Filter>Header Files\Include Files</Filter>
     99    </None>
    97100  </ItemGroup>
    98101  <ItemGroup>
Note: See TracChangeset for help on using the changeset viewer.