Commit 974c94f6 authored by Michael Jung's avatar Michael Jung Committed by Alexandre Julliard

Set last error if dwFlags are non zero in CPReleaseContext.

Added corresponding test.
parent a2463068
...@@ -2630,6 +2630,11 @@ BOOL WINAPI RSAENH_CPReleaseContext(HCRYPTPROV hProv, DWORD dwFlags) ...@@ -2630,6 +2630,11 @@ BOOL WINAPI RSAENH_CPReleaseContext(HCRYPTPROV hProv, DWORD dwFlags)
return FALSE; return FALSE;
} }
if (dwFlags) {
SetLastError(NTE_BAD_FLAGS);
return FALSE;
}
return TRUE; return TRUE;
} }
......
...@@ -79,6 +79,11 @@ static int init_environment(void) ...@@ -79,6 +79,11 @@ static int init_environment(void)
static void clean_up_environment(void) static void clean_up_environment(void)
{ {
BOOL result;
result = CryptReleaseContext(hProv, 1);
ok(!result && GetLastError()==NTE_BAD_FLAGS, "%08lx\n", GetLastError());
CryptAcquireContext(&hProv, szContainer, szProvider, PROV_RSA_FULL, CRYPT_DELETEKEYSET); CryptAcquireContext(&hProv, szContainer, szProvider, PROV_RSA_FULL, CRYPT_DELETEKEYSET);
} }
......
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