Changeset 21967 for trunk/src


Ignore:
Timestamp:
Feb 9, 2012, 2:34:40 PM (14 years ago)
Author:
dmik
Message:

Don't access debug fields in CRITICAL_SECTION in release builds.

This fixes occasional crashes in CRYPT32.DLL (e.g. when playing back
some Flash contents).

Location:
trunk/src
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/crypt32/collectionstore.c

    r21354 r21967  
    6060        CryptMemFree(entry);
    6161    }
     62#ifdef DEBUG
    6263    cs->cs.DebugInfo->Spare[0] = 0;
     64#endif
    6365    DeleteCriticalSection((CRITICAL_SECTION*)&cs->cs);
    6466    CRYPT_FreeStore((PWINECRYPT_CERTSTORE)store);
     
    453455            store->hdr.ctls.deleteContext  = CRYPT_CollectionDeleteCTL;
    454456            InitializeCriticalSection((CRITICAL_SECTION*)&store->cs);
     457#ifdef DEBUG
    455458            store->cs.DebugInfo->Spare[0] = (DWORD)(DWORD_PTR)(__FILE__ ": PWINE_COLLECTIONSTORE->cs");
     459#endif
    456460            list_init(&store->stores);
    457461        }
  • trunk/src/crypt32/context.c

    r21354 r21967  
    198198        list->contextSize = contextSize;
    199199        InitializeCriticalSection((CRITICAL_SECTION*)&list->cs);
     200#ifdef DEBUG
    200201        list->cs.DebugInfo->Spare[0] = (DWORD)(DWORD_PTR)(__FILE__ ": ContextList.cs");
     202#endif
    201203        list_init(&list->contexts);
    202204    }
     
    310312{
    311313    ContextList_Empty(list);
     314#ifdef DEBUG
    312315    list->cs.DebugInfo->Spare[0] = 0;
     316#endif
    313317    DeleteCriticalSection((CRITICAL_SECTION*)&list->cs);
    314318    CryptMemFree(list);
  • trunk/src/crypt32/oid.c

    r21916 r21967  
    106106            CryptMemFree(functionCursor);
    107107        }
     108#ifdef DEBUG
    108109        setCursor->cs.DebugInfo->Spare[0] = 0;
     110#endif
    109111        DeleteCriticalSection((CRITICAL_SECTION*)&setCursor->cs);
    110112        CryptMemFree(setCursor);
     
    141143            {
    142144                InitializeCriticalSection((CRITICAL_SECTION*)&ret->cs);
     145#ifdef DEBUG
    143146                ret->cs.DebugInfo->Spare[0] = (DWORD)(DWORD_PTR)(__FILE__ ": OIDFunctionSet.cs");
     147#endif
    144148                list_init(&ret->functions);
    145149                strcpy(ret->name, pszFuncName);
  • trunk/src/crypt32/proplist.c

    r21354 r21967  
    4949    {
    5050        InitializeCriticalSection((CRITICAL_SECTION*)&list->cs);
     51#if DEBUG
    5152        list->cs.DebugInfo->Spare[0] = (DWORD)(DWORD_PTR)(__FILE__ ": PCONTEXT_PROPERTY_LIST->cs");
     53#endif
    5254        list_init(&list->properties);
    5355    }
     
    6668        CryptMemFree(prop);
    6769    }
     70#if DEBUG
    6871    list->cs.DebugInfo->Spare[0] = 0;
     72#endif
    6973    DeleteCriticalSection((CRITICAL_SECTION*)&list->cs);
    7074    CryptMemFree(list);
  • trunk/src/crypt32/regstore.c

    r21354 r21967  
    328328    CRYPT_RegFlushStore(store, FALSE);
    329329    RegCloseKey(store->key);
     330#ifdef DEBUG
    330331    store->cs.DebugInfo->Spare[0] = 0;
     332#endif
    331333    DeleteCriticalSection((CRITICAL_SECTION*)&store->cs);
    332334    CryptMemFree(store);
     
    549551                    regInfo->key = key;
    550552                    InitializeCriticalSection((CRITICAL_SECTION*)&regInfo->cs);
     553#ifdef DEBUG
    551554                    regInfo->cs.DebugInfo->Spare[0] = (DWORD)(DWORD_PTR)(__FILE__ ": PWINE_REGSTOREINFO->cs");
     555#endif
    552556                    list_init(&regInfo->certsToDelete);
    553557                    list_init(&regInfo->crlsToDelete);
  • trunk/src/rsaenh/handle.c

    r21494 r21967  
    5959    lpTable->iFirstFree = 0;
    6060    InitializeCriticalSection(&lpTable->mutex);
    61     //lpTable->mutex.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": HANDLETBL.mutex");
     61#ifdef DEBUG
     62    lpTable->mutex.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": HANDLETBL.mutex");
     63#endif
    6264}
    6365
     
    7880       
    7981    HeapFree(GetProcessHeap(), 0, lpTable->paEntries);
    80     //lpTable->mutex.DebugInfo->Spare[0] = 0;
     82#ifdef DEBUG
     83    lpTable->mutex.DebugInfo->Spare[0] = 0;
     84#endif
    8185    DeleteCriticalSection(&lpTable->mutex);
    8286}
  • trunk/src/secur32/secur32.c

    r21916 r21967  
    559559    TRACE("\n");
    560560    InitializeCriticalSection(&cs);
    561     //cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": cs");
     561#ifdef DEBUG
     562    cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": cs");
     563#endif
    562564    /* First load built-in providers */
    563565    SECUR32_initSchannelSP();
     
    707709
    708710    LeaveCriticalSection(&cs);
    709     //cs.DebugInfo->Spare[0] = 0;
     711#ifdef DEBUG
     712    cs.DebugInfo->Spare[0] = 0;
     713#endif
    710714    DeleteCriticalSection(&cs);
    711715}
Note: See TracChangeset for help on using the changeset viewer.