Set last error if dwFlags are non zero in CPReleaseContext.

Added corresponding test.
This commit is contained in:
Michael Jung 2005-01-05 13:22:37 +00:00 committed by Alexandre Julliard
parent a246306870
commit 974c94f604
2 changed files with 10 additions and 0 deletions

View File

@ -2630,6 +2630,11 @@ BOOL WINAPI RSAENH_CPReleaseContext(HCRYPTPROV hProv, DWORD dwFlags)
return FALSE;
}
if (dwFlags) {
SetLastError(NTE_BAD_FLAGS);
return FALSE;
}
return TRUE;
}

View File

@ -79,6 +79,11 @@ static int init_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);
}