From 0546cf1a696125b82843959a5d0d7de36a5abb40 Mon Sep 17 00:00:00 2001 From: Juan Lang Date: Thu, 28 Jun 2007 17:16:15 -0700 Subject: [PATCH] crypt32: Add a stub get param function for data messages and remove stub message from open function. --- dlls/crypt32/msg.c | 19 ++++++++++++++++++- dlls/crypt32/tests/msg.c | 2 +- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/dlls/crypt32/msg.c b/dlls/crypt32/msg.c index b88694aa711..e392b79cfe6 100644 --- a/dlls/crypt32/msg.c +++ b/dlls/crypt32/msg.c @@ -109,6 +109,23 @@ static BOOL CDataEncodeMsg_Update(HCRYPTMSG hCryptMsg, const BYTE *pbData, return ret; } +static BOOL CDataEncodeMsg_GetParam(HCRYPTMSG hCryptMsg, DWORD dwParamType, + DWORD dwIndex, void *pvData, DWORD *pcbData) +{ + BOOL ret = FALSE; + + switch (dwParamType) + { + case CMSG_CONTENT_PARAM: + case CMSG_BARE_CONTENT_PARAM: + FIXME("stub\n"); + break; + default: + SetLastError(CRYPT_E_INVALID_MSG_TYPE); + } + return ret; +} + static HCRYPTMSG CDataEncodeMsg_Open(DWORD dwFlags, const void *pvMsgEncodeInfo, LPSTR pszInnerContentObjID, PCMSG_STREAM_INFO pStreamInfo) { @@ -119,13 +136,13 @@ static HCRYPTMSG CDataEncodeMsg_Open(DWORD dwFlags, const void *pvMsgEncodeInfo, SetLastError(E_INVALIDARG); return NULL; } - FIXME("semi-stub\n"); 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; msg->bare_content_len = sizeof(empty_data_content); msg->bare_content = (LPBYTE)empty_data_content; } diff --git a/dlls/crypt32/tests/msg.c b/dlls/crypt32/tests/msg.c index 03d0abf68aa..0d4ea3a556b 100644 --- a/dlls/crypt32/tests/msg.c +++ b/dlls/crypt32/tests/msg.c @@ -369,6 +369,7 @@ static void test_data_msg_get_param(void) size = 0; ret = CryptMsgGetParam(msg, CMSG_BARE_CONTENT_PARAM, 0, NULL, &size); ok(ret, "CryptMsgGetParam failed: %08x\n", GetLastError()); + } /* But for this type of message, the signer and hash aren't applicable, * and the type isn't available. */ @@ -384,7 +385,6 @@ static void test_data_msg_get_param(void) ret = CryptMsgGetParam(msg, CMSG_TYPE_PARAM, 0, NULL, &size); ok(!ret && GetLastError() == CRYPT_E_INVALID_MSG_TYPE, "Expected CRYPT_E_INVALID_MSG_TYPE, got %x\n", GetLastError()); - } CryptMsgClose(msg); }