Set last error if dwFlags are non zero in CPReleaseContext.
Added corresponding test.
This commit is contained in:
parent
a246306870
commit
974c94f604
|
@ -2630,6 +2630,11 @@ BOOL WINAPI RSAENH_CPReleaseContext(HCRYPTPROV hProv, DWORD dwFlags)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
if (dwFlags) {
|
||||
SetLastError(NTE_BAD_FLAGS);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue