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
April 2017
----- 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
757 discussions
Start a n
N
ew thread
Hans Leidekker : webservices: Keep track of service proxy state.
by Alexandre Julliard
05 Apr '17
05 Apr '17
Module: wine Branch: master Commit: e1e36be4b8880795a281e214029aa5cdd1d0d5bd URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e1e36be4b8880795a281e2140…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Wed Apr 5 11:40:23 2017 +0200 webservices: Keep track of service proxy state. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/webservices/proxy.c | 30 +++++++++++++++++++++--------- dlls/webservices/tests/proxy.c | 36 ++++++++++++++++++++++-------------- 2 files changed, 43 insertions(+), 23 deletions(-) diff --git a/dlls/webservices/proxy.c b/dlls/webservices/proxy.c index 63cf559..ac8387a 100644 --- a/dlls/webservices/proxy.c +++ b/dlls/webservices/proxy.c @@ -43,11 +43,12 @@ static const struct prop_desc proxy_props[] = struct proxy { - ULONG magic; - CRITICAL_SECTION cs; - WS_CHANNEL *channel; - ULONG prop_count; - struct prop prop[sizeof(proxy_props)/sizeof(proxy_props[0])]; + ULONG magic; + CRITICAL_SECTION cs; + WS_SERVICE_PROXY_STATE state; + WS_CHANNEL *channel; + ULONG prop_count; + struct prop prop[sizeof(proxy_props)/sizeof(proxy_props[0])]; }; #define PROXY_MAGIC (('P' << 24) | ('R' << 16) | ('O' << 8) | 'X') @@ -222,7 +223,7 @@ HRESULT WINAPI WsGetServiceProxyProperty( WS_SERVICE_PROXY *handle, WS_PROXY_PRO void *buf, ULONG size, WS_ERROR *error ) { struct proxy *proxy = (struct proxy *)handle; - HRESULT hr; + HRESULT hr = S_OK; TRACE( "%p %u %p %u %p\n", handle, id, buf, size, error ); if (error) FIXME( "ignoring error parameter\n" ); @@ -237,7 +238,16 @@ HRESULT WINAPI WsGetServiceProxyProperty( WS_SERVICE_PROXY *handle, WS_PROXY_PRO return E_INVALIDARG; } - hr = prop_get( proxy->prop, proxy->prop_count, id, buf, size ); + switch (id) + { + case WS_PROXY_PROPERTY_STATE: + if (!buf || size != sizeof(proxy->state)) hr = E_INVALIDARG; + else *(WS_SERVICE_PROXY_STATE *)buf = proxy->state; + break; + + default: + hr = prop_get( proxy->prop, proxy->prop_count, id, buf, size ); + } LeaveCriticalSection( &proxy->cs ); return hr; @@ -266,7 +276,8 @@ HRESULT WINAPI WsOpenServiceProxy( WS_SERVICE_PROXY *handle, const WS_ENDPOINT_A return E_INVALIDARG; } - hr = WsOpenChannel( proxy->channel, endpoint, NULL, NULL ); + if ((hr = WsOpenChannel( proxy->channel, endpoint, NULL, NULL )) == S_OK) + proxy->state = WS_SERVICE_PROXY_STATE_OPEN; LeaveCriticalSection( &proxy->cs ); return hr; @@ -294,7 +305,8 @@ HRESULT WINAPI WsCloseServiceProxy( WS_SERVICE_PROXY *handle, const WS_ASYNC_CON return E_INVALIDARG; } - hr = WsCloseChannel( proxy->channel, NULL, NULL ); + if ((hr = WsCloseChannel( proxy->channel, NULL, NULL )) == S_OK) + proxy->state = WS_SERVICE_PROXY_STATE_CLOSED; LeaveCriticalSection( &proxy->cs ); return hr; diff --git a/dlls/webservices/tests/proxy.c b/dlls/webservices/tests/proxy.c index 79f6444..9351d2d 100644 --- a/dlls/webservices/tests/proxy.c +++ b/dlls/webservices/tests/proxy.c @@ -95,7 +95,7 @@ static void test_WsCreateServiceProxy(void) HRESULT hr; WS_SERVICE_PROXY *proxy; WS_SERVICE_PROXY_STATE state; - ULONG size, value; + ULONG value; hr = WsCreateServiceProxy( WS_CHANNEL_TYPE_REQUEST, WS_HTTP_CHANNEL_BINDING, NULL, NULL, 0, NULL, 0, NULL, NULL ); @@ -109,13 +109,11 @@ static void test_WsCreateServiceProxy(void) /* write-only property */ value = 0xdeadbeef; - size = sizeof(value); - hr = WsGetServiceProxyProperty( proxy, WS_PROXY_PROPERTY_CALL_TIMEOUT, &value, size, NULL ); + hr = WsGetServiceProxyProperty( proxy, WS_PROXY_PROPERTY_CALL_TIMEOUT, &value, sizeof(value), NULL ); ok( hr == E_INVALIDARG, "got %08x\n", hr ); state = 0xdeadbeef; - size = sizeof(state); - hr = WsGetServiceProxyProperty( proxy, WS_PROXY_PROPERTY_STATE, &state, size, NULL ); + hr = WsGetServiceProxyProperty( proxy, WS_PROXY_PROPERTY_STATE, &state, sizeof(state), NULL ); ok( hr == S_OK, "got %08x\n", hr ); ok( state == WS_SERVICE_PROXY_STATE_CREATED, "got %u\n", state ); @@ -151,6 +149,7 @@ static void test_WsOpenServiceProxy(void) WCHAR url[] = {'h','t','t','p',':','/','/','l','o','c','a','l','h','o','s','t','/'}; HRESULT hr; WS_SERVICE_PROXY *proxy; + WS_SERVICE_PROXY_STATE state; WS_HTTP_POLICY_DESCRIPTION policy; WS_ENDPOINT_ADDRESS addr; @@ -159,17 +158,30 @@ static void test_WsOpenServiceProxy(void) NULL, 0, &policy, sizeof(policy), &proxy, NULL ); ok( hr == S_OK, "got %08x\n", hr ); + state = 0xdeadbeef; + hr = WsGetServiceProxyProperty( proxy, WS_PROXY_PROPERTY_STATE, &state, sizeof(state), NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( state == WS_SERVICE_PROXY_STATE_CREATED, "got %u\n", state ); + + memset( &addr, 0, sizeof(addr) ); addr.url.length = sizeof(url)/sizeof(url[0]); addr.url.chars = url; - addr.headers = NULL; - addr.extensions = NULL; - addr.identity = NULL; hr = WsOpenServiceProxy( proxy, &addr, NULL, NULL ); ok( hr == S_OK, "got %08x\n", hr ); + state = 0xdeadbeef; + hr = WsGetServiceProxyProperty( proxy, WS_PROXY_PROPERTY_STATE, &state, sizeof(state), NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( state == WS_SERVICE_PROXY_STATE_OPEN, "got %u\n", state ); + hr = WsCloseServiceProxy( proxy , NULL, NULL ); ok( hr == S_OK, "got %08x\n", hr ); + state = 0xdeadbeef; + hr = WsGetServiceProxyProperty( proxy, WS_PROXY_PROPERTY_STATE, &state, sizeof(state), NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( state == WS_SERVICE_PROXY_STATE_CLOSED, "got %u\n", state ); + WsFreeServiceProxy( proxy ); } @@ -197,11 +209,9 @@ static HRESULT create_channel( int port, WS_CHANNEL **ret ) hr = WsCreateChannel( WS_CHANNEL_TYPE_REQUEST, WS_HTTP_CHANNEL_BINDING, prop, 2, NULL, &channel, NULL ); if (hr != S_OK) return hr; + memset( &addr, 0, sizeof(addr) ); addr.url.length = wsprintfW( buf, fmt, port ); addr.url.chars = buf; - addr.headers = NULL; - addr.extensions = NULL; - addr.identity = NULL; hr = WsOpenChannel( channel, &addr, NULL, NULL ); if (hr == S_OK) *ret = channel; else WsFreeChannel( channel ); @@ -335,11 +345,9 @@ static HRESULT create_proxy( int port, WS_SERVICE_PROXY **ret ) 0, prop, sizeof(prop)/sizeof(prop[0]), &proxy, NULL ); if (hr != S_OK) return hr; + memset( &addr, 0, sizeof(addr) ); addr.url.length = wsprintfW( url, fmt, port ); addr.url.chars = url; - addr.headers = NULL; - addr.extensions = NULL; - addr.identity = NULL; hr = WsOpenServiceProxy( proxy, &addr, NULL, NULL ); if (hr == S_OK) *ret = proxy; else WsFreeServiceProxy( proxy );
1
0
0
0
Hans Leidekker : webservices: Implement WsResetChannel.
by Alexandre Julliard
05 Apr '17
05 Apr '17
Module: wine Branch: master Commit: 29d4c50391cdd5a129d84cc41838bd8714128aab URL:
http://source.winehq.org/git/wine.git/?a=commit;h=29d4c50391cdd5a129d84cc41…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Wed Apr 5 11:40:22 2017 +0200 webservices: Implement WsResetChannel. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/webservices/channel.c | 65 ++++++++++++++++++++++++++++++--------- dlls/webservices/tests/channel.c | 60 ++++++++++++++++++++++++++++++++++++ dlls/webservices/webservices.spec | 2 +- 3 files changed, 111 insertions(+), 16 deletions(-) diff --git a/dlls/webservices/channel.c b/dlls/webservices/channel.c index d44fcc0..d82aa67 100644 --- a/dlls/webservices/channel.c +++ b/dlls/webservices/channel.c @@ -121,14 +121,27 @@ static struct channel *alloc_channel(void) return ret; } -static void free_channel( struct channel *channel ) +static void reset_channel( struct channel *channel ) { - WsFreeWriter( channel->writer ); - WsFreeReader( channel->reader ); + channel->state = WS_CHANNEL_STATE_CREATED; + heap_free( channel->addr.url.chars ); + channel->addr.url.chars = NULL; + channel->addr.url.length = 0; + WinHttpCloseHandle( channel->http_request ); + channel->http_request = NULL; WinHttpCloseHandle( channel->http_connect ); + channel->http_connect = NULL; WinHttpCloseHandle( channel->http_session ); - heap_free( channel->addr.url.chars ); + channel->http_session = NULL; +} + +static void free_channel( struct channel *channel ) +{ + reset_channel( channel ); + + WsFreeWriter( channel->writer ); + WsFreeReader( channel->reader ); channel->cs.DebugInfo->Spare[0] = 0; DeleteCriticalSection( &channel->cs ); @@ -226,6 +239,38 @@ void WINAPI WsFreeChannel( WS_CHANNEL *handle ) } /************************************************************************** + * WsResetChannel [webservices.@] + */ +HRESULT WINAPI WsResetChannel( WS_CHANNEL *handle, WS_ERROR *error ) +{ + struct channel *channel = (struct channel *)handle; + + TRACE( "%p %p\n", handle, error ); + if (error) FIXME( "ignoring error parameter\n" ); + + if (!channel) return E_INVALIDARG; + + EnterCriticalSection( &channel->cs ); + + if (channel->magic != CHANNEL_MAGIC) + { + LeaveCriticalSection( &channel->cs ); + return E_INVALIDARG; + } + + if (channel->state != WS_CHANNEL_STATE_CREATED && channel->state != WS_CHANNEL_STATE_CLOSED) + { + LeaveCriticalSection( &channel->cs ); + return WS_E_INVALID_OPERATION; + } + + reset_channel( channel ); + + LeaveCriticalSection( &channel->cs ); + return S_OK; +} + +/************************************************************************** * WsGetChannelProperty [webservices.@] */ HRESULT WINAPI WsGetChannelProperty( WS_CHANNEL *handle, WS_CHANNEL_PROPERTY_ID id, void *buf, @@ -343,17 +388,7 @@ HRESULT WINAPI WsOpenChannel( WS_CHANNEL *handle, const WS_ENDPOINT_ADDRESS *end static HRESULT close_channel( struct channel *channel ) { - WinHttpCloseHandle( channel->http_request ); - channel->http_request = NULL; - WinHttpCloseHandle( channel->http_connect ); - channel->http_connect = NULL; - WinHttpCloseHandle( channel->http_session ); - channel->http_session = NULL; - - heap_free( channel->addr.url.chars ); - channel->addr.url.chars = NULL; - channel->addr.url.length = 0; - + reset_channel( channel ); channel->state = WS_CHANNEL_STATE_CLOSED; return S_OK; } diff --git a/dlls/webservices/tests/channel.c b/dlls/webservices/tests/channel.c index f053c15..74cef3b 100644 --- a/dlls/webservices/tests/channel.c +++ b/dlls/webservices/tests/channel.c @@ -103,8 +103,68 @@ static void test_WsOpenChannel(void) WsFreeChannel( channel ); } +static void test_WsResetChannel(void) +{ + WCHAR url[] = {'h','t','t','p',':','/','/','l','o','c','a','l','h','o','s','t'}; + HRESULT hr; + WS_CHANNEL *channel; + WS_CHANNEL_STATE state; + WS_CHANNEL_TYPE type; + WS_ENDPOINT_ADDRESS addr; + ULONG size, timeout; + + hr = WsCreateChannel( WS_CHANNEL_TYPE_REQUEST, WS_HTTP_CHANNEL_BINDING, NULL, 0, NULL, &channel, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsResetChannel( channel, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + timeout = 5000; + size = sizeof(timeout); + hr = WsSetChannelProperty( channel, WS_CHANNEL_PROPERTY_RESOLVE_TIMEOUT, &timeout, size, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + addr.url.length = sizeof(url)/sizeof(url[0]); + addr.url.chars = url; + addr.headers = NULL; + addr.extensions = NULL; + addr.identity = NULL; + hr = WsOpenChannel( channel, &addr, NULL, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsResetChannel( channel, NULL ); + ok( hr == WS_E_INVALID_OPERATION, "got %08x\n", hr ); + + hr = WsCloseChannel( channel, NULL, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsResetChannel( channel, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + state = 0xdeadbeef; + size = sizeof(state); + hr = WsGetChannelProperty( channel, WS_CHANNEL_PROPERTY_STATE, &state, size, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( state == WS_CHANNEL_STATE_CREATED, "got %u\n", state ); + + type = 0xdeadbeef; + size = sizeof(type); + hr = WsGetChannelProperty( channel, WS_CHANNEL_PROPERTY_CHANNEL_TYPE, &type, size, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( type == WS_CHANNEL_TYPE_REQUEST, "got %u\n", type ); + + timeout = 0xdeadbeef; + size = sizeof(timeout); + hr = WsGetChannelProperty( channel, WS_CHANNEL_PROPERTY_RESOLVE_TIMEOUT, &timeout, size, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( timeout == 5000, "got %u\n", timeout ); + + WsFreeChannel( channel ); +} + START_TEST(channel) { test_WsCreateChannel(); test_WsOpenChannel(); + test_WsResetChannel(); } diff --git a/dlls/webservices/webservices.spec b/dlls/webservices/webservices.spec index fd4a831..0a3057d 100644 --- a/dlls/webservices/webservices.spec +++ b/dlls/webservices/webservices.spec @@ -133,7 +133,7 @@ @ stub WsRemoveNode @ stub WsRequestReply @ stub WsRequestSecurityToken -@ stub WsResetChannel +@ stdcall WsResetChannel(ptr ptr) @ stdcall WsResetError(ptr) @ stdcall WsResetHeap(ptr ptr) @ stub WsResetListener
1
0
0
0
Hans Leidekker : include: Add missing Web Services declarations.
by Alexandre Julliard
05 Apr '17
05 Apr '17
Module: wine Branch: master Commit: 5488acf1d37ed64de4b516951d2c24529259a04c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5488acf1d37ed64de4b516951…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Wed Apr 5 11:40:21 2017 +0200 include: Add missing Web Services declarations. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- include/webservices.h | 141 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 141 insertions(+) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=5488acf1d37ed64de4b51…
1
0
0
0
Alistair Leslie-Hughes : winhttp/tests: Added multi Authenticate header test.
by Alexandre Julliard
05 Apr '17
05 Apr '17
Module: wine Branch: master Commit: eb3cb338200a6fa7c301f9da43766d1d5118b637 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=eb3cb338200a6fa7c301f9da4…
Author: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Date: Wed Apr 5 09:20:54 2017 +0000 winhttp/tests: Added multi Authenticate header test. Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winhttp/tests/winhttp.c | 50 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/dlls/winhttp/tests/winhttp.c b/dlls/winhttp/tests/winhttp.c index d4406af..9802297 100644 --- a/dlls/winhttp/tests/winhttp.c +++ b/dlls/winhttp/tests/winhttp.c @@ -2049,6 +2049,16 @@ static const char headmsg[] = "Content-Length: 100\r\n" "\r\n"; +static const char multiauth[] = +"HTTP/1.1 401 Unauthorized\r\n" +"Server: winetest\r\n" +"WWW-Authenticate: Bearer\r\n" +"WWW-Authenticate: Basic realm=\"placebo\"\r\n" +"WWW-Authenticate: NTLM\r\n" +"Content-Length: 10\r\n" +"Content-Type: text/plain\r\n" +"\r\n"; + static const char unauthorized[] = "Unauthorized"; static const char hello_world[] = "Hello World"; @@ -2158,6 +2168,10 @@ static DWORD CALLBACK server_thread(LPVOID param) else send(c, notokmsg, sizeof(notokmsg) - 1, 0); } + if (strstr(buffer, "GET /multiauth")) + { + send(c, multiauth, sizeof multiauth - 1, 0); + } if (strstr(buffer, "GET /cookie4")) { send(c, cookiemsg2, sizeof(cookiemsg2) - 1, 0); @@ -2504,6 +2518,41 @@ static void test_basic_authentication(int port) WinHttpCloseHandle(ses); } +static void test_multi_authentication(int port) +{ + static const WCHAR multiauthW[] = {'/','m','u','l','t','i','a','u','t','h',0}; + static const WCHAR getW[] = {'G','E','T',0}; + HINTERNET ses, con, req; + DWORD supported = 10, first = 9, target = 8; + BOOL ret; + + ses = WinHttpOpen(test_useragent, WINHTTP_ACCESS_TYPE_NO_PROXY, NULL, NULL, 0); + ok(ses != NULL, "failed to open session %u\n", GetLastError()); + + con = WinHttpConnect(ses, localhostW, port, 0); + ok(con != NULL, "failed to open a connection %u\n", GetLastError()); + + req = WinHttpOpenRequest(con, getW, multiauthW, NULL, NULL, NULL, 0); + ok(req != NULL, "failed to open a request %u\n", GetLastError()); + + ret = WinHttpSendRequest(req, WINHTTP_NO_ADDITIONAL_HEADERS, 0, + WINHTTP_NO_REQUEST_DATA,0, 0, 0 ); + ok(ret, "expected success\n"); + + ret = WinHttpReceiveResponse(req, NULL); + ok(ret, "expected success\n"); + + ret = WinHttpQueryAuthSchemes(req, &supported, &first, &target); + todo_wine ok(ret, "expected success\n"); + todo_wine ok(supported == (WINHTTP_AUTH_SCHEME_BASIC | WINHTTP_AUTH_SCHEME_NTLM), "got %x\n", supported); + todo_wine ok(target == WINHTTP_AUTH_TARGET_SERVER, "got %x\n", target); + todo_wine ok(first == 1, "got %x\n", first); + + WinHttpCloseHandle(req); + WinHttpCloseHandle(con); + WinHttpCloseHandle(ses); +} + static void test_no_headers(int port) { static const WCHAR no_headersW[] = {'/','n','o','_','h','e','a','d','e','r','s',0}; @@ -4303,6 +4352,7 @@ START_TEST (winhttp) test_head_request(si.port); test_not_modified(si.port); test_basic_authentication(si.port); + test_multi_authentication(si.port); test_bad_header(si.port); test_multiple_reads(si.port); test_cookies(si.port);
1
0
0
0
Henri Verbeet : usp10: Return early if the number of positioning operations is 0 in GPOS_apply_ChainContextPos ().
by Alexandre Julliard
05 Apr '17
05 Apr '17
Module: wine Branch: master Commit: 038976856805c9bec00291e6784310f24e9168f5 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=038976856805c9bec00291e67…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Wed Apr 5 10:21:29 2017 +0200 usp10: Return early if the number of positioning operations is 0 in GPOS_apply_ChainContextPos(). This preserves the current logic, but I wonder if we're not supposed to always return "input_count". Returning 1 seems questionable if we matched more input glyphs than that, and so does including the lookahead count. Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Aric Stewart <aric(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/usp10/opentype.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/dlls/usp10/opentype.c b/dlls/usp10/opentype.c index 9c1d596..0d98253 100644 --- a/dlls/usp10/opentype.c +++ b/dlls/usp10/opentype.c @@ -2226,7 +2226,7 @@ static unsigned int GPOS_apply_ChainContextPos(const ScriptCache *script_cache, } else if (GET_BE_WORD(backtrack->PosFormat) == 3) { - WORD backtrack_count, input_count, lookahead_count; + WORD backtrack_count, input_count, lookahead_count, positioning_count; int k; const GPOS_ChainContextPosFormat3_2 *input; const GPOS_ChainContextPosFormat3_3 *lookahead; @@ -2286,20 +2286,19 @@ static unsigned int GPOS_apply_ChainContextPos(const ScriptCache *script_cache, continue; TRACE("Matched LookAhead\n"); - if (GET_BE_WORD(positioning->PosCount)) + if (!(positioning_count = GET_BE_WORD(positioning->PosCount))) + return 1; + + for (k = 0; k < positioning_count; ++k) { - for (k = 0; k < GET_BE_WORD(positioning->PosCount); ++k) - { - int lookupIndex = GET_BE_WORD(positioning->PosLookupRecord[k].LookupListIndex); - int SequenceIndex = GET_BE_WORD(positioning->PosLookupRecord[k].SequenceIndex) * write_dir; + WORD lookup_index = GET_BE_WORD(positioning->PosLookupRecord[k].LookupListIndex); + WORD sequence_index = GET_BE_WORD(positioning->PosLookupRecord[k].SequenceIndex) * write_dir; - TRACE("Position: %i -> %i %i\n",k, SequenceIndex, lookupIndex); - GPOS_apply_lookup(script_cache, otm, logfont, analysis, advance, lookup, lookupIndex, - glyphs, glyph_index + SequenceIndex, glyph_count, goffset); - } - return input_count + lookahead_count; + TRACE("Position: %u -> %u %u.\n", k, sequence_index, lookup_index); + GPOS_apply_lookup(script_cache, otm, logfont, analysis, advance, lookup, lookup_index, + glyphs, glyph_index + sequence_index, glyph_count, goffset); } - else return 1; + return input_count + lookahead_count; } else FIXME("Unhandled Chaining Contextual Positioning Format %#x.\n", GET_BE_WORD(backtrack->PosFormat));
1
0
0
0
Henri Verbeet : usp10: Range check glyph counts in GPOS_apply_ChainContextPos().
by Alexandre Julliard
05 Apr '17
05 Apr '17
Module: wine Branch: master Commit: 7dfe9b9c94e5c57a2b6c0b1252e72b78a17a678d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7dfe9b9c94e5c57a2b6c0b125…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Wed Apr 5 10:21:28 2017 +0200 usp10: Range check glyph counts in GPOS_apply_ChainContextPos(). I.e., avoid accessing outside the "glyphs" array. If we're particularly unlucky we may actually get a match against data outside the array. Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Aric Stewart <aric(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/usp10/opentype.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/dlls/usp10/opentype.c b/dlls/usp10/opentype.c index b5ee5d1..9c1d596 100644 --- a/dlls/usp10/opentype.c +++ b/dlls/usp10/opentype.c @@ -2235,10 +2235,22 @@ static unsigned int GPOS_apply_ChainContextPos(const ScriptCache *script_cache, TRACE(" subtype 3 (Coverage-based Chaining Context Glyph Positioning)\n"); backtrack_count = GET_BE_WORD(backtrack->BacktrackGlyphCount); + k = glyph_index + dirBacktrack * backtrack_count; + if (k < 0 || k >= glyph_count) + continue; + input = (const GPOS_ChainContextPosFormat3_2 *)&backtrack->Coverage[backtrack_count]; input_count = GET_BE_WORD(input->InputGlyphCount); + k = glyph_index + write_dir * (input_count - 1); + if (k < 0 || k >= glyph_count) + continue; + lookahead = (const GPOS_ChainContextPosFormat3_3 *)&input->Coverage[input_count]; lookahead_count = GET_BE_WORD(lookahead->LookaheadGlyphCount); + k = glyph_index + dirLookahead * (input_count + lookahead_count - 1); + if (k < 0 || k >= glyph_count) + continue; + positioning = (const GPOS_ChainContextPosFormat3_4 *)&lookahead->Coverage[lookahead_count]; for (k = 0; k < backtrack_count; ++k)
1
0
0
0
Henri Verbeet : usp10: Simplify the chaining context table assignments in GPOS_apply_ChainContextPos ().
by Alexandre Julliard
05 Apr '17
05 Apr '17
Module: wine Branch: master Commit: f6c0146499cf0b0c632c1c14ba910dfdce57db6a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f6c0146499cf0b0c632c1c14b…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Wed Apr 5 10:21:27 2017 +0200 usp10: Simplify the chaining context table assignments in GPOS_apply_ChainContextPos(). And avoid some endian conversions in the process. Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Aric Stewart <aric(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/usp10/opentype.c | 35 ++++++++++++++++------------------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/dlls/usp10/opentype.c b/dlls/usp10/opentype.c index fd8fe91..b5ee5d1 100644 --- a/dlls/usp10/opentype.c +++ b/dlls/usp10/opentype.c @@ -2226,57 +2226,54 @@ static unsigned int GPOS_apply_ChainContextPos(const ScriptCache *script_cache, } else if (GET_BE_WORD(backtrack->PosFormat) == 3) { + WORD backtrack_count, input_count, lookahead_count; int k; - int indexGlyphs; const GPOS_ChainContextPosFormat3_2 *input; const GPOS_ChainContextPosFormat3_3 *lookahead; const GPOS_ChainContextPosFormat3_4 *positioning; TRACE(" subtype 3 (Coverage-based Chaining Context Glyph Positioning)\n"); - for (k = 0; k < GET_BE_WORD(backtrack->BacktrackGlyphCount); ++k) + backtrack_count = GET_BE_WORD(backtrack->BacktrackGlyphCount); + input = (const GPOS_ChainContextPosFormat3_2 *)&backtrack->Coverage[backtrack_count]; + input_count = GET_BE_WORD(input->InputGlyphCount); + lookahead = (const GPOS_ChainContextPosFormat3_3 *)&input->Coverage[input_count]; + lookahead_count = GET_BE_WORD(lookahead->LookaheadGlyphCount); + positioning = (const GPOS_ChainContextPosFormat3_4 *)&lookahead->Coverage[lookahead_count]; + + for (k = 0; k < backtrack_count; ++k) { offset = GET_BE_WORD(backtrack->Coverage[k]); if (GSUB_is_glyph_covered((const BYTE *)backtrack + offset, glyphs[glyph_index + (dirBacktrack * (k + 1))]) == -1) break; } - if (k != GET_BE_WORD(backtrack->BacktrackGlyphCount)) + if (k != backtrack_count) continue; TRACE("Matched Backtrack\n"); - input = (const GPOS_ChainContextPosFormat3_2 *)((BYTE *)backtrack + - FIELD_OFFSET(GPOS_ChainContextPosFormat3_1, Coverage[GET_BE_WORD(backtrack->BacktrackGlyphCount)])); - - indexGlyphs = GET_BE_WORD(input->InputGlyphCount); - for (k = 0; k < indexGlyphs; k++) + for (k = 0; k < input_count; ++k) { offset = GET_BE_WORD(input->Coverage[k]); if (GSUB_is_glyph_covered((const BYTE *)backtrack + offset, glyphs[glyph_index + (write_dir * k)]) == -1) break; } - if (k != indexGlyphs) + if (k != input_count) continue; TRACE("Matched IndexGlyphs\n"); - lookahead = (const GPOS_ChainContextPosFormat3_3 *)((BYTE *)input + - FIELD_OFFSET(GPOS_ChainContextPosFormat3_2, Coverage[GET_BE_WORD(input->InputGlyphCount)])); - - for (k = 0; k < GET_BE_WORD(lookahead->LookaheadGlyphCount); ++k) + for (k = 0; k < lookahead_count; ++k) { offset = GET_BE_WORD(lookahead->Coverage[k]); if (GSUB_is_glyph_covered((const BYTE *)backtrack + offset, - glyphs[glyph_index + (dirLookahead * (indexGlyphs + k))]) == -1) + glyphs[glyph_index + (dirLookahead * (input_count + k))]) == -1) break; } - if (k != GET_BE_WORD(lookahead->LookaheadGlyphCount)) + if (k != lookahead_count) continue; TRACE("Matched LookAhead\n"); - positioning = (const GPOS_ChainContextPosFormat3_4 *)((BYTE *)lookahead + - FIELD_OFFSET(GPOS_ChainContextPosFormat3_3, Coverage[GET_BE_WORD(lookahead->LookaheadGlyphCount)])); - if (GET_BE_WORD(positioning->PosCount)) { for (k = 0; k < GET_BE_WORD(positioning->PosCount); ++k) @@ -2288,7 +2285,7 @@ static unsigned int GPOS_apply_ChainContextPos(const ScriptCache *script_cache, GPOS_apply_lookup(script_cache, otm, logfont, analysis, advance, lookup, lookupIndex, glyphs, glyph_index + SequenceIndex, glyph_count, goffset); } - return indexGlyphs + GET_BE_WORD(lookahead->LookaheadGlyphCount); + return input_count + lookahead_count; } else return 1; }
1
0
0
0
Henri Verbeet : usp10: Rename the chaining context tables in GPOS_apply_ChainContextPos() to something more descriptive.
by Alexandre Julliard
05 Apr '17
05 Apr '17
Module: wine Branch: master Commit: fb3ea0ae05b023ce1722cfd1e698199152c8c5a1 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=fb3ea0ae05b023ce1722cfd1e…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Wed Apr 5 10:21:26 2017 +0200 usp10: Rename the chaining context tables in GPOS_apply_ChainContextPos() to something more descriptive. Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Aric Stewart <aric(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/usp10/opentype.c | 63 +++++++++++++++++++++++++++------------------------ 1 file changed, 33 insertions(+), 30 deletions(-) diff --git a/dlls/usp10/opentype.c b/dlls/usp10/opentype.c index 889aa8a..fd8fe91 100644 --- a/dlls/usp10/opentype.c +++ b/dlls/usp10/opentype.c @@ -2206,91 +2206,94 @@ static unsigned int GPOS_apply_ChainContextPos(const ScriptCache *script_cache, for (j = 0; j < GET_BE_WORD(look->SubTableCount); j++) { int offset; - const GPOS_ChainContextPosFormat3_1 *ccpf3 = (GPOS_ChainContextPosFormat3_1 *)GPOS_get_subtable(look, j); + const GPOS_ChainContextPosFormat3_1 *backtrack = (GPOS_ChainContextPosFormat3_1 *)GPOS_get_subtable(look, j); int dirLookahead = write_dir; int dirBacktrack = -1 * write_dir; - if (GET_BE_WORD(ccpf3->PosFormat) == 1) + if (GET_BE_WORD(backtrack->PosFormat) == 1) { static int once; if (!once++) FIXME(" TODO: subtype 1 (Simple Chaining Context Glyph Positioning)\n"); continue; } - else if (GET_BE_WORD(ccpf3->PosFormat) == 2) + else if (GET_BE_WORD(backtrack->PosFormat) == 2) { static int once; if (!once++) FIXME(" TODO: subtype 2 (Class-based Chaining Context Glyph Positioning)\n"); continue; } - else if (GET_BE_WORD(ccpf3->PosFormat) == 3) + else if (GET_BE_WORD(backtrack->PosFormat) == 3) { int k; int indexGlyphs; - const GPOS_ChainContextPosFormat3_2 *ccpf3_2; - const GPOS_ChainContextPosFormat3_3 *ccpf3_3; - const GPOS_ChainContextPosFormat3_4 *ccpf3_4; + const GPOS_ChainContextPosFormat3_2 *input; + const GPOS_ChainContextPosFormat3_3 *lookahead; + const GPOS_ChainContextPosFormat3_4 *positioning; TRACE(" subtype 3 (Coverage-based Chaining Context Glyph Positioning)\n"); - for (k = 0; k < GET_BE_WORD(ccpf3->BacktrackGlyphCount); k++) + for (k = 0; k < GET_BE_WORD(backtrack->BacktrackGlyphCount); ++k) { - offset = GET_BE_WORD(ccpf3->Coverage[k]); - if (GSUB_is_glyph_covered((const BYTE*)ccpf3+offset, glyphs[glyph_index + (dirBacktrack * (k+1))]) == -1) + offset = GET_BE_WORD(backtrack->Coverage[k]); + if (GSUB_is_glyph_covered((const BYTE *)backtrack + offset, + glyphs[glyph_index + (dirBacktrack * (k + 1))]) == -1) break; } - if (k != GET_BE_WORD(ccpf3->BacktrackGlyphCount)) + if (k != GET_BE_WORD(backtrack->BacktrackGlyphCount)) continue; TRACE("Matched Backtrack\n"); - ccpf3_2 = (const GPOS_ChainContextPosFormat3_2*)((BYTE *)ccpf3 + - FIELD_OFFSET(GPOS_ChainContextPosFormat3_1, Coverage[GET_BE_WORD(ccpf3->BacktrackGlyphCount)])); + input = (const GPOS_ChainContextPosFormat3_2 *)((BYTE *)backtrack + + FIELD_OFFSET(GPOS_ChainContextPosFormat3_1, Coverage[GET_BE_WORD(backtrack->BacktrackGlyphCount)])); - indexGlyphs = GET_BE_WORD(ccpf3_2->InputGlyphCount); + indexGlyphs = GET_BE_WORD(input->InputGlyphCount); for (k = 0; k < indexGlyphs; k++) { - offset = GET_BE_WORD(ccpf3_2->Coverage[k]); - if (GSUB_is_glyph_covered((const BYTE*)ccpf3+offset, glyphs[glyph_index + (write_dir * k)]) == -1) + offset = GET_BE_WORD(input->Coverage[k]); + if (GSUB_is_glyph_covered((const BYTE *)backtrack + offset, + glyphs[glyph_index + (write_dir * k)]) == -1) break; } if (k != indexGlyphs) continue; TRACE("Matched IndexGlyphs\n"); - ccpf3_3 = (const GPOS_ChainContextPosFormat3_3*)((BYTE *)ccpf3_2 + - FIELD_OFFSET(GPOS_ChainContextPosFormat3_2, Coverage[GET_BE_WORD(ccpf3_2->InputGlyphCount)])); + lookahead = (const GPOS_ChainContextPosFormat3_3 *)((BYTE *)input + + FIELD_OFFSET(GPOS_ChainContextPosFormat3_2, Coverage[GET_BE_WORD(input->InputGlyphCount)])); - for (k = 0; k < GET_BE_WORD(ccpf3_3->LookaheadGlyphCount); k++) + for (k = 0; k < GET_BE_WORD(lookahead->LookaheadGlyphCount); ++k) { - offset = GET_BE_WORD(ccpf3_3->Coverage[k]); - if (GSUB_is_glyph_covered((const BYTE*)ccpf3+offset, glyphs[glyph_index + (dirLookahead * (indexGlyphs + k))]) == -1) + offset = GET_BE_WORD(lookahead->Coverage[k]); + if (GSUB_is_glyph_covered((const BYTE *)backtrack + offset, + glyphs[glyph_index + (dirLookahead * (indexGlyphs + k))]) == -1) break; } - if (k != GET_BE_WORD(ccpf3_3->LookaheadGlyphCount)) + if (k != GET_BE_WORD(lookahead->LookaheadGlyphCount)) continue; TRACE("Matched LookAhead\n"); - ccpf3_4 = (const GPOS_ChainContextPosFormat3_4*)((BYTE *)ccpf3_3 + - FIELD_OFFSET(GPOS_ChainContextPosFormat3_3, Coverage[GET_BE_WORD(ccpf3_3->LookaheadGlyphCount)])); + positioning = (const GPOS_ChainContextPosFormat3_4 *)((BYTE *)lookahead + + FIELD_OFFSET(GPOS_ChainContextPosFormat3_3, Coverage[GET_BE_WORD(lookahead->LookaheadGlyphCount)])); - if (GET_BE_WORD(ccpf3_4->PosCount)) + if (GET_BE_WORD(positioning->PosCount)) { - for (k = 0; k < GET_BE_WORD(ccpf3_4->PosCount); k++) + for (k = 0; k < GET_BE_WORD(positioning->PosCount); ++k) { - int lookupIndex = GET_BE_WORD(ccpf3_4->PosLookupRecord[k].LookupListIndex); - int SequenceIndex = GET_BE_WORD(ccpf3_4->PosLookupRecord[k].SequenceIndex) * write_dir; + int lookupIndex = GET_BE_WORD(positioning->PosLookupRecord[k].LookupListIndex); + int SequenceIndex = GET_BE_WORD(positioning->PosLookupRecord[k].SequenceIndex) * write_dir; TRACE("Position: %i -> %i %i\n",k, SequenceIndex, lookupIndex); GPOS_apply_lookup(script_cache, otm, logfont, analysis, advance, lookup, lookupIndex, glyphs, glyph_index + SequenceIndex, glyph_count, goffset); } - return indexGlyphs + GET_BE_WORD(ccpf3_3->LookaheadGlyphCount); + return indexGlyphs + GET_BE_WORD(lookahead->LookaheadGlyphCount); } else return 1; } else - FIXME("Unhandled Chaining Contextual Positioning Format %i\n",GET_BE_WORD(ccpf3->PosFormat)); + FIXME("Unhandled Chaining Contextual Positioning Format %#x.\n", GET_BE_WORD(backtrack->PosFormat)); } return 1; }
1
0
0
0
Henri Verbeet : wined3d: Send rendertarget view clears through the command stream.
by Alexandre Julliard
05 Apr '17
05 Apr '17
Module: wine Branch: master Commit: 3e3f5e88e6aa27ce3838d0faed9de135532f10a4 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3e3f5e88e6aa27ce3838d0fae…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Wed Apr 5 10:21:25 2017 +0200 wined3d: Send rendertarget view clears through the command stream. Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/cs.c | 62 +++++++++++++++++++++++++++++++++++++----- dlls/wined3d/device.c | 16 ++--------- dlls/wined3d/wined3d_private.h | 2 ++ 3 files changed, 59 insertions(+), 21 deletions(-) diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c index 841ceca..c408eb0 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c @@ -81,6 +81,9 @@ struct wined3d_cs_clear { enum wined3d_cs_op opcode; DWORD flags; + unsigned int rt_count; + struct wined3d_fb_state *fb; + RECT draw_rect; struct wined3d_color color; float depth; DWORD stencil; @@ -420,24 +423,25 @@ static void wined3d_cs_exec_clear(struct wined3d_cs *cs, const void *data) device = cs->device; wined3d_get_draw_rect(state, &draw_rect); - device->blitter->ops->blitter_clear(device->blitter, device, device->adapter->gl_info.limits.buffers, - state->fb, op->rect_count, op->rects, &draw_rect, op->flags, &op->color, op->depth, op->stencil); + device->blitter->ops->blitter_clear(device->blitter, device, op->rt_count, op->fb, + op->rect_count, op->rects, &op->draw_rect, op->flags, &op->color, op->depth, op->stencil); if (op->flags & WINED3DCLEAR_TARGET) { - for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i) + for (i = 0; i < op->rt_count; ++i) { - if (state->fb->render_targets[i]) - wined3d_resource_release(state->fb->render_targets[i]->resource); + if (op->fb->render_targets[i]) + wined3d_resource_release(op->fb->render_targets[i]->resource); } } if (op->flags & (WINED3DCLEAR_ZBUFFER | WINED3DCLEAR_STENCIL)) - wined3d_resource_release(state->fb->depth_stencil->resource); + wined3d_resource_release(op->fb->depth_stencil->resource); } void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *rects, DWORD flags, const struct wined3d_color *color, float depth, DWORD stencil) { + unsigned int rt_count = cs->device->adapter->gl_info.limits.buffers; const struct wined3d_state *state = &cs->device->state; struct wined3d_cs_clear *op; unsigned int i; @@ -445,6 +449,9 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT * op = cs->ops->require_space(cs, FIELD_OFFSET(struct wined3d_cs_clear, rects[rect_count])); op->opcode = WINED3D_CS_OP_CLEAR; op->flags = flags; + op->rt_count = rt_count; + op->fb = &cs->fb; + wined3d_get_draw_rect(state, &op->draw_rect); op->color = *color; op->depth = depth; op->stencil = stencil; @@ -453,7 +460,7 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT * if (flags & WINED3DCLEAR_TARGET) { - for (i = 0; i < cs->device->adapter->gl_info.limits.buffers; ++i) + for (i = 0; i < rt_count; ++i) { if (state->fb->render_targets[i]) wined3d_resource_acquire(state->fb->render_targets[i]->resource); @@ -465,6 +472,47 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT * cs->ops->submit(cs); } +void wined3d_cs_emit_clear_rendertarget_view(struct wined3d_cs *cs, struct wined3d_rendertarget_view *view, + const RECT *rect, DWORD flags, const struct wined3d_color *color, float depth, DWORD stencil) +{ + struct wined3d_cs_clear *op; + struct + { + struct wined3d_rendertarget_view *rt; + struct wined3d_fb_state fb; + } *extra; + + op = cs->ops->require_space(cs, FIELD_OFFSET(struct wined3d_cs_clear, rects[1]) + sizeof(*extra)); + extra = (void *)&op->rects[1]; + extra->fb.render_targets = &extra->rt; + op->fb = &extra->fb; + + op->opcode = WINED3D_CS_OP_CLEAR; + op->flags = flags; + if (flags & WINED3DCLEAR_TARGET) + { + op->rt_count = 1; + op->fb->render_targets[0] = view; + op->fb->depth_stencil = NULL; + op->color = *color; + } + else + { + op->rt_count = 0; + op->fb->render_targets[0] = NULL; + op->fb->depth_stencil = view; + op->depth = depth; + op->stencil = stencil; + } + SetRect(&op->draw_rect, 0, 0, view->width, view->height); + op->rect_count = 1; + op->rects[0] = *rect; + + wined3d_resource_acquire(view->resource); + + cs->ops->submit(cs); +} + static void acquire_shader_resources(const struct wined3d_state *state, unsigned int shader_mask) { struct wined3d_shader_sampler_map_entry *entry; diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 11a56f2..ffc99b1 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -4148,7 +4148,7 @@ HRESULT CDECL wined3d_device_clear_rendertarget_view(struct wined3d_device *devi const struct wined3d_color *color, float depth, DWORD stencil) { struct wined3d_resource *resource; - RECT draw_rect, r; + RECT r; TRACE("device %p, view %p, rect %s, flags %#x, color %s, depth %.8e, stencil %u.\n", device, view, wine_dbgstr_rect(rect), flags, debug_color(color), depth, stencil); @@ -4185,19 +4185,7 @@ HRESULT CDECL wined3d_device_clear_rendertarget_view(struct wined3d_device *devi return hr; } - SetRect(&draw_rect, 0, 0, view->width, view->height); - if (flags == WINED3DCLEAR_TARGET) - { - struct wined3d_fb_state fb = {&view, NULL}; - device->blitter->ops->blitter_clear(device->blitter, device, 1, &fb, - 1, rect, &draw_rect, flags, color, depth, stencil); - } - else - { - struct wined3d_fb_state fb = {NULL, view}; - device->blitter->ops->blitter_clear(device->blitter, device, 0, &fb, - 1, rect, &draw_rect, flags, color, depth, stencil); - } + wined3d_cs_emit_clear_rendertarget_view(device->cs, view, rect, flags, color, depth, stencil); return WINED3D_OK; } diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 4acb94f..82aecf7 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -3228,6 +3228,8 @@ void wined3d_cs_emit_blt_sub_resource(struct wined3d_cs *cs, struct wined3d_reso const struct wined3d_blt_fx *fx, enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN; void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *rects, DWORD flags, const struct wined3d_color *color, float depth, DWORD stencil) DECLSPEC_HIDDEN; +void wined3d_cs_emit_clear_rendertarget_view(struct wined3d_cs *cs, struct wined3d_rendertarget_view *view, + const RECT *rect, DWORD flags, const struct wined3d_color *color, float depth, DWORD stencil) DECLSPEC_HIDDEN; void wined3d_cs_emit_dispatch(struct wined3d_cs *cs, unsigned int group_count_x, unsigned int group_count_y, unsigned int group_count_z) DECLSPEC_HIDDEN; void wined3d_cs_emit_draw(struct wined3d_cs *cs, GLenum primitive_type, int base_vertex_idx,
1
0
0
0
Nikolay Sivov : dwrite: Fix explicit levels returned for LRE and RLE control characters.
by Alexandre Julliard
05 Apr '17
05 Apr '17
Module: wine Branch: master Commit: abfc973c85290d8c30bf0c7d19b03a2ef85e7208 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=abfc973c85290d8c30bf0c7d1…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Wed Apr 5 11:56:06 2017 +0300 dwrite: Fix explicit levels returned for LRE and RLE control characters. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dwrite/bidi.c | 4 ++-- dlls/dwrite/tests/analyzer.c | 6 ------ dlls/dwrite/tests/layout.c | 2 +- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/dlls/dwrite/bidi.c b/dlls/dwrite/bidi.c index 3a7367e..d4ee2ca 100644 --- a/dlls/dwrite/bidi.c +++ b/dlls/dwrite/bidi.c @@ -278,7 +278,7 @@ static void bidi_resolve_explicit(UINT8 baselevel, UINT8 *classes, UINT8 *levels /* X2 */ case RLE: least_odd = get_greater_odd_level(stack[stack_top].level); - levels[i] = stack[stack_top].level; + levels[i] = valid_level(least_odd) ? least_odd : stack[stack_top].level; if (valid_level(least_odd)) push_stack(least_odd, NI, FALSE); else if (overflow_isolate_count == 0) @@ -288,7 +288,7 @@ static void bidi_resolve_explicit(UINT8 baselevel, UINT8 *classes, UINT8 *levels /* X3 */ case LRE: least_even = get_greater_even_level(stack[stack_top].level); - levels[i] = stack[stack_top].level; + levels[i] = valid_level(least_even) ? least_even : stack[stack_top].level; if (valid_level(least_even)) push_stack(least_even, NI, FALSE); else if (overflow_isolate_count == 0) diff --git a/dlls/dwrite/tests/analyzer.c b/dlls/dwrite/tests/analyzer.c index 7af19d7..2e2a2e9 100644 --- a/dlls/dwrite/tests/analyzer.c +++ b/dlls/dwrite/tests/analyzer.c @@ -2282,42 +2282,36 @@ static const struct bidi_test bidi_tests[] = { DWRITE_READING_DIRECTION_LEFT_TO_RIGHT, { 2, 2, 0, 0 }, { 0, 0, 0, 0 }, - TRUE }, { { 'a', LRE, PDF, 'b', 0 }, DWRITE_READING_DIRECTION_LEFT_TO_RIGHT, { 0, 2, 2, 0 }, { 0, 0, 0, 0 }, - TRUE }, { { RLE, PDF, 'a', 'b', 0 }, DWRITE_READING_DIRECTION_LEFT_TO_RIGHT, { 1, 1, 0, 0 }, { 0, 0, 0, 0 }, - TRUE }, { { 'a', RLE, PDF, 'b', 0 }, DWRITE_READING_DIRECTION_LEFT_TO_RIGHT, { 0, 1, 1, 0 }, { 0, 0, 0, 0 }, - TRUE }, { { 'a', RLE, PDF, 'b', 0 }, DWRITE_READING_DIRECTION_RIGHT_TO_LEFT, { 1, 3, 3, 1 }, { 2, 2, 2, 2 }, - TRUE }, { { LRE, PDF, 'a', 'b', 0 }, DWRITE_READING_DIRECTION_RIGHT_TO_LEFT, { 2, 2, 1, 1 }, { 1, 1, 2, 2 }, - TRUE }, { { PDF, 'a', 'b', 0 }, diff --git a/dlls/dwrite/tests/layout.c b/dlls/dwrite/tests/layout.c index ecc57df..38b818c 100644 --- a/dlls/dwrite/tests/layout.c +++ b/dlls/dwrite/tests/layout.c @@ -1648,7 +1648,7 @@ todo_wine flush_sequence(sequences, RENDERER_ID); hr = IDWriteTextLayout_Draw(layout, &ctxt, &testrenderer, 0.0, 0.0); ok(hr == S_OK, "got 0x%08x\n", hr); - ok_sequence(sequences, RENDERER_ID, draw_seq3, "draw test 3", TRUE); + ok_sequence(sequences, RENDERER_ID, draw_seq3, "draw test 3", FALSE); IDWriteTextLayout_Release(layout); /* strikethrough splits ranges from renderer point of view, but doesn't break
1
0
0
0
← Newer
1
...
64
65
66
67
68
69
70
...
76
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
Results per page:
10
25
50
100
200