crypt32(9/17): Add a get param function, use it to implement CryptMsgGetParam

Juan Lang juan.lang at gmail.com
Thu Jun 28 19:30:22 CDT 2007


--Juan
-------------- next part --------------
From c3a1bb32b97ddd9e74066c04dc9ad2077d38d417 Mon Sep 17 00:00:00 2001
From: Juan Lang <juanlang at juan.corp.google.com>
Date: Thu, 28 Jun 2007 16:49:55 -0700
Subject: [PATCH] Add a get param function, use it to implement CryptMsgGetParam
---
 dlls/crypt32/msg.c |   19 ++++++++++++++-----
 1 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/dlls/crypt32/msg.c b/dlls/crypt32/msg.c
index d231074..d48a670 100644
--- a/dlls/crypt32/msg.c
+++ b/dlls/crypt32/msg.c
@@ -30,11 +30,15 @@ WINE_DEFAULT_DEBUG_CHANNEL(crypt);
  */
 typedef void (*CryptMsgCloseFunc)(HCRYPTMSG msg);
 
+typedef BOOL (*CryptMsgGetParamFunc)(HCRYPTMSG hCryptMsg, DWORD dwParamType,
+ DWORD dwIndex, void *pvData, DWORD *pcbData);
+
 typedef struct _CryptMsgBase
 {
-    LONG              ref;
-    DWORD             open_flags;
-    CryptMsgCloseFunc close;
+    LONG                 ref;
+    DWORD                open_flags;
+    CryptMsgCloseFunc    close;
+    CryptMsgGetParamFunc get_param;
 } CryptMsgBase;
 
 static inline void CryptMsgBase_Init(CryptMsgBase *msg, DWORD dwFlags)
@@ -178,7 +182,12 @@ BOOL WINAPI CryptMsgUpdate(HCRYPTMSG hCr
 BOOL WINAPI CryptMsgGetParam(HCRYPTMSG hCryptMsg, DWORD dwParamType,
  DWORD dwIndex, void *pvData, DWORD *pcbData)
 {
-    FIXME("(%p, %d, %d, %p, %p): stub\n", hCryptMsg, dwParamType, dwIndex,
+    CryptMsgBase *msg = (CryptMsgBase *)hCryptMsg;
+    BOOL ret = FALSE;
+
+    TRACE("(%p, %d, %d, %p, %p)\n", hCryptMsg, dwParamType, dwIndex,
      pvData, pcbData);
-    return FALSE;
+    if (msg && msg->get_param)
+        ret = msg->get_param(hCryptMsg, dwParamType, dwIndex, pvData, pcbData);
+    return ret;
 }
-- 
1.4.1


More information about the wine-patches mailing list