advapi32: Remove wrong "is NULL and error out" code (coccicheck).

This commit is contained in:
Michael Stefaniuc 2011-06-05 23:33:47 +02:00 committed by Alexandre Julliard
parent cd22aa18a6
commit b856884c3b
2 changed files with 3 additions and 5 deletions

View File

@ -1420,11 +1420,6 @@ BOOL WINAPI CryptGenKey (HCRYPTPROV hProv, ALG_ID Algid, DWORD dwFlags, HCRYPTKE
TRACE("(0x%lx, %d, %08x, %p)\n", hProv, Algid, dwFlags, phKey);
if (!prov)
{
SetLastError(ERROR_INVALID_HANDLE);
return FALSE;
}
if (!phKey || !prov || prov->dwMagic != MAGIC_CRYPTPROV)
{
SetLastError(ERROR_INVALID_PARAMETER);

View File

@ -238,6 +238,9 @@ static void test_incorrect_api_usage(void)
if (!result) return;
pCryptDestroyHash(hHash);
result = pCryptGenKey(0, CALG_RC4, 0, &hKey);
ok (!result && GetLastError() == ERROR_INVALID_PARAMETER, "%d\n", GetLastError());
result = pCryptGenKey(hProv, CALG_RC4, 0, &hKey);
ok (result, "%d\n", GetLastError());
if (!result) return;