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
June 2007
----- 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
5 participants
856 discussions
Start a n
N
ew thread
Jacek Caban : mshtml: Move IConnectionPointContainer to the separated struct.
by Alexandre Julliard
29 Jun '07
29 Jun '07
Module: wine Branch: master Commit: f09a6f7283fc825a38fe0222954ab34784b82504 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f09a6f7283fc825a38fe02229…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Fri Jun 29 02:49:27 2007 +0200 mshtml: Move IConnectionPointContainer to the separated struct. --- dlls/mshtml/conpoint.c | 31 +++++++++++++++++-------------- dlls/mshtml/htmldoc.c | 6 +++--- dlls/mshtml/mshtml_private.h | 14 ++++++++++---- 3 files changed, 30 insertions(+), 21 deletions(-) diff --git a/dlls/mshtml/conpoint.c b/dlls/mshtml/conpoint.c index 7900ff6..b19ca16 100644 --- a/dlls/mshtml/conpoint.c +++ b/dlls/mshtml/conpoint.c @@ -107,7 +107,7 @@ static HRESULT WINAPI ConnectionPoint_GetConnectionPointContainer(IConnectionPoi if(!ppCPC) return E_POINTER; - *ppCPC = CONPTCONT(This->doc); + *ppCPC = CONPTCONT(&This->doc->cp_container); IConnectionPointContainer_AddRef(*ppCPC); return S_OK; } @@ -209,31 +209,31 @@ static void ConnectionPoint_Destroy(ConnectionPoint *This) mshtml_free(This->sinks); } -#define CONPTCONT_THIS(iface) DEFINE_THIS(HTMLDocument, ConnectionPointContainer, iface) +#define CONPTCONT_THIS(iface) DEFINE_THIS(ConnectionPointContainer, ConnectionPointContainer, iface) static HRESULT WINAPI ConnectionPointContainer_QueryInterface(IConnectionPointContainer *iface, REFIID riid, void **ppv) { - HTMLDocument *This = CONPTCONT_THIS(iface); - return IHTMLDocument2_QueryInterface(HTMLDOC(This), riid, ppv); + ConnectionPointContainer *This = CONPTCONT_THIS(iface); + return IUnknown_QueryInterface(This->outer, riid, ppv); } static ULONG WINAPI ConnectionPointContainer_AddRef(IConnectionPointContainer *iface) { - HTMLDocument *This = CONPTCONT_THIS(iface); - return IHTMLDocument2_AddRef(HTMLDOC(This)); + ConnectionPointContainer *This = CONPTCONT_THIS(iface); + return IUnknown_AddRef(This->outer); } static ULONG WINAPI ConnectionPointContainer_Release(IConnectionPointContainer *iface) { - HTMLDocument *This = CONPTCONT_THIS(iface); - return IHTMLDocument2_Release(HTMLDOC(This)); + ConnectionPointContainer *This = CONPTCONT_THIS(iface); + return IUnknown_Release(This->outer); } static HRESULT WINAPI ConnectionPointContainer_EnumConnectionPoints(IConnectionPointContainer *iface, IEnumConnectionPoints **ppEnum) { - HTMLDocument *This = CONPTCONT_THIS(iface); + ConnectionPointContainer *This = CONPTCONT_THIS(iface); FIXME("(%p)->(%p)\n", This, ppEnum); return E_NOTIMPL; } @@ -241,14 +241,14 @@ static HRESULT WINAPI ConnectionPointContainer_EnumConnectionPoints(IConnectionP static HRESULT WINAPI ConnectionPointContainer_FindConnectionPoint(IConnectionPointContainer *iface, REFIID riid, IConnectionPoint **ppCP) { - HTMLDocument *This = CONPTCONT_THIS(iface); + ConnectionPointContainer *This = CONPTCONT_THIS(iface); ConnectionPoint *iter; TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppCP); *ppCP = NULL; - for(iter = &This->cp_propnotif; iter; iter = iter->next) { + for(iter = This->cp_list; iter; iter = iter->next) { if(IsEqualGUID(&iter->iid, riid)) *ppCP = CONPOINT(iter); } @@ -272,14 +272,17 @@ static const IConnectionPointContainerVtbl ConnectionPointContainerVtbl = { #undef CONPTCONT_THIS -void HTMLDocument_ConnectionPoints_Init(HTMLDocument *This) +void ConnectionPointContainer_Init(ConnectionPointContainer *This, ConnectionPoint *cp_list, + IUnknown *outer) { This->lpConnectionPointContainerVtbl = &ConnectionPointContainerVtbl; + This->cp_list = cp_list; + This->outer = outer; } -void HTMLDocument_ConnectionPoints_Destroy(HTMLDocument *This) +void ConnectionPointContainer_Destroy(ConnectionPointContainer *This) { - ConnectionPoint *iter = &This->cp_propnotif; + ConnectionPoint *iter = This->cp_list; while(iter) { ConnectionPoint_Destroy(iter); diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index 649a849..b5eee9a 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -109,7 +109,7 @@ static HRESULT WINAPI HTMLDocument_QueryInterface(IHTMLDocument2 *iface, REFIID *ppvObject = HLNKTARGET(This); }else if(IsEqualGUID(&IID_IConnectionPointContainer, riid)) { TRACE("(%p)->(IID_IConnectionPointContainer %p)\n", This, ppvObject); - *ppvObject = CONPTCONT(This); + *ppvObject = CONPTCONT(&This->cp_container); }else if(IsEqualGUID(&IID_IPersistStreamInit, riid)) { TRACE("(%p)->(IID_IPersistStreamInit %p)\n", This, ppvObject); *ppvObject = PERSTRINIT(This); @@ -171,7 +171,7 @@ static ULONG WINAPI HTMLDocument_Release(IHTMLDocument2 *iface) release_nodes(This); - HTMLDocument_ConnectionPoints_Destroy(This); + ConnectionPointContainer_Destroy(&This->cp_container); if(This->nscontainer) NSContainer_Release(This->nscontainer); @@ -1141,12 +1141,12 @@ HRESULT HTMLDocument_Create(IUnknown *pUnkOuter, REFIID riid, void** ppvObject) HTMLDocument_Window_Init(ret); HTMLDocument_Service_Init(ret); HTMLDocument_Hlink_Init(ret); - HTMLDocument_ConnectionPoints_Init(ret); ConnectionPoint_Init(&ret->cp_propnotif, ret, &IID_IPropertyNotifySink, NULL); ConnectionPoint_Init(&ret->cp_htmldocevents, ret, &DIID_HTMLDocumentEvents, &ret->cp_propnotif); ConnectionPoint_Init(&ret->cp_htmldocevents2, ret, &DIID_HTMLDocumentEvents2, &ret->cp_htmldocevents); + ConnectionPointContainer_Init(&ret->cp_container, &ret->cp_propnotif, (IUnknown*)HTMLDOC(ret)); ret->nscontainer = NSContainer_Create(ret, NULL); ret->window = HTMLWindow_Create(ret); diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index 40bf08f..ecdab3d 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -71,6 +71,13 @@ typedef enum { EDITMODE } USERMODE; +typedef struct { + const IConnectionPointContainerVtbl *lpConnectionPointContainerVtbl; + + ConnectionPoint *cp_list; + IUnknown *outer; +} ConnectionPointContainer; + struct ConnectionPoint { const IConnectionPointVtbl *lpConnectionPointVtbl; @@ -104,7 +111,6 @@ struct HTMLDocument { const IOleCommandTargetVtbl *lpOleCommandTargetVtbl; const IOleControlVtbl *lpOleControlVtbl; const IHlinkTargetVtbl *lpHlinkTargetVtbl; - const IConnectionPointContainerVtbl *lpConnectionPointContainerVtbl; const IPersistStreamInitVtbl *lpPersistStreamInitVtbl; LONG ref; @@ -137,6 +143,7 @@ struct HTMLDocument { DWORD update; + ConnectionPointContainer cp_container; ConnectionPoint cp_htmldocevents; ConnectionPoint cp_htmldocevents2; ConnectionPoint cp_propnotif; @@ -338,11 +345,10 @@ void HTMLDocument_View_Init(HTMLDocument*); void HTMLDocument_Window_Init(HTMLDocument*); void HTMLDocument_Service_Init(HTMLDocument*); void HTMLDocument_Hlink_Init(HTMLDocument*); -void HTMLDocument_ConnectionPoints_Init(HTMLDocument*); - -void HTMLDocument_ConnectionPoints_Destroy(HTMLDocument*); void ConnectionPoint_Init(ConnectionPoint*,HTMLDocument*,REFIID,ConnectionPoint*); +void ConnectionPointContainer_Init(ConnectionPointContainer*,ConnectionPoint*,IUnknown*); +void ConnectionPointContainer_Destroy(ConnectionPointContainer*); NSContainer *NSContainer_Create(HTMLDocument*,NSContainer*); void NSContainer_Release(NSContainer*);
1
0
0
0
Jacek Caban : mshtml: Store connection point as a list.
by Alexandre Julliard
29 Jun '07
29 Jun '07
Module: wine Branch: master Commit: fc4fd71e011e39e3522f1270c4b72f97a6a3b2ff URL:
http://source.winehq.org/git/wine.git/?a=commit;h=fc4fd71e011e39e3522f1270c…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Fri Jun 29 02:48:50 2007 +0200 mshtml: Store connection point as a list. --- dlls/mshtml/conpoint.c | 36 ++++++++++++++++++------------------ dlls/mshtml/htmldoc.c | 5 +++++ dlls/mshtml/mshtml_private.h | 4 ++++ 3 files changed, 27 insertions(+), 18 deletions(-) diff --git a/dlls/mshtml/conpoint.c b/dlls/mshtml/conpoint.c index 421a72e..7900ff6 100644 --- a/dlls/mshtml/conpoint.c +++ b/dlls/mshtml/conpoint.c @@ -184,13 +184,17 @@ static const IConnectionPointVtbl ConnectionPointVtbl = ConnectionPoint_EnumConnections }; -static void ConnectionPoint_Init(HTMLDocument *doc, REFIID riid, ConnectionPoint *cp) +void ConnectionPoint_Init(ConnectionPoint *cp, HTMLDocument *doc, REFIID riid, ConnectionPoint *prev) { cp->lpConnectionPointVtbl = &ConnectionPointVtbl; cp->doc = doc; cp->sinks = NULL; cp->sinks_size = 0; cp->iid = *riid; + cp->next = NULL; + + if(prev) + prev->next = cp; } static void ConnectionPoint_Destroy(ConnectionPoint *This) @@ -238,18 +242,15 @@ static HRESULT WINAPI ConnectionPointContainer_FindConnectionPoint(IConnectionPo REFIID riid, IConnectionPoint **ppCP) { HTMLDocument *This = CONPTCONT_THIS(iface); + ConnectionPoint *iter; + + TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppCP); *ppCP = NULL; - if(IsEqualGUID(&DIID_HTMLDocumentEvents, riid)) { - TRACE("(%p)->(DIID_HTMLDocumentEvents %p)\n", This, ppCP); - *ppCP = CONPOINT(&This->cp_htmldocevents); - }else if(IsEqualGUID(&DIID_HTMLDocumentEvents2, riid)) { - TRACE("(%p)->(DIID_HTMLDocumentEvents2 %p)\n", This, ppCP); - *ppCP = CONPOINT(&This->cp_htmldocevents2); - }else if(IsEqualGUID(&IID_IPropertyNotifySink, riid)) { - TRACE("(%p)->(IID_IPropertyNotifySink %p)\n", This, ppCP); - *ppCP = CONPOINT(&This->cp_propnotif); + for(iter = &This->cp_propnotif; iter; iter = iter->next) { + if(IsEqualGUID(&iter->iid, riid)) + *ppCP = CONPOINT(iter); } if(*ppCP) { @@ -257,7 +258,7 @@ static HRESULT WINAPI ConnectionPointContainer_FindConnectionPoint(IConnectionPo return S_OK; } - FIXME("(%p)->(%s %p) unsupported riid\n", This, debugstr_guid(riid), ppCP); + FIXME("unsupported riid %s\n", debugstr_guid(riid)); return CONNECT_E_NOCONNECTION; } @@ -274,15 +275,14 @@ static const IConnectionPointContainerVtbl ConnectionPointContainerVtbl = { void HTMLDocument_ConnectionPoints_Init(HTMLDocument *This) { This->lpConnectionPointContainerVtbl = &ConnectionPointContainerVtbl; - - ConnectionPoint_Init(This, &IID_IPropertyNotifySink, &This->cp_propnotif); - ConnectionPoint_Init(This, &DIID_HTMLDocumentEvents, &This->cp_htmldocevents); - ConnectionPoint_Init(This, &DIID_HTMLDocumentEvents2, &This->cp_htmldocevents2); } void HTMLDocument_ConnectionPoints_Destroy(HTMLDocument *This) { - ConnectionPoint_Destroy(&This->cp_propnotif); - ConnectionPoint_Destroy(&This->cp_htmldocevents); - ConnectionPoint_Destroy(&This->cp_htmldocevents2); + ConnectionPoint *iter = &This->cp_propnotif; + + while(iter) { + ConnectionPoint_Destroy(iter); + iter = iter->next; + } } diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index a606dac..649a849 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -1143,6 +1143,11 @@ HRESULT HTMLDocument_Create(IUnknown *pUnkOuter, REFIID riid, void** ppvObject) HTMLDocument_Hlink_Init(ret); HTMLDocument_ConnectionPoints_Init(ret); + ConnectionPoint_Init(&ret->cp_propnotif, ret, &IID_IPropertyNotifySink, NULL); + ConnectionPoint_Init(&ret->cp_htmldocevents, ret, &DIID_HTMLDocumentEvents, &ret->cp_propnotif); + ConnectionPoint_Init(&ret->cp_htmldocevents2, ret, &DIID_HTMLDocumentEvents2, + &ret->cp_htmldocevents); + ret->nscontainer = NSContainer_Create(ret, NULL); ret->window = HTMLWindow_Create(ret); diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index b343697..40bf08f 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -84,6 +84,8 @@ struct ConnectionPoint { DWORD sinks_size; IID iid; + + ConnectionPoint *next; }; struct HTMLDocument { @@ -340,6 +342,8 @@ void HTMLDocument_ConnectionPoints_Init(HTMLDocument*); void HTMLDocument_ConnectionPoints_Destroy(HTMLDocument*); +void ConnectionPoint_Init(ConnectionPoint*,HTMLDocument*,REFIID,ConnectionPoint*); + NSContainer *NSContainer_Create(HTMLDocument*,NSContainer*); void NSContainer_Release(NSContainer*);
1
0
0
0
Juan Lang : crypt32: Implement getting content for data messages opened to encode.
by Alexandre Julliard
29 Jun '07
29 Jun '07
Module: wine Branch: master Commit: f75b86f02be0d3caa030b6c89dc66e6338d5717c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f75b86f02be0d3caa030b6c89…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Thu Jun 28 17:19:45 2007 -0700 crypt32: Implement getting content for data messages opened to encode. --- dlls/crypt32/msg.c | 11 ++++++++++- dlls/crypt32/tests/msg.c | 5 ----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/dlls/crypt32/msg.c b/dlls/crypt32/msg.c index c92d6ef..4ac5cf0 100644 --- a/dlls/crypt32/msg.c +++ b/dlls/crypt32/msg.c @@ -118,8 +118,17 @@ static BOOL CDataEncodeMsg_GetParam(HCRYPTMSG hCryptMsg, DWORD dwParamType, switch (dwParamType) { case CMSG_CONTENT_PARAM: - FIXME("stub\n"); + { + CRYPT_CONTENT_INFO info; + char rsa_data[] = "1.2.840.113549.1.7.1"; + + info.pszObjId = rsa_data; + info.Content.cbData = msg->bare_content_len; + info.Content.pbData = msg->bare_content; + ret = CryptEncodeObject(X509_ASN_ENCODING, PKCS_CONTENT_INFO, &info, + pvData, pcbData); break; + } case CMSG_BARE_CONTENT_PARAM: if (!pvData) { diff --git a/dlls/crypt32/tests/msg.c b/dlls/crypt32/tests/msg.c index da534da..16ab7f6 100644 --- a/dlls/crypt32/tests/msg.c +++ b/dlls/crypt32/tests/msg.c @@ -384,7 +384,6 @@ static void test_data_msg_get_param(void) /* Content and bare content are always gettable */ size = 0; ret = CryptMsgGetParam(msg, CMSG_CONTENT_PARAM, 0, NULL, &size); - todo_wine ok(ret, "CryptMsgGetParam failed: %08x\n", GetLastError()); size = 0; ret = CryptMsgGetParam(msg, CMSG_BARE_CONTENT_PARAM, 0, NULL, &size); @@ -426,14 +425,12 @@ static void test_data_msg_encoding(void) NULL); check_param("data empty bare content", msg, CMSG_BARE_CONTENT_PARAM, dataEmptyBareContent, sizeof(dataEmptyBareContent)); - todo_wine check_param("data empty content", msg, CMSG_CONTENT_PARAM, dataEmptyContent, sizeof(dataEmptyContent)); ret = CryptMsgUpdate(msg, msgData, sizeof(msgData), TRUE); ok(ret, "CryptMsgUpdate failed: %x\n", GetLastError()); check_param("data bare content", msg, CMSG_BARE_CONTENT_PARAM, dataBareContent, sizeof(dataBareContent)); - todo_wine check_param("data content", msg, CMSG_CONTENT_PARAM, dataContent, sizeof(dataContent)); CryptMsgClose(msg); @@ -442,14 +439,12 @@ static void test_data_msg_encoding(void) CMSG_DATA, NULL, NULL, NULL); check_param("data empty bare content", msg, CMSG_BARE_CONTENT_PARAM, dataEmptyBareContent, sizeof(dataEmptyBareContent)); - todo_wine check_param("data empty content", msg, CMSG_CONTENT_PARAM, dataEmptyContent, sizeof(dataEmptyContent)); ret = CryptMsgUpdate(msg, msgData, sizeof(msgData), TRUE); ok(ret, "CryptMsgUpdate failed: %x\n", GetLastError()); check_param("data bare content", msg, CMSG_BARE_CONTENT_PARAM, dataBareContent, sizeof(dataBareContent)); - todo_wine check_param("data content", msg, CMSG_CONTENT_PARAM, dataContent, sizeof(dataContent)); CryptMsgClose(msg);
1
0
0
0
Jacek Caban : mshtml: Don't use dynamic allocation for connection points.
by Alexandre Julliard
29 Jun '07
29 Jun '07
Module: wine Branch: master Commit: fb16633d6f7c6522c3453e3efca0296630198977 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=fb16633d6f7c6522c3453e3ef…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Fri Jun 29 02:47:59 2007 +0200 mshtml: Don't use dynamic allocation for connection points. --- dlls/mshtml/conpoint.c | 50 ++++++++++++----------------------------- dlls/mshtml/mshtml_private.h | 21 +++++++++++++++-- dlls/mshtml/persist.c | 2 +- dlls/mshtml/task.c | 6 ++-- 4 files changed, 37 insertions(+), 42 deletions(-) diff --git a/dlls/mshtml/conpoint.c b/dlls/mshtml/conpoint.c index 9077baf..421a72e 100644 --- a/dlls/mshtml/conpoint.c +++ b/dlls/mshtml/conpoint.c @@ -36,21 +36,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(mshtml); #define CONPOINT(x) ((IConnectionPoint*) &(x)->lpConnectionPointVtbl); -struct ConnectionPoint { - const IConnectionPointVtbl *lpConnectionPointVtbl; - - HTMLDocument *doc; - - union { - IUnknown *unk; - IDispatch *disp; - IPropertyNotifySink *propnotif; - } *sinks; - DWORD sinks_size; - - IID iid; -}; - void call_property_onchanged(ConnectionPoint *This, DISPID dispid) { DWORD i; @@ -199,17 +184,13 @@ static const IConnectionPointVtbl ConnectionPointVtbl = ConnectionPoint_EnumConnections }; -static void ConnectionPoint_Create(HTMLDocument *doc, REFIID riid, ConnectionPoint **cp) +static void ConnectionPoint_Init(HTMLDocument *doc, REFIID riid, ConnectionPoint *cp) { - ConnectionPoint *ret = mshtml_alloc(sizeof(ConnectionPoint)); - - ret->lpConnectionPointVtbl = &ConnectionPointVtbl; - ret->doc = doc; - ret->sinks = NULL; - ret->sinks_size = 0; - memcpy(&ret->iid, riid, sizeof(IID)); - - *cp = ret; + cp->lpConnectionPointVtbl = &ConnectionPointVtbl; + cp->doc = doc; + cp->sinks = NULL; + cp->sinks_size = 0; + cp->iid = *riid; } static void ConnectionPoint_Destroy(ConnectionPoint *This) @@ -222,7 +203,6 @@ static void ConnectionPoint_Destroy(ConnectionPoint *This) } mshtml_free(This->sinks); - mshtml_free(This); } #define CONPTCONT_THIS(iface) DEFINE_THIS(HTMLDocument, ConnectionPointContainer, iface) @@ -263,13 +243,13 @@ static HRESULT WINAPI ConnectionPointContainer_FindConnectionPoint(IConnectionPo if(IsEqualGUID(&DIID_HTMLDocumentEvents, riid)) { TRACE("(%p)->(DIID_HTMLDocumentEvents %p)\n", This, ppCP); - *ppCP = CONPOINT(This->cp_htmldocevents); + *ppCP = CONPOINT(&This->cp_htmldocevents); }else if(IsEqualGUID(&DIID_HTMLDocumentEvents2, riid)) { TRACE("(%p)->(DIID_HTMLDocumentEvents2 %p)\n", This, ppCP); - *ppCP = CONPOINT(This->cp_htmldocevents2); + *ppCP = CONPOINT(&This->cp_htmldocevents2); }else if(IsEqualGUID(&IID_IPropertyNotifySink, riid)) { TRACE("(%p)->(IID_IPropertyNotifySink %p)\n", This, ppCP); - *ppCP = CONPOINT(This->cp_propnotif); + *ppCP = CONPOINT(&This->cp_propnotif); } if(*ppCP) { @@ -295,14 +275,14 @@ void HTMLDocument_ConnectionPoints_Init(HTMLDocument *This) { This->lpConnectionPointContainerVtbl = &ConnectionPointContainerVtbl; - ConnectionPoint_Create(This, &IID_IPropertyNotifySink, &This->cp_propnotif); - ConnectionPoint_Create(This, &DIID_HTMLDocumentEvents, &This->cp_htmldocevents); - ConnectionPoint_Create(This, &DIID_HTMLDocumentEvents2, &This->cp_htmldocevents2); + ConnectionPoint_Init(This, &IID_IPropertyNotifySink, &This->cp_propnotif); + ConnectionPoint_Init(This, &DIID_HTMLDocumentEvents, &This->cp_htmldocevents); + ConnectionPoint_Init(This, &DIID_HTMLDocumentEvents2, &This->cp_htmldocevents2); } void HTMLDocument_ConnectionPoints_Destroy(HTMLDocument *This) { - ConnectionPoint_Destroy(This->cp_propnotif); - ConnectionPoint_Destroy(This->cp_htmldocevents); - ConnectionPoint_Destroy(This->cp_htmldocevents2); + ConnectionPoint_Destroy(&This->cp_propnotif); + ConnectionPoint_Destroy(&This->cp_htmldocevents); + ConnectionPoint_Destroy(&This->cp_htmldocevents2); } diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index 1b8b02f..b343697 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -71,6 +71,21 @@ typedef enum { EDITMODE } USERMODE; +struct ConnectionPoint { + const IConnectionPointVtbl *lpConnectionPointVtbl; + + HTMLDocument *doc; + + union { + IUnknown *unk; + IDispatch *disp; + IPropertyNotifySink *propnotif; + } *sinks; + DWORD sinks_size; + + IID iid; +}; + struct HTMLDocument { const IHTMLDocument2Vtbl *lpHTMLDocument2Vtbl; const IHTMLDocument3Vtbl *lpHTMLDocument3Vtbl; @@ -120,9 +135,9 @@ struct HTMLDocument { DWORD update; - ConnectionPoint *cp_htmldocevents; - ConnectionPoint *cp_htmldocevents2; - ConnectionPoint *cp_propnotif; + ConnectionPoint cp_htmldocevents; + ConnectionPoint cp_htmldocevents2; + ConnectionPoint cp_propnotif; HTMLDOMNode *nodes; }; diff --git a/dlls/mshtml/persist.c b/dlls/mshtml/persist.c index 58ca422..3b606d6 100644 --- a/dlls/mshtml/persist.c +++ b/dlls/mshtml/persist.c @@ -177,7 +177,7 @@ static HRESULT set_moniker(HTMLDocument *This, IMoniker *mon, IBindCtx *pibc, BO } This->readystate = READYSTATE_LOADING; - call_property_onchanged(This->cp_propnotif, DISPID_READYSTATE); + call_property_onchanged(&This->cp_propnotif, DISPID_READYSTATE); update_doc(This, UPDATE_TITLE); HTMLDocument_LockContainer(This, TRUE); diff --git a/dlls/mshtml/task.c b/dlls/mshtml/task.c index 540c969..5204a89 100644 --- a/dlls/mshtml/task.c +++ b/dlls/mshtml/task.c @@ -135,10 +135,10 @@ static void set_parsecomplete(HTMLDocument *doc) if(doc->usermode == EDITMODE) init_editor(doc); - call_property_onchanged(doc->cp_propnotif, 1005); + call_property_onchanged(&doc->cp_propnotif, 1005); doc->readystate = READYSTATE_INTERACTIVE; - call_property_onchanged(doc->cp_propnotif, DISPID_READYSTATE); + call_property_onchanged(&doc->cp_propnotif, DISPID_READYSTATE); if(doc->client) IOleClientSite_QueryInterface(doc->client, &IID_IOleCommandTarget, (void**)&olecmd); @@ -163,7 +163,7 @@ static void set_parsecomplete(HTMLDocument *doc) } doc->readystate = READYSTATE_COMPLETE; - call_property_onchanged(doc->cp_propnotif, DISPID_READYSTATE); + call_property_onchanged(&doc->cp_propnotif, DISPID_READYSTATE); if(doc->frame) { static const WCHAR wszDone[] = {'D','o','n','e',0};
1
0
0
0
Juan Lang : crypt32: Implement getting bare content for data messages opened to encode.
by Alexandre Julliard
29 Jun '07
29 Jun '07
Module: wine Branch: master Commit: 263f424c3b27a99553d7d564b9032db17018dd2e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=263f424c3b27a99553d7d564b…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Thu Jun 28 17:19:04 2007 -0700 crypt32: Implement getting bare content for data messages opened to encode. --- dlls/crypt32/msg.c | 20 +++++++++++++++++++- dlls/crypt32/tests/msg.c | 15 +++++---------- 2 files changed, 24 insertions(+), 11 deletions(-) diff --git a/dlls/crypt32/msg.c b/dlls/crypt32/msg.c index e392b79..c92d6ef 100644 --- a/dlls/crypt32/msg.c +++ b/dlls/crypt32/msg.c @@ -112,14 +112,32 @@ static BOOL CDataEncodeMsg_Update(HCRYPTMSG hCryptMsg, const BYTE *pbData, static BOOL CDataEncodeMsg_GetParam(HCRYPTMSG hCryptMsg, DWORD dwParamType, DWORD dwIndex, void *pvData, DWORD *pcbData) { + CDataEncodeMsg *msg = (CDataEncodeMsg *)hCryptMsg; BOOL ret = FALSE; switch (dwParamType) { case CMSG_CONTENT_PARAM: - case CMSG_BARE_CONTENT_PARAM: FIXME("stub\n"); break; + case CMSG_BARE_CONTENT_PARAM: + if (!pvData) + { + *pcbData = msg->bare_content_len; + ret = TRUE; + } + else if (*pcbData < msg->bare_content_len) + { + *pcbData = msg->bare_content_len; + SetLastError(ERROR_MORE_DATA); + } + else + { + *pcbData = msg->bare_content_len; + memcpy(pvData, msg->bare_content, msg->bare_content_len); + ret = TRUE; + } + break; default: SetLastError(CRYPT_E_INVALID_MSG_TYPE); } diff --git a/dlls/crypt32/tests/msg.c b/dlls/crypt32/tests/msg.c index 47e353a..da534da 100644 --- a/dlls/crypt32/tests/msg.c +++ b/dlls/crypt32/tests/msg.c @@ -384,12 +384,11 @@ static void test_data_msg_get_param(void) /* Content and bare content are always gettable */ size = 0; ret = CryptMsgGetParam(msg, CMSG_CONTENT_PARAM, 0, NULL, &size); - todo_wine { + todo_wine ok(ret, "CryptMsgGetParam failed: %08x\n", GetLastError()); 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. */ @@ -425,38 +424,34 @@ static void test_data_msg_encoding(void) msg = CryptMsgOpenToEncode(PKCS_7_ASN_ENCODING, 0, CMSG_DATA, NULL, NULL, NULL); - todo_wine { check_param("data empty bare content", msg, CMSG_BARE_CONTENT_PARAM, dataEmptyBareContent, sizeof(dataEmptyBareContent)); + todo_wine check_param("data empty content", msg, CMSG_CONTENT_PARAM, dataEmptyContent, sizeof(dataEmptyContent)); - } ret = CryptMsgUpdate(msg, msgData, sizeof(msgData), TRUE); ok(ret, "CryptMsgUpdate failed: %x\n", GetLastError()); - todo_wine { check_param("data bare content", msg, CMSG_BARE_CONTENT_PARAM, dataBareContent, sizeof(dataBareContent)); + todo_wine check_param("data content", msg, CMSG_CONTENT_PARAM, dataContent, sizeof(dataContent)); - } CryptMsgClose(msg); /* Same test, but with CMSG_BARE_CONTENT_FLAG set */ msg = CryptMsgOpenToEncode(PKCS_7_ASN_ENCODING, CMSG_BARE_CONTENT_FLAG, CMSG_DATA, NULL, NULL, NULL); - todo_wine { check_param("data empty bare content", msg, CMSG_BARE_CONTENT_PARAM, dataEmptyBareContent, sizeof(dataEmptyBareContent)); + todo_wine check_param("data empty content", msg, CMSG_CONTENT_PARAM, dataEmptyContent, sizeof(dataEmptyContent)); - } ret = CryptMsgUpdate(msg, msgData, sizeof(msgData), TRUE); ok(ret, "CryptMsgUpdate failed: %x\n", GetLastError()); - todo_wine { check_param("data bare content", msg, CMSG_BARE_CONTENT_PARAM, dataBareContent, sizeof(dataBareContent)); + todo_wine check_param("data content", msg, CMSG_CONTENT_PARAM, dataContent, sizeof(dataContent)); - } CryptMsgClose(msg); }
1
0
0
0
Juan Lang : crypt32: Add tests for data message encoding.
by Alexandre Julliard
29 Jun '07
29 Jun '07
Module: wine Branch: master Commit: d1f379340a5d9936c76db78778fc4ba36e6472a4 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d1f379340a5d9936c76db7877…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Thu Jun 28 17:16:49 2007 -0700 crypt32: Add tests for data message encoding. --- dlls/crypt32/tests/msg.c | 72 ++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 72 insertions(+), 0 deletions(-) diff --git a/dlls/crypt32/tests/msg.c b/dlls/crypt32/tests/msg.c index 0d4ea3a..47e353a 100644 --- a/dlls/crypt32/tests/msg.c +++ b/dlls/crypt32/tests/msg.c @@ -280,6 +280,26 @@ static void test_msg_close(void) ok(ret, "CryptMsgClose failed: %x\n", GetLastError()); } +static void check_param(LPCSTR test, HCRYPTMSG msg, DWORD param, + const BYTE *expected, DWORD expectedSize) +{ + DWORD size; + LPBYTE buf; + BOOL ret; + + size = 0; + ret = CryptMsgGetParam(msg, param, 0, NULL, &size); + ok(ret, "%s: CryptMsgGetParam failed: %08x\n", test, GetLastError()); + buf = HeapAlloc(GetProcessHeap(), 0, size); + ret = CryptMsgGetParam(msg, param, 0, buf, &size); + ok(ret, "%s: CryptMsgGetParam failed: %08x\n", test, GetLastError()); + ok(size == expectedSize, "%s: expected size %d, got %d\n", test, + expectedSize, size); + if (size) + ok(!memcmp(buf, expected, size), "%s: unexpected data\n", test); + HeapFree(GetProcessHeap(), 0, buf); +} + static void test_data_msg_open(void) { HCRYPTMSG msg; @@ -389,11 +409,63 @@ static void test_data_msg_get_param(void) CryptMsgClose(msg); } +static const BYTE dataEmptyBareContent[] = { 0x04,0x00 }; +static const BYTE dataEmptyContent[] = { +0x30,0x0f,0x06,0x09,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x01,0x07,0x01,0xa0,0x02, +0x04,0x00 }; +static const BYTE dataBareContent[] = { 0x04,0x04,0x01,0x02,0x03,0x04 }; +static const BYTE dataContent[] = { +0x30,0x13,0x06,0x09,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x01,0x07,0x01,0xa0,0x06, +0x04,0x04,0x01,0x02,0x03,0x04 }; + +static void test_data_msg_encoding(void) +{ + HCRYPTMSG msg; + BOOL ret; + + msg = CryptMsgOpenToEncode(PKCS_7_ASN_ENCODING, 0, CMSG_DATA, NULL, NULL, + NULL); + todo_wine { + check_param("data empty bare content", msg, CMSG_BARE_CONTENT_PARAM, + dataEmptyBareContent, sizeof(dataEmptyBareContent)); + check_param("data empty content", msg, CMSG_CONTENT_PARAM, dataEmptyContent, + sizeof(dataEmptyContent)); + } + ret = CryptMsgUpdate(msg, msgData, sizeof(msgData), TRUE); + ok(ret, "CryptMsgUpdate failed: %x\n", GetLastError()); + todo_wine { + check_param("data bare content", msg, CMSG_BARE_CONTENT_PARAM, + dataBareContent, sizeof(dataBareContent)); + check_param("data content", msg, CMSG_CONTENT_PARAM, dataContent, + sizeof(dataContent)); + } + CryptMsgClose(msg); + /* Same test, but with CMSG_BARE_CONTENT_FLAG set */ + msg = CryptMsgOpenToEncode(PKCS_7_ASN_ENCODING, CMSG_BARE_CONTENT_FLAG, + CMSG_DATA, NULL, NULL, NULL); + todo_wine { + check_param("data empty bare content", msg, CMSG_BARE_CONTENT_PARAM, + dataEmptyBareContent, sizeof(dataEmptyBareContent)); + check_param("data empty content", msg, CMSG_CONTENT_PARAM, dataEmptyContent, + sizeof(dataEmptyContent)); + } + ret = CryptMsgUpdate(msg, msgData, sizeof(msgData), TRUE); + ok(ret, "CryptMsgUpdate failed: %x\n", GetLastError()); + todo_wine { + check_param("data bare content", msg, CMSG_BARE_CONTENT_PARAM, + dataBareContent, sizeof(dataBareContent)); + check_param("data content", msg, CMSG_CONTENT_PARAM, dataContent, + sizeof(dataContent)); + } + CryptMsgClose(msg); +} + static void test_data_msg(void) { test_data_msg_open(); test_data_msg_update(); test_data_msg_get_param(); + test_data_msg_encoding(); } START_TEST(msg)
1
0
0
0
Juan Lang : crypt32: Add a stub get param function for data messages and remove stub message from open function .
by Alexandre Julliard
29 Jun '07
29 Jun '07
Module: wine Branch: master Commit: 0546cf1a696125b82843959a5d0d7de36a5abb40 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=0546cf1a696125b82843959a5…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Thu Jun 28 17:16:15 2007 -0700 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 b88694a..e392b79 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 03d0abf..0d4ea3a 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); }
1
0
0
0
Juan Lang : crypt32: Implement CryptMsgUpdate for data messages opened to encode.
by Alexandre Julliard
29 Jun '07
29 Jun '07
Module: wine Branch: master Commit: 74bf713be79c40be97c37f2a83257e04447300e7 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=74bf713be79c40be97c37f2a8…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Thu Jun 28 17:14:02 2007 -0700 crypt32: Implement CryptMsgUpdate for data messages opened to encode. --- dlls/crypt32/msg.c | 53 ++++++++++++++++++++++++++++++++++++++++++++++ dlls/crypt32/tests/msg.c | 8 ------- 2 files changed, 53 insertions(+), 8 deletions(-) diff --git a/dlls/crypt32/msg.c b/dlls/crypt32/msg.c index c701107..b88694a 100644 --- a/dlls/crypt32/msg.c +++ b/dlls/crypt32/msg.c @@ -58,8 +58,57 @@ static inline void CryptMsgBase_Init(CryptMsgBase *msg, DWORD dwFlags, typedef struct _CDataEncodeMsg { CryptMsgBase base; + DWORD bare_content_len; + LPBYTE bare_content; } CDataEncodeMsg; +static const BYTE empty_data_content[] = { 0x04,0x00 }; + +static void CDataEncodeMsg_Close(HCRYPTMSG hCryptMsg) +{ + CDataEncodeMsg *msg = (CDataEncodeMsg *)hCryptMsg; + + if (msg->bare_content != empty_data_content) + LocalFree(msg->bare_content); +} + +static BOOL CDataEncodeMsg_Update(HCRYPTMSG hCryptMsg, const BYTE *pbData, + DWORD cbData, BOOL fFinal) +{ + CDataEncodeMsg *msg = (CDataEncodeMsg *)hCryptMsg; + BOOL ret = FALSE; + + if (msg->base.finalized) + SetLastError(CRYPT_E_MSG_ERROR); + else if (!fFinal) + { + if (msg->base.open_flags & CMSG_DETACHED_FLAG) + SetLastError(E_INVALIDARG); + else + SetLastError(CRYPT_E_MSG_ERROR); + } + else + { + msg->base.finalized = TRUE; + if (!cbData) + SetLastError(E_INVALIDARG); + else + { + CRYPT_DATA_BLOB blob = { cbData, (LPBYTE)pbData }; + + /* data messages don't allow non-final updates, don't bother + * checking whether data already exist, they can't. + */ + ret = CryptEncodeObjectEx(X509_ASN_ENCODING, X509_OCTET_STRING, + &blob, CRYPT_ENCODE_ALLOC_FLAG, NULL, &msg->bare_content, + &msg->bare_content_len); + if (ret && msg->base.stream_info) + FIXME("stream info unimplemented\n"); + } + } + return ret; +} + static HCRYPTMSG CDataEncodeMsg_Open(DWORD dwFlags, const void *pvMsgEncodeInfo, LPSTR pszInnerContentObjID, PCMSG_STREAM_INFO pStreamInfo) { @@ -75,6 +124,10 @@ static HCRYPTMSG CDataEncodeMsg_Open(DWORD dwFlags, const void *pvMsgEncodeInfo, if (msg) { CryptMsgBase_Init((CryptMsgBase *)msg, dwFlags, pStreamInfo); + msg->base.close = CDataEncodeMsg_Close; + msg->base.update = CDataEncodeMsg_Update; + msg->bare_content_len = sizeof(empty_data_content); + msg->bare_content = (LPBYTE)empty_data_content; } return (HCRYPTMSG)msg; } diff --git a/dlls/crypt32/tests/msg.c b/dlls/crypt32/tests/msg.c index df5e83f..03d0abf 100644 --- a/dlls/crypt32/tests/msg.c +++ b/dlls/crypt32/tests/msg.c @@ -309,17 +309,14 @@ static void test_data_msg_update(void) /* Can't update a message that wasn't opened detached with final = FALSE */ SetLastError(0xdeadbeef); ret = CryptMsgUpdate(msg, NULL, 0, FALSE); - todo_wine ok(!ret && GetLastError() == CRYPT_E_MSG_ERROR, "Expected CRYPT_E_MSG_ERROR, got %x\n", GetLastError()); /* Updating it with final = TRUE succeeds */ ret = CryptMsgUpdate(msg, msgData, sizeof(msgData), TRUE); - todo_wine ok(ret, "CryptMsgUpdate failed: %x\n", GetLastError()); /* Any subsequent update will fail, as the last was final */ SetLastError(0xdeadbeef); ret = CryptMsgUpdate(msg, msgData, sizeof(msgData), TRUE); - todo_wine ok(!ret && GetLastError() == CRYPT_E_MSG_ERROR, "Expected CRYPT_E_MSG_ERROR, got %x\n", GetLastError()); CryptMsgClose(msg); @@ -329,7 +326,6 @@ static void test_data_msg_update(void) /* Can't update a message with no data */ SetLastError(0xdeadbeef); ret = CryptMsgUpdate(msg, NULL, 0, TRUE); - todo_wine { ok(!ret && GetLastError() == E_INVALIDARG, "Expected E_INVALIDARG, got %x\n", GetLastError()); /* Curiously, a valid update will now fail as well, presumably because of @@ -338,7 +334,6 @@ static void test_data_msg_update(void) ret = CryptMsgUpdate(msg, msgData, sizeof(msgData), TRUE); ok(!ret && GetLastError() == CRYPT_E_MSG_ERROR, "Expected CRYPT_E_MSG_ERROR, got %x\n", GetLastError()); - } CryptMsgClose(msg); msg = CryptMsgOpenToEncode(PKCS_7_ASN_ENCODING, CMSG_DETACHED_FLAG, @@ -346,16 +341,13 @@ static void test_data_msg_update(void) /* Dont appear to be able to update CMSG-DATA with non-final updates */ SetLastError(0xdeadbeef); ret = CryptMsgUpdate(msg, NULL, 0, FALSE); - todo_wine ok(!ret && GetLastError() == E_INVALIDARG, "Expected E_INVALIDARG, got %x\n", GetLastError()); SetLastError(0xdeadbeef); ret = CryptMsgUpdate(msg, msgData, sizeof(msgData), FALSE); - todo_wine ok(!ret && GetLastError() == E_INVALIDARG, "Expected E_INVALIDARG, got %x\n", GetLastError()); ret = CryptMsgUpdate(msg, msgData, sizeof(msgData), TRUE); - todo_wine ok(ret, "CryptMsgUpdate failed: %x\n", GetLastError()); CryptMsgClose(msg); }
1
0
0
0
Juan Lang : crypt32: Add a finalized member to message.
by Alexandre Julliard
29 Jun '07
29 Jun '07
Module: wine Branch: master Commit: b6bf594aa571731392acace33cab4ae731a4dbc5 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b6bf594aa571731392acace33…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Thu Jun 28 16:53:37 2007 -0700 crypt32: Add a finalized member to message. --- dlls/crypt32/msg.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/dlls/crypt32/msg.c b/dlls/crypt32/msg.c index 5087308..c701107 100644 --- a/dlls/crypt32/msg.c +++ b/dlls/crypt32/msg.c @@ -40,6 +40,7 @@ typedef struct _CryptMsgBase LONG ref; DWORD open_flags; PCMSG_STREAM_INFO stream_info; + BOOL finalized; CryptMsgCloseFunc close; CryptMsgUpdateFunc update; CryptMsgGetParamFunc get_param; @@ -51,6 +52,7 @@ static inline void CryptMsgBase_Init(CryptMsgBase *msg, DWORD dwFlags, msg->ref = 1; msg->open_flags = dwFlags; msg->stream_info = pStreamInfo; + msg->finalized = FALSE; } typedef struct _CDataEncodeMsg
1
0
0
0
Juan Lang : crypt32: Store stream info in message.
by Alexandre Julliard
29 Jun '07
29 Jun '07
Module: wine Branch: master Commit: 203849d75d0a62e1b1b970cb73941755642f8123 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=203849d75d0a62e1b1b970cb7…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Thu Jun 28 16:52:37 2007 -0700 crypt32: Store stream info in message. --- dlls/crypt32/msg.c | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/dlls/crypt32/msg.c b/dlls/crypt32/msg.c index 5368515..5087308 100644 --- a/dlls/crypt32/msg.c +++ b/dlls/crypt32/msg.c @@ -39,15 +39,18 @@ typedef struct _CryptMsgBase { LONG ref; DWORD open_flags; + PCMSG_STREAM_INFO stream_info; CryptMsgCloseFunc close; CryptMsgUpdateFunc update; CryptMsgGetParamFunc get_param; } CryptMsgBase; -static inline void CryptMsgBase_Init(CryptMsgBase *msg, DWORD dwFlags) +static inline void CryptMsgBase_Init(CryptMsgBase *msg, DWORD dwFlags, + PCMSG_STREAM_INFO pStreamInfo) { msg->ref = 1; msg->open_flags = dwFlags; + msg->stream_info = pStreamInfo; } typedef struct _CDataEncodeMsg @@ -69,7 +72,7 @@ static HCRYPTMSG CDataEncodeMsg_Open(DWORD dwFlags, const void *pvMsgEncodeInfo, msg = CryptMemAlloc(sizeof(CDataEncodeMsg)); if (msg) { - CryptMsgBase_Init((CryptMsgBase *)msg, dwFlags); + CryptMsgBase_Init((CryptMsgBase *)msg, dwFlags, pStreamInfo); } return (HCRYPTMSG)msg; }
1
0
0
0
← Newer
1
2
3
4
5
6
...
86
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
Results per page:
10
25
50
100
200