Commit cf770571 authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

dssenh: Return NTE_BAD_KEYSET when key cannot be opened.

parent c5bdc240
......@@ -284,7 +284,8 @@ BOOL WINAPI CPAcquireContext( HCRYPTPROV *ret_prov, LPSTR container, DWORD flags
{
case 0:
case 0 | CRYPT_MACHINE_KEYSET:
ret = read_key_container( name, flags );
if (!(ret = read_key_container( name, flags )))
SetLastError( NTE_BAD_KEYSET );
break;
case CRYPT_NEWKEYSET:
......
......@@ -75,7 +75,7 @@ static void test_acquire_context(void)
result = CryptAcquireContextA(&hProv, NULL, NULL, PROV_DSS, 0);
if (!result)
{
todo_wine ok(GetLastError() == NTE_BAD_KEYSET, "Expected NTE_BAD_KEYSET, got %08x\n", GetLastError());
ok(GetLastError() == NTE_BAD_KEYSET, "Expected NTE_BAD_KEYSET, got %08x\n", GetLastError());
SetLastError(0xdeadbeef);
result = CryptAcquireContextA(&hProv, NULL, NULL, PROV_DSS, CRYPT_NEWKEYSET);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment