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
June 2015
----- 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
610 discussions
Start a n
N
ew thread
Bruno Jesus : ws2_32: UDP sockets can write data even when unbound.
by Alexandre Julliard
19 Jun '15
19 Jun '15
Module: wine Branch: master Commit: 45677e173d6efb64e6ab29689df118f2b15628fd URL:
http://source.winehq.org/git/wine.git/?a=commit;h=45677e173d6efb64e6ab29689…
Author: Bruno Jesus <00cpxxx(a)gmail.com> Date: Thu Jun 18 11:03:10 2015 -0300 ws2_32: UDP sockets can write data even when unbound. --- dlls/ws2_32/socket.c | 3 ++- dlls/ws2_32/tests/sock.c | 2 -- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c index 63c965e..4fe3a0b 100644 --- a/dlls/ws2_32/socket.c +++ b/dlls/ws2_32/socket.c @@ -4708,7 +4708,8 @@ static struct pollfd *fd_sets_to_poll( const WS_fd_set *readfds, const WS_fd_set fds[j].fd = get_sock_fd( writefds->fd_array[i], FILE_WRITE_DATA, NULL ); if (fds[j].fd == -1) goto failed; fds[j].revents = 0; - if (is_fd_bound(fds[j].fd, NULL, NULL) == 1) + if (is_fd_bound(fds[j].fd, NULL, NULL) == 1 || + _get_fd_type(fds[j].fd) == SOCK_DGRAM) { fds[j].events = POLLOUT; } diff --git a/dlls/ws2_32/tests/sock.c b/dlls/ws2_32/tests/sock.c index 7335faa..2d14496 100644 --- a/dlls/ws2_32/tests/sock.c +++ b/dlls/ws2_32/tests/sock.c @@ -3877,9 +3877,7 @@ todo_wine FD_ZERO_ALL(); FD_SET_ALL(fdWrite); ret = select(0, &readfds, &writefds, &exceptfds, &select_timeout); -todo_wine ok(ret == 1, "expected 1, got %d\n", ret); -todo_wine ok(FD_ISSET(fdWrite, &writefds), "fdWrite socket is not in the set\n"); closesocket(fdWrite); }
1
0
0
0
Bruno Jesus : ws2_32: Add a helper to get socket type.
by Alexandre Julliard
19 Jun '15
19 Jun '15
Module: wine Branch: master Commit: 9d558c5c5fafe816a6e0e90ec3f5031fff702b66 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9d558c5c5fafe816a6e0e90ec…
Author: Bruno Jesus <00cpxxx(a)gmail.com> Date: Thu Jun 18 11:03:08 2015 -0300 ws2_32: Add a helper to get socket type. --- dlls/ws2_32/socket.c | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c index d7c3ff3..63c965e 100644 --- a/dlls/ws2_32/socket.c +++ b/dlls/ws2_32/socket.c @@ -1096,6 +1096,14 @@ static int _get_sock_error(SOCKET s, unsigned int bit) return events[bit]; } +static int _get_fd_type(int fd) +{ + int sock_type = -1; + socklen_t optlen = sizeof(sock_type); + getsockopt(fd, SOL_SOCKET, SO_TYPE, (char*) &sock_type, &optlen); + return sock_type; +} + static struct per_thread_data *get_per_thread_data(void) { struct per_thread_data * ptb = NtCurrentTeb()->WinSockData; @@ -2778,8 +2786,6 @@ static int WINAPI WS2_WSARecvMsg( SOCKET s, LPWSAMSG msg, LPDWORD lpNumberOfByte static BOOL interface_bind( SOCKET s, int fd, struct sockaddr *addr ) { struct sockaddr_in *in_sock = (struct sockaddr_in *) addr; - unsigned int sock_type = 0; - socklen_t optlen = sizeof(sock_type); in_addr_t bind_addr = in_sock->sin_addr.s_addr; PIP_ADAPTER_INFO adapters = NULL, adapter; BOOL ret = FALSE; @@ -2788,7 +2794,7 @@ static BOOL interface_bind( SOCKET s, int fd, struct sockaddr *addr ) if (bind_addr == htonl(INADDR_ANY) || bind_addr == htonl(INADDR_LOOPBACK)) return FALSE; /* Not binding to a network adapter, special interface binding unnecessary. */ - if (getsockopt(fd, SOL_SOCKET, SO_TYPE, &sock_type, &optlen) == -1 || sock_type != SOCK_DGRAM) + if (_get_fd_type(fd) != SOCK_DGRAM) return FALSE; /* Special interface binding is only necessary for UDP datagrams. */ if (GetAdaptersInfo(NULL, &adap_size) != ERROR_BUFFER_OVERFLOW) goto cleanup; @@ -3231,12 +3237,12 @@ static void interface_bind_check(int fd, struct sockaddr_in *addr) return; #else int ifindex; - socklen_t len = sizeof(ifindex); + socklen_t len; /* Check for IPv4, address 0.0.0.0 and UDP socket */ if (addr->sin_family != AF_INET || addr->sin_addr.s_addr != 0) return; - if (getsockopt(fd, SOL_SOCKET, SO_TYPE, &ifindex, &len) || ifindex != SOCK_DGRAM) + if (_get_fd_type(fd) != SOCK_DGRAM) return; ifindex = -1; @@ -3547,8 +3553,7 @@ INT WINAPI WS_getsockopt(SOCKET s, INT level, case WS_SO_LINGER: { struct linger lingval; - int so_type; - socklen_t len = sizeof(struct linger), slen = sizeof(int); + socklen_t len = sizeof(struct linger); /* struct linger and LINGER have different sizes */ if (!optlen || *optlen < sizeof(LINGER) || !optval) @@ -3559,7 +3564,7 @@ INT WINAPI WS_getsockopt(SOCKET s, INT level, if ( (fd = get_sock_fd( s, 0, NULL )) == -1) return SOCKET_ERROR; - if ((getsockopt(fd, SOL_SOCKET, SO_TYPE, &so_type, &slen) == 0 && so_type == SOCK_DGRAM)) + if (_get_fd_type(fd) == SOCK_DGRAM) { SetLastError(WSAENOPROTOOPT); ret = SOCKET_ERROR; @@ -3643,6 +3648,7 @@ INT WINAPI WS_getsockopt(SOCKET s, INT level, } case WS_SO_TYPE: { + int sock_type; if (!optlen || *optlen < sizeof(int) || !optval) { SetLastError(WSAEFAULT); @@ -3651,13 +3657,14 @@ INT WINAPI WS_getsockopt(SOCKET s, INT level, if ( (fd = get_sock_fd( s, 0, NULL )) == -1) return SOCKET_ERROR; - if (getsockopt(fd, SOL_SOCKET, SO_TYPE, optval, (socklen_t *)optlen) != 0 ) + sock_type = _get_fd_type(fd); + if (sock_type == -1) { SetLastError(wsaErrno()); ret = SOCKET_ERROR; } else - (*(int *)optval) = convert_socktype_u2w(*(int *)optval); + (*(int *)optval) = convert_socktype_u2w(sock_type); release_sock_fd( s, fd ); return ret;
1
0
0
0
Jacek Caban : wininet: Don't use blocking_mode_t in netconn.c.
by Alexandre Julliard
19 Jun '15
19 Jun '15
Module: wine Branch: master Commit: 9d7d27ea7f8781e81f8efa343f4f12b998f156ac URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9d7d27ea7f8781e81f8efa343…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Thu Jun 18 15:17:46 2015 +0200 wininet: Don't use blocking_mode_t in netconn.c. --- dlls/wininet/http.c | 6 ++++++ dlls/wininet/internet.h | 6 ------ dlls/wininet/netconnection.c | 35 ++++++++++++++--------------------- 3 files changed, 20 insertions(+), 27 deletions(-) diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c index 42654a2..3be88b7 100644 --- a/dlls/wininet/http.c +++ b/dlls/wininet/http.c @@ -380,6 +380,12 @@ static WCHAR *get_host_header( http_request_t *req ) return ret; } +typedef enum { + BLOCKING_ALLOW, + BLOCKING_DISALLOW, + BLOCKING_WAITALL +} blocking_mode_t; + struct data_stream_vtbl_t { DWORD (*get_avail_data)(data_stream_t*,http_request_t*); BOOL (*end_of_data)(data_stream_t*,http_request_t*); diff --git a/dlls/wininet/internet.h b/dlls/wininet/internet.h index 955c7c5..4044bbf 100644 --- a/dlls/wininet/internet.h +++ b/dlls/wininet/internet.h @@ -415,12 +415,6 @@ VOID INTERNET_SendCallback(object_header_t *hdr, DWORD_PTR dwContext, DWORD dwStatusInfoLength) DECLSPEC_HIDDEN; BOOL INTERNET_FindProxyForProtocol(LPCWSTR szProxy, LPCWSTR proto, WCHAR *foundProxy, DWORD *foundProxyLen) DECLSPEC_HIDDEN; -typedef enum { - BLOCKING_ALLOW, - BLOCKING_DISALLOW, - BLOCKING_WAITALL -} blocking_mode_t; - DWORD create_netconn(BOOL,server_t*,DWORD,BOOL,DWORD,netconn_t**) DECLSPEC_HIDDEN; void free_netconn(netconn_t*) DECLSPEC_HIDDEN; void NETCON_unload(void) DECLSPEC_HIDDEN; diff --git a/dlls/wininet/netconnection.c b/dlls/wininet/netconnection.c index e82dd30..40f53de 100644 --- a/dlls/wininet/netconnection.c +++ b/dlls/wininet/netconnection.c @@ -280,9 +280,9 @@ void init_winsock(void) InitOnceExecuteOnce(&init_once, winsock_startup, NULL, NULL); } -static void set_socket_blocking(int socket, blocking_mode_t mode) +static void set_socket_blocking(int socket, BOOL is_blocking) { - ULONG arg = mode == BLOCKING_DISALLOW; + ULONG arg = !is_blocking; ioctlsocket(socket, FIONBIO, &arg); } @@ -297,7 +297,7 @@ static DWORD create_netconn_socket(server_t *server, netconn_t *netconn, DWORD t assert(server->addr_len); result = netconn->socket = socket(server->addr.ss_family, SOCK_STREAM, 0); if(result != -1) { - set_socket_blocking(netconn->socket, BLOCKING_DISALLOW); + set_socket_blocking(netconn->socket, FALSE); result = connect(netconn->socket, (struct sockaddr*)&server->addr, server->addr_len); if(result == -1) { @@ -326,7 +326,7 @@ static DWORD create_netconn_socket(server_t *server, netconn_t *netconn, DWORD t netconn->socket = -1; } else { - set_socket_blocking(netconn->socket, BLOCKING_ALLOW); + set_socket_blocking(netconn->socket, TRUE); } } if(result == -1) @@ -688,22 +688,17 @@ DWORD NETCON_send(netconn_t *connection, const void *msg, size_t len, int flags, } } -static BOOL read_ssl_chunk(netconn_t *conn, void *buf, SIZE_T buf_size, blocking_mode_t mode, SIZE_T *ret_size, BOOL *eof) +static BOOL read_ssl_chunk(netconn_t *conn, void *buf, SIZE_T buf_size, BOOL blocking, SIZE_T *ret_size, BOOL *eof) { const SIZE_T ssl_buf_size = conn->ssl_sizes.cbHeader+conn->ssl_sizes.cbMaximumMessage+conn->ssl_sizes.cbTrailer; SecBuffer bufs[4]; SecBufferDesc buf_desc = {SECBUFFER_VERSION, sizeof(bufs)/sizeof(*bufs), bufs}; SSIZE_T size, buf_len = 0; - blocking_mode_t tmp_mode; int i; SECURITY_STATUS res; assert(conn->extra_len < ssl_buf_size); - /* BLOCKING_WAITALL is handled by caller */ - if(mode == BLOCKING_WAITALL) - mode = BLOCKING_ALLOW; - if(conn->extra_len) { memcpy(conn->ssl_buf, conn->extra_buf, conn->extra_len); buf_len = conn->extra_len; @@ -712,8 +707,7 @@ static BOOL read_ssl_chunk(netconn_t *conn, void *buf, SIZE_T buf_size, blocking conn->extra_buf = NULL; } - tmp_mode = buf_len ? BLOCKING_DISALLOW : mode; - set_socket_blocking(conn->socket, tmp_mode); + set_socket_blocking(conn->socket, blocking && !buf_len); size = sock_recv(conn->socket, conn->ssl_buf+buf_len, ssl_buf_size-buf_len, 0); if(size < 0) { if(!buf_len) { @@ -728,11 +722,10 @@ static BOOL read_ssl_chunk(netconn_t *conn, void *buf, SIZE_T buf_size, blocking buf_len += size; } - *ret_size = buf_len; - if(!buf_len) { TRACE("EOF\n"); *eof = TRUE; + *ret_size = 0; return ERROR_SUCCESS; } @@ -755,7 +748,7 @@ static BOOL read_ssl_chunk(netconn_t *conn, void *buf, SIZE_T buf_size, blocking case SEC_E_INCOMPLETE_MESSAGE: assert(buf_len < ssl_buf_size); - set_socket_blocking(conn->socket, mode); + set_socket_blocking(conn->socket, blocking); size = sock_recv(conn->socket, conn->ssl_buf+buf_len, ssl_buf_size-buf_len, 0); if(size < 1) { if(size < 0 && WSAGetLastError() == WSAEWOULDBLOCK) { @@ -826,9 +819,9 @@ DWORD NETCON_recv(netconn_t *connection, void *buf, size_t len, BOOL blocking, i if (!connection->secure) { - set_socket_blocking(connection->socket, blocking ? BLOCKING_ALLOW : BLOCKING_DISALLOW); - *recvd = sock_recv(connection->socket, buf, len, 0); - return *recvd == -1 ? WSAGetLastError() : ERROR_SUCCESS; + set_socket_blocking(connection->socket, blocking); + *recvd = sock_recv(connection->socket, buf, len, 0); + return *recvd == -1 ? WSAGetLastError() : ERROR_SUCCESS; } else { @@ -852,7 +845,7 @@ DWORD NETCON_recv(netconn_t *connection, void *buf, size_t len, BOOL blocking, i } do { - res = read_ssl_chunk(connection, (BYTE*)buf+size, len-size, blocking ? BLOCKING_ALLOW : BLOCKING_DISALLOW, &size, &eof); + res = read_ssl_chunk(connection, (BYTE*)buf, len, blocking, &size, &eof); if(res != ERROR_SUCCESS) { if(res == WSAEWOULDBLOCK) { if(size) @@ -901,9 +894,9 @@ BOOL NETCON_is_alive(netconn_t *netconn) int len; char b; - set_socket_blocking(netconn->socket, BLOCKING_DISALLOW); + set_socket_blocking(netconn->socket, FALSE); len = sock_recv(netconn->socket, &b, 1, MSG_PEEK); - set_socket_blocking(netconn->socket, BLOCKING_ALLOW); + set_socket_blocking(netconn->socket, TRUE); return len == 1 || (len == -1 && WSAGetLastError() == WSAEWOULDBLOCK); }
1
0
0
0
Jacek Caban : wininet: Get rid of unneeded MSG_WAITALL support in NETCON_recv.
by Alexandre Julliard
18 Jun '15
18 Jun '15
Module: wine Branch: master Commit: 6fe55462107b4dcc31f919296a6e5870dcc881a3 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6fe55462107b4dcc31f919296…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Thu Jun 18 13:28:24 2015 +0200 wininet: Get rid of unneeded MSG_WAITALL support in NETCON_recv. --- dlls/wininet/http.c | 11 +++++------ dlls/wininet/internet.h | 2 +- dlls/wininet/netconnection.c | 33 +++++++++------------------------ 3 files changed, 15 insertions(+), 31 deletions(-) diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c index f4f67cb..42654a2 100644 --- a/dlls/wininet/http.c +++ b/dlls/wininet/http.c @@ -2513,7 +2513,7 @@ static DWORD read_more_data( http_request_t *req, int maxlen ) if (maxlen == -1) maxlen = sizeof(req->read_buf); res = NETCON_recv( req->netconn, req->read_buf + req->read_size, - maxlen - req->read_size, BLOCKING_ALLOW, &len ); + maxlen - req->read_size, TRUE, &len ); if(res == ERROR_SUCCESS) req->read_size += len; @@ -2664,8 +2664,7 @@ static DWORD netconn_read(data_stream_t *stream, http_request_t *req, BYTE *buf, size = min(size, netconn_stream->content_length-netconn_stream->content_read); if(size && is_valid_netconn(req->netconn)) { - while((res = NETCON_recv(req->netconn, buf+ret, size-ret, - blocking_mode == BLOCKING_WAITALL ? BLOCKING_ALLOW : blocking_mode, &len)) == ERROR_SUCCESS) { + while((res = NETCON_recv(req->netconn, buf+ret, size-ret, blocking_mode != BLOCKING_DISALLOW, &len)) == ERROR_SUCCESS) { if(!len) { netconn_stream->content_length = netconn_stream->content_read; break; @@ -2695,7 +2694,7 @@ static BOOL netconn_drain_content(data_stream_t *stream, http_request_t *req) return TRUE; do { - if(NETCON_recv(req->netconn, buf, sizeof(buf), BLOCKING_DISALLOW, &len) != ERROR_SUCCESS) + if(NETCON_recv(req->netconn, buf, sizeof(buf), FALSE, &len) != ERROR_SUCCESS) return FALSE; netconn_stream->content_read += len; @@ -2735,7 +2734,7 @@ static DWORD read_more_chunked_data(chunked_stream_t *stream, http_request_t *re if (maxlen == -1) maxlen = sizeof(stream->buf); res = NETCON_recv( req->netconn, stream->buf + stream->buf_size, - maxlen - stream->buf_size, BLOCKING_ALLOW, &len ); + maxlen - stream->buf_size, TRUE, &len ); if(res == ERROR_SUCCESS) stream->buf_size += len; @@ -2871,7 +2870,7 @@ static DWORD chunked_read(data_stream_t *stream, http_request_t *req, BYTE *buf, break; } - res = NETCON_recv(req->netconn, (char *)buf+ret_read, read_bytes, BLOCKING_ALLOW, (int*)&read_bytes); + res = NETCON_recv(req->netconn, (char *)buf+ret_read, read_bytes, TRUE, (int*)&read_bytes); if(res != ERROR_SUCCESS) break; } diff --git a/dlls/wininet/internet.h b/dlls/wininet/internet.h index 40951b6..955c7c5 100644 --- a/dlls/wininet/internet.h +++ b/dlls/wininet/internet.h @@ -427,7 +427,7 @@ void NETCON_unload(void) DECLSPEC_HIDDEN; DWORD NETCON_secure_connect(netconn_t*,server_t*) DECLSPEC_HIDDEN; DWORD NETCON_send(netconn_t *connection, const void *msg, size_t len, int flags, int *sent /* out */) DECLSPEC_HIDDEN; -DWORD NETCON_recv(netconn_t*,void*,size_t,blocking_mode_t,int*) DECLSPEC_HIDDEN; +DWORD NETCON_recv(netconn_t*,void*,size_t,BOOL,int*) DECLSPEC_HIDDEN; BOOL NETCON_query_data_available(netconn_t *connection, DWORD *available) DECLSPEC_HIDDEN; BOOL NETCON_is_alive(netconn_t*) DECLSPEC_HIDDEN; LPCVOID NETCON_GetCert(netconn_t *connection) DECLSPEC_HIDDEN; diff --git a/dlls/wininet/netconnection.c b/dlls/wininet/netconnection.c index 9f64cb9..e82dd30 100644 --- a/dlls/wininet/netconnection.c +++ b/dlls/wininet/netconnection.c @@ -731,6 +731,7 @@ static BOOL read_ssl_chunk(netconn_t *conn, void *buf, SIZE_T buf_size, blocking *ret_size = buf_len; if(!buf_len) { + TRACE("EOF\n"); *eof = TRUE; return ERROR_SUCCESS; } @@ -817,7 +818,7 @@ static BOOL read_ssl_chunk(netconn_t *conn, void *buf, SIZE_T buf_size, blocking * Basically calls 'recv()' unless we should use SSL * number of chars received is put in *recvd */ -DWORD NETCON_recv(netconn_t *connection, void *buf, size_t len, blocking_mode_t mode, int *recvd) +DWORD NETCON_recv(netconn_t *connection, void *buf, size_t len, BOOL blocking, int *recvd) { *recvd = 0; if (!len) @@ -825,18 +826,13 @@ DWORD NETCON_recv(netconn_t *connection, void *buf, size_t len, blocking_mode_t if (!connection->secure) { - int flags = 0; - - if(mode == BLOCKING_WAITALL) - flags = MSG_WAITALL; - - set_socket_blocking(connection->socket, mode); - *recvd = sock_recv(connection->socket, buf, len, flags); + set_socket_blocking(connection->socket, blocking ? BLOCKING_ALLOW : BLOCKING_DISALLOW); + *recvd = sock_recv(connection->socket, buf, len, 0); return *recvd == -1 ? WSAGetLastError() : ERROR_SUCCESS; } else { - SIZE_T size = 0, cread; + SIZE_T size = 0; BOOL eof; DWORD res; @@ -850,17 +846,13 @@ DWORD NETCON_recv(netconn_t *connection, void *buf, size_t len, blocking_mode_t heap_free(connection->peek_msg_mem); connection->peek_msg_mem = connection->peek_msg = NULL; } - /* check if we have enough data from the peek buffer */ - if(mode != BLOCKING_WAITALL || size == len) { - *recvd = size; - return ERROR_SUCCESS; - } - mode = BLOCKING_DISALLOW; + *recvd = size; + return ERROR_SUCCESS; } do { - res = read_ssl_chunk(connection, (BYTE*)buf+size, len-size, mode, &cread, &eof); + res = read_ssl_chunk(connection, (BYTE*)buf+size, len-size, blocking ? BLOCKING_ALLOW : BLOCKING_DISALLOW, &size, &eof); if(res != ERROR_SUCCESS) { if(res == WSAEWOULDBLOCK) { if(size) @@ -870,14 +862,7 @@ DWORD NETCON_recv(netconn_t *connection, void *buf, size_t len, blocking_mode_t } break; } - - if(eof) { - TRACE("EOF\n"); - break; - } - - size += cread; - }while(!size || (mode == BLOCKING_WAITALL && size < len)); + }while(!size && !eof); TRACE("received %ld bytes\n", size); *recvd = size;
1
0
0
0
Jacek Caban : mshtml: Use test.winehq.org over http in img_onload tests.
by Alexandre Julliard
18 Jun '15
18 Jun '15
Module: wine Branch: master Commit: e250e545305a3bf01648f88670d63face7e24103 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e250e545305a3bf01648f8867…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Thu Jun 18 13:11:07 2015 +0200 mshtml: Use
test.winehq.org
over http in img_onload tests. --- dlls/mshtml/tests/events.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/mshtml/tests/events.c b/dlls/mshtml/tests/events.c index 07549e3..69f21df 100644 --- a/dlls/mshtml/tests/events.c +++ b/dlls/mshtml/tests/events.c @@ -1854,7 +1854,7 @@ static void test_imgload(IHTMLDocument2 *doc) ok(V_DISPATCH(&v) == (IDispatch*)&img_onerror_obj, "V_DISPATCH(onerror) != onerrorFunc\n"); VariantClear(&v); - str = a2bstr("
https://www.winehq.org/images/winehq_logo_text.png
"); + str = a2bstr("
http://test.winehq.org/tests/winehq_snapshot/index_files/winehq_logo_text.p…
"); hres = IHTMLImgElement_put_src(img, str); ok(hres == S_OK, "put_src failed: %08x\n", hres); SysFreeString(str);
1
0
0
0
Jacek Caban : secur32: Fixed compilation on very old gnutls versions.
by Alexandre Julliard
18 Jun '15
18 Jun '15
Module: wine Branch: master Commit: cae3f98c6938663aab248f6551e9cc7cfbc1ce09 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=cae3f98c6938663aab248f655…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Thu Jun 18 13:06:08 2015 +0200 secur32: Fixed compilation on very old gnutls versions. --- dlls/secur32/schannel_gnutls.c | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/dlls/secur32/schannel_gnutls.c b/dlls/secur32/schannel_gnutls.c index c0b6f80..d2c64fc 100644 --- a/dlls/secur32/schannel_gnutls.c +++ b/dlls/secur32/schannel_gnutls.c @@ -41,6 +41,9 @@ WINE_DEFAULT_DEBUG_CHANNEL(secur32); WINE_DECLARE_DEBUG_CHANNEL(winediag); +/* Not present in gnutls version < 2.9.10. */ +extern int gnutls_cipher_get_block_size(gnutls_cipher_algorithm_t algorithm); + static void *libgnutls_handle; #define MAKE_FUNCPTR(f) static typeof(f) * p##f MAKE_FUNCPTR(gnutls_alert_get); @@ -77,10 +80,34 @@ MAKE_FUNCPTR(gnutls_transport_set_push_function); #undef MAKE_FUNCPTR #if GNUTLS_VERSION_MAJOR < 3 +#define GNUTLS_CIPHER_AES_192_CBC 92 #define GNUTLS_CIPHER_AES_128_GCM 93 #define GNUTLS_CIPHER_AES_256_GCM 94 #endif +static int compat_cipher_get_block_size(gnutls_cipher_algorithm_t cipher) +{ + switch(cipher) { + case GNUTLS_CIPHER_3DES_CBC: + return 8; + case GNUTLS_CIPHER_AES_128_CBC: + case GNUTLS_CIPHER_AES_256_CBC: + return 16; + case GNUTLS_CIPHER_ARCFOUR_128: + case GNUTLS_CIPHER_ARCFOUR_40: + return 1; + case GNUTLS_CIPHER_DES_CBC: + return 8; + case GNUTLS_CIPHER_NULL: + return 1; + case GNUTLS_CIPHER_RC2_40_CBC: + return 8; + default: + FIXME("Unknown cipher %#x, returning 1\n", cipher); + return 1; + } +} + static ssize_t schan_pull_adapter(gnutls_transport_ptr_t transport, void *buff, size_t buff_len) { @@ -474,7 +501,6 @@ BOOL schan_imp_init(void) LOAD_FUNCPTR(gnutls_certificate_free_credentials) LOAD_FUNCPTR(gnutls_certificate_get_peers) LOAD_FUNCPTR(gnutls_cipher_get) - LOAD_FUNCPTR(gnutls_cipher_get_block_size) LOAD_FUNCPTR(gnutls_cipher_get_key_size) LOAD_FUNCPTR(gnutls_credentials_set) LOAD_FUNCPTR(gnutls_deinit) @@ -501,6 +527,12 @@ BOOL schan_imp_init(void) LOAD_FUNCPTR(gnutls_transport_set_push_function) #undef LOAD_FUNCPTR + if (!(pgnutls_cipher_get_block_size = wine_dlsym(libgnutls_handle, "gnutls_cipher_get_block_size", NULL, 0))) + { + WARN("gnutls_cipher_get_block_size not found\n"); + pgnutls_cipher_get_block_size = compat_cipher_get_block_size; + } + ret = pgnutls_global_init(); if (ret != GNUTLS_E_SUCCESS) {
1
0
0
0
Huw Davies : gdi32/tests: Fix Courier test on Arabic locales.
by Alexandre Julliard
18 Jun '15
18 Jun '15
Module: wine Branch: master Commit: 002cf965e16c296f4c928f42c752ef0ad652b6fc URL:
http://source.winehq.org/git/wine.git/?a=commit;h=002cf965e16c296f4c928f42c…
Author: Huw Davies <huw(a)codeweavers.com> Date: Thu Jun 18 09:45:35 2015 +0100 gdi32/tests: Fix Courier test on Arabic locales. --- dlls/gdi32/tests/font.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dlls/gdi32/tests/font.c b/dlls/gdi32/tests/font.c index 5388df1..a590ce8 100644 --- a/dlls/gdi32/tests/font.c +++ b/dlls/gdi32/tests/font.c @@ -5704,9 +5704,11 @@ static void test_stock_fonts(void) { int charset, weight, height, height_pixels, dpi; const char face_name[LF_FACESIZE]; + WORD lang_id; } td[][11] = { { /* ANSI_FIXED_FONT */ + { ANSI_CHARSET, FW_NORMAL, 12, 12, 96, "Courier", LANG_ARABIC }, { DEFAULT_CHARSET, FW_NORMAL, 12, 13, 96, "Courier" }, { DEFAULT_CHARSET, FW_NORMAL, 12, 13, 120, "Courier" }, { 0 } @@ -5769,7 +5771,8 @@ static void test_stock_fonts(void) for (j = 0; td[i][j].face_name[0] != 0; j++) { - if (lf.lfCharSet != td[i][j].charset && td[i][j].charset != DEFAULT_CHARSET) + if ((lf.lfCharSet != td[i][j].charset && td[i][j].charset != DEFAULT_CHARSET) || + (system_lang_id != td[i][j].lang_id && td[i][j].lang_id != LANG_NEUTRAL)) { continue; }
1
0
0
0
Nikolay Sivov : comctl32/monthcal: Fix title to use properly localized year/month format.
by Alexandre Julliard
18 Jun '15
18 Jun '15
Module: wine Branch: master Commit: 035d0a159431d9d6b9affff46ce7ff84d1d0e990 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=035d0a159431d9d6b9affff46…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Wed Jun 17 11:57:21 2015 +0300 comctl32/monthcal: Fix title to use properly localized year/month format. --- dlls/comctl32/monthcal.c | 76 +++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 63 insertions(+), 13 deletions(-) diff --git a/dlls/comctl32/monthcal.c b/dlls/comctl32/monthcal.c index a49fad7..5accbe6 100644 --- a/dlls/comctl32/monthcal.c +++ b/dlls/comctl32/monthcal.c @@ -866,10 +866,16 @@ static void MONTHCAL_PaintButton(MONTHCAL_INFO *infoPtr, HDC hdc, enum nav_direc /* paint a title with buttons and month/year string */ static void MONTHCAL_PaintTitle(MONTHCAL_INFO *infoPtr, HDC hdc, const PAINTSTRUCT *ps, INT calIdx) { - static const WCHAR fmt_monthW[] = { '%','s',' ','%','l','d',0 }; + static const WCHAR mmmmW[] = {'M','M','M','M',0}; + static const WCHAR mmmW[] = {'M','M','M',0}; + static const WCHAR mmW[] = {'M','M',0}; + static const WCHAR fmtyearW[] = {'%','l','d',0}; + static const WCHAR fmtmmW[] = {'%','0','2','d',0}; + static const WCHAR fmtmW[] = {'%','d',0}; RECT *title = &infoPtr->calendars[calIdx].title; const SYSTEMTIME *st = &infoPtr->calendars[calIdx].month; - WCHAR buf_month[80], buf_fmt[80]; + WCHAR monthW[80], strW[80], fmtW[80], yearW[6] /* valid year range is 1601-30827 */; + int yearoffset, monthoffset, shiftX; SIZE sz; /* fill header box */ @@ -880,21 +886,65 @@ static void MONTHCAL_PaintTitle(MONTHCAL_INFO *infoPtr, HDC hdc, const PAINTSTRU SetTextColor(hdc, infoPtr->colors[MCSC_TITLETEXT]); SelectObject(hdc, infoPtr->hBoldFont); - GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SMONTHNAME1 + st->wMonth - 1, - buf_month, countof(buf_month)); + /* draw formatted date string */ + GetDateFormatW(LOCALE_USER_DEFAULT, DATE_YEARMONTH, st, NULL, strW, countof(strW)); + DrawTextW(hdc, strW, strlenW(strW), title, DT_CENTER | DT_VCENTER | DT_SINGLELINE); + + GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SYEARMONTH, fmtW, countof(fmtW)); + wsprintfW(yearW, fmtyearW, st->wYear); + + /* month is trickier as it's possible to have different format pictures, we'll + test for M, MM, MMM, and MMMM */ + if (strstrW(fmtW, mmmmW)) + GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SMONTHNAME1+st->wMonth-1, monthW, countof(monthW)); + else if (strstrW(fmtW, mmmW)) + GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SABBREVMONTHNAME1+st->wMonth-1, monthW, countof(monthW)); + else if (strstrW(fmtW, mmW)) + wsprintfW(monthW, fmtmmW, st->wMonth); + else + wsprintfW(monthW, fmtmW, st->wMonth); - wsprintfW(buf_fmt, fmt_monthW, buf_month, st->wYear); - DrawTextW(hdc, buf_fmt, strlenW(buf_fmt), title, - DT_CENTER | DT_VCENTER | DT_SINGLELINE); + /* update hit boxes */ + yearoffset = 0; + while (strW[yearoffset]) + { + if (!strncmpW(&strW[yearoffset], yearW, strlenW(yearW))) + break; + yearoffset++; + } - /* update title rectangles with current month - used while testing hits */ - GetTextExtentPoint32W(hdc, buf_fmt, strlenW(buf_fmt), &sz); - infoPtr->calendars[calIdx].titlemonth.left = title->right / 2 + title->left / 2 - sz.cx / 2; - infoPtr->calendars[calIdx].titleyear.right = title->right / 2 + title->left / 2 + sz.cx / 2; + monthoffset = 0; + while (strW[monthoffset]) + { + if (!strncmpW(&strW[monthoffset], monthW, strlenW(monthW))) + break; + monthoffset++; + } + + /* for left limits use offsets */ + sz.cx = 0; + if (yearoffset) + GetTextExtentPoint32W(hdc, strW, yearoffset, &sz); + infoPtr->calendars[calIdx].titleyear.left = sz.cx; + + sz.cx = 0; + if (monthoffset) + GetTextExtentPoint32W(hdc, strW, monthoffset, &sz); + infoPtr->calendars[calIdx].titlemonth.left = sz.cx; - GetTextExtentPoint32W(hdc, buf_month, strlenW(buf_month), &sz); + /* for right limits use actual string parts lengths */ + GetTextExtentPoint32W(hdc, &strW[yearoffset], strlenW(yearW), &sz); + infoPtr->calendars[calIdx].titleyear.right = infoPtr->calendars[calIdx].titleyear.left + sz.cx; + + GetTextExtentPoint32W(hdc, monthW, strlenW(monthW), &sz); infoPtr->calendars[calIdx].titlemonth.right = infoPtr->calendars[calIdx].titlemonth.left + sz.cx; - infoPtr->calendars[calIdx].titleyear.left = infoPtr->calendars[calIdx].titlemonth.right; + + /* Finally translate rectangles to match center aligned string, + hit rectangles are relative to title rectangle before translation. */ + GetTextExtentPoint32W(hdc, strW, strlenW(strW), &sz); + shiftX = (title->right - title->left - sz.cx) / 2 + title->left; + OffsetRect(&infoPtr->calendars[calIdx].titleyear, shiftX, 0); + OffsetRect(&infoPtr->calendars[calIdx].titlemonth, shiftX, 0); } static void MONTHCAL_PaintWeeknumbers(const MONTHCAL_INFO *infoPtr, HDC hdc, const PAINTSTRUCT *ps, INT calIdx)
1
0
0
0
Nikolay Sivov : riched20: Improve tracing for unimplemented selection methods.
by Alexandre Julliard
18 Jun '15
18 Jun '15
Module: wine Branch: master Commit: 060cffc1b330f4087bd2a7f08d415aebaa5c0ddb URL:
http://source.winehq.org/git/wine.git/?a=commit;h=060cffc1b330f4087bd2a7f08…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Tue Jun 16 22:00:25 2015 +0300 riched20: Improve tracing for unimplemented selection methods. --- dlls/riched20/richole.c | 308 +++++++++++++++++++++++++++++++----------------- 1 file changed, 202 insertions(+), 106 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=060cffc1b330f4087bd2a…
1
0
0
0
Nikolay Sivov : dwrite/tests: Initial test for GetBaseline().
by Alexandre Julliard
18 Jun '15
18 Jun '15
Module: wine Branch: master Commit: 5df702af9e52939827b60d074be739daf8c30b86 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5df702af9e52939827b60d074…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Wed Jun 17 18:56:03 2015 +0300 dwrite/tests: Initial test for GetBaseline(). --- dlls/dwrite/tests/analyzer.c | 60 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/dlls/dwrite/tests/analyzer.c b/dlls/dwrite/tests/analyzer.c index c514bec..a3eaa38 100644 --- a/dlls/dwrite/tests/analyzer.c +++ b/dlls/dwrite/tests/analyzer.c @@ -1819,6 +1819,65 @@ static void test_GetGlyphOrientationTransform(void) IDWriteTextAnalyzer2_Release(analyzer2); } +static void test_GetBaseline(void) +{ + DWRITE_SCRIPT_ANALYSIS sa = { 0 }; + IDWriteTextAnalyzer1 *analyzer1; + IDWriteTextAnalyzer *analyzer; + IDWriteFontFace *fontface; + INT32 baseline; + BOOL exists; + HRESULT hr; + + hr = IDWriteFactory_CreateTextAnalyzer(factory, &analyzer); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IDWriteTextAnalyzer_QueryInterface(analyzer, &IID_IDWriteTextAnalyzer1, (void**)&analyzer1); + IDWriteTextAnalyzer_Release(analyzer); + if (hr != S_OK) { + win_skip("GetBaseline() is not supported.\n"); + return; + } + + fontface = create_fontface(); + + /* Tahoma doesn't have BASE table, it doesn't work even with simulation enabled */ + exists = TRUE; + baseline = 456; + hr = IDWriteTextAnalyzer1_GetBaseline(analyzer1, + fontface, + DWRITE_BASELINE_DEFAULT, + FALSE, + TRUE, + sa, + NULL, + &baseline, + &exists); +todo_wine { + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(baseline == 0, "got %d\n", baseline); + ok(exists == FALSE, "got %d\n", exists); +} + exists = TRUE; + baseline = 456; + hr = IDWriteTextAnalyzer1_GetBaseline(analyzer1, + fontface, + DWRITE_BASELINE_ROMAN, + FALSE, + TRUE, + sa, + NULL, + &baseline, + &exists); +todo_wine { + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(baseline == 0, "got %d\n", baseline); + ok(exists == FALSE, "got %d\n", exists); +} + IDWriteFontFace_Release(fontface); + IDWriteTextAnalyzer1_Release(analyzer1); +} + START_TEST(analyzer) { HRESULT hr; @@ -1844,6 +1903,7 @@ START_TEST(analyzer) test_GetGlyphPlacements(); test_ApplyCharacterSpacing(); test_GetGlyphOrientationTransform(); + test_GetBaseline(); IDWriteFactory_Release(factory); }
1
0
0
0
← Newer
1
...
20
21
22
23
24
25
26
...
61
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
Results per page:
10
25
50
100
200