Juan Lang : crypt32: Pass address of blob to store data rather than message to CDecodeMsg_CopyData .

Alexandre Julliard julliard at winehq.org
Thu Aug 21 10:02:13 CDT 2008


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

Author: Juan Lang <juan.lang at gmail.com>
Date:   Wed Aug 20 12:03:12 2008 -0700

crypt32: Pass address of blob to store data rather than message to CDecodeMsg_CopyData.

---

 dlls/crypt32/msg.c |   22 +++++++++++-----------
 1 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/dlls/crypt32/msg.c b/dlls/crypt32/msg.c
index 22d740e..be12218 100644
--- a/dlls/crypt32/msg.c
+++ b/dlls/crypt32/msg.c
@@ -1518,22 +1518,22 @@ static void CDecodeMsg_Close(HCRYPTMSG hCryptMsg)
     ContextPropertyList_Free(msg->properties);
 }
 
-static BOOL CDecodeMsg_CopyData(CDecodeMsg *msg, const BYTE *pbData,
+static BOOL CDecodeMsg_CopyData(CRYPT_DATA_BLOB *blob, const BYTE *pbData,
  DWORD cbData)
 {
     BOOL ret = TRUE;
 
     if (cbData)
     {
-        if (msg->msg_data.cbData)
-            msg->msg_data.pbData = CryptMemRealloc(msg->msg_data.pbData,
-             msg->msg_data.cbData + cbData);
+        if (blob->cbData)
+            blob->pbData = CryptMemRealloc(blob->pbData,
+             blob->cbData + cbData);
         else
-            msg->msg_data.pbData = CryptMemAlloc(cbData);
-        if (msg->msg_data.pbData)
+            blob->pbData = CryptMemAlloc(cbData);
+        if (blob->pbData)
         {
-            memcpy(msg->msg_data.pbData + msg->msg_data.cbData, pbData, cbData);
-            msg->msg_data.cbData += cbData;
+            memcpy(blob->pbData + blob->cbData, pbData, cbData);
+            blob->cbData += cbData;
         }
         else
             ret = FALSE;
@@ -1768,7 +1768,7 @@ static BOOL CDecodeMsg_Update(HCRYPTMSG hCryptMsg, const BYTE *pbData,
             if (msg->base.open_flags & CMSG_DETACHED_FLAG &&
              msg->base.state != MsgStateDataFinalized)
             {
-                ret = CDecodeMsg_CopyData(msg, pbData, cbData);
+                ret = CDecodeMsg_CopyData(&msg->msg_data, pbData, cbData);
                 msg->base.state = MsgStateDataFinalized;
                 if (ret)
                     ret = CDecodeMsg_DecodeContent(msg, &msg->msg_data,
@@ -1784,7 +1784,7 @@ static BOOL CDecodeMsg_Update(HCRYPTMSG hCryptMsg, const BYTE *pbData,
         }
         else
         {
-            ret = CDecodeMsg_CopyData(msg, pbData, cbData);
+            ret = CDecodeMsg_CopyData(&msg->msg_data, pbData, cbData);
             if (msg->base.state == MsgStateInit)
                 msg->base.state = MsgStateUpdated;
         }
@@ -1797,7 +1797,7 @@ static BOOL CDecodeMsg_Update(HCRYPTMSG hCryptMsg, const BYTE *pbData,
         {
             if (msg->base.state == MsgStateInit)
             {
-                ret = CDecodeMsg_CopyData(msg, pbData, cbData);
+                ret = CDecodeMsg_CopyData(&msg->msg_data, pbData, cbData);
                 if (ret)
                     ret = CDecodeMsg_DecodeContent(msg, &msg->msg_data,
                      msg->type);




More information about the wine-cvs mailing list