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
November 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
866 discussions
Start a n
N
ew thread
Jörg Höhle : mciwave: Fix some MCI_STATUS return code.
by Alexandre Julliard
03 Nov '10
03 Nov '10
Module: wine Branch: master Commit: d9b16027b0c98bcc98c1f85f4919a2c43e9bf6e8 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d9b16027b0c98bcc98c1f85f4…
Author: Jörg Höhle <hoehle(a)users.sourceforge.net> Date: Wed Sep 22 07:47:19 2010 +0200 mciwave: Fix some MCI_STATUS return code. --- dlls/mciwave/mciwave.c | 3 ++- dlls/winmm/tests/mci.c | 34 +++++++++++----------------------- 2 files changed, 13 insertions(+), 24 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=d9b16027b0c98bcc98c1f…
1
0
0
0
Adam Martinson : msxml3: Implement domdoc schema validation.
by Alexandre Julliard
03 Nov '10
03 Nov '10
Module: wine Branch: master Commit: c367215bbca3b51779f29819c73b24bd20975aab URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c367215bbca3b51779f29819c…
Author: Adam Martinson <amartinson(a)codeweavers.com> Date: Tue Nov 2 17:20:31 2010 -0500 msxml3: Implement domdoc schema validation. --- dlls/msxml3/domdoc.c | 157 ++++++++++++++++++++++++++++++++++---------- dlls/msxml3/tests/domdoc.c | 2 +- 2 files changed, 123 insertions(+), 36 deletions(-) diff --git a/dlls/msxml3/domdoc.c b/dlls/msxml3/domdoc.c index 500bde8..a5100f0 100644 --- a/dlls/msxml3/domdoc.c +++ b/dlls/msxml3/domdoc.c @@ -116,7 +116,7 @@ struct domdoc VARIANT_BOOL resolving; VARIANT_BOOL preserving; domdoc_properties* properties; - IXMLDOMSchemaCollection *schema; + IXMLDOMSchemaCollection2* schema; bsc_t *bsc; HRESULT error; @@ -875,7 +875,7 @@ static ULONG WINAPI domdoc_Release( if (This->site) IUnknown_Release( This->site ); destroy_xmlnode(&This->node); - if(This->schema) IXMLDOMSchemaCollection_Release( This->schema ); + if(This->schema) IXMLDOMSchemaCollection2_Release(This->schema); if (This->stream) IStream_Release(This->stream); HeapFree( GetProcessHeap(), 0, This ); } @@ -2391,7 +2391,7 @@ static HRESULT WINAPI domdoc_get_schemas( { domdoc *This = impl_from_IXMLDOMDocument3( iface ); HRESULT hr = S_FALSE; - IXMLDOMSchemaCollection *cur_schema = This->schema; + IXMLDOMSchemaCollection2* cur_schema = This->schema; TRACE("(%p)->(%p)\n", This, var1); @@ -2400,7 +2400,7 @@ static HRESULT WINAPI domdoc_get_schemas( if(cur_schema) { - hr = IXMLDOMSchemaCollection_QueryInterface(cur_schema, &IID_IDispatch, (void**)&V_DISPATCH(var1)); + hr = IXMLDOMSchemaCollection2_QueryInterface(cur_schema, &IID_IDispatch, (void**)&V_DISPATCH(var1)); if(SUCCEEDED(hr)) V_VT(var1) = VT_DISPATCH; } @@ -2413,7 +2413,7 @@ static HRESULT WINAPI domdoc_putref_schemas( { domdoc *This = impl_from_IXMLDOMDocument3( iface ); HRESULT hr = E_FAIL; - IXMLDOMSchemaCollection *new_schema = NULL; + IXMLDOMSchemaCollection2* new_schema = NULL; FIXME("(%p): semi-stub\n", This); switch(V_VT(&var1)) @@ -2437,18 +2437,48 @@ static HRESULT WINAPI domdoc_putref_schemas( if(SUCCEEDED(hr)) { - IXMLDOMSchemaCollection *old_schema = InterlockedExchangePointer((void**)&This->schema, new_schema); - if(old_schema) IXMLDOMSchemaCollection_Release(old_schema); + IXMLDOMSchemaCollection2* old_schema = InterlockedExchangePointer((void**)&This->schema, new_schema); + if(old_schema) IXMLDOMSchemaCollection2_Release(old_schema); } return hr; } +static inline BOOL is_wellformed(xmlDocPtr doc) +{ +#ifdef HAVE_XMLDOC_PROPERTIES + return doc->properties & XML_DOC_WELLFORMED; +#else + /* Not a full check, but catches the worst violations */ + xmlNodePtr child; + int root = 0; + + for (child = doc->children; child != NULL; child = child->next) + { + switch (child->type) + { + case XML_ELEMENT_NODE: + if (++root > 1) + return FALSE; + break; + case XML_TEXT_NODE: + case XML_CDATA_SECTION_NODE: + return FALSE; + break; + default: + break; + } + } + + return root == 1; +#endif +} + static void LIBXML2_LOG_CALLBACK validate_error(void* ctx, char const* msg, ...) { va_list ap; va_start(ap, msg); - LIBXML2_CALLBACK_ERR(domdoc_validate, msg, ap); + LIBXML2_CALLBACK_ERR(domdoc_validateNode, msg, ap); va_end(ap); } @@ -2456,44 +2486,111 @@ static void LIBXML2_LOG_CALLBACK validate_warning(void* ctx, char const* msg, .. { va_list ap; va_start(ap, msg); - LIBXML2_CALLBACK_WARN(domdoc_validate, msg, ap); + LIBXML2_CALLBACK_WARN(domdoc_validateNode, msg, ap); va_end(ap); } -static HRESULT WINAPI domdoc_validate( +static HRESULT WINAPI domdoc_validateNode( IXMLDOMDocument3* iface, + IXMLDOMNode* node, IXMLDOMParseError** err) { - domdoc *This = impl_from_IXMLDOMDocument3( iface ); - LONG state; - xmlValidCtxtPtr vctx; + domdoc* This = impl_from_IXMLDOMDocument3(iface); + LONG state, err_code = 0; + HRESULT hr = S_OK; + int validated = 0; - TRACE("(%p)->(%p)\n", This, err); + TRACE("(%p)->(%p, %p)\n", This, node, err); domdoc_get_readyState(iface, &state); if (state != READYSTATE_COMPLETE) { if (err) - *err = create_parseError(0, NULL, NULL, NULL, 0, 0, 0); + *err = create_parseError(err_code, NULL, NULL, NULL, 0, 0, 0); return E_PENDING; } - vctx = xmlNewValidCtxt(); - vctx->error = validate_error; - vctx->warning = validate_warning; + if (!node) + { + if (err) + *err = create_parseError(err_code, NULL, NULL, NULL, 0, 0, 0); + return E_POINTER; + } - if (xmlValidateDocument(vctx, get_doc(This))) + if (!get_node_obj(node)->node || get_node_obj(node)->node->doc != get_doc(This)) { if (err) - *err = create_parseError(0, NULL, NULL, NULL, 0, 0, 0); + *err = create_parseError(err_code, NULL, NULL, NULL, 0, 0, 0); + return E_FAIL; + } + + if (!is_wellformed(get_doc(This))) + { + ERR("doc not well-formed"); + if (err) + *err = create_parseError(E_XML_NOTWF, NULL, NULL, NULL, 0, 0, 0); + return S_FALSE; + } + + /* DTD validation */ + if (get_doc(This)->intSubset || get_doc(This)->extSubset) + { + xmlValidCtxtPtr vctx = xmlNewValidCtxt(); + vctx->error = validate_error; + vctx->warning = validate_warning; + ++validated; + + if (!((node == (IXMLDOMNode*)iface)? + xmlValidateDocument(vctx, get_doc(This)) : + xmlValidateElement(vctx, get_doc(This), get_node_obj(node)->node))) + { + /* TODO: get a real error code here */ + TRACE("DTD validation failed\n"); + err_code = E_XML_INVALID; + hr = S_FALSE; + } xmlFreeValidCtxt(vctx); - return S_OK; } - FIXME("partial stub!\n"); + /* Schema validation */ + if (hr == S_OK && This->schema != NULL) + { + + hr = SchemaCache_validate_tree(This->schema, get_node_obj(node)->node); + if (!FAILED(hr)) + { + ++validated; + /* TODO: get a real error code here */ + TRACE("schema validation failed\n"); + if (hr != S_OK) + err_code = E_XML_INVALID; + } + else + { + /* not really OK, just didn't find a schema for the ns */ + hr = S_OK; + } + } + + if (!validated) + { + TRACE("no DTD or schema found\n"); + err_code = E_XML_NODTD; + hr = S_FALSE; + } + if (err) - *err = create_parseError(0xC00CE223, NULL, NULL, NULL, 0, 0, 0); - xmlFreeValidCtxt(vctx); - return S_FALSE; + *err = create_parseError(err_code, NULL, NULL, NULL, 0, 0, 0); + + return hr; +} + +static HRESULT WINAPI domdoc_validate( + IXMLDOMDocument3* iface, + IXMLDOMParseError** err) +{ + domdoc *This = impl_from_IXMLDOMDocument3( iface ); + TRACE("(%p)->(%p)\n", This, err); + return domdoc_validateNode(iface, (IXMLDOMNode*)iface, err); } static HRESULT WINAPI domdoc_setProperty( @@ -2729,16 +2826,6 @@ static HRESULT WINAPI domdoc_getProperty( return E_FAIL; } -static HRESULT WINAPI domdoc_validateNode( - IXMLDOMDocument3* iface, - IXMLDOMNode* node, - IXMLDOMParseError** error) -{ - domdoc *This = impl_from_IXMLDOMDocument3( iface ); - FIXME("(%p)->(%p %p): stub\n", This, node, error); - return E_NOTIMPL; -} - static HRESULT WINAPI domdoc_importNode( IXMLDOMDocument3* iface, IXMLDOMNode* node, diff --git a/dlls/msxml3/tests/domdoc.c b/dlls/msxml3/tests/domdoc.c index e009829..3ab6be3 100644 --- a/dlls/msxml3/tests/domdoc.c +++ b/dlls/msxml3/tests/domdoc.c @@ -3507,7 +3507,7 @@ static void test_IXMLDOMDocument2(void) res = 0; ole_check(IXMLDOMParseError_get_errorCode(err, &res)); /* XML_E_NODTD */ - todo_wine ok(res == E_XML_NODTD, "got %08x\n", res); + ok(res == E_XML_NODTD, "got %08x\n", res); IXMLDOMParseError_Release(err); }
1
0
0
0
Adam Martinson : configure: Add a check for xmlDocProperties.
by Alexandre Julliard
03 Nov '10
03 Nov '10
Module: wine Branch: master Commit: 9408b4973df91ceb01be5f783a9d1d21bb41efe1 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9408b4973df91ceb01be5f783…
Author: Adam Martinson <amartinson(a)codeweavers.com> Date: Tue Nov 2 17:20:08 2010 -0500 configure: Add a check for xmlDocProperties. --- configure | 8 ++++++++ configure.ac | 2 ++ include/config.h.in | 3 +++ 3 files changed, 13 insertions(+), 0 deletions(-) diff --git a/configure b/configure index 20fff98..4d89bd8 100755 --- a/configure +++ b/configure @@ -9244,6 +9244,14 @@ $as_echo "#define HAVE_XMLSCHEMASSETVALIDSTRUCTUREDERRORS 1" >>confdefs.h fi + ac_fn_c_check_type "$LINENO" "xmlDocProperties" "ac_cv_type_xmlDocProperties" "#include <libxml/tree.h> +" +if test "x$ac_cv_type_xmlDocProperties" = x""yes; then : + +$as_echo "#define HAVE_XMLDOC_PROPERTIES 1" >>confdefs.h + +fi + fi diff --git a/configure.ac b/configure.ac index f38aca4..f0ebc03 100644 --- a/configure.ac +++ b/configure.ac @@ -1121,6 +1121,8 @@ then [AC_DEFINE(HAVE_XMLNEWDOCPI,1,[Define if libxml2 has the xmlNewDocPI function])],,$ac_xml_libs) AC_CHECK_LIB(xml2, xmlSchemaSetValidStructuredErrors, [AC_DEFINE(HAVE_XMLSCHEMASSETVALIDSTRUCTUREDERRORS,1,[Define if libxml2 has the xmlSchemaSetValidStructuredErrors function])],,$ac_xml_libs) + AC_CHECK_TYPE([xmlDocProperties], + [AC_DEFINE(HAVE_XMLDOC_PROPERTIES,1,[Define if libxml2 has the xmlDocProperties enum])],,[[#include <libxml/tree.h>]]) ]) CPPFLAGS="$ac_save_CPPFLAGS" fi diff --git a/include/config.h.in b/include/config.h.in index 1c82e75..46adad8 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -1105,6 +1105,9 @@ /* Define if you have the XKB extension */ #undef HAVE_XKB +/* Define if libxml2 has the xmlDocProperties enum */ +#undef HAVE_XMLDOC_PROPERTIES + /* Define if libxml2 has the xmlNewDocPI function */ #undef HAVE_XMLNEWDOCPI
1
0
0
0
Thomas Mullaly : urlmon: Implemented case when relative URI has a path that doesn't start with '/'.
by Alexandre Julliard
03 Nov '10
03 Nov '10
Module: wine Branch: master Commit: 290aca1b19b8ae962fd33d27d4d5a8ae3e575aed URL:
http://source.winehq.org/git/wine.git/?a=commit;h=290aca1b19b8ae962fd33d27d…
Author: Thomas Mullaly <thomas.mullaly(a)gmail.com> Date: Sun Oct 31 21:31:30 2010 -0400 urlmon: Implemented case when relative URI has a path that doesn't start with '/'. --- dlls/urlmon/tests/uri.c | 39 ++++++++++++++++--- dlls/urlmon/uri.c | 98 +++++++++++++++++++++++++++++++++++++++-------- 2 files changed, 115 insertions(+), 22 deletions(-) diff --git a/dlls/urlmon/tests/uri.c b/dlls/urlmon/tests/uri.c index 7dd58d8..7b59e7f 100644 --- a/dlls/urlmon/tests/uri.c +++ b/dlls/urlmon/tests/uri.c @@ -5612,7 +5612,7 @@ typedef struct _uri_combine_test { static const uri_combine_test uri_combine_tests[] = { { "
http://google.com/fun/stuff
",0, "../not/fun/stuff",Uri_CREATE_ALLOW_RELATIVE, - 0,S_OK,TRUE, + 0,S_OK,FALSE, { {"
http://google.com/not/fun/stuff
",S_OK}, {"
google.com
",S_OK}, @@ -5747,7 +5747,7 @@ static const uri_combine_test uri_combine_tests[] = { }, { "
http://winehq.org/test/abc
",0, "testing/abc/../test",Uri_CREATE_ALLOW_RELATIVE, - 0,S_OK,TRUE, + 0,S_OK,FALSE, { {"
http://winehq.org/test/testing/test
",S_OK}, {"
winehq.org
",S_OK}, @@ -5774,7 +5774,7 @@ static const uri_combine_test uri_combine_tests[] = { }, { "
http://winehq.org/test/abc
",0, "testing/abc/../test",Uri_CREATE_ALLOW_RELATIVE, - URL_DONT_SIMPLIFY,S_OK,TRUE, + URL_DONT_SIMPLIFY,S_OK,FALSE, { {"
http://winehq.org:80/test/testing/abc/../test
",S_OK}, /* Default port is hidden in the authority. */ @@ -5802,7 +5802,7 @@ static const uri_combine_test uri_combine_tests[] = { }, { "
http://winehq.org/test?query
",0, "testing",Uri_CREATE_ALLOW_RELATIVE, - 0,S_OK,TRUE, + 0,S_OK,FALSE, { {"
http://winehq.org/testing
",S_OK}, {"
winehq.org
",S_OK}, @@ -5829,7 +5829,7 @@ static const uri_combine_test uri_combine_tests[] = { }, { "
http://winehq.org/test#frag
",0, "testing",Uri_CREATE_ALLOW_RELATIVE, - 0,S_OK,TRUE, + 0,S_OK,FALSE, { {"
http://winehq.org/testing
",S_OK}, {"
winehq.org
",S_OK}, @@ -5856,7 +5856,7 @@ static const uri_combine_test uri_combine_tests[] = { }, { "testing?query#frag",Uri_CREATE_ALLOW_RELATIVE, "test",Uri_CREATE_ALLOW_RELATIVE, - 0,S_OK,TRUE, + 0,S_OK,FALSE, { {"test",S_OK}, {"",S_FALSE}, @@ -6253,6 +6253,33 @@ static const uri_combine_test uri_combine_tests[] = { {URL_SCHEME_UNKNOWN,S_OK}, {URLZONE_INVALID,E_NOTIMPL} } + }, + { "file:///c:/",0, + "../testing/test",Uri_CREATE_ALLOW_RELATIVE, + 0,S_OK,FALSE, + { + {"file:///c:/testing/test",S_OK}, + {"",S_FALSE}, + {"file:///c:/testing/test",S_OK}, + {"",S_FALSE}, + {"",S_FALSE}, + {"",S_FALSE}, + {"",S_FALSE}, + {"",S_FALSE}, + {"/c:/testing/test",S_OK}, + {"/c:/testing/test",S_OK}, + {"",S_FALSE}, + {"file:///c:/testing/test",S_OK}, + {"file",S_OK}, + {"",S_FALSE}, + {"",S_FALSE} + }, + { + {Uri_HOST_UNKNOWN,S_OK}, + {0,S_FALSE}, + {URL_SCHEME_FILE,S_OK}, + {URLZONE_INVALID,E_NOTIMPL} + } } }; diff --git a/dlls/urlmon/uri.c b/dlls/urlmon/uri.c index 7eaadb4..3bbe54f 100644 --- a/dlls/urlmon/uri.c +++ b/dlls/urlmon/uri.c @@ -5679,6 +5679,51 @@ HRESULT WINAPI CreateIUriBuilder(IUri *pIUri, DWORD dwFlags, DWORD_PTR dwReserve return S_OK; } +/* Merges the base path with the relative path and stores the resulting path + * and path len in 'result' and 'result_len'. + */ +static HRESULT merge_paths(parse_data *data, const WCHAR *base, DWORD base_len, const WCHAR *relative, + DWORD relative_len, WCHAR **result, DWORD *result_len, DWORD flags) +{ + const WCHAR *end = NULL; + DWORD base_copy_len = 0; + WCHAR *ptr; + + if(base_len) { + /* Find the characters the will be copied over from + * the base path. + */ + end = str_last_of(base, base+(base_len-1), '/'); + if(!end && data->scheme_type == URL_SCHEME_FILE) + /* Try looking for a '\\'. */ + end = str_last_of(base, base+(base_len-1), '\\'); + } + + if(end) { + base_copy_len = (end+1)-base; + *result = heap_alloc((base_copy_len+relative_len+1)*sizeof(WCHAR)); + } else + *result = heap_alloc((relative_len+1)*sizeof(WCHAR)); + + if(!(*result)) { + *result_len = 0; + return E_OUTOFMEMORY; + } + + ptr = *result; + if(end) { + memcpy(ptr, base, base_copy_len*sizeof(WCHAR)); + ptr += base_copy_len; + } + + memcpy(ptr, relative, relative_len*sizeof(WCHAR)); + ptr += relative_len; + *ptr = '\0'; + + *result_len = (ptr-*result); + return S_OK; +} + static HRESULT combine_uri(Uri *base, Uri *relative, DWORD flags, IUri **result) { Uri *ret; HRESULT hr; @@ -5777,10 +5822,16 @@ static HRESULT combine_uri(Uri *base, Uri *relative, DWORD flags, IUri **result) data.query_len = base->query_len; } } else { + const WCHAR *ptr, **pptr; DWORD path_offset = 0, path_len = 0; + /* There's two possibilities on what will happen to the path component + * of the result IUri. First, if the relative path begins with a '/' + * then the resulting path will just be the relative path. Second, if + * relative path doesn't begin with a '/' then the base path and relative + * path are merged together. + */ if(relative->path_len && *(relative->canon_uri+relative->path_start) == '/') { - const WCHAR *ptr, **pptr; WCHAR *tmp = NULL; BOOL copy_drive_path = FALSE; @@ -5815,19 +5866,25 @@ static HRESULT combine_uri(Uri *base, Uri *relative, DWORD flags, IUri **result) memcpy(tmp, relative->canon_uri+relative->path_start, relative->path_len*sizeof(WCHAR)); path[path_len] = '\0'; - - ptr = path; - pptr = &ptr; - if((data.is_opaque && !parse_path_opaque(pptr, &data, 0)) || - (!data.is_opaque && !parse_path_hierarchical(pptr, &data, 0))) { - heap_free(path); + } else { + /* Merge the base path with the relative path. */ + hr = merge_paths(&data, base->canon_uri+base->path_start, base->path_len, + relative->canon_uri+relative->path_start, relative->path_len, + &path, &path_len, flags); + if(FAILED(hr)) { *result = NULL; - return E_INVALIDARG; + return hr; + } + + /* If the resulting IUri is a file URI, the drive path isn't + * reduced out when the dot segments are removed. + */ + if(path_len >= 3 && data.scheme_type == URL_SCHEME_FILE && !data.host) { + if(*path == '/' && is_drive_path(path+1)) + path_offset = 2; + else if(is_drive_path(path)) + path_offset = 1; } - } else { - FIXME("Path merging not implemented yet!\n"); - *result = NULL; - return E_NOTIMPL; } /* Check if the dot segments need to be removed from the path. */ @@ -5836,19 +5893,28 @@ static HRESULT combine_uri(Uri *base, Uri *relative, DWORD flags, IUri **result) DWORD new_len = remove_dot_segments(path+offset,path_len-offset); if(new_len != path_len) { - WCHAR *tmp = heap_realloc(path, (new_len+1)*sizeof(WCHAR)); + WCHAR *tmp = heap_realloc(path, (path_offset+new_len+1)*sizeof(WCHAR)); if(!tmp) { heap_free(path); *result = NULL; return E_OUTOFMEMORY; } - tmp[new_len] = '\0'; - data.path = tmp; - data.path_len = new_len; + tmp[new_len+offset] = '\0'; path = tmp; + path_len = new_len+offset; } } + + /* Make sure the path component is valid. */ + ptr = path; + pptr = &ptr; + if((data.is_opaque && !parse_path_opaque(pptr, &data, 0)) || + (!data.is_opaque && !parse_path_hierarchical(pptr, &data, 0))) { + heap_free(path); + *result = NULL; + return E_INVALIDARG; + } } if(relative->fragment_start > -1) {
1
0
0
0
Thomas Mullaly : urlmon: Implemented case when relative path begins with '/ ' in CoInternetCombineIUri.
by Alexandre Julliard
03 Nov '10
03 Nov '10
Module: wine Branch: master Commit: 5d76d6b4666bfe755b439fa2ce5b189ae2d4983c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5d76d6b4666bfe755b439fa2c…
Author: Thomas Mullaly <thomas.mullaly(a)gmail.com> Date: Fri Oct 29 21:56:43 2010 -0400 urlmon: Implemented case when relative path begins with '/' in CoInternetCombineIUri. --- dlls/urlmon/tests/uri.c | 16 +++--- dlls/urlmon/uri.c | 147 ++++++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 147 insertions(+), 16 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=5d76d6b4666bfe755b439…
1
0
0
0
Thomas Mullaly : urlmon: Some IUri's don' t display the default port in the authority.
by Alexandre Julliard
03 Nov '10
03 Nov '10
Module: wine Branch: master Commit: 4561a03ea840f4e67a125d92f258457e671f9f2c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4561a03ea840f4e67a125d92f…
Author: Thomas Mullaly <thomas.mullaly(a)gmail.com> Date: Fri Oct 29 21:30:00 2010 -0400 urlmon: Some IUri's don't display the default port in the authority. --- dlls/urlmon/tests/uri.c | 33 +++++++++++++++++++++++++++++++ dlls/urlmon/uri.c | 49 +++++++++++++++++++++++++++++++++++++--------- 2 files changed, 72 insertions(+), 10 deletions(-) diff --git a/dlls/urlmon/tests/uri.c b/dlls/urlmon/tests/uri.c index 681ad21..5a45632 100644 --- a/dlls/urlmon/tests/uri.c +++ b/dlls/urlmon/tests/uri.c @@ -4324,6 +4324,38 @@ static const uri_properties uri_tests[] = { {URL_SCHEME_FILE,S_OK,FALSE}, {URLZONE_INVALID,E_NOTIMPL,FALSE} } + }, + /* When CreateUri generates an IUri, it still displays the default port in the + * authority. + */ + { "
http://google.com:80/
", Uri_CREATE_NO_CANONICALIZE, S_OK, FALSE, + Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_DOMAIN| + Uri_HAS_HOST|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI| + Uri_HAS_SCHEME_NAME|Uri_HAS_HOST_TYPE|Uri_HAS_PORT|Uri_HAS_SCHEME, + FALSE, + { + {"
http://google.com:80/
",S_OK,FALSE}, + {"google.com:80",S_OK,FALSE}, + {"
http://google.com:80/
",S_OK,FALSE}, + {"
google.com
",S_OK,FALSE}, + {"",S_FALSE,FALSE}, + {"",S_FALSE,FALSE}, + {"
google.com
",S_OK,FALSE}, + {"",S_FALSE,FALSE}, + {"/",S_OK,FALSE}, + {"/",S_OK,FALSE}, + {"",S_FALSE,FALSE}, + {"
http://google.com:80/
",S_OK,FALSE}, + {"http",S_OK,FALSE}, + {"",S_FALSE,FALSE}, + {"",S_FALSE,FALSE} + }, + { + {Uri_HOST_DNS,S_OK,FALSE}, + {80,S_OK,FALSE}, + {URL_SCHEME_HTTP,S_OK,FALSE}, + {URLZONE_INVALID,E_NOTIMPL,FALSE} + } } }; @@ -5745,6 +5777,7 @@ static const uri_combine_test uri_combine_tests[] = { URL_DONT_SIMPLIFY,S_OK,TRUE, { {"
http://winehq.org:80/test/testing/abc/../test
",S_OK}, + /* Default port is hidden in the authority. */ {"
winehq.org
",S_OK}, {"
http://winehq.org:80/test/testing/abc/../test
",S_OK}, {"
winehq.org
",S_OK}, diff --git a/dlls/urlmon/uri.c b/dlls/urlmon/uri.c index 8ebc694..9b25f69 100644 --- a/dlls/urlmon/uri.c +++ b/dlls/urlmon/uri.c @@ -26,6 +26,9 @@ #define UINT_MAX 0xffffffff #define USHORT_MAX 0xffff +#define URI_DISPLAY_NO_ABSOLUTE_URI 0x1 +#define URI_DISPLAY_NO_DEFAULT_PORT_AUTH 0x2 + #define ALLOW_NULL_TERM_SCHEME 0x01 #define ALLOW_NULL_TERM_USER_NAME 0x02 #define ALLOW_NULL_TERM_PASSWORD 0x04 @@ -49,7 +52,7 @@ typedef struct { WCHAR *canon_uri; DWORD canon_size; DWORD canon_len; - BOOL display_absolute; + BOOL display_modifiers; DWORD create_flags; INT scheme_start; @@ -64,6 +67,7 @@ typedef struct { DWORD host_len; Uri_HOST_TYPE host_type; + INT port_offset; DWORD port; BOOL has_port; @@ -339,6 +343,17 @@ static inline BOOL is_path_delim(WCHAR val) { return (!val || val == '#' || val == '?'); } +static BOOL is_default_port(URL_SCHEME scheme, DWORD port) { + DWORD i; + + for(i = 0; i < sizeof(default_ports)/sizeof(default_ports[0]); ++i) { + if(default_ports[i].scheme == scheme && default_ports[i].port) + return TRUE; + } + + return FALSE; +} + /* List of schemes types Windows seems to expect to be hierarchical. */ static inline BOOL is_hierarchical_scheme(URL_SCHEME type) { return(type == URL_SCHEME_HTTP || type == URL_SCHEME_FTP || @@ -2775,6 +2790,8 @@ static BOOL canonicalize_port(const parse_data *data, Uri *uri, DWORD flags, BOO USHORT default_port = 0; DWORD i; + uri->port_offset = -1; + /* Check if the scheme has a default port. */ for(i = 0; i < sizeof(default_ports)/sizeof(default_ports[0]); ++i) { if(default_ports[i].scheme == data->scheme_type) { @@ -2795,6 +2812,7 @@ static BOOL canonicalize_port(const parse_data *data, Uri *uri, DWORD flags, BOO if(has_default_port && data->has_port && data->port_value == default_port) { /* If it's the default port and this flag isn't set, don't do anything. */ if(flags & Uri_CREATE_NO_CANONICALIZE) { + uri->port_offset = uri->canon_len-uri->authority_start; if(!computeOnly) uri->canon_uri[uri->canon_len] = ':'; ++uri->canon_len; @@ -2814,6 +2832,7 @@ static BOOL canonicalize_port(const parse_data *data, Uri *uri, DWORD flags, BOO uri->port = default_port; } else if(data->has_port) { + uri->port_offset = uri->canon_len-uri->authority_start; if(!computeOnly) uri->canon_uri[uri->canon_len] = ':'; ++uri->canon_len; @@ -3146,8 +3165,6 @@ static BOOL canonicalize_path_opaque(const parse_data *data, Uri *uri, DWORD fla * URI is opaque it canonicalizes the path of the URI. */ static BOOL canonicalize_hierpart(const parse_data *data, Uri *uri, DWORD flags, BOOL computeOnly) { - uri->display_absolute = TRUE; - if(!data->is_opaque || (data->is_relative && (data->password || data->username))) { /* "//" is only added for non-wildcard scheme types. * @@ -3187,6 +3204,7 @@ static BOOL canonicalize_hierpart(const parse_data *data, Uri *uri, DWORD flags, uri->authority_start = -1; uri->authority_len = 0; uri->domain_offset = -1; + uri->port_offset = -1; if(is_hierarchical_scheme(data->scheme_type)) { DWORD i; @@ -3194,7 +3212,7 @@ static BOOL canonicalize_hierpart(const parse_data *data, Uri *uri, DWORD flags, /* Absolute URIs aren't displayed for known scheme types * which should be hierarchical URIs. */ - uri->display_absolute = FALSE; + uri->display_modifiers |= URI_DISPLAY_NO_ABSOLUTE_URI; /* Windows also sets the port for these (if they have one). */ for(i = 0; i < sizeof(default_ports)/sizeof(default_ports[0]); ++i) { @@ -4140,7 +4158,7 @@ static HRESULT WINAPI Uri_GetPropertyBSTR(IUri *iface, Uri_PROPERTY uriProp, BST switch(uriProp) { case Uri_PROPERTY_ABSOLUTE_URI: - if(!This->display_absolute) { + if(This->display_modifiers & URI_DISPLAY_NO_ABSOLUTE_URI) { *pbstrProperty = SysAllocStringLen(NULL, 0); hres = S_FALSE; } else { @@ -4182,7 +4200,12 @@ static HRESULT WINAPI Uri_GetPropertyBSTR(IUri *iface, Uri_PROPERTY uriProp, BST break; case Uri_PROPERTY_AUTHORITY: if(This->authority_start > -1) { - *pbstrProperty = SysAllocStringLen(This->canon_uri+This->authority_start, This->authority_len); + if(This->port_offset > -1 && is_default_port(This->scheme_type, This->port) && + This->display_modifiers & URI_DISPLAY_NO_DEFAULT_PORT_AUTH) + /* Don't include the port in the authority component. */ + *pbstrProperty = SysAllocStringLen(This->canon_uri+This->authority_start, This->port_offset); + else + *pbstrProperty = SysAllocStringLen(This->canon_uri+This->authority_start, This->authority_len); hres = S_OK; } else { *pbstrProperty = SysAllocStringLen(NULL, 0); @@ -4416,7 +4439,7 @@ static HRESULT WINAPI Uri_GetPropertyLength(IUri *iface, Uri_PROPERTY uriProp, D switch(uriProp) { case Uri_PROPERTY_ABSOLUTE_URI: - if(!This->display_absolute) { + if(This->display_modifiers & URI_DISPLAY_NO_ABSOLUTE_URI) { *pcchProperty = 0; hres = S_FALSE; } else { @@ -4438,7 +4461,13 @@ static HRESULT WINAPI Uri_GetPropertyLength(IUri *iface, Uri_PROPERTY uriProp, D break; case Uri_PROPERTY_AUTHORITY: - *pcchProperty = This->authority_len; + if(This->port_offset > -1 && + This->display_modifiers & URI_DISPLAY_NO_DEFAULT_PORT_AUTH && + is_default_port(This->scheme_type, This->port)) + /* Only count up until the port in the authority. */ + *pcchProperty = This->port_offset; + else + *pcchProperty = This->authority_len; hres = (This->authority_start > -1) ? S_OK : S_FALSE; break; case Uri_PROPERTY_DISPLAY_URI: @@ -4585,7 +4614,7 @@ static HRESULT WINAPI Uri_HasProperty(IUri *iface, Uri_PROPERTY uriProp, BOOL *p switch(uriProp) { case Uri_PROPERTY_ABSOLUTE_URI: - *pfHasProperty = This->display_absolute; + *pfHasProperty = !(This->display_modifiers & URI_DISPLAY_NO_ABSOLUTE_URI); break; case Uri_PROPERTY_AUTHORITY: *pfHasProperty = This->authority_start > -1; @@ -4778,7 +4807,7 @@ static HRESULT WINAPI Uri_GetProperties(IUri *iface, DWORD *pdwProperties) /* All URIs have these. */ *pdwProperties = Uri_HAS_DISPLAY_URI|Uri_HAS_RAW_URI|Uri_HAS_SCHEME|Uri_HAS_HOST_TYPE; - if(This->display_absolute) + if(!(This->display_modifiers & URI_DISPLAY_NO_ABSOLUTE_URI)) *pdwProperties |= Uri_HAS_ABSOLUTE_URI; if(This->scheme_start > -1)
1
0
0
0
Thomas Mullaly : urlmon: Implemented case when the relative URI doesn' t have a path component in CoInternetCombineIUri.
by Alexandre Julliard
03 Nov '10
03 Nov '10
Module: wine Branch: master Commit: 87bdf4edbc2b0b44b5930888da4876f8f233b9d1 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=87bdf4edbc2b0b44b5930888d…
Author: Thomas Mullaly <thomas.mullaly(a)gmail.com> Date: Wed Oct 13 20:08:32 2010 -0400 urlmon: Implemented case when the relative URI doesn't have a path component in CoInternetCombineIUri. --- dlls/urlmon/tests/uri.c | 92 ++++++++++++++++++++++++++++++++++++- dlls/urlmon/uri.c | 116 +++++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 195 insertions(+), 13 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=87bdf4edbc2b0b44b5930…
1
0
0
0
Thomas Mullaly : urlmon/tests: Added more CoInternetCombineIUri tests.
by Alexandre Julliard
03 Nov '10
03 Nov '10
Module: wine Branch: master Commit: 7c6bb2fbfc289ea8b6166bebc05212999812b6c0 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7c6bb2fbfc289ea8b6166bebc…
Author: Thomas Mullaly <thomas.mullaly(a)gmail.com> Date: Tue Oct 12 20:50:18 2010 -0400 urlmon/tests: Added more CoInternetCombineIUri tests. --- dlls/urlmon/tests/uri.c | 117 +++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 117 insertions(+), 0 deletions(-) diff --git a/dlls/urlmon/tests/uri.c b/dlls/urlmon/tests/uri.c index bf1ed1c..92fb94f 100644 --- a/dlls/urlmon/tests/uri.c +++ b/dlls/urlmon/tests/uri.c @@ -6017,6 +6017,123 @@ static const uri_combine_test uri_combine_tests[] = { {URL_SCHEME_HTTP,S_OK}, {URLZONE_INVALID,E_NOTIMPL} } + }, + /* Windows validates the path component from the relative Uri. */ + { "
http://google.com/test
",0, + "/Te%XXst",Uri_CREATE_ALLOW_RELATIVE, + 0,E_INVALIDARG,TRUE + }, + /* Windows doesn't validate the query from the relative Uri. */ + { "
http://google.com/test
",0, + "?Tes%XXt",Uri_CREATE_ALLOW_RELATIVE, + 0,S_OK,TRUE, + { + {"
http://google.com/test?Tes%XXt
",S_OK}, + {"
google.com
",S_OK}, + {"
http://google.com/test?Tes%XXt
",S_OK}, + {"
google.com
",S_OK}, + {"",S_FALSE}, + {"",S_FALSE}, + {"
google.com
",S_OK}, + {"",S_FALSE}, + {"/test",S_OK}, + {"/test?Tes%XXt",S_OK}, + {"?Tes%XXt",S_OK}, + {"
http://google.com/test?Tes%XXt
",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} + } + }, + /* Windows doesn't validate the fragment from the relative Uri. */ + { "
http://google.com/test
",0, + "#Tes%XXt",Uri_CREATE_ALLOW_RELATIVE, + 0,S_OK,TRUE, + { + {"
http://google.com/test#Tes%XXt
",S_OK}, + {"
google.com
",S_OK}, + {"
http://google.com/test#Tes%XXt
",S_OK}, + {"
google.com
",S_OK}, + {"",S_FALSE}, + {"#Tes%XXt",S_OK}, + {"
google.com
",S_OK}, + {"",S_FALSE}, + {"/test",S_OK}, + {"/test",S_OK}, + {"",S_FALSE}, + {"
http://google.com/test#Tes%XXt
",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} + } + }, + /* Creates an IUri which contains an invalid dos path char. */ + { "file:///c:/test",0, + "/test<ing",Uri_CREATE_ALLOW_RELATIVE, + URL_FILE_USE_PATHURL,S_OK,TRUE, + { + {"file://c:\\test<ing",S_OK}, + {"",S_FALSE}, + {"file://c:\\test<ing",S_OK}, + {"",S_FALSE}, + {"",S_FALSE}, + {"",S_FALSE}, + {"",S_FALSE}, + {"",S_FALSE}, + {"c:\\test<ing",S_OK}, + {"c:\\test<ing",S_OK}, + {"",S_FALSE}, + {"file://c:\\test<ing",S_OK}, + {"file",S_OK}, + {"",S_FALSE}, + {"",S_FALSE} + }, + { + {Uri_HOST_UNKNOWN,S_OK}, + {0,S_FALSE}, + {URL_SCHEME_FILE,S_OK}, + {URLZONE_INVALID,E_NOTIMPL} + } + }, + /* Appends the path after the drive letter (if any). */ + { "file:///c:/test",0, + "/c:/testing",Uri_CREATE_ALLOW_RELATIVE, + 0,S_OK,TRUE, + { + {"file:///c:/c:/testing",S_OK}, + {"",S_FALSE}, + {"file:///c:/c:/testing",S_OK}, + {"",S_FALSE}, + {"",S_FALSE}, + {"",S_FALSE}, + {"",S_FALSE}, + {"",S_FALSE}, + {"/c:/c:/testing",S_OK}, + {"/c:/c:/testing",S_OK}, + {"",S_FALSE}, + {"file:///c:/c:/testing",S_OK}, + {"file",S_OK}, + {"",S_FALSE}, + {"",S_FALSE} + }, + { + {Uri_HOST_UNKNOWN,S_OK}, + {0,S_FALSE}, + {URL_SCHEME_FILE,S_OK}, + {URLZONE_INVALID,E_NOTIMPL} + } } };
1
0
0
0
Thomas Mullaly : urlmon: Improved IUri support for file URIs.
by Alexandre Julliard
03 Nov '10
03 Nov '10
Module: wine Branch: master Commit: d6e624c7ee0cc64a0e4f4e3d42a99453fcd21028 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d6e624c7ee0cc64a0e4f4e3d4…
Author: Thomas Mullaly <thomas.mullaly(a)gmail.com> Date: Sun Oct 10 15:40:54 2010 -0400 urlmon: Improved IUri support for file URIs. --- dlls/urlmon/tests/uri.c | 29 +++++++++++++++++++++++++++++ dlls/urlmon/uri.c | 16 ++++++++++++++-- 2 files changed, 43 insertions(+), 2 deletions(-) diff --git a/dlls/urlmon/tests/uri.c b/dlls/urlmon/tests/uri.c index cb1ad6f..bf1ed1c 100644 --- a/dlls/urlmon/tests/uri.c +++ b/dlls/urlmon/tests/uri.c @@ -4295,6 +4295,35 @@ static const uri_properties uri_tests[] = { {URL_SCHEME_MK,S_OK,FALSE}, {URLZONE_INVALID,E_NOTIMPL,FALSE} } + }, + /* Two '\' are added to the URI when USE_DOS_PATH is set, and it's a UNC path. */ + { "file://server/dir/index.html", Uri_CREATE_FILE_USE_DOS_PATH, S_OK, FALSE, + Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_EXTENSION|Uri_HAS_HOST| + Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|Uri_HAS_HOST_TYPE| + Uri_HAS_SCHEME, FALSE, + { + {"file://\\\\server\\dir\\index.html",S_OK,FALSE}, + {"server",S_OK,FALSE}, + {"file://\\\\server\\dir\\index.html",S_OK,FALSE}, + {"",S_FALSE,FALSE}, + {".html",S_OK,FALSE}, + {"",S_FALSE,FALSE}, + {"server",S_OK,FALSE}, + {"",S_FALSE,FALSE}, + {"\\dir\\index.html",S_OK,FALSE}, + {"\\dir\\index.html",S_OK,FALSE}, + {"",S_FALSE,FALSE}, + {"file://server/dir/index.html",S_OK,FALSE}, + {"file",S_OK,FALSE}, + {"",S_FALSE,FALSE}, + {"",S_FALSE,FALSE} + }, + { + {Uri_HOST_DNS,S_OK,FALSE}, + {0,S_FALSE,FALSE}, + {URL_SCHEME_FILE,S_OK,FALSE}, + {URLZONE_INVALID,E_NOTIMPL,FALSE} + } } }; diff --git a/dlls/urlmon/uri.c b/dlls/urlmon/uri.c index 6aaa133..ad50fb2 100644 --- a/dlls/urlmon/uri.c +++ b/dlls/urlmon/uri.c @@ -2348,6 +2348,9 @@ static BOOL canonicalize_userinfo(const parse_data *data, Uri *uri, DWORD flags, * it isn't an unknown scheme type. * * 4) If it's a file scheme and the host is "localhost" it's removed. + * + * 5) If it's a file scheme and Uri_CREATE_FILE_USE_DOS_PATH is set, + * then the UNC path characters are added before the host name. */ static BOOL canonicalize_reg_name(const parse_data *data, Uri *uri, DWORD flags, BOOL computeOnly) { @@ -2356,8 +2359,6 @@ static BOOL canonicalize_reg_name(const parse_data *data, Uri *uri, const WCHAR *ptr; const BOOL known_scheme = data->scheme_type != URL_SCHEME_UNKNOWN; - uri->host_start = uri->canon_len; - if(data->scheme_type == URL_SCHEME_FILE && data->host_len == lstrlenW(localhostW)) { if(!StrCmpNIW(data->host, localhostW, data->host_len)) { @@ -2368,6 +2369,17 @@ static BOOL canonicalize_reg_name(const parse_data *data, Uri *uri, } } + if(data->scheme_type == URL_SCHEME_FILE && flags & Uri_CREATE_FILE_USE_DOS_PATH) { + if(!computeOnly) { + uri->canon_uri[uri->canon_len] = '\\'; + uri->canon_uri[uri->canon_len+1] = '\\'; + } + uri->canon_len += 2; + uri->authority_start = uri->canon_len; + } + + uri->host_start = uri->canon_len; + for(ptr = data->host; ptr < data->host+data->host_len; ++ptr) { if(*ptr == '%' && known_scheme) { WCHAR val = decode_pct_val(ptr);
1
0
0
0
Thomas Mullaly : urlmon: Fixed memory free of an uninitialized variable.
by Alexandre Julliard
03 Nov '10
03 Nov '10
Module: wine Branch: master Commit: 03efc237b601b429e300c5ba63828d0b0cac209f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=03efc237b601b429e300c5ba6…
Author: Thomas Mullaly <thomas.mullaly(a)gmail.com> Date: Tue Nov 2 21:12:23 2010 -0400 urlmon: Fixed memory free of an uninitialized variable. Thanks to Gerald for spotting this. --- dlls/urlmon/uri.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/dlls/urlmon/uri.c b/dlls/urlmon/uri.c index 3e29575..6aaa133 100644 --- a/dlls/urlmon/uri.c +++ b/dlls/urlmon/uri.c @@ -5605,7 +5605,6 @@ static HRESULT combine_uri(Uri *base, Uri *relative, DWORD flags, IUri **result) data.uri = SysAllocString(relative->raw_uri); if(!data.uri) { - IUri_Release(URI(ret)); *result = NULL; return E_OUTOFMEMORY; }
1
0
0
0
← Newer
1
...
69
70
71
72
73
74
75
...
87
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
Results per page:
10
25
50
100
200