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 2016
----- 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
465 discussions
Start a n
N
ew thread
Hans Leidekker : wbemprox: Return a non-null UUID for Win32_ComputerSystemProduct.UUID if nothing better is available.
by Alexandre Julliard
17 Nov '16
17 Nov '16
Module: wine Branch: master Commit: 9842bf333a646cfe62135767d8ea05ebc6faa897 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9842bf333a646cfe62135767d…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Thu Nov 17 13:07:34 2016 -0600 wbemprox: Return a non-null UUID for Win32_ComputerSystemProduct.UUID if nothing better is available. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wbemprox/builtin.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/wbemprox/builtin.c b/dlls/wbemprox/builtin.c index 718b818..b0f5faa 100644 --- a/dlls/wbemprox/builtin.c +++ b/dlls/wbemprox/builtin.c @@ -714,8 +714,8 @@ static const WCHAR compsys_modelW[] = static const WCHAR compsysproduct_identifyingnumberW[] = {'0',0}; static const WCHAR compsysproduct_uuidW[] = - {'0','0','0','0','0','0','0','0','-','0','0','0','0','-','0','0','0','0','-','0','0','0','0','-', - '0','0','0','0','0','0','0','0','0','0','0','0',0}; + {'d','e','a','d','d','e','a','d','-','d','e','a','d','-','d','e','a','d','-','d','e','a','d','-', + 'd','e','a','d','d','e','a','d','d','e','a','d',0}; static const WCHAR diskdrive_interfacetypeW[] = {'I','D','E',0}; static const WCHAR diskdrive_manufacturerW[] =
1
0
0
0
Hans Leidekker : webservices: Add support for serializing array parameters in WsCall.
by Alexandre Julliard
17 Nov '16
17 Nov '16
Module: wine Branch: master Commit: e4288daa62c012fa73fc430332bd602328699446 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e4288daa62c012fa73fc43033…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Thu Nov 17 10:11:08 2016 -0600 webservices: Add support for serializing array parameters in WsCall. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/webservices/tests/proxy.c | 68 +++++++++++++++++++++++++++++------------- dlls/webservices/writer.c | 23 +++++++++++++- 2 files changed, 70 insertions(+), 21 deletions(-) diff --git a/dlls/webservices/tests/proxy.c b/dlls/webservices/tests/proxy.c index f1676cd..61dff79 100644 --- a/dlls/webservices/tests/proxy.c +++ b/dlls/webservices/tests/proxy.c @@ -289,7 +289,7 @@ static HRESULT create_proxy( int port, WS_SERVICE_PROXY **ret ) static const char req_test2[] = "<s:Envelope xmlns:s=\"
http://schemas.xmlsoap.org/soap/envelope/\
"><s:Body>" - "<req_test2 xmlns=\"ns\"><val>1</val></req_test2>" + "<req_test2 xmlns=\"ns\"><val>1</val><str>test</str><str>test2</str></req_test2>" "</s:Body></s:Envelope>"; static const char resp_test2[] = @@ -299,7 +299,7 @@ static const char resp_test2[] = static void test_WsCall( int port ) { - static WCHAR testW[] = {'t','e','s','t',0}; + static const WCHAR testW[] = {'t','e','s','t',0}, test2W[] = {'t','e','s','t','2',0}; WS_XML_STRING str = {3, (BYTE *)"str"}; WS_XML_STRING req = {3, (BYTE *)"req"}; WS_XML_STRING resp = {4, (BYTE *)"resp"}; @@ -315,16 +315,19 @@ static void test_WsCall( int port ) WS_MESSAGE_DESCRIPTION input_msg, output_msg; WS_ELEMENT_DESCRIPTION input_elem, output_elem; WS_STRUCT_DESCRIPTION input_struct, output_struct; - WS_FIELD_DESCRIPTION f, f2, f3, *fields[2], *fields2[2]; - WS_PARAMETER_DESCRIPTION param[4]; - const void *args[4]; + WS_FIELD_DESCRIPTION f, f2, f3, f4, *fields[2], *fields2[2]; + WS_PARAMETER_DESCRIPTION param[6]; + const void *args[6]; WS_HEAP *heap; INT32 **val_ptr; WCHAR **str_ptr; ULONG *count_ptr; + const WCHAR *str_array[2]; struct input { - INT32 val; + INT32 val; + ULONG count; + const WCHAR **str; } in; struct output { @@ -352,11 +355,20 @@ static void test_WsCall( int port ) f.type = WS_INT32_TYPE; fields[0] = &f; + memset( &f4, 0, sizeof(f4) ); + f4.mapping = WS_REPEATING_ELEMENT_FIELD_MAPPING; + f4.type = WS_WSZ_TYPE; + f4.offset = FIELD_OFFSET(struct input, str); + f4.countOffset = FIELD_OFFSET(struct input, count); + f4.itemLocalName = &str; + f4.itemNs = &ns; + fields[1] = &f4; + memset( &input_struct, 0, sizeof(input_struct) ); input_struct.size = sizeof(struct input); input_struct.alignment = TYPE_ALIGNMENT(struct input); input_struct.fields = fields; - input_struct.fieldCount = 1; + input_struct.fieldCount = 2; input_struct.typeLocalName = &req; input_struct.typeNs = &ns; @@ -403,24 +415,32 @@ static void test_WsCall( int port ) param[0].inputMessageIndex = 0; param[0].outputMessageIndex = 0xffff; - param[1].parameterType = WS_PARAMETER_TYPE_NORMAL; - param[1].inputMessageIndex = 0xffff; - param[1].outputMessageIndex = 0; + param[1].parameterType = WS_PARAMETER_TYPE_ARRAY; + param[1].inputMessageIndex = 1; + param[1].outputMessageIndex = 0xffff; - param[2].parameterType = WS_PARAMETER_TYPE_ARRAY; - param[2].inputMessageIndex = 0xffff; - param[2].outputMessageIndex = 1; + param[2].parameterType = WS_PARAMETER_TYPE_ARRAY_COUNT; + param[2].inputMessageIndex = 1; + param[2].outputMessageIndex = 0xffff; - param[3].parameterType = WS_PARAMETER_TYPE_ARRAY_COUNT; + param[3].parameterType = WS_PARAMETER_TYPE_NORMAL; param[3].inputMessageIndex = 0xffff; - param[3].outputMessageIndex = 1; + param[3].outputMessageIndex = 0; + + param[4].parameterType = WS_PARAMETER_TYPE_ARRAY; + param[4].inputMessageIndex = 0xffff; + param[4].outputMessageIndex = 1; + + param[5].parameterType = WS_PARAMETER_TYPE_ARRAY_COUNT; + param[5].inputMessageIndex = 0xffff; + param[5].outputMessageIndex = 1; op.versionInfo = 1; op.inputMessageDescription = &input_msg; op.outputMessageDescription = &output_msg; op.inputMessageOptions = 0; op.outputMessageOptions = 0; - op.parameterCount = 4; + op.parameterCount = 6; op.parameterDescription = param; op.stubCallback = NULL; op.style = 0; @@ -428,17 +448,25 @@ static void test_WsCall( int port ) ok( hr == E_INVALIDARG, "got %08x\n", hr ); in.val = 1; + str_array[0] = testW; + str_array[1] = test2W; + in.str = str_array; + in.count = 2; + args[0] = &in.val; + args[1] = &in.str; + args[2] = &in.count; out.str = NULL; out.count = 0; - out.val = 0; + out.val = NULL; str_ptr = &out.str; val_ptr = &out.val; count_ptr = &out.count; - args[1] = &str_ptr; - args[2] = &val_ptr; - args[3] = &count_ptr; + + args[3] = &str_ptr; + args[4] = &val_ptr; + args[5] = &count_ptr; hr = WsCall( proxy, &op, args, heap, NULL, 0, NULL, NULL ); ok( hr == S_OK, "got %08x\n", hr ); diff --git a/dlls/webservices/writer.c b/dlls/webservices/writer.c index d5c953c..c1f1b0c 100644 --- a/dlls/webservices/writer.c +++ b/dlls/webservices/writer.c @@ -2813,6 +2813,25 @@ static HRESULT write_param( struct writer *writer, const WS_FIELD_DESCRIPTION *d return write_type_struct_field( writer, desc, value, 0 ); } +static ULONG get_array_len( const WS_PARAMETER_DESCRIPTION *params, ULONG count, ULONG index, const void **args ) +{ + ULONG i, ret = 0; + for (i = 0; i < count; i++) + { + if (params[i].inputMessageIndex != index || params[i].parameterType != WS_PARAMETER_TYPE_ARRAY_COUNT) + continue; + if (args[i]) ret = *(const ULONG *)args[i]; + break; + } + return ret; +} + +static HRESULT write_param_array( struct writer *writer, const WS_FIELD_DESCRIPTION *desc, const void *value, + ULONG len ) +{ + return write_type_repeating_element( writer, desc, value, len ); +} + HRESULT write_input_params( WS_XML_WRITER *handle, const WS_ELEMENT_DESCRIPTION *desc, const WS_PARAMETER_DESCRIPTION *params, ULONG count, const void **args ) { @@ -2841,7 +2860,9 @@ HRESULT write_input_params( WS_XML_WRITER *handle, const WS_ELEMENT_DESCRIPTION } else if (params[i].parameterType == WS_PARAMETER_TYPE_ARRAY) { - FIXME( "no support for writing array parameters\n" ); + const void *ptr = *(const void **)args[i]; + ULONG len = get_array_len( params, count, params[i].inputMessageIndex, args ); + if ((hr = write_param_array( writer, desc_field, ptr, len )) != S_OK) return hr; } }
1
0
0
0
Hans Leidekker : webservices: Add support for repeating element field mappings in WsWriteType.
by Alexandre Julliard
17 Nov '16
17 Nov '16
Module: wine Branch: master Commit: 0a235233133019a44484416e7e4c1720a3435b73 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=0a235233133019a44484416e7…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Thu Nov 17 10:11:03 2016 -0600 webservices: Add support for repeating element field mappings in WsWriteType. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/webservices/tests/writer.c | 110 ++++++++++++++++++++++++++ dlls/webservices/writer.c | 167 ++++++++++++++++++++++------------------ 2 files changed, 201 insertions(+), 76 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=0a235233133019a444844…
1
0
0
0
Hans Leidekker : webservices: Fix calculation of the end of a UTF-8 sequence.
by Alexandre Julliard
17 Nov '16
17 Nov '16
Module: wine Branch: master Commit: 43e213e24ca4a1571df8053431e748425a00a53a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=43e213e24ca4a1571df805343…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Thu Nov 17 10:10:56 2016 -0600 webservices: Fix calculation of the end of a UTF-8 sequence. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/webservices/reader.c | 2 +- dlls/webservices/tests/reader.c | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/dlls/webservices/reader.c b/dlls/webservices/reader.c index 5b5dc69..d67c47a 100644 --- a/dlls/webservices/reader.c +++ b/dlls/webservices/reader.c @@ -1035,7 +1035,7 @@ static inline unsigned int read_utf8_char( struct reader *reader, unsigned int * } len = utf8_length[ch - 0x80]; if (reader->read_pos + len >= reader->read_size) return 0; - end = reader->read_bufptr + reader->read_pos + len; + end = reader->read_bufptr + reader->read_pos + len + 1; res = ch & utf8_mask[len]; switch (len) diff --git a/dlls/webservices/tests/reader.c b/dlls/webservices/tests/reader.c index 23c3f10..b19bc8c 100644 --- a/dlls/webservices/tests/reader.c +++ b/dlls/webservices/tests/reader.c @@ -1325,6 +1325,8 @@ static void test_WsReadType(void) static const WCHAR testW[] = {'t','e','s','t',0}; static const GUID guid1 = {0,0,0,{0,0,0,0,0,0,0,0}}; static const GUID guid2 = {0,0,0,{0,0,0,0,0,0,0,0xa1}}; + static const char utf8[] = {'<','t','>',0xe2,0x80,0x99,'<','/','t','>'}; + static const WCHAR utf8W[] = {0x2019,0}; HRESULT hr; WS_XML_READER *reader; WS_HEAP *heap; @@ -1636,6 +1638,14 @@ static void test_WsReadType(void) WS_READ_REQUIRED_VALUE, heap, &val_bytes, sizeof(val_bytes), NULL ); ok( hr == WS_E_INVALID_FORMAT, "got %08x\n", hr ); + val_str = NULL; + prepare_type_test( reader, utf8, sizeof(utf8) ); + hr = WsReadType( reader, WS_ELEMENT_CONTENT_TYPE_MAPPING, WS_WSZ_TYPE, NULL, + WS_READ_REQUIRED_POINTER, heap, &val_str, sizeof(val_str), NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( val_str != NULL, "pointer not set\n" ); + if (val_str) ok( !lstrcmpW( val_str, utf8W ), "wrong data %s\n", wine_dbgstr_w(val_str) ); + WsFreeReader( reader ); WsFreeHeap( heap ); }
1
0
0
0
Hans Leidekker : webservices/tests: Fix argument order in WsCreateMessage calls (Clang).
by Alexandre Julliard
17 Nov '16
17 Nov '16
Module: wine Branch: master Commit: 28f66b2a346564abcdd922ad3729e775a5aa0cd8 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=28f66b2a346564abcdd922ad3…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Thu Nov 17 10:10:47 2016 -0600 webservices/tests: Fix argument order in WsCreateMessage calls (Clang). Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/webservices/tests/msg.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/dlls/webservices/tests/msg.c b/dlls/webservices/tests/msg.c index 5d0901e..f481948 100644 --- a/dlls/webservices/tests/msg.c +++ b/dlls/webservices/tests/msg.c @@ -564,7 +564,7 @@ static void test_WsSetHeader(void) hr = WsSetHeader( NULL, 0, 0, 0, NULL, 0, NULL ); ok( hr == E_INVALIDARG, "got %08x\n", hr ); - hr = WsCreateMessage( WS_ADDRESSING_VERSION_1_0, WS_ENVELOPE_VERSION_SOAP_1_2, NULL, 0, &msg, + hr = WsCreateMessage( WS_ENVELOPE_VERSION_SOAP_1_2, WS_ADDRESSING_VERSION_1_0, NULL, 0, &msg, NULL ); ok( hr == S_OK, "got %08x\n", hr ); @@ -628,7 +628,7 @@ static void test_WsRemoveHeader(void) hr = WsSetHeader( NULL, 0, 0, 0, NULL, 0, NULL ); ok( hr == E_INVALIDARG, "got %08x\n", hr ); - hr = WsCreateMessage( WS_ADDRESSING_VERSION_1_0, WS_ENVELOPE_VERSION_SOAP_1_2, NULL, 0, &msg, + hr = WsCreateMessage( WS_ENVELOPE_VERSION_SOAP_1_2, WS_ADDRESSING_VERSION_1_0, NULL, 0, &msg, NULL ); ok( hr == S_OK, "got %08x\n", hr ); @@ -678,7 +678,7 @@ static void test_WsAddMappedHeader(void) hr = WsAddMappedHeader( NULL, NULL, 0, 0, NULL, 0, NULL ); ok( hr == E_INVALIDARG, "got %08x\n", hr ); - hr = WsCreateMessage( WS_ADDRESSING_VERSION_1_0, WS_ENVELOPE_VERSION_SOAP_1_2, NULL, 0, &msg, NULL ); + hr = WsCreateMessage( WS_ENVELOPE_VERSION_SOAP_1_2, WS_ADDRESSING_VERSION_1_0, NULL, 0, &msg, NULL ); ok( hr == S_OK, "got %08x\n", hr ); hr = WsAddMappedHeader( msg, NULL, 0, 0, NULL, 0, NULL ); @@ -712,7 +712,7 @@ static void test_WsRemoveMappedHeader(void) hr = WsRemoveMappedHeader( NULL, NULL, NULL ); ok( hr == E_INVALIDARG, "got %08x\n", hr ); - hr = WsCreateMessage( WS_ADDRESSING_VERSION_1_0, WS_ENVELOPE_VERSION_SOAP_1_2, NULL, 0, &msg, NULL ); + hr = WsCreateMessage( WS_ENVELOPE_VERSION_SOAP_1_2, WS_ADDRESSING_VERSION_1_0, NULL, 0, &msg, NULL ); ok( hr == S_OK, "got %08x\n", hr ); hr = WsRemoveMappedHeader( msg, NULL, NULL ); @@ -778,7 +778,7 @@ static void test_WsAddCustomHeader(void) hr = WsAddCustomHeader( NULL, NULL, 0, NULL, 0, 0, NULL ); ok( hr == E_INVALIDARG, "got %08x\n", hr ); - hr = WsCreateMessage( WS_ADDRESSING_VERSION_1_0, WS_ENVELOPE_VERSION_SOAP_1_2, NULL, 0, &msg, NULL ); + hr = WsCreateMessage( WS_ENVELOPE_VERSION_SOAP_1_2, WS_ADDRESSING_VERSION_1_0, NULL, 0, &msg, NULL ); ok( hr == S_OK, "got %08x\n", hr ); hr = WsAddCustomHeader( msg, NULL, 0, NULL, 0, 0, NULL ); @@ -855,7 +855,7 @@ static void test_WsRemoveCustomHeader(void) hr = WsRemoveCustomHeader( NULL, NULL, NULL, NULL ); ok( hr == E_INVALIDARG, "got %08x\n", hr ); - hr = WsCreateMessage( WS_ADDRESSING_VERSION_1_0, WS_ENVELOPE_VERSION_SOAP_1_2, NULL, 0, &msg, NULL ); + hr = WsCreateMessage( WS_ENVELOPE_VERSION_SOAP_1_2, WS_ADDRESSING_VERSION_1_0, NULL, 0, &msg, NULL ); ok( hr == S_OK, "got %08x\n", hr ); hr = WsRemoveCustomHeader( msg, &localname, &ns, NULL ); @@ -917,7 +917,7 @@ static void test_WsReadEnvelopeStart(void) hr = WsReadEnvelopeStart( NULL, NULL, NULL, NULL, NULL ); ok( hr == E_INVALIDARG, "got %08x\n", hr ); - hr = WsCreateMessage( WS_ADDRESSING_VERSION_0_9, WS_ENVELOPE_VERSION_SOAP_1_1, NULL, 0, &msg, NULL ); + hr = WsCreateMessage( WS_ENVELOPE_VERSION_SOAP_1_1, WS_ADDRESSING_VERSION_0_9, NULL, 0, &msg, NULL ); ok( hr == S_OK, "got %08x\n", hr ); hr = WsReadEnvelopeStart( msg, NULL, NULL, NULL, NULL ); @@ -932,7 +932,7 @@ static void test_WsReadEnvelopeStart(void) hr = WsReadEnvelopeStart( msg, reader, NULL, NULL, NULL ); ok( hr == WS_E_INVALID_OPERATION, "got %08x\n", hr ); - hr = WsCreateMessage( WS_ADDRESSING_VERSION_0_9, WS_ENVELOPE_VERSION_SOAP_1_1, NULL, 0, &msg2, NULL ); + hr = WsCreateMessage( WS_ENVELOPE_VERSION_SOAP_1_1, WS_ADDRESSING_VERSION_0_9, NULL, 0, &msg2, NULL ); ok( hr == S_OK, "got %08x\n", hr ); hr = set_input( reader, xml, strlen(xml) ); @@ -963,7 +963,7 @@ static void test_WsReadEnvelopeEnd(void) hr = WsReadEnvelopeEnd( NULL, NULL ); ok( hr == E_INVALIDARG, "got %08x\n", hr ); - hr = WsCreateMessage( WS_ADDRESSING_VERSION_0_9, WS_ENVELOPE_VERSION_SOAP_1_1, NULL, 0, &msg, NULL ); + hr = WsCreateMessage( WS_ENVELOPE_VERSION_SOAP_1_1, WS_ADDRESSING_VERSION_0_9, NULL, 0, &msg, NULL ); ok( hr == S_OK, "got %08x\n", hr ); hr = WsCreateReader( NULL, 0, &reader, NULL ); @@ -972,7 +972,7 @@ static void test_WsReadEnvelopeEnd(void) hr = WsInitializeMessage( msg, WS_REQUEST_MESSAGE, NULL, NULL ); ok( hr == S_OK, "got %08x\n", hr ); - hr = WsCreateMessage( WS_ADDRESSING_VERSION_0_9, WS_ENVELOPE_VERSION_SOAP_1_1, NULL, 0, &msg2, NULL ); + hr = WsCreateMessage( WS_ENVELOPE_VERSION_SOAP_1_1, WS_ADDRESSING_VERSION_0_9, NULL, 0, &msg2, NULL ); ok( hr == S_OK, "got %08x\n", hr ); hr = set_input( reader, xml, strlen(xml) ); @@ -1023,7 +1023,7 @@ static void test_WsReadBody(void) hr = WsReadBody( NULL, NULL, 0, NULL, NULL, 0, NULL ); ok( hr == E_INVALIDARG, "got %08x\n", hr ); - hr = WsCreateMessage( WS_ADDRESSING_VERSION_0_9, WS_ENVELOPE_VERSION_SOAP_1_1, NULL, 0, &msg, NULL ); + hr = WsCreateMessage( WS_ENVELOPE_VERSION_SOAP_1_1, WS_ADDRESSING_VERSION_0_9, NULL, 0, &msg, NULL ); ok( hr == S_OK, "got %08x\n", hr ); hr = WsCreateReader( NULL, 0, &reader, NULL ); @@ -1032,7 +1032,7 @@ static void test_WsReadBody(void) hr = WsInitializeMessage( msg, WS_REQUEST_MESSAGE, NULL, NULL ); ok( hr == S_OK, "got %08x\n", hr ); - hr = WsCreateMessage( WS_ADDRESSING_VERSION_0_9, WS_ENVELOPE_VERSION_SOAP_1_1, NULL, 0, &msg2, NULL ); + hr = WsCreateMessage( WS_ENVELOPE_VERSION_SOAP_1_1, WS_ADDRESSING_VERSION_0_9, NULL, 0, &msg2, NULL ); ok( hr == S_OK, "got %08x\n", hr ); hr = WsReadBody( msg2, NULL, 0, NULL, NULL, 0, NULL );
1
0
0
0
Hans Leidekker : webservices/tests: Mark some test results as broken.
by Alexandre Julliard
17 Nov '16
17 Nov '16
Module: wine Branch: master Commit: f90f1f88a9a06d8411384715dedad332f9d7bb8c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f90f1f88a9a06d8411384715d…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Thu Nov 17 10:10:40 2016 -0600 webservices/tests: Mark some test results as broken. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/webservices/tests/writer.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dlls/webservices/tests/writer.c b/dlls/webservices/tests/writer.c index 912e944..0affea3 100644 --- a/dlls/webservices/tests/writer.c +++ b/dlls/webservices/tests/writer.c @@ -2595,6 +2595,7 @@ static void test_datetime(void) HRESULT hr; const char *result; const char *result2; + HRESULT hr_broken; } tests[] = { @@ -2617,7 +2618,7 @@ static void test_datetime(void) { 0x11ed178c6c000, WS_DATETIME_FORMAT_NONE, S_OK, "<t>0002-01-01T00:00:00</t>" }, { 0x2bca2875f4373fff, WS_DATETIME_FORMAT_UTC, S_OK, "<t>9999-12-31T23:59:59.9999999Z</t>" }, { 0x2bca2875f4373fff, WS_DATETIME_FORMAT_LOCAL, S_OK, "<t>9999-12-31T15:59:59.9999999-08:00</t>", - "<t>9999-12-31T17:59:59.9999999-06:00</t>" /* win7 */ }, + "<t>9999-12-31T17:59:59.9999999-06:00</t>" /* win7 */, WS_E_INVALID_FORMAT }, { 0x2bca2875f4373fff, WS_DATETIME_FORMAT_NONE, S_OK, "<t>9999-12-31T23:59:59.9999999</t>" }, { 0x2bca2875f4374000, WS_DATETIME_FORMAT_UTC, WS_E_INVALID_FORMAT }, { 0x2bca2875f4374000, WS_DATETIME_FORMAT_LOCAL, WS_E_INVALID_FORMAT }, @@ -2651,7 +2652,8 @@ static void test_datetime(void) hr = WsWriteType( writer, WS_ELEMENT_TYPE_MAPPING, WS_DATETIME_TYPE, NULL, WS_WRITE_REQUIRED_VALUE, &date, sizeof(date), NULL ); WsWriteEndElement( writer, NULL ); - ok( hr == tests[i].hr, "%u: got %08x\n", i, hr ); + ok( hr == tests[i].hr || broken(hr == tests[i].hr_broken), "%u: got %08x\n", i, hr ); + if (hr != tests[i].hr && hr == tests[i].hr_broken) break; if (hr == S_OK) { ok( check_result( writer, tests[i].result ) ||
1
0
0
0
Piotr Caban : msvcr120: Add _Condition_variable tests.
by Alexandre Julliard
17 Nov '16
17 Nov '16
Module: wine Branch: master Commit: ccda9bbba43f642f9f1cb631c18adfbc59019a18 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ccda9bbba43f642f9f1cb631c…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Thu Nov 17 09:56:21 2016 -0600 msvcr120: Add _Condition_variable tests. Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msvcr120/tests/msvcr120.c | 125 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 125 insertions(+) diff --git a/dlls/msvcr120/tests/msvcr120.c b/dlls/msvcr120/tests/msvcr120.c index 4ecea51..e631738 100644 --- a/dlls/msvcr120/tests/msvcr120.c +++ b/dlls/msvcr120/tests/msvcr120.c @@ -46,6 +46,8 @@ struct thiscall_thunk static ULONG_PTR (WINAPI *call_thiscall_func1)( void *func, void *this ); static ULONG_PTR (WINAPI *call_thiscall_func2)( void *func, void *this, const void *a ); +static ULONG_PTR (WINAPI *call_thiscall_func3)( void *func, + void *this, const void *a, const void *b ); static void init_thiscall_thunk(void) { @@ -58,16 +60,19 @@ static void init_thiscall_thunk(void) thunk->jmp_edx = 0xe2ff; /* jmp *%edx */ call_thiscall_func1 = (void *)thunk; call_thiscall_func2 = (void *)thunk; + call_thiscall_func3 = (void *)thunk; } #define call_func1(func,_this) call_thiscall_func1(func,_this) #define call_func2(func,_this,a) call_thiscall_func2(func,_this,(const void*)(a)) +#define call_func3(func,_this,a,b) call_thiscall_func3(func,_this,(const void*)(a),(const void*)(b)) #else #define init_thiscall_thunk() #define call_func1(func,_this) func(_this) #define call_func2(func,_this,a) func(_this,a) +#define call_func3(func,_this,a,b) func(_this,a,b) #endif /* __i386__ */ @@ -103,6 +108,11 @@ typedef struct int unknown2[2]; } critical_section_scoped_lock; +typedef struct { + void *chain; + critical_section lock; +} _Condition_variable; + static inline float __port_infinity(void) { static const unsigned __inf_bytes = 0x7f800000; @@ -188,6 +198,13 @@ static critical_section_scoped_lock* (__thiscall *p_critical_section_scoped_lock (critical_section_scoped_lock*, critical_section *); static void (__thiscall *p_critical_section_scoped_lock_dtor)(critical_section_scoped_lock*); +static _Condition_variable* (__thiscall *p__Condition_variable_ctor)(_Condition_variable*); +static void (__thiscall *p__Condition_variable_dtor)(_Condition_variable*); +static void (__thiscall *p__Condition_variable_wait)(_Condition_variable*, critical_section*); +static MSVCRT_bool (__thiscall *p__Condition_variable_wait_for)(_Condition_variable*, critical_section*, unsigned int); +static void (__thiscall *p__Condition_variable_notify_one)(_Condition_variable*); +static void (__thiscall *p__Condition_variable_notify_all)(_Condition_variable*); + #define SETNOFAIL(x,y) x = (void*)GetProcAddress(module,y) #define SET(x,y) do { SETNOFAIL(x,y); ok(x != NULL, "Export '%s' not found\n", y); } while(0) @@ -240,6 +257,18 @@ static BOOL init(void) "??0scoped_lock@critical_section@Concurrency@@QEAA@AEAV12@@Z"); SET(p_critical_section_scoped_lock_dtor, "??1scoped_lock@critical_section@Concurrency@@QEAA@XZ"); + SET(p__Condition_variable_ctor, + "??0_Condition_variable@details@Concurrency@@QEAA@XZ"); + SET(p__Condition_variable_dtor, + "??1_Condition_variable@details@Concurrency@@QEAA@XZ"); + SET(p__Condition_variable_wait, + "?wait@_Condition_variable@details@Concurrency@@QEAAXAEAVcritical_section@3@@Z"); + SET(p__Condition_variable_wait_for, + "?wait_for@_Condition_variable@details@Concurrency@@QEAA_NAEAVcritical_section@3@I@Z"); + SET(p__Condition_variable_notify_one, + "?notify_one@_Condition_variable@details@Concurrency@@QEAAXXZ"); + SET(p__Condition_variable_notify_all, + "?notify_all@_Condition_variable@details@Concurrency@@QEAAXXZ"); } else { #ifdef __arm__ SET(p_critical_section_ctor, @@ -260,6 +289,18 @@ static BOOL init(void) "??0scoped_lock@critical_section@Concurrency@@QAA@AAV12@@Z"); SET(p_critical_section_scoped_lock_dtor, "??1scoped_lock@critical_section@Concurrency@@QAA@XZ"); + SET(p__Condition_variable_ctor, + "??0_Condition_variable@details@Concurrency@@QAA@XZ"); + SET(p__Condition_variable_dtor, + "??1_Condition_variable@details@Concurrency@@QAA@XZ"); + SET(p__Condition_variable_wait, + "?wait@_Condition_variable@details@Concurrency@@QAAXAAVcritical_section@3@@Z"); + SET(p__Condition_variable_wait_for, + "?wait_for@_Condition_variable@details@Concurrency@@QAA_NAAVcritical_section@3@I@Z"); + SET(p__Condition_variable_notify_one, + "?notify_one@_Condition_variable@details@Concurrency@@QAAXXZ"); + SET(p__Condition_variable_notify_all, + "?notify_all@_Condition_variable@details@Concurrency@@QAAXXZ"); #else SET(p_critical_section_ctor, "??0critical_section@Concurrency@@QAE@XZ"); @@ -279,6 +320,18 @@ static BOOL init(void) "??0scoped_lock@critical_section@Concurrency@@QAE@AAV12@@Z"); SET(p_critical_section_scoped_lock_dtor, "??1scoped_lock@critical_section@Concurrency@@QAE@XZ"); + SET(p__Condition_variable_ctor, + "??0_Condition_variable@details@Concurrency@@QAE@XZ"); + SET(p__Condition_variable_dtor, + "??1_Condition_variable@details@Concurrency@@QAE@XZ"); + SET(p__Condition_variable_wait, + "?wait@_Condition_variable@details@Concurrency@@QAEXAAVcritical_section@3@@Z"); + SET(p__Condition_variable_wait_for, + "?wait_for@_Condition_variable@details@Concurrency@@QAE_NAAVcritical_section@3@I@Z"); + SET(p__Condition_variable_notify_one, + "?notify_one@_Condition_variable@details@Concurrency@@QAEXXZ"); + SET(p__Condition_variable_notify_all, + "?notify_all@_Condition_variable@details@Concurrency@@QAEXXZ"); #endif } @@ -758,6 +811,77 @@ static void test__wcreate_locale(void) ok(errno == -1, "expected errno -1, but got %i\n", e); } +struct wait_thread_arg +{ + critical_section *cs; + _Condition_variable *cv; + HANDLE thread_initialized; +}; + +static DWORD WINAPI condition_variable_wait_thread(void *varg) +{ + struct wait_thread_arg *arg = varg; + + call_func1(p_critical_section_lock, arg->cs); + SetEvent(arg->thread_initialized); + call_func2(p__Condition_variable_wait, arg->cv, arg->cs); + call_func1(p_critical_section_unlock, arg->cs); + return 0; +} + +static void test__Condition_variable(void) +{ + critical_section cs; + _Condition_variable cv; + HANDLE thread_initialized = CreateEventW(NULL, FALSE, FALSE, NULL); + struct wait_thread_arg wait_thread_arg = { &cs, &cv, thread_initialized }; + HANDLE threads[2]; + DWORD ret; + MSVCRT_bool b; + + ok(thread_initialized != NULL, "CreateEvent failed\n"); + + call_func1(p_critical_section_ctor, &cs); + call_func1(p__Condition_variable_ctor, &cv); + + call_func1(p__Condition_variable_notify_one, &cv); + call_func1(p__Condition_variable_notify_all, &cv); + + threads[0] = CreateThread(0, 0, condition_variable_wait_thread, + &wait_thread_arg, 0, 0); + ok(threads[0] != NULL, "CreateThread failed\n"); + WaitForSingleObject(thread_initialized, INFINITE); + call_func1(p_critical_section_lock, &cs); + call_func1(p_critical_section_unlock, &cs); + + threads[1] = CreateThread(0, 0, condition_variable_wait_thread, + &wait_thread_arg, 0, 0); + ok(threads[1] != NULL, "CreateThread failed\n"); + WaitForSingleObject(thread_initialized, INFINITE); + call_func1(p_critical_section_lock, &cs); + call_func1(p_critical_section_unlock, &cs); + + call_func1(p__Condition_variable_notify_one, &cv); + ret = WaitForSingleObject(threads[1], 500); + ok(ret == WAIT_OBJECT_0, "WaitForSingleObject returned %d\n", ret); + call_func1(p__Condition_variable_notify_one, &cv); + ret = WaitForSingleObject(threads[0], 500); + ok(ret == WAIT_OBJECT_0, "WaitForSingleObject returned %d\n", ret); + + CloseHandle(threads[0]); + CloseHandle(threads[1]); + + call_func1(p_critical_section_lock, &cs); + b = call_func3(p__Condition_variable_wait_for, &cv, &cs, 1); + ok(!b, "_Condition_variable_wait_for returned TRUE\n"); + call_func1(p_critical_section_unlock, &cs); + + call_func1(p_critical_section_dtor, &cs); + call_func1(p__Condition_variable_dtor, &cv); + + CloseHandle(thread_initialized); +} + START_TEST(msvcr120) { if (!init()) return; @@ -773,4 +897,5 @@ START_TEST(msvcr120) test_critical_section(); test_fegetenv(); test__wcreate_locale(); + test__Condition_variable(); }
1
0
0
0
Piotr Caban : msvcr120: Add _Condition_variable implementation.
by Alexandre Julliard
17 Nov '16
17 Nov '16
Module: wine Branch: master Commit: 5e981f8512ec08d0cd044e3241c969b209da5aa0 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5e981f8512ec08d0cd044e324…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Thu Nov 17 09:56:13 2016 -0600 msvcr120: Add _Condition_variable implementation. Based on patch by Yifu Wang. Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msvcrt/lock.c | 124 +++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 115 insertions(+), 9 deletions(-) diff --git a/dlls/msvcrt/lock.c b/dlls/msvcrt/lock.c index 008ce37..85f6727 100644 --- a/dlls/msvcrt/lock.c +++ b/dlls/msvcrt/lock.c @@ -559,8 +559,14 @@ unsigned int __cdecl _GetConcurrency(void) #endif #if _MSVCR_VER >= 110 +typedef struct cv_queue { + struct cv_queue *next; + BOOL expired; +} cv_queue; + typedef struct { - void *chain; + /* cv_queue structure is not binary compatible */ + cv_queue *queue; critical_section lock; } _Condition_variable; @@ -569,8 +575,11 @@ typedef struct { DEFINE_THISCALL_WRAPPER(_Condition_variable_ctor, 4) _Condition_variable* __thiscall _Condition_variable_ctor(_Condition_variable *this) { - FIXME("(%p)\n", this); - return NULL; + TRACE("(%p)\n", this); + + this->queue = NULL; + critical_section_ctor(&this->lock); + return this; } /* ??1_Condition_variable@details@Concurrency@@QAE@XZ */ @@ -578,7 +587,16 @@ _Condition_variable* __thiscall _Condition_variable_ctor(_Condition_variable *th DEFINE_THISCALL_WRAPPER(_Condition_variable_dtor, 4) void __thiscall _Condition_variable_dtor(_Condition_variable *this) { - FIXME("(%p)\n", this); + TRACE("(%p)\n", this); + + while(this->queue) { + cv_queue *next = this->queue->next; + if(!this->queue->expired) + ERR("there's an active wait\n"); + HeapFree(GetProcessHeap(), 0, this->queue); + this->queue = next; + } + critical_section_dtor(&this->lock); } /* ?wait@_Condition_variable@details@Concurrency@@QAEXAAVcritical_section@3@@Z */ @@ -586,7 +604,19 @@ void __thiscall _Condition_variable_dtor(_Condition_variable *this) DEFINE_THISCALL_WRAPPER(_Condition_variable_wait, 8) void __thiscall _Condition_variable_wait(_Condition_variable *this, critical_section *cs) { - FIXME("(%p, %p)\n", this, cs); + cv_queue q; + + TRACE("(%p, %p)\n", this, cs); + + critical_section_lock(&this->lock); + q.next = this->queue; + q.expired = FALSE; + this->queue = &q; + critical_section_unlock(&this->lock); + + critical_section_unlock(cs); + NtWaitForKeyedEvent(keyed_event, &q, 0, NULL); + critical_section_lock(cs); } /* ?wait_for@_Condition_variable@details@Concurrency@@QAE_NAAVcritical_section@3@I@Z */ @@ -595,8 +625,41 @@ DEFINE_THISCALL_WRAPPER(_Condition_variable_wait_for, 12) MSVCRT_bool __thiscall _Condition_variable_wait_for(_Condition_variable *this, critical_section *cs, unsigned int timeout) { - FIXME("(%p %p %d)\n", this, cs, timeout); - return FALSE; + LARGE_INTEGER to; + NTSTATUS status; + FILETIME ft; + cv_queue *q; + + TRACE("(%p %p %d)\n", this, cs, timeout); + + if(!(q = HeapAlloc(GetProcessHeap(), 0, sizeof(cv_queue)))) { + throw_bad_alloc("bad allocation"); + } + + critical_section_lock(&this->lock); + q->next = this->queue; + q->expired = FALSE; + this->queue = q; + critical_section_unlock(&this->lock); + + critical_section_unlock(cs); + + GetSystemTimeAsFileTime(&ft); + to.QuadPart = ((LONGLONG)ft.dwHighDateTime << 32) + + ft.dwLowDateTime + (LONGLONG)timeout * 10000; + status = NtWaitForKeyedEvent(keyed_event, q, 0, &to); + if(status == STATUS_TIMEOUT) { + if(!InterlockedExchange(&q->expired, TRUE)) { + critical_section_lock(cs); + return FALSE; + } + else + NtWaitForKeyedEvent(keyed_event, q, 0, 0); + } + + HeapFree(GetProcessHeap(), 0, q); + critical_section_lock(cs); + return TRUE; } /* ?notify_one@_Condition_variable@details@Concurrency@@QAEXXZ */ @@ -604,7 +667,30 @@ MSVCRT_bool __thiscall _Condition_variable_wait_for(_Condition_variable *this, DEFINE_THISCALL_WRAPPER(_Condition_variable_notify_one, 4) void __thiscall _Condition_variable_notify_one(_Condition_variable *this) { - FIXME("(%p)\n", this); + cv_queue *node; + + TRACE("(%p)\n", this); + + if(!this->queue) + return; + + while(1) { + critical_section_lock(&this->lock); + node = this->queue; + if(!node) { + critical_section_unlock(&this->lock); + return; + } + this->queue = node->next; + critical_section_unlock(&this->lock); + + if(!InterlockedExchange(&node->expired, TRUE)) { + NtReleaseKeyedEvent(keyed_event, node, 0, NULL); + return; + } else { + HeapFree(GetProcessHeap(), 0, node); + } + } } /* ?notify_all@_Condition_variable@details@Concurrency@@QAEXXZ */ @@ -612,7 +698,27 @@ void __thiscall _Condition_variable_notify_one(_Condition_variable *this) DEFINE_THISCALL_WRAPPER(_Condition_variable_notify_all, 4) void __thiscall _Condition_variable_notify_all(_Condition_variable *this) { - FIXME("(%p)\n", this); + cv_queue *ptr; + + TRACE("(%p)\n", this); + + if(!this->queue) + return; + + critical_section_lock(&this->lock); + ptr = this->queue; + this->queue = NULL; + critical_section_unlock(&this->lock); + + while(ptr) { + cv_queue *next = ptr->next; + + if(!InterlockedExchange(&ptr->expired, TRUE)) + NtReleaseKeyedEvent(keyed_event, ptr, 0, NULL); + else + HeapFree(GetProcessHeap(), 0, ptr); + ptr = next; + } } #endif
1
0
0
0
Piotr Caban : msvcr110: Add Concurrency::details:: _Condition_variable class stub.
by Alexandre Julliard
17 Nov '16
17 Nov '16
Module: wine Branch: master Commit: 84bed7664c381637697f30f32f5b34787d9450da URL:
http://source.winehq.org/git/wine.git/?a=commit;h=84bed7664c381637697f30f32…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Thu Nov 17 09:56:06 2016 -0600 msvcr110: Add Concurrency::details::_Condition_variable class stub. Based on patch by Yifu Wang. Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/concrt140/concrt140.spec | 24 +++++++-------- dlls/msvcr110/msvcr110.spec | 36 +++++++++++------------ dlls/msvcr120/msvcr120.spec | 36 +++++++++++------------ dlls/msvcr120_app/msvcr120_app.spec | 36 +++++++++++------------ dlls/msvcrt/lock.c | 58 +++++++++++++++++++++++++++++++++++++ 5 files changed, 124 insertions(+), 66 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=84bed7664c381637697f3…
1
0
0
0
Daniel Lehman : urlmon: Fix buffer overflow in parse_canonicalize.
by Alexandre Julliard
17 Nov '16
17 Nov '16
Module: wine Branch: master Commit: 22b4599b8a715cb6ec71351ed24795fce1530195 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=22b4599b8a715cb6ec71351ed…
Author: Daniel Lehman <dlehman(a)esri.com> Date: Fri Nov 4 13:26:02 2016 -0700 urlmon: Fix buffer overflow in parse_canonicalize. Signed-off-by: Daniel Lehman <dlehman(a)esri.com> Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/urlmon/tests/uri.c | 34 ++++++++++++++++++++++++++++++++++ dlls/urlmon/uri.c | 38 +++++++++++++++++++++++--------------- 2 files changed, 57 insertions(+), 15 deletions(-) diff --git a/dlls/urlmon/tests/uri.c b/dlls/urlmon/tests/uri.c index 5f98d4e..da5a739 100644 --- a/dlls/urlmon/tests/uri.c +++ b/dlls/urlmon/tests/uri.c @@ -7405,6 +7405,11 @@ static inline LPWSTR a2w(LPCSTR str) { return ret; } +static inline void *heap_alloc(size_t len) +{ + return HeapAlloc(GetProcessHeap(), 0, len); +} + static inline BOOL heap_free(void* mem) { return HeapFree(GetProcessHeap(), 0, mem); } @@ -10403,7 +10408,9 @@ static void test_CoInternetParseIUri_InvalidArgs(void) { HRESULT hr; IUri *uri = NULL; WCHAR tmp[3]; + WCHAR *longurl, *copy; DWORD result = -1; + DWORD i, len; hr = pCoInternetParseIUri(NULL, PARSE_CANONICALIZE, 0, tmp, 3, &result, 0); ok(hr == E_INVALIDARG, "Error: CoInternetParseIUri returned 0x%08x, expected 0x%08x.\n", @@ -10459,6 +10466,33 @@ static void test_CoInternetParseIUri_InvalidArgs(void) { expected_len, result); } if(uri) IUri_Release(uri); + + /* a long url that causes a crash on Wine */ + len = INTERNET_MAX_URL_LENGTH*2; + longurl = heap_alloc((len+1)*sizeof(WCHAR)); + memcpy(longurl, http_urlW, sizeof(http_urlW)); + for(i = sizeof(http_urlW)/sizeof(WCHAR)-1; i < len; i++) + longurl[i] = 'x'; + longurl[len] = 0; + + copy = heap_alloc((len+1)*sizeof(WCHAR)); + memcpy(copy, longurl, (len+1)*sizeof(WCHAR)); + + hr = pCreateUri(longurl, 0, 0, &uri); + ok(SUCCEEDED(hr), "Error: CreateUri returned 0x%08x.\n", hr); + if(SUCCEEDED(hr)) { + result = -1; + memset(longurl, 0xcc, len*sizeof(WCHAR)); + hr = pCoInternetParseIUri(uri, PARSE_CANONICALIZE, 0, longurl, len+1, &result, 0); + ok(SUCCEEDED(hr), "Error: CoInternetParseIUri returned 0x%08x.\n", hr); + ok(!lstrcmpW(longurl, copy), "Error: expected long url '%s' but was '%s'.\n", + wine_dbgstr_w(copy), wine_dbgstr_w(longurl)); + ok(result == len, "Error: Expected 'result' to be %d, but was %d instead.\n", + len, result); + } + heap_free(longurl); + heap_free(copy); + if(uri) IUri_Release(uri); } static void test_CoInternetParseIUri(void) { diff --git a/dlls/urlmon/uri.c b/dlls/urlmon/uri.c index e6f844b..79b073e 100644 --- a/dlls/urlmon/uri.c +++ b/dlls/urlmon/uri.c @@ -6825,7 +6825,6 @@ static HRESULT parse_canonicalize(const Uri *uri, DWORD flags, LPWSTR output, const WCHAR *ptr = NULL; WCHAR *path = NULL; const WCHAR **pptr; - WCHAR buffer[INTERNET_MAX_URL_LENGTH+1]; DWORD len = 0; BOOL reduce_path; @@ -6852,11 +6851,11 @@ static HRESULT parse_canonicalize(const Uri *uri, DWORD flags, LPWSTR output, * it later. */ if(reduce_path && !path && ptr == uri->canon_uri+uri->path_start) - path = buffer+len; + path = output+len; /* Check if it's time to reduce the path. */ if(reduce_path && ptr == uri->canon_uri+uri->path_start+uri->path_len) { - DWORD current_path_len = (buffer+len) - path; + DWORD current_path_len = (output+len) - path; DWORD new_path_len = remove_dot_segments(path, current_path_len); /* Update the current length. */ @@ -6868,7 +6867,9 @@ static HRESULT parse_canonicalize(const Uri *uri, DWORD flags, LPWSTR output, const WCHAR decoded = decode_pct_val(ptr); if(decoded) { if(allow_unescape && (flags & URL_UNESCAPE)) { - buffer[len++] = decoded; + if(len < output_len) + output[len] = decoded; + len++; ptr += 2; do_default_action = FALSE; } @@ -6876,48 +6877,55 @@ static HRESULT parse_canonicalize(const Uri *uri, DWORD flags, LPWSTR output, /* See if %'s needed to encoded. */ if(do_default_action && (flags & URL_ESCAPE_PERCENT)) { - pct_encode_val(*ptr, buffer+len); + if(len + 3 < output_len) + pct_encode_val(*ptr, output+len); len += 3; do_default_action = FALSE; } } else if(*ptr == ' ') { if((flags & URL_ESCAPE_SPACES_ONLY) && !(flags & URL_ESCAPE_UNSAFE)) { - pct_encode_val(*ptr, buffer+len); + if(len + 3 < output_len) + pct_encode_val(*ptr, output+len); len += 3; do_default_action = FALSE; } } else if(!is_reserved(*ptr) && !is_unreserved(*ptr)) { if(flags & URL_ESCAPE_UNSAFE) { - pct_encode_val(*ptr, buffer+len); + if(len + 3 < output_len) + pct_encode_val(*ptr, output+len); len += 3; do_default_action = FALSE; } } - if(do_default_action) - buffer[len++] = *ptr; + if(do_default_action) { + if(len < output_len) + output[len] = *ptr; + len++; + } } /* Sometimes the path is the very last component of the IUri, so * see if the dot segments need to be reduced now. */ if(reduce_path && path) { - DWORD current_path_len = (buffer+len) - path; + DWORD current_path_len = (output+len) - path; DWORD new_path_len = remove_dot_segments(path, current_path_len); /* Update the current length. */ len -= (current_path_len-new_path_len); } - buffer[len++] = 0; + if(len < output_len) + output[len] = 0; + else + output[output_len-1] = 0; /* The null terminator isn't included in the length. */ - *result_len = len-1; - if(len > output_len) + *result_len = len; + if(len >= output_len) return STRSAFE_E_INSUFFICIENT_BUFFER; - else - memcpy(output, buffer, len*sizeof(WCHAR)); return S_OK; }
1
0
0
0
← Newer
1
...
22
23
24
25
26
27
28
...
47
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
Results per page:
10
25
50
100
200