Juan Lang : crypt32: Add an update function, use it to implement CryptMsgUpdate.

Alexandre Julliard julliard at wine.codeweavers.com
Fri Jun 29 08:14:38 CDT 2007


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

Author: Juan Lang <juan.lang at gmail.com>
Date:   Thu Jun 28 16:51:47 2007 -0700

crypt32: Add an update function, use it to implement CryptMsgUpdate.

---

 dlls/crypt32/msg.c       |   13 +++++++++++--
 dlls/crypt32/tests/msg.c |    2 ++
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/dlls/crypt32/msg.c b/dlls/crypt32/msg.c
index 3c28230..5368515 100644
--- a/dlls/crypt32/msg.c
+++ b/dlls/crypt32/msg.c
@@ -32,11 +32,15 @@ typedef void (*CryptMsgCloseFunc)(HCRYPTMSG msg);
 typedef BOOL (*CryptMsgGetParamFunc)(HCRYPTMSG hCryptMsg, DWORD dwParamType,
  DWORD dwIndex, void *pvData, DWORD *pcbData);
 
+typedef BOOL (*CryptMsgUpdateFunc)(HCRYPTMSG hCryptMsg, const BYTE *pbData,
+ DWORD cbData, BOOL fFinal);
+
 typedef struct _CryptMsgBase
 {
     LONG                 ref;
     DWORD                open_flags;
     CryptMsgCloseFunc    close;
+    CryptMsgUpdateFunc   update;
     CryptMsgGetParamFunc get_param;
 } CryptMsgBase;
 
@@ -171,8 +175,13 @@ BOOL WINAPI CryptMsgClose(HCRYPTMSG hCryptMsg)
 BOOL WINAPI CryptMsgUpdate(HCRYPTMSG hCryptMsg, const BYTE *pbData,
  DWORD cbData, BOOL fFinal)
 {
-    FIXME("(%p, %p, %d, %d): stub\n", hCryptMsg, pbData, cbData, fFinal);
-    return TRUE;
+    CryptMsgBase *msg = (CryptMsgBase *)hCryptMsg;
+    BOOL ret = FALSE;
+
+    TRACE("(%p, %p, %d, %d)\n", hCryptMsg, pbData, cbData, fFinal);
+    if (msg && msg->update)
+        ret = msg->update(hCryptMsg, pbData, cbData, fFinal);
+    return ret;
 }
 
 BOOL WINAPI CryptMsgGetParam(HCRYPTMSG hCryptMsg, DWORD dwParamType,
diff --git a/dlls/crypt32/tests/msg.c b/dlls/crypt32/tests/msg.c
index 9d7c3c6..df5e83f 100644
--- a/dlls/crypt32/tests/msg.c
+++ b/dlls/crypt32/tests/msg.c
@@ -314,6 +314,7 @@ static void test_data_msg_update(void)
      "Expected CRYPT_E_MSG_ERROR, got %x\n", GetLastError());
     /* Updating it with final = TRUE succeeds */
     ret = CryptMsgUpdate(msg, msgData, sizeof(msgData), TRUE);
+    todo_wine
     ok(ret, "CryptMsgUpdate failed: %x\n", GetLastError());
     /* Any subsequent update will fail, as the last was final */
     SetLastError(0xdeadbeef);
@@ -354,6 +355,7 @@ static void test_data_msg_update(void)
     ok(!ret && GetLastError() == E_INVALIDARG,
      "Expected E_INVALIDARG, got %x\n", GetLastError());
     ret = CryptMsgUpdate(msg, msgData, sizeof(msgData), TRUE);
+    todo_wine
     ok(ret, "CryptMsgUpdate failed: %x\n", GetLastError());
     CryptMsgClose(msg);
 }




More information about the wine-cvs mailing list