Module: wine Branch: master Commit: 4e2894493414da24429f557ae307791592ca216a URL: http://source.winehq.org/git/wine.git/?a=commit;h=4e2894493414da24429f557ae3...
Author: Juan Lang juan.lang@gmail.com Date: Tue Jul 17 07:33:01 2007 -0700
crypt32: 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(HCRYPTMSG hCryptMsg, DWORD dwParamType, 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(void) { 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);