Paul Vriens : crypt32/tests: Prevent a crash on Win9x (test_data_msg).

Alexandre Julliard julliard at winehq.org
Mon Feb 23 10:00:44 CST 2009


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

Author: Paul Vriens <Paul.Vriens.Wine at gmail.com>
Date:   Mon Feb 23 11:54:39 2009 +0100

crypt32/tests: Prevent a crash on Win9x (test_data_msg).

---

 dlls/crypt32/tests/msg.c |   28 ++++++++++++++++------------
 1 files changed, 16 insertions(+), 12 deletions(-)

diff --git a/dlls/crypt32/tests/msg.c b/dlls/crypt32/tests/msg.c
index 8913db4..40f6dfe 100644
--- a/dlls/crypt32/tests/msg.c
+++ b/dlls/crypt32/tests/msg.c
@@ -413,18 +413,22 @@ static void test_data_msg_update(void)
     ok(ret, "CryptMsgUpdate failed: %x\n", GetLastError());
     CryptMsgClose(msg);
 
-    /* Calling update after opening with an empty stream info (with a bogus
-     * output function) yields an error:
-     */
-    msg = CryptMsgOpenToEncode(PKCS_7_ASN_ENCODING, 0, CMSG_DATA, NULL, NULL,
-     &streamInfo);
-    SetLastError(0xdeadbeef);
-    ret = CryptMsgUpdate(msg, msgData, sizeof(msgData), FALSE);
-    ok(!ret && (GetLastError() == STATUS_ACCESS_VIOLATION ||
-     GetLastError() == STATUS_ILLEGAL_INSTRUCTION /* WinME */),
-     "Expected STATUS_ACCESS_VIOLATION or STATUS_ILLEGAL_INSTRUCTION, got %x\n",
-     GetLastError());
-    CryptMsgClose(msg);
+    if (have_nt)
+    {
+        /* Calling update after opening with an empty stream info (with a bogus
+         * output function) yields an error:
+         */
+        /* Crashes on some Win9x */
+        msg = CryptMsgOpenToEncode(PKCS_7_ASN_ENCODING, 0, CMSG_DATA, NULL, NULL,
+         &streamInfo);
+        SetLastError(0xdeadbeef);
+        ret = CryptMsgUpdate(msg, msgData, sizeof(msgData), FALSE);
+        ok(!ret && (GetLastError() == STATUS_ACCESS_VIOLATION ||
+         GetLastError() == STATUS_ILLEGAL_INSTRUCTION /* WinME */),
+         "Expected STATUS_ACCESS_VIOLATION or STATUS_ILLEGAL_INSTRUCTION, got %x\n",
+         GetLastError());
+        CryptMsgClose(msg);
+    }
     /* Calling update with a valid output function succeeds, even if the data
      * exceeds the size specified in the stream info.
      */




More information about the wine-cvs mailing list