winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
December 2010
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
2 participants
1099 discussions
Start a n
N
ew thread
Alexander Morozov : crypt32: Implement getting content of an enveloped message.
by Alexandre Julliard
02 Dec '10
02 Dec '10
Module: wine Branch: master Commit: 6ad5416f32dae5e436a55d1a6fac871d533abf30 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6ad5416f32dae5e436a55d1a6…
Author: Alexander Morozov <amorozov(a)etersoft.ru> Date: Wed Dec 1 14:40:27 2010 +0300 crypt32: Implement getting content of an enveloped message. --- dlls/crypt32/crypt32_private.h | 18 +++++++++++++ dlls/crypt32/encode.c | 55 ++++++++++++++++++++++++++++++++++++++++ dlls/crypt32/msg.c | 55 +++++++++++++++++++++++++++++++++++++-- dlls/crypt32/tests/msg.c | 2 - 4 files changed, 125 insertions(+), 5 deletions(-) diff --git a/dlls/crypt32/crypt32_private.h b/dlls/crypt32/crypt32_private.h index 36ee3e2..a4b9aff 100644 --- a/dlls/crypt32/crypt32_private.h +++ b/dlls/crypt32/crypt32_private.h @@ -82,6 +82,24 @@ typedef struct _CRYPT_DIGESTED_DATA BOOL CRYPT_AsnEncodePKCSDigestedData(const CRYPT_DIGESTED_DATA *digestedData, void *pvData, DWORD *pcbData); +typedef struct _CRYPT_ENCRYPTED_CONTENT_INFO +{ + LPSTR contentType; + CRYPT_ALGORITHM_IDENTIFIER contentEncryptionAlgorithm; + CRYPT_DATA_BLOB encryptedContent; +} CRYPT_ENCRYPTED_CONTENT_INFO; + +typedef struct _CRYPT_ENVELOPED_DATA +{ + DWORD version; + DWORD cRecipientInfo; + PCMSG_KEY_TRANS_RECIPIENT_INFO rgRecipientInfo; + CRYPT_ENCRYPTED_CONTENT_INFO encryptedContentInfo; +} CRYPT_ENVELOPED_DATA; + +BOOL CRYPT_AsnEncodePKCSEnvelopedData(const CRYPT_ENVELOPED_DATA *envelopedData, + void *pvData, DWORD *pcbData); + typedef struct _CRYPT_SIGNED_INFO { DWORD version; diff --git a/dlls/crypt32/encode.c b/dlls/crypt32/encode.c index 3beab84..5d6affe 100644 --- a/dlls/crypt32/encode.c +++ b/dlls/crypt32/encode.c @@ -4293,6 +4293,61 @@ BOOL CRYPT_AsnEncodeCMSSignedInfo(CRYPT_SIGNED_INFO *signedInfo, void *pvData, return ret; } +static BOOL WINAPI CRYPT_AsnEncodeRecipientInfo(DWORD dwCertEncodingType, + LPCSTR lpszStructType, const void *pvStructInfo, DWORD dwFlags, + PCRYPT_ENCODE_PARA pEncodePara, BYTE *pbEncoded, DWORD *pcbEncoded) +{ + const CMSG_KEY_TRANS_RECIPIENT_INFO *info = pvStructInfo; + struct AsnEncodeSequenceItem items[] = { + { &info->dwVersion, CRYPT_AsnEncodeInt, 0 }, + { &info->RecipientId.u.IssuerSerialNumber, + CRYPT_AsnEncodeIssuerSerialNumber, 0 }, + { &info->KeyEncryptionAlgorithm, + CRYPT_AsnEncodeAlgorithmIdWithNullParams, 0 }, + { &info->EncryptedKey, CRYPT_AsnEncodeOctets, 0 }, + }; + + return CRYPT_AsnEncodeSequence(dwCertEncodingType, items, + sizeof(items) / sizeof(items[0]), dwFlags, pEncodePara, pbEncoded, + pcbEncoded); +} + +static BOOL WINAPI CRYPT_AsnEncodeEncryptedContentInfo(DWORD dwCertEncodingType, + LPCSTR lpszStructType, const void *pvStructInfo, DWORD dwFlags, + PCRYPT_ENCODE_PARA pEncodePara, BYTE *pbEncoded, DWORD *pcbEncoded) +{ + const CRYPT_ENCRYPTED_CONTENT_INFO *info = pvStructInfo; + struct AsnEncodeTagSwappedItem swapped = { ASN_CONTEXT | 0, + &info->encryptedContent, CRYPT_AsnEncodeOctets }; + struct AsnEncodeSequenceItem items[] = { + { info->contentType, CRYPT_AsnEncodeOid, 0 }, + { &info->contentEncryptionAlgorithm, + CRYPT_AsnEncodeAlgorithmIdWithNullParams, 0 }, + { &swapped, CRYPT_AsnEncodeSwapTag, 0 }, + }; + + return CRYPT_AsnEncodeSequence(dwCertEncodingType, items, + sizeof(items) / sizeof(items[0]), dwFlags, pEncodePara, pbEncoded, + pcbEncoded); +} + +BOOL CRYPT_AsnEncodePKCSEnvelopedData(const CRYPT_ENVELOPED_DATA *envelopedData, + void *pvData, DWORD *pcbData) +{ + struct DERSetDescriptor recipientInfosSet = { envelopedData->cRecipientInfo, + envelopedData->rgRecipientInfo, sizeof(CMSG_KEY_TRANS_RECIPIENT_INFO), 0, + CRYPT_AsnEncodeRecipientInfo }; + struct AsnEncodeSequenceItem items[] = { + { &envelopedData->version, CRYPT_AsnEncodeInt, 0 }, + { &recipientInfosSet, CRYPT_DEREncodeItemsAsSet, 0 }, + { &envelopedData->encryptedContentInfo, + CRYPT_AsnEncodeEncryptedContentInfo, 0 }, + }; + + return CRYPT_AsnEncodeSequence(X509_ASN_ENCODING, items, + sizeof(items) / sizeof(items[0]), 0, NULL, pvData, pcbData); +} + static CryptEncodeObjectExFunc CRYPT_GetBuiltinEncoder(DWORD dwCertEncodingType, LPCSTR lpszStructType) { diff --git a/dlls/crypt32/msg.c b/dlls/crypt32/msg.c index 2b93a5b..f083c53 100644 --- a/dlls/crypt32/msg.c +++ b/dlls/crypt32/msg.c @@ -1785,9 +1785,58 @@ static void CEnvelopedEncodeMsg_Close(HCRYPTMSG hCryptMsg) static BOOL CEnvelopedEncodeMsg_GetParam(HCRYPTMSG hCryptMsg, DWORD dwParamType, DWORD dwIndex, void *pvData, DWORD *pcbData) { - FIXME("(%p, %d, %d, %p, %p): stub\n", hCryptMsg, dwParamType, dwIndex, - pvData, pcbData); - return FALSE; + CEnvelopedEncodeMsg *msg = hCryptMsg; + BOOL ret = FALSE; + + switch (dwParamType) + { + case CMSG_BARE_CONTENT_PARAM: + if (msg->base.streamed) + SetLastError(E_INVALIDARG); + else + { + char oid_rsa_data[] = szOID_RSA_data; + CRYPT_ENVELOPED_DATA envelopedData = { + CMSG_ENVELOPED_DATA_PKCS_1_5_VERSION, msg->cRecipientInfo, + msg->recipientInfo, { oid_rsa_data, msg->algo, msg->data } + }; + + ret = CRYPT_AsnEncodePKCSEnvelopedData(&envelopedData, pvData, + pcbData); + } + break; + case CMSG_CONTENT_PARAM: + { + CRYPT_CONTENT_INFO info; + + ret = CryptMsgGetParam(hCryptMsg, CMSG_BARE_CONTENT_PARAM, 0, NULL, + &info.Content.cbData); + if (ret) + { + info.Content.pbData = CryptMemAlloc(info.Content.cbData); + if (info.Content.pbData) + { + ret = CryptMsgGetParam(hCryptMsg, CMSG_BARE_CONTENT_PARAM, 0, + info.Content.pbData, &info.Content.cbData); + if (ret) + { + char oid_rsa_enveloped[] = szOID_RSA_envelopedData; + + info.pszObjId = oid_rsa_enveloped; + ret = CryptEncodeObjectEx(X509_ASN_ENCODING, + PKCS_CONTENT_INFO, &info, 0, NULL, pvData, pcbData); + } + CryptMemFree(info.Content.pbData); + } + else + ret = FALSE; + } + break; + } + default: + SetLastError(CRYPT_E_INVALID_MSG_TYPE); + } + return ret; } static BOOL CEnvelopedEncodeMsg_Update(HCRYPTMSG hCryptMsg, const BYTE *pbData, diff --git a/dlls/crypt32/tests/msg.c b/dlls/crypt32/tests/msg.c index 9ffae52..e32690b 100644 --- a/dlls/crypt32/tests/msg.c +++ b/dlls/crypt32/tests/msg.c @@ -2248,11 +2248,9 @@ static void test_enveloped_msg_encoding(void) "CryptMsgOpenToEncode failed: %08x\n", GetLastError()); if (msg) { - todo_wine check_param("enveloped empty bare content", msg, CMSG_BARE_CONTENT_PARAM, envelopedEmptyBareContent, sizeof(envelopedEmptyBareContent)); - todo_wine check_param("enveloped empty content", msg, CMSG_CONTENT_PARAM, envelopedEmptyContent, sizeof(envelopedEmptyContent)); CryptMsgClose(msg);
1
0
0
0
Alexander Morozov : crypt32: Implement updating enveloped messages.
by Alexandre Julliard
02 Dec '10
02 Dec '10
Module: wine Branch: master Commit: 03e94320c21cabf503a2eae2175d6a1989aebdcc URL:
http://source.winehq.org/git/wine.git/?a=commit;h=03e94320c21cabf503a2eae21…
Author: Alexander Morozov <amorozov(a)etersoft.ru> Date: Wed Dec 1 14:36:02 2010 +0300 crypt32: Implement updating enveloped messages. --- dlls/crypt32/msg.c | 66 ++++++++++++++++++++++++++++++++++++++++++++- dlls/crypt32/tests/msg.c | 14 ---------- 2 files changed, 64 insertions(+), 16 deletions(-) diff --git a/dlls/crypt32/msg.c b/dlls/crypt32/msg.c index 1ca4d0e..2b93a5b 100644 --- a/dlls/crypt32/msg.c +++ b/dlls/crypt32/msg.c @@ -1793,8 +1793,70 @@ static BOOL CEnvelopedEncodeMsg_GetParam(HCRYPTMSG hCryptMsg, DWORD dwParamType, static BOOL CEnvelopedEncodeMsg_Update(HCRYPTMSG hCryptMsg, const BYTE *pbData, DWORD cbData, BOOL fFinal) { - FIXME("(%p, %p, %d, %d): stub\n", hCryptMsg, pbData, cbData, fFinal); - return FALSE; + CEnvelopedEncodeMsg *msg = hCryptMsg; + BOOL ret = FALSE; + + if (msg->base.state == MsgStateFinalized) + SetLastError(CRYPT_E_MSG_ERROR); + else if (msg->base.streamed) + { + FIXME("streamed stub\n"); + msg->base.state = fFinal ? MsgStateFinalized : MsgStateUpdated; + ret = TRUE; + } + else + { + if (!fFinal) + { + if (msg->base.open_flags & CMSG_DETACHED_FLAG) + SetLastError(E_INVALIDARG); + else + SetLastError(CRYPT_E_MSG_ERROR); + } + else + { + if (cbData) + { + DWORD dataLen = cbData; + + msg->data.cbData = cbData; + msg->data.pbData = CryptMemAlloc(cbData); + if (msg->data.pbData) + { + memcpy(msg->data.pbData, pbData, cbData); + ret = CryptEncrypt(msg->key, 0, TRUE, 0, msg->data.pbData, + &dataLen, msg->data.cbData); + msg->data.cbData = dataLen; + if (dataLen > cbData) + { + msg->data.pbData = CryptMemRealloc(msg->data.pbData, + dataLen); + if (msg->data.pbData) + { + dataLen = cbData; + ret = CryptEncrypt(msg->key, 0, TRUE, 0, + msg->data.pbData, &dataLen, msg->data.cbData); + } + else + ret = FALSE; + } + if (!ret) + CryptMemFree(msg->data.pbData); + } + else + ret = FALSE; + if (!ret) + { + msg->data.cbData = 0; + msg->data.pbData = NULL; + } + } + else + ret = TRUE; + msg->base.state = MsgStateFinalized; + } + } + return ret; } static HCRYPTMSG CEnvelopedEncodeMsg_Open(DWORD dwFlags, diff --git a/dlls/crypt32/tests/msg.c b/dlls/crypt32/tests/msg.c index fb7a7c2..9ffae52 100644 --- a/dlls/crypt32/tests/msg.c +++ b/dlls/crypt32/tests/msg.c @@ -2118,16 +2118,13 @@ static void test_enveloped_msg_update(void) { SetLastError(0xdeadbeef); ret = CryptMsgUpdate(msg, NULL, 0, FALSE); - todo_wine ok(!ret && GetLastError() == CRYPT_E_MSG_ERROR, "expected CRYPT_E_MSG_ERROR, got %08x\n", GetLastError()); SetLastError(0xdeadbeef); ret = CryptMsgUpdate(msg, NULL, 0, TRUE); - todo_wine ok(ret, "CryptMsgUpdate failed: %08x\n", GetLastError()); SetLastError(0xdeadbeef); ret = CryptMsgUpdate(msg, NULL, 0, TRUE); - todo_wine ok(!ret && GetLastError() == CRYPT_E_MSG_ERROR, "expected CRYPT_E_MSG_ERROR, got %08x\n", GetLastError()); CryptMsgClose(msg); @@ -2142,18 +2139,15 @@ static void test_enveloped_msg_update(void) { SetLastError(0xdeadbeef); ret = CryptMsgUpdate(msg, msgData, sizeof(msgData), FALSE); - todo_wine ok(!ret && GetLastError() == CRYPT_E_MSG_ERROR, "expected CRYPT_E_MSG_ERROR, got %08x\n", GetLastError()); SetLastError(0xdeadbeef); ret = CryptMsgUpdate(msg, msgData, sizeof(msgData), TRUE); - todo_wine ok(ret || broken(!ret && GetLastError() == NTE_PERM), /* some NT4 */ "CryptMsgUpdate failed: %08x\n", GetLastError()); SetLastError(0xdeadbeef); ret = CryptMsgUpdate(msg, NULL, 0, TRUE); - todo_wine ok(!ret && GetLastError() == CRYPT_E_MSG_ERROR, "expected CRYPT_E_MSG_ERROR, got %08x\n", GetLastError()); CryptMsgClose(msg); @@ -2168,12 +2162,10 @@ static void test_enveloped_msg_update(void) { SetLastError(0xdeadbeef); ret = CryptMsgUpdate(msg, NULL, 0, FALSE); - todo_wine ok(!ret && GetLastError() == E_INVALIDARG, "expected E_INVALIDARG, got %08x\n", GetLastError()); SetLastError(0xdeadbeef); ret = CryptMsgUpdate(msg, NULL, 0, TRUE); - todo_wine ok(ret, "CryptMsgUpdate failed: %08x\n", GetLastError()); CryptMsgClose(msg); } @@ -2187,12 +2179,10 @@ static void test_enveloped_msg_update(void) { SetLastError(0xdeadbeef); ret = CryptMsgUpdate(msg, msgData, sizeof(msgData), FALSE); - todo_wine ok(!ret && GetLastError() == E_INVALIDARG, "expected E_INVALIDARG, got %08x\n", GetLastError()); SetLastError(0xdeadbeef); ret = CryptMsgUpdate(msg, msgData, sizeof(msgData), TRUE); - todo_wine ok(ret || broken(!ret && GetLastError() == NTE_PERM), /* some NT4 */ "CryptMsgUpdate failed: %08x\n", GetLastError()); @@ -2208,11 +2198,9 @@ static void test_enveloped_msg_update(void) { SetLastError(0xdeadbeef); ret = CryptMsgUpdate(msg, NULL, 0, FALSE); - todo_wine ok(ret, "CryptMsgUpdate failed: %08x\n", GetLastError()); SetLastError(0xdeadbeef); ret = CryptMsgUpdate(msg, NULL, 0, TRUE); - todo_wine ok(ret, "CryptMsgUpdate failed: %08x\n", GetLastError()); CryptMsgClose(msg); } @@ -2226,11 +2214,9 @@ static void test_enveloped_msg_update(void) { SetLastError(0xdeadbeef); ret = CryptMsgUpdate(msg, msgData, sizeof(msgData), FALSE); - todo_wine ok(ret, "CryptMsgUpdate failed: %08x\n", GetLastError()); SetLastError(0xdeadbeef); ret = CryptMsgUpdate(msg, msgData, sizeof(msgData), TRUE); - todo_wine ok(ret || broken(!ret && GetLastError() == NTE_PERM), /* some NT4 */ "CryptMsgUpdate failed: %08x\n", GetLastError());
1
0
0
0
Alexander Morozov : crypt32: Save some info needed for creating enveloped messages.
by Alexandre Julliard
02 Dec '10
02 Dec '10
Module: wine Branch: master Commit: c3a2f7a3d1e6c98e2ee97cede11fbefa4a40b053 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c3a2f7a3d1e6c98e2ee97cede…
Author: Alexander Morozov <amorozov(a)etersoft.ru> Date: Wed Dec 1 14:26:17 2010 +0300 crypt32: Save some info needed for creating enveloped messages. --- dlls/crypt32/msg.c | 326 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 326 insertions(+), 0 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=c3a2f7a3d1e6c98e2ee97…
1
0
0
0
Alexander Morozov : wincrypt.h: Define some enveloped message callback functions.
by Alexandre Julliard
02 Dec '10
02 Dec '10
Module: wine Branch: master Commit: 1de62294899212f7e6d26cff235246f3c8013085 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1de62294899212f7e6d26cff2…
Author: Alexander Morozov <amorozov(a)etersoft.ru> Date: Wed Dec 1 13:55:56 2010 +0300 wincrypt.h: Define some enveloped message callback functions. --- include/wincrypt.h | 37 +++++++++++++++++++++++++++++++++++++ 1 files changed, 37 insertions(+), 0 deletions(-) diff --git a/include/wincrypt.h b/include/wincrypt.h index c813738..7d5a87c 100644 --- a/include/wincrypt.h +++ b/include/wincrypt.h @@ -2279,6 +2279,8 @@ static const WCHAR CERT_TRUST_PUB_AUTHENTICODE_FLAGS_VALUE_NAME[] = "CertDllVerifyCertificateChainPolicy" #define URL_OID_GET_OBJECT_URL_FUNC "UrlDllGetObjectUrl" #define TIME_VALID_OID_GET_OBJECT_FUNC "TimeValidDllGetObject" +#define CMSG_OID_GEN_CONTENT_ENCRYPT_KEY_FUNC "CryptMsgDllGenContentEncryptKey" +#define CMSG_OID_EXPORT_KEY_TRANS_FUNC "CryptMsgDllExportKeyTrans" #define CRYPT_OID_REGPATH "Software\\Microsoft\\Cryptography\\OID" #define CRYPT_OID_REG_ENCODING_TYPE_PREFIX "EncodingType " @@ -3778,6 +3780,41 @@ typedef struct _CMSG_CMS_RECIPIENT_INFO { #define CMSG_KEY_AGREE_VERSION CMSG_ENVELOPED_RECIPIENT_V3 #define CMSG_MAIL_LIST_VERSION CMSG_ENVELOPED_RECIPIENT_V4 +typedef void * (WINAPI *PFN_CMSG_ALLOC)(size_t cb); +typedef void (WINAPI *PFN_CMSG_FREE)(void *pv); + +typedef struct _CMSG_CONTENT_ENCRYPT_INFO { + DWORD cbSize; + HCRYPTPROV hCryptProv; + CRYPT_ALGORITHM_IDENTIFIER ContentEncryptionAlgorithm; + void *pvEncryptionAuxInfo; + DWORD cRecipients; + PCMSG_RECIPIENT_ENCODE_INFO rgCmsRecipients; + PFN_CMSG_ALLOC pfnAlloc; + PFN_CMSG_FREE pfnFree; + DWORD dwEncryptFlags; + HCRYPTKEY hContentEncryptKey; + DWORD dwFlags; +} CMSG_CONTENT_ENCRYPT_INFO, *PCMSG_CONTENT_ENCRYPT_INFO; + +typedef struct _CMSG_KEY_TRANS_ENCRYPT_INFO { + DWORD cbSize; + DWORD dwRecipientIndex; + CRYPT_ALGORITHM_IDENTIFIER KeyEncryptionAlgorithm; + CRYPT_DATA_BLOB EncryptedKey; + DWORD dwFlags; +} CMSG_KEY_TRANS_ENCRYPT_INFO, *PCMSG_KEY_TRANS_ENCRYPT_INFO; + +typedef BOOL (WINAPI *PFN_CMSG_GEN_CONTENT_ENCRYPT_KEY)( + PCMSG_CONTENT_ENCRYPT_INFO pContentEncryptInfo, DWORD dwFlags, + void *pvReserved); + +typedef BOOL (WINAPI *PFN_CMSG_EXPORT_KEY_TRANS)( + PCMSG_CONTENT_ENCRYPT_INFO pContentEncryptInfo, + PCMSG_KEY_TRANS_RECIPIENT_ENCODE_INFO pKeyTransEncodeInfo, + PCMSG_KEY_TRANS_ENCRYPT_INFO pKeyTransEncryptInfo, + DWORD dwFlags, void *pvReserved); + /* CryptMsgGetAndVerifySigner flags */ #define CMSG_TRUSTED_SIGNER_FLAG 0x1 #define CMSG_SIGNER_ONLY_FLAG 0x2
1
0
0
0
Alexandre Julliard : hlink: Convert dll registration to the IRegistrar mechanism.
by Alexandre Julliard
02 Dec '10
02 Dec '10
Module: wine Branch: master Commit: 61eb983313fe04813bc8c6f64162ca434e642e23 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=61eb983313fe04813bc8c6f64…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Dec 2 14:40:00 2010 +0100 hlink: Convert dll registration to the IRegistrar mechanism. --- dlls/hlink/Makefile.in | 2 + dlls/hlink/hlink.spec | 2 +- dlls/hlink/hlink_classes.idl | 36 +++++++++++++++++++++++++++++++ dlls/hlink/hlink_main.c | 48 ++++++++++------------------------------- 4 files changed, 51 insertions(+), 37 deletions(-) diff --git a/dlls/hlink/Makefile.in b/dlls/hlink/Makefile.in index 2bf15c7..a387802 100644 --- a/dlls/hlink/Makefile.in +++ b/dlls/hlink/Makefile.in @@ -9,4 +9,6 @@ C_SRCS = \ hlink_main.c \ link.c +IDL_R_SRCS = hlink_classes.idl + @MAKE_DLL_RULES@ diff --git a/dlls/hlink/hlink.spec b/dlls/hlink/hlink.spec index ca8144e..6a5bfdf 100644 --- a/dlls/hlink/hlink.spec +++ b/dlls/hlink/hlink.spec @@ -30,4 +30,4 @@ @ stdcall -private DllCanUnloadNow() @ stdcall -private DllGetClassObject(ptr ptr ptr) @ stdcall -private DllRegisterServer() -# @ stub -private DllUnregisterServer +@ stdcall -private DllUnregisterServer() diff --git a/dlls/hlink/hlink_classes.idl b/dlls/hlink/hlink_classes.idl new file mode 100644 index 0000000..98b5d32 --- /dev/null +++ b/dlls/hlink/hlink_classes.idl @@ -0,0 +1,36 @@ +/* + * COM Classes for hlink + * + * Copyright 2010 Alexandre Julliard + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +[ + threading(apartment), + uuid(79eac9d0-baf9-11ce-8c82-00aa004ba90b) +] +coclass StdHlink +{ + interface IHlink; + interface IPersistStream; + interface IDataObject; +} + +[ + threading(apartment), + uuid(79eac9d1-baf9-11ce-8c82-00aa004ba90b) +] +coclass StdHlinkBrowseContext { interface IHlinkBrowseContext; } diff --git a/dlls/hlink/hlink_main.c b/dlls/hlink/hlink_main.c index cda9683..0300fc0 100644 --- a/dlls/hlink/hlink_main.c +++ b/dlls/hlink/hlink_main.c @@ -21,12 +21,15 @@ #include "hlink_private.h" #include "winreg.h" +#include "rpcproxy.h" #include "hlguids.h" #include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(hlink); +static HINSTANCE instance; + typedef HRESULT (CALLBACK *LPFNCREATEINSTANCE)(IUnknown*, REFIID, LPVOID*); typedef struct @@ -42,6 +45,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) switch (fdwReason) { case DLL_PROCESS_ATTACH: + instance = hinstDLL; DisableThreadLibraryCalls(hinstDLL); break; case DLL_PROCESS_DETACH: @@ -576,46 +580,18 @@ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID iid, LPVOID *ppv) return IClassFactory_QueryInterface(pcf, iid, ppv); } -static HRESULT register_clsid(LPCGUID guid) +/*********************************************************************** + * DllRegisterServer (HLINK.@) + */ +HRESULT WINAPI DllRegisterServer(void) { - static const WCHAR clsid[] = - {'C','L','S','I','D','\\',0}; - static const WCHAR ips[] = - {'\\','I','n','p','r','o','c','S','e','r','v','e','r','3','2',0}; - static const WCHAR hlink[] = - {'h','l','i','n','k','.','d','l','l',0}; - static const WCHAR threading_model[] = - {'T','h','r','e','a','d','i','n','g','M','o','d','e','l',0}; - static const WCHAR apartment[] = - {'A','p','a','r','t','m','e','n','t',0}; - WCHAR path[80]; - HKEY key = NULL; - LONG r; - - lstrcpyW(path, clsid); - StringFromGUID2(guid, &path[6], 80); - lstrcatW(path, ips); - r = RegCreateKeyW(HKEY_CLASSES_ROOT, path, &key); - if (r != ERROR_SUCCESS) - return E_FAIL; - - RegSetValueExW(key, NULL, 0, REG_SZ, (const BYTE *)hlink, sizeof hlink); - RegSetValueExW(key, threading_model, 0, REG_SZ, (const BYTE *)apartment, sizeof apartment); - RegCloseKey(key); - - return S_OK; + return __wine_register_resources( instance, NULL ); } /*********************************************************************** - * DllRegisterServer (HLINK.@) + * DllUnregisterServer (HLINK.@) */ -HRESULT WINAPI DllRegisterServer(void) +HRESULT WINAPI DllUnregisterServer(void) { - HRESULT r; - - r = register_clsid(&CLSID_StdHlink); - if (SUCCEEDED(r)) - r = register_clsid(&CLSID_StdHlinkBrowseContext); - - return S_OK; + return __wine_unregister_resources( instance, NULL ); }
1
0
0
0
Alexandre Julliard : inseng: Convert dll registration to the IRegistrar mechanism.
by Alexandre Julliard
02 Dec '10
02 Dec '10
Module: wine Branch: master Commit: 26c7172177ea22abdfb561097aabc657cbebc86d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=26c7172177ea22abdfb561097…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Dec 2 14:16:17 2010 +0100 inseng: Convert dll registration to the IRegistrar mechanism. --- dlls/inseng/Makefile.in | 5 +- dlls/inseng/inseng.idl | 33 +++ dlls/inseng/inseng_main.c | 23 ++ dlls/inseng/regsvr.c | 501 --------------------------------------------- 4 files changed, 59 insertions(+), 503 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=26c7172177ea22abdfb56…
1
0
0
0
Alexandre Julliard : oledb32: Convert dll registration to the IRegistrar mechanism.
by Alexandre Julliard
02 Dec '10
02 Dec '10
Module: wine Branch: master Commit: dda5d9383415d6f640a2e976a5fa80f75e876935 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=dda5d9383415d6f640a2e976a…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Dec 2 14:05:33 2010 +0100 oledb32: Convert dll registration to the IRegistrar mechanism. --- dlls/oledb32/Makefile.in | 5 +- dlls/oledb32/main.c | 20 ++ dlls/oledb32/oledb32_classes.idl | 32 +++ dlls/oledb32/regsvr.c | 560 -------------------------------------- 4 files changed, 55 insertions(+), 562 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=dda5d9383415d6f640a2e…
1
0
0
0
Alexandre Julliard : wbemprox: Convert dll registration to the IRegistrar mechanism.
by Alexandre Julliard
02 Dec '10
02 Dec '10
Module: wine Branch: master Commit: 822d7b6eb33eb04f1c0e8a62cf94e878671ade39 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=822d7b6eb33eb04f1c0e8a62c…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Dec 2 14:05:25 2010 +0100 wbemprox: Convert dll registration to the IRegistrar mechanism. --- dlls/wbemprox/Makefile.in | 3 +- dlls/wbemprox/main.c | 23 +++ dlls/wbemprox/regsvr.c | 424 -------------------------------------------- dlls/wbemprox/wbemprox.idl | 26 +++ 4 files changed, 51 insertions(+), 425 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=822d7b6eb33eb04f1c0e8…
1
0
0
0
Alexandre Julliard : wmiutils: Convert dll registration to the IRegistrar mechanism.
by Alexandre Julliard
02 Dec '10
02 Dec '10
Module: wine Branch: master Commit: dc36d92e22b80b4c3cd98f6d9d7013b9595f83b2 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=dc36d92e22b80b4c3cd98f6d9…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Dec 2 13:48:08 2010 +0100 wmiutils: Convert dll registration to the IRegistrar mechanism. --- dlls/wmiutils/Makefile.in | 3 +- dlls/wmiutils/main.c | 23 +++ dlls/wmiutils/regsvr.c | 424 -------------------------------------------- dlls/wmiutils/wmiutils.idl | 25 +++ 4 files changed, 50 insertions(+), 425 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=dc36d92e22b80b4c3cd98…
1
0
0
0
Alexandre Julliard : objsel: Convert dll registration to the IRegistrar mechanism.
by Alexandre Julliard
02 Dec '10
02 Dec '10
Module: wine Branch: master Commit: aece1f733fc9983d882ea987d54543f04097b929 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=aece1f733fc9983d882ea987d…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Dec 2 13:39:31 2010 +0100 objsel: Convert dll registration to the IRegistrar mechanism. --- dlls/objsel/Makefile.in | 5 +- dlls/objsel/objsel.c | 19 ++ dlls/objsel/objsel_classes.idl | 25 ++ dlls/objsel/regsvr.c | 508 ---------------------------------------- include/objsel.h | 4 +- 5 files changed, 49 insertions(+), 512 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=aece1f733fc9983d882ea…
1
0
0
0
← Newer
1
...
102
103
104
105
106
107
108
109
110
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
Results per page:
10
25
50
100
200