Commit 0546cf1a authored by Juan Lang's avatar Juan Lang Committed by Alexandre Julliard

crypt32: Add a stub get param function for data messages and remove stub message…

crypt32: Add a stub get param function for data messages and remove stub message from open function.
parent 74bf713b
...@@ -109,6 +109,23 @@ static BOOL CDataEncodeMsg_Update(HCRYPTMSG hCryptMsg, const BYTE *pbData, ...@@ -109,6 +109,23 @@ static BOOL CDataEncodeMsg_Update(HCRYPTMSG hCryptMsg, const BYTE *pbData,
return ret; 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, static HCRYPTMSG CDataEncodeMsg_Open(DWORD dwFlags, const void *pvMsgEncodeInfo,
LPSTR pszInnerContentObjID, PCMSG_STREAM_INFO pStreamInfo) LPSTR pszInnerContentObjID, PCMSG_STREAM_INFO pStreamInfo)
{ {
...@@ -119,13 +136,13 @@ static HCRYPTMSG CDataEncodeMsg_Open(DWORD dwFlags, const void *pvMsgEncodeInfo, ...@@ -119,13 +136,13 @@ static HCRYPTMSG CDataEncodeMsg_Open(DWORD dwFlags, const void *pvMsgEncodeInfo,
SetLastError(E_INVALIDARG); SetLastError(E_INVALIDARG);
return NULL; return NULL;
} }
FIXME("semi-stub\n");
msg = CryptMemAlloc(sizeof(CDataEncodeMsg)); msg = CryptMemAlloc(sizeof(CDataEncodeMsg));
if (msg) if (msg)
{ {
CryptMsgBase_Init((CryptMsgBase *)msg, dwFlags, pStreamInfo); CryptMsgBase_Init((CryptMsgBase *)msg, dwFlags, pStreamInfo);
msg->base.close = CDataEncodeMsg_Close; msg->base.close = CDataEncodeMsg_Close;
msg->base.update = CDataEncodeMsg_Update; msg->base.update = CDataEncodeMsg_Update;
msg->base.get_param = CDataEncodeMsg_GetParam;
msg->bare_content_len = sizeof(empty_data_content); msg->bare_content_len = sizeof(empty_data_content);
msg->bare_content = (LPBYTE)empty_data_content; msg->bare_content = (LPBYTE)empty_data_content;
} }
......
...@@ -369,6 +369,7 @@ static void test_data_msg_get_param(void) ...@@ -369,6 +369,7 @@ static void test_data_msg_get_param(void)
size = 0; size = 0;
ret = CryptMsgGetParam(msg, CMSG_BARE_CONTENT_PARAM, 0, NULL, &size); ret = CryptMsgGetParam(msg, CMSG_BARE_CONTENT_PARAM, 0, NULL, &size);
ok(ret, "CryptMsgGetParam failed: %08x\n", GetLastError()); ok(ret, "CryptMsgGetParam failed: %08x\n", GetLastError());
}
/* But for this type of message, the signer and hash aren't applicable, /* But for this type of message, the signer and hash aren't applicable,
* and the type isn't available. * and the type isn't available.
*/ */
...@@ -384,7 +385,6 @@ static void test_data_msg_get_param(void) ...@@ -384,7 +385,6 @@ static void test_data_msg_get_param(void)
ret = CryptMsgGetParam(msg, CMSG_TYPE_PARAM, 0, NULL, &size); ret = CryptMsgGetParam(msg, CMSG_TYPE_PARAM, 0, NULL, &size);
ok(!ret && GetLastError() == CRYPT_E_INVALID_MSG_TYPE, ok(!ret && GetLastError() == CRYPT_E_INVALID_MSG_TYPE,
"Expected CRYPT_E_INVALID_MSG_TYPE, got %x\n", GetLastError()); "Expected CRYPT_E_INVALID_MSG_TYPE, got %x\n", GetLastError());
}
CryptMsgClose(msg); CryptMsgClose(msg);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment