- Timestamp:
- Dec 4, 2012, 3:03:40 AM (11 years ago)
- Location:
- trunk/Utilities/ShowHresult
- Files:
-
- 1 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Utilities/ShowHresult/NotifyIconWindow.h
r151 r153 21 21 #include <audioclient.h> // FACILITY_AUDCLNT 22 22 #include <p2p.h> // FACILITY_P2P 23 #include <slerror.h> // FACILITY_SL_ITF 23 24 24 25 #include <adserr.h> … … 444 445 #define A(x) { x, #x }, 445 446 #include "P2pIdentifier.inc" 447 #undef A 448 }; 449 for(SIZE_T nIndex = 0; nIndex < DIM(g_pMap); nIndex++) 450 if(g_pMap[nIndex].nValue == nValue) 451 { 452 sIdentifier = CString(g_pMap[nIndex].pszName); 453 return TRUE; 454 } 455 return FALSE; 456 } 457 static BOOL IsSlResult(HRESULT nResult, CString* psMessage = NULL, CString* psIdentifier = NULL) 458 { 459 if(HRESULT_FACILITY(nResult) != FACILITY_SL_ITF) 460 return FALSE; 461 psMessage; 462 const CString sMessage = AtlFormatSystemMessage(CDataLibraryMap::LoadLibrary(_T("slc.dll")), nResult); 463 if(psMessage) 464 *psMessage = sMessage; 465 CString sIdentifier; 466 if(!LookupSlIdentifier(nResult, sIdentifier)) 467 if(sMessage.IsEmpty()) 468 return FALSE; 469 if(psIdentifier) 470 *psIdentifier = sIdentifier; 471 return TRUE; 472 } 473 static BOOL LookupSlIdentifier(HRESULT nValue, CString& sIdentifier) 474 { 475 static const struct { HRESULT nValue; LPCSTR pszName; } g_pMap[] = 476 { 477 #define A(x) { x, #x }, 478 #include "SlIdentifier.inc" 446 479 #undef A 447 480 }; … … 630 663 else if(IsP2pResult(nResult, &sMessage, &sIdentifier) || LookupP2pIdentifier(nResult, sIdentifier)) 631 664 sTitle = _T("P2P"); 665 else if(IsSlResult(nResult, &sMessage, &sIdentifier) || LookupSlIdentifier(nResult, sIdentifier)) 666 sTitle = _T("Software Licensing"); 632 667 else 633 668 { -
trunk/Utilities/ShowHresult/ShowHresult.vcxproj
r151 r153 306 306 <ClInclude Include="Resource.h" /> 307 307 <ClInclude Include="ShowHresult_i.h" /> 308 <ClInclude Include="SlIdentifier.inc" /> 308 309 <ClInclude Include="stdafx.h" /> 309 310 <ClInclude Include="targetver.h" /> -
trunk/Utilities/ShowHresult/ShowHresult.vcxproj.filters
r151 r153 48 48 <ClInclude Include="NotifyIconWindow.h"> 49 49 <Filter>Header Files</Filter> 50 </ClInclude> 51 <ClInclude Include="SlIdentifier.inc"> 52 <Filter>Header Files\Include Files</Filter> 50 53 </ClInclude> 51 54 </ItemGroup> -
trunk/Utilities/ShowHresult/ShowHresult_i.c
r151 r153 7 7 8 8 /* File created by MIDL compiler version 7.00.0555 */ 9 /* at Mon Nov 26 13:58:2820129 /* at Tue Dec 04 12:57:03 2012 10 10 */ 11 11 /* Compiler settings for ShowHresult.idl: -
trunk/Utilities/ShowHresult/ShowHresult_i.h
r151 r153 5 5 6 6 /* File created by MIDL compiler version 7.00.0555 */ 7 /* at Mon Nov 26 13:58:2820127 /* at Tue Dec 04 12:57:03 2012 8 8 */ 9 9 /* Compiler settings for ShowHresult.idl:
Note: See TracChangeset
for help on using the changeset viewer.