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
September 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
446 discussions
Start a n
N
ew thread
Hans Leidekker : winhttp: Implement WINHTTP_OPTION_SECURE_PROTOCOLS.
by Alexandre Julliard
12 Sep '17
12 Sep '17
Module: wine Branch: master Commit: 2b77b0bb6b220979278bc4153d0fa854f8eeb5e7 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2b77b0bb6b220979278bc4153…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Tue Sep 12 09:59:06 2017 +0200 winhttp: Implement WINHTTP_OPTION_SECURE_PROTOCOLS. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winhttp/request.c | 19 ++++++++++++++++++- dlls/winhttp/session.c | 11 +++++++++++ dlls/winhttp/tests/winhttp.c | 7 ++++++- dlls/winhttp/winhttp_private.h | 1 + include/winhttp.h | 12 ++++++++---- 5 files changed, 44 insertions(+), 6 deletions(-) diff --git a/dlls/winhttp/request.c b/dlls/winhttp/request.c index 4103a84..f3f4cf8 100644 --- a/dlls/winhttp/request.c +++ b/dlls/winhttp/request.c @@ -1093,11 +1093,28 @@ static void cache_connection( netconn_t *netconn ) LeaveCriticalSection( &connection_pool_cs ); } +static DWORD map_secure_protocols( DWORD mask ) +{ + DWORD ret = 0; + if (mask & WINHTTP_FLAG_SECURE_PROTOCOL_SSL2) ret |= SP_PROT_SSL2_CLIENT; + if (mask & WINHTTP_FLAG_SECURE_PROTOCOL_SSL3) ret |= SP_PROT_SSL3_CLIENT; + if (mask & WINHTTP_FLAG_SECURE_PROTOCOL_TLS1) ret |= SP_PROT_TLS1_CLIENT; + if (mask & WINHTTP_FLAG_SECURE_PROTOCOL_TLS1_1) ret |= SP_PROT_TLS1_1_CLIENT; + if (mask & WINHTTP_FLAG_SECURE_PROTOCOL_TLS1_2) ret |= SP_PROT_TLS1_2_CLIENT; + return ret; +} + static BOOL ensure_cred_handle( session_t *session ) { + SCHANNEL_CRED cred; SECURITY_STATUS status; + if (session->cred_handle_initialized) return TRUE; - if ((status = AcquireCredentialsHandleW( NULL, (WCHAR *)UNISP_NAME_W, SECPKG_CRED_OUTBOUND, NULL, NULL, + + memset( &cred, 0, sizeof(cred) ); + cred.dwVersion = SCHANNEL_CRED_VERSION; + cred.grbitEnabledProtocols = map_secure_protocols( session->secure_protocols ); + if ((status = AcquireCredentialsHandleW( NULL, (WCHAR *)UNISP_NAME_W, SECPKG_CRED_OUTBOUND, NULL, &cred, NULL, NULL, &session->cred_handle, NULL )) != SEC_E_OK) { WARN( "AcquireCredentialsHandleW failed: 0x%08x\n", status ); diff --git a/dlls/winhttp/session.c b/dlls/winhttp/session.c index a448869..b54e77b 100644 --- a/dlls/winhttp/session.c +++ b/dlls/winhttp/session.c @@ -184,6 +184,17 @@ static BOOL session_set_option( object_header_t *hdr, DWORD option, LPVOID buffe hdr->redirect_policy = policy; return TRUE; } + case WINHTTP_OPTION_SECURE_PROTOCOLS: + { + if (buflen != sizeof(session->secure_protocols)) + { + set_last_error( ERROR_INSUFFICIENT_BUFFER ); + return FALSE; + } + session->secure_protocols = *(DWORD *)buffer; + TRACE("0x%x\n", session->secure_protocols); + return TRUE; + } case WINHTTP_OPTION_DISABLE_FEATURE: set_last_error( ERROR_WINHTTP_INCORRECT_HANDLE_TYPE ); return FALSE; diff --git a/dlls/winhttp/tests/winhttp.c b/dlls/winhttp/tests/winhttp.c index c9f5ecd..2babe98 100644 --- a/dlls/winhttp/tests/winhttp.c +++ b/dlls/winhttp/tests/winhttp.c @@ -974,7 +974,7 @@ static void test_secure_connection(void) { static const char data_start[] = "<!DOCTYPE html PUBLIC"; HINTERNET ses, con, req; - DWORD size, status, policy, bitness, read_size, err, available_size; + DWORD size, status, policy, bitness, read_size, err, available_size, protocols; BOOL ret; CERT_CONTEXT *cert; WINHTTP_CERTIFICATE_INFO info; @@ -987,6 +987,11 @@ static void test_secure_connection(void) ret = WinHttpSetOption(ses, WINHTTP_OPTION_REDIRECT_POLICY, &policy, sizeof(policy)); ok(ret, "failed to set redirect policy %u\n", GetLastError()); + protocols = WINHTTP_FLAG_SECURE_PROTOCOL_TLS1_2; + ret = WinHttpSetOption(ses, WINHTTP_OPTION_SECURE_PROTOCOLS, &protocols, sizeof(protocols)); + err = GetLastError(); + ok(ret || (!ret && err == ERROR_INVALID_PARAMETER) /* < win7 */, "failed to set protocols %u\n", err); + con = WinHttpConnect(ses, test_winehq, 443, 0); ok(con != NULL, "failed to open a connection %u\n", GetLastError()); diff --git a/dlls/winhttp/winhttp_private.h b/dlls/winhttp/winhttp_private.h index dcbfa84..ee41481 100644 --- a/dlls/winhttp/winhttp_private.h +++ b/dlls/winhttp/winhttp_private.h @@ -122,6 +122,7 @@ typedef struct HANDLE unload_event; CredHandle cred_handle; BOOL cred_handle_initialized; + DWORD secure_protocols; } session_t; typedef struct diff --git a/include/winhttp.h b/include/winhttp.h index 52c60e4..e873e77 100644 --- a/include/winhttp.h +++ b/include/winhttp.h @@ -440,10 +440,14 @@ typedef int INTERNET_SCHEME, *LPINTERNET_SCHEME; #define WINHTTP_CALLBACK_STATUS_FLAG_CERT_WRONG_USAGE 0x00000040 #define WINHTTP_CALLBACK_STATUS_FLAG_SECURITY_CHANNEL_ERROR 0x80000000 -#define WINHTTP_FLAG_SECURE_PROTOCOL_SSL2 0x00000008 -#define WINHTTP_FLAG_SECURE_PROTOCOL_SSL3 0x00000020 -#define WINHTTP_FLAG_SECURE_PROTOCOL_TLS1 0x00000080 -#define WINHTTP_FLAG_SECURE_PROTOCOL_ALL (WINHTTP_FLAG_SECURE_PROTOCOL_SSL2 | WINHTTP_FLAG_SECURE_PROTOCOL_SSL3 | WINHTTP_FLAG_SECURE_PROTOCOL_TLS1) +#define WINHTTP_FLAG_SECURE_PROTOCOL_SSL2 0x00000008 +#define WINHTTP_FLAG_SECURE_PROTOCOL_SSL3 0x00000020 +#define WINHTTP_FLAG_SECURE_PROTOCOL_TLS1 0x00000080 +#define WINHTTP_FLAG_SECURE_PROTOCOL_TLS1_1 0x00000200 +#define WINHTTP_FLAG_SECURE_PROTOCOL_TLS1_2 0x00000800 +#define WINHTTP_FLAG_SECURE_PROTOCOL_ALL (WINHTTP_FLAG_SECURE_PROTOCOL_SSL2 |\ + WINHTTP_FLAG_SECURE_PROTOCOL_SSL3 |\ + WINHTTP_FLAG_SECURE_PROTOCOL_TLS1) #define WINHTTP_AUTH_SCHEME_BASIC 0x00000001 #define WINHTTP_AUTH_SCHEME_NTLM 0x00000002
1
0
0
0
Hans Leidekker : winhttp: Allocate a credential handle for each session.
by Alexandre Julliard
12 Sep '17
12 Sep '17
Module: wine Branch: master Commit: d71fcc93e47df51d20970630612bc43841941e51 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d71fcc93e47df51d209706306…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Tue Sep 12 09:59:05 2017 +0200 winhttp: Allocate a credential handle for each session. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winhttp/net.c | 47 +++--------------------------------------- dlls/winhttp/request.c | 19 ++++++++++++++++- dlls/winhttp/session.c | 1 + dlls/winhttp/winhttp_private.h | 4 +++- 4 files changed, 25 insertions(+), 46 deletions(-) diff --git a/dlls/winhttp/net.c b/dlls/winhttp/net.c index 5cce127..d0d02d5 100644 --- a/dlls/winhttp/net.c +++ b/dlls/winhttp/net.c @@ -254,46 +254,8 @@ static DWORD netconn_verify_cert( PCCERT_CONTEXT cert, WCHAR *server, DWORD secu return err; } -static SecHandle cred_handle; -static BOOL cred_handle_initialized; - -static CRITICAL_SECTION init_sechandle_cs; -static CRITICAL_SECTION_DEBUG init_sechandle_cs_debug = { - 0, 0, &init_sechandle_cs, - { &init_sechandle_cs_debug.ProcessLocksList, - &init_sechandle_cs_debug.ProcessLocksList }, - 0, 0, { (DWORD_PTR)(__FILE__ ": init_sechandle_cs") } -}; -static CRITICAL_SECTION init_sechandle_cs = { &init_sechandle_cs_debug, -1, 0, 0, 0, 0 }; - -static BOOL ensure_cred_handle(void) -{ - BOOL ret = TRUE; - - EnterCriticalSection(&init_sechandle_cs); - - if(!cred_handle_initialized) { - SECURITY_STATUS res; - - res = AcquireCredentialsHandleW(NULL, (WCHAR*)UNISP_NAME_W, SECPKG_CRED_OUTBOUND, NULL, NULL, - NULL, NULL, &cred_handle, NULL); - if(res == SEC_E_OK) { - cred_handle_initialized = TRUE; - }else { - WARN("AcquireCredentialsHandleW failed: %u\n", res); - ret = FALSE; - } - } - - LeaveCriticalSection(&init_sechandle_cs); - return ret; -} - void netconn_unload( void ) { - if(cred_handle_initialized) - FreeCredentialsHandle(&cred_handle); - DeleteCriticalSection(&init_sechandle_cs); #ifndef HAVE_GETADDRINFO DeleteCriticalSection(&cs_gethostbyname); #endif @@ -409,7 +371,7 @@ BOOL netconn_close( netconn_t *conn ) return TRUE; } -BOOL netconn_secure_connect( netconn_t *conn, WCHAR *hostname, DWORD security_flags ) +BOOL netconn_secure_connect( netconn_t *conn, WCHAR *hostname, DWORD security_flags, CredHandle *cred_handle ) { SecBuffer out_buf = {0, SECBUFFER_TOKEN, NULL}, in_bufs[2] = {{0, SECBUFFER_TOKEN}, {0, SECBUFFER_EMPTY}}; SecBufferDesc out_desc = {SECBUFFER_VERSION, 1, &out_buf}, in_desc = {SECBUFFER_VERSION, 2, in_bufs}; @@ -425,14 +387,11 @@ BOOL netconn_secure_connect( netconn_t *conn, WCHAR *hostname, DWORD security_fl const DWORD isc_req_flags = ISC_REQ_ALLOCATE_MEMORY|ISC_REQ_USE_SESSION_KEY|ISC_REQ_CONFIDENTIALITY |ISC_REQ_SEQUENCE_DETECT|ISC_REQ_REPLAY_DETECT|ISC_REQ_MANUAL_CRED_VALIDATION; - if(!ensure_cred_handle()) - return FALSE; - read_buf = heap_alloc(read_buf_size); if(!read_buf) return FALSE; - status = InitializeSecurityContextW(&cred_handle, NULL, hostname, isc_req_flags, 0, 0, NULL, 0, + status = InitializeSecurityContextW(cred_handle, NULL, hostname, isc_req_flags, 0, 0, NULL, 0, &ctx, &out_desc, &attrs, NULL); assert(status != SEC_E_OK); @@ -492,7 +451,7 @@ BOOL netconn_secure_connect( netconn_t *conn, WCHAR *hostname, DWORD security_fl in_bufs[0].cbBuffer += size; in_bufs[0].pvBuffer = read_buf; - status = InitializeSecurityContextW(&cred_handle, &ctx, hostname, isc_req_flags, 0, 0, &in_desc, + status = InitializeSecurityContextW(cred_handle, &ctx, hostname, isc_req_flags, 0, 0, &in_desc, 0, NULL, &out_desc, &attrs, NULL); TRACE("InitializeSecurityContext ret %08x\n", status); diff --git a/dlls/winhttp/request.c b/dlls/winhttp/request.c index b72d2c1..4103a84 100644 --- a/dlls/winhttp/request.c +++ b/dlls/winhttp/request.c @@ -35,6 +35,7 @@ #include "initguid.h" #include "httprequest.h" #include "httprequestid.h" +#include "schannel.h" #include "winhttp.h" #include "winhttp_private.h" @@ -1092,6 +1093,20 @@ static void cache_connection( netconn_t *netconn ) LeaveCriticalSection( &connection_pool_cs ); } +static BOOL ensure_cred_handle( session_t *session ) +{ + SECURITY_STATUS status; + if (session->cred_handle_initialized) return TRUE; + if ((status = AcquireCredentialsHandleW( NULL, (WCHAR *)UNISP_NAME_W, SECPKG_CRED_OUTBOUND, NULL, NULL, + NULL, NULL, &session->cred_handle, NULL )) != SEC_E_OK) + { + WARN( "AcquireCredentialsHandleW failed: 0x%08x\n", status ); + return FALSE; + } + session->cred_handle_initialized = TRUE; + return TRUE; +} + static BOOL open_connection( request_t *request ) { BOOL is_secure = request->hdr.flags & WINHTTP_FLAG_SECURE; @@ -1219,7 +1234,9 @@ static BOOL open_connection( request_t *request ) return FALSE; } } - if (!netconn_secure_connect( netconn, connect->hostname, request->security_flags )) + if (!ensure_cred_handle( connect->session ) || + !netconn_secure_connect( netconn, connect->hostname, request->security_flags, + &connect->session->cred_handle )) { heap_free( addressW ); netconn_close( netconn ); diff --git a/dlls/winhttp/session.c b/dlls/winhttp/session.c index 877794a..a448869 100644 --- a/dlls/winhttp/session.c +++ b/dlls/winhttp/session.c @@ -99,6 +99,7 @@ static void session_destroy( object_header_t *hdr ) TRACE("%p\n", session); if (session->unload_event) SetEvent( session->unload_event ); + if (session->cred_handle_initialized) FreeCredentialsHandle( &session->cred_handle ); LIST_FOR_EACH_SAFE( item, next, &session->cookie_cache ) { diff --git a/dlls/winhttp/winhttp_private.h b/dlls/winhttp/winhttp_private.h index a5cea89..dcbfa84 100644 --- a/dlls/winhttp/winhttp_private.h +++ b/dlls/winhttp/winhttp_private.h @@ -120,6 +120,8 @@ typedef struct LPWSTR proxy_password; struct list cookie_cache; HANDLE unload_event; + CredHandle cred_handle; + BOOL cred_handle_initialized; } session_t; typedef struct @@ -300,7 +302,7 @@ void netconn_unload( void ) DECLSPEC_HIDDEN; ULONG netconn_query_data_available( netconn_t * ) DECLSPEC_HIDDEN; BOOL netconn_recv( netconn_t *, void *, size_t, int, int * ) DECLSPEC_HIDDEN; BOOL netconn_resolve( WCHAR *, INTERNET_PORT, struct sockaddr_storage *, int ) DECLSPEC_HIDDEN; -BOOL netconn_secure_connect( netconn_t *, WCHAR *, DWORD ) DECLSPEC_HIDDEN; +BOOL netconn_secure_connect( netconn_t *, WCHAR *, DWORD, CredHandle * ) DECLSPEC_HIDDEN; BOOL netconn_send( netconn_t *, const void *, size_t, int * ) DECLSPEC_HIDDEN; DWORD netconn_set_timeout( netconn_t *, BOOL, int ) DECLSPEC_HIDDEN; BOOL netconn_is_alive( netconn_t * ) DECLSPEC_HIDDEN;
1
0
0
0
Hans Leidekker : winhttp: Trace errors from send and recv.
by Alexandre Julliard
12 Sep '17
12 Sep '17
Module: wine Branch: master Commit: 9b3b5fd0c0459ab91d715dab31c9d270ffb4364a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9b3b5fd0c0459ab91d715dab3…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Tue Sep 12 09:59:04 2017 +0200 winhttp: Trace errors from send and recv. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winhttp/net.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/dlls/winhttp/net.c b/dlls/winhttp/net.c index c9aa6d4..5cce127 100644 --- a/dlls/winhttp/net.c +++ b/dlls/winhttp/net.c @@ -144,7 +144,7 @@ static int sock_send(int fd, const void *msg, size_t len, int flags) int ret; do { - ret = send(fd, msg, len, flags); + if ((ret = send(fd, msg, len, flags)) == -1) WARN("send error %s\n", strerror(errno)); } while(ret == -1 && errno == EINTR); return ret; @@ -155,7 +155,7 @@ static int sock_recv(int fd, void *msg, size_t len, int flags) int ret; do { - ret = recv(fd, msg, len, flags); + if ((ret = recv(fd, msg, len, flags)) == -1) WARN("recv error %s\n", strerror(errno)); } while(ret == -1 && errno == EINTR); return ret; @@ -484,7 +484,6 @@ BOOL netconn_secure_connect( netconn_t *conn, WCHAR *hostname, DWORD security_fl size = sock_recv(conn->socket, read_buf+in_bufs[0].cbBuffer, read_buf_size-in_bufs[0].cbBuffer, 0); if(size < 1) { - WARN("recv error\n"); status = ERROR_WINHTTP_SECURE_CHANNEL_ERROR; break; } @@ -620,10 +619,8 @@ static BOOL read_ssl_chunk(netconn_t *conn, void *buf, SIZE_T buf_size, SIZE_T * conn->extra_buf = NULL; }else { buf_len = sock_recv(conn->socket, conn->ssl_buf+conn->extra_len, ssl_buf_size-conn->extra_len, 0); - if(buf_len < 0) { - WARN("recv failed\n"); + if(buf_len < 0) return FALSE; - } if(!buf_len) { *eof = TRUE;
1
0
0
0
Hugh McMaster : setupapi: Recursively remove any subkeys before calling NtDeleteKey().
by Alexandre Julliard
12 Sep '17
12 Sep '17
Module: wine Branch: master Commit: c9308b8d6b1e2f4dd39b19a6890423cd42fd4620 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c9308b8d6b1e2f4dd39b19a68…
Author: Hugh McMaster <hugh.mcmaster(a)outlook.com> Date: Tue Sep 12 06:08:13 2017 +0000 setupapi: Recursively remove any subkeys before calling NtDeleteKey(). Signed-off-by: Hugh McMaster <hugh.mcmaster(a)outlook.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/setupapi/install.c | 6 +++++- dlls/setupapi/tests/install.c | 1 - 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/dlls/setupapi/install.c b/dlls/setupapi/install.c index a8d38aa..0593df8 100644 --- a/dlls/setupapi/install.c +++ b/dlls/setupapi/install.c @@ -320,7 +320,11 @@ static BOOL do_reg_operation( HKEY hkey, const WCHAR *value, INFCONTEXT *context } else RegDeleteValueW( hkey, value ); } - else NtDeleteKey( hkey ); + else + { + RegDeleteTreeW( hkey, NULL ); + NtDeleteKey( hkey ); + } return TRUE; } diff --git a/dlls/setupapi/tests/install.c b/dlls/setupapi/tests/install.c index 558453c..3ca7f26 100644 --- a/dlls/setupapi/tests/install.c +++ b/dlls/setupapi/tests/install.c @@ -174,7 +174,6 @@ static void test_registry(void) /* Check if the registry key is recursively deleted */ res = RegOpenKeyA(HKEY_CURRENT_USER, "Software\\Wine\\setupapitest", &key); - todo_wine ok(res == ERROR_FILE_NOT_FOUND, "Didn't expect the registry key to exist\n"); /* Just in case */ if (res == ERROR_SUCCESS)
1
0
0
0
Alistair Leslie-Hughes : mfplat: Implement MFCreateEventQueue.
by Alexandre Julliard
11 Sep '17
11 Sep '17
Module: wine Branch: master Commit: 19d57982ecb4520453a1b77ace386c625312e265 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=19d57982ecb4520453a1b77ac…
Author: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Date: Fri Sep 8 11:00:20 2017 +0000 mfplat: Implement MFCreateEventQueue. Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/mfplat/main.c | 153 +++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 149 insertions(+), 4 deletions(-) diff --git a/dlls/mfplat/main.c b/dlls/mfplat/main.c index 4745094..7c5be65 100644 --- a/dlls/mfplat/main.c +++ b/dlls/mfplat/main.c @@ -1514,17 +1514,162 @@ HRESULT WINAPI MFCreateMediaType(IMFMediaType **type) return S_OK; } +typedef struct _mfeventqueue +{ + IMFMediaEventQueue IMFMediaEventQueue_iface; + LONG ref; +} mfeventqueue; + +static inline mfeventqueue *impl_from_IMFMediaEventQueue(IMFMediaEventQueue *iface) +{ + return CONTAINING_RECORD(iface, mfeventqueue, IMFMediaEventQueue_iface); +} + +static HRESULT WINAPI mfeventqueue_QueryInterface(IMFMediaEventQueue *iface, REFIID riid, void **out) +{ + mfeventqueue *This = impl_from_IMFMediaEventQueue(iface); + + TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), out); + + if(IsEqualGUID(riid, &IID_IUnknown) || + IsEqualGUID(riid, &IID_IMFMediaEventQueue)) + { + *out = &This->IMFMediaEventQueue_iface; + } + else + { + FIXME("(%s, %p)\n", debugstr_guid(riid), out); + *out = NULL; + return E_NOINTERFACE; + } + + IUnknown_AddRef((IUnknown*)*out); + return S_OK; +} + +static ULONG WINAPI mfeventqueue_AddRef(IMFMediaEventQueue *iface) +{ + mfeventqueue *This = impl_from_IMFMediaEventQueue(iface); + ULONG ref = InterlockedIncrement(&This->ref); + + TRACE("(%p) ref=%u\n", This, ref); + + return ref; +} + +static ULONG WINAPI mfeventqueue_Release(IMFMediaEventQueue *iface) +{ + mfeventqueue *This = impl_from_IMFMediaEventQueue(iface); + ULONG ref = InterlockedDecrement(&This->ref); + + TRACE("(%p) ref=%u\n", This, ref); + + if (!ref) + { + HeapFree(GetProcessHeap(), 0, This); + } + + return ref; +} + +static HRESULT WINAPI mfeventqueue_GetEvent(IMFMediaEventQueue *iface, DWORD flags, IMFMediaEvent **event) +{ + mfeventqueue *This = impl_from_IMFMediaEventQueue(iface); + + FIXME("%p, %p\n", This, event); + + return E_NOTIMPL; +} + +static HRESULT WINAPI mfeventqueue_BeginGetEvent(IMFMediaEventQueue *iface, IMFAsyncCallback *callback, IUnknown *state) +{ + mfeventqueue *This = impl_from_IMFMediaEventQueue(iface); + + FIXME("%p, %p, %p\n", This, callback, state); + + return E_NOTIMPL; +} + +static HRESULT WINAPI mfeventqueue_EndGetEvent(IMFMediaEventQueue *iface, IMFAsyncResult *result, IMFMediaEvent **event) +{ + mfeventqueue *This = impl_from_IMFMediaEventQueue(iface); + + FIXME("%p, %p, %p\n", This, result, event); + + return E_NOTIMPL; +} + +static HRESULT WINAPI mfeventqueue_QueueEvent(IMFMediaEventQueue *iface, IMFMediaEvent *event) +{ + mfeventqueue *This = impl_from_IMFMediaEventQueue(iface); + + FIXME("%p, %p\n", This, event); + + return E_NOTIMPL; +} + +static HRESULT WINAPI mfeventqueue_QueueEventParamVar(IMFMediaEventQueue *iface, MediaEventType met, + REFGUID type, HRESULT status, const PROPVARIANT *value) +{ + mfeventqueue *This = impl_from_IMFMediaEventQueue(iface); + + FIXME("%p, %d, %s, 0x%08x, %p\n", This, met, debugstr_guid(type), status, value); + + return E_NOTIMPL; +} + +static HRESULT WINAPI mfeventqueue_QueueEventParamUnk(IMFMediaEventQueue *iface, MediaEventType met, REFGUID type, + HRESULT status, IUnknown *unk) +{ + mfeventqueue *This = impl_from_IMFMediaEventQueue(iface); + + FIXME("%p, %d, %s, 0x%08x, %p\n", This, met, debugstr_guid(type), status, unk); + + return E_NOTIMPL; +} + +static HRESULT WINAPI mfeventqueue_Shutdown(IMFMediaEventQueue *iface) +{ + mfeventqueue *This = impl_from_IMFMediaEventQueue(iface); + + FIXME("%p\n", This); + + return E_NOTIMPL; +} + +static const IMFMediaEventQueueVtbl mfeventqueue_vtbl = +{ + mfeventqueue_QueryInterface, + mfeventqueue_AddRef, + mfeventqueue_Release, + mfeventqueue_GetEvent, + mfeventqueue_BeginGetEvent, + mfeventqueue_EndGetEvent, + mfeventqueue_QueueEvent, + mfeventqueue_QueueEventParamVar, + mfeventqueue_QueueEventParamUnk, + mfeventqueue_Shutdown +}; + /*********************************************************************** * MFCreateEventQueue (mfplat.@) */ HRESULT WINAPI MFCreateEventQueue(IMFMediaEventQueue **queue) { - FIXME("%p\n", queue); + mfeventqueue *object; - if(queue) - *queue = NULL; + TRACE("%p\n", queue); - return E_FAIL; + object = HeapAlloc( GetProcessHeap(), 0, sizeof(*object) ); + if(!object) + return E_OUTOFMEMORY; + + object->ref = 1; + object->IMFMediaEventQueue_iface.lpVtbl = &mfeventqueue_vtbl; + + *queue = &object->IMFMediaEventQueue_iface; + + return S_OK; } typedef struct _mfdescriptor
1
0
0
0
Alistair Leslie-Hughes : mfplat: Implement MFCreateStreamDescriptor.
by Alexandre Julliard
11 Sep '17
11 Sep '17
Module: wine Branch: master Commit: 32ff8ea63e70593f23552b61a3f88d12a82367d5 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=32ff8ea63e70593f23552b61a…
Author: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Date: Fri Sep 8 11:00:12 2017 +0000 mfplat: Implement MFCreateStreamDescriptor. Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/mfplat/main.c | 411 ++++++++++++++++++++++++++++++++++++++++++++++++ dlls/mfplat/mfplat.spec | 2 +- include/mfidl.idl | 2 + 3 files changed, 414 insertions(+), 1 deletion(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=32ff8ea63e70593f23552…
1
0
0
0
Vincent Povirk : sane.ds: Add support for word list options.
by Alexandre Julliard
11 Sep '17
11 Sep '17
Module: wine Branch: master Commit: 31a4a58f81caf2aa6ee7a1e0540917b1b8ad7e14 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=31a4a58f81caf2aa6ee7a1e05…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Mon Sep 11 13:47:55 2017 -0500 sane.ds: Add support for word list options. Signed-off-by: Vincent Povirk <vincent(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/sane.ds/ui.c | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/dlls/sane.ds/ui.c b/dlls/sane.ds/ui.c index 5574c5a..9a9bcb0 100644 --- a/dlls/sane.ds/ui.c +++ b/dlls/sane.ds/ui.c @@ -716,6 +716,23 @@ static BOOL UpdateSaneBoolOption(int index, BOOL position) return FALSE; } +static BOOL UpdateSaneIntOption(int index, SANE_Int value) +{ + SANE_Status rc = SANE_STATUS_GOOD; + SANE_Int result = 0; + + rc = psane_control_option (activeDS.deviceHandle,index, + SANE_ACTION_SET_VALUE, &value, &result); + + if(rc == SANE_STATUS_GOOD) + { + if (result & SANE_INFO_RELOAD_OPTIONS || + result & SANE_INFO_RELOAD_PARAMS || result & SANE_INFO_INEXACT) + return TRUE; + } + return FALSE; +} + static BOOL UpdateSaneStringOption(int index, SANE_String value) { SANE_Status rc = SANE_STATUS_GOOD; @@ -791,6 +808,21 @@ static INT_PTR InitializeDialog(HWND hwnd) SendMessageA(control,BM_SETCHECK,BST_CHECKED,0); } + else if (opt->type == SANE_TYPE_INT && + opt->constraint_type == SANE_CONSTRAINT_WORD_LIST) + { + int j, count = opt->constraint.word_list[0]; + CHAR buffer[16]; + SANE_Int val; + for (j=1; j<=count; j++) + { + sprintf(buffer, "%d", opt->constraint.word_list[j]); + SendMessageA(control, CB_ADDSTRING, 0, (LPARAM)buffer); + } + psane_control_option(activeDS.deviceHandle, i, SANE_ACTION_GET_VALUE, &val, NULL); + sprintf(buffer, "%d", val); + SendMessageA(control,CB_SELECTSTRING,0,(LPARAM)buffer); + } else if (opt->constraint_type == SANE_CONSTRAINT_RANGE) { if (opt->type == SANE_TYPE_INT) @@ -977,6 +1009,11 @@ static void ComboChanged(HWND hwnd, INT id, HWND control) if (UpdateSaneStringOption(index, value)) InitializeDialog(hwnd); } + else if (opt->type == SANE_TYPE_INT) + { + if (UpdateSaneIntOption(index, atoi(value))) + InitializeDialog(hwnd); + } }
1
0
0
0
Vincent Povirk : loader/wine.inf: Put 32-bit .ds fakedlls in windows/ twain_32.
by Alexandre Julliard
11 Sep '17
11 Sep '17
Module: wine Branch: master Commit: 72e5f1af3d4a3a8230081d74fff52f0dacb6be9d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=72e5f1af3d4a3a8230081d74f…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Mon Sep 11 12:44:48 2017 -0500 loader/wine.inf: Put 32-bit .ds fakedlls in windows/twain_32. Some programs search for TWAIN devices by listing this directory. Signed-off-by: Vincent Povirk <vincent(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- loader/wine.inf.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/loader/wine.inf.in b/loader/wine.inf.in index 0b3c940..d22137f 100644 --- a/loader/wine.inf.in +++ b/loader/wine.inf.in @@ -2517,6 +2517,8 @@ HKLM,%CurrentVersion%\Telephony\Country List\998,"SameAreaRule",,"G" 10,,rundll.exe,rundll.exe16 10,,twain.dll,twain.dll16 10,,twain_32.dll +10,twain_32,sane.ds +10,twain_32,gphoto2.ds 10,,winhelp.exe,winhelp.exe16 10,,winhlp32.exe 10,command,start.exe
1
0
0
0
Daniel Lehman : msvcrt: Use exception base to create copy constructor pointer.
by Alexandre Julliard
11 Sep '17
11 Sep '17
Module: wine Branch: master Commit: 3ea70fa1e2c37df94c6c89e15d8f8fc06bbb22e3 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3ea70fa1e2c37df94c6c89e15…
Author: Daniel Lehman <dlehman(a)esri.com> Date: Fri Sep 8 10:32:07 2017 -0700 msvcrt: Use exception base to create copy constructor pointer. The exception base (exc_base) from the ExceptionRecord is used in find_caught_type to find the type info for the exception. All related type information is relative to this base, including the offset for the copy constructor. Signed-off-by: Daniel Lehman <dlehman(a)esri.com> Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msvcrt/except_x86_64.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dlls/msvcrt/except_x86_64.c b/dlls/msvcrt/except_x86_64.c index 7e9c38d..0820aad 100644 --- a/dlls/msvcrt/except_x86_64.c +++ b/dlls/msvcrt/except_x86_64.c @@ -248,7 +248,7 @@ static const cxx_type_info *find_caught_type(cxx_exception_type *exc_type, ULONG static inline void copy_exception(void *object, ULONG64 frame, DISPATCHER_CONTEXT *dispatch, const catchblock_info *catchblock, - const cxx_type_info *type) + const cxx_type_info *type, ULONG64 exc_base) { const type_info *catch_ti = rva_to_ptr(catchblock->type_info, dispatch->ImageBase); void **dest = rva_to_ptr(catchblock->offset, frame); @@ -273,13 +273,13 @@ static inline void copy_exception(void *object, ULONG64 frame, if (type->flags & CLASS_HAS_VIRTUAL_BASE_CLASS) { void (__cdecl *copy_ctor)(void*, void*, int) = - rva_to_ptr(type->copy_ctor, dispatch->ImageBase); + rva_to_ptr(type->copy_ctor, exc_base); copy_ctor(dest, get_this_pointer(&type->offsets, object), 1); } else { void (__cdecl *copy_ctor)(void*, void*) = - rva_to_ptr(type->copy_ctor, dispatch->ImageBase); + rva_to_ptr(type->copy_ctor, exc_base); copy_ctor(dest, get_this_pointer(&type->offsets, object)); } } @@ -462,7 +462,7 @@ static inline void find_catch_block(EXCEPTION_RECORD *rec, EXCEPTION_RECORD *unt /* copy the exception to its destination on the stack */ copy_exception((void*)rec->ExceptionInformation[1], - orig_frame, dispatch, catchblock, type); + orig_frame, dispatch, catchblock, type, exc_base); } else {
1
0
0
0
Alexandre Julliard : ntdll: Trace views once they are properly initialized.
by Alexandre Julliard
11 Sep '17
11 Sep '17
Module: wine Branch: master Commit: 78ab8aa46af48cb2189715537297068dc0199dab URL:
http://source.winehq.org/git/wine.git/?a=commit;h=78ab8aa46af48cb2189715537…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Sep 11 19:51:43 2017 +0200 ntdll: Trace views once they are properly initialized. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/virtual.c | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/dlls/ntdll/virtual.c b/dlls/ntdll/virtual.c index 6065b79..bcd9680 100644 --- a/dlls/ntdll/virtual.c +++ b/dlls/ntdll/virtual.c @@ -312,13 +312,15 @@ static void VIRTUAL_DumpView( struct file_view *view ) TRACE( "View: %p - %p", addr, addr + view->size - 1 ); if (view->protect & VPROT_SYSTEM) - TRACE( " (system)\n" ); - else if (view->protect & VPROT_VALLOC) - TRACE( " (valloc)\n" ); - else if (view->mapping) - TRACE( " %p\n", view->mapping ); + TRACE( " (builtin image)\n" ); + else if (view->protect & SEC_IMAGE) + TRACE( " (image) %p\n", view->mapping ); + else if (view->protect & SEC_FILE) + TRACE( " (file) %p\n", view->mapping ); + else if (view->protect & (SEC_RESERVE | SEC_COMMIT)) + TRACE( " (anonymous) %p\n", view->mapping ); else - TRACE( " (anonymous)\n"); + TRACE( " (valloc)\n"); for (count = i = 1; i < view->size >> page_shift; i++, count++) { @@ -711,7 +713,6 @@ static NTSTATUS create_view( struct file_view **view_ret, void *base, size_t siz wine_rb_put( &views_tree, view->base, &view->entry ); *view_ret = view; - VIRTUAL_DEBUG_DUMP_VIEW( view ); if (force_exec_prot && (unix_prot & PROT_READ) && !(unix_prot & PROT_EXEC)) { @@ -849,15 +850,11 @@ static BOOL VIRTUAL_SetProt( struct file_view *view, /* [in] Pointer to view */ { int unix_prot = VIRTUAL_GetUnixProt(vprot); - TRACE("%p-%p %s\n", - base, (char *)base + size - 1, VIRTUAL_GetProtStr( vprot ) ); - if (view->protect & VPROT_WRITEWATCH) { /* each page may need different protections depending on write watch flag */ set_page_vprot_bits( base, size, vprot & ~VPROT_WRITEWATCH, ~vprot & ~VPROT_WRITEWATCH ); mprotect_range( view, base, size, 0, 0 ); - VIRTUAL_DEBUG_DUMP_VIEW( view ); return TRUE; } @@ -869,7 +866,6 @@ static BOOL VIRTUAL_SetProt( struct file_view *view, /* [in] Pointer to view */ { set_page_vprot( base, size, vprot ); mprotect( base, size, unix_prot ); - VIRTUAL_DEBUG_DUMP_VIEW( view ); return TRUE; } @@ -877,7 +873,6 @@ static BOOL VIRTUAL_SetProt( struct file_view *view, /* [in] Pointer to view */ return FALSE; set_page_vprot( base, size, vprot ); - VIRTUAL_DEBUG_DUMP_VIEW( view ); return TRUE; } @@ -1482,6 +1477,7 @@ static NTSTATUS map_image( HANDLE hmapping, int fd, char *base, SIZE_T total_siz done: view->mapping = dup_mapping; view->map_protect = map_vprot; + VIRTUAL_DEBUG_DUMP_VIEW( view ); server_leave_uninterrupted_section( &csVirtual, &sigset ); *addr_ptr = ptr; @@ -1651,6 +1647,7 @@ NTSTATUS virtual_create_builtin_view( void *module ) if (sec[i].Characteristics & IMAGE_SCN_MEM_WRITE) flags |= VPROT_WRITE; set_page_vprot( (char *)base + sec[i].VirtualAddress, sec[i].Misc.VirtualSize, flags ); } + VIRTUAL_DEBUG_DUMP_VIEW( view ); } server_leave_uninterrupted_section( &csVirtual, &sigset ); return status; @@ -1692,6 +1689,7 @@ NTSTATUS virtual_alloc_thread_stack( TEB *teb, SIZE_T reserve_size, SIZE_T commi VIRTUAL_SetProt( view, view->base, page_size, VPROT_COMMITTED ); VIRTUAL_SetProt( view, (char *)view->base + page_size, page_size, VPROT_READ | VPROT_WRITE | VPROT_COMMITTED | VPROT_GUARD ); + VIRTUAL_DEBUG_DUMP_VIEW( view ); /* note: limit is lower than base since the stack grows down */ teb->DeallocationStack = view->base; @@ -2119,6 +2117,7 @@ NTSTATUS WINAPI NtAllocateVirtualMemory( HANDLE process, PVOID *ret, ULONG zero_ status = allocate_dos_memory( &view, vprot ); if (status == STATUS_SUCCESS) { + VIRTUAL_DEBUG_DUMP_VIEW( view ); *ret = view->base; *size_ptr = view->size; } @@ -2180,6 +2179,8 @@ NTSTATUS WINAPI NtAllocateVirtualMemory( HANDLE process, PVOID *ret, ULONG zero_ } } + if (!status) VIRTUAL_DEBUG_DUMP_VIEW( view ); + if (use_locks) server_leave_uninterrupted_section( &csVirtual, &sigset ); if (status == STATUS_SUCCESS) @@ -2378,6 +2379,8 @@ NTSTATUS WINAPI NtProtectVirtualMemory( HANDLE process, PVOID *addr_ptr, SIZE_T } else status = STATUS_INVALID_PARAMETER; + if (!status) VIRTUAL_DEBUG_DUMP_VIEW( view ); + server_leave_uninterrupted_section( &csVirtual, &sigset ); if (status == STATUS_SUCCESS) @@ -2891,6 +2894,7 @@ NTSTATUS WINAPI NtMapViewOfSection( HANDLE handle, HANDLE process, PVOID *addr_p view->mapping = dup_mapping; view->map_protect = map_vprot; dup_mapping = 0; /* don't close it */ + VIRTUAL_DEBUG_DUMP_VIEW( view ); } else {
1
0
0
0
← Newer
1
...
30
31
32
33
34
35
36
...
45
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
Results per page:
10
25
50
100
200