advapi32: CryptAcquireContext(CRYPT_DELETEKEYSET) should set returned provider handle to 0.

Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Dmitry Timoshkov 2019-03-12 15:19:11 +08:00 committed by Alexandre Julliard
parent b13b8ccc1f
commit cd5c9a2bed
2 changed files with 1 additions and 2 deletions

View File

@ -523,6 +523,7 @@ BOOL WINAPI CryptAcquireContextW (HCRYPTPROV *phProv, LPCWSTR pszContainer,
*/
if (dwFlags & CRYPT_DELETEKEYSET)
{
*phProv = 0;
pProv->dwMagic = 0;
FreeLibrary(pProv->hModule);
CRYPT_Free(provnameA);

View File

@ -273,7 +273,6 @@ static void test_incorrect_api_usage(void)
result = pCryptAcquireContextA(&hProv2, szBadKeySet, NULL, PROV_RSA_FULL,
CRYPT_DELETEKEYSET);
ok (result, "%d\n", GetLastError());
todo_wine
ok (hProv2 == 0, "%ld\n", hProv2);
if (!result) return;
@ -1183,7 +1182,6 @@ static void test_container_sd(void)
ret = CryptAcquireContextA(&prov, "winetest", "Microsoft Enhanced Cryptographic Provider v1.0",
PROV_RSA_FULL, CRYPT_MACHINE_KEYSET|CRYPT_DELETEKEYSET);
ok(ret, "got %u\n", GetLastError());
todo_wine
ok(prov == 0, "got %ld\n", prov);
}