Commit b856884c authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

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

parent cd22aa18
...@@ -1420,11 +1420,6 @@ BOOL WINAPI CryptGenKey (HCRYPTPROV hProv, ALG_ID Algid, DWORD dwFlags, HCRYPTKE ...@@ -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); 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) if (!phKey || !prov || prov->dwMagic != MAGIC_CRYPTPROV)
{ {
SetLastError(ERROR_INVALID_PARAMETER); SetLastError(ERROR_INVALID_PARAMETER);
......
...@@ -238,6 +238,9 @@ static void test_incorrect_api_usage(void) ...@@ -238,6 +238,9 @@ static void test_incorrect_api_usage(void)
if (!result) return; if (!result) return;
pCryptDestroyHash(hHash); 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); result = pCryptGenKey(hProv, CALG_RC4, 0, &hKey);
ok (result, "%d\n", GetLastError()); ok (result, "%d\n", GetLastError());
if (!result) return; if (!result) return;
......
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