crypt32(1/10): Pass function pointers to CryptMsgBase_Init...
Juan Lang
juan.lang at gmail.com
Mon Jul 9 13:48:41 CDT 2007
rather than rely on callers to initialize them
--Juan
-------------- next part --------------
From 1847efe746e37fa4f85c88381145218e8971576a Mon Sep 17 00:00:00 2001
From: Juan Lang <juanlang at juan.corp.google.com>
Date: Mon, 9 Jul 2007 10:50:48 -0700
Subject: [PATCH] Pass function pointers to CryptMsgBase_Init rather than rely on callers to
initialize them
---
dlls/crypt32/msg.c | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/dlls/crypt32/msg.c b/dlls/crypt32/msg.c
index 4ac5cf0..f5f1491 100644
--- a/dlls/crypt32/msg.c
+++ b/dlls/crypt32/msg.c
@@ -47,11 +47,15 @@ typedef struct _CryptMsgBase
} CryptMsgBase;
static inline void CryptMsgBase_Init(CryptMsgBase *msg, DWORD dwFlags,
- PCMSG_STREAM_INFO pStreamInfo)
+ PCMSG_STREAM_INFO pStreamInfo, CryptMsgCloseFunc close,
+ CryptMsgGetParamFunc get_param, CryptMsgUpdateFunc update)
{
msg->ref = 1;
msg->open_flags = dwFlags;
msg->stream_info = pStreamInfo;
+ msg->close = close;
+ msg->get_param = get_param;
+ msg->update = update;
msg->finalized = FALSE;
}
@@ -166,10 +170,8 @@ static HCRYPTMSG CDataEncodeMsg_Open(DWO
msg = CryptMemAlloc(sizeof(CDataEncodeMsg));
if (msg)
{
- CryptMsgBase_Init((CryptMsgBase *)msg, dwFlags, pStreamInfo);
- msg->base.close = CDataEncodeMsg_Close;
- msg->base.update = CDataEncodeMsg_Update;
- msg->base.get_param = CDataEncodeMsg_GetParam;
+ CryptMsgBase_Init((CryptMsgBase *)msg, dwFlags, pStreamInfo,
+ CDataEncodeMsg_Close, CDataEncodeMsg_GetParam, CDataEncodeMsg_Update);
msg->bare_content_len = sizeof(empty_data_content);
msg->bare_content = (LPBYTE)empty_data_content;
}
--
1.4.1
More information about the wine-patches
mailing list