forked from Mirrors/wine-wine
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>feature/deterministic
parent
9cc8b501ee
commit
62df03af96
|
@ -636,7 +636,7 @@ BOOL WINAPI CryptContextAddRef (HCRYPTPROV hProv, DWORD *pdwReserved, DWORD dwFl
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
pProv->refcount++;
|
InterlockedIncrement(&pProv->refcount);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -672,8 +672,7 @@ BOOL WINAPI CryptReleaseContext (HCRYPTPROV hProv, DWORD dwFlags)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
pProv->refcount--;
|
if (InterlockedDecrement(&pProv->refcount) == 0)
|
||||||
if (pProv->refcount <= 0)
|
|
||||||
{
|
{
|
||||||
ret = pProv->pFuncs->pCPReleaseContext(pProv->hPrivate, dwFlags);
|
ret = pProv->pFuncs->pCPReleaseContext(pProv->hPrivate, dwFlags);
|
||||||
pProv->dwMagic = 0;
|
pProv->dwMagic = 0;
|
||||||
|
|
|
@ -63,7 +63,7 @@ typedef struct tagPROVFUNCS
|
||||||
typedef struct tagCRYPTPROV
|
typedef struct tagCRYPTPROV
|
||||||
{
|
{
|
||||||
DWORD dwMagic;
|
DWORD dwMagic;
|
||||||
UINT refcount;
|
LONG refcount;
|
||||||
HMODULE hModule;
|
HMODULE hModule;
|
||||||
PPROVFUNCS pFuncs;
|
PPROVFUNCS pFuncs;
|
||||||
HCRYPTPROV hPrivate; /*CSP's handle - Should not be given to application under any circumstances!*/
|
HCRYPTPROV hPrivate; /*CSP's handle - Should not be given to application under any circumstances!*/
|
||||||
|
|
Loading…
Reference in New Issue