crypt32: Input parameter checking.
This commit is contained in:
parent
93825eab3e
commit
c8da5149d0
|
@ -383,6 +383,13 @@ BOOL WINAPI CryptSIPLoad
|
||||||
(const GUID *pgSubject, DWORD dwFlags, SIP_DISPATCH_INFO *pSipDispatch)
|
(const GUID *pgSubject, DWORD dwFlags, SIP_DISPATCH_INFO *pSipDispatch)
|
||||||
{
|
{
|
||||||
FIXME("(%s %d %p) stub!\n", debugstr_guid(pgSubject), dwFlags, pSipDispatch);
|
FIXME("(%s %d %p) stub!\n", debugstr_guid(pgSubject), dwFlags, pSipDispatch);
|
||||||
|
|
||||||
|
if (!pgSubject || dwFlags != 0 || !pSipDispatch)
|
||||||
|
{
|
||||||
|
SetLastError(ERROR_INVALID_PARAMETER);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -272,17 +272,15 @@ static void test_SIPLoad(void)
|
||||||
SetLastError(0xdeadbeef);
|
SetLastError(0xdeadbeef);
|
||||||
ret = CryptSIPLoad(NULL, 0, NULL);
|
ret = CryptSIPLoad(NULL, 0, NULL);
|
||||||
ok ( !ret, "Expected CryptSIPLoad to fail\n");
|
ok ( !ret, "Expected CryptSIPLoad to fail\n");
|
||||||
todo_wine
|
ok ( GetLastError() == ERROR_INVALID_PARAMETER,
|
||||||
ok ( GetLastError() == ERROR_INVALID_PARAMETER,
|
"Expected ERROR_INVALID_PARAMETER, got 0x%08x\n", GetLastError());
|
||||||
"Expected ERROR_INVALID_PARAMETER, got 0x%08x\n", GetLastError());
|
|
||||||
|
|
||||||
/* Only pSipDispatch NULL */
|
/* Only pSipDispatch NULL */
|
||||||
SetLastError(0xdeadbeef);
|
SetLastError(0xdeadbeef);
|
||||||
ret = CryptSIPLoad(&subject, 0, NULL);
|
ret = CryptSIPLoad(&subject, 0, NULL);
|
||||||
ok ( !ret, "Expected CryptSIPLoad to fail\n");
|
ok ( !ret, "Expected CryptSIPLoad to fail\n");
|
||||||
todo_wine
|
ok ( GetLastError() == ERROR_INVALID_PARAMETER,
|
||||||
ok ( GetLastError() == ERROR_INVALID_PARAMETER,
|
"Expected ERROR_INVALID_PARAMETER, got 0x%08x\n", GetLastError());
|
||||||
"Expected ERROR_INVALID_PARAMETER, got 0x%08x\n", GetLastError());
|
|
||||||
|
|
||||||
/* No NULLs, but nonexistent pgSubject */
|
/* No NULLs, but nonexistent pgSubject */
|
||||||
SetLastError(0xdeadbeef);
|
SetLastError(0xdeadbeef);
|
||||||
|
@ -405,9 +403,8 @@ static void test_SIPLoad(void)
|
||||||
sdi.pfGet = (pCryptSIPGetSignedDataMsg)0xdeadbeef;
|
sdi.pfGet = (pCryptSIPGetSignedDataMsg)0xdeadbeef;
|
||||||
ret = CryptSIPLoad(&unknown, 1, &sdi);
|
ret = CryptSIPLoad(&unknown, 1, &sdi);
|
||||||
ok ( !ret, "Expected CryptSIPLoad to fail\n");
|
ok ( !ret, "Expected CryptSIPLoad to fail\n");
|
||||||
todo_wine
|
ok ( GetLastError() == ERROR_INVALID_PARAMETER,
|
||||||
ok ( GetLastError() == ERROR_INVALID_PARAMETER,
|
"Expected ERROR_INVALID_PARAMETER, got 0x%08x\n", GetLastError());
|
||||||
"Expected ERROR_INVALID_PARAMETER, got 0x%08x\n", GetLastError());
|
|
||||||
ok( sdi.pfGet == (pCryptSIPGetSignedDataMsg)0xdeadbeef, "Expected no change to the function pointer\n");
|
ok( sdi.pfGet == (pCryptSIPGetSignedDataMsg)0xdeadbeef, "Expected no change to the function pointer\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue