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
October 2009
----- 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
3 participants
1207 discussions
Start a n
N
ew thread
Jacek Caban : mshtml.idl: Moved IHTMLElement2 dispinterface declaration to macro.
by Alexandre Julliard
05 Oct '09
05 Oct '09
Module: wine Branch: master Commit: bff6c1cd72dfb72700fa08e252ffb31fbc361a94 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=bff6c1cd72dfb72700fa08e25…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Fri Oct 2 20:12:10 2009 +0200 mshtml.idl: Moved IHTMLElement2 dispinterface declaration to macro. --- include/mshtml.idl | 3680 +++++----------------------------------------------- 1 files changed, 310 insertions(+), 3370 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=bff6c1cd72dfb72700fa0…
1
0
0
0
Juan Lang : winhttp: Unload OpenSSL when unloading winhttp.
by Alexandre Julliard
05 Oct '09
05 Oct '09
Module: wine Branch: master Commit: d7d8a0eec46219adc421065223959737a91f92ba URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d7d8a0eec46219adc42106522…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Fri Oct 2 07:53:01 2009 -0700 winhttp: Unload OpenSSL when unloading winhttp. --- dlls/winhttp/main.c | 1 + dlls/winhttp/net.c | 16 ++++++++++++++++ dlls/winhttp/winhttp_private.h | 1 + 3 files changed, 18 insertions(+), 0 deletions(-) diff --git a/dlls/winhttp/main.c b/dlls/winhttp/main.c index c0ac9cb..945123a 100644 --- a/dlls/winhttp/main.c +++ b/dlls/winhttp/main.c @@ -42,6 +42,7 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv) DisableThreadLibraryCalls(hInstDLL); break; case DLL_PROCESS_DETACH: + netconn_unload(); break; } return TRUE; diff --git a/dlls/winhttp/net.c b/dlls/winhttp/net.c index a824271..7ab9944 100644 --- a/dlls/winhttp/net.c +++ b/dlls/winhttp/net.c @@ -97,6 +97,7 @@ static SSL_CTX *ctx; MAKE_FUNCPTR( SSL_library_init ); MAKE_FUNCPTR( SSL_load_error_strings ); MAKE_FUNCPTR( SSLv23_method ); +MAKE_FUNCPTR( SSL_CTX_free ); MAKE_FUNCPTR( SSL_CTX_new ); MAKE_FUNCPTR( SSL_new ); MAKE_FUNCPTR( SSL_free ); @@ -221,6 +222,7 @@ BOOL netconn_init( netconn_t *conn, BOOL secure ) LOAD_FUNCPTR( SSL_library_init ); LOAD_FUNCPTR( SSL_load_error_strings ); LOAD_FUNCPTR( SSLv23_method ); + LOAD_FUNCPTR( SSL_CTX_free ); LOAD_FUNCPTR( SSL_CTX_new ); LOAD_FUNCPTR( SSL_new ); LOAD_FUNCPTR( SSL_free ); @@ -270,6 +272,20 @@ BOOL netconn_init( netconn_t *conn, BOOL secure ) return TRUE; } +void netconn_unload( void ) +{ +#if defined(SONAME_LIBSSL) && defined(SONAME_LIBCRYPTO) + if (libcrypto_handle) + wine_dlclose( libcrypto_handle, NULL, 0 ); + if (libssl_handle) + { + if (ctx) + pSSL_CTX_free( ctx ); + wine_dlclose( libssl_handle, NULL, 0 ); + } +#endif +} + BOOL netconn_connected( netconn_t *conn ) { return (conn->socket != -1); diff --git a/dlls/winhttp/winhttp_private.h b/dlls/winhttp/winhttp_private.h index e445109..64348a2 100644 --- a/dlls/winhttp/winhttp_private.h +++ b/dlls/winhttp/winhttp_private.h @@ -215,6 +215,7 @@ BOOL netconn_connected( netconn_t * ); BOOL netconn_create( netconn_t *, int, int, int ); BOOL netconn_get_next_line( netconn_t *, char *, DWORD * ); BOOL netconn_init( netconn_t *, BOOL ); +void netconn_unload( void ); BOOL netconn_query_data_available( netconn_t *, DWORD * ); BOOL netconn_recv( netconn_t *, void *, size_t, int, int * ); BOOL netconn_resolve( WCHAR *, INTERNET_PORT, struct sockaddr *, socklen_t * );
1
0
0
0
Juan Lang : winhttp: Protect OpenSSL initialization with critical section.
by Alexandre Julliard
05 Oct '09
05 Oct '09
Module: wine Branch: master Commit: 349e82508029bdd600704d5e34146d7251ee4f44 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=349e82508029bdd600704d5e3…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Wed Sep 30 10:55:36 2009 -0700 winhttp: Protect OpenSSL initialization with critical section. --- dlls/winhttp/net.c | 23 ++++++++++++++++++++++- 1 files changed, 22 insertions(+), 1 deletions(-) diff --git a/dlls/winhttp/net.c b/dlls/winhttp/net.c index b264314..a824271 100644 --- a/dlls/winhttp/net.c +++ b/dlls/winhttp/net.c @@ -76,6 +76,16 @@ static CRITICAL_SECTION cs_gethostbyname = { &critsect_debug, -1, 0, 0, 0, 0 }; #include <openssl/err.h> +static CRITICAL_SECTION init_ssl_cs; +static CRITICAL_SECTION_DEBUG init_ssl_cs_debug = +{ + 0, 0, &init_ssl_cs, + { &init_ssl_cs_debug.ProcessLocksList, + &init_ssl_cs_debug.ProcessLocksList }, + 0, 0, { (DWORD_PTR)(__FILE__ ": init_ssl_cs") } +}; +static CRITICAL_SECTION init_ssl_cs = { &init_ssl_cs_debug, -1, 0, 0, 0, 0 }; + static void *libssl_handle; static void *libcrypto_handle; @@ -180,17 +190,24 @@ BOOL netconn_init( netconn_t *conn, BOOL secure ) if (!secure) return TRUE; #if defined(SONAME_LIBSSL) && defined(SONAME_LIBCRYPTO) - if (libssl_handle) return TRUE; + EnterCriticalSection( &init_ssl_cs ); + if (libssl_handle) + { + LeaveCriticalSection( &init_ssl_cs ); + return TRUE; + } if (!(libssl_handle = wine_dlopen( SONAME_LIBSSL, RTLD_NOW, NULL, 0 ))) { ERR("Trying to use SSL but couldn't load %s. Expect trouble.\n", SONAME_LIBSSL); set_last_error( ERROR_WINHTTP_SECURE_CHANNEL_ERROR ); + LeaveCriticalSection( &init_ssl_cs ); return FALSE; } if (!(libcrypto_handle = wine_dlopen( SONAME_LIBCRYPTO, RTLD_NOW, NULL, 0 ))) { ERR("Trying to use SSL but couldn't load %s. Expect trouble.\n", SONAME_LIBCRYPTO); set_last_error( ERROR_WINHTTP_SECURE_CHANNEL_ERROR ); + LeaveCriticalSection( &init_ssl_cs ); return FALSE; } #define LOAD_FUNCPTR(x) \ @@ -198,6 +215,7 @@ BOOL netconn_init( netconn_t *conn, BOOL secure ) { \ ERR("Failed to load symbol %s\n", #x); \ set_last_error( ERROR_WINHTTP_SECURE_CHANNEL_ERROR ); \ + LeaveCriticalSection( &init_ssl_cs ); \ return FALSE; \ } LOAD_FUNCPTR( SSL_library_init ); @@ -221,6 +239,7 @@ BOOL netconn_init( netconn_t *conn, BOOL secure ) { \ ERR("Failed to load symbol %s\n", #x); \ set_last_error( ERROR_WINHTTP_SECURE_CHANNEL_ERROR ); \ + LeaveCriticalSection( &init_ssl_cs ); \ return FALSE; \ } LOAD_FUNCPTR( BIO_new_fp ); @@ -239,8 +258,10 @@ BOOL netconn_init( netconn_t *conn, BOOL secure ) { ERR("SSL_CTX_set_default_verify_paths failed: %s\n", pERR_error_string( pERR_get_error(), 0 )); set_last_error( ERROR_OUTOFMEMORY ); + LeaveCriticalSection( &init_ssl_cs ); return FALSE; } + LeaveCriticalSection( &init_ssl_cs ); #else WARN("SSL support not compiled in.\n"); set_last_error( ERROR_WINHTTP_SECURE_CHANNEL_ERROR );
1
0
0
0
Juan Lang : winhttp: Move initialization of SSL_CTX to library initialization time.
by Alexandre Julliard
05 Oct '09
05 Oct '09
Module: wine Branch: master Commit: 016d7c3c0a3f1180f8ed9081d96229f41c486eee URL:
http://source.winehq.org/git/wine.git/?a=commit;h=016d7c3c0a3f1180f8ed9081d…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Wed Sep 30 10:29:38 2009 -0700 winhttp: Move initialization of SSL_CTX to library initialization time. --- dlls/winhttp/net.c | 14 +++++++------- 1 files changed, 7 insertions(+), 7 deletions(-) diff --git a/dlls/winhttp/net.c b/dlls/winhttp/net.c index ed4d4b9..b264314 100644 --- a/dlls/winhttp/net.c +++ b/dlls/winhttp/net.c @@ -234,6 +234,13 @@ BOOL netconn_init( netconn_t *conn, BOOL secure ) pBIO_new_fp( stderr, BIO_NOCLOSE ); method = pSSLv23_method(); + ctx = pSSL_CTX_new( method ); + if (!pSSL_CTX_set_default_verify_paths( ctx )) + { + ERR("SSL_CTX_set_default_verify_paths failed: %s\n", pERR_error_string( pERR_get_error(), 0 )); + set_last_error( ERROR_OUTOFMEMORY ); + return FALSE; + } #else WARN("SSL support not compiled in.\n"); set_last_error( ERROR_WINHTTP_SECURE_CHANNEL_ERROR ); @@ -333,13 +340,6 @@ BOOL netconn_secure_connect( netconn_t *conn ) X509 *cert; long res; - ctx = pSSL_CTX_new( method ); - if (!pSSL_CTX_set_default_verify_paths( ctx )) - { - ERR("SSL_CTX_set_default_verify_paths failed: %s\n", pERR_error_string( pERR_get_error(), 0 )); - set_last_error( ERROR_OUTOFMEMORY ); - return FALSE; - } if (!(conn->ssl_conn = pSSL_new( ctx ))) { ERR("SSL_new failed: %s\n", pERR_error_string( pERR_get_error(), 0 ));
1
0
0
0
Juan Lang : wininet: Quiet a fixme.
by Alexandre Julliard
05 Oct '09
05 Oct '09
Module: wine Branch: master Commit: b214fc62f13097e87ee0f123f41de07e8260f186 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b214fc62f13097e87ee0f123f…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Fri Oct 2 08:34:39 2009 -0700 wininet: Quiet a fixme. --- dlls/wininet/internet.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/dlls/wininet/internet.c b/dlls/wininet/internet.c index bad49e4..dbee0a2 100644 --- a/dlls/wininet/internet.c +++ b/dlls/wininet/internet.c @@ -2162,6 +2162,8 @@ DWORD INET_QueryOption(DWORD option, void *buffer, DWORD *size, BOOL unicode) return res; } + case INTERNET_OPTION_USER_AGENT: + return ERROR_INTERNET_INCORRECT_HANDLE_TYPE; } FIXME("Stub for %d\n", option);
1
0
0
0
Juan Lang : wininet: Correct user agent handling.
by Alexandre Julliard
05 Oct '09
05 Oct '09
Module: wine Branch: master Commit: 05a7e3d38653660abed38604b7df9225bf26b54b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=05a7e3d38653660abed38604b…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Fri Oct 2 08:31:31 2009 -0700 wininet: Correct user agent handling. --- dlls/wininet/internet.c | 27 +++++++++++++++++++++++---- dlls/wininet/tests/internet.c | 4 ++-- 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/dlls/wininet/internet.c b/dlls/wininet/internet.c index 619674e..bad49e4 100644 --- a/dlls/wininet/internet.c +++ b/dlls/wininet/internet.c @@ -526,17 +526,36 @@ static DWORD APPINFO_QueryOption(object_header_t *hdr, DWORD option, void *buffe bufsize = *size; if (unicode) { - *size = (strlenW(ai->lpszAgent) + 1) * sizeof(WCHAR); + DWORD len = ai->lpszAgent ? strlenW(ai->lpszAgent) : 0; + + *size = (len + 1) * sizeof(WCHAR); if(!buffer || bufsize < *size) return ERROR_INSUFFICIENT_BUFFER; - strcpyW(buffer, ai->lpszAgent); + if (ai->lpszAgent) + strcpyW(buffer, ai->lpszAgent); + else + *(WCHAR *)buffer = 0; + /* If the buffer is copied, the returned length doesn't include + * the NULL terminator. + */ + *size = len * sizeof(WCHAR); }else { - *size = WideCharToMultiByte(CP_ACP, 0, ai->lpszAgent, -1, NULL, 0, NULL, NULL); + if (ai->lpszAgent) + *size = WideCharToMultiByte(CP_ACP, 0, ai->lpszAgent, -1, NULL, 0, NULL, NULL); + else + *size = 1; if(!buffer || bufsize < *size) return ERROR_INSUFFICIENT_BUFFER; - WideCharToMultiByte(CP_ACP, 0, ai->lpszAgent, -1, buffer, *size, NULL, NULL); + if (ai->lpszAgent) + WideCharToMultiByte(CP_ACP, 0, ai->lpszAgent, -1, buffer, *size, NULL, NULL); + else + *(char *)buffer = 0; + /* If the buffer is copied, the returned length doesn't include + * the NULL terminator. + */ + *size -= 1; } return ERROR_SUCCESS; diff --git a/dlls/wininet/tests/internet.c b/dlls/wininet/tests/internet.c index 144c630..622711a 100644 --- a/dlls/wininet/tests/internet.c +++ b/dlls/wininet/tests/internet.c @@ -184,7 +184,7 @@ static void test_InternetQueryOptionA(void) if (retval) { ok(!strcmp(useragent,buffer),"Got wrong user agent string %s instead of %s\n",buffer,useragent); - todo_wine ok(len == strlen(useragent),"Got wrong user agent length %d instead of %d\n",len,lstrlenA(useragent)); + ok(len == strlen(useragent),"Got wrong user agent length %d instead of %d\n",len,lstrlenA(useragent)); } ok(err == 0xdeadbeef, "Got wrong error code %d\n",err); HeapFree(GetProcessHeap(),0,buffer); @@ -231,7 +231,7 @@ static void test_InternetQueryOptionA(void) len=0; retval=InternetQueryOptionA(hinet,INTERNET_OPTION_USER_AGENT,NULL,&len); err=GetLastError(); - todo_wine ok(len == 1,"Got wrong user agent length %d instead of %d\n",len,1); + ok(len == 1,"Got wrong user agent length %d instead of %d\n",len,1); ok(retval == 0,"Got wrong return value %d\n",retval); ok(err == ERROR_INSUFFICIENT_BUFFER, "Got wrong error code%d\n",err);
1
0
0
0
Owen Rudge : comctl32: Capture the mouse when performing a listview marquee selection.
by Alexandre Julliard
05 Oct '09
05 Oct '09
Module: wine Branch: master Commit: b63c1cb219bf1fd3a62c39799a0f248eaa4a979f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b63c1cb219bf1fd3a62c39799…
Author: Owen Rudge <orudge(a)codeweavers.com> Date: Fri Oct 2 16:13:26 2009 +0100 comctl32: Capture the mouse when performing a listview marquee selection. --- dlls/comctl32/listview.c | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c index eb2dbfb..e1e51e7 100644 --- a/dlls/comctl32/listview.c +++ b/dlls/comctl32/listview.c @@ -3731,7 +3731,10 @@ static LRESULT LISTVIEW_MouseMove(LISTVIEW_INFO *infoPtr, WORD fwKeys, INT x, IN /* If we're allowing multiple selections, send notification. If return value is non-zero, cancel. */ if (!(infoPtr->dwStyle & LVS_SINGLESEL) && (notify_hdr(infoPtr, LVN_MARQUEEBEGIN, &hdr) == 0)) + { infoPtr->bMarqueeSelect = TRUE; + SetCapture(infoPtr->hwndSelf); + } } else { @@ -9533,9 +9536,12 @@ static LRESULT LISTVIEW_LButtonUp(LISTVIEW_INFO *infoPtr, WORD wKey, INT x, INT if (infoPtr->bDragging || infoPtr->bMarqueeSelect) { - /* Remove the marquee rectangle */ + /* Remove the marquee rectangle and release our mouse capture */ if (infoPtr->bMarqueeSelect) + { LISTVIEW_InvalidateRect(infoPtr, &infoPtr->marqueeRect); + ReleaseCapture(); + } SetRect(&infoPtr->marqueeRect, 0, 0, 0, 0);
1
0
0
0
Alexandre Julliard : odbc32: Define correct function prototypes for all libodbc entry points.
by Alexandre Julliard
05 Oct '09
05 Oct '09
Module: wine Branch: master Commit: 27a44a5d63bd3cbae61f4cbde1b0168d53628932 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=27a44a5d63bd3cbae61f4cbde…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Sat Oct 3 14:40:19 2009 +0200 odbc32: Define correct function prototypes for all libodbc entry points. Fix the prototypes of the Unicode functions. --- dlls/odbc32/proxyodbc.c | 1406 +++++++++++++++++++---------------------------- dlls/odbc32/proxyodbc.h | 131 ----- include/sqltypes.h | 10 + 3 files changed, 588 insertions(+), 959 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=27a44a5d63bd3cbae61f4…
1
0
0
0
Juan Lang : wininet: Set callbacks needed by OpenSSL for multithreaded use.
by Alexandre Julliard
02 Oct '09
02 Oct '09
Module: wine Branch: master Commit: 3c98992f5537dab767bff701de5a210d0ae32907 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3c98992f5537dab767bff701d…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Fri Oct 2 07:47:48 2009 -0700 wininet: Set callbacks needed by OpenSSL for multithreaded use. --- dlls/wininet/netconnection.c | 46 ++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 46 insertions(+), 0 deletions(-) diff --git a/dlls/wininet/netconnection.c b/dlls/wininet/netconnection.c index 1a9d7a2..97c764f 100644 --- a/dlls/wininet/netconnection.c +++ b/dlls/wininet/netconnection.c @@ -138,11 +138,29 @@ MAKE_FUNCPTR(SSL_CTX_set_default_verify_paths); /* OpenSSL's libcrypto functions that we use */ MAKE_FUNCPTR(BIO_new_fp); +MAKE_FUNCPTR(CRYPTO_num_locks); +MAKE_FUNCPTR(CRYPTO_set_id_callback); +MAKE_FUNCPTR(CRYPTO_set_locking_callback); MAKE_FUNCPTR(ERR_get_error); MAKE_FUNCPTR(ERR_error_string); MAKE_FUNCPTR(i2d_X509); #undef MAKE_FUNCPTR +static CRITICAL_SECTION *ssl_locks; + +static unsigned long ssl_thread_id(void) +{ + return GetCurrentThreadId(); +} + +static void ssl_lock_callback(int mode, int type, const char *file, int line) +{ + if (mode & CRYPTO_LOCK) + EnterCriticalSection(&ssl_locks[type]); + else + LeaveCriticalSection(&ssl_locks[type]); +} + #endif BOOL NETCON_init(WININET_NETCONNECTION *connection, BOOL useSSL) @@ -152,6 +170,8 @@ BOOL NETCON_init(WININET_NETCONNECTION *connection, BOOL useSSL) if (useSSL) { #if defined(SONAME_LIBSSL) && defined(SONAME_LIBCRYPTO) + int i; + TRACE("using SSL connection\n"); EnterCriticalSection(&init_ssl_cs); if (OpenSSL_ssl_handle) /* already initialized everything */ @@ -219,6 +239,9 @@ BOOL NETCON_init(WININET_NETCONNECTION *connection, BOOL useSSL) return FALSE; \ } DYNCRYPTO(BIO_new_fp); + DYNCRYPTO(CRYPTO_num_locks); + DYNCRYPTO(CRYPTO_set_id_callback); + DYNCRYPTO(CRYPTO_set_locking_callback); DYNCRYPTO(ERR_get_error); DYNCRYPTO(ERR_error_string); DYNCRYPTO(i2d_X509); @@ -238,6 +261,19 @@ BOOL NETCON_init(WININET_NETCONNECTION *connection, BOOL useSSL) LeaveCriticalSection(&init_ssl_cs); return FALSE; } + + pCRYPTO_set_id_callback(ssl_thread_id); + ssl_locks = HeapAlloc(GetProcessHeap(), 0, + pCRYPTO_num_locks() * sizeof(CRITICAL_SECTION)); + if (!ssl_locks) + { + INTERNET_SetLastError(ERROR_OUTOFMEMORY); + LeaveCriticalSection(&init_ssl_cs); + return FALSE; + } + for (i = 0; i < pCRYPTO_num_locks(); i++) + InitializeCriticalSection(&ssl_locks[i]); + pCRYPTO_set_locking_callback(ssl_lock_callback); LeaveCriticalSection(&init_ssl_cs); #else FIXME("can't use SSL, not compiled in.\n"); @@ -252,7 +288,17 @@ void NETCON_unload(void) { #if defined(SONAME_LIBSSL) && defined(SONAME_LIBCRYPTO) if (OpenSSL_crypto_handle) + { + if (ssl_locks) + { + int i; + + for (i = 0; i < pCRYPTO_num_locks(); i++) + DeleteCriticalSection(&ssl_locks[i]); + HeapFree(GetProcessHeap(), 0, ssl_locks); + } wine_dlclose(OpenSSL_crypto_handle, NULL, 0); + } if (OpenSSL_ssl_handle) { if (ctx)
1
0
0
0
Juan Lang : wininet: Unload OpenSSL when unloading wininet.
by Alexandre Julliard
02 Oct '09
02 Oct '09
Module: wine Branch: master Commit: 41592569fdc28ffb665ecf834205416cb577d938 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=41592569fdc28ffb665ecf834…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Fri Oct 2 07:43:45 2009 -0700 wininet: Unload OpenSSL when unloading wininet. --- dlls/wininet/internet.c | 2 ++ dlls/wininet/internet.h | 1 + dlls/wininet/netconnection.c | 16 ++++++++++++++++ 3 files changed, 19 insertions(+), 0 deletions(-) diff --git a/dlls/wininet/internet.c b/dlls/wininet/internet.c index 1f08c49..619674e 100644 --- a/dlls/wininet/internet.c +++ b/dlls/wininet/internet.c @@ -290,6 +290,8 @@ BOOL WINAPI DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) case DLL_PROCESS_DETACH: + NETCON_unload(); + URLCacheContainers_DeleteAll(); if (g_dwTlsErrIndex != TLS_OUT_OF_INDEXES) diff --git a/dlls/wininet/internet.h b/dlls/wininet/internet.h index 39d8083..75568fa 100644 --- a/dlls/wininet/internet.h +++ b/dlls/wininet/internet.h @@ -429,6 +429,7 @@ VOID INTERNET_SendCallback(object_header_t *hdr, DWORD_PTR dwContext, BOOL NETCON_connected(WININET_NETCONNECTION *connection); BOOL NETCON_init(WININET_NETCONNECTION *connnection, BOOL useSSL); +void NETCON_unload(void); BOOL NETCON_create(WININET_NETCONNECTION *connection, int domain, int type, int protocol); BOOL NETCON_close(WININET_NETCONNECTION *connection); diff --git a/dlls/wininet/netconnection.c b/dlls/wininet/netconnection.c index d54e3ac..1a9d7a2 100644 --- a/dlls/wininet/netconnection.c +++ b/dlls/wininet/netconnection.c @@ -120,6 +120,7 @@ static SSL_CTX *ctx; MAKE_FUNCPTR(SSL_library_init); MAKE_FUNCPTR(SSL_load_error_strings); MAKE_FUNCPTR(SSLv23_method); +MAKE_FUNCPTR(SSL_CTX_free); MAKE_FUNCPTR(SSL_CTX_new); MAKE_FUNCPTR(SSL_new); MAKE_FUNCPTR(SSL_free); @@ -191,6 +192,7 @@ BOOL NETCON_init(WININET_NETCONNECTION *connection, BOOL useSSL) DYNSSL(SSL_library_init); DYNSSL(SSL_load_error_strings); DYNSSL(SSLv23_method); + DYNSSL(SSL_CTX_free); DYNSSL(SSL_CTX_new); DYNSSL(SSL_new); DYNSSL(SSL_free); @@ -246,6 +248,20 @@ BOOL NETCON_init(WININET_NETCONNECTION *connection, BOOL useSSL) return TRUE; } +void NETCON_unload(void) +{ +#if defined(SONAME_LIBSSL) && defined(SONAME_LIBCRYPTO) + if (OpenSSL_crypto_handle) + wine_dlclose(OpenSSL_crypto_handle, NULL, 0); + if (OpenSSL_ssl_handle) + { + if (ctx) + pSSL_CTX_free(ctx); + wine_dlclose(OpenSSL_ssl_handle, NULL, 0); + } +#endif +} + BOOL NETCON_connected(WININET_NETCONNECTION *connection) { if (connection->socketFD == -1)
1
0
0
0
← Newer
1
...
106
107
108
109
110
111
112
...
121
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
Results per page:
10
25
50
100
200