crypt32: Fix CryptProtectData tests on older Windows versions.

This commit is contained in:
Juan Lang 2009-01-29 17:01:14 -08:00 committed by Alexandre Julliard
parent 10b7b81e21
commit b5b097fdaa
1 changed files with 13 additions and 6 deletions

View File

@ -69,11 +69,16 @@ static void test_cryptprotectdata(void)
/* without entropy */
SetLastError(0xDEADBEEF);
protected = pCryptProtectData(&plain,desc,NULL,NULL,NULL,0,&cipher);
ok(protected, "Encrypting without entropy.\n");
r = GetLastError();
ok(r == ERROR_SUCCESS ||
r == ERROR_IO_PENDING, /* win2k */
"Expected ERROR_SUCCESS or ERROR_IO_PENDING, got %d\n",r);
ok(protected ||
broken(!protected), /* Win9x/NT4 */
"Encrypting without entropy.\n");
if (protected)
{
r = GetLastError();
ok(r == ERROR_SUCCESS ||
r == ERROR_IO_PENDING, /* win2k */
"Expected ERROR_SUCCESS or ERROR_IO_PENDING, got %d\n",r);
}
cipher_entropy.pbData=NULL;
cipher_entropy.cbData=0;
@ -81,7 +86,9 @@ static void test_cryptprotectdata(void)
/* with entropy */
SetLastError(0xDEADBEEF);
protected = pCryptProtectData(&plain,desc,&entropy,NULL,NULL,0,&cipher_entropy);
ok(protected, "Encrypting with entropy.\n");
ok(protected ||
broken(!protected), /* Win9x/NT4 */
"Encrypting with entropy.\n");
cipher_no_desc.pbData=NULL;
cipher_no_desc.cbData=0;