advapi32: Use standard refcount in CRYPTPROV.
Signed-off-by: Serge Gautherie <winehq-git_serge_180711@gautherie.fr> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
9cc8b501ee
commit
62df03af96
|
@ -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!*/
|
||||
|
|
Loading…
Reference in New Issue