crypt32(7/10): Implement getting content of a data message
Juan Lang
juan.lang at gmail.com
Tue Jul 17 10:28:11 CDT 2007
--Juan
-------------- next part --------------
From ddb8544dfe5935172bca7aefe87f6de8c268ae6e Mon Sep 17 00:00:00 2001
From: Juan Lang <juanlang at juan.corp.google.com>
Date: Tue, 17 Jul 2007 07:33:01 -0700
Subject: [PATCH] Implement getting content of a data message
---
dlls/crypt32/msg.c | 7 +++++++
dlls/crypt32/tests/msg.c | 6 +++++-
2 files changed, 12 insertions(+), 1 deletions(-)
diff --git a/dlls/crypt32/msg.c b/dlls/crypt32/msg.c
index 4f2aeaa..f5b65de 100644
--- a/dlls/crypt32/msg.c
+++ b/dlls/crypt32/msg.c
@@ -743,6 +743,13 @@ static BOOL CDecodeMsg_GetParam(HCRYPTMS
ret = CRYPT_CopyParam(pvData, pcbData, (const BYTE *)&msg->type,
sizeof(msg->type));
break;
+ case CMSG_CONTENT_PARAM:
+ if (msg->data)
+ ret = CRYPT_CopyParam(pvData, pcbData, msg->data->pbData,
+ msg->data->cbData);
+ else
+ SetLastError(CRYPT_E_INVALID_MSG_TYPE);
+ break;
default:
FIXME("unimplemented for parameter %d\n", dwParamType);
SetLastError(CRYPT_E_INVALID_MSG_TYPE);
diff --git a/dlls/crypt32/tests/msg.c b/dlls/crypt32/tests/msg.c
index 8458c9b..53c1235 100644
--- a/dlls/crypt32/tests/msg.c
+++ b/dlls/crypt32/tests/msg.c
@@ -1208,10 +1208,14 @@ static void test_decode_msg_get_param(vo
{
HCRYPTMSG msg;
BOOL ret;
+ DWORD size = 0;
msg = CryptMsgOpenToDecode(PKCS_7_ASN_ENCODING, 0, 0, 0, NULL, NULL);
+ SetLastError(0xdeadbeef);
+ ret = CryptMsgGetParam(msg, CMSG_CONTENT_PARAM, 0, NULL, &size);
+ ok(!ret && GetLastError() == CRYPT_E_INVALID_MSG_TYPE,
+ "Expected CRYPT_E_INVALID_MSG_TYPE, got %x\n", GetLastError());
ret = CryptMsgUpdate(msg, dataContent, sizeof(dataContent), TRUE);
- todo_wine
check_param("data content", msg, CMSG_CONTENT_PARAM, msgData,
sizeof(msgData));
CryptMsgClose(msg);
--
1.4.1
More information about the wine-patches
mailing list