crypt32: Check the result of CryptAcquireContextW() when initializing default provider.

This commit is contained in:
Paul Chitescu 2009-11-06 14:18:14 +02:00 committed by Alexandre Julliard
parent 15d7b7b777
commit 7223d8b6d2
1 changed files with 3 additions and 2 deletions

View File

@ -64,8 +64,9 @@ HCRYPTPROV CRYPT_GetDefaultProvider(void)
{
HCRYPTPROV prov;
CryptAcquireContextW(&prov, NULL, MS_ENHANCED_PROV_W, PROV_RSA_FULL,
CRYPT_VERIFYCONTEXT);
if (!CryptAcquireContextW(&prov, NULL, MS_ENHANCED_PROV_W, PROV_RSA_FULL,
CRYPT_VERIFYCONTEXT))
return hDefProv;
InterlockedCompareExchangePointer((PVOID *)&hDefProv, (PVOID)prov,
NULL);
if (hDefProv != prov)