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
September 2010
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
2 participants
852 discussions
Start a n
N
ew thread
Alexandre Julliard : include: Move some included files outside of extern "C ".
by Alexandre Julliard
07 Sep '10
07 Sep '10
Module: wine Branch: master Commit: 2349a5eb4fbb1b8b1abedcad226d3d98eae1f261 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2349a5eb4fbb1b8b1abedcad2…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Sep 7 11:36:46 2010 +0200 include: Move some included files outside of extern "C". --- include/ddrawi.h | 6 +++--- include/mapival.h | 8 ++++---- include/msi.h | 8 ++++---- include/rpcndr.h | 4 ++-- include/shlobj.h | 5 ++--- 5 files changed, 15 insertions(+), 16 deletions(-) diff --git a/include/ddrawi.h b/include/ddrawi.h index 8b3b632..4e3c9e3 100644 --- a/include/ddrawi.h +++ b/include/ddrawi.h @@ -22,13 +22,13 @@ #ifndef __WINE_DDRAWI_H #define __WINE_DDRAWI_H +#include <ddraw.h> +#include <dciddi.h> /* the DD HAL is layered onto DCI escapes */ + #ifdef __cplusplus extern "C" { #endif -#include <ddraw.h> -#include <dciddi.h> /* the DD HAL is layered onto DCI escapes */ - typedef struct _DDVIDEOPORTCAPS *LPDDVIDEOPORTCAPS; /* should be in dvp.h */ typedef struct _DDKERNELCAPS *LPDDKERNELCAPS; /* should be in ddkernel.h */ typedef struct _VMEMHEAP *LPVMEMHEAP; /* should be in dmemmgr.h */ diff --git a/include/mapival.h b/include/mapival.h index 82cd020..e44c21e 100644 --- a/include/mapival.h +++ b/include/mapival.h @@ -19,14 +19,14 @@ #ifndef MAPIVAL_H #define MAPIVAL_H -#ifdef __cplusplus -extern "C" { -#endif - #include <mapiutil.h> #include <stddef.h> #include <stdarg.h> +#ifdef __cplusplus +extern "C" { +#endif + BOOL WINAPI FBadRglpszW(LPWSTR*,ULONG); BOOL WINAPI FBadRowSet(LPSRowSet); BOOL WINAPI FBadRglpNameID(LPMAPINAMEID*,ULONG); diff --git a/include/msi.h b/include/msi.h index 164cd26..550ce95 100644 --- a/include/msi.h +++ b/include/msi.h @@ -19,14 +19,14 @@ #ifndef __WINE_MSI_H #define __WINE_MSI_H -#ifdef __cplusplus -extern "C" { -#endif - #ifndef _MSI_NO_CRYPTO #include <wincrypt.h> #endif +#ifdef __cplusplus +extern "C" { +#endif + typedef ULONG MSIHANDLE; typedef enum tagINSTALLSTATE diff --git a/include/rpcndr.h b/include/rpcndr.h index 5ab0685..8c1b4df 100644 --- a/include/rpcndr.h +++ b/include/rpcndr.h @@ -24,12 +24,12 @@ #ifndef __WINE_RPCNDR_H #define __WINE_RPCNDR_H +#include <basetsd.h> + #ifdef __cplusplus extern "C" { #endif -#include <basetsd.h> - #undef CONST_VTBL #ifdef CONST_VTABLE # define CONST_VTBL const diff --git a/include/shlobj.h b/include/shlobj.h index cda1306..e0170ea 100644 --- a/include/shlobj.h +++ b/include/shlobj.h @@ -23,6 +23,8 @@ #include <commctrl.h> #include <prsht.h> #include <shlguid.h> +#include <shtypes.h> +#include <shobjidl.h> #ifdef WINE_NO_UNICODE_MACROS #undef GetObject @@ -35,9 +37,6 @@ extern "C" { /* Except for specific structs, this header is byte packed */ #include <pshpack1.h> -#include <shtypes.h> -#include <shobjidl.h> - #ifndef HPSXA_DEFINED #define HPSXA_DEFINED DECLARE_HANDLE(HPSXA);
1
0
0
0
Thomas Mullaly : urlmon: Implemented IUriBuilder_{Get/Set}UserName.
by Alexandre Julliard
07 Sep '10
07 Sep '10
Module: wine Branch: master Commit: 380fd731e2d8bc6fb1e404539541a43b191fe575 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=380fd731e2d8bc6fb1e404539…
Author: Thomas Mullaly <thomas.mullaly(a)gmail.com> Date: Mon Sep 6 17:55:23 2010 -0400 urlmon: Implemented IUriBuilder_{Get/Set}UserName. --- dlls/urlmon/tests/uri.c | 34 +++++++++++++++++++++++++++++++++- dlls/urlmon/uri.c | 34 +++++++++++++++++++++------------- 2 files changed, 54 insertions(+), 14 deletions(-) diff --git a/dlls/urlmon/tests/uri.c b/dlls/urlmon/tests/uri.c index 4c8f358..8517046 100644 --- a/dlls/urlmon/tests/uri.c +++ b/dlls/urlmon/tests/uri.c @@ -4433,7 +4433,7 @@ static const uri_builder_test uri_builder_tests[] = { {TRUE,"#fragment",NULL,Uri_PROPERTY_FRAGMENT,S_OK,FALSE}, {TRUE,"password",NULL,Uri_PROPERTY_PASSWORD,S_OK,FALSE}, {TRUE,"?query=x",NULL,Uri_PROPERTY_QUERY,S_OK,FALSE}, - {TRUE,"username",NULL,Uri_PROPERTY_USER_NAME,S_OK,TRUE} + {TRUE,"username",NULL,Uri_PROPERTY_USER_NAME,S_OK,FALSE} }, {FALSE}, 0,S_OK,TRUE, @@ -4856,6 +4856,38 @@ static const uri_builder_test uri_builder_tests[] = { {URL_SCHEME_HTTP,S_OK}, {URLZONE_INVALID,E_NOTIMPL} } + }, + { "http://:password@google.com/",0,S_OK,FALSE, + { + {FALSE}, + }, + {FALSE}, + 0,S_OK,TRUE, + 0,S_OK,TRUE, + 0,0,0,S_OK,TRUE, + { + {"http://:password@google.com/",S_OK}, + {":password@google.com",S_OK}, + {"
http://google.com/
",S_OK}, + {"
google.com
",S_OK}, + {"",S_FALSE}, + {"",S_FALSE}, + {"
google.com
",S_OK}, + {"password",S_OK}, + {"/",S_OK}, + {"/",S_OK}, + {"",S_FALSE}, + {"http://:password@google.com/",S_OK}, + {"http",S_OK}, + {":password",S_OK}, + {"",S_FALSE} + }, + { + {Uri_HOST_DNS,S_OK}, + {80,S_OK}, + {URL_SCHEME_HTTP,S_OK}, + {URLZONE_INVALID,E_NOTIMPL} + } } }; diff --git a/dlls/urlmon/uri.c b/dlls/urlmon/uri.c index 283c649..94be29b 100644 --- a/dlls/urlmon/uri.c +++ b/dlls/urlmon/uri.c @@ -100,6 +100,9 @@ typedef struct { WCHAR *scheme; DWORD scheme_len; + + WCHAR *username; + DWORD username_len; } UriBuilder; typedef struct { @@ -4383,6 +4386,7 @@ static ULONG WINAPI UriBuilder_Release(IUriBuilder *iface) heap_free(This->path); heap_free(This->query); heap_free(This->scheme); + heap_free(This->username); heap_free(This); } @@ -4602,19 +4606,22 @@ static HRESULT WINAPI UriBuilder_GetUserName(IUriBuilder *iface, DWORD *pcchUser UriBuilder *This = URIBUILDER_THIS(iface); TRACE("(%p)->(%p %p)\n", This, pcchUserName, ppwzUserName); - if(!pcchUserName) { - if(ppwzUserName) - *ppwzUserName = NULL; - return E_POINTER; - } + if(!This->uri || This->uri->userinfo_start == -1 || + This->uri->userinfo_start == This->uri->userinfo_split || + This->modified_props & Uri_HAS_USER_NAME) + return get_builder_component(&This->username, &This->username_len, NULL, 0, ppwzUserName, pcchUserName); + else { + const WCHAR *start = This->uri->canon_uri+This->uri->userinfo_start; - if(!ppwzUserName) { - *pcchUserName = 0; - return E_POINTER; + /* Check if there's a password in the userinfo section. */ + if(This->uri->userinfo_split > -1) + /* Don't include the password. */ + return get_builder_component(&This->username, &This->username_len, start, + This->uri->userinfo_split, ppwzUserName, pcchUserName); + else + return get_builder_component(&This->username, &This->username_len, start, + This->uri->userinfo_len, ppwzUserName, pcchUserName); } - - FIXME("(%p)->(%p %p)\n", This, pcchUserName, ppwzUserName); - return E_NOTIMPL; } static HRESULT WINAPI UriBuilder_SetFragment(IUriBuilder *iface, LPCWSTR pwzNewValue) @@ -4679,8 +4686,9 @@ static HRESULT WINAPI UriBuilder_SetSchemeName(IUriBuilder *iface, LPCWSTR pwzNe static HRESULT WINAPI UriBuilder_SetUserName(IUriBuilder *iface, LPCWSTR pwzNewValue) { UriBuilder *This = URIBUILDER_THIS(iface); - FIXME("(%p)->(%s)\n", This, debugstr_w(pwzNewValue)); - return E_NOTIMPL; + TRACE("(%p)->(%s)\n", This, debugstr_w(pwzNewValue)); + return set_builder_component(&This->username, &This->username_len, pwzNewValue, 0, + &This->modified_props, Uri_HAS_USER_NAME); } static HRESULT WINAPI UriBuilder_RemoveProperties(IUriBuilder *iface, DWORD dwPropertyMask)
1
0
0
0
Thomas Mullaly : urlmon: Some IUri's don' t include the userinfo component in the absolute URI string.
by Alexandre Julliard
07 Sep '10
07 Sep '10
Module: wine Branch: master Commit: ef8200ebd2f413b19ff31991bc61dd5c4745d9b4 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ef8200ebd2f413b19ff31991b…
Author: Thomas Mullaly <thomas.mullaly(a)gmail.com> Date: Mon Sep 6 18:54:22 2010 -0400 urlmon: Some IUri's don't include the userinfo component in the absolute URI string. --- dlls/urlmon/tests/uri.c | 158 ++++++++++++++++++++++++++++++++++++++++++++++- dlls/urlmon/uri.c | 67 +++++++++++++++++--- 2 files changed, 215 insertions(+), 10 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=ef8200ebd2f413b19ff31…
1
0
0
0
Thomas Mullaly : urlmon: Implemented IUriBuilder_{Get/Set}SchemeName.
by Alexandre Julliard
07 Sep '10
07 Sep '10
Module: wine Branch: master Commit: 7f6faca6f6880843217ac39e7d90ea006416bd16 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7f6faca6f6880843217ac39e7…
Author: Thomas Mullaly <thomas.mullaly(a)gmail.com> Date: Mon Sep 6 16:51:11 2010 -0400 urlmon: Implemented IUriBuilder_{Get/Set}SchemeName. --- dlls/urlmon/tests/uri.c | 4 ++-- dlls/urlmon/uri.c | 27 ++++++++++++--------------- 2 files changed, 14 insertions(+), 17 deletions(-) diff --git a/dlls/urlmon/tests/uri.c b/dlls/urlmon/tests/uri.c index a8b4952..d062df3 100644 --- a/dlls/urlmon/tests/uri.c +++ b/dlls/urlmon/tests/uri.c @@ -4313,7 +4313,7 @@ static const uri_builder_test uri_builder_tests[] = { }, { "
http://google.com/
",0,S_OK,FALSE, { - {TRUE,"test",NULL,Uri_PROPERTY_SCHEME_NAME,S_OK,TRUE} + {TRUE,"test",NULL,Uri_PROPERTY_SCHEME_NAME,S_OK,FALSE} }, {TRUE,TRUE,120,S_OK,FALSE}, 0,S_OK,TRUE, @@ -4345,7 +4345,7 @@ static const uri_builder_test uri_builder_tests[] = { }, { "/Test/test dir",Uri_CREATE_ALLOW_RELATIVE,S_OK,FALSE, { - {TRUE,"http",NULL,Uri_PROPERTY_SCHEME_NAME,S_OK,TRUE}, + {TRUE,"http",NULL,Uri_PROPERTY_SCHEME_NAME,S_OK,FALSE}, {TRUE,"::192.2.3.4",NULL,Uri_PROPERTY_HOST,S_OK,FALSE}, {TRUE,NULL,NULL,Uri_PROPERTY_PATH,S_OK,FALSE} }, diff --git a/dlls/urlmon/uri.c b/dlls/urlmon/uri.c index ce14446..f15f6aa 100644 --- a/dlls/urlmon/uri.c +++ b/dlls/urlmon/uri.c @@ -97,6 +97,9 @@ typedef struct { WCHAR *query; DWORD query_len; + + WCHAR *scheme; + DWORD scheme_len; } UriBuilder; typedef struct { @@ -4328,6 +4331,7 @@ static ULONG WINAPI UriBuilder_Release(IUriBuilder *iface) heap_free(This->password); heap_free(This->path); heap_free(This->query); + heap_free(This->scheme); heap_free(This); } @@ -4535,19 +4539,11 @@ static HRESULT WINAPI UriBuilder_GetSchemeName(IUriBuilder *iface, DWORD *pcchSc UriBuilder *This = URIBUILDER_THIS(iface); TRACE("(%p)->(%p %p)\n", This, pcchSchemeName, ppwzSchemeName); - if(!pcchSchemeName) { - if(ppwzSchemeName) - *ppwzSchemeName = NULL; - return E_POINTER; - } - - if(!ppwzSchemeName) { - *pcchSchemeName = 0; - return E_POINTER; - } - - FIXME("(%p)->(%p %p)\n", This, pcchSchemeName, ppwzSchemeName); - return E_NOTIMPL; + if(!This->uri || This->uri->scheme_start == -1 || This->modified_props & Uri_HAS_SCHEME_NAME) + return get_builder_component(&This->scheme, &This->scheme_len, NULL, 0, ppwzSchemeName, pcchSchemeName); + else + return get_builder_component(&This->scheme, &This->scheme_len, This->uri->canon_uri+This->uri->scheme_start, + This->uri->scheme_len, ppwzSchemeName, pcchSchemeName); } static HRESULT WINAPI UriBuilder_GetUserName(IUriBuilder *iface, DWORD *pcchUserName, LPCWSTR *ppwzUserName) @@ -4624,8 +4620,9 @@ static HRESULT WINAPI UriBuilder_SetQuery(IUriBuilder *iface, LPCWSTR pwzNewValu static HRESULT WINAPI UriBuilder_SetSchemeName(IUriBuilder *iface, LPCWSTR pwzNewValue) { UriBuilder *This = URIBUILDER_THIS(iface); - FIXME("(%p)->(%s)\n", This, debugstr_w(pwzNewValue)); - return E_NOTIMPL; + TRACE("(%p)->(%s)\n", This, debugstr_w(pwzNewValue)); + return set_builder_component(&This->scheme, &This->scheme_len, pwzNewValue, 0, + &This->modified_props, Uri_HAS_SCHEME_NAME); } static HRESULT WINAPI UriBuilder_SetUserName(IUriBuilder *iface, LPCWSTR pwzNewValue)
1
0
0
0
Thomas Mullaly : urlmon: Implemented IUriBuilder_{Get/Set}Query.
by Alexandre Julliard
07 Sep '10
07 Sep '10
Module: wine Branch: master Commit: b27e9297b6058e95adb6b1428fb3a60fee43f01f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b27e9297b6058e95adb6b1428…
Author: Thomas Mullaly <thomas.mullaly(a)gmail.com> Date: Mon Sep 6 16:43:37 2010 -0400 urlmon: Implemented IUriBuilder_{Get/Set}Query. --- dlls/urlmon/tests/uri.c | 35 ++++++++++++++++++++++++++++++++++- dlls/urlmon/uri.c | 27 ++++++++++++--------------- 2 files changed, 46 insertions(+), 16 deletions(-) diff --git a/dlls/urlmon/tests/uri.c b/dlls/urlmon/tests/uri.c index 6756d99..a8b4952 100644 --- a/dlls/urlmon/tests/uri.c +++ b/dlls/urlmon/tests/uri.c @@ -4280,7 +4280,7 @@ static const uri_builder_test uri_builder_tests[] = { { {TRUE,"#fragment",NULL,Uri_PROPERTY_FRAGMENT,S_OK,FALSE}, {TRUE,"password",NULL,Uri_PROPERTY_PASSWORD,S_OK,FALSE}, - {TRUE,"?query=x",NULL,Uri_PROPERTY_QUERY,S_OK,TRUE}, + {TRUE,"?query=x",NULL,Uri_PROPERTY_QUERY,S_OK,FALSE}, {TRUE,"username",NULL,Uri_PROPERTY_USER_NAME,S_OK,TRUE} }, {FALSE}, @@ -4671,6 +4671,39 @@ static const uri_builder_test uri_builder_tests[] = { {URL_SCHEME_HTTP,S_OK}, {URLZONE_INVALID,E_NOTIMPL} } + }, + { "
http://google.com/
",0,S_OK,FALSE, + { + {TRUE,"test","?test",Uri_PROPERTY_QUERY,S_OK,FALSE}, + }, + + {FALSE}, + 0,S_OK,TRUE, + 0,S_OK,TRUE, + 0,0,0,S_OK,TRUE, + { + {"
http://google.com/?test
",S_OK}, + {"
google.com
",S_OK}, + {"
http://google.com/?test
",S_OK}, + {"
google.com
",S_OK}, + {"",S_FALSE}, + {"",S_FALSE}, + {"
google.com
",S_OK}, + {"",S_FALSE}, + {"/",S_OK}, + {"/?test",S_OK}, + {"?test",S_OK}, + {"
http://google.com/?test
",S_OK}, + {"http",S_OK}, + {"",S_FALSE}, + {"",S_FALSE} + }, + { + {Uri_HOST_DNS,S_OK}, + {80,S_OK}, + {URL_SCHEME_HTTP,S_OK}, + {URLZONE_INVALID,E_NOTIMPL} + } } }; diff --git a/dlls/urlmon/uri.c b/dlls/urlmon/uri.c index dbc1747..ce14446 100644 --- a/dlls/urlmon/uri.c +++ b/dlls/urlmon/uri.c @@ -94,6 +94,9 @@ typedef struct { BOOL has_port; DWORD port; + + WCHAR *query; + DWORD query_len; } UriBuilder; typedef struct { @@ -4324,6 +4327,7 @@ static ULONG WINAPI UriBuilder_Release(IUriBuilder *iface) heap_free(This->host); heap_free(This->password); heap_free(This->path); + heap_free(This->query); heap_free(This); } @@ -4519,19 +4523,11 @@ static HRESULT WINAPI UriBuilder_GetQuery(IUriBuilder *iface, DWORD *pcchQuery, UriBuilder *This = URIBUILDER_THIS(iface); TRACE("(%p)->(%p %p)\n", This, pcchQuery, ppwzQuery); - if(!pcchQuery) { - if(ppwzQuery) - *ppwzQuery = NULL; - return E_POINTER; - } - - if(!ppwzQuery) { - *pcchQuery = 0; - return E_POINTER; - } - - FIXME("(%p)->(%p %p)\n", This, pcchQuery, ppwzQuery); - return E_NOTIMPL; + if(!This->uri || This->uri->query_start == -1 || This->modified_props & Uri_HAS_QUERY) + return get_builder_component(&This->query, &This->query_len, NULL, 0, ppwzQuery, pcchQuery); + else + return get_builder_component(&This->query, &This->query_len, This->uri->canon_uri+This->uri->query_start, + This->uri->query_len, ppwzQuery, pcchQuery); } static HRESULT WINAPI UriBuilder_GetSchemeName(IUriBuilder *iface, DWORD *pcchSchemeName, LPCWSTR *ppwzSchemeName) @@ -4620,8 +4616,9 @@ static HRESULT WINAPI UriBuilder_SetPort(IUriBuilder *iface, BOOL fHasPort, DWOR static HRESULT WINAPI UriBuilder_SetQuery(IUriBuilder *iface, LPCWSTR pwzNewValue) { UriBuilder *This = URIBUILDER_THIS(iface); - FIXME("(%p)->(%s)\n", This, debugstr_w(pwzNewValue)); - return E_NOTIMPL; + TRACE("(%p)->(%s)\n", This, debugstr_w(pwzNewValue)); + return set_builder_component(&This->query, &This->query_len, pwzNewValue, '?', + &This->modified_props, Uri_HAS_QUERY); } static HRESULT WINAPI UriBuilder_SetSchemeName(IUriBuilder *iface, LPCWSTR pwzNewValue)
1
0
0
0
Thomas Mullaly : urlmon: Implemented IUriBuilder_{Get/Set}Port.
by Alexandre Julliard
07 Sep '10
07 Sep '10
Module: wine Branch: master Commit: a4eee688183db9036cf02a973d067a884022d24b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a4eee688183db9036cf02a973…
Author: Thomas Mullaly <thomas.mullaly(a)gmail.com> Date: Mon Sep 6 16:34:21 2010 -0400 urlmon: Implemented IUriBuilder_{Get/Set}Port. --- dlls/urlmon/tests/uri.c | 136 ++++++++++++++++++++++++++++++++++++++++++++++- dlls/urlmon/uri.c | 21 ++++++-- 2 files changed, 152 insertions(+), 5 deletions(-) diff --git a/dlls/urlmon/tests/uri.c b/dlls/urlmon/tests/uri.c index 684a608..6756d99 100644 --- a/dlls/urlmon/tests/uri.c +++ b/dlls/urlmon/tests/uri.c @@ -4315,7 +4315,7 @@ static const uri_builder_test uri_builder_tests[] = { { {TRUE,"test",NULL,Uri_PROPERTY_SCHEME_NAME,S_OK,TRUE} }, - {TRUE,TRUE,120,S_OK,TRUE}, + {TRUE,TRUE,120,S_OK,FALSE}, 0,S_OK,TRUE, 0,S_OK,TRUE, 0,0,0,S_OK,TRUE, @@ -4568,6 +4568,109 @@ static const uri_builder_test uri_builder_tests[] = { {URL_SCHEME_UNKNOWN,S_OK}, {URLZONE_INVALID,E_NOTIMPL} } + }, + { "
http://google.com/
",0,S_OK,FALSE, + { + {FALSE}, + }, + /* 555 will be returned from GetPort even though FALSE was passed as the hasPort parameter. */ + {TRUE,FALSE,555,S_OK,FALSE}, + 0,S_OK,TRUE, + 0,S_OK,TRUE, + 0,0,0,S_OK,TRUE, + { + {"
http://google.com/
",S_OK}, + {"
google.com
",S_OK}, + {"
http://google.com/
",S_OK}, + {"
google.com
",S_OK}, + {"",S_FALSE}, + {"",S_FALSE}, + {"
google.com
",S_OK}, + {"",S_FALSE}, + {"/",S_OK}, + {"/",S_OK}, + {"",S_FALSE}, + {"
http://google.com/
",S_OK}, + {"http",S_OK}, + {"",S_FALSE}, + {"",S_FALSE} + }, + { + {Uri_HOST_DNS,S_OK}, + /* Still returns 80, even though earlier the port was disabled. */ + {80,S_OK}, + {URL_SCHEME_HTTP,S_OK}, + {URLZONE_INVALID,E_NOTIMPL} + } + }, + { "
http://google.com/
",0,S_OK,FALSE, + { + {FALSE}, + }, + /* Instead of getting "TRUE" back as the "hasPort" parameter in GetPort, + * you'll get 122345 instead. + */ + {TRUE,122345,222,S_OK,FALSE}, + 0,S_OK,TRUE, + 0,S_OK,TRUE, + 0,0,0,S_OK,TRUE, + { + {"
http://google.com:222/
",S_OK}, + {"google.com:222",S_OK}, + {"
http://google.com:222/
",S_OK}, + {"
google.com
",S_OK}, + {"",S_FALSE}, + {"",S_FALSE}, + {"
google.com
",S_OK}, + {"",S_FALSE}, + {"/",S_OK}, + {"/",S_OK}, + {"",S_FALSE}, + {"
http://google.com:222/
",S_OK}, + {"http",S_OK}, + {"",S_FALSE}, + {"",S_FALSE} + }, + { + {Uri_HOST_DNS,S_OK}, + {222,S_OK}, + {URL_SCHEME_HTTP,S_OK}, + {URLZONE_INVALID,E_NOTIMPL} + } + }, + /* IUri's created with the IUriBuilder can have ports that exceed USHORT_MAX. */ + { "
http://google.com/
",0,S_OK,FALSE, + { + {FALSE}, + }, + + {TRUE,TRUE,999999,S_OK,FALSE}, + 0,S_OK,TRUE, + 0,S_OK,TRUE, + 0,0,0,S_OK,TRUE, + { + {"
http://google.com:999999/
",S_OK}, + {"google.com:999999",S_OK}, + {"
http://google.com:999999/
",S_OK}, + {"
google.com
",S_OK}, + {"",S_FALSE}, + {"",S_FALSE}, + {"
google.com
",S_OK}, + {"",S_FALSE}, + {"/",S_OK}, + {"/",S_OK}, + {"",S_FALSE}, + {"
http://google.com:999999/
",S_OK}, + {"http",S_OK}, + {"",S_FALSE}, + {"",S_FALSE} + }, + { + {Uri_HOST_DNS,S_OK}, + {999999,S_OK}, + {URL_SCHEME_HTTP,S_OK}, + {URLZONE_INVALID,E_NOTIMPL} + } } }; @@ -7516,6 +7619,34 @@ static void test_IUriBuilder_RemoveProperties(void) { } } +static void test_IUriBuilder_Misc(void) { + HRESULT hr; + IUri *uri; + + hr = pCreateUri(http_urlW, 0, 0, &uri); + if(SUCCEEDED(hr)) { + IUriBuilder *builder; + + hr = pCreateIUriBuilder(uri, 0, 0, &builder); + ok(hr == S_OK, "Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x.\n", hr, S_OK); + if(SUCCEEDED(hr)) { + BOOL has = -1; + DWORD port = -1; + + hr = IUriBuilder_GetPort(builder, &has, &port); + ok(hr == S_OK, "Error: IUriBuilder_GetPort returned 0x%08x, expected 0x%08x.\n", hr, S_OK); + if(SUCCEEDED(hr)) { + /* 'has' will be set to FALSE, even though uri had a port. */ + ok(has == FALSE, "Error: Expected 'has' to be FALSE, was %d instead.\n", has); + /* Still sets 'port' to 80. */ + ok(port == 80, "Error: Expected the port to be 80, but, was %d instead.\n", port); + } + } + if(builder) IUriBuilder_Release(builder); + } + if(uri) IUri_Release(uri); +} + START_TEST(uri) { HMODULE hurlmon; @@ -7591,4 +7722,7 @@ START_TEST(uri) { trace("test IUriBuilder_RemoveProperties...\n"); test_IUriBuilder_RemoveProperties(); + + trace("test IUriBuilder miscellaneous...\n"); + test_IUriBuilder_Misc(); } diff --git a/dlls/urlmon/uri.c b/dlls/urlmon/uri.c index c05c0fa..dbc1747 100644 --- a/dlls/urlmon/uri.c +++ b/dlls/urlmon/uri.c @@ -91,6 +91,9 @@ typedef struct { WCHAR *path; DWORD path_len; + + BOOL has_port; + DWORD port; } UriBuilder; typedef struct { @@ -4506,8 +4509,9 @@ static HRESULT WINAPI UriBuilder_GetPort(IUriBuilder *iface, BOOL *pfHasPort, DW return E_POINTER; } - FIXME("(%p)->(%p %p)\n", This, pfHasPort, pdwPort); - return E_NOTIMPL; + *pfHasPort = This->has_port; + *pdwPort = This->port; + return S_OK; } static HRESULT WINAPI UriBuilder_GetQuery(IUriBuilder *iface, DWORD *pcchQuery, LPCWSTR *ppwzQuery) @@ -4605,8 +4609,12 @@ static HRESULT WINAPI UriBuilder_SetPath(IUriBuilder *iface, LPCWSTR pwzNewValue static HRESULT WINAPI UriBuilder_SetPort(IUriBuilder *iface, BOOL fHasPort, DWORD dwNewValue) { UriBuilder *This = URIBUILDER_THIS(iface); - FIXME("(%p)->(%d %d)\n", This, fHasPort, dwNewValue); - return E_NOTIMPL; + TRACE("(%p)->(%d %d)\n", This, fHasPort, dwNewValue); + + This->has_port = fHasPort; + This->port = dwNewValue; + This->modified_props |= Uri_HAS_PORT; + return S_OK; } static HRESULT WINAPI UriBuilder_SetQuery(IUriBuilder *iface, LPCWSTR pwzNewValue) @@ -4705,6 +4713,11 @@ HRESULT WINAPI CreateIUriBuilder(IUri *pIUri, DWORD dwFlags, DWORD_PTR dwReserve if((uri = get_uri_obj(pIUri))) { IUri_AddRef(pIUri); ret->uri = uri; + + if(uri->has_port) + /* Windows doesn't set 'has_port' to TRUE in this case. */ + ret->port = uri->port; + } else { heap_free(ret); *ppIUriBuilder = NULL;
1
0
0
0
Thomas Mullaly : urlmon: set_builder_component now handles setting the modified property flag.
by Alexandre Julliard
07 Sep '10
07 Sep '10
Module: wine Branch: master Commit: 23e312e3245faf8123e4f1307f790db93c51e3e7 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=23e312e3245faf8123e4f1307…
Author: Thomas Mullaly <thomas.mullaly(a)gmail.com> Date: Mon Sep 6 15:47:01 2010 -0400 urlmon: set_builder_component now handles setting the modified property flag. --- dlls/urlmon/uri.c | 25 ++++++++++++------------- 1 files changed, 12 insertions(+), 13 deletions(-) diff --git a/dlls/urlmon/uri.c b/dlls/urlmon/uri.c index ef6ba22..c05c0fa 100644 --- a/dlls/urlmon/uri.c +++ b/dlls/urlmon/uri.c @@ -3292,9 +3292,11 @@ static HRESULT get_builder_component(LPWSTR *component, DWORD *component_len, /* Allocates 'component' and copies the string from 'new_value' into 'component'. * If 'prefix' is set and 'new_value' isn't NULL, then it checks if 'new_value' * starts with 'prefix'. If it doesn't then 'prefix' is prepended to 'component'. + * + * If everything is successful, then will set 'success_flag' in 'flags'. */ static HRESULT set_builder_component(LPWSTR *component, DWORD *component_len, LPCWSTR new_value, - WCHAR prefix) + WCHAR prefix, DWORD *flags, DWORD success_flag) { if(*component) heap_free(*component); @@ -3323,6 +3325,7 @@ static HRESULT set_builder_component(LPWSTR *component, DWORD *component_len, LP *component_len = len+pos; } + *flags |= success_flag; return S_OK; } @@ -4571,36 +4574,32 @@ static HRESULT WINAPI UriBuilder_SetFragment(IUriBuilder *iface, LPCWSTR pwzNewV { UriBuilder *This = URIBUILDER_THIS(iface); TRACE("(%p)->(%s)\n", This, debugstr_w(pwzNewValue)); - - This->modified_props |= Uri_HAS_FRAGMENT; - return set_builder_component(&This->fragment, &This->fragment_len, pwzNewValue, '#'); + return set_builder_component(&This->fragment, &This->fragment_len, pwzNewValue, '#', + &This->modified_props, Uri_HAS_FRAGMENT); } static HRESULT WINAPI UriBuilder_SetHost(IUriBuilder *iface, LPCWSTR pwzNewValue) { UriBuilder *This = URIBUILDER_THIS(iface); TRACE("(%p)->(%s)\n", This, debugstr_w(pwzNewValue)); - - This->modified_props |= Uri_HAS_HOST; - return set_builder_component(&This->host, &This->host_len, pwzNewValue, 0); + return set_builder_component(&This->host, &This->host_len, pwzNewValue, 0, + &This->modified_props, Uri_HAS_HOST); } static HRESULT WINAPI UriBuilder_SetPassword(IUriBuilder *iface, LPCWSTR pwzNewValue) { UriBuilder *This = URIBUILDER_THIS(iface); TRACE("(%p)->(%s)\n", This, debugstr_w(pwzNewValue)); - - This->modified_props |= Uri_HAS_PASSWORD; - return set_builder_component(&This->password, &This->password_len, pwzNewValue, 0); + return set_builder_component(&This->password, &This->password_len, pwzNewValue, 0, + &This->modified_props, Uri_HAS_PASSWORD); } static HRESULT WINAPI UriBuilder_SetPath(IUriBuilder *iface, LPCWSTR pwzNewValue) { UriBuilder *This = URIBUILDER_THIS(iface); TRACE("(%p)->(%s)\n", This, debugstr_w(pwzNewValue)); - - This->modified_props |= Uri_HAS_PATH; - return set_builder_component(&This->path, &This->path_len, pwzNewValue, 0); + return set_builder_component(&This->path, &This->path_len, pwzNewValue, 0, + &This->modified_props, Uri_HAS_PATH); } static HRESULT WINAPI UriBuilder_SetPort(IUriBuilder *iface, BOOL fHasPort, DWORD dwNewValue)
1
0
0
0
Nikolay Sivov : msxml3/tests: Basic test for ::setAttributeNode().
by Alexandre Julliard
07 Sep '10
07 Sep '10
Module: wine Branch: master Commit: 398e64941472273e9a0b3d39410c6843f19efd51 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=398e64941472273e9a0b3d394…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Mon Sep 6 23:26:39 2010 +0400 msxml3/tests: Basic test for ::setAttributeNode(). --- dlls/msxml3/element.c | 4 +++ dlls/msxml3/tests/domdoc.c | 53 +++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 56 insertions(+), 1 deletions(-) diff --git a/dlls/msxml3/element.c b/dlls/msxml3/element.c index 0e8559a..e65da62 100644 --- a/dlls/msxml3/element.c +++ b/dlls/msxml3/element.c @@ -661,7 +661,11 @@ static HRESULT WINAPI domelem_setAttributeNode( IXMLDOMAttribute** attributeNode) { domelem *This = impl_from_IXMLDOMElement( iface ); + FIXME("(%p)->(%p %p)\n", This, domAttribute, attributeNode); + + if(!domAttribute) return E_INVALIDARG; + return E_NOTIMPL; } diff --git a/dlls/msxml3/tests/domdoc.c b/dlls/msxml3/tests/domdoc.c index 06532d6..4317c52 100644 --- a/dlls/msxml3/tests/domdoc.c +++ b/dlls/msxml3/tests/domdoc.c @@ -5932,6 +5932,57 @@ static void test_get_ownerDocument(void) free_bstrs(); } +static void test_setAttributeNode(void) +{ + IXMLDOMDocument *doc; + IXMLDOMElement *elem; + IXMLDOMAttribute *attr, *attr2, *ret_attr; + VARIANT_BOOL b; + HRESULT hr; + BSTR str; + + doc = create_document(&IID_IXMLDOMDocument); + if (!doc) return; + + str = SysAllocString( szComplete4 ); + hr = IXMLDOMDocument2_loadXML( doc, str, &b ); + ok( hr == S_OK, "loadXML failed\n"); + ok( b == VARIANT_TRUE, "failed to load XML string\n"); + SysFreeString( str ); + + hr = IXMLDOMDocument_get_documentElement(doc, &elem); + ok( hr == S_OK, "got 0x%08x\n", hr); + + ret_attr = (void*)0xdeadbeef; + hr = IXMLDOMElement_setAttributeNode(elem, NULL, &ret_attr); + ok( hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok( ret_attr == (void*)0xdeadbeef, "got %p\n", ret_attr); + + hr = IXMLDOMDocument_createAttribute(doc, _bstr_("attr"), &attr); + ok( hr == S_OK, "got 0x%08x\n", hr); + + ret_attr = (void*)0xdeadbeef; + hr = IXMLDOMElement_setAttributeNode(elem, attr, &ret_attr); + todo_wine ok( hr == S_OK, "got 0x%08x\n", hr); + todo_wine ok( ret_attr == NULL, "got %p\n", ret_attr); + + attr2 = NULL; + hr = IXMLDOMElement_getAttributeNode(elem, _bstr_("attr"), &attr2); + todo_wine ok( hr == S_OK, "got 0x%08x\n", hr); + if (attr2) IXMLDOMAttribute_Release(attr2); + + /* try to add it another time */ + ret_attr = (void*)0xdeadbeef; + hr = IXMLDOMElement_setAttributeNode(elem, attr, &ret_attr); + todo_wine ok( hr == E_FAIL, "got 0x%08x\n", hr); + ok( ret_attr == (void*)0xdeadbeef, "got %p\n", ret_attr); + + IXMLDOMAttribute_Release(attr); + IXMLDOMElement_Release(elem); + IXMLDOMDocument_Release(doc); + free_bstrs(); +} + START_TEST(domdoc) { IXMLDOMDocument *doc; @@ -5951,7 +6002,6 @@ START_TEST(domdoc) return; } - IXMLDOMDocument_Release(doc); test_domdoc(); @@ -5985,6 +6035,7 @@ START_TEST(domdoc) test_getQualifiedItem(); test_removeQualifiedItem(); test_get_ownerDocument(); + test_setAttributeNode(); CoUninitialize(); }
1
0
0
0
Nikolay Sivov : msxml3/tests: Some tests for ::get_ownerDocument() returned document instance.
by Alexandre Julliard
07 Sep '10
07 Sep '10
Module: wine Branch: master Commit: 97e78d9a0ebfb4ac71985330d6ad86bf02bdf0f3 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=97e78d9a0ebfb4ac71985330d…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Sun Sep 5 21:06:17 2010 +0400 msxml3/tests: Some tests for ::get_ownerDocument() returned document instance. --- dlls/msxml3/tests/domdoc.c | 79 ++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 79 insertions(+), 0 deletions(-) diff --git a/dlls/msxml3/tests/domdoc.c b/dlls/msxml3/tests/domdoc.c index ded8175..06532d6 100644 --- a/dlls/msxml3/tests/domdoc.c +++ b/dlls/msxml3/tests/domdoc.c @@ -5854,6 +5854,84 @@ static void test_removeQualifiedItem(void) free_bstrs(); } +static void test_get_ownerDocument(void) +{ + IXMLDOMDocument *doc1, *doc2, *doc3; + IXMLDOMDocument2 *doc, *doc_owner; + IXMLDOMNode *node; + VARIANT_BOOL b; + VARIANT var; + HRESULT hr; + BSTR str; + + doc = create_document(&IID_IXMLDOMDocument2); + if (!doc) return; + + str = SysAllocString( szComplete4 ); + hr = IXMLDOMDocument2_loadXML( doc, str, &b ); + ok( hr == S_OK, "loadXML failed\n"); + ok( b == VARIANT_TRUE, "failed to load XML string\n"); + SysFreeString( str ); + + V_VT(&var) = VT_BSTR; + V_BSTR(&var) = _bstr_("xmlns:wi=\'
www.winehq.org\
'"); + hr = IXMLDOMDocument2_setProperty(doc, _bstr_("SelectionNamespaces"), var); + todo_wine ok( hr == S_OK, "got 0x%08x\n", hr); + + hr = IXMLDOMDocument2_get_firstChild(doc, &node); + ok( hr == S_OK, "got 0x%08x\n", hr); + + hr = IXMLDOMNode_get_ownerDocument(node, &doc1); + ok( hr == S_OK, "got 0x%08x\n", hr); + + VariantClear(&var); + hr = IXMLDOMDocument_QueryInterface(doc1, &IID_IXMLDOMDocument2, (void**)&doc_owner); + ok( hr == S_OK, "got 0x%08x\n", hr); + ok( doc_owner != doc, "got %p, doc %p\n", doc_owner, doc); + hr = IXMLDOMDocument2_getProperty(doc_owner, _bstr_("SelectionNamespaces"), &var); + todo_wine ok( hr == S_OK, "got 0x%08x\n", hr); + todo_wine ok( lstrcmpW(V_BSTR(&var), _bstr_("xmlns:wi=\'
www.winehq.org\
'")) == 0, "expected previously set value\n"); + IXMLDOMDocument2_Release(doc_owner); + VariantClear(&var); + + hr = IXMLDOMNode_get_ownerDocument(node, &doc2); + ok( hr == S_OK, "got 0x%08x\n", hr); + IXMLDOMNode_Release(node); + + ok(doc1 != doc2, "got %p, expected %p. original %p\n", doc2, doc1, doc); + + /* reload */ + str = SysAllocString( szComplete4 ); + hr = IXMLDOMDocument2_loadXML( doc, str, &b ); + ok( hr == S_OK, "got 0x%08x\n", hr); + ok( b == VARIANT_TRUE, "failed to load XML string\n"); + SysFreeString( str ); + + /* property retained even after reload */ + VariantClear(&var); + hr = IXMLDOMDocument2_getProperty(doc, _bstr_("SelectionNamespaces"), &var); + todo_wine ok( hr == S_OK, "got 0x%08x\n", hr); + todo_wine ok( lstrcmpW(V_BSTR(&var), _bstr_("xmlns:wi=\'
www.winehq.org\
'")) == 0, "expected previously set value\n"); + VariantClear(&var); + + hr = IXMLDOMDocument2_get_firstChild(doc, &node); + ok( hr == S_OK, "got 0x%08x\n", hr); + + hr = IXMLDOMNode_get_ownerDocument(node, &doc3); + ok( hr == S_OK, "got 0x%08x\n", hr); + IXMLDOMNode_Release(node); + + hr = IXMLDOMDocument_QueryInterface(doc3, &IID_IXMLDOMDocument2, (void**)&doc_owner); + ok( hr == S_OK, "got 0x%08x\n", hr); + ok(doc3 != doc1 && doc3 != doc2 && doc_owner != doc, "got %p, (%p, %p, %p)\n", doc3, doc, doc1, doc2); + + IXMLDOMDocument_Release(doc1); + IXMLDOMDocument_Release(doc2); + IXMLDOMDocument_Release(doc3); + IXMLDOMDocument2_Release(doc); + free_bstrs(); +} + START_TEST(domdoc) { IXMLDOMDocument *doc; @@ -5906,6 +5984,7 @@ START_TEST(domdoc) test_splitText(); test_getQualifiedItem(); test_removeQualifiedItem(); + test_get_ownerDocument(); CoUninitialize(); }
1
0
0
0
Nikolay Sivov : msxml3/domdoc: Implement IXMLDOMNamedNodeMap:: removeQualifiedItem().
by Alexandre Julliard
07 Sep '10
07 Sep '10
Module: wine Branch: master Commit: 0adfd6cf4c4f5b512c10ab2a5f4c77de13a8fa2a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=0adfd6cf4c4f5b512c10ab2a5…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Sat Sep 4 18:41:10 2010 +0400 msxml3/domdoc: Implement IXMLDOMNamedNodeMap::removeQualifiedItem(). --- dlls/msxml3/nodemap.c | 99 +++++++++++++++++++++++++------------------ dlls/msxml3/tests/domdoc.c | 70 ++++++++++++++++++++++++++++++- 2 files changed, 125 insertions(+), 44 deletions(-) diff --git a/dlls/msxml3/nodemap.c b/dlls/msxml3/nodemap.c index f7818f9..78d9d46 100644 --- a/dlls/msxml3/nodemap.c +++ b/dlls/msxml3/nodemap.c @@ -250,43 +250,8 @@ static HRESULT WINAPI xmlnodemap_removeNamedItem( IXMLDOMNode** namedItem) { xmlnodemap *This = impl_from_IXMLDOMNamedNodeMap( iface ); - xmlChar *element_name; - xmlAttrPtr attr; - xmlNodePtr node; - TRACE("(%p)->(%s %p)\n", This, debugstr_w(name), namedItem ); - - if ( !name) - return E_INVALIDARG; - - node = xmlNodePtr_from_domnode( This->node, 0 ); - if ( !node ) - return E_FAIL; - - element_name = xmlChar_from_wchar( name ); - attr = xmlHasNsProp( node, element_name, NULL ); - heap_free( element_name ); - - if ( !attr ) - { - if( namedItem ) - *namedItem = NULL; - return S_FALSE; - } - - if ( namedItem ) - { - xmlUnlinkNode( (xmlNodePtr) attr ); - xmldoc_add_orphan( attr->doc, (xmlNodePtr) attr ); - *namedItem = create_node( (xmlNodePtr) attr ); - } - else - { - if( xmlRemoveProp( attr ) == -1 ) - ERR("xmlRemoveProp failed\n"); - } - - return S_OK; + return IXMLDOMNamedNodeMap_removeQualifiedItem(iface, name, NULL, namedItem); } static HRESULT WINAPI xmlnodemap_get_item( @@ -394,6 +359,10 @@ static HRESULT WINAPI xmlnodemap_getQualifiedItem( } attr = xmlHasNsProp(node, name, href); + + heap_free(name); + heap_free(href); + if (!attr) { *qualifiedItem = NULL; @@ -402,9 +371,6 @@ static HRESULT WINAPI xmlnodemap_getQualifiedItem( *qualifiedItem = create_node((xmlNodePtr)attr); - heap_free(name); - heap_free(href); - return S_OK; } @@ -415,8 +381,58 @@ static HRESULT WINAPI xmlnodemap_removeQualifiedItem( IXMLDOMNode** qualifiedItem) { xmlnodemap *This = impl_from_IXMLDOMNamedNodeMap( iface ); - FIXME("(%p)->(%s %s %p)\n", This, debugstr_w(baseName), debugstr_w(namespaceURI), qualifiedItem); - return E_NOTIMPL; + xmlAttrPtr attr; + xmlNodePtr node; + xmlChar *name; + xmlChar *href; + + TRACE("(%p)->(%s %s %p)\n", This, debugstr_w(baseName), debugstr_w(namespaceURI), qualifiedItem); + + if (!baseName) return E_INVALIDARG; + + node = xmlNodePtr_from_domnode( This->node, XML_ELEMENT_NODE ); + if ( !node ) + return E_FAIL; + + if (namespaceURI && *namespaceURI) + { + href = xmlChar_from_wchar(namespaceURI); + if (!href) return E_OUTOFMEMORY; + } + else + href = NULL; + + name = xmlChar_from_wchar(baseName); + if (!name) + { + heap_free(href); + return E_OUTOFMEMORY; + } + + attr = xmlHasNsProp( node, name, href ); + + heap_free(name); + heap_free(href); + + if ( !attr ) + { + if (qualifiedItem) *qualifiedItem = NULL; + return S_FALSE; + } + + if ( qualifiedItem ) + { + xmlUnlinkNode( (xmlNodePtr) attr ); + xmldoc_add_orphan( attr->doc, (xmlNodePtr) attr ); + *qualifiedItem = create_node( (xmlNodePtr) attr ); + } + else + { + if (xmlRemoveProp(attr) == -1) + ERR("xmlRemoveProp failed\n"); + } + + return S_OK; } static HRESULT WINAPI xmlnodemap_nextNode( @@ -497,7 +513,6 @@ static HRESULT WINAPI support_error_QueryInterface( { xmlnodemap *This = impl_from_ISupportErrorInfo( iface ); TRACE("%p %s %p\n", iface, debugstr_guid(riid), ppvObject); - return IXMLDOMNamedNodeMap_QueryInterface((IXMLDOMNamedNodeMap*)&This->lpVtbl, riid, ppvObject); } diff --git a/dlls/msxml3/tests/domdoc.c b/dlls/msxml3/tests/domdoc.c index 8211aec..ded8175 100644 --- a/dlls/msxml3/tests/domdoc.c +++ b/dlls/msxml3/tests/domdoc.c @@ -2791,7 +2791,7 @@ static void test_removeNamedItem(void) removed_node = (void*)0xdeadbeef; r = IXMLDOMNamedNodeMap_removeNamedItem( pr_attrs, NULL, &removed_node); ok ( r == E_INVALIDARG, "ret %08x\n", r); - ok ( removed_node == (void*)0xdeadbeef, "removed_node == %p\n", removed_node); + ok ( removed_node == (void*)0xdeadbeef, "got %p\n", removed_node); removed_node = (void*)0xdeadbeef; str = SysAllocString(szvr); @@ -2801,7 +2801,7 @@ static void test_removeNamedItem(void) removed_node2 = (void*)0xdeadbeef; r = IXMLDOMNamedNodeMap_removeNamedItem( pr_attrs, str, &removed_node2); ok ( r == S_FALSE, "ret %08x\n", r); - ok ( removed_node2 == NULL, "removed_node == %p\n", removed_node2 ); + ok ( removed_node2 == NULL, "got %p\n", removed_node2 ); r = IXMLDOMNamedNodeMap_get_length( pr_attrs, &len ); ok( r == S_OK, "ret %08x\n", r); @@ -5789,6 +5789,71 @@ static void test_getQualifiedItem(void) free_bstrs(); } +static void test_removeQualifiedItem(void) +{ + IXMLDOMDocument *doc; + IXMLDOMElement *element; + IXMLDOMNode *pr_node, *node; + IXMLDOMNodeList *root_list; + IXMLDOMNamedNodeMap *map; + VARIANT_BOOL b; + BSTR str; + LONG len; + HRESULT hr; + + doc = create_document(&IID_IXMLDOMDocument); + if (!doc) return; + + str = SysAllocString( szComplete4 ); + hr = IXMLDOMDocument_loadXML( doc, str, &b ); + ok( hr == S_OK, "loadXML failed\n"); + ok( b == VARIANT_TRUE, "failed to load XML string\n"); + SysFreeString( str ); + + hr = IXMLDOMDocument_get_documentElement(doc, &element); + ok( hr == S_OK, "ret %08x\n", hr); + + hr = IXMLDOMElement_get_childNodes(element, &root_list); + ok( hr == S_OK, "ret %08x\n", hr); + + hr = IXMLDOMNodeList_get_item(root_list, 1, &pr_node); + ok( hr == S_OK, "ret %08x\n", hr); + IXMLDOMNodeList_Release(root_list); + + hr = IXMLDOMNode_get_attributes(pr_node, &map); + ok( hr == S_OK, "ret %08x\n", hr); + IXMLDOMNode_Release(pr_node); + + hr = IXMLDOMNamedNodeMap_get_length(map, &len); + ok( hr == S_OK, "ret %08x\n", hr); + ok( len == 3, "length %d\n", len); + + hr = IXMLDOMNamedNodeMap_removeQualifiedItem(map, NULL, NULL, NULL); + ok( hr == E_INVALIDARG, "ret %08x\n", hr); + + node = (void*)0xdeadbeef; + hr = IXMLDOMNamedNodeMap_removeQualifiedItem(map, NULL, NULL, &node); + ok( hr == E_INVALIDARG, "ret %08x\n", hr); + ok( node == (void*)0xdeadbeef, "got %p\n", node); + + /* out pointer is optional */ + hr = IXMLDOMNamedNodeMap_removeQualifiedItem(map, _bstr_("id"), NULL, NULL); + ok( hr == S_OK, "ret %08x\n", hr); + + /* already removed */ + hr = IXMLDOMNamedNodeMap_removeQualifiedItem(map, _bstr_("id"), NULL, NULL); + ok( hr == S_FALSE, "ret %08x\n", hr); + + hr = IXMLDOMNamedNodeMap_removeQualifiedItem(map, _bstr_("vr"), NULL, &node); + ok( hr == S_OK, "ret %08x\n", hr); + IXMLDOMNode_Release(node); + + IXMLDOMNamedNodeMap_Release( map ); + IXMLDOMElement_Release( element ); + IXMLDOMDocument_Release( doc ); + free_bstrs(); +} + START_TEST(domdoc) { IXMLDOMDocument *doc; @@ -5840,6 +5905,7 @@ START_TEST(domdoc) test_document_IObjectSafety(); test_splitText(); test_getQualifiedItem(); + test_removeQualifiedItem(); CoUninitialize(); }
1
0
0
0
← Newer
1
...
67
68
69
70
71
72
73
...
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