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
March 2013
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
2 participants
531 discussions
Start a n
N
ew thread
Andrew Talbot : winhttp: Avoid signed-unsigned integer comparisons.
by Alexandre Julliard
06 Mar '13
06 Mar '13
Module: wine Branch: master Commit: a9983e6cd20d1c6423915ddc7397056839dba7f6 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a9983e6cd20d1c6423915ddc7…
Author: Andrew Talbot <andrew.talbot(a)talbotville.com> Date: Tue Mar 5 22:52:21 2013 +0000 winhttp: Avoid signed-unsigned integer comparisons. --- dlls/winhttp/net.c | 2 +- dlls/winhttp/request.c | 4 ++-- dlls/winhttp/session.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/dlls/winhttp/net.c b/dlls/winhttp/net.c index fa8cad0..5ce7683 100644 --- a/dlls/winhttp/net.c +++ b/dlls/winhttp/net.c @@ -568,7 +568,7 @@ static BOOL read_ssl_chunk(netconn_t *conn, void *buf, SIZE_T buf_size, SIZE_T * SecBuffer bufs[4]; SecBufferDesc buf_desc = {SECBUFFER_VERSION, sizeof(bufs)/sizeof(*bufs), bufs}; SSIZE_T size, buf_len; - int i; + unsigned int i; SECURITY_STATUS res; assert(conn->extra_len < ssl_buf_size); diff --git a/dlls/winhttp/request.c b/dlls/winhttp/request.c index cd583e7..e2c3734 100644 --- a/dlls/winhttp/request.c +++ b/dlls/winhttp/request.c @@ -2935,9 +2935,9 @@ static HRESULT request_send( struct winhttp_request *request ) VariantInit( &data ); if (V_VT( &request->data ) == VT_BSTR) { - UINT i, cp = CP_ACP; + UINT cp = CP_ACP; const WCHAR *str = V_BSTR( &request->data ); - int len = strlenW( str ); + int i, len = strlenW( str ); for (i = 0; i < len; i++) { diff --git a/dlls/winhttp/session.c b/dlls/winhttp/session.c index 41b266a..d43b225 100644 --- a/dlls/winhttp/session.c +++ b/dlls/winhttp/session.c @@ -878,7 +878,7 @@ static const object_vtbl_t request_vtbl = static BOOL store_accept_types( request_t *request, const WCHAR **accept_types ) { const WCHAR **types = accept_types; - int i; + DWORD i; if (!types) return TRUE; while (*types) @@ -897,7 +897,7 @@ static BOOL store_accept_types( request_t *request, const WCHAR **accept_types ) { if (!(request->accept_types[i] = strdupW( *types ))) { - for (; i >= 0; i--) heap_free( request->accept_types[i] ); + for ( ; i > 0; --i) heap_free( request->accept_types[i - 1] ); heap_free( request->accept_types ); request->accept_types = NULL; request->num_accept_types = 0;
1
0
0
0
Piotr Caban : ieframe: Pass BSTR to handle_navigation_error.
by Alexandre Julliard
05 Mar '13
05 Mar '13
Module: wine Branch: master Commit: 402b10013f7082d8578e55dedb19b5e5ecfc0e69 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=402b10013f7082d8578e55ded…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Tue Mar 5 16:17:57 2013 +0100 ieframe: Pass BSTR to handle_navigation_error. --- dlls/ieframe/navigate.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dlls/ieframe/navigate.c b/dlls/ieframe/navigate.c index 2601ba8..3a35acf 100644 --- a/dlls/ieframe/navigate.c +++ b/dlls/ieframe/navigate.c @@ -45,7 +45,7 @@ typedef struct { DocHost *doc_host; IBinding *binding; - LPWSTR url; + BSTR url; HGLOBAL post_data; BSTR headers; ULONG post_data_len; @@ -206,7 +206,7 @@ static ULONG WINAPI BindStatusCallback_Release(IBindStatusCallback *iface) if(This->post_data) GlobalFree(This->post_data); SysFreeString(This->headers); - heap_free(This->url); + SysFreeString(This->url); heap_free(This); } @@ -543,7 +543,7 @@ static BindStatusCallback *create_callback(DocHost *doc_host, LPCWSTR url, PBYTE ret->IHttpSecurity_iface.lpVtbl = &HttpSecurityVtbl; ret->ref = 1; - ret->url = heap_strdupW(url); + ret->url = SysAllocString(url); ret->post_data = NULL; ret->post_data_len = post_data_len; ret->headers = headers ? SysAllocString(headers) : NULL;
1
0
0
0
Francois Gouget : inetcomm: Make mimebody_create() static.
by Alexandre Julliard
05 Mar '13
05 Mar '13
Module: wine Branch: master Commit: d5a4621bd6cfc002b978534ae490ba059d0cb319 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d5a4621bd6cfc002b978534ae…
Author: Francois Gouget <fgouget(a)free.fr> Date: Tue Mar 5 12:15:44 2013 +0100 inetcomm: Make mimebody_create() static. --- dlls/inetcomm/mimeole.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/dlls/inetcomm/mimeole.c b/dlls/inetcomm/mimeole.c index 4c61f72..38acd49 100644 --- a/dlls/inetcomm/mimeole.c +++ b/dlls/inetcomm/mimeole.c @@ -1094,7 +1094,7 @@ static HRESULT MimeBody_set_offsets(MimeBody *body, const BODYOFFSETS *offsets) #define FIRST_CUSTOM_PROP_ID 0x100 -MimeBody *mimebody_create(void) +static MimeBody *mimebody_create(void) { MimeBody *This; BODYOFFSETS body_offsets;
1
0
0
0
Hans Leidekker : winhttp: Make sure to clear response headers from a previous request.
by Alexandre Julliard
05 Mar '13
05 Mar '13
Module: wine Branch: master Commit: 71874a38aac99d992c0569a4e45d5570de8d3599 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=71874a38aac99d992c0569a4e…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Tue Mar 5 12:15:54 2013 +0100 winhttp: Make sure to clear response headers from a previous request. --- dlls/winhttp/request.c | 32 ++++++++++++++++---------------- 1 files changed, 16 insertions(+), 16 deletions(-) diff --git a/dlls/winhttp/request.c b/dlls/winhttp/request.c index c07c613..cd583e7 100644 --- a/dlls/winhttp/request.c +++ b/dlls/winhttp/request.c @@ -1038,6 +1038,20 @@ static BOOL add_host_header( request_t *request, DWORD modifier ) return ret; } +static void clear_response_headers( request_t *request ) +{ + unsigned int i; + + for (i = 0; i < request->num_headers; i++) + { + if (!request->headers[i].field) continue; + if (!request->headers[i].value) continue; + if (request->headers[i].is_request) continue; + delete_header( request, i ); + i--; + } +} + static BOOL send_request( request_t *request, LPCWSTR headers, DWORD headers_len, LPVOID optional, DWORD optional_len, DWORD total_len, DWORD_PTR context, BOOL async ) { @@ -1053,6 +1067,8 @@ static BOOL send_request( request_t *request, LPCWSTR headers, DWORD headers_len int bytes_sent; DWORD len, i, flags; + clear_response_headers( request ); + flags = WINHTTP_ADDREQ_FLAG_ADD|WINHTTP_ADDREQ_FLAG_COALESCE_WITH_COMMA; for (i = 0; i < request->num_accept_types; i++) { @@ -1457,20 +1473,6 @@ static BOOL handle_authorization( request_t *request, DWORD status ) return FALSE; } -static void clear_response_headers( request_t *request ) -{ - unsigned int i; - - for (i = 0; i < request->num_headers; i++) - { - if (!request->headers[i].field) continue; - if (!request->headers[i].value) continue; - if (request->headers[i].is_request) continue; - delete_header( request, i ); - i--; - } -} - #define MAX_REPLY_LEN 1460 #define INITIAL_HEADER_BUFFER_LEN 512 @@ -1897,7 +1899,6 @@ static BOOL receive_response( request_t *request, BOOL async ) if (!(ret = handle_redirect( request, status ))) break; - clear_response_headers( request ); send_request( request, NULL, 0, NULL, 0, 0, 0, FALSE ); /* recurse synchronously */ continue; } @@ -1911,7 +1912,6 @@ static BOOL receive_response( request_t *request, BOOL async ) ret = TRUE; break; } - clear_response_headers( request ); send_request( request, NULL, 0, NULL, 0, 0, 0, FALSE ); continue; }
1
0
0
0
Hans Leidekker : winhttp: Implement WINHTTP_OPTION_REDIRECT_POLICY_DISALLOW_HTTPS_TO_HTTP.
by Alexandre Julliard
05 Mar '13
05 Mar '13
Module: wine Branch: master Commit: 418d2ce5232a48b909084a0a93b2daeff8e8ebfc URL:
http://source.winehq.org/git/wine.git/?a=commit;h=418d2ce5232a48b909084a0a9…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Tue Mar 5 12:15:22 2013 +0100 winhttp: Implement WINHTTP_OPTION_REDIRECT_POLICY_DISALLOW_HTTPS_TO_HTTP. --- dlls/winhttp/request.c | 218 ++++++++++++++++++++++++----------------------- 1 files changed, 111 insertions(+), 107 deletions(-) diff --git a/dlls/winhttp/request.c b/dlls/winhttp/request.c index 12b1f25..c07c613 100644 --- a/dlls/winhttp/request.c +++ b/dlls/winhttp/request.c @@ -1574,112 +1574,6 @@ end: return TRUE; } -static WCHAR *get_redirect_url( request_t *request, DWORD *len ) -{ - DWORD size; - WCHAR *ret; - - query_headers( request, WINHTTP_QUERY_LOCATION, NULL, NULL, &size, NULL ); - if (get_last_error() != ERROR_INSUFFICIENT_BUFFER) return FALSE; - if (!(ret = heap_alloc( size ))) return NULL; - *len = size / sizeof(WCHAR); - if (query_headers( request, WINHTTP_QUERY_LOCATION, NULL, ret, &size, NULL )) return ret; - heap_free( ret ); - return NULL; -} - -static BOOL handle_redirect( request_t *request, DWORD status ) -{ - BOOL ret = FALSE; - DWORD len; - URL_COMPONENTS uc; - connect_t *connect = request->connect; - INTERNET_PORT port; - WCHAR *hostname = NULL, *location; - int index; - - if (!(location = get_redirect_url( request, &len ))) return FALSE; - - send_callback( &request->hdr, WINHTTP_CALLBACK_STATUS_REDIRECT, location, len + 1 ); - - memset( &uc, 0, sizeof(uc) ); - uc.dwStructSize = sizeof(uc); - uc.dwSchemeLength = uc.dwHostNameLength = uc.dwUrlPathLength = uc.dwExtraInfoLength = ~0u; - - if (!WinHttpCrackUrl( location, len, 0, &uc )) /* assume relative redirect */ - { - WCHAR *path, *p; - - len = strlenW( location ) + 1; - if (location[0] != '/') len++; - if (!(p = path = heap_alloc( len * sizeof(WCHAR) ))) goto end; - - if (location[0] != '/') *p++ = '/'; - strcpyW( p, location ); - - heap_free( request->path ); - request->path = path; - } - else - { - if (uc.nScheme == INTERNET_SCHEME_HTTP && request->hdr.flags & WINHTTP_FLAG_SECURE) - { - TRACE("redirect from secure page to non-secure page\n"); - request->hdr.flags &= ~WINHTTP_FLAG_SECURE; - } - else if (uc.nScheme == INTERNET_SCHEME_HTTPS && !(request->hdr.flags & WINHTTP_FLAG_SECURE)) - { - TRACE("redirect from non-secure page to secure page\n"); - request->hdr.flags |= WINHTTP_FLAG_SECURE; - } - - len = uc.dwHostNameLength; - if (!(hostname = heap_alloc( (len + 1) * sizeof(WCHAR) ))) goto end; - memcpy( hostname, uc.lpszHostName, len * sizeof(WCHAR) ); - hostname[len] = 0; - - port = uc.nPort ? uc.nPort : (uc.nScheme == INTERNET_SCHEME_HTTPS ? 443 : 80); - if (strcmpiW( connect->hostname, hostname ) || connect->serverport != port) - { - heap_free( connect->hostname ); - connect->hostname = hostname; - connect->hostport = port; - if (!(ret = set_server_for_hostname( connect, hostname, port ))) goto end; - - netconn_close( &request->netconn ); - if (!(ret = netconn_init( &request->netconn ))) goto end; - } - if (!(ret = add_host_header( request, WINHTTP_ADDREQ_FLAG_REPLACE ))) goto end; - if (!(ret = open_connection( request ))) goto end; - - heap_free( request->path ); - request->path = NULL; - if (uc.dwUrlPathLength) - { - len = uc.dwUrlPathLength + uc.dwExtraInfoLength; - if (!(request->path = heap_alloc( (len + 1) * sizeof(WCHAR) ))) goto end; - strcpyW( request->path, uc.lpszUrlPath ); - } - else request->path = strdupW( slashW ); - } - - /* remove content-type/length headers */ - if ((index = get_header_index( request, attr_content_type, 0, TRUE )) >= 0) delete_header( request, index ); - if ((index = get_header_index( request, attr_content_length, 0, TRUE )) >= 0 ) delete_header( request, index ); - - if (status != HTTP_STATUS_REDIRECT_KEEP_VERB && !strcmpW( request->verb, postW )) - { - heap_free( request->verb ); - request->verb = strdupW( getW ); - } - ret = TRUE; - -end: - if (!ret) heap_free( hostname ); - heap_free( location ); - return ret; -} - static BOOL receive_data( request_t *request, void *buffer, DWORD size, DWORD *read, BOOL async ) { DWORD to_read; @@ -1862,6 +1756,117 @@ static void record_cookies( request_t *request ) } } +static WCHAR *get_redirect_url( request_t *request, DWORD *len ) +{ + DWORD size; + WCHAR *ret; + + query_headers( request, WINHTTP_QUERY_LOCATION, NULL, NULL, &size, NULL ); + if (get_last_error() != ERROR_INSUFFICIENT_BUFFER) return FALSE; + if (!(ret = heap_alloc( size ))) return NULL; + *len = size / sizeof(WCHAR); + if (query_headers( request, WINHTTP_QUERY_LOCATION, NULL, ret, &size, NULL )) return ret; + heap_free( ret ); + return NULL; +} + +static BOOL handle_redirect( request_t *request, DWORD status ) +{ + BOOL ret = FALSE; + DWORD len, len_url; + URL_COMPONENTS uc; + connect_t *connect = request->connect; + INTERNET_PORT port; + WCHAR *hostname = NULL, *location; + int index; + + if (!(location = get_redirect_url( request, &len_url ))) return FALSE; + + memset( &uc, 0, sizeof(uc) ); + uc.dwStructSize = sizeof(uc); + uc.dwSchemeLength = uc.dwHostNameLength = uc.dwUrlPathLength = uc.dwExtraInfoLength = ~0u; + + if (!WinHttpCrackUrl( location, len_url, 0, &uc )) /* assume relative redirect */ + { + WCHAR *path, *p; + + len = strlenW( location ) + 1; + if (location[0] != '/') len++; + if (!(p = path = heap_alloc( len * sizeof(WCHAR) ))) goto end; + + if (location[0] != '/') *p++ = '/'; + strcpyW( p, location ); + + heap_free( request->path ); + request->path = path; + + drain_content( request ); + send_callback( &request->hdr, WINHTTP_CALLBACK_STATUS_REDIRECT, location, len_url + 1 ); + } + else + { + if (uc.nScheme == INTERNET_SCHEME_HTTP && request->hdr.flags & WINHTTP_FLAG_SECURE) + { + if (request->hdr.redirect_policy == WINHTTP_OPTION_REDIRECT_POLICY_DISALLOW_HTTPS_TO_HTTP) goto end; + TRACE("redirect from secure page to non-secure page\n"); + request->hdr.flags &= ~WINHTTP_FLAG_SECURE; + } + else if (uc.nScheme == INTERNET_SCHEME_HTTPS && !(request->hdr.flags & WINHTTP_FLAG_SECURE)) + { + TRACE("redirect from non-secure page to secure page\n"); + request->hdr.flags |= WINHTTP_FLAG_SECURE; + } + + drain_content( request ); + send_callback( &request->hdr, WINHTTP_CALLBACK_STATUS_REDIRECT, location, len_url + 1 ); + + len = uc.dwHostNameLength; + if (!(hostname = heap_alloc( (len + 1) * sizeof(WCHAR) ))) goto end; + memcpy( hostname, uc.lpszHostName, len * sizeof(WCHAR) ); + hostname[len] = 0; + + port = uc.nPort ? uc.nPort : (uc.nScheme == INTERNET_SCHEME_HTTPS ? 443 : 80); + if (strcmpiW( connect->hostname, hostname ) || connect->serverport != port) + { + heap_free( connect->hostname ); + connect->hostname = hostname; + connect->hostport = port; + if (!(ret = set_server_for_hostname( connect, hostname, port ))) goto end; + + netconn_close( &request->netconn ); + if (!(ret = netconn_init( &request->netconn ))) goto end; + } + if (!(ret = add_host_header( request, WINHTTP_ADDREQ_FLAG_REPLACE ))) goto end; + if (!(ret = open_connection( request ))) goto end; + + heap_free( request->path ); + request->path = NULL; + if (uc.dwUrlPathLength) + { + len = uc.dwUrlPathLength + uc.dwExtraInfoLength; + if (!(request->path = heap_alloc( (len + 1) * sizeof(WCHAR) ))) goto end; + strcpyW( request->path, uc.lpszUrlPath ); + } + else request->path = strdupW( slashW ); + } + + /* remove content-type/length headers */ + if ((index = get_header_index( request, attr_content_type, 0, TRUE )) >= 0) delete_header( request, index ); + if ((index = get_header_index( request, attr_content_length, 0, TRUE )) >= 0 ) delete_header( request, index ); + + if (status != HTTP_STATUS_REDIRECT_KEEP_VERB && !strcmpW( request->verb, postW )) + { + heap_free( request->verb ); + request->verb = strdupW( getW ); + } + ret = TRUE; + +end: + if (!ret) heap_free( hostname ); + heap_free( location ); + return ret; +} + static BOOL receive_response( request_t *request, BOOL async ) { BOOL ret; @@ -1890,7 +1895,6 @@ static BOOL receive_response( request_t *request, BOOL async ) if (request->hdr.disable_flags & WINHTTP_DISABLE_REDIRECTS || request->hdr.redirect_policy == WINHTTP_OPTION_REDIRECT_POLICY_NEVER) break; - drain_content( request ); if (!(ret = handle_redirect( request, status ))) break; clear_response_headers( request );
1
0
0
0
Hans Leidekker : winhttp: Add a helper to retrieve the redirect URL.
by Alexandre Julliard
05 Mar '13
05 Mar '13
Module: wine Branch: master Commit: e56cb72cd336044088309dd9b4c1803acfc5244e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e56cb72cd336044088309dd9b…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Tue Mar 5 12:14:50 2013 +0100 winhttp: Add a helper to retrieve the redirect URL. --- dlls/winhttp/request.c | 27 +++++++++++++++++++-------- 1 files changed, 19 insertions(+), 8 deletions(-) diff --git a/dlls/winhttp/request.c b/dlls/winhttp/request.c index 9915a43..12b1f25 100644 --- a/dlls/winhttp/request.c +++ b/dlls/winhttp/request.c @@ -1574,28 +1574,39 @@ end: return TRUE; } +static WCHAR *get_redirect_url( request_t *request, DWORD *len ) +{ + DWORD size; + WCHAR *ret; + + query_headers( request, WINHTTP_QUERY_LOCATION, NULL, NULL, &size, NULL ); + if (get_last_error() != ERROR_INSUFFICIENT_BUFFER) return FALSE; + if (!(ret = heap_alloc( size ))) return NULL; + *len = size / sizeof(WCHAR); + if (query_headers( request, WINHTTP_QUERY_LOCATION, NULL, ret, &size, NULL )) return ret; + heap_free( ret ); + return NULL; +} + static BOOL handle_redirect( request_t *request, DWORD status ) { BOOL ret = FALSE; - DWORD size, len; + DWORD len; URL_COMPONENTS uc; connect_t *connect = request->connect; INTERNET_PORT port; - WCHAR *hostname = NULL, *location = NULL; + WCHAR *hostname = NULL, *location; int index; - size = 0; - query_headers( request, WINHTTP_QUERY_LOCATION, NULL, NULL, &size, NULL ); - if (!(location = heap_alloc( size ))) return FALSE; - if (!query_headers( request, WINHTTP_QUERY_LOCATION, NULL, location, &size, NULL )) goto end; + if (!(location = get_redirect_url( request, &len ))) return FALSE; - send_callback( &request->hdr, WINHTTP_CALLBACK_STATUS_REDIRECT, location, size / sizeof(WCHAR) + 1 ); + send_callback( &request->hdr, WINHTTP_CALLBACK_STATUS_REDIRECT, location, len + 1 ); memset( &uc, 0, sizeof(uc) ); uc.dwStructSize = sizeof(uc); uc.dwSchemeLength = uc.dwHostNameLength = uc.dwUrlPathLength = uc.dwExtraInfoLength = ~0u; - if (!WinHttpCrackUrl( location, size / sizeof(WCHAR), 0, &uc )) /* assume relative redirect */ + if (!WinHttpCrackUrl( location, len, 0, &uc )) /* assume relative redirect */ { WCHAR *path, *p;
1
0
0
0
Hans Leidekker : winhttp: Use symbolic constants for HTTP status codes.
by Alexandre Julliard
05 Mar '13
05 Mar '13
Module: wine Branch: master Commit: 58e7d39c7fae38766013453eb690fa5c6456bfe7 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=58e7d39c7fae38766013453eb…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Tue Mar 5 12:14:25 2013 +0100 winhttp: Use symbolic constants for HTTP status codes. --- dlls/winhttp/request.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dlls/winhttp/request.c b/dlls/winhttp/request.c index 301478d..9915a43 100644 --- a/dlls/winhttp/request.c +++ b/dlls/winhttp/request.c @@ -1422,12 +1422,12 @@ static BOOL handle_authorization( request_t *request, DWORD status ) switch (status) { - case 401: + case HTTP_STATUS_DENIED: target = WINHTTP_AUTH_TARGET_SERVER; level = WINHTTP_QUERY_WWW_AUTHENTICATE; break; - case 407: + case HTTP_STATUS_PROXY_AUTH_REQ: target = WINHTTP_AUTH_TARGET_PROXY; level = WINHTTP_QUERY_PROXY_AUTHENTICATE; break; @@ -1886,7 +1886,7 @@ static BOOL receive_response( request_t *request, BOOL async ) send_request( request, NULL, 0, NULL, 0, 0, 0, FALSE ); /* recurse synchronously */ continue; } - else if (status == 401 || status == 407) + else if (status == HTTP_STATUS_DENIED || status == HTTP_STATUS_PROXY_AUTH_REQ) { if (request->hdr.disable_flags & WINHTTP_DISABLE_AUTHENTICATION) break;
1
0
0
0
Piotr Caban : msvcr90: Check more fields in _getptd tests.
by Alexandre Julliard
05 Mar '13
05 Mar '13
Module: wine Branch: master Commit: d36c6452ce011e3ac2d0c71464907388323bf45b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d36c6452ce011e3ac2d0c7146…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Tue Mar 5 11:06:08 2013 +0100 msvcr90: Check more fields in _getptd tests. --- dlls/msvcr90/tests/msvcr90.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/dlls/msvcr90/tests/msvcr90.c b/dlls/msvcr90/tests/msvcr90.c index f1ac539..fe3fa58 100644 --- a/dlls/msvcr90/tests/msvcr90.c +++ b/dlls/msvcr90/tests/msvcr90.c @@ -117,6 +117,7 @@ static int (__cdecl *p_feof)(FILE*); static int (__cdecl *p_ferror)(FILE*); static int (__cdecl *p_flsbuf)(int, FILE*); static unsigned long (__cdecl *p_byteswap_ulong)(unsigned long); +static void** (__cdecl *p__pxcptinfoptrs)(void); /* make sure we use the correct errno */ #undef errno @@ -302,6 +303,7 @@ static BOOL init(void) SET(p_ferror, "ferror"); SET(p_flsbuf, "_flsbuf"); SET(p_byteswap_ulong, "_byteswap_ulong"); + SET(p__pxcptinfoptrs, "__pxcptinfoptrs"); if (sizeof(void *) == 8) { SET(p_type_info_name_internal_method, "?_name_internal_method@type_info@@QEBAPEBDPEAU__type_info_node@@@Z"); @@ -1015,7 +1017,8 @@ struct __thread_data { struct tm *time_buffer; char *efcvt_buffer; int unk3[2]; - void *unk4[4]; + void *unk4[3]; + EXCEPTION_POINTERS *xcptinfo; int fpecode; pthreadmbcinfo mbcinfo; pthreadlocinfo locinfo; @@ -1060,6 +1063,7 @@ static void test_getptd(void) ok(p_wasctime(&time) == ptd->wasctime_buffer, "ptd->wasctime_buffer is incorrect\n"); ok(p_localtime64(&secs) == ptd->time_buffer, "ptd->time_buffer is incorrect\n"); ok(p_ecvt(3.12, 1, &dec, &sign) == ptd->efcvt_buffer, "ptd->efcvt_buffer is incorrect\n"); + ok(p__pxcptinfoptrs() == (void**)&ptd->xcptinfo, "ptd->xcptinfo is incorrect\n"); ok(p_fpecode() == &ptd->fpecode, "ptd->fpecode is incorrect\n"); mbcinfo = ptd->mbcinfo; locinfo = ptd->locinfo;
1
0
0
0
Piotr Caban : msvcrt: Added __pxcptinfoptrs tests.
by Alexandre Julliard
05 Mar '13
05 Mar '13
Module: wine Branch: master Commit: d989e92c3e2ffd666b14a0aa779b88b66fcf7602 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d989e92c3e2ffd666b14a0aa7…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Tue Mar 5 11:05:57 2013 +0100 msvcrt: Added __pxcptinfoptrs tests. --- dlls/msvcrt/tests/signal.c | 32 ++++++++++++++++++++++++++++++++ 1 files changed, 32 insertions(+), 0 deletions(-) diff --git a/dlls/msvcrt/tests/signal.c b/dlls/msvcrt/tests/signal.c index d33498b..ad6ea6e 100644 --- a/dlls/msvcrt/tests/signal.c +++ b/dlls/msvcrt/tests/signal.c @@ -26,6 +26,13 @@ static int test_value = 0; static void __cdecl sighandler(int signum) { + void **ret = __pxcptinfoptrs(); + + ok(ret != NULL, "ret = NULL\n"); + if(signum == SIGABRT) + ok(*ret == (void*)0xdeadbeef, "*ret = %p\n", *ret); + else if(signum == SIGSEGV) + ok(*ret == NULL, "*ret = %p\n", *ret); ++test_value; } @@ -42,7 +49,32 @@ static void test_signal(void) ok(test_value == 1, "SIGBREAK handler not invoked\n"); } +static void test___pxcptinfoptrs(void) +{ + void **ret = __pxcptinfoptrs(); + int res; + + ok(ret != NULL, "ret == NULL\n"); + ok(*ret == NULL, "*ret != NULL\n"); + + test_value = 0; + + *ret = (void*)0xdeadbeef; + signal(SIGSEGV, sighandler); + res = raise(SIGSEGV); + ok(res == 0, "failed to raise SIGSEGV\n"); + ok(*ret == (void*)0xdeadbeef, "*ret = %p\n", *ret); + + signal(SIGABRT, sighandler); + res = raise(SIGABRT); + ok(res == 0, "failed to raise SIGBREAK\n"); + ok(*ret == (void*)0xdeadbeef, "*ret = %p\n", *ret); + + ok(test_value == 2, "test_value = %d\n", test_value); +} + START_TEST(signal) { test_signal(); + test___pxcptinfoptrs(); }
1
0
0
0
Piotr Caban : msvcrt: Added __pxcptinfoptrs implementation.
by Alexandre Julliard
05 Mar '13
05 Mar '13
Module: wine Branch: master Commit: 14a81773c7ce865dd6d919ddee89cad301985ab2 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=14a81773c7ce865dd6d919dde…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Tue Mar 5 11:05:42 2013 +0100 msvcrt: Added __pxcptinfoptrs implementation. --- dlls/msvcrt/except.c | 45 +++++++++++++++++++++++++++++++++++++++++---- dlls/msvcrt/msvcrt.h | 3 ++- dlls/msvcrt/msvcrt.spec | 2 +- include/msvcrt/signal.h | 1 + 4 files changed, 45 insertions(+), 6 deletions(-) diff --git a/dlls/msvcrt/except.c b/dlls/msvcrt/except.c index c96623c..32cf3b0 100644 --- a/dlls/msvcrt/except.c +++ b/dlls/msvcrt/except.c @@ -61,6 +61,14 @@ static BOOL WINAPI msvcrt_console_handler(DWORD ctrlType) return ret; } +/********************************************************************* + * __pxcptinfoptrs (MSVCRT.@) + */ +void** CDECL MSVCRT___pxcptinfoptrs(void) +{ + return (void**)&msvcrt_get_thread_data()->xcptinfo; +} + typedef void (CDECL *float_handler)(int, int); /* The exception codes are actually NTSTATUS values */ @@ -93,8 +101,13 @@ static LONG WINAPI msvcrt_exception_filter(struct _EXCEPTION_POINTERS *except) { if (handler != MSVCRT_SIG_IGN) { + EXCEPTION_POINTERS **ep = (EXCEPTION_POINTERS**)MSVCRT___pxcptinfoptrs(), *old_ep; + + old_ep = *ep; + *ep = except; sighandlers[MSVCRT_SIGSEGV] = MSVCRT_SIG_DFL; handler(MSVCRT_SIGSEGV); + *ep = old_ep; } ret = EXCEPTION_CONTINUE_EXECUTION; } @@ -114,6 +127,7 @@ static LONG WINAPI msvcrt_exception_filter(struct _EXCEPTION_POINTERS *except) { if (handler != MSVCRT_SIG_IGN) { + EXCEPTION_POINTERS **ep = (EXCEPTION_POINTERS**)MSVCRT___pxcptinfoptrs(), *old_ep; unsigned int i; int float_signal = MSVCRT__FPE_INVALID; @@ -128,7 +142,11 @@ static LONG WINAPI msvcrt_exception_filter(struct _EXCEPTION_POINTERS *except) break; } } + + old_ep = *ep; + *ep = except; ((float_handler)handler)(MSVCRT_SIGFPE, float_signal); + *ep = old_ep; } ret = EXCEPTION_CONTINUE_EXECUTION; } @@ -139,8 +157,13 @@ static LONG WINAPI msvcrt_exception_filter(struct _EXCEPTION_POINTERS *except) { if (handler != MSVCRT_SIG_IGN) { + EXCEPTION_POINTERS **ep = (EXCEPTION_POINTERS**)MSVCRT___pxcptinfoptrs(), *old_ep; + + old_ep = *ep; + *ep = except; sighandlers[MSVCRT_SIGILL] = MSVCRT_SIG_DFL; handler(MSVCRT_SIGILL); + *ep = old_ep; } ret = EXCEPTION_CONTINUE_EXECUTION; } @@ -204,22 +227,36 @@ int CDECL MSVCRT_raise(int sig) switch (sig) { - case MSVCRT_SIGABRT: case MSVCRT_SIGFPE: case MSVCRT_SIGILL: case MSVCRT_SIGSEGV: - case MSVCRT_SIGINT: - case MSVCRT_SIGTERM: - case MSVCRT_SIGBREAK: handler = sighandlers[sig]; if (handler == MSVCRT_SIG_DFL) MSVCRT__exit(3); if (handler != MSVCRT_SIG_IGN) { + EXCEPTION_POINTERS **ep = (EXCEPTION_POINTERS**)MSVCRT___pxcptinfoptrs(), *old_ep; + sighandlers[sig] = MSVCRT_SIG_DFL; + + old_ep = *ep; + *ep = NULL; if (sig == MSVCRT_SIGFPE) ((float_handler)handler)(sig, MSVCRT__FPE_EXPLICITGEN); else handler(sig); + *ep = old_ep; + } + break; + case MSVCRT_SIGABRT: + case MSVCRT_SIGINT: + case MSVCRT_SIGTERM: + case MSVCRT_SIGBREAK: + handler = sighandlers[sig]; + if (handler == MSVCRT_SIG_DFL) MSVCRT__exit(3); + if (handler != MSVCRT_SIG_IGN) + { + sighandlers[sig] = MSVCRT_SIG_DFL; + handler(sig); } break; default: diff --git a/dlls/msvcrt/msvcrt.h b/dlls/msvcrt/msvcrt.h index 288d18d..e2ff7a0 100644 --- a/dlls/msvcrt/msvcrt.h +++ b/dlls/msvcrt/msvcrt.h @@ -200,7 +200,8 @@ struct __thread_data { struct MSVCRT_tm *time_buffer; /* buffer for localtime/gmtime */ char *efcvt_buffer; /* buffer for ecvt/fcvt */ int unk3[2]; - void *unk4[4]; + void *unk4[3]; + EXCEPTION_POINTERS *xcptinfo; int fpecode; MSVCRT_pthreadmbcinfo mbcinfo; MSVCRT_pthreadlocinfo locinfo; diff --git a/dlls/msvcrt/msvcrt.spec b/dlls/msvcrt/msvcrt.spec index f5ef8b6..2b01fc3 100644 --- a/dlls/msvcrt/msvcrt.spec +++ b/dlls/msvcrt/msvcrt.spec @@ -250,7 +250,7 @@ @ cdecl __pctype_func() MSVCRT___pctype_func @ extern __pioinfo MSVCRT___pioinfo # stub __pwctype_func() -@ stub __pxcptinfoptrs() +@ cdecl __pxcptinfoptrs() MSVCRT___pxcptinfoptrs @ cdecl __set_app_type(long) MSVCRT___set_app_type @ extern __setlc_active MSVCRT___setlc_active @ cdecl __setusermatherr(ptr) MSVCRT___setusermatherr diff --git a/include/msvcrt/signal.h b/include/msvcrt/signal.h index d9f72cc..42d2bfe 100644 --- a/include/msvcrt/signal.h +++ b/include/msvcrt/signal.h @@ -42,6 +42,7 @@ typedef void (__cdecl *__sighandler_t)(int); #define SIG_IGN ((__sighandler_t)1) #define SIG_ERR ((__sighandler_t)-1) +void** __cdecl __pxcptinfoptrs(void); __sighandler_t __cdecl signal(int sig, __sighandler_t func); int __cdecl raise(int sig);
1
0
0
0
← Newer
1
...
41
42
43
44
45
46
47
...
54
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
Results per page:
10
25
50
100
200