Commit 62df03af authored by Serge Gautherie's avatar Serge Gautherie Committed by Alexandre Julliard

advapi32: Use standard refcount in CRYPTPROV.

parent 9cc8b501
......@@ -636,7 +636,7 @@ BOOL WINAPI CryptContextAddRef (HCRYPTPROV hProv, DWORD *pdwReserved, DWORD dwFl
return FALSE;
}
pProv->refcount++;
InterlockedIncrement(&pProv->refcount);
return TRUE;
}
......@@ -672,8 +672,7 @@ BOOL WINAPI CryptReleaseContext (HCRYPTPROV hProv, DWORD dwFlags)
return FALSE;
}
pProv->refcount--;
if (pProv->refcount <= 0)
if (InterlockedDecrement(&pProv->refcount) == 0)
{
ret = pProv->pFuncs->pCPReleaseContext(pProv->hPrivate, dwFlags);
pProv->dwMagic = 0;
......
......@@ -63,7 +63,7 @@ typedef struct tagPROVFUNCS
typedef struct tagCRYPTPROV
{
DWORD dwMagic;
UINT refcount;
LONG refcount;
HMODULE hModule;
PPROVFUNCS pFuncs;
HCRYPTPROV hPrivate; /*CSP's handle - Should not be given to application under any circumstances!*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment