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 2008
----- 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
3 participants
944 discussions
Start a n
N
ew thread
Jacek Caban : mshtml: Added IHTMLElement::put_className implementation.
by Alexandre Julliard
23 Jun '08
23 Jun '08
Module: wine Branch: master Commit: 47d835206708bdedb63d779614056dca17ace71f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=47d835206708bdedb63d77961…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon Jun 23 09:52:17 2008 -0500 mshtml: Added IHTMLElement::put_className implementation. --- dlls/mshtml/htmlelem.c | 19 +++++++++++++++++-- dlls/mshtml/tests/dom.c | 18 ++++++++++++++++++ 2 files changed, 35 insertions(+), 2 deletions(-) diff --git a/dlls/mshtml/htmlelem.c b/dlls/mshtml/htmlelem.c index 8956065..ce93399 100644 --- a/dlls/mshtml/htmlelem.c +++ b/dlls/mshtml/htmlelem.c @@ -252,8 +252,23 @@ static HRESULT WINAPI HTMLElement_removeAttribute(IHTMLElement *iface, BSTR strA static HRESULT WINAPI HTMLElement_put_className(IHTMLElement *iface, BSTR v) { HTMLElement *This = HTMLELEM_THIS(iface); - FIXME("(%p)->(%s)\n", This, debugstr_w(v)); - return E_NOTIMPL; + nsAString classname_str; + nsresult nsres; + + TRACE("(%p)->(%s)\n", This, debugstr_w(v)); + + if(!This->nselem) { + FIXME("NULL nselem\n"); + return E_NOTIMPL; + } + + nsAString_Init(&classname_str, v); + nsres = nsIDOMHTMLElement_SetClassName(This->nselem, &classname_str); + nsAString_Finish(&classname_str); + if(NS_FAILED(nsres)) + ERR("SetClassName failed: %08x\n", nsres); + + return S_OK; } static HRESULT WINAPI HTMLElement_get_className(IHTMLElement *iface, BSTR *p) diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c index e67ca76..5624020 100644 --- a/dlls/mshtml/tests/dom.c +++ b/dlls/mshtml/tests/dom.c @@ -935,6 +935,22 @@ static void _test_elem_class(unsigned line, IUnknown *unk, const char *exclass) SysFreeString(class); } +#define test_elem_set_class(u,c) _test_elem_set_class(__LINE__,u,c) +static void _test_elem_set_class(unsigned line, IUnknown *unk, const char *class) +{ + IHTMLElement *elem = _get_elem_iface(line, unk); + BSTR tmp; + HRESULT hres; + + tmp = class ? a2bstr(class) : NULL; + hres = IHTMLElement_put_className(elem, tmp); + IHTMLElement_Release(elem); + ok_(__FILE__,line) (hres == S_OK, "put_className failed: %08x\n", hres); + SysFreeString(tmp); + + _test_elem_class(line, unk, class); +} + #define get_child_item(c,i) _get_child_item(__LINE__,c,i) static IHTMLDOMNode *_get_child_item(unsigned line, IHTMLDOMChildrenCollection *col, long idx) { @@ -1804,6 +1820,8 @@ static void test_elems(IHTMLDocument2 *doc) test_elem_attr(elem, xxxW, NULL); test_elem_attr(elem, idW, sW); test_elem_class((IUnknown*)elem, NULL); + test_elem_set_class((IUnknown*)elem, "cl"); + test_elem_set_class((IUnknown*)elem, NULL); IHTMLElement_Release(elem); }
1
0
0
0
Jacek Caban : mshtml: Return NULL instead of empty string in IHTMLElement: :get_className.
by Alexandre Julliard
23 Jun '08
23 Jun '08
Module: wine Branch: master Commit: 0497c9896154350512282668e48ba4e01e0c3172 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=0497c9896154350512282668e…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon Jun 23 09:51:28 2008 -0500 mshtml: Return NULL instead of empty string in IHTMLElement::get_className. --- dlls/mshtml/htmlelem.c | 2 +- dlls/mshtml/tests/dom.c | 21 ++++++++++++++++++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/dlls/mshtml/htmlelem.c b/dlls/mshtml/htmlelem.c index d4e1d4d..8956065 100644 --- a/dlls/mshtml/htmlelem.c +++ b/dlls/mshtml/htmlelem.c @@ -276,7 +276,7 @@ static HRESULT WINAPI HTMLElement_get_className(IHTMLElement *iface, BSTR *p) if(NS_SUCCEEDED(nsres)) { const PRUnichar *class; nsAString_GetData(&class_str, &class); - *p = SysAllocString(class); + *p = *class ? SysAllocString(class) : NULL; }else { ERR("GetClassName failed: %08x\n", nsres); hres = E_FAIL; diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c index eb07b90..e67ca76 100644 --- a/dlls/mshtml/tests/dom.c +++ b/dlls/mshtml/tests/dom.c @@ -42,7 +42,7 @@ static const char elem_test_str[] = "<html><head><title>test</title><style>.body { margin-right: 0px; }</style>" "<body>text test<!-- a comment -->" "<a href=\"
http://test\
" name=\"x\">link</a>" - "<input id=\"in\" />" + "<input id=\"in\" class=\"testclass\"/>" "<select id=\"s\"><option id=\"x\">opt1</option><option id=\"y\">opt2</option></select>" "<textarea id=\"X\">text text</textarea>" "<table><tbody></tbody></table>" @@ -918,6 +918,23 @@ static IHTMLDOMChildrenCollection *_get_child_nodes(unsigned line, IUnknown *unk return col; } +#define test_elem_class(u,c) _test_elem_class(__LINE__,u,c) +static void _test_elem_class(unsigned line, IUnknown *unk, const char *exclass) +{ + IHTMLElement *elem = _get_elem_iface(line, unk); + BSTR class = (void*)0xdeadbeef; + HRESULT hres; + + hres = IHTMLElement_get_className(elem, &class); + IHTMLElement_Release(elem); + ok_(__FILE__,line) (hres == S_OK, "get_className failed: %08x\n", hres); + if(exclass) + ok_(__FILE__,line) (!strcmp_wa(class, exclass), "unexpected className %s\n", dbgstr_w(class)); + else + ok_(__FILE__,line) (!class, "class != NULL\n"); + SysFreeString(class); +} + #define get_child_item(c,i) _get_child_item(__LINE__,c,i) static IHTMLDOMNode *_get_child_item(unsigned line, IHTMLDOMChildrenCollection *col, long idx) { @@ -1786,6 +1803,7 @@ static void test_elems(IHTMLDocument2 *doc) test_elem_type((IUnknown*)elem, ET_SELECT); test_elem_attr(elem, xxxW, NULL); test_elem_attr(elem, idW, sW); + test_elem_class((IUnknown*)elem, NULL); IHTMLElement_Release(elem); } @@ -1846,6 +1864,7 @@ static void test_elems(IHTMLDocument2 *doc) test_input_value((IUnknown*)elem, NULL); test_input_put_value((IUnknown*)elem, "test"); test_input_value((IUnknown*)elem, NULL); + test_elem_class((IUnknown*)elem, "testclass"); IHTMLInputElement_Release(input); IHTMLElement_Release(elem);
1
0
0
0
Jacek Caban : mshtml: Added IHTMLDocument3::createTextNode implementation.
by Alexandre Julliard
23 Jun '08
23 Jun '08
Module: wine Branch: master Commit: 39c7951cf1b95b76f2b9a4bf2aaad068034211dc URL:
http://source.winehq.org/git/wine.git/?a=commit;h=39c7951cf1b95b76f2b9a4bf2…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon Jun 23 09:50:22 2008 -0500 mshtml: Added IHTMLDocument3::createTextNode implementation. --- dlls/mshtml/htmldoc3.c | 27 +++++++++++++++++++++++++-- dlls/mshtml/tests/dom.c | 25 +++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 2 deletions(-) diff --git a/dlls/mshtml/htmldoc3.c b/dlls/mshtml/htmldoc3.c index 4fbd131..92ed1cc 100644 --- a/dlls/mshtml/htmldoc3.c +++ b/dlls/mshtml/htmldoc3.c @@ -108,8 +108,31 @@ static HRESULT WINAPI HTMLDocument3_createTextNode(IHTMLDocument3 *iface, BSTR t IHTMLDOMNode **newTextNode) { HTMLDocument *This = HTMLDOC3_THIS(iface); - FIXME("(%p)->(%s %p)\n", This, debugstr_w(text), newTextNode); - return E_NOTIMPL; + nsIDOMDocument *nsdoc; + nsIDOMText *nstext; + HTMLDOMNode *node; + nsAString text_str; + nsresult nsres; + + TRACE("(%p)->(%s %p)\n", This, debugstr_w(text), newTextNode); + + nsIWebNavigation_GetDocument(This->nscontainer->navigation, &nsdoc); + + nsAString_Init(&text_str, text); + nsres = nsIDOMDocument_CreateTextNode(nsdoc, &text_str, &nstext); + nsAString_Finish(&text_str); + nsIDOMDocument_Release(nsdoc); + if(NS_FAILED(nsres)) { + ERR("CreateTextNode failed: %08x\n", nsres); + return E_FAIL; + } + + node = HTMLDOMTextNode_Create(This, (nsIDOMNode*)nstext); + nsIDOMElement_Release(nstext); + + *newTextNode = HTMLDOMNODE(node); + IHTMLDOMNode_AddRef(HTMLDOMNODE(node)); + return S_OK; } static HRESULT WINAPI HTMLDocument3_get_documentElement(IHTMLDocument3 *iface, IHTMLElement **p) diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c index b64555d..eb07b90 100644 --- a/dlls/mshtml/tests/dom.c +++ b/dlls/mshtml/tests/dom.c @@ -1035,6 +1035,26 @@ static IHTMLElement *_test_create_elem(unsigned line, IHTMLDocument2 *doc, const return elem; } +#define test_create_text(d,t) _test_create_text(__LINE__,d,t) +static IHTMLDOMNode *_test_create_text(unsigned line, IHTMLDocument2 *doc, const char *text) +{ + IHTMLDocument3 *doc3; + IHTMLDOMNode *node = NULL; + BSTR tmp; + HRESULT hres; + + hres = IHTMLDocument2_QueryInterface(doc, &IID_IHTMLDocument3, (void**)&doc3); + ok_(__FILE__,line) (hres == S_OK, "Could not get IHTMLDocument3: %08x\n", hres); + + tmp = a2bstr(text); + hres = IHTMLDocument3_createTextNode(doc3, tmp, &node); + IHTMLDocument3_Release(doc3); + ok_(__FILE__,line) (hres == S_OK, "createElement failed: %08x\n", hres); + ok_(__FILE__,line) (node != NULL, "node == NULL\n"); + + return node; +} + #define test_node_append_child(n,c) _test_node_append_child(__LINE__,n,c) static IHTMLDOMNode *_test_node_append_child(unsigned line, IUnknown *node_unk, IUnknown *child_unk) { @@ -1932,6 +1952,11 @@ static void test_create_elems(IHTMLDocument2 *doc) IHTMLElement_Release(elem2); IHTMLElement_Release(body); IHTMLElement_Release(elem); + + node = test_create_text(doc, "test"); + test_ifaces((IUnknown*)node, text_iids); + test_disp((IUnknown*)node, &DIID_DispHTMLDOMTextNode); + IHTMLDOMNode_Release(node); } static void test_exec(IUnknown *unk, const GUID *grpid, DWORD cmdid, VARIANT *in, VARIANT *out)
1
0
0
0
Jacek Caban : mshtml: Added IHTMLDOMNode::appendChild implementation.
by Alexandre Julliard
23 Jun '08
23 Jun '08
Module: wine Branch: master Commit: 19803de2b453186cac556fc6c7b64bdaf1940d40 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=19803de2b453186cac556fc6c…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon Jun 23 09:49:26 2008 -0500 mshtml: Added IHTMLDOMNode::appendChild implementation. --- dlls/mshtml/htmlnode.c | 47 +++++++++++++++++++++++++++++++++++++++++++++-- dlls/mshtml/tests/dom.c | 44 +++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 88 insertions(+), 3 deletions(-) diff --git a/dlls/mshtml/htmlnode.c b/dlls/mshtml/htmlnode.c index afcf363..6886508 100644 --- a/dlls/mshtml/htmlnode.c +++ b/dlls/mshtml/htmlnode.c @@ -31,6 +31,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(mshtml); +static HTMLDOMNode *get_node_obj(HTMLDocument*,IUnknown*); + typedef struct { DispatchEx dispex; const IHTMLDOMChildrenCollectionVtbl *lpIHTMLDOMChildrenCollectionVtbl; @@ -424,8 +426,26 @@ static HRESULT WINAPI HTMLDOMNode_appendChild(IHTMLDOMNode *iface, IHTMLDOMNode IHTMLDOMNode **node) { HTMLDOMNode *This = HTMLDOMNODE_THIS(iface); - FIXME("(%p)->(%p %p)\n", This, newChild, node); - return E_NOTIMPL; + HTMLDOMNode *node_obj; + nsIDOMNode *nsnode; + nsresult nsres; + + TRACE("(%p)->(%p %p)\n", This, newChild, node); + + node_obj = get_node_obj(This->doc, (IUnknown*)newChild); + if(!node_obj) + return E_FAIL; + + nsres = nsIDOMNode_AppendChild(This->nsnode, node_obj->nsnode, &nsnode); + if(NS_FAILED(nsres)) { + ERR("AppendChild failed: %08x\n", nsres); + return E_FAIL; + } + + /* FIXME: Make sure that node != newChild */ + *node = HTMLDOMNODE(get_node(This->doc, nsnode, TRUE)); + IHTMLDOMNode_AddRef(*node); + return S_OK; } static HRESULT WINAPI HTMLDOMNode_get_nodeName(IHTMLDOMNode *iface, BSTR *p) @@ -769,6 +789,29 @@ HTMLDOMNode *get_node(HTMLDocument *This, nsIDOMNode *nsnode, BOOL create) return create_node(This, nsnode); } +/* + * FIXME + * We should use better way for getting node object (like private interface) + * or avoid it at all. + */ +static HTMLDOMNode *get_node_obj(HTMLDocument *This, IUnknown *iface) +{ + HTMLDOMNode *iter = This->nodes; + IHTMLDOMNode *node; + + IUnknown_QueryInterface(iface, &IID_IHTMLDOMNode, (void**)&node); + IHTMLDOMNode_Release(node); + + while(iter) { + if(HTMLDOMNODE(iter) == node) + return iter; + iter = iter->next; + } + + FIXME("Not found %p\n", iface); + return NULL; +} + void release_nodes(HTMLDocument *This) { HTMLDOMNode *iter, *next; diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c index 8611a41..b64555d 100644 --- a/dlls/mshtml/tests/dom.c +++ b/dlls/mshtml/tests/dom.c @@ -1035,6 +1035,25 @@ static IHTMLElement *_test_create_elem(unsigned line, IHTMLDocument2 *doc, const return elem; } +#define test_node_append_child(n,c) _test_node_append_child(__LINE__,n,c) +static IHTMLDOMNode *_test_node_append_child(unsigned line, IUnknown *node_unk, IUnknown *child_unk) +{ + IHTMLDOMNode *node = _get_node_iface(line, node_unk); + IHTMLDOMNode *child = _get_node_iface(line, child_unk); + IHTMLDOMNode *new_child = NULL; + HRESULT hres; + + hres = IHTMLDOMNode_appendChild(node, child, &new_child); + ok_(__FILE__,line) (hres == S_OK, "appendChild failed: %08x\n", hres); + ok_(__FILE__,line) (new_child != NULL, "new_child == NULL\n"); + /* TODO ok_(__FILE__,line) (new_child != child, "new_child == child\n"); */ + + IHTMLDOMNode_Release(node); + IHTMLDOMNode_Release(child); + + return new_child; +} + static void test_elem_col_item(IHTMLElementCollection *col, LPCWSTR n, const elem_type_t *elem_types, long len) { @@ -1879,8 +1898,14 @@ static void test_elems(IHTMLDocument2 *doc) static void test_create_elems(IHTMLDocument2 *doc) { - IHTMLElement *elem; + IHTMLElementCollection *col; + IHTMLElement *elem, *body, *elem2; + IHTMLDOMNode *node; + IDispatch *disp; long type; + HRESULT hres; + + static const elem_type_t types1[] = { ET_TESTG }; elem = test_create_elem(doc, "TEST"); test_elem_tag((IUnknown*)elem, "TEST"); @@ -1889,6 +1914,23 @@ static void test_create_elems(IHTMLDocument2 *doc) test_ifaces((IUnknown*)elem, elem_iids); test_disp((IUnknown*)elem, &DIID_DispHTMLGenericElement); + hres = IHTMLDocument2_get_body(doc, &body); + ok(hres == S_OK, "get_body failed: %08x\n", hres); + + node = test_node_append_child((IUnknown*)body, (IUnknown*)elem); + elem2 = get_elem_iface((IUnknown*)node); + IHTMLDOMNode_Release(node); + + hres = IHTMLElement_get_all(body, &disp); + ok(hres == S_OK, "get_all failed: %08x\n", hres); + hres = IDispatch_QueryInterface(disp, &IID_IHTMLElementCollection, (void**)&col); + ok(hres == S_OK, "Could not get IHTMLElementCollection: %08x\n", hres); + IDispatch_Release(disp); + + test_elem_collection(col, types1, sizeof(types1)/sizeof(types1[0])); + + IHTMLElement_Release(elem2); + IHTMLElement_Release(body); IHTMLElement_Release(elem); }
1
0
0
0
Huw Davies : winspool.drv: Make sure the printer driver registry entry exists.
by Alexandre Julliard
23 Jun '08
23 Jun '08
Module: wine Branch: master Commit: 4f6f415aaa2dbc4a00b2b1b7dfe0ec5c5ed9a253 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4f6f415aaa2dbc4a00b2b1b7d…
Author: Huw Davies <huw(a)codeweavers.com> Date: Mon Jun 23 17:12:12 2008 +0100 winspool.drv: Make sure the printer driver registry entry exists. --- dlls/winspool.drv/info.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/dlls/winspool.drv/info.c b/dlls/winspool.drv/info.c index abc3397..b49dd53 100644 --- a/dlls/winspool.drv/info.c +++ b/dlls/winspool.drv/info.c @@ -524,6 +524,7 @@ static BOOL CUPS_LoadPrinters(void) TRACE("Printer already exists\n"); RegDeleteValueW(hkeyPrinter, May_Delete_Value); RegCloseKey(hkeyPrinter); + add_printer_driver(dests[i].name); } else { static CHAR data_type[] = "RAW", print_proc[] = "WinPrint", @@ -661,6 +662,7 @@ PRINTCAP_ParseEntry(const char *pent, BOOL isfirst) { TRACE("Printer already exists\n"); RegDeleteValueW(hkeyPrinter, May_Delete_Value); RegCloseKey(hkeyPrinter); + add_printer_driver(devname); } else { static CHAR data_type[] = "RAW", print_proc[] = "WinPrint",
1
0
0
0
Paul Vriens : setupapi/tests: Fix a test on NT4.
by Alexandre Julliard
23 Jun '08
23 Jun '08
Module: wine Branch: master Commit: 4fe5683ce43fe5a90642087b6a01efef67bbc164 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4fe5683ce43fe5a90642087b6…
Author: Paul Vriens <paul.vriens.wine(a)gmail.com> Date: Mon Jun 23 17:47:49 2008 +0200 setupapi/tests: Fix a test on NT4. --- dlls/setupapi/tests/devinst.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/dlls/setupapi/tests/devinst.c b/dlls/setupapi/tests/devinst.c index 2dbfdcc..8fcff08 100644 --- a/dlls/setupapi/tests/devinst.c +++ b/dlls/setupapi/tests/devinst.c @@ -602,7 +602,8 @@ static void testGetDeviceInstanceId(void) ret = pSetupDiGetDeviceInstanceIdA(set, &devInfo, instanceID, sizeof(instanceID), NULL); ok(ret, "SetupDiGetDeviceInstanceIdA failed: %08x\n", GetLastError()); - ok(!lstrcmpA(instanceID, "ROOT\\LEGACY_BOGUS\\0001"), + /* NT4 returns 'Root' and W2K and above 'ROOT' */ + ok(!lstrcmpiA(instanceID, "ROOT\\LEGACY_BOGUS\\0001"), "Unexpected instance ID %s\n", instanceID); pSetupDiDestroyDeviceInfoList(set); }
1
0
0
0
Paul Vriens : setupapi/tests: Remove a registry key on failure for NT4.
by Alexandre Julliard
23 Jun '08
23 Jun '08
Module: wine Branch: master Commit: 0b773df85fe0dfcdfc6e78d1a782c8e84fbccd22 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=0b773df85fe0dfcdfc6e78d1a…
Author: Paul Vriens <paul.vriens.wine(a)gmail.com> Date: Mon Jun 23 17:27:37 2008 +0200 setupapi/tests: Remove a registry key on failure for NT4. --- dlls/setupapi/tests/devinst.c | 62 ++++++++++++++++++++++++++++++++++++++++- 1 files changed, 61 insertions(+), 1 deletions(-) diff --git a/dlls/setupapi/tests/devinst.c b/dlls/setupapi/tests/devinst.c index 64035d7..2dbfdcc 100644 --- a/dlls/setupapi/tests/devinst.c +++ b/dlls/setupapi/tests/devinst.c @@ -89,6 +89,39 @@ static void init_function_pointers(void) pSetupDiGetDeviceRegistryPropertyW = (void *)GetProcAddress(hSetupAPI, "SetupDiGetDeviceRegistryPropertyW"); } +static void change_reg_permissions(const WCHAR *regkey) +{ + HKEY hkey; + SID_IDENTIFIER_AUTHORITY ident = { SECURITY_WORLD_SID_AUTHORITY }; + SECURITY_DESCRIPTOR sd; + PSID EveryoneSid; + PACL pacl = NULL; + + RegOpenKeyExW(HKEY_LOCAL_MACHINE, regkey, 0, WRITE_DAC, &hkey); + + /* Initialize the 'Everyone' sid */ + AllocateAndInitializeSid(&ident, 1, SECURITY_WORLD_RID, 0, 0, 0, 0, 0, 0, 0, &EveryoneSid); + + pacl = HeapAlloc(GetProcessHeap(), 0, 256); + InitializeAcl(pacl, 256, ACL_REVISION); + + /* Add 'Full Control' for 'Everyone' */ + AddAccessAllowedAce(pacl, ACL_REVISION, KEY_ALL_ACCESS, EveryoneSid); + + InitializeSecurityDescriptor(&sd, SECURITY_DESCRIPTOR_REVISION); + + SetSecurityDescriptorDacl(&sd, TRUE, pacl, FALSE); + + /* Set the new security on the registry key */ + RegSetKeySecurity(hkey, DACL_SECURITY_INFORMATION, &sd); + + RegCloseKey(hkey); + + HeapFree(GetProcessHeap(), 0, pacl); + if (EveryoneSid) + FreeSid(EveryoneSid); +} + static BOOL remove_device(void) { HDEVINFO set; @@ -400,19 +433,46 @@ static void testCreateDeviceInfo(void) DWORD i; static GUID deadbeef = {0xdeadbeef, 0xdead, 0xbeef, {0xde,0xad,0xbe,0xef,0xde,0xad,0xbe,0xef}}; + LONG res; + HKEY key; + static const WCHAR bogus0000[] = {'S','y','s','t','e','m','\\', + 'C','u','r','r','e','n','t','C','o','n','t','r','o','l','S','e','t','\\', + 'E','n','u','m','\\','R','o','o','t','\\', + 'L','E','G','A','C','Y','_','B','O','G','U','S','\\','0','0','0','0',0}; + /* So we know we have a clean start */ + res = RegOpenKeyW(HKEY_LOCAL_MACHINE, bogus0000, &key); + ok(res != ERROR_SUCCESS, "Expected key to not exist\n"); /* No GUID given */ SetLastError(0xdeadbeef); ret = pSetupDiCreateDeviceInfoA(set, "Root\\LEGACY_BOGUS\\0000", NULL, NULL, NULL, 0, NULL); ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %08x\n", GetLastError()); + /* Even though NT4 fails it still adds some stuff to the registry that + * can't be deleted via normal setupapi functions. As the registry is written + * by a different user (SYSTEM) we have to do some magic to get rid of the key + */ + if (!RegOpenKeyW(HKEY_LOCAL_MACHINE, bogus0000, &key)) + { + trace("NT4 created a bogus key on failure, will be removed now\n"); + change_reg_permissions(bogus0000); + ok(!RegDeleteKeyW(HKEY_LOCAL_MACHINE, bogus0000), + "Could not delete LEGACY_BOGUS\\0000 key\n"); + } /* We can't add device information to the set with a different GUID */ SetLastError(0xdeadbeef); ret = pSetupDiCreateDeviceInfoA(set, "Root\\LEGACY_BOGUS\\0000", &deadbeef, NULL, NULL, 0, NULL); ok(!ret && GetLastError() == ERROR_CLASS_MISMATCH, "Expected ERROR_CLASS_MISMATCH, got %08x\n", GetLastError()); + if (!RegOpenKeyW(HKEY_LOCAL_MACHINE, bogus0000, &key)) + { + trace("NT4 created a bogus key on failure, will be removed now\n"); + change_reg_permissions(bogus0000); + ok(!RegDeleteKeyW(HKEY_LOCAL_MACHINE, bogus0000), + "Could not delete LEGACY_BOGUS\\0000 key\n"); + } /* Finally, with all three required parameters, this succeeds: */ ret = pSetupDiCreateDeviceInfoA(set, "Root\\LEGACY_BOGUS\\0000", &guid, NULL, NULL, 0, NULL);
1
0
0
0
Paul Vriens : setupapi/tests: Prevent crash on NT4.
by Alexandre Julliard
23 Jun '08
23 Jun '08
Module: wine Branch: master Commit: f544b039cf56a634d5f652e4ca7941823da91a8e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f544b039cf56a634d5f652e4c…
Author: Paul Vriens <paul.vriens.wine(a)gmail.com> Date: Mon Jun 23 16:16:43 2008 +0200 setupapi/tests: Prevent crash on NT4. --- dlls/setupapi/tests/devinst.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/dlls/setupapi/tests/devinst.c b/dlls/setupapi/tests/devinst.c index db323af..64035d7 100644 --- a/dlls/setupapi/tests/devinst.c +++ b/dlls/setupapi/tests/devinst.c @@ -992,6 +992,13 @@ static void testRegisterAndGetDetail(void) '1','1','d','b','-','b','7','0','4','-', '0','0','1','1','9','5','5','c','2','b','d','b','}',0}; + if (!pSetupDiCreateDeviceInterfaceA || !pSetupDiEnumDeviceInterfaces || + !pSetupDiGetDeviceInterfaceDetailA) + { + skip("Needed functions are not available\n"); + return; + } + SetLastError(0xdeadbeef); set = pSetupDiGetClassDevsA(&guid, NULL, 0, DIGCF_ALLCLASSES); ok(set != INVALID_HANDLE_VALUE, "SetupDiGetClassDevsA failed: %08x\n",
1
0
0
0
Paul Vriens : setupapi/tests: Remove last win9x references.
by Alexandre Julliard
23 Jun '08
23 Jun '08
Module: wine Branch: master Commit: 7e7574d2a8bb8f8768dae099713cda884d7663c6 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7e7574d2a8bb8f8768dae0997…
Author: Paul Vriens <paul.vriens.wine(a)gmail.com> Date: Mon Jun 23 15:48:16 2008 +0200 setupapi/tests: Remove last win9x references. --- dlls/setupapi/tests/devinst.c | 48 ++++++++++++---------------------------- 1 files changed, 15 insertions(+), 33 deletions(-) diff --git a/dlls/setupapi/tests/devinst.c b/dlls/setupapi/tests/devinst.c index 8b79844..db323af 100644 --- a/dlls/setupapi/tests/devinst.c +++ b/dlls/setupapi/tests/devinst.c @@ -491,12 +491,6 @@ static void testGetDeviceInstanceId(void) HDEVINFO set; SP_DEVINFO_DATA devInfo = { 0 }; - if (!pSetupDiCreateDeviceInfoList || !pSetupDiDestroyDeviceInfoList || - !pSetupDiCreateDeviceInfoA || !pSetupDiGetDeviceInstanceIdA) - { - skip("No SetupDiGetDeviceInstanceIdA\n"); - return; - } SetLastError(0xdeadbeef); ret = pSetupDiGetDeviceInstanceIdA(NULL, NULL, NULL, 0, NULL); ok(!ret && GetLastError() == ERROR_INVALID_HANDLE, @@ -594,8 +588,7 @@ static void testRegisterDeviceInfo(void) ok(ret, "SetupDiCreateDeviceInfoA failed: %d\n", GetLastError()); } /* FIXME: On Win2K+ systems, this is now persisted to registry in - * HKLM\System\CCS\Enum\USB\Bogus\0000. I don't check because the - * Win9x location is different. + * HKLM\System\CCS\Enum\USB\Bogus\0000. * FIXME: the key also becomes undeletable. How to get rid of it? */ pSetupDiDestroyDeviceInfoList(set); @@ -618,11 +611,9 @@ static void testCreateDeviceInterface(void) '1','1','d','b','-','b','7','0','4','-', '0','0','1','1','9','5','5','c','2','b','d','b','}',0}; - if (!pSetupDiCreateDeviceInfoList || !pSetupDiDestroyDeviceInfoList || - !pSetupDiCreateDeviceInfoA || !pSetupDiCreateDeviceInterfaceA || - !pSetupDiEnumDeviceInterfaces) + if (!pSetupDiCreateDeviceInterfaceA || !pSetupDiEnumDeviceInterfaces) { - skip("No SetupDiCreateDeviceInterfaceA\n"); + skip("SetupDiCreateDeviceInterfaceA and/or SetupDiEnumDeviceInterfaces are not available\n"); return; } SetLastError(0xdeadbeef); @@ -717,11 +708,9 @@ static void testGetDeviceInterfaceDetail(void) '1','1','d','b','-','b','7','0','4','-', '0','0','1','1','9','5','5','c','2','b','d','b','}',0}; - if (!pSetupDiCreateDeviceInfoList || !pSetupDiDestroyDeviceInfoList || - !pSetupDiCreateDeviceInfoA || !pSetupDiCreateDeviceInterfaceA || - !pSetupDiGetDeviceInterfaceDetailA) + if (!pSetupDiCreateDeviceInterfaceA || !pSetupDiGetDeviceInterfaceDetailA) { - skip("No SetupDiGetDeviceInterfaceDetailA\n"); + skip("SetupDiCreateDeviceInterfaceA and/or SetupDiGetDeviceInterfaceDetailA are not available\n"); return; } SetLastError(0xdeadbeef); @@ -794,9 +783,7 @@ static void testGetDeviceInterfaceDetail(void) size, &size, NULL); ok(!ret && GetLastError() == ERROR_INVALID_USER_BUFFER, "Expected ERROR_INVALID_USER_BUFFER, got %08x\n", GetLastError()); - /* Windows 2000 and up check for the exact size. Win9x returns ERROR_INVALID_PARAMETER - * on every call (so doesn't get here) and NT4 doesn't have this function. - */ + /* Windows 2000 and up check for the exact size */ detail->cbSize = FIELD_OFFSET(SP_DEVICE_INTERFACE_DETAIL_DATA_A, DevicePath[1]); ret = pSetupDiGetDeviceInterfaceDetailA(set, &interfaceData, detail, size, &size, NULL); @@ -806,18 +793,13 @@ static void testGetDeviceInterfaceDetail(void) !lstrcmpiA(path_w2k, detail->DevicePath), "Unexpected path %s\n", detail->DevicePath); /* Check SetupDiGetDeviceInterfaceDetailW */ - if (pSetupDiGetDeviceInterfaceDetailW) - { - ret = pSetupDiGetDeviceInterfaceDetailW(set, &interfaceData, NULL, 0, &size, NULL); - ok(!ret && GetLastError() == ERROR_INSUFFICIENT_BUFFER, - "Expected ERROR_INSUFFICIENT_BUFFER, got error code: %d\n", GetLastError()); - ok(expectedsize == size || - (expectedsize + sizeof(WCHAR)) == size /* W2K adds a backslash */, - "SetupDiGetDeviceInterfaceDetailW returned wrong reqsize, got %d\n", - size); - } - else - skip("SetupDiGetDeviceInterfaceDetailW is not available\n"); + ret = pSetupDiGetDeviceInterfaceDetailW(set, &interfaceData, NULL, 0, &size, NULL); + ok(!ret && GetLastError() == ERROR_INSUFFICIENT_BUFFER, + "Expected ERROR_INSUFFICIENT_BUFFER, got error code: %d\n", GetLastError()); + ok(expectedsize == size || + (expectedsize + sizeof(WCHAR)) == size /* W2K adds a backslash */, + "SetupDiGetDeviceInterfaceDetailW returned wrong reqsize, got %d\n", + size); HeapFree(GetProcessHeap(), 0, buf); } @@ -1316,10 +1298,10 @@ START_TEST(devinst) return; } - if (pSetupDiCreateDeviceInfoListExW && pSetupDiDestroyDeviceInfoList) + if (pSetupDiCreateDeviceInfoListExW) test_SetupDiCreateDeviceInfoListEx(); else - skip("SetupDiCreateDeviceInfoListExW and/or SetupDiDestroyDeviceInfoList not available\n"); + skip("SetupDiCreateDeviceInfoListExW is not available\n"); if (pSetupDiOpenClassRegKeyExA) test_SetupDiOpenClassRegKeyExA();
1
0
0
0
Rob Shearman : rpcrt4: Fix NdrConformantVaryingStructUnmarshall to use buffer memory if applicable and to reuse memory for embedded pointers .
by Alexandre Julliard
23 Jun '08
23 Jun '08
Module: wine Branch: master Commit: 0c095ee0d3f1ed02fc30dade7361d885a70222b5 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=0c095ee0d3f1ed02fc30dade7…
Author: Rob Shearman <robertshearman(a)gmail.com> Date: Mon Jun 23 12:56:49 2008 +0100 rpcrt4: Fix NdrConformantVaryingStructUnmarshall to use buffer memory if applicable and to reuse memory for embedded pointers. --- dlls/rpcrt4/ndr_marshall.c | 30 +++++++++++++++++++----------- dlls/rpcrt4/tests/server.c | 2 -- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/dlls/rpcrt4/ndr_marshall.c b/dlls/rpcrt4/ndr_marshall.c index 977effa..4e7643a 100644 --- a/dlls/rpcrt4/ndr_marshall.c +++ b/dlls/rpcrt4/ndr_marshall.c @@ -1562,7 +1562,7 @@ static unsigned char * EmbeddedPointerMarshall(PMIDL_STUB_MESSAGE pStubMsg, * EmbeddedPointerUnmarshall */ static unsigned char * EmbeddedPointerUnmarshall(PMIDL_STUB_MESSAGE pStubMsg, - unsigned char *pDstMemoryPtrs, + unsigned char *pDstBuffer, unsigned char *pSrcMemoryPtrs, PFORMAT_STRING pFormat, unsigned char fMustAlloc) @@ -1572,7 +1572,7 @@ static unsigned char * EmbeddedPointerUnmarshall(PMIDL_STUB_MESSAGE pStubMsg, unsigned i; unsigned char *saved_buffer = NULL; - TRACE("(%p,%p,%p,%p,%d)\n", pStubMsg, pDstMemoryPtrs, pSrcMemoryPtrs, pFormat, fMustAlloc); + TRACE("(%p,%p,%p,%p,%d)\n", pStubMsg, pDstBuffer, pSrcMemoryPtrs, pFormat, fMustAlloc); if (*pFormat != RPC_FC_PP) return NULL; pFormat += 2; @@ -1610,16 +1610,16 @@ static unsigned char * EmbeddedPointerUnmarshall(PMIDL_STUB_MESSAGE pStubMsg, } for (i = 0; i < rep; i++) { PFORMAT_STRING info = pFormat; - unsigned char *memdstbase = pDstMemoryPtrs + (i * stride); + unsigned char *bufdstbase = pDstBuffer + (i * stride); unsigned char *memsrcbase = pSrcMemoryPtrs + (i * stride); unsigned char *bufbase = Mark + (i * stride); unsigned u; for (u=0; u<count; u++,info+=8) { - unsigned char **memdstptr = (unsigned char **)(memdstbase + *(const SHORT*)&info[0]); + unsigned char **bufdstptr = (unsigned char **)(bufdstbase + *(const SHORT*)&info[2]); unsigned char **memsrcptr = (unsigned char **)(memsrcbase + *(const SHORT*)&info[0]); unsigned char *bufptr = bufbase + *(const SHORT*)&info[2]; - PointerUnmarshall(pStubMsg, bufptr, memdstptr, *memsrcptr, info+4, fMustAlloc); + PointerUnmarshall(pStubMsg, bufptr, bufdstptr, *memsrcptr, info+4, fMustAlloc); } } pFormat += 8 * count; @@ -4186,6 +4186,7 @@ unsigned char * WINAPI NdrConformantVaryingStructUnmarshall(PMIDL_STUB_MESSAGE PFORMAT_STRING pCVArrayFormat; ULONG esize, bufsize; unsigned char cvarray_type; + unsigned char *saved_buffer, *saved_array_buffer; TRACE("(%p, %p, %p, %d)\n", pStubMsg, ppMemory, pFormat, fMustAlloc); @@ -4237,9 +4238,9 @@ unsigned char * WINAPI NdrConformantVaryingStructUnmarshall(PMIDL_STUB_MESSAGE *ppMemory = NdrAllocate(pStubMsg, size); } - /* copy the constant data */ - pStubMsg->BufferMark = pStubMsg->Buffer; - safe_copy_from_buffer(pStubMsg, *ppMemory, pCVStructFormat->memory_size); + /* mark the start of the constant data */ + saved_buffer = pStubMsg->BufferMark = pStubMsg->Buffer; + safe_buffer_increment(pStubMsg, pCVStructFormat->memory_size); pCVArrayFormat = ReadVariance(pStubMsg, pCVArrayFormat, pStubMsg->MaxCount); @@ -4249,16 +4250,23 @@ unsigned char * WINAPI NdrConformantVaryingStructUnmarshall(PMIDL_STUB_MESSAGE (cvarray_type == RPC_FC_C_WSTRING)) validate_string_data(pStubMsg, bufsize, esize); + /* mark the start of the array data */ + saved_array_buffer = pStubMsg->Buffer; + safe_buffer_increment(pStubMsg, bufsize); + + EmbeddedPointerUnmarshall(pStubMsg, saved_buffer, *ppMemory, pFormat, fMustAlloc); + + /* copy the constant data */ + memcpy(*ppMemory, saved_buffer, pCVStructFormat->memory_size); /* copy the array data */ - safe_copy_from_buffer(pStubMsg, *ppMemory + pCVStructFormat->memory_size, bufsize); + TRACE("copying %p to %p\n", saved_array_buffer, *ppMemory + pCVStructFormat->memory_size); + memcpy(*ppMemory + pCVStructFormat->memory_size, saved_array_buffer, bufsize); if (cvarray_type == RPC_FC_C_CSTRING) TRACE("string=%s\n", debugstr_a((char *)(*ppMemory + pCVStructFormat->memory_size))); else if (cvarray_type == RPC_FC_C_WSTRING) TRACE("string=%s\n", debugstr_w((WCHAR *)(*ppMemory + pCVStructFormat->memory_size))); - EmbeddedPointerUnmarshall(pStubMsg, *ppMemory, *ppMemory, pFormat, TRUE /* FIXME */); - return NULL; } diff --git a/dlls/rpcrt4/tests/server.c b/dlls/rpcrt4/tests/server.c index 91c87bf..69b9ba4 100644 --- a/dlls/rpcrt4/tests/server.c +++ b/dlls/rpcrt4/tests/server.c @@ -1208,9 +1208,7 @@ array_tests(void) ns->size = 5; ns->numbers[0].pi = pi; get_numbers_struct(&ns); - todo_wine { ok(ns->numbers[0].pi == pi, "RPC conformant varying struct embedded pointer changed from %p to %p\n", pi, ns->numbers[0].pi); - } ok(*ns->numbers[0].pi == 5, "pi unmarshalled incorrectly %d\n", *ns->numbers[0].pi); HeapFree(GetProcessHeap(), 0, ns);
1
0
0
0
← Newer
1
...
36
37
38
39
40
41
42
...
95
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
Results per page:
10
25
50
100
200