Juan Lang : crypt32: Fix CryptProtectData tests on older Windows versions.

Alexandre Julliard julliard at winehq.org
Fri Jan 30 07:58:17 CST 2009


Module: wine
Branch: master
Commit: b5b097fdaaa1c453bd4cfbb5ea55ef26fc722bc5
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=b5b097fdaaa1c453bd4cfbb5ea55ef26fc722bc5

Author: Juan Lang <juan.lang at gmail.com>
Date:   Thu Jan 29 17:01:14 2009 -0800

crypt32: Fix CryptProtectData tests on older Windows versions.

---

 dlls/crypt32/tests/protectdata.c |   19 +++++++++++++------
 1 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/dlls/crypt32/tests/protectdata.c b/dlls/crypt32/tests/protectdata.c
index 30b55b4..97b08c5 100644
--- a/dlls/crypt32/tests/protectdata.c
+++ b/dlls/crypt32/tests/protectdata.c
@@ -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;




More information about the wine-cvs mailing list