[PATCH 2/5] advapi32: CRYPTPROV.refcount is a UINT, so >= 0, in CryptReleaseContext().

Zhiyi Zhang zzhang at codeweavers.com
Thu Mar 12 02:49:43 CDT 2020



On 3/12/20 1:44 PM, Serge Gautherie wrote:
> Signed-off-by: Serge Gautherie <winehq-git_serge_180711 at gautherie.fr>
> ---
>  dlls/advapi32/crypt.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/dlls/advapi32/crypt.c b/dlls/advapi32/crypt.c
> index 9ede750..e94ee34 100644
> --- a/dlls/advapi32/crypt.c
> +++ b/dlls/advapi32/crypt.c
> @@ -673,7 +673,7 @@ BOOL WINAPI CryptReleaseContext (HCRYPTPROV hProv, DWORD dwFlags)
>  	}
>  
>  	pProv->refcount--;
Let's make refcount use atomic operations as well.
> -	if (pProv->refcount <= 0) 
> +    if (pProv->refcount == 0)
>  	{
>  		ret = pProv->pFuncs->pCPReleaseContext(pProv->hPrivate, dwFlags);
>  		pProv->dwMagic = 0;




More information about the wine-devel mailing list