Ignore:
Timestamp:
May 15, 2015, 12:47:44 AM (7 years ago)
Author:
roman
Message:

VS2013 related updates; use of CSIDL_LOCAL_APPDATA instead of CSIDL_APPDATA for fallback log writes; added bitness and privilege indication in all captions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/DirectShowSpy/Common.h

    r376 r432  
    141141{
    142142        _Z2(atlTraceRegistrar, 2, _T("TreatAsClassIdentifier %ls, bRegister %d\n"), _PersistHelper::StringFromIdentifier(TreatAsClassIdentifier), bRegister);
    143         // NOTE: Registration is much more sophisticated starting Vista operating system
    144         const ULONG nOsVersion = GetOsVersion();
    145         _Z4(atlTraceRegistrar, 4, _T("nOsVersion 0x%08x\n"), nOsVersion);
     143        // NOTE: Registration is more sophisticated starting Vista operating system
     144        const BOOL bAdjustProcessTokenPrivileges = IsWindowsVistaOrGreater();
     145        _Z4(atlTraceRegistrar, 4, _T("bAdjustProcessTokenPrivileges %d\n"), bAdjustProcessTokenPrivileges);
    146146        CProcessTokenPrivileges ProcessTokenPrivileges;
    147         if(nOsVersion >= 0x060000) // Win Vista+
     147        if(bAdjustProcessTokenPrivileges)
    148148                _ATLTRY
    149149                {
     
    157157        const HRESULT nCoGetTreatAsClassResult = CoGetTreatAsClass(TreatAsClassIdentifier, &CurrentTreatAsClassIdentifier);
    158158        __C(nCoGetTreatAsClassResult);
    159         _Z4(atlTraceRegistrar, 4, _T("bRegister %d, nCoGetTreatAsClassResult 0x%08x, CurrentTreatAsClassIdentifier %ls\n"), bRegister, nCoGetTreatAsClassResult, _PersistHelper::StringFromIdentifier(CurrentTreatAsClassIdentifier));
     159        _Z4(atlTraceRegistrar, 4, _T("bRegister %d, nCoGetTreatAsClassResult 0x%08X, CurrentTreatAsClassIdentifier %ls\n"), bRegister, nCoGetTreatAsClassResult, _PersistHelper::StringFromIdentifier(CurrentTreatAsClassIdentifier));
    160160        __D(!bRegister || nCoGetTreatAsClassResult != S_OK || CurrentTreatAsClassIdentifier == T::GetObjectCLSID(), E_UNNAMED);
    161161        CClassIdentifierRegKeySecurity ClassIdentifierRegKeySecurity(TreatAsClassIdentifier);
    162162        if(!bRegister && nCoGetTreatAsClassResult == S_OK)
    163163        {
    164                 if(nOsVersion >= 0x060000) // Win Vista+
     164                if(bAdjustProcessTokenPrivileges)
    165165                        ClassIdentifierRegKeySecurity.Adjust();
    166166                __C(CoTreatAsClass(TreatAsClassIdentifier, CLSID_NULL));
     
    170170        if(bRegister)
    171171        {
    172                 if(nOsVersion >= 0x060000) // Win Vista+
     172                if(bAdjustProcessTokenPrivileges)
    173173                        ClassIdentifierRegKeySecurity.Adjust();
    174174                #if _DEVELOPMENT
    175175                        const HRESULT nCoTreatAsClassResult = CoTreatAsClass(TreatAsClassIdentifier, T::GetObjectCLSID());
    176                         _Z2(atlTraceRegistrar, SUCCEEDED(nCoTreatAsClassResult) ? 4 : 2, _T("nCoTreatAsClassResult 0x%08x\n"), nCoTreatAsClassResult);
     176                        _Z2(atlTraceRegistrar, SUCCEEDED(nCoTreatAsClassResult) ? 4 : 2, _T("nCoTreatAsClassResult 0x%08X\n"), nCoTreatAsClassResult);
    177177                        __C(nCoTreatAsClassResult);
    178178                        const HRESULT nCoGetTreatAsClassResult = CoGetTreatAsClass(TreatAsClassIdentifier, &CurrentTreatAsClassIdentifier);
    179                         _Z4(atlTraceRegistrar, 4, _T("nCoGetTreatAsClassResult 0x%08x, CurrentTreatAsClassIdentifier %ls\n"), nCoGetTreatAsClassResult, _PersistHelper::StringFromIdentifier(CurrentTreatAsClassIdentifier));
     179                        _Z4(atlTraceRegistrar, 4, _T("nCoGetTreatAsClassResult 0x%08X, CurrentTreatAsClassIdentifier %ls\n"), nCoGetTreatAsClassResult, _PersistHelper::StringFromIdentifier(CurrentTreatAsClassIdentifier));
    180180                        _A(CurrentTreatAsClassIdentifier == T::GetObjectCLSID());
    181181                #else
Note: See TracChangeset for help on using the changeset viewer.