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
July 2013
----- 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
447 discussions
Start a n
N
ew thread
Dmitry Timoshkov : gdiplus/tests: Add clipping region tests with rotating world transform.
by Alexandre Julliard
30 Jul '13
30 Jul '13
Module: wine Branch: master Commit: 249bf0eb63adc0186f9120fb78fae8a0ebf6596d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=249bf0eb63adc0186f9120fb7…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Mon Jul 22 17:49:14 2013 +0900 gdiplus/tests: Add clipping region tests with rotating world transform. --- dlls/gdiplus/tests/graphics.c | 306 ++++++++++++++++++++++++++++++++++++++++- 1 files changed, 304 insertions(+), 2 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=249bf0eb63adc0186f912…
1
0
0
0
Piotr Caban : oleaut32: Store PARAMDESCEX structure inside lprgelemdescParam.
by Alexandre Julliard
30 Jul '13
30 Jul '13
Module: wine Branch: master Commit: 2f707558fcd29df82afd71338591dd596807ae3a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2f707558fcd29df82afd71338…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Tue Jul 30 15:20:04 2013 +0200 oleaut32: Store PARAMDESCEX structure inside lprgelemdescParam. Thanks to this change we don't need to free the data differently depending on how it was created (by typelib reading or writing code). --- dlls/oleaut32/typelib.c | 7 ++----- 1 files changed, 2 insertions(+), 5 deletions(-) diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c index 44eea5b..a8916d8 100644 --- a/dlls/oleaut32/typelib.c +++ b/dlls/oleaut32/typelib.c @@ -2356,7 +2356,7 @@ MSFT_DoFuncs(TLBContext* pcx, MSFT_ParameterInfo paraminfo; ptfd->funcdesc.lprgelemdescParam = - heap_alloc_zero(pFuncRec->nrargs * sizeof(ELEMDESC)); + heap_alloc_zero(pFuncRec->nrargs * (sizeof(ELEMDESC) + sizeof(PARAMDESCEX))); ptfd->pParamDesc = TLBParDesc_Constructor(pFuncRec->nrargs); @@ -2390,7 +2390,7 @@ MSFT_DoFuncs(TLBContext* pcx, PARAMDESC* pParamDesc = &elemdesc->u.paramdesc; - pParamDesc->pparamdescex = heap_alloc_zero(sizeof(PARAMDESCEX)); + pParamDesc->pparamdescex = (PARAMDESCEX*)(ptfd->funcdesc.lprgelemdescParam+pFuncRec->nrargs)+j; pParamDesc->pparamdescex->cBytes = sizeof(PARAMDESCEX); MSFT_ReadValue(&(pParamDesc->pparamdescex->varDefaultValue), @@ -5441,10 +5441,7 @@ static void ITypeInfoImpl_Destroy(ITypeInfoImpl *This) { ELEMDESC *elemdesc = &pFInfo->funcdesc.lprgelemdescParam[j]; if (elemdesc->u.paramdesc.wParamFlags & PARAMFLAG_FHASDEFAULT) - { VariantClear(&elemdesc->u.paramdesc.pparamdescex->varDefaultValue); - heap_free(elemdesc->u.paramdesc.pparamdescex); - } TLB_FreeCustData(&pFInfo->pParamDesc[j].custdata_list); } heap_free(pFInfo->funcdesc.lprgelemdescParam);
1
0
0
0
Nikolay Sivov : kernel32/tests: Remove unused helper argument.
by Alexandre Julliard
30 Jul '13
30 Jul '13
Module: wine Branch: master Commit: e8cbae2e49264b5ab6a48368f77cd7fbeadd8cb4 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e8cbae2e49264b5ab6a48368f…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Tue Jul 30 19:05:18 2013 +0400 kernel32/tests: Remove unused helper argument. --- dlls/kernel32/tests/actctx.c | 20 ++++++++++---------- 1 files changed, 10 insertions(+), 10 deletions(-) diff --git a/dlls/kernel32/tests/actctx.c b/dlls/kernel32/tests/actctx.c index a9d5f29..50529f8 100644 --- a/dlls/kernel32/tests/actctx.c +++ b/dlls/kernel32/tests/actctx.c @@ -600,7 +600,7 @@ static void test_file_info(HANDLE handle, ULONG assid, ULONG fileid, LPCWSTR fil HeapFree(GetProcessHeap(), 0, info); } -static HANDLE test_create(const char *file, const char *manifest) +static HANDLE test_create(const char *file) { ACTCTXW actctx; HANDLE handle; @@ -1114,7 +1114,7 @@ static void test_actctx(void) trace("manifest1\n"); - handle = test_create("test1.manifest", manifest1); + handle = test_create("test1.manifest"); DeleteFileA("test1.manifest"); if(handle != INVALID_HANDLE_VALUE) { test_basic_info(handle, __LINE__); @@ -1139,7 +1139,7 @@ static void test_actctx(void) trace("manifest2 depmanifest1\n"); - handle = test_create("test2.manifest", manifest2); + handle = test_create("test2.manifest"); DeleteFileA("test2.manifest"); DeleteFileA("testdep.manifest"); if(handle != INVALID_HANDLE_VALUE) { @@ -1157,7 +1157,7 @@ static void test_actctx(void) trace("manifest2 depmanifest2\n"); - handle = test_create("test2-2.manifest", manifest2); + handle = test_create("test2-2.manifest"); DeleteFileA("test2-2.manifest"); DeleteFileA("testdep.manifest"); if(handle != INVALID_HANDLE_VALUE) { @@ -1185,7 +1185,7 @@ static void test_actctx(void) return; } - handle = test_create("test2-3.manifest", manifest2); + handle = test_create("test2-3.manifest"); DeleteFileA("test2-3.manifest"); DeleteFileA("testdep.manifest"); if(handle != INVALID_HANDLE_VALUE) { @@ -1215,7 +1215,7 @@ static void test_actctx(void) return; } - handle = test_create("test3.manifest", manifest3); + handle = test_create("test3.manifest"); DeleteFileA("test3.manifest"); if(handle != INVALID_HANDLE_VALUE) { test_basic_info(handle, __LINE__); @@ -1242,7 +1242,7 @@ static void test_actctx(void) return; } - handle = test_create("test4.manifest", manifest4); + handle = test_create("test4.manifest"); DeleteFileA("test4.manifest"); DeleteFileA("testdep.manifest"); if(handle != INVALID_HANDLE_VALUE) { @@ -1262,7 +1262,7 @@ static void test_actctx(void) skip("Could not create manifest file\n"); return; } - handle = test_create("..\\test1.manifest", manifest1); + handle = test_create("..\\test1.manifest"); DeleteFileA("..\\test1.manifest"); if(handle != INVALID_HANDLE_VALUE) { test_basic_info(handle, __LINE__); @@ -1282,7 +1282,7 @@ static void test_actctx(void) return; } - handle = test_create("test1.manifest", manifest1); + handle = test_create("test1.manifest"); DeleteFileA("test1.manifest"); if (handle != INVALID_HANDLE_VALUE) { test_basic_info(handle, __LINE__); @@ -1297,7 +1297,7 @@ static void test_actctx(void) return; } - handle = test_create("test1.manifest", manifest1); + handle = test_create("test1.manifest"); DeleteFileA("test1.manifest"); if (handle != INVALID_HANDLE_VALUE) { test_basic_info(handle, __LINE__);
1
0
0
0
Piotr Caban : oleaut32: Free guid_list in ITypeLib2_Release.
by Alexandre Julliard
30 Jul '13
30 Jul '13
Module: wine Branch: master Commit: 1967b35962ea0c2476da8986404c8d8f45eda0b9 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1967b35962ea0c2476da89864…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Tue Jul 30 15:19:54 2013 +0200 oleaut32: Free guid_list in ITypeLib2_Release. --- dlls/oleaut32/typelib.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c index b0cfc88..44eea5b 100644 --- a/dlls/oleaut32/typelib.c +++ b/dlls/oleaut32/typelib.c @@ -4577,6 +4577,7 @@ static ULONG WINAPI ITypeLib2_fnRelease( ITypeLib2 *iface) TLBImpLib *pImpLib, *pImpLibNext; TLBRefType *ref_type; TLBString *tlbstr, *tlbstr_next; + TLBGuid *tlbguid, *tlbguid_next; void *cursor2; int i; @@ -4604,6 +4605,11 @@ static ULONG WINAPI ITypeLib2_fnRelease( ITypeLib2 *iface) heap_free(tlbstr); } + LIST_FOR_EACH_ENTRY_SAFE(tlbguid, tlbguid_next, &This->guid_list, TLBGuid, entry) { + list_remove(&tlbguid->entry); + heap_free(tlbguid); + } + TLB_FreeCustData(&This->custdata_list); for (i = 0; i < This->ctTypeDesc; i++)
1
0
0
0
Piotr Caban : oleaut32: Don' t leak BSTRs allocated in string_list and name_list.
by Alexandre Julliard
30 Jul '13
30 Jul '13
Module: wine Branch: master Commit: 6d6c3e5d81a6f93800982498bd206ec2fc8be23f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6d6c3e5d81a6f93800982498b…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Tue Jul 30 15:19:37 2013 +0200 oleaut32: Don't leak BSTRs allocated in string_list and name_list. --- dlls/oleaut32/typelib.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c index 1041e1b..b0cfc88 100644 --- a/dlls/oleaut32/typelib.c +++ b/dlls/oleaut32/typelib.c @@ -4594,11 +4594,13 @@ static ULONG WINAPI ITypeLib2_fnRelease( ITypeLib2 *iface) LIST_FOR_EACH_ENTRY_SAFE(tlbstr, tlbstr_next, &This->string_list, TLBString, entry) { list_remove(&tlbstr->entry); + SysFreeString(tlbstr->str); heap_free(tlbstr); } LIST_FOR_EACH_ENTRY_SAFE(tlbstr, tlbstr_next, &This->name_list, TLBString, entry) { list_remove(&tlbstr->entry); + SysFreeString(tlbstr->str); heap_free(tlbstr); }
1
0
0
0
Bruno Jesus : ws2_32/tests: Add SO_ACCEPTCONN tests.
by Alexandre Julliard
30 Jul '13
30 Jul '13
Module: wine Branch: master Commit: 4133fb4341bf5376c612af019831ae79427b7c7a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4133fb4341bf5376c612af019…
Author: Bruno Jesus <00cpxxx(a)gmail.com> Date: Tue Jul 30 09:58:38 2013 -0300 ws2_32/tests: Add SO_ACCEPTCONN tests. --- dlls/ws2_32/tests/sock.c | 11 +++++++++-- 1 files changed, 9 insertions(+), 2 deletions(-) diff --git a/dlls/ws2_32/tests/sock.c b/dlls/ws2_32/tests/sock.c index fce0b99..1a75ffd 100644 --- a/dlls/ws2_32/tests/sock.c +++ b/dlls/ws2_32/tests/sock.c @@ -2460,7 +2460,7 @@ static void test_errors(void) static void test_listen(void) { SOCKET fdA, fdB; - int ret; + int ret, acceptc, olen = sizeof(acceptc); struct sockaddr_in address; memset(&address, 0, sizeof(address)); @@ -2507,9 +2507,17 @@ static void test_listen(void) ok (bind(fdB, (struct sockaddr*) &address, sizeof(address)), "bind should have failed\n"); ok (ret == WSAEINVAL, "expected 10022, received %d\n", ret); + acceptc = 0xdead; + ok (!getsockopt(fdA, SOL_SOCKET, SO_ACCEPTCONN, (char*)&acceptc, &olen), "getsockopt failed\n"); + ok (acceptc == 0, "SO_ACCEPTCONN should be 0, received %d\n", acceptc); + ok (!listen(fdA, 0), "listen failed\n"); ok (!listen(fdA, SOMAXCONN), "double listen failed\n"); + acceptc = 0xdead; + ok (!getsockopt(fdA, SOL_SOCKET, SO_ACCEPTCONN, (char*)&acceptc, &olen), "getsockopt failed\n"); + ok (acceptc == 1, "SO_ACCEPTCONN should be 1, received %d\n", acceptc); + SetLastError(0xdeadbeef); ok ((listen(fdB, SOMAXCONN) == SOCKET_ERROR), "listen did not fail\n"); ret = WSAGetLastError(); @@ -2521,7 +2529,6 @@ static void test_listen(void) fdB = socket(AF_INET, SOCK_STREAM, 0); ok ((fdB != INVALID_SOCKET), "socket failed unexpectedly: %d\n", WSAGetLastError() ); - SetLastError(0xdeadbeef); ok (bind(fdB, (struct sockaddr*) &address, sizeof(address)), "bind should have failed\n"); ret = WSAGetLastError();
1
0
0
0
Jacek Caban : mshtml: Added IHTMLTable::cellSpacing property implementation .
by Alexandre Julliard
30 Jul '13
30 Jul '13
Module: wine Branch: master Commit: c897306d244c14188791d68e714121ff08c6bbda URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c897306d244c14188791d68e7…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Tue Jul 30 14:10:16 2013 +0200 mshtml: Added IHTMLTable::cellSpacing property implementation. --- dlls/mshtml/htmltable.c | 42 ++++++++++++++++++++++++++++++++++++++---- dlls/mshtml/tests/dom.c | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 71 insertions(+), 4 deletions(-) diff --git a/dlls/mshtml/htmltable.c b/dlls/mshtml/htmltable.c index f3c7ba8..64157e7 100644 --- a/dlls/mshtml/htmltable.c +++ b/dlls/mshtml/htmltable.c @@ -170,15 +170,49 @@ static HRESULT WINAPI HTMLTable_get_rules(IHTMLTable *iface, BSTR *p) static HRESULT WINAPI HTMLTable_put_cellSpacing(IHTMLTable *iface, VARIANT v) { HTMLTable *This = impl_from_IHTMLTable(iface); - FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); - return E_NOTIMPL; + nsAString nsstr; + WCHAR buf[64]; + nsresult nsres; + + TRACE("(%p)->(%s)\n", This, debugstr_variant(&v)); + + switch(V_VT(&v)) { + case VT_BSTR: + nsAString_InitDepend(&nsstr, V_BSTR(&v)); + break; + case VT_I4: { + static const WCHAR formatW[] = {'%','d',0}; + sprintfW(buf, formatW, V_I4(&v)); + nsAString_InitDepend(&nsstr, buf); + break; + } + default: + FIXME("unsupported arg %s\n", debugstr_variant(&v)); + return E_NOTIMPL; + } + + nsres = nsIDOMHTMLTableElement_SetCellSpacing(This->nstable, &nsstr); + nsAString_Finish(&nsstr); + if(NS_FAILED(nsres)) { + ERR("SetCellSpacing failed: %08x\n", nsres); + return E_FAIL; + } + + return S_OK; } static HRESULT WINAPI HTMLTable_get_cellSpacing(IHTMLTable *iface, VARIANT *p) { HTMLTable *This = impl_from_IHTMLTable(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; + nsAString nsstr; + nsresult nsres; + + TRACE("(%p)->(%p)\n", This, p); + + nsAString_Init(&nsstr, NULL); + nsres = nsIDOMHTMLTableElement_GetCellSpacing(This->nstable, &nsstr); + V_VT(p) = VT_BSTR; + return return_nsstr(nsres, &nsstr, &V_BSTR(p)); } static HRESULT WINAPI HTMLTable_put_cellPadding(IHTMLTable *iface, VARIANT v) diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c index da44190..8d3b951 100644 --- a/dlls/mshtml/tests/dom.c +++ b/dlls/mshtml/tests/dom.c @@ -5513,11 +5513,29 @@ static void test_tr_elem(IHTMLElement *elem) IHTMLTableRow_Release(row); } +#define test_table_cell_spacing(a,b) _test_table_cell_spacing(__LINE__,a,b) +static void _test_table_cell_spacing(unsigned line, IHTMLTable *table, const char *exstr) +{ + VARIANT v; + HRESULT hres; + + V_VT(&v) = VT_ERROR; + hres = IHTMLTable_get_cellSpacing(table, &v); + ok_(__FILE__,line)(hres == S_OK, "get_cellSpacing failed: %08x\n", hres); + ok_(__FILE__,line)(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v)); + if(exstr) + ok_(__FILE__,line)(!strcmp_wa(V_BSTR(&v), exstr), "cellSpacing = %s, expected %s\n", wine_dbgstr_w(V_BSTR(&v)), exstr); + else + ok_(__FILE__,line)(!V_BSTR(&v), "cellSpacing = %s, expected NULL\n", wine_dbgstr_w(V_BSTR(&v))); + VariantClear(&v); +} + static void test_table_elem(IHTMLElement *elem) { IHTMLElementCollection *col; IHTMLTable *table; IHTMLDOMNode *node; + VARIANT v; HRESULT hres; static const elem_type_t row_types[] = {ET_TR,ET_TR}; @@ -5557,6 +5575,21 @@ static void test_table_elem(IHTMLElement *elem) test_elem_collection((IUnknown*)col, tbodies_types, sizeof(tbodies_types)/sizeof(*tbodies_types)); IHTMLElementCollection_Release(col); + test_table_cell_spacing(table, NULL); + + V_VT(&v) = VT_I4; + V_I4(&v) = 10; + hres = IHTMLTable_put_cellSpacing(table, v); + ok(hres == S_OK, "put_cellSpacing = %08x\n", hres); + test_table_cell_spacing(table, "10"); + + V_VT(&v) = VT_BSTR; + V_BSTR(&v) = a2bstr("11"); + hres = IHTMLTable_put_cellSpacing(table, v); + ok(hres == S_OK, "put_cellSpacing = %08x\n", hres); + test_table_cell_spacing(table, "11"); + VariantClear(&v); + IHTMLTable_Release(table); }
1
0
0
0
Hans Leidekker : iphlpapi: Add partial support for the module classes in GetExtendedTcpTable and GetExtendedUdpTable .
by Alexandre Julliard
30 Jul '13
30 Jul '13
Module: wine Branch: master Commit: 792eafa465943d5a1e20eda817a6d4556c162e7b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=792eafa465943d5a1e20eda81…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Tue Jul 30 12:57:50 2013 +0200 iphlpapi: Add partial support for the module classes in GetExtendedTcpTable and GetExtendedUdpTable. --- dlls/iphlpapi/iphlpapi_main.c | 16 +++++++--------- dlls/iphlpapi/ipstats.c | 40 ++++++++++++++++++++++++++++------------ dlls/iphlpapi/tests/iphlpapi.c | 29 +++++++++++++++++++++++++++++ include/tcpmib.h | 18 ++++++++++++++++++ 4 files changed, 82 insertions(+), 21 deletions(-) diff --git a/dlls/iphlpapi/iphlpapi_main.c b/dlls/iphlpapi/iphlpapi_main.c index e970162..837eb3d 100644 --- a/dlls/iphlpapi/iphlpapi_main.c +++ b/dlls/iphlpapi/iphlpapi_main.c @@ -1859,14 +1859,14 @@ DWORD WINAPI GetExtendedTcpTable(PVOID pTcpTable, PDWORD pdwSize, BOOL bOrder, if (!pdwSize) return ERROR_INVALID_PARAMETER; - if (ulAf != AF_INET || - TableClass == TCP_TABLE_OWNER_MODULE_LISTENER || - TableClass == TCP_TABLE_OWNER_MODULE_CONNECTIONS || - TableClass == TCP_TABLE_OWNER_MODULE_ALL) + if (ulAf != AF_INET) { - FIXME("ulAf = %u, TableClass = %u not supported\n", ulAf, TableClass); + FIXME("ulAf = %u not supported\n", ulAf); return ERROR_NOT_SUPPORTED; } + if (TableClass >= TCP_TABLE_OWNER_MODULE_LISTENER) + FIXME("module classes not fully supported\n"); + if ((ret = build_tcp_table(TableClass, &table, bOrder, GetProcessHeap(), 0, &size))) return ret; @@ -1924,11 +1924,9 @@ DWORD WINAPI GetExtendedUdpTable(PVOID pUdpTable, PDWORD pdwSize, BOOL bOrder, if (!pdwSize) return ERROR_INVALID_PARAMETER; - if (ulAf != AF_INET || - (TableClass != UDP_TABLE_BASIC && TableClass != UDP_TABLE_OWNER_PID && - TableClass != UDP_TABLE_OWNER_MODULE)) + if (ulAf != AF_INET) { - FIXME("ulAf = %u, TableClass = %u not supported\n", ulAf, TableClass); + FIXME("ulAf = %u not supported\n", ulAf); return ERROR_NOT_SUPPORTED; } if (TableClass == UDP_TABLE_OWNER_MODULE) diff --git a/dlls/iphlpapi/ipstats.c b/dlls/iphlpapi/ipstats.c index 87651d3..9ca51e9 100644 --- a/dlls/iphlpapi/ipstats.c +++ b/dlls/iphlpapi/ipstats.c @@ -140,6 +140,7 @@ #include "wine/debug.h" #include "wine/server.h" +#include "wine/unicode.h" #ifndef HAVE_NETINET_TCP_FSM_H #define TCPS_ESTABLISHED 1 @@ -1815,6 +1816,14 @@ static DWORD get_tcp_table_sizes( TCP_TABLE_CLASS class, DWORD row_count, DWORD if (row_size) *row_size = sizeof(MIB_TCPROW_OWNER_PID); break; } + case TCP_TABLE_OWNER_MODULE_LISTENER: + case TCP_TABLE_OWNER_MODULE_CONNECTIONS: + case TCP_TABLE_OWNER_MODULE_ALL: + { + table_size = FIELD_OFFSET(MIB_TCPTABLE_OWNER_MODULE, table[row_count]); + if (row_size) *row_size = sizeof(MIB_TCPROW_OWNER_MODULE); + break; + } default: ERR("unhandled class %u\n", class); return 0; @@ -1824,7 +1833,7 @@ static DWORD get_tcp_table_sizes( TCP_TABLE_CLASS class, DWORD row_count, DWORD static MIB_TCPTABLE *append_tcp_row( TCP_TABLE_CLASS class, HANDLE heap, DWORD flags, MIB_TCPTABLE *table, DWORD *count, - const MIB_TCPROW_OWNER_PID *row, DWORD row_size ) + const MIB_TCPROW_OWNER_MODULE *row, DWORD row_size ) { if (table->dwNumEntries >= *count) { @@ -2012,7 +2021,7 @@ DWORD build_tcp_table( TCP_TABLE_CLASS class, void **tablep, BOOL order, HANDLE DWORD *size ) { MIB_TCPTABLE *table; - MIB_TCPROW_OWNER_PID row; + MIB_TCPROW_OWNER_MODULE row; DWORD ret = NO_ERROR, count = 16, table_size, row_size; if (!(table_size = get_tcp_table_sizes( class, count, &row_size ))) @@ -2034,9 +2043,7 @@ DWORD build_tcp_table( TCP_TABLE_CLASS class, void **tablep, BOOL order, HANDLE unsigned int dummy, num_entries = 0; int inode; - if (class == TCP_TABLE_OWNER_PID_ALL || - class == TCP_TABLE_OWNER_PID_LISTENER || - class == TCP_TABLE_OWNER_PID_CONNECTIONS) map = get_pid_map( &num_entries ); + if (class >= TCP_TABLE_OWNER_PID_LISTENER) map = get_pid_map( &num_entries ); /* skip header line */ ptr = fgets(buf, sizeof(buf), fp); @@ -2050,11 +2057,14 @@ DWORD build_tcp_table( TCP_TABLE_CLASS class, void **tablep, BOOL order, HANDLE row.dwRemotePort = htons( row.dwRemotePort ); row.dwState = TCPStateToMIBState( row.dwState ); if (!match_class( class, row.dwState )) continue; - if (class == TCP_TABLE_OWNER_PID_ALL || - class == TCP_TABLE_OWNER_PID_LISTENER || - class == TCP_TABLE_OWNER_PID_CONNECTIONS) - row.dwOwningPid = find_owning_pid( map, num_entries, inode ); + if (class >= TCP_TABLE_OWNER_PID_LISTENER) + row.dwOwningPid = find_owning_pid( map, num_entries, inode ); + if (class >= TCP_TABLE_OWNER_MODULE_LISTENER) + { + row.liCreateTimestamp.QuadPart = 0; /* FIXME */ + memset( &row.OwningModuleInfo, 0, sizeof(row.OwningModuleInfo) ); + } if (!(table = append_tcp_row( class, heap, flags, table, &count, &row, row_size ))) break; } @@ -2304,8 +2314,7 @@ DWORD build_udp_table( UDP_TABLE_CLASS class, void **tablep, BOOL order, HANDLE unsigned int dummy, num_entries = 0; int inode; - if (class == UDP_TABLE_OWNER_PID || class == UDP_TABLE_OWNER_MODULE) - map = get_pid_map( &num_entries ); + if (class >= UDP_TABLE_OWNER_PID) map = get_pid_map( &num_entries ); /* skip header line */ ptr = fgets( buf, sizeof(buf), fp ); @@ -2315,8 +2324,15 @@ DWORD build_udp_table( UDP_TABLE_CLASS class, void **tablep, BOOL order, HANDLE &row.dwLocalAddr, &row.dwLocalPort, &inode ) != 4) continue; row.dwLocalPort = htons( row.dwLocalPort ); - if (class == UDP_TABLE_OWNER_PID || class == UDP_TABLE_OWNER_MODULE) + + if (class >= UDP_TABLE_OWNER_PID) row.dwOwningPid = find_owning_pid( map, num_entries, inode ); + if (class >= UDP_TABLE_OWNER_MODULE) + { + row.liCreateTimestamp.QuadPart = 0; /* FIXME */ + row.u.dwFlags = 0; + memset( &row.OwningModuleInfo, 0, sizeof(row.OwningModuleInfo) ); + } if (!(table = append_udp_row( class, heap, flags, table, &count, &row, row_size ))) break; } diff --git a/dlls/iphlpapi/tests/iphlpapi.c b/dlls/iphlpapi/tests/iphlpapi.c index d15e05c..dcbd3ab 100644 --- a/dlls/iphlpapi/tests/iphlpapi.c +++ b/dlls/iphlpapi/tests/iphlpapi.c @@ -1193,6 +1193,7 @@ static void test_GetExtendedTcpTable(void) DWORD ret, size; MIB_TCPTABLE *table; MIB_TCPTABLE_OWNER_PID *table_pid; + MIB_TCPTABLE_OWNER_MODULE *table_module; if (!pGetExtendedTcpTable) { @@ -1237,6 +1238,24 @@ static void test_GetExtendedTcpTable(void) ret = pGetExtendedTcpTable( table_pid, &size, TRUE, AF_INET, TCP_TABLE_OWNER_PID_LISTENER, 0 ); ok( ret == ERROR_SUCCESS, "got %u\n", ret ); HeapFree( GetProcessHeap(), 0, table_pid ); + + size = 0; + ret = pGetExtendedTcpTable( NULL, &size, TRUE, AF_INET, TCP_TABLE_OWNER_MODULE_ALL, 0 ); + ok( ret == ERROR_INSUFFICIENT_BUFFER, "got %u\n", ret ); + + table_module = HeapAlloc( GetProcessHeap(), 0, size ); + ret = pGetExtendedTcpTable( table_module, &size, TRUE, AF_INET, TCP_TABLE_OWNER_MODULE_ALL, 0 ); + ok( ret == ERROR_SUCCESS, "got %u\n", ret ); + HeapFree( GetProcessHeap(), 0, table_module ); + + size = 0; + ret = pGetExtendedTcpTable( NULL, &size, TRUE, AF_INET, TCP_TABLE_OWNER_MODULE_LISTENER, 0 ); + ok( ret == ERROR_INSUFFICIENT_BUFFER, "got %u\n", ret ); + + table_module = HeapAlloc( GetProcessHeap(), 0, size ); + ret = pGetExtendedTcpTable( table_module, &size, TRUE, AF_INET, TCP_TABLE_OWNER_MODULE_LISTENER, 0 ); + ok( ret == ERROR_SUCCESS, "got %u\n", ret ); + HeapFree( GetProcessHeap(), 0, table_module ); } static void test_GetExtendedUdpTable(void) @@ -1244,6 +1263,7 @@ static void test_GetExtendedUdpTable(void) DWORD ret, size; MIB_UDPTABLE *table; MIB_UDPTABLE_OWNER_PID *table_pid; + MIB_UDPTABLE_OWNER_MODULE *table_module; if (!pGetExtendedUdpTable) { @@ -1270,6 +1290,15 @@ static void test_GetExtendedUdpTable(void) ret = pGetExtendedUdpTable( table_pid, &size, TRUE, AF_INET, UDP_TABLE_OWNER_PID, 0 ); ok( ret == ERROR_SUCCESS, "got %u\n", ret ); HeapFree( GetProcessHeap(), 0, table_pid ); + + size = 0; + ret = pGetExtendedUdpTable( NULL, &size, TRUE, AF_INET, UDP_TABLE_OWNER_MODULE, 0 ); + ok( ret == ERROR_INSUFFICIENT_BUFFER, "got %u\n", ret ); + + table_module = HeapAlloc( GetProcessHeap(), 0, size ); + ret = pGetExtendedUdpTable( table_module, &size, TRUE, AF_INET, UDP_TABLE_OWNER_MODULE, 0 ); + ok( ret == ERROR_SUCCESS, "got %u\n", ret ); + HeapFree( GetProcessHeap(), 0, table_module ); } START_TEST(iphlpapi) diff --git a/include/tcpmib.h b/include/tcpmib.h index 8c3efa1..477500c 100644 --- a/include/tcpmib.h +++ b/include/tcpmib.h @@ -115,6 +115,24 @@ typedef struct _MIB_TCPTABLE_OWNER_PID MIB_TCPROW_OWNER_PID table[1]; } MIB_TCPTABLE_OWNER_PID, *PMIB_TCPTABLE_OWNER_PID; +typedef struct _MIB_TCPROW_OWNER_MODULE +{ + DWORD dwState; + DWORD dwLocalAddr; + DWORD dwLocalPort; + DWORD dwRemoteAddr; + DWORD dwRemotePort; + DWORD dwOwningPid; + LARGE_INTEGER liCreateTimestamp; + ULONGLONG OwningModuleInfo[TCPIP_OWNING_MODULE_SIZE]; +} MIB_TCPROW_OWNER_MODULE, *PMIB_TCPROW_OWNER_MODULE; + +typedef struct _MIB_TCPTABLE_OWNER_MODULE +{ + DWORD dwNumEntries; + MIB_TCPROW_OWNER_MODULE table[1]; +} MIB_TCPTABLE_OWNER_MODULE, *PMIB_TCPTABLE_OWNER_MODULE; + typedef struct _MIB_TCPROW2 { DWORD dwState;
1
0
0
0
Hans Leidekker : iphlpapi: Add support for the listener and connection classes in GetExtendedTcpTable .
by Alexandre Julliard
30 Jul '13
30 Jul '13
Module: wine Branch: master Commit: 86157236994c6e8204751734463baf25637b7eab URL:
http://source.winehq.org/git/wine.git/?a=commit;h=86157236994c6e82047517344…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Tue Jul 30 12:56:57 2013 +0200 iphlpapi: Add support for the listener and connection classes in GetExtendedTcpTable. --- dlls/iphlpapi/iphlpapi_main.c | 4 +++- dlls/iphlpapi/ipstats.c | 38 ++++++++++++++++++++++++++++++++++++-- dlls/iphlpapi/tests/iphlpapi.c | 18 ++++++++++++++++++ 3 files changed, 57 insertions(+), 3 deletions(-) diff --git a/dlls/iphlpapi/iphlpapi_main.c b/dlls/iphlpapi/iphlpapi_main.c index aeb91c1..e970162 100644 --- a/dlls/iphlpapi/iphlpapi_main.c +++ b/dlls/iphlpapi/iphlpapi_main.c @@ -1860,7 +1860,9 @@ DWORD WINAPI GetExtendedTcpTable(PVOID pTcpTable, PDWORD pdwSize, BOOL bOrder, if (!pdwSize) return ERROR_INVALID_PARAMETER; if (ulAf != AF_INET || - (TableClass != TCP_TABLE_BASIC_ALL && TableClass != TCP_TABLE_OWNER_PID_ALL)) + TableClass == TCP_TABLE_OWNER_MODULE_LISTENER || + TableClass == TCP_TABLE_OWNER_MODULE_CONNECTIONS || + TableClass == TCP_TABLE_OWNER_MODULE_ALL) { FIXME("ulAf = %u, TableClass = %u not supported\n", ulAf, TableClass); return ERROR_NOT_SUPPORTED; diff --git a/dlls/iphlpapi/ipstats.c b/dlls/iphlpapi/ipstats.c index 1f52fcc..87651d3 100644 --- a/dlls/iphlpapi/ipstats.c +++ b/dlls/iphlpapi/ipstats.c @@ -1981,6 +1981,33 @@ static unsigned int find_owning_pid( struct pid_map *map, unsigned int num_entri #endif } +static BOOL match_class( TCP_TABLE_CLASS class, MIB_TCP_STATE state ) +{ + switch (class) + { + case TCP_TABLE_BASIC_ALL: + case TCP_TABLE_OWNER_PID_ALL: + case TCP_TABLE_OWNER_MODULE_ALL: + return TRUE; + + case TCP_TABLE_BASIC_LISTENER: + case TCP_TABLE_OWNER_PID_LISTENER: + case TCP_TABLE_OWNER_MODULE_LISTENER: + if (state == MIB_TCP_STATE_LISTEN) return TRUE; + return FALSE; + + case TCP_TABLE_BASIC_CONNECTIONS: + case TCP_TABLE_OWNER_PID_CONNECTIONS: + case TCP_TABLE_OWNER_MODULE_CONNECTIONS: + if (state == MIB_TCP_STATE_ESTAB) return TRUE; + return FALSE; + + default: + ERR( "unhandled class %u\n", class ); + return FALSE; + } +} + DWORD build_tcp_table( TCP_TABLE_CLASS class, void **tablep, BOOL order, HANDLE heap, DWORD flags, DWORD *size ) { @@ -2007,7 +2034,9 @@ DWORD build_tcp_table( TCP_TABLE_CLASS class, void **tablep, BOOL order, HANDLE unsigned int dummy, num_entries = 0; int inode; - if (class == TCP_TABLE_OWNER_PID_ALL) map = get_pid_map( &num_entries ); + if (class == TCP_TABLE_OWNER_PID_ALL || + class == TCP_TABLE_OWNER_PID_LISTENER || + class == TCP_TABLE_OWNER_PID_CONNECTIONS) map = get_pid_map( &num_entries ); /* skip header line */ ptr = fgets(buf, sizeof(buf), fp); @@ -2020,7 +2049,10 @@ DWORD build_tcp_table( TCP_TABLE_CLASS class, void **tablep, BOOL order, HANDLE row.dwLocalPort = htons( row.dwLocalPort ); row.dwRemotePort = htons( row.dwRemotePort ); row.dwState = TCPStateToMIBState( row.dwState ); - if (class == TCP_TABLE_OWNER_PID_ALL) + if (!match_class( class, row.dwState )) continue; + if (class == TCP_TABLE_OWNER_PID_ALL || + class == TCP_TABLE_OWNER_PID_LISTENER || + class == TCP_TABLE_OWNER_PID_CONNECTIONS) row.dwOwningPid = find_owning_pid( map, num_entries, inode ); if (!(table = append_tcp_row( class, heap, flags, table, &count, &row, row_size ))) @@ -2048,6 +2080,7 @@ DWORD build_tcp_table( TCP_TABLE_CLASS class, void **tablep, BOOL order, HANDLE row.dwRemoteAddr = entry->tcpConnRemAddress; row.dwRemotePort = htons( entry->tcpConnRemPort ); row.dwState = entry->tcpConnState; + if (!match_class( class, row.dwState )) continue; if (!(table = append_tcp_row( class, heap, flags, table, &count, &row, row_size ))) break; } @@ -2128,6 +2161,7 @@ DWORD build_tcp_table( TCP_TABLE_CLASS class, void **tablep, BOOL order, HANDLE row.dwRemoteAddr = pINData->inp_faddr.s_addr; row.dwRemotePort = pINData->inp_fport; row.dwState = TCPStateToMIBState (pTCPData->t_state); + if (!match_class( class, row.dwState )) continue; if (!(table = append_tcp_row( class, heap, flags, table, &count, &row, row_size ))) break; } diff --git a/dlls/iphlpapi/tests/iphlpapi.c b/dlls/iphlpapi/tests/iphlpapi.c index 26bf26e..d15e05c 100644 --- a/dlls/iphlpapi/tests/iphlpapi.c +++ b/dlls/iphlpapi/tests/iphlpapi.c @@ -1212,6 +1212,15 @@ static void test_GetExtendedTcpTable(void) HeapFree( GetProcessHeap(), 0, table ); size = 0; + ret = pGetExtendedTcpTable( NULL, &size, TRUE, AF_INET, TCP_TABLE_BASIC_LISTENER, 0 ); + ok( ret == ERROR_INSUFFICIENT_BUFFER, "got %u\n", ret ); + + table = HeapAlloc( GetProcessHeap(), 0, size ); + ret = pGetExtendedTcpTable( table, &size, TRUE, AF_INET, TCP_TABLE_BASIC_LISTENER, 0 ); + ok( ret == ERROR_SUCCESS, "got %u\n", ret ); + HeapFree( GetProcessHeap(), 0, table ); + + size = 0; ret = pGetExtendedTcpTable( NULL, &size, TRUE, AF_INET, TCP_TABLE_OWNER_PID_ALL, 0 ); ok( ret == ERROR_INSUFFICIENT_BUFFER, "got %u\n", ret ); @@ -1219,6 +1228,15 @@ static void test_GetExtendedTcpTable(void) ret = pGetExtendedTcpTable( table_pid, &size, TRUE, AF_INET, TCP_TABLE_OWNER_PID_ALL, 0 ); ok( ret == ERROR_SUCCESS, "got %u\n", ret ); HeapFree( GetProcessHeap(), 0, table_pid ); + + size = 0; + ret = pGetExtendedTcpTable( NULL, &size, TRUE, AF_INET, TCP_TABLE_OWNER_PID_LISTENER, 0 ); + ok( ret == ERROR_INSUFFICIENT_BUFFER, "got %u\n", ret ); + + table_pid = HeapAlloc( GetProcessHeap(), 0, size ); + ret = pGetExtendedTcpTable( table_pid, &size, TRUE, AF_INET, TCP_TABLE_OWNER_PID_LISTENER, 0 ); + ok( ret == ERROR_SUCCESS, "got %u\n", ret ); + HeapFree( GetProcessHeap(), 0, table_pid ); } static void test_GetExtendedUdpTable(void)
1
0
0
0
Nikolay Sivov : xmllite: Initial implementation of attribute parsing.
by Alexandre Julliard
30 Jul '13
30 Jul '13
Module: wine Branch: master Commit: 53f72826a21b25df6ebf3b34a2dcbe0f3aabcba8 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=53f72826a21b25df6ebf3b34a…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Tue Jul 30 14:59:28 2013 +0400 xmllite: Initial implementation of attribute parsing. --- dlls/xmllite/reader.c | 137 ++++++++++++++++++++++++++++++++++--------- dlls/xmllite/tests/reader.c | 88 +++++++++++++++++++++++++++ 2 files changed, 198 insertions(+), 27 deletions(-) diff --git a/dlls/xmllite/reader.c b/dlls/xmllite/reader.c index b556d7d..38d539d 100644 --- a/dlls/xmllite/reader.c +++ b/dlls/xmllite/reader.c @@ -1757,37 +1757,129 @@ static HRESULT reader_parse_qname(xmlreader *reader, strval *prefix, strval *loc return S_OK; } +/* [66] CharRef ::= '&#' [0-9]+ ';' | '&#x' [0-9a-fA-F]+ ';' + [67] Reference ::= EntityRef | CharRef + [68] EntityRef ::= '&' Name ';' */ +static HRESULT reader_parse_reference(xmlreader *reader) +{ + FIXME("References not supported\n"); + return E_NOTIMPL; +} + +/* [10 NS] AttValue ::= '"' ([^<&"] | Reference)* '"' | "'" ([^<&'] | Reference)* "'" */ +static HRESULT reader_parse_attvalue(xmlreader *reader, strval *value) +{ + WCHAR *ptr, *start; + WCHAR quote; + + ptr = reader_get_cur(reader); + + /* skip opening quote */ + quote = *ptr; + if (quote != '\"' && quote != '\'') return WC_E_QUOTE; + reader_skipn(reader, 1); + + start = ptr = reader_get_cur(reader); + while (*ptr) + { + if (*ptr == '<') return WC_E_LESSTHAN; + + if (*ptr == quote) + { + /* skip closing quote */ + reader_skipn(reader, 1); + break; + } + + if (*ptr == '&') + { + HRESULT hr = reader_parse_reference(reader); + if (FAILED(hr)) return hr; + } + else + reader_skipn(reader, 1); + ptr = reader_get_cur(reader); + } + + reader_init_strvalue(start, ptr-start, value); + + return S_OK; +} + +/* [1 NS] NSAttName ::= PrefixedAttName | DefaultAttName + [2 NS] PrefixedAttName ::= 'xmlns:' NCName + [3 NS] DefaultAttName ::= 'xmlns' + [15 NS] Attribute ::= NSAttName Eq AttValue | QName Eq AttValue */ +static HRESULT reader_parse_attribute(xmlreader *reader) +{ + static const WCHAR xmlnsW[] = {'x','m','l','n','s',0}; + strval prefix, local, qname, xmlns, value; + HRESULT hr; + + hr = reader_parse_qname(reader, &prefix, &local, &qname); + if (FAILED(hr)) return hr; + + reader_init_strvalue((WCHAR*)xmlnsW, 5, &xmlns); + + if (strval_eq(&prefix, &xmlns)) + { + FIXME("namespace definitions not supported\n"); + return E_NOTIMPL; + } + + if (strval_eq(&qname, &xmlns)) + { + FIXME("default namespace definitions not supported\n"); + return E_NOTIMPL; + } + + hr = reader_parse_eq(reader); + if (FAILED(hr)) return hr; + + hr = reader_parse_attvalue(reader, &value); + if (FAILED(hr)) return hr; + + TRACE("%s=\"%s\"\n", debugstr_wn(local.str, local.len), debugstr_wn(value.str, value.len)); + return reader_add_attr(reader, &local, &value); +} + /* [12 NS] STag ::= '<' QName (S Attribute)* S? '>' [14 NS] EmptyElemTag ::= '<' QName (S Attribute)* S? '/>' */ static HRESULT reader_parse_stag(xmlreader *reader, strval *prefix, strval *local, strval *qname, int *empty) { - static const WCHAR endW[] = {'/','>',0}; HRESULT hr; hr = reader_parse_qname(reader, prefix, local, qname); if (FAILED(hr)) return hr; - reader_skipspaces(reader); - - /* empty element */ - if ((*empty = !reader_cmp(reader, endW))) + while (1) { - /* skip '/>' */ - reader_skipn(reader, 2); - reader->empty_element = TRUE; - return S_OK; - } + static const WCHAR endW[] = {'/','>',0}; - /* got a start tag */ - if (!reader_cmp(reader, gtW)) - { - /* skip '>' */ - reader_skipn(reader, 1); - return reader_push_element(reader, qname); + reader_skipspaces(reader); + + /* empty element */ + if ((*empty = !reader_cmp(reader, endW))) + { + /* skip '/>' */ + reader_skipn(reader, 2); + reader->empty_element = TRUE; + return S_OK; + } + + /* got a start tag */ + if (!reader_cmp(reader, gtW)) + { + /* skip '>' */ + reader_skipn(reader, 1); + return reader_push_element(reader, qname); + } + + hr = reader_parse_attribute(reader); + if (FAILED(hr)) return hr; } - FIXME("only empty elements/start tags without attribute list supported\n"); - return E_NOTIMPL; + return S_OK; } /* [39] element ::= EmptyElemTag | STag content ETag */ @@ -1937,15 +2029,6 @@ static HRESULT reader_parse_cdata(xmlreader *reader) return S_OK; } -/* [66] CharRef ::= '&#' [0-9]+ ';' | '&#x' [0-9a-fA-F]+ ';' - [67] Reference ::= EntityRef | CharRef - [68] EntityRef ::= '&' Name ';' */ -static HRESULT reader_parse_reference(xmlreader *reader) -{ - FIXME("References not supported\n"); - return E_NOTIMPL; -} - /* [14] CharData ::= [^<&]* - ([^<&]* ']]>' [^<&]*) */ static HRESULT reader_parse_chardata(xmlreader *reader) { diff --git a/dlls/xmllite/tests/reader.c b/dlls/xmllite/tests/reader.c index 86bdf69..548abb1 100644 --- a/dlls/xmllite/tests/reader.c +++ b/dlls/xmllite/tests/reader.c @@ -1566,6 +1566,93 @@ static void test_isemptyelement(void) IXmlReader_Release(reader); } +static struct test_entry attributes_tests[] = { + { "<a attr1=\"attrvalue\"/>", "attr1", "attrvalue", S_OK }, + { "<a attr1=\"a\'\'ttrvalue\"/>", "attr1", "a\'\'ttrvalue", S_OK }, + { "<a attr1=\'a\"ttrvalue\'/>", "attr1", "a\"ttrvalue", S_OK }, + { "<a attr1=\' \'/>", "attr1", " ", S_OK }, + { "<a attr1=\" \"/>", "attr1", " ", S_OK }, + { "<a attr1=attrvalue/>", NULL, NULL, WC_E_QUOTE }, + { "<a attr1=\"attr<value\"/>", NULL, NULL, WC_E_LESSTHAN }, + { NULL } +}; + +static void test_read_attribute(void) +{ + struct test_entry *test = attributes_tests; + IXmlReader *reader; + HRESULT hr; + + hr = pCreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL); + ok(hr == S_OK, "S_OK, got %08x\n", hr); + + while (test->xml) + { + XmlNodeType type; + IStream *stream; + + stream = create_stream_on_data(test->xml, strlen(test->xml)+1); + hr = IXmlReader_SetInput(reader, (IUnknown*)stream); + ok(hr == S_OK, "got %08x\n", hr); + + type = XmlNodeType_None; + hr = IXmlReader_Read(reader, &type); + + if (test->hr_broken) + ok(hr == test->hr || broken(hr == test->hr_broken), "got %08x for %s\n", hr, test->xml); + else + ok(hr == test->hr, "got %08x for %s\n", hr, test->xml); + if (hr == S_OK) + { + const WCHAR *str; + WCHAR *str_exp; + UINT len; + + ok(type == XmlNodeType_Element, "got %d for %s\n", type, test->xml); + + hr = IXmlReader_MoveToFirstAttribute(reader); + ok(hr == S_OK, "got 0x%08x\n", hr); + + len = 1; + str = NULL; + hr = IXmlReader_GetLocalName(reader, &str, &len); + ok(hr == S_OK, "got 0x%08x\n", hr); + todo_wine { + ok(len == strlen(test->name), "got %u\n", len); + str_exp = a2w(test->name); + ok(!lstrcmpW(str, str_exp), "got %s\n", wine_dbgstr_w(str)); + free_str(str_exp); + } + len = 1; + str = NULL; + hr = IXmlReader_GetQualifiedName(reader, &str, &len); + ok(hr == S_OK, "got 0x%08x\n", hr); + todo_wine { + ok(len == strlen(test->name), "got %u\n", len); + str_exp = a2w(test->name); + ok(!lstrcmpW(str, str_exp), "got %s\n", wine_dbgstr_w(str)); + free_str(str_exp); + } + /* value */ + len = 1; + str = NULL; + hr = IXmlReader_GetValue(reader, &str, &len); + ok(hr == S_OK, "got 0x%08x\n", hr); + todo_wine { + ok(len == strlen(test->value), "got %u\n", len); + str_exp = a2w(test->value); + ok(!lstrcmpW(str, str_exp), "got %s\n", wine_dbgstr_w(str)); + free_str(str_exp); + } + } + + IStream_Release(stream); + test++; + } + + IXmlReader_Release(reader); +} + START_TEST(reader) { HRESULT r; @@ -1582,6 +1669,7 @@ START_TEST(reader) test_reader_create(); test_readerinput(); test_reader_state(); + test_read_attribute(); test_read_cdata(); test_read_comment(); test_read_pi();
1
0
0
0
← Newer
1
2
3
4
5
6
7
...
45
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
Results per page:
10
25
50
100
200