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
January 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
492 discussions
Start a n
N
ew thread
Anton Romanov : ws2_32: Ignore IPV6_V6ONLY setsockopt for AF_INET sockets.
by Alexandre Julliard
12 Jan '17
12 Jan '17
Module: wine Branch: master Commit: 531dcf2dd3b1c5e9848afce422a6e0f2ee497597 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=531dcf2dd3b1c5e9848afce42…
Author: Anton Romanov <theli.ua(a)gmail.com> Date: Wed Jan 11 21:27:08 2017 -0800 ws2_32: Ignore IPV6_V6ONLY setsockopt for AF_INET sockets. Signed-off-by: Anton Romanov <theli.ua(a)gmail.com> Signed-off-by: Bruno Jesus <00cpxxx(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ws2_32/socket.c | 25 +++++++++++++++++++++++- dlls/ws2_32/tests/sock.c | 50 +++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 73 insertions(+), 2 deletions(-) diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c index 6bf3c9d..4977bbf 100644 --- a/dlls/ws2_32/socket.c +++ b/dlls/ws2_32/socket.c @@ -6016,7 +6016,6 @@ int WINAPI WS_setsockopt(SOCKET s, int level, int optname, case WS_IPV6_MULTICAST_HOPS: case WS_IPV6_MULTICAST_LOOP: case WS_IPV6_UNICAST_HOPS: - case WS_IPV6_V6ONLY: #ifdef IPV6_UNICAST_IF case WS_IPV6_UNICAST_IF: #endif @@ -6027,6 +6026,30 @@ int WINAPI WS_setsockopt(SOCKET s, int level, int optname, case WS_IPV6_PROTECTION_LEVEL: FIXME("IPV6_PROTECTION_LEVEL is ignored!\n"); return 0; + case WS_IPV6_V6ONLY: + { + union generic_unix_sockaddr uaddr; + socklen_t uaddrlen; + int bound; + + fd = get_sock_fd( s, 0, NULL ); + if (fd == -1) return SOCKET_ERROR; + + bound = is_fd_bound(fd, &uaddr, &uaddrlen); + release_sock_fd( s, fd ); + if (bound == 0 && uaddr.addr.sa_family == AF_INET) + { + /* Changing IPV6_V6ONLY succeeds on AF_INET (IPv4) socket + * on Windows (with IPv6 support) if the socket is unbound. + * It is essentially a noop, though Windows does store the value + */ + WARN("Silently ignoring IPPROTO_IPV6+IPV6_V6ONLY on AF_INET socket\n"); + return 0; + } + level = IPPROTO_IPV6; + optname = IPV6_V6ONLY; + break; + } default: FIXME("Unknown IPPROTO_IPV6 optname 0x%08x\n", optname); return SOCKET_ERROR; diff --git a/dlls/ws2_32/tests/sock.c b/dlls/ws2_32/tests/sock.c index ba755a5..5856718 100644 --- a/dlls/ws2_32/tests/sock.c +++ b/dlls/ws2_32/tests/sock.c @@ -6189,12 +6189,60 @@ static void test_ipv6only(void) } v4 = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); - ok(v4 != INVALID_SOCKET, "Could not create IPv6 socket (LastError: %d)\n", WSAGetLastError()); + ok(v4 != INVALID_SOCKET, "Could not create IPv4 socket (LastError: %d)\n", WSAGetLastError()); + +todo_wine { + enabled = 2; + ret = getsockopt(v4, IPPROTO_IPV6, IPV6_V6ONLY, (char*)&enabled, &len); + ok(!ret, "getsockopt(IPV6_ONLY) failed (LastError: %d)\n", WSAGetLastError()); + ok(enabled == 1, "expected 1, got %d\n", enabled); +} + + enabled = 0; + len = sizeof(enabled); + ret = setsockopt(v4, IPPROTO_IPV6, IPV6_V6ONLY, (char*)&enabled, len); + ok(!ret, "setsockopt(IPV6_ONLY) failed (LastError: %d)\n", WSAGetLastError()); + +todo_wine { + enabled = 2; + ret = getsockopt(v4, IPPROTO_IPV6, IPV6_V6ONLY, (char*)&enabled, &len); + ok(!ret, "getsockopt(IPV6_ONLY) failed (LastError: %d)\n", WSAGetLastError()); + ok(!enabled, "expected 0, got %d\n", enabled); +} + + enabled = 1; + len = sizeof(enabled); + ret = setsockopt(v4, IPPROTO_IPV6, IPV6_V6ONLY, (char*)&enabled, len); + ok(!ret, "setsockopt(IPV6_ONLY) failed (LastError: %d)\n", WSAGetLastError()); /* bind on IPv4 socket should succeed - IPV6_V6ONLY is enabled by default */ ret = bind(v4, (struct sockaddr*)&sin4, sizeof(sin4)); ok(!ret, "Could not bind IPv4 address (LastError: %d)\n", WSAGetLastError()); +todo_wine { + enabled = 2; + ret = getsockopt(v4, IPPROTO_IPV6, IPV6_V6ONLY, (char*)&enabled, &len); + ok(!ret, "getsockopt(IPV6_ONLY) failed (LastError: %d)\n", WSAGetLastError()); + ok(enabled == 1, "expected 1, got %d\n", enabled); +} + + enabled = 0; + len = sizeof(enabled); + ret = setsockopt(v4, IPPROTO_IPV6, IPV6_V6ONLY, (char*)&enabled, len); + ok(ret, "setsockopt(IPV6_ONLY) succeeded (LastError: %d)\n", WSAGetLastError()); + +todo_wine { + enabled = 0; + ret = getsockopt(v4, IPPROTO_IPV6, IPV6_V6ONLY, (char*)&enabled, &len); + ok(!ret, "getsockopt(IPV6_ONLY) failed (LastError: %d)\n", WSAGetLastError()); + ok(enabled == 1, "expected 1, got %d\n", enabled); +} + + enabled = 1; + len = sizeof(enabled); + ret = setsockopt(v4, IPPROTO_IPV6, IPV6_V6ONLY, (char*)&enabled, len); + ok(ret, "setsockopt(IPV6_ONLY) succeeded (LastError: %d)\n", WSAGetLastError()); + closesocket(v4); closesocket(v6);
1
0
0
0
Józef Kucia : ddraw/tests: Add test for display mode surface pixel format.
by Alexandre Julliard
12 Jan '17
12 Jan '17
Module: wine Branch: master Commit: 0bcc46874fea9b9e278304759443395394abbfd9 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=0bcc46874fea9b9e278304759…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Thu Jan 12 11:36:27 2017 +0100 ddraw/tests: Add test for display mode surface pixel format. Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ddraw/tests/ddraw1.c | 83 +++++++++++++++++++++++++++++++++++++++++++++++ dlls/ddraw/tests/ddraw2.c | 83 +++++++++++++++++++++++++++++++++++++++++++++++ dlls/ddraw/tests/ddraw4.c | 83 +++++++++++++++++++++++++++++++++++++++++++++++ dlls/ddraw/tests/ddraw7.c | 83 +++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 332 insertions(+) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=0bcc46874fea9b9e27830…
1
0
0
0
Józef Kucia : wined3d: Update "screen_format" when ChangeDisplaySettingsEx() call is redundant.
by Alexandre Julliard
12 Jan '17
12 Jan '17
Module: wine Branch: master Commit: 06cf77b343a36729754e9df34045a1b039b31c44 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=06cf77b343a36729754e9df34…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Thu Jan 12 11:36:26 2017 +0100 wined3d: Update "screen_format" when ChangeDisplaySettingsEx() call is redundant. This fixes a regression introduced by commit f6dde7062413a1dfdd71acc92c5178ac66f3ade0. Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/directx.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c index 2d81a6d..afe2d1c 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -4537,6 +4537,7 @@ HRESULT CDECL wined3d_set_adapter_display_mode(struct wined3d *wined3d, || !(new_mode.dmFields & DM_DISPLAYFLAGS))) { TRACE("Skipping redundant mode setting call.\n"); + adapter->screen_format = new_format_id; return WINED3D_OK; }
1
0
0
0
Andrey Gusev : Fix message output.
by Jeremy Newman
12 Jan '17
12 Jan '17
Module: appdb Branch: master Commit: cf153b8e42a9d9235ecffa2c685e1289383999b1 URL:
http://source.winehq.org/git/appdb.git/?a=commit;h=cf153b8e42a9d9235ecffa2c…
Author: Andrey Gusev <andrey.goosev(a)gmail.com> Date: Thu Jan 12 12:31:16 2017 +0200 Fix message output. --- include/maintainer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/maintainer.php b/include/maintainer.php index 6c0c92f..f4fd822 100644 --- a/include/maintainer.php +++ b/include/maintainer.php @@ -316,7 +316,7 @@ class maintainer $oApp = new Application($oRow->appId); $oVersion = new Version($oRow->versionId); $sSubject = "Application Maintainer Request Report"; - $sMsg = "Your application to be the maintainer of ".$oApp->sName." ".$oVersion->sName." was rejected. "; + $sMsg = "Your application to be the maintainer of $oApp->sName $oVersion->sName was rejected. "; $sMsg .= $this->sReplyText; $sMsg .= ""; $sMsg .= "-The AppDB admins\n";
1
0
0
0
Alexandre Julliard : winex11: Add basic support for importing text/ html clipboard format.
by Alexandre Julliard
11 Jan '17
11 Jan '17
Module: wine Branch: master Commit: 8df9a11adebf72f3f1046a2efad6e8c85fc44c40 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8df9a11adebf72f3f1046a2ef…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Jan 11 20:55:21 2017 +0100 winex11: Add basic support for importing text/html clipboard format. Based on a patch by Damjan Jovanovic. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winex11.drv/clipboard.c | 47 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/dlls/winex11.drv/clipboard.c b/dlls/winex11.drv/clipboard.c index 1d7dbad..4cb8cb8 100644 --- a/dlls/winex11.drv/clipboard.c +++ b/dlls/winex11.drv/clipboard.c @@ -116,6 +116,7 @@ static HANDLE import_string( Atom type, const void *data, size_t size ); static HANDLE import_utf8_string( Atom type, const void *data, size_t size ); static HANDLE import_compound_text( Atom type, const void *data, size_t size ); static HANDLE import_text( Atom type, const void *data, size_t size ); +static HANDLE import_text_html( Atom type, const void *data, size_t size ); static HANDLE import_text_uri_list( Atom type, const void *data, size_t size ); static HANDLE import_targets( Atom type, const void *data, size_t size ); @@ -174,7 +175,7 @@ static const struct { JFIFW, 0, XATOM_image_jpeg, import_data, export_data }, { PNGW, 0, XATOM_image_png, import_data, export_data }, { HTMLFormatW, 0, XATOM_HTML_Format, import_data, export_data }, - { HTMLFormatW, 0, XATOM_text_html, import_data, export_text_html }, + { HTMLFormatW, 0, XATOM_text_html, import_text_html, export_text_html }, { 0, 0, XATOM_TARGETS, import_targets, export_targets }, { 0, 0, XATOM_MULTIPLE, NULL, export_multiple }, { 0, 0, XATOM_TIMESTAMP, NULL, export_timestamp }, @@ -842,6 +843,50 @@ static HANDLE import_enhmetafile( Atom type, const void *data, size_t size ) /************************************************************************** + * import_text_html + */ +static HANDLE import_text_html( Atom type, const void *data, size_t size ) +{ + static const char header[] = + "Version:0.9\n" + "StartHTML:0000000100\n" + "EndHTML:%010lu\n" + "StartFragment:%010lu\n" + "EndFragment:%010lu\n" + "<!--StartFragment-->"; + static const char trailer[] = "\n<!--EndFragment-->"; + char *text = NULL; + HANDLE ret; + SIZE_T len, total; + + /* Firefox uses UTF-16LE with byte order mark. Convert to UTF-8 without the BOM. */ + if (size >= sizeof(WCHAR) && ((const WCHAR *)data)[0] == 0xfeff) + { + len = WideCharToMultiByte( CP_UTF8, 0, (const WCHAR *)data + 1, size / sizeof(WCHAR) - 1, + NULL, 0, NULL, NULL ); + if (!(text = HeapAlloc( GetProcessHeap(), 0, len ))) return 0; + WideCharToMultiByte( CP_UTF8, 0, (const WCHAR *)data + 1, size / sizeof(WCHAR) - 1, + text, len, NULL, NULL ); + size = len; + data = text; + } + + len = strlen( header ) + 12; /* 3 * 4 extra chars for %010lu */ + total = len + size + sizeof(trailer); + if ((ret = GlobalAlloc( GMEM_FIXED, total ))) + { + char *p = ret; + p += sprintf( p, header, total - 1, len, len + size + 1 /* include the final \n in the data */ ); + memcpy( p, data, size ); + strcpy( p + size, trailer ); + TRACE( "returning %s\n", debugstr_a( ret )); + } + HeapFree( GetProcessHeap(), 0, text ); + return ret; +} + + +/************************************************************************** * import_text_uri_list * * Import text/uri-list.
1
0
0
0
Ken Thomases : winemac: Periodically check for pasteboard changes using a timer.
by Alexandre Julliard
11 Jan '17
11 Jan '17
Module: wine Branch: master Commit: 5f5807cbfec59fe5aebf07badc0ab4732710b79b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5f5807cbfec59fe5aebf07bad…
Author: Ken Thomases <ken(a)codeweavers.com> Date: Wed Jan 11 11:06:22 2017 -0600 winemac: Periodically check for pasteboard changes using a timer. Signed-off-by: Ken Thomases <ken(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winemac.drv/clipboard.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dlls/winemac.drv/clipboard.c b/dlls/winemac.drv/clipboard.c index 7d9ae0a..fc1589f 100644 --- a/dlls/winemac.drv/clipboard.c +++ b/dlls/winemac.drv/clipboard.c @@ -1664,6 +1664,7 @@ static void grab_win32_clipboard(BOOL changed) last_clipboard_update = GetTickCount64(); set_win32_clipboard_formats_from_mac_pasteboard(types); CloseClipboard(); + SetTimer(clipboard_hwnd, 1, CLIPBOARD_UPDATE_DELAY, NULL); } @@ -1713,9 +1714,14 @@ static LRESULT CALLBACK clipboard_wndproc(HWND hwnd, UINT msg, WPARAM wp, LPARAM case WM_RENDERFORMAT: render_format(wp); break; + case WM_TIMER: + if (!is_clipboard_owner) break; + grab_win32_clipboard(FALSE); + break; case WM_DESTROYCLIPBOARD: TRACE("WM_DESTROYCLIPBOARD: lost ownership\n"); is_clipboard_owner = FALSE; + KillTimer(hwnd, 1); break; } return DefWindowProcW(hwnd, msg, wp, lp);
1
0
0
0
Ken Thomases : winemac: Don' t update the clipboard if the Mac pasteboard hasn't changed.
by Alexandre Julliard
11 Jan '17
11 Jan '17
Module: wine Branch: master Commit: 525c0b17952425142e2a4fce5ca358b4f2f8a73e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=525c0b17952425142e2a4fce5…
Author: Ken Thomases <ken(a)codeweavers.com> Date: Wed Jan 11 11:06:21 2017 -0600 winemac: Don't update the clipboard if the Mac pasteboard hasn't changed. Signed-off-by: Ken Thomases <ken(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winemac.drv/clipboard.c | 87 ++++++++++++++++++++++++++++++-------------- 1 file changed, 60 insertions(+), 27 deletions(-) diff --git a/dlls/winemac.drv/clipboard.c b/dlls/winemac.drv/clipboard.c index ff79a1e..7d9ae0a 100644 --- a/dlls/winemac.drv/clipboard.c +++ b/dlls/winemac.drv/clipboard.c @@ -194,6 +194,7 @@ static DWORD clipboard_thread_id; static HWND clipboard_hwnd; static BOOL is_clipboard_owner; static macdrv_window clipboard_cocoa_window; +static UINT rendered_formats; static ULONG64 last_clipboard_update; static WINE_CLIPFORMAT **current_mac_formats; static unsigned int nb_current_mac_formats; @@ -1358,39 +1359,25 @@ BOOL macdrv_pasteboard_has_format(CFTypeRef pasteboard, UINT desired_format) /************************************************************************** - * get_formats_for_pasteboard + * get_formats_for_pasteboard_types */ -static WINE_CLIPFORMAT** get_formats_for_pasteboard(CFTypeRef pasteboard, UINT *num_formats) +static WINE_CLIPFORMAT** get_formats_for_pasteboard_types(CFArrayRef types, UINT *num_formats) { - CFArrayRef types; CFIndex count, i; CFMutableSetRef seen_formats; WINE_CLIPFORMAT** formats; UINT pos; - TRACE("pasteboard %s\n", debugstr_cf(pasteboard)); - - types = macdrv_copy_pasteboard_types(pasteboard); - if (!types) - { - WARN("Failed to copy pasteboard types\n"); - return NULL; - } - count = CFArrayGetCount(types); TRACE("got %ld types\n", count); if (!count) - { - CFRelease(types); return NULL; - } seen_formats = CFSetCreateMutable(NULL, count, NULL); if (!seen_formats) { WARN("Failed to allocate seen formats set\n"); - CFRelease(types); return NULL; } @@ -1398,7 +1385,6 @@ static WINE_CLIPFORMAT** get_formats_for_pasteboard(CFTypeRef pasteboard, UINT * if (!formats) { WARN("Failed to allocate formats array\n"); - CFRelease(types); CFRelease(seen_formats); return NULL; } @@ -1457,7 +1443,6 @@ static WINE_CLIPFORMAT** get_formats_for_pasteboard(CFTypeRef pasteboard, UINT * formats[pos++] = format; } - CFRelease(types); CFRelease(seen_formats); if (!pos) @@ -1472,6 +1457,29 @@ static WINE_CLIPFORMAT** get_formats_for_pasteboard(CFTypeRef pasteboard, UINT * /************************************************************************** + * get_formats_for_pasteboard + */ +static WINE_CLIPFORMAT** get_formats_for_pasteboard(CFTypeRef pasteboard, UINT *num_formats) +{ + CFArrayRef types; + WINE_CLIPFORMAT** formats; + + TRACE("pasteboard %s\n", debugstr_cf(pasteboard)); + + types = macdrv_copy_pasteboard_types(pasteboard); + if (!types) + { + WARN("Failed to copy pasteboard types\n"); + return NULL; + } + + formats = get_formats_for_pasteboard_types(types, num_formats); + CFRelease(types); + return formats; +} + + +/************************************************************************** * macdrv_get_pasteboard_formats */ UINT* macdrv_get_pasteboard_formats(CFTypeRef pasteboard, UINT* num_formats) @@ -1571,12 +1579,12 @@ static void set_mac_pasteboard_types_from_win32_clipboard(void) /************************************************************************** * set_win32_clipboard_formats_from_mac_pasteboard */ -static void set_win32_clipboard_formats_from_mac_pasteboard(void) +static void set_win32_clipboard_formats_from_mac_pasteboard(CFArrayRef types) { WINE_CLIPFORMAT** formats; UINT count, i; - formats = get_formats_for_pasteboard(NULL, &count); + formats = get_formats_for_pasteboard_types(types, &count); if (!formats) return; @@ -1610,7 +1618,11 @@ static void render_format(UINT id) { HANDLE handle = current_mac_formats[i]->import_func(pasteboard_data); CFRelease(pasteboard_data); - if (handle) SetClipboardData(id, handle); + if (handle) + { + SetClipboardData(id, handle); + rendered_formats++; + } break; } } @@ -1623,13 +1635,34 @@ static void render_format(UINT id) * Grab the Win32 clipboard when a Mac app has taken ownership of the * pasteboard, and fill it with the pasteboard data types. */ -static void grab_win32_clipboard(void) +static void grab_win32_clipboard(BOOL changed) { + static CFArrayRef last_types; + CFArrayRef types; + + types = macdrv_copy_pasteboard_types(NULL); + if (!types) + { + WARN("Failed to copy pasteboard types\n"); + return; + } + + changed = (changed || rendered_formats || !last_types || !CFEqual(types, last_types)); + if (!changed) + { + CFRelease(types); + return; + } + + if (last_types) CFRelease(last_types); + last_types = types; /* takes ownership */ + if (!OpenClipboard(clipboard_hwnd)) return; EmptyClipboard(); is_clipboard_owner = TRUE; + rendered_formats = 0; last_clipboard_update = GetTickCount64(); - set_win32_clipboard_formats_from_mac_pasteboard(); + set_win32_clipboard_formats_from_mac_pasteboard(types); CloseClipboard(); } @@ -1653,10 +1686,10 @@ static void update_clipboard(void) if (is_clipboard_owner) { if (GetTickCount64() - last_clipboard_update > CLIPBOARD_UPDATE_DELAY) - grab_win32_clipboard(); + grab_win32_clipboard(FALSE); } else if (!macdrv_is_pasteboard_owner(clipboard_cocoa_window)) - grab_win32_clipboard(); + grab_win32_clipboard(TRUE); updating = FALSE; } @@ -1823,7 +1856,7 @@ static DWORD WINAPI clipboard_thread(void *arg) clipboard_thread_id = GetCurrentThreadId(); AddClipboardFormatListener(clipboard_hwnd); register_builtin_formats(); - grab_win32_clipboard(); + grab_win32_clipboard(TRUE); TRACE("clipboard thread %04x running\n", GetCurrentThreadId()); while (1) @@ -2085,7 +2118,7 @@ void macdrv_lost_pasteboard_ownership(HWND hwnd) { TRACE("win %p\n", hwnd); if (!macdrv_is_pasteboard_owner(clipboard_cocoa_window)) - grab_win32_clipboard(); + grab_win32_clipboard(TRUE); }
1
0
0
0
Ken Thomases : winemac: Change some clipboard functions to void return.
by Alexandre Julliard
11 Jan '17
11 Jan '17
Module: wine Branch: master Commit: 3208d1497aa838bdebd0a29c86f7bf52ee7fd9d8 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3208d1497aa838bdebd0a29c8…
Author: Ken Thomases <ken(a)codeweavers.com> Date: Wed Jan 11 11:06:20 2017 -0600 winemac: Change some clipboard functions to void return. Signed-off-by: Ken Thomases <ken(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winemac.drv/clipboard.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/dlls/winemac.drv/clipboard.c b/dlls/winemac.drv/clipboard.c index 3f06ed9..ff79a1e 100644 --- a/dlls/winemac.drv/clipboard.c +++ b/dlls/winemac.drv/clipboard.c @@ -1623,15 +1623,14 @@ static void render_format(UINT id) * Grab the Win32 clipboard when a Mac app has taken ownership of the * pasteboard, and fill it with the pasteboard data types. */ -static BOOL grab_win32_clipboard(void) +static void grab_win32_clipboard(void) { - if (!OpenClipboard(clipboard_hwnd)) return FALSE; + if (!OpenClipboard(clipboard_hwnd)) return; EmptyClipboard(); is_clipboard_owner = TRUE; last_clipboard_update = GetTickCount64(); set_win32_clipboard_formats_from_mac_pasteboard(); CloseClipboard(); - return TRUE; } @@ -1641,27 +1640,25 @@ static BOOL grab_win32_clipboard(void) * Periodically update the clipboard while the clipboard is owned by a * Mac app. */ -static BOOL update_clipboard(void) +static void update_clipboard(void) { static BOOL updating; - BOOL ret = TRUE; TRACE("is_clipboard_owner %d last_clipboard_update %llu now %llu\n", is_clipboard_owner, last_clipboard_update, GetTickCount64()); - if (updating) return TRUE; + if (updating) return; updating = TRUE; if (is_clipboard_owner) { if (GetTickCount64() - last_clipboard_update > CLIPBOARD_UPDATE_DELAY) - ret = grab_win32_clipboard(); + grab_win32_clipboard(); } else if (!macdrv_is_pasteboard_owner(clipboard_cocoa_window)) - ret = grab_win32_clipboard(); + grab_win32_clipboard(); updating = FALSE; - return ret; }
1
0
0
0
Nikolay Sivov : comctl32/toolbar: Protect from NULL pointer access in TB_GETBUTTONINFOW handler.
by Alexandre Julliard
11 Jan '17
11 Jan '17
Module: wine Branch: master Commit: 26067cc0b9e39ac80bd13f8c90d9c9948eb60fbb URL:
http://source.winehq.org/git/wine.git/?a=commit;h=26067cc0b9e39ac80bd13f8c9…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Wed Jan 11 15:31:42 2017 +0300 comctl32/toolbar: Protect from NULL pointer access in TB_GETBUTTONINFOW handler. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/comctl32/tests/toolbar.c | 11 ++++++++++- dlls/comctl32/toolbar.c | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/dlls/comctl32/tests/toolbar.c b/dlls/comctl32/tests/toolbar.c index 7dcdadb..f2f7924 100644 --- a/dlls/comctl32/tests/toolbar.c +++ b/dlls/comctl32/tests/toolbar.c @@ -1710,12 +1710,13 @@ static void test_recalc(void) static void test_getbuttoninfo(void) { HWND hToolbar = NULL; + TBBUTTONINFOW tbiW; + TBBUTTONINFOA tbi; int i; rebuild_toolbar_with_buttons(&hToolbar); for (i = 0; i < 128; i++) { - TBBUTTONINFOA tbi; int ret; tbi.cbSize = i; @@ -1727,6 +1728,14 @@ static void test_getbuttoninfo(void) compare(ret, -1, "%d"); } } + + /* TBIF_TEXT with NULL pszText */ + memset(&tbiW, 0, sizeof(tbiW)); + tbiW.cbSize = sizeof(tbiW); + tbiW.dwMask = TBIF_BYINDEX | TBIF_STYLE | TBIF_COMMAND | TBIF_TEXT; + i = SendMessageA(hToolbar, TB_GETBUTTONINFOW, 1, (LPARAM)&tbiW); + ok(i == 1, "Got index %d\n", i); + DestroyWindow(hToolbar); } diff --git a/dlls/comctl32/toolbar.c b/dlls/comctl32/toolbar.c index 422845c..0c545a2 100644 --- a/dlls/comctl32/toolbar.c +++ b/dlls/comctl32/toolbar.c @@ -3397,7 +3397,7 @@ TOOLBAR_GetButtonInfoT(const TOOLBAR_INFO *infoPtr, INT Id, LPTBBUTTONINFOW lpTb Str_GetPtrW(lpText, lpTbInfo->pszText, lpTbInfo->cchText); else Str_GetPtrWtoA(lpText, (LPSTR)lpTbInfo->pszText, lpTbInfo->cchText); - } else + } else if (!bUnicode || lpTbInfo->pszText) lpTbInfo->pszText[0] = '\0'; } return nIndex;
1
0
0
0
Nikolay Sivov : user32/tests: Some tests for GetWindowText() when non terminated string is returned.
by Alexandre Julliard
11 Jan '17
11 Jan '17
Module: wine Branch: master Commit: 904c695de89e3c68389ec92f1df95cfc52d403e7 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=904c695de89e3c68389ec92f1…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Wed Jan 11 02:11:19 2017 +0300 user32/tests: Some tests for GetWindowText() when non terminated string is returned. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/tests/win.c | 65 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c index 4640109..f926b9d 100644 --- a/dlls/user32/tests/win.c +++ b/dlls/user32/tests/win.c @@ -754,6 +754,7 @@ static void test_enum_thread_windows(void) static struct wm_gettext_override_data { BOOL enabled; /* when 1 bypasses default procedure */ + BOOL dont_terminate; /* don't null terminate returned string in WM_GETTEXT handler */ char *buff; /* expected text buffer pointer */ WCHAR *buffW; /* same, for W test */ } g_wm_gettext_override; @@ -846,6 +847,16 @@ static LRESULT WINAPI main_window_procA(HWND hwnd, UINT msg, WPARAM wparam, LPAR ok(*text == 0, "expected empty string buffer %x\n", *text); return 0; } + else if (g_wm_gettext_override.dont_terminate) + { + char *text = (char *)lparam; + if (text) + { + memcpy(text, "text", 4); + return 4; + } + return 0; + } break; case WM_SETTEXT: num_settext_msgs++; @@ -872,6 +883,17 @@ static LRESULT WINAPI main_window_procW(HWND hwnd, UINT msg, WPARAM wparam, LPAR ok(*text == 0, "expected empty string buffer %x\n", *text); return 0; } + else if (g_wm_gettext_override.dont_terminate) + { + static const WCHAR textW[] = {'t','e','x','t'}; + WCHAR *text = (WCHAR *)lparam; + if (text) + { + memcpy(text, textW, sizeof(textW)); + return 4; + } + return 0; + } break; } @@ -6567,6 +6589,7 @@ static DWORD CALLBACK settext_msg_thread( LPVOID arg ) static void test_gettext(void) { + static const WCHAR textW[] = {'t','e','x','t'}; DWORD tid, num_msgs; WCHAR bufW[32]; HANDLE thread; @@ -6720,6 +6743,48 @@ static void test_gettext(void) ok( !strcmp(buf, "thread_caption"), "got wrong window text '%s'\n", buf ); ok( num_gettext_msgs == 1, "got %u WM_GETTEXT messages\n", num_gettext_msgs ); + /* WM_GETTEXT does not terminate returned string */ + memset( buf, 0x1c, sizeof(buf) ); + g_wm_gettext_override.dont_terminate = TRUE; + buf_len = GetWindowTextA( hwnd, buf, sizeof(buf) ); + ok( buf_len == 4, "Unexpected text length, %d\n", buf_len ); + ok( !memcmp(buf, "text", 4), "Unexpected window text, '%s'\n", buf ); + ok( buf[4] == 0x1c, "Unexpected buffer contents\n" ); + g_wm_gettext_override.dont_terminate = FALSE; + + memset( bufW, 0x1c, sizeof(bufW) ); + g_wm_gettext_override.dont_terminate = TRUE; + buf_len = GetWindowTextW( hwnd, bufW, sizeof(bufW)/sizeof(bufW[0]) ); +todo_wine + ok( buf_len == 4, "Unexpected text length, %d\n", buf_len ); + ok( !memcmp(bufW, textW, 4 * sizeof(WCHAR)), "Unexpected window text, %s\n", wine_dbgstr_w(bufW) ); +todo_wine + ok( bufW[4] == 0, "Unexpected buffer contents, %#x\n", bufW[4] ); + g_wm_gettext_override.dont_terminate = FALSE; + + hwnd2 = CreateWindowExW( 0, mainclassW, NULL, WS_POPUP, 0, 0, 0, 0, 0, 0, 0, NULL ); + ok( hwnd2 != 0, "CreateWindowExA error %d\n", GetLastError() ); + + memset( buf, 0x1c, sizeof(buf) ); + g_wm_gettext_override.dont_terminate = TRUE; + buf_len = GetWindowTextA( hwnd2, buf, sizeof(buf) ); +todo_wine + ok( buf_len == 4, "Unexpected text length, %d\n", buf_len ); + ok( !memcmp(buf, "text", 4), "Unexpected window text, '%s'\n", buf ); +todo_wine + ok( buf[4] == 0, "Unexpected buffer contents, %#x\n", buf[4] ); + g_wm_gettext_override.dont_terminate = FALSE; + + memset( bufW, 0x1c, sizeof(bufW) ); + g_wm_gettext_override.dont_terminate = TRUE; + buf_len = GetWindowTextW( hwnd2, bufW, sizeof(bufW)/sizeof(bufW[0]) ); + ok( buf_len == 4, "Unexpected text length, %d\n", buf_len ); + ok( !memcmp(bufW, textW, 4 * sizeof(WCHAR)), "Unexpected window text, %s\n", wine_dbgstr_w(bufW) ); + ok( bufW[4] == 0x1c1c, "Unexpected buffer contents, %#x\n", bufW[4] ); + g_wm_gettext_override.dont_terminate = FALSE; + + DestroyWindow(hwnd2); + /* seems to crash on every modern Windows version */ if (0) {
1
0
0
0
← Newer
1
...
37
38
39
40
41
42
43
...
50
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
Results per page:
10
25
50
100
200