Juan Lang : crypt32: Stub CryptMsgOpenToEncode for data messages.
Alexandre Julliard
julliard at wine.codeweavers.com
Fri Jun 29 08:14:38 CDT 2007
Module: wine
Branch: master
Commit: fa0f5bd066b6514a14e877fad9dd7836ef5f4ae0
URL: http://source.winehq.org/git/wine.git/?a=commit;h=fa0f5bd066b6514a14e877fad9dd7836ef5f4ae0
Author: Juan Lang <juan.lang at gmail.com>
Date: Thu Jun 28 16:49:06 2007 -0700
crypt32: Stub CryptMsgOpenToEncode for data messages.
---
dlls/crypt32/msg.c | 27 +++++++++++++++++++++++++++
dlls/crypt32/tests/msg.c | 3 ---
2 files changed, 27 insertions(+), 3 deletions(-)
diff --git a/dlls/crypt32/msg.c b/dlls/crypt32/msg.c
index f806838..ebd7b65 100644
--- a/dlls/crypt32/msg.c
+++ b/dlls/crypt32/msg.c
@@ -42,6 +42,30 @@ static inline void CryptMsgBase_Init(CryptMsgBase *msg, DWORD dwFlags)
msg->open_flags = dwFlags;
}
+typedef struct _CDataEncodeMsg
+{
+ CryptMsgBase base;
+} CDataEncodeMsg;
+
+static HCRYPTMSG CDataEncodeMsg_Open(DWORD dwFlags, const void *pvMsgEncodeInfo,
+ LPSTR pszInnerContentObjID, PCMSG_STREAM_INFO pStreamInfo)
+{
+ CDataEncodeMsg *msg;
+
+ if (pvMsgEncodeInfo)
+ {
+ SetLastError(E_INVALIDARG);
+ return NULL;
+ }
+ FIXME("semi-stub\n");
+ msg = CryptMemAlloc(sizeof(CDataEncodeMsg));
+ if (msg)
+ {
+ CryptMsgBase_Init((CryptMsgBase *)msg, dwFlags);
+ }
+ return (HCRYPTMSG)msg;
+}
+
static inline const char *MSG_TYPE_STR(DWORD type)
{
switch (type)
@@ -76,6 +100,9 @@ HCRYPTMSG WINAPI CryptMsgOpenToEncode(DWORD dwMsgEncodingType, DWORD dwFlags,
switch (dwMsgType)
{
case CMSG_DATA:
+ msg = CDataEncodeMsg_Open(dwFlags, pvMsgEncodeInfo,
+ pszInnerContentObjID, pStreamInfo);
+ break;
case CMSG_SIGNED:
case CMSG_ENVELOPED:
case CMSG_HASHED:
diff --git a/dlls/crypt32/tests/msg.c b/dlls/crypt32/tests/msg.c
index 1895f82..9d7c3c6 100644
--- a/dlls/crypt32/tests/msg.c
+++ b/dlls/crypt32/tests/msg.c
@@ -275,7 +275,6 @@ static void test_msg_close(void)
ret = CryptMsgClose((HCRYPTMSG)1);
msg = CryptMsgOpenToEncode(PKCS_7_ASN_ENCODING, 0, CMSG_DATA, NULL, NULL,
NULL);
- todo_wine
ok(msg != NULL, "CryptMsgOpenToEncode failed: %x\n", GetLastError());
ret = CryptMsgClose(msg);
ok(ret, "CryptMsgClose failed: %x\n", GetLastError());
@@ -290,13 +289,11 @@ static void test_data_msg_open(void)
SetLastError(0xdeadbeef);
msg = CryptMsgOpenToEncode(PKCS_7_ASN_ENCODING, 0, CMSG_DATA, &hashInfo,
NULL, NULL);
- todo_wine {
ok(!msg && GetLastError() == E_INVALIDARG,
"Expected E_INVALIDARG, got %x\n", GetLastError());
msg = CryptMsgOpenToEncode(PKCS_7_ASN_ENCODING, 0, CMSG_DATA, NULL, NULL,
NULL);
ok(msg != NULL, "CryptMsgOpenToEncode failed: %x\n", GetLastError());
- }
CryptMsgClose(msg);
}
More information about the wine-cvs
mailing list