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
May
April
March
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
October 2022
----- 2025 -----
May 2025
April 2025
March 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
1 participants
537 discussions
Start a n
N
ew thread
Paul Gofman : msvcp140: Link to vcruntime140.
by Alexandre Julliard
13 Oct '22
13 Oct '22
Module: wine Branch: master Commit: 93d1970a75f311ed82f3b373558d8a0ca17ec8fe URL:
https://gitlab.winehq.org/wine/wine/-/commit/93d1970a75f311ed82f3b373558d8a…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Wed Oct 12 16:08:40 2022 -0500 msvcp140: Link to vcruntime140. --- dlls/msvcp140/Makefile.in | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/msvcp140/Makefile.in b/dlls/msvcp140/Makefile.in index eb0c8c3ef39..c5b1582944b 100644 --- a/dlls/msvcp140/Makefile.in +++ b/dlls/msvcp140/Makefile.in @@ -2,6 +2,7 @@ MODULE = msvcp140.dll EXTRADEFS = -D_MSVCP_VER=140 PARENTSRC = ../msvcp90 IMPORTLIB = msvcp140 +IMPORTS = vcruntime140 C_SRCS = \ details.c \
1
0
0
0
Paul Gofman : vcruntime140_1: Link to vcruntime140.
by Alexandre Julliard
13 Oct '22
13 Oct '22
Module: wine Branch: master Commit: 297cb1c85ec37b8032545a0a79d5b64940dfffdd URL:
https://gitlab.winehq.org/wine/wine/-/commit/297cb1c85ec37b8032545a0a79d5b6…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Wed Oct 12 16:07:25 2022 -0500 vcruntime140_1: Link to vcruntime140. --- dlls/vcruntime140/Makefile.in | 1 + dlls/vcruntime140_1/Makefile.in | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/dlls/vcruntime140/Makefile.in b/dlls/vcruntime140/Makefile.in index 2b4d6af7c91..b09faf2c901 100644 --- a/dlls/vcruntime140/Makefile.in +++ b/dlls/vcruntime140/Makefile.in @@ -1,4 +1,5 @@ MODULE = vcruntime140.dll +IMPORTLIB = vcruntime140 C_SRCS = \ misc.c diff --git a/dlls/vcruntime140_1/Makefile.in b/dlls/vcruntime140_1/Makefile.in index 31f15af2989..6b76e4576bc 100644 --- a/dlls/vcruntime140_1/Makefile.in +++ b/dlls/vcruntime140_1/Makefile.in @@ -1,4 +1,5 @@ -MODULE = vcruntime140_1.dll +MODULE = vcruntime140_1.dll +IMPORTS = vcruntime140 C_SRCS = \ except_x86_64.c
1
0
0
0
Huw Davies : nsi: Use the correct members for the error and discard counts.
by Alexandre Julliard
13 Oct '22
13 Oct '22
Module: wine Branch: master Commit: 673da9cdecd8fed165bc467ece59c7d0ff24a403 URL:
https://gitlab.winehq.org/wine/wine/-/commit/673da9cdecd8fed165bc467ece59c7…
Author: Huw Davies <huw(a)codeweavers.com> Date: Mon Oct 10 14:10:54 2022 -0500 nsi: Use the correct members for the error and discard counts. Wine-Bug:
https://bugs.winehq.org//show_bug.cgi?id=53234
--- include/wine/nsi.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/include/wine/nsi.h b/include/wine/nsi.h index 42fc4f68a67..0e20490e2a8 100644 --- a/include/wine/nsi.h +++ b/include/wine/nsi.h @@ -54,11 +54,9 @@ struct nsi_ndis_ifinfo_dynamic UINT mtu; ULONG64 xmit_speed; ULONG64 rcv_speed; - ULONG64 in_errors; + ULONG64 unk2[3]; ULONG64 in_discards; - ULONG64 out_errors; - ULONG64 out_discards; - ULONG64 unk2; + ULONG64 in_errors; ULONG64 in_octets; ULONG64 in_ucast_pkts; ULONG64 in_mcast_pkts; @@ -67,7 +65,8 @@ struct nsi_ndis_ifinfo_dynamic ULONG64 out_ucast_pkts; ULONG64 out_mcast_pkts; ULONG64 out_bcast_pkts; - ULONG64 unk3[2]; + ULONG64 out_errors; + ULONG64 out_discards; ULONG64 in_ucast_octs; ULONG64 in_mcast_octs; ULONG64 in_bcast_octs;
1
0
0
0
Sebastian Lackner : ntdll: Improve stub of NtQueryEaFile.
by Alexandre Julliard
13 Oct '22
13 Oct '22
Module: wine Branch: master Commit: 3c4cdfa7049eb3063c9b77efbbf3c90e5334bd28 URL:
https://gitlab.winehq.org/wine/wine/-/commit/3c4cdfa7049eb3063c9b77efbbf3c9…
Author: Sebastian Lackner <sebastian(a)fds-team.de> Date: Sat Jun 6 07:03:33 2015 +0800 ntdll: Improve stub of NtQueryEaFile. Co-authored-by: Qian Hong <qhong(a)codeweavers.com> Co-authored-by: Joel Holdsworth <joel(a)airwebreathe.org.uk> Signed-off-by: Joel Holdsworth <joel(a)airwebreathe.org.uk> --- dlls/ntdll/tests/file.c | 83 +++++++++++++++++++++++++++++++++++++++++++++++++ dlls/ntdll/unix/file.c | 15 +++++++-- 2 files changed, 96 insertions(+), 2 deletions(-) diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c index d49d4d5c26f..c011733626f 100644 --- a/dlls/ntdll/tests/file.c +++ b/dlls/ntdll/tests/file.c @@ -84,6 +84,7 @@ static NTSTATUS (WINAPI *pNtQueryDirectoryFile)(HANDLE,HANDLE,PIO_APC_ROUTINE,PV static NTSTATUS (WINAPI *pNtQueryVolumeInformationFile)(HANDLE,PIO_STATUS_BLOCK,PVOID,ULONG,FS_INFORMATION_CLASS); static NTSTATUS (WINAPI *pNtQueryFullAttributesFile)(const OBJECT_ATTRIBUTES*, FILE_NETWORK_OPEN_INFORMATION*); static NTSTATUS (WINAPI *pNtFlushBuffersFile)(HANDLE, IO_STATUS_BLOCK*); +static NTSTATUS (WINAPI *pNtQueryEaFile)(HANDLE,PIO_STATUS_BLOCK,PVOID,ULONG,BOOLEAN,PVOID,ULONG,PULONG,BOOLEAN); static WCHAR fooW[] = {'f','o','o',0}; @@ -5112,6 +5113,86 @@ static void test_flush_buffers_file(void) DeleteFileA(buffer); } +static void test_query_ea(void) +{ +#define EA_BUFFER_SIZE 4097 + unsigned char data[EA_BUFFER_SIZE + 8]; + unsigned char *buffer = (void *)(((DWORD_PTR)data + 7) & ~7); + DWORD buffer_len, i; + IO_STATUS_BLOCK io; + NTSTATUS status; + HANDLE handle; + + if (!(handle = create_temp_file(0))) return; + + /* test with INVALID_HANDLE_VALUE */ + U(io).Status = 0xdeadbeef; + io.Information = 0xdeadbeef; + memset(buffer, 0xcc, EA_BUFFER_SIZE); + buffer_len = EA_BUFFER_SIZE - 1; + status = pNtQueryEaFile(INVALID_HANDLE_VALUE, &io, buffer, buffer_len, TRUE, NULL, 0, NULL, FALSE); + ok(status == STATUS_OBJECT_TYPE_MISMATCH, "expected STATUS_OBJECT_TYPE_MISMATCH, got %#lx\n", status); + ok(U(io).Status == 0xdeadbeef, "expected 0xdeadbeef, got %#lx\n", U(io).Status); + ok(io.Information == 0xdeadbeef, "expected 0xdeadbeef, got %#Ix\n", io.Information); + ok(buffer[0] == 0xcc, "data at position 0 overwritten\n"); + + /* test with 0xdeadbeef */ + U(io).Status = 0xdeadbeef; + io.Information = 0xdeadbeef; + memset(buffer, 0xcc, EA_BUFFER_SIZE); + buffer_len = EA_BUFFER_SIZE - 1; + status = pNtQueryEaFile((void *)0xdeadbeef, &io, buffer, buffer_len, TRUE, NULL, 0, NULL, FALSE); + ok(status == STATUS_INVALID_HANDLE, "expected STATUS_INVALID_HANDLE, got %#lx\n", status); + ok(U(io).Status == 0xdeadbeef, "expected 0xdeadbeef, got %#lx\n", U(io).Status); + ok(io.Information == 0xdeadbeef, "expected 0xdeadbeef, got %#Ix\n", io.Information); + ok(buffer[0] == 0xcc, "data at position 0 overwritten\n"); + + /* test without buffer */ + U(io).Status = 0xdeadbeef; + io.Information = 0xdeadbeef; + status = pNtQueryEaFile(handle, &io, NULL, 0, TRUE, NULL, 0, NULL, FALSE); + ok(status == STATUS_NO_EAS_ON_FILE, "expected STATUS_NO_EAS_ON_FILE, got %#lx\n", status); + ok(U(io).Status == 0xdeadbeef, "expected 0xdeadbeef, got %#lx\n", U(io).Status); + ok(io.Information == 0xdeadbeef, "expected 0xdeadbeef, got %#Ix\n", io.Information); + + /* test with zero buffer */ + U(io).Status = 0xdeadbeef; + io.Information = 0xdeadbeef; + status = pNtQueryEaFile(handle, &io, buffer, 0, TRUE, NULL, 0, NULL, FALSE); + ok(status == STATUS_NO_EAS_ON_FILE, "expected STATUS_NO_EAS_ON_FILE, got %#lx\n", status); + ok(U(io).Status == 0xdeadbeef, "expected 0xdeadbeef, got %#lx\n", U(io).Status); + ok(io.Information == 0xdeadbeef, "expected 0xdeadbeef, got %#Ix\n", io.Information); + + /* test with very small buffer */ + U(io).Status = 0xdeadbeef; + io.Information = 0xdeadbeef; + memset(buffer, 0xcc, EA_BUFFER_SIZE); + buffer_len = 4; + status = pNtQueryEaFile(handle, &io, buffer, buffer_len, TRUE, NULL, 0, NULL, FALSE); + ok(status == STATUS_NO_EAS_ON_FILE, "expected STATUS_NO_EAS_ON_FILE, got %#lx\n", status); + ok(U(io).Status == 0xdeadbeef, "expected 0xdeadbeef, got %#lx\n", U(io).Status); + ok(io.Information == 0xdeadbeef, "expected 0xdeadbeef, got %#Ix\n", io.Information); + for (i = 0; i < buffer_len && !buffer[i]; i++); + ok(i == buffer_len, "expected %lu bytes filled with 0x00, got %lu bytes\n", buffer_len, i); + ok(buffer[i] == 0xcc, "data at position %u overwritten\n", buffer[i]); + + /* test with very big buffer */ + U(io).Status = 0xdeadbeef; + io.Information = 0xdeadbeef; + memset(buffer, 0xcc, EA_BUFFER_SIZE); + buffer_len = EA_BUFFER_SIZE - 1; + status = pNtQueryEaFile(handle, &io, buffer, buffer_len, TRUE, NULL, 0, NULL, FALSE); + ok(status == STATUS_NO_EAS_ON_FILE, "expected STATUS_NO_EAS_ON_FILE, got %#lx\n", status); + ok(U(io).Status == 0xdeadbeef, "expected 0xdeadbeef, got %#lx\n", U(io).Status); + ok(io.Information == 0xdeadbeef, "expected 0xdeadbeef, got %#Ix\n", io.Information); + for (i = 0; i < buffer_len && !buffer[i]; i++); + ok(i == buffer_len, "expected %lu bytes filled with 0x00, got %lu bytes\n", buffer_len, i); + ok(buffer[i] == 0xcc, "data at position %u overwritten\n", buffer[i]); + + CloseHandle(handle); +#undef EA_BUFFER_SIZE +} + static void test_file_readonly_access(void) { static const DWORD default_sharing = FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE; @@ -5285,6 +5366,7 @@ START_TEST(file) pNtQueryVolumeInformationFile = (void *)GetProcAddress(hntdll, "NtQueryVolumeInformationFile"); pNtQueryFullAttributesFile = (void *)GetProcAddress(hntdll, "NtQueryFullAttributesFile"); pNtFlushBuffersFile = (void *)GetProcAddress(hntdll, "NtFlushBuffersFile"); + pNtQueryEaFile = (void *)GetProcAddress(hntdll, "NtQueryEaFile"); test_read_write(); test_NtCreateFile(); @@ -5314,6 +5396,7 @@ START_TEST(file) test_query_volume_information_file(); test_query_attribute_information_file(); test_ioctl(); + test_query_ea(); test_flush_buffers_file(); test_mailslot_name(); } diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c index 469c714f847..604ca866890 100644 --- a/dlls/ntdll/unix/file.c +++ b/dlls/ntdll/unix/file.c @@ -6844,9 +6844,20 @@ NTSTATUS WINAPI NtQueryEaFile( HANDLE handle, IO_STATUS_BLOCK *io, void *buffer, BOOLEAN single_entry, void *list, ULONG list_len, ULONG *index, BOOLEAN restart ) { - FIXME( "(%p,%p,%p,%d,%d,%p,%d,%p,%d) stub\n", + int fd, needs_close; + NTSTATUS status; + + FIXME( "(%p,%p,%p,%d,%d,%p,%d,%p,%d) semi-stub\n", handle, io, buffer, length, single_entry, list, list_len, index, restart ); - return STATUS_ACCESS_DENIED; + + if ((status = server_get_unix_fd( handle, 0, &fd, &needs_close, NULL, NULL ))) + return status; + + if (buffer && length) + memset( buffer, 0, length ); + + if (needs_close) close( fd ); + return STATUS_NO_EAS_ON_FILE; }
1
0
0
0
Paul Gofman : winhttp: Support WINHTTP_OPTION_WEB_SOCKET_SEND_BUFFER_SIZE.
by Alexandre Julliard
13 Oct '22
13 Oct '22
Module: wine Branch: master Commit: f78137a8c2a9f5846746bba0ae03f37b103c346c URL:
https://gitlab.winehq.org/wine/wine/-/commit/f78137a8c2a9f5846746bba0ae03f3…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Fri Oct 7 12:08:10 2022 -0500 winhttp: Support WINHTTP_OPTION_WEB_SOCKET_SEND_BUFFER_SIZE. --- dlls/winhttp/request.c | 20 ++++++++++++---- dlls/winhttp/session.c | 48 +++++++++++++++++++++++++++++++++++++++ dlls/winhttp/tests/notification.c | 18 ++++++++++++++- dlls/winhttp/tests/winhttp.c | 39 +++++++++++++++++++++++++++++++ dlls/winhttp/winhttp_private.h | 5 +++- 5 files changed, 123 insertions(+), 7 deletions(-)
1
0
0
0
Paul Gofman : winhttp: Stub WINHTTP_OPTION_WEB_SOCKET_RECEIVE_BUFFER_SIZE.
by Alexandre Julliard
13 Oct '22
13 Oct '22
Module: wine Branch: master Commit: d8552dab2b70f0957d246a28f2e43c8fed7ed92a URL:
https://gitlab.winehq.org/wine/wine/-/commit/d8552dab2b70f0957d246a28f2e43c…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Fri Oct 7 11:50:24 2022 -0500 winhttp: Stub WINHTTP_OPTION_WEB_SOCKET_RECEIVE_BUFFER_SIZE. --- dlls/winhttp/session.c | 49 ++++++++++++++++++++++++++++++++++++++ dlls/winhttp/tests/winhttp.c | 53 ++++++++++++++++++++++++++++++++++++++++++ dlls/winhttp/winhttp_private.h | 2 ++ 3 files changed, 104 insertions(+) diff --git a/dlls/winhttp/session.c b/dlls/winhttp/session.c index 01e95895eb3..12af5ded251 100644 --- a/dlls/winhttp/session.c +++ b/dlls/winhttp/session.c @@ -144,6 +144,13 @@ static BOOL session_query_option( struct object_header *hdr, DWORD option, void *buflen = sizeof(DWORD); return TRUE; + case WINHTTP_OPTION_WEB_SOCKET_RECEIVE_BUFFER_SIZE: + if (!validate_buffer( buffer, buflen, sizeof(DWORD) )) return FALSE; + + *(DWORD *)buffer = session->websocket_receive_buffer_size; + *buflen = sizeof(DWORD); + return TRUE; + default: FIXME( "unimplemented option %lu\n", option ); SetLastError( ERROR_INVALID_PARAMETER ); @@ -233,6 +240,22 @@ static BOOL session_set_option( struct object_header *hdr, DWORD option, void *b FIXME( "WINHTTP_OPTION_MAX_CONNS_PER_1_0_SERVER: %lu\n", *(DWORD *)buffer ); return TRUE; + case WINHTTP_OPTION_WEB_SOCKET_RECEIVE_BUFFER_SIZE: + { + DWORD buffer_size; + + if (buflen != sizeof(buffer_size)) + { + SetLastError( ERROR_INSUFFICIENT_BUFFER ); + return FALSE; + } + + buffer_size = *(DWORD *)buffer; + TRACE( "%#lx\n", buffer_size ); + session->websocket_receive_buffer_size = buffer_size; + return TRUE; + } + default: FIXME( "unimplemented option %lu\n", option ); SetLastError( ERROR_WINHTTP_INVALID_OPTION ); @@ -270,6 +293,7 @@ HINTERNET WINAPI WinHttpOpen( LPCWSTR agent, DWORD access, LPCWSTR proxy, LPCWST session->send_timeout = DEFAULT_SEND_TIMEOUT; session->receive_timeout = DEFAULT_RECEIVE_TIMEOUT; session->receive_response_timeout = DEFAULT_RECEIVE_RESPONSE_TIMEOUT; + session->websocket_receive_buffer_size = 32768; list_init( &session->cookie_cache ); InitializeCriticalSection( &session->cs ); session->cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": session.cs"); @@ -842,6 +866,13 @@ static BOOL request_query_option( struct object_header *hdr, DWORD option, void *buflen = sizeof(DWORD); return TRUE; + case WINHTTP_OPTION_WEB_SOCKET_RECEIVE_BUFFER_SIZE: + if (!validate_buffer( buffer, buflen, sizeof(DWORD) )) return FALSE; + + *(DWORD *)buffer = request->websocket_receive_buffer_size; + *buflen = sizeof(DWORD); + return TRUE; + default: FIXME( "unimplemented option %lu\n", option ); SetLastError( ERROR_INVALID_PARAMETER ); @@ -1078,6 +1109,23 @@ static BOOL request_set_option( struct object_header *hdr, DWORD option, void *b SetLastError(ERROR_INVALID_PARAMETER); return FALSE; + case WINHTTP_OPTION_WEB_SOCKET_RECEIVE_BUFFER_SIZE: + { + DWORD buffer_size; + + if (buflen != sizeof(buffer_size)) + { + SetLastError( ERROR_INSUFFICIENT_BUFFER ); + return FALSE; + } + + buffer_size = *(DWORD *)buffer; + WARN( "Setting websocket receive buffer size currently has not effct, size %lu\n", buffer_size ); + request->websocket_receive_buffer_size = buffer_size; + return TRUE; + } + + default: FIXME( "unimplemented option %lu\n", option ); SetLastError( ERROR_WINHTTP_INVALID_OPTION ); @@ -1174,6 +1222,7 @@ HINTERNET WINAPI WinHttpOpenRequest( HINTERNET hconnect, const WCHAR *verb, cons request->receive_timeout = connect->session->receive_timeout; request->receive_response_timeout = connect->session->receive_response_timeout; request->max_redirects = 10; + request->websocket_receive_buffer_size = connect->session->websocket_receive_buffer_size; if (!verb || !verb[0]) verb = L"GET"; if (!(request->verb = strdupW( verb ))) goto end; diff --git a/dlls/winhttp/tests/winhttp.c b/dlls/winhttp/tests/winhttp.c index ed3d06038af..b48e11dd753 100644 --- a/dlls/winhttp/tests/winhttp.c +++ b/dlls/winhttp/tests/winhttp.c @@ -3425,9 +3425,52 @@ static void test_websocket(int port) connection = WinHttpConnect(session, L"ws.ifelse.io", 0, 0); ok(connection != NULL, "got %lu\n", GetLastError()); + size = 0xdeadbeef; + ret = WinHttpQueryOption(session, WINHTTP_OPTION_WEB_SOCKET_RECEIVE_BUFFER_SIZE, &value, &size); + ok(ret, "got %lu\n", GetLastError()); + ok(size == sizeof(DWORD), "got %lu.\n", size); + ok(value == 32768, "got %lu.\n", value); + + value = 65535; + ret = WinHttpSetOption(session, WINHTTP_OPTION_WEB_SOCKET_RECEIVE_BUFFER_SIZE, &value, sizeof(DWORD)); + ok(ret, "got %lu\n", GetLastError()); + request = WinHttpOpenRequest(connection, L"GET", L"/", NULL, NULL, NULL, 0); ok(request != NULL, "got %lu\n", GetLastError()); + size = 0xdeadbeef; + ret = WinHttpQueryOption(session, WINHTTP_OPTION_WEB_SOCKET_RECEIVE_BUFFER_SIZE, &value, &size); + ok(ret, "got %lu\n", GetLastError()); + ok(size == sizeof(DWORD), "got %lu.\n", size); + ok(value == 65535 || broken( value == WINHTTP_OPTION_WEB_SOCKET_RECEIVE_BUFFER_SIZE ) /* Win8 */, "got %lu.\n", value); + + size = 0xdeadbeef; + ret = WinHttpQueryOption(request, WINHTTP_OPTION_WEB_SOCKET_RECEIVE_BUFFER_SIZE, &value, &size); + ok(ret, "got %lu\n", GetLastError()); + ok(size == sizeof(DWORD), "got %lu.\n", size); + ok(value == 65535 || broken( value == WINHTTP_OPTION_WEB_SOCKET_RECEIVE_BUFFER_SIZE ), "got %lu.\n", value); + + value = 1048576; + ret = WinHttpSetOption(request, WINHTTP_OPTION_WEB_SOCKET_RECEIVE_BUFFER_SIZE, &value, sizeof(DWORD)); + ok(ret, "got %lu\n", GetLastError()); + + size = 0xdeadbeef; + ret = WinHttpQueryOption(session, WINHTTP_OPTION_WEB_SOCKET_RECEIVE_BUFFER_SIZE, &value, &size); + ok(ret, "got %lu\n", GetLastError()); + ok(size == sizeof(DWORD), "got %lu.\n", size); + ok(value == 65535 || broken( value == WINHTTP_OPTION_WEB_SOCKET_RECEIVE_BUFFER_SIZE ) /* Win8 */, "got %lu.\n", value); + + size = 0xdeadbeef; + ret = WinHttpQueryOption(request, WINHTTP_OPTION_WEB_SOCKET_RECEIVE_BUFFER_SIZE, &value, &size); + ok(ret, "got %lu\n", GetLastError()); + ok(size == sizeof(DWORD), "got %lu.\n", size); + ok(value == 1048576, "got %lu.\n", value); + + size = 0xdeadbeef; + ret = WinHttpQueryOption(connection, WINHTTP_OPTION_WEB_SOCKET_RECEIVE_BUFFER_SIZE, &value, &size); + ok(!ret, "got %d\n", ret); + todo_wine ok(GetLastError() == ERROR_WINHTTP_INCORRECT_HANDLE_TYPE, "got %lu\n", GetLastError()); + size = sizeof(value); ret = WinHttpQueryOption(session, WINHTTP_OPTION_WEB_SOCKET_KEEPALIVE_INTERVAL, &value, &size); ok(!ret, "got %d\n", ret); @@ -3462,6 +3505,16 @@ static void test_websocket(int port) socket = pWinHttpWebSocketCompleteUpgrade(request, 0); ok(socket != NULL, "got %lu\n", GetLastError()); + size = sizeof(value); + ret = WinHttpQueryOption(socket, WINHTTP_OPTION_WEB_SOCKET_RECEIVE_BUFFER_SIZE, &value, &size); + ok(!ret, "got %d\n", ret); + todo_wine ok(GetLastError() == ERROR_WINHTTP_INCORRECT_HANDLE_TYPE, "got %lu\n", GetLastError()); + + value = 65535; + ret = WinHttpSetOption(socket, WINHTTP_OPTION_WEB_SOCKET_RECEIVE_BUFFER_SIZE, &value, sizeof(DWORD)); + ok(!ret, "got %d\n", ret); + todo_wine ok(GetLastError() == ERROR_WINHTTP_INCORRECT_HANDLE_TYPE, "got %lu\n", GetLastError()); + value = 20000; ret = WinHttpSetOption(socket, WINHTTP_OPTION_WEB_SOCKET_KEEPALIVE_INTERVAL, &value, 2); ok(!ret, "got %d\n", ret); diff --git a/dlls/winhttp/winhttp_private.h b/dlls/winhttp/winhttp_private.h index 52f9eb171ee..9c994037bcf 100644 --- a/dlls/winhttp/winhttp_private.h +++ b/dlls/winhttp/winhttp_private.h @@ -85,6 +85,7 @@ struct session HANDLE unload_event; DWORD secure_protocols; DWORD passport_flags; + unsigned int websocket_receive_buffer_size; }; struct connect @@ -215,6 +216,7 @@ struct request WCHAR *username; WCHAR *password; } creds[TARGET_MAX][SCHEME_MAX]; + unsigned int websocket_receive_buffer_size; }; enum socket_state
1
0
0
0
Paul Gofman : winhttp: Support WINHTTP_OPTION_WEB_SOCKET_KEEPALIVE_INTERVAL.
by Alexandre Julliard
13 Oct '22
13 Oct '22
Module: wine Branch: master Commit: 84ec7aec91bfd09276cb8adbe2011c92cea7a095 URL:
https://gitlab.winehq.org/wine/wine/-/commit/84ec7aec91bfd09276cb8adbe2011c…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Fri Oct 7 11:34:45 2022 -0500 winhttp: Support WINHTTP_OPTION_WEB_SOCKET_KEEPALIVE_INTERVAL. --- dlls/winhttp/request.c | 32 +++++++++++++++++++++++++ dlls/winhttp/tests/winhttp.c | 53 +++++++++++++++++++++++++++++++++++++++++- dlls/winhttp/winhttp_private.h | 1 + 3 files changed, 85 insertions(+), 1 deletion(-) diff --git a/dlls/winhttp/request.c b/dlls/winhttp/request.c index 9f769f3dc35..543532c31d8 100644 --- a/dlls/winhttp/request.c +++ b/dlls/winhttp/request.c @@ -3151,6 +3151,13 @@ static void socket_handle_closing( struct object_header *hdr ) static BOOL socket_query_option( struct object_header *hdr, DWORD option, void *buffer, DWORD *buflen ) { + switch (option) + { + case WINHTTP_OPTION_WEB_SOCKET_KEEPALIVE_INTERVAL: + SetLastError( ERROR_INVALID_PARAMETER ); + return FALSE; + } + FIXME( "unimplemented option %lu\n", option ); SetLastError( ERROR_WINHTTP_INVALID_OPTION ); return FALSE; @@ -3172,6 +3179,28 @@ static void socket_destroy( struct object_header *hdr ) static BOOL socket_set_option( struct object_header *hdr, DWORD option, void *buffer, DWORD buflen ) { + struct socket *socket = (struct socket *)hdr; + + switch (option) + { + case WINHTTP_OPTION_WEB_SOCKET_KEEPALIVE_INTERVAL: + { + DWORD interval; + + if (buflen != sizeof(DWORD) || (interval = *(DWORD *)buffer) < 15000) + { + WARN( "Invalid parameters for WINHTTP_OPTION_WEB_SOCKET_KEEPALIVE_INTERVAL.\n" ); + SetLastError( ERROR_INVALID_PARAMETER ); + return FALSE; + } + socket->keepalive_interval = interval; + netconn_set_timeout( socket->request->netconn, FALSE, socket->keepalive_interval ); + SetLastError( ERROR_SUCCESS ); + TRACE( "WINHTTP_OPTION_WEB_SOCKET_KEEPALIVE_INTERVAL %lu.\n", interval); + return TRUE; + } + } + FIXME( "unimplemented option %lu\n", option ); SetLastError( ERROR_WINHTTP_INVALID_OPTION ); return FALSE; @@ -3215,6 +3244,7 @@ HINTERNET WINAPI WinHttpWebSocketCompleteUpgrade( HINTERNET hrequest, DWORD_PTR socket->hdr.callback = request->hdr.callback; socket->hdr.notify_mask = request->hdr.notify_mask; socket->hdr.context = context; + socket->keepalive_interval = 30000; InitializeSRWLock( &socket->send_lock ); init_queue( &socket->send_q ); init_queue( &socket->recv_q ); @@ -3222,6 +3252,8 @@ HINTERNET WINAPI WinHttpWebSocketCompleteUpgrade( HINTERNET hrequest, DWORD_PTR addref_object( &request->hdr ); socket->request = request; + netconn_set_timeout( socket->request->netconn, FALSE, socket->keepalive_interval ); + if ((hsocket = alloc_handle( &socket->hdr ))) { send_callback( &request->hdr, WINHTTP_CALLBACK_STATUS_HANDLE_CREATED, &hsocket, sizeof(hsocket) ); diff --git a/dlls/winhttp/tests/winhttp.c b/dlls/winhttp/tests/winhttp.c index d1dd58fdad4..ed3d06038af 100644 --- a/dlls/winhttp/tests/winhttp.c +++ b/dlls/winhttp/tests/winhttp.c @@ -3233,7 +3233,7 @@ static void test_redirect(int port) static void test_websocket(int port) { HINTERNET session, connection, request, socket, socket2; - DWORD size, len, count, status, index, error; + DWORD size, len, count, status, index, error, value; DWORD_PTR ctx; WINHTTP_WEB_SOCKET_BUFFER_TYPE type; WCHAR header[32]; @@ -3428,6 +3428,21 @@ static void test_websocket(int port) request = WinHttpOpenRequest(connection, L"GET", L"/", NULL, NULL, NULL, 0); ok(request != NULL, "got %lu\n", GetLastError()); + size = sizeof(value); + ret = WinHttpQueryOption(session, WINHTTP_OPTION_WEB_SOCKET_KEEPALIVE_INTERVAL, &value, &size); + ok(!ret, "got %d\n", ret); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %lu\n", GetLastError()); + + size = sizeof(value); + ret = WinHttpQueryOption(request, WINHTTP_OPTION_WEB_SOCKET_KEEPALIVE_INTERVAL, &value, &size); + ok(!ret, "got %d\n", ret); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %lu\n", GetLastError()); + + value = 20000; + ret = WinHttpSetOption(request, WINHTTP_OPTION_WEB_SOCKET_KEEPALIVE_INTERVAL, &value, sizeof(DWORD)); + ok(!ret, "got %d\n", ret); + todo_wine ok(GetLastError() == ERROR_WINHTTP_INCORRECT_HANDLE_TYPE, "got %lu\n", GetLastError()); + ret = WinHttpSetOption(request, WINHTTP_OPTION_UPGRADE_TO_WEB_SOCKET, NULL, 0); ok(ret, "got %lu\n", GetLastError()); @@ -3447,6 +3462,42 @@ static void test_websocket(int port) socket = pWinHttpWebSocketCompleteUpgrade(request, 0); ok(socket != NULL, "got %lu\n", GetLastError()); + value = 20000; + ret = WinHttpSetOption(socket, WINHTTP_OPTION_WEB_SOCKET_KEEPALIVE_INTERVAL, &value, 2); + ok(!ret, "got %d\n", ret); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %lu\n", GetLastError()); + + value = 20000; + ret = WinHttpSetOption(socket, WINHTTP_OPTION_WEB_SOCKET_KEEPALIVE_INTERVAL, &value, sizeof(DWORD) * 2); + ok(!ret, "got %d\n", ret); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %lu\n", GetLastError()); + + SetLastError(0xdeadbeef); + value = 20000; + ret = WinHttpSetOption(socket, WINHTTP_OPTION_WEB_SOCKET_KEEPALIVE_INTERVAL, &value, sizeof(DWORD)); + ok(ret, "got %lu\n", GetLastError()); + ok(!GetLastError(), "got %lu\n", GetLastError()); + + size = sizeof(value); + ret = WinHttpQueryOption(socket, WINHTTP_OPTION_WEB_SOCKET_KEEPALIVE_INTERVAL, &value, &size); + ok(!ret, "got %d\n", ret); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %lu\n", GetLastError()); + + size = 0; + ret = WinHttpQueryOption(socket, WINHTTP_OPTION_WEB_SOCKET_KEEPALIVE_INTERVAL, NULL, &size); + ok(!ret, "got %d\n", ret); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %lu\n", GetLastError()); + + value = 10000; + ret = WinHttpSetOption(socket, WINHTTP_OPTION_WEB_SOCKET_KEEPALIVE_INTERVAL, &value, sizeof(DWORD)); + ok(!ret, "got %d\n", ret); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %lu\n", GetLastError()); + + value = 10000; + ret = WinHttpSetOption(socket, WINHTTP_OPTION_WEB_SOCKET_KEEPALIVE_INTERVAL, &value, 2); + ok(!ret, "got %d\n", ret); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %lu\n", GetLastError()); + buf[0] = 0; count = 0; type = 0xdeadbeef; diff --git a/dlls/winhttp/winhttp_private.h b/dlls/winhttp/winhttp_private.h index 79941dee31a..52f9eb171ee 100644 --- a/dlls/winhttp/winhttp_private.h +++ b/dlls/winhttp/winhttp_private.h @@ -252,6 +252,7 @@ struct socket { struct object_header hdr; struct request *request; + int keepalive_interval; enum socket_state state; struct queue send_q; struct queue recv_q;
1
0
0
0
Rémi Bernon : winegstreamer: Create wg_sample from IMFSample within of wg_transform_read_mf.
by Alexandre Julliard
13 Oct '22
13 Oct '22
Module: wine Branch: master Commit: ba3e3d0c06bda6fea2ec707c59f82201bd10e350 URL:
https://gitlab.winehq.org/wine/wine/-/commit/ba3e3d0c06bda6fea2ec707c59f822…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Wed Sep 14 22:27:50 2022 +0200 winegstreamer: Create wg_sample from IMFSample within of wg_transform_read_mf. --- dlls/winegstreamer/color_convert.c | 16 ++------------- dlls/winegstreamer/gst_private.h | 4 ++-- dlls/winegstreamer/h264_decoder.c | 16 ++------------- dlls/winegstreamer/resampler.c | 17 ++-------------- dlls/winegstreamer/video_processor.c | 16 ++------------- dlls/winegstreamer/wg_sample.c | 38 +++++++++++++++++++++++++----------- dlls/winegstreamer/wma_decoder.c | 17 ++-------------- 7 files changed, 39 insertions(+), 85 deletions(-)
1
0
0
0
Rémi Bernon : winegstreamer: Make IMFTransform_ProcessOutput checks more consistent.
by Alexandre Julliard
13 Oct '22
13 Oct '22
Module: wine Branch: master Commit: 4845d46d49112f3a42efcce7c363e91f98c1f34e URL:
https://gitlab.winehq.org/wine/wine/-/commit/4845d46d49112f3a42efcce7c363e9…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Wed Sep 14 22:20:16 2022 +0200 winegstreamer: Make IMFTransform_ProcessOutput checks more consistent. --- dlls/winegstreamer/color_convert.c | 12 ++++++------ dlls/winegstreamer/h264_decoder.c | 6 +++--- dlls/winegstreamer/resampler.c | 15 +++++++-------- dlls/winegstreamer/video_processor.c | 11 ++++++----- dlls/winegstreamer/wma_decoder.c | 13 ++++++------- 5 files changed, 28 insertions(+), 29 deletions(-) diff --git a/dlls/winegstreamer/color_convert.c b/dlls/winegstreamer/color_convert.c index 7ffe29de907..4b985338778 100644 --- a/dlls/winegstreamer/color_convert.c +++ b/dlls/winegstreamer/color_convert.c @@ -553,15 +553,15 @@ static HRESULT WINAPI transform_ProcessOutput(IMFTransform *iface, DWORD flags, if (count != 1) return E_INVALIDARG; - if (FAILED(hr = IMFTransform_GetOutputStreamInfo(iface, 0, &info))) - return hr; - if (!impl->wg_transform) return MF_E_TRANSFORM_TYPE_NOT_SET; - *status = 0; - samples[0].dwStatus = 0; - if (!samples[0].pSample) return E_INVALIDARG; + *status = samples->dwStatus = 0; + if (!samples->pSample) + return E_INVALIDARG; + + if (FAILED(hr = IMFTransform_GetOutputStreamInfo(iface, 0, &info))) + return hr; if (FAILED(hr = wg_sample_create_mf(samples[0].pSample, &wg_sample))) return hr; diff --git a/dlls/winegstreamer/h264_decoder.c b/dlls/winegstreamer/h264_decoder.c index cf4a79303ab..bddb83e160a 100644 --- a/dlls/winegstreamer/h264_decoder.c +++ b/dlls/winegstreamer/h264_decoder.c @@ -607,9 +607,9 @@ static HRESULT WINAPI transform_ProcessOutput(IMFTransform *iface, DWORD flags, if (!decoder->wg_transform) return MF_E_TRANSFORM_TYPE_NOT_SET; - *status = 0; - samples[0].dwStatus = 0; - if (!samples[0].pSample) return E_INVALIDARG; + *status = samples->dwStatus = 0; + if (!samples->pSample) + return E_INVALIDARG; if (FAILED(hr = IMFMediaType_GetGUID(decoder->output_type, &MF_MT_SUBTYPE, &subtype))) return hr; diff --git a/dlls/winegstreamer/resampler.c b/dlls/winegstreamer/resampler.c index 7dd50da1c2d..e2052ff44a5 100644 --- a/dlls/winegstreamer/resampler.c +++ b/dlls/winegstreamer/resampler.c @@ -531,23 +531,22 @@ static HRESULT WINAPI transform_ProcessOutput(IMFTransform *iface, DWORD flags, TRACE("iface %p, flags %#lx, count %lu, samples %p, status %p.\n", iface, flags, count, samples, status); - if (count > 1) + if (count != 1) return E_INVALIDARG; if (!impl->wg_transform) return MF_E_TRANSFORM_TYPE_NOT_SET; - if (FAILED(hr = IMFTransform_GetOutputStreamInfo(iface, 0, &info))) - return hr; - - *status = 0; - samples[0].dwStatus = 0; - if (!samples[0].pSample) + *status = samples->dwStatus = 0; + if (!samples->pSample) { - samples[0].dwStatus = MFT_OUTPUT_DATA_BUFFER_NO_SAMPLE; + samples->dwStatus = MFT_OUTPUT_DATA_BUFFER_NO_SAMPLE; return MF_E_TRANSFORM_NEED_MORE_INPUT; } + if (FAILED(hr = IMFTransform_GetOutputStreamInfo(iface, 0, &info))) + return hr; + if (FAILED(hr = wg_sample_create_mf(samples[0].pSample, &wg_sample))) return hr; diff --git a/dlls/winegstreamer/video_processor.c b/dlls/winegstreamer/video_processor.c index a0f1c52f356..3cad80550d1 100644 --- a/dlls/winegstreamer/video_processor.c +++ b/dlls/winegstreamer/video_processor.c @@ -534,14 +534,15 @@ static HRESULT WINAPI video_processor_ProcessOutput(IMFTransform *iface, DWORD f if (count != 1) return E_INVALIDARG; - if (FAILED(hr = IMFTransform_GetOutputStreamInfo(iface, 0, &info))) - return hr; - if (!impl->wg_transform) return MF_E_TRANSFORM_TYPE_NOT_SET; - samples[0].dwStatus = 0; - if (!samples[0].pSample) return E_INVALIDARG; + samples->dwStatus = 0; + if (!samples->pSample) + return E_INVALIDARG; + + if (FAILED(hr = IMFTransform_GetOutputStreamInfo(iface, 0, &info))) + return hr; if (FAILED(hr = wg_sample_create_mf(samples[0].pSample, &wg_sample))) return hr; diff --git a/dlls/winegstreamer/wma_decoder.c b/dlls/winegstreamer/wma_decoder.c index a68d5c0f607..80167db40ce 100644 --- a/dlls/winegstreamer/wma_decoder.c +++ b/dlls/winegstreamer/wma_decoder.c @@ -553,23 +553,22 @@ static HRESULT WINAPI transform_ProcessOutput(IMFTransform *iface, DWORD flags, TRACE("iface %p, flags %#lx, count %lu, samples %p, status %p.\n", iface, flags, count, samples, status); - if (count > 1) + if (count != 1) return E_INVALIDARG; if (!decoder->wg_transform) return MF_E_TRANSFORM_TYPE_NOT_SET; - if (FAILED(hr = IMFTransform_GetOutputStreamInfo(iface, 0, &info))) - return hr; - - *status = 0; - samples[0].dwStatus = 0; - if (!samples[0].pSample) + *status = samples->dwStatus = 0; + if (!samples->pSample) { samples[0].dwStatus = MFT_OUTPUT_DATA_BUFFER_NO_SAMPLE; return MF_E_TRANSFORM_NEED_MORE_INPUT; } + if (FAILED(hr = IMFTransform_GetOutputStreamInfo(iface, 0, &info))) + return hr; + if (FAILED(hr = wg_sample_create_mf(samples[0].pSample, &wg_sample))) return hr;
1
0
0
0
Paul Gofman : windows.devices.enumeration: Add stub IDeviceAccessInformation interface.
by Alexandre Julliard
13 Oct '22
13 Oct '22
Module: wine Branch: master Commit: a628ac6d9ebffc4d7897e9e60760c6721d5a27a3 URL:
https://gitlab.winehq.org/wine/wine/-/commit/a628ac6d9ebffc4d7897e9e60760c6…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Tue Oct 4 14:06:56 2022 -0500 windows.devices.enumeration: Add stub IDeviceAccessInformation interface. --- dlls/windows.devices.enumeration/access.c | 137 ++++++++++++++++++++++- dlls/windows.devices.enumeration/tests/devices.c | 2 +- 2 files changed, 135 insertions(+), 4 deletions(-) diff --git a/dlls/windows.devices.enumeration/access.c b/dlls/windows.devices.enumeration/access.c index 3d773969a61..1056b734029 100644 --- a/dlls/windows.devices.enumeration/access.c +++ b/dlls/windows.devices.enumeration/access.c @@ -23,6 +23,137 @@ WINE_DEFAULT_DEBUG_CHANNEL(mmdevapi); +struct device_access_information +{ + IDeviceAccessInformation IDeviceAccessInformation_iface; + LONG ref; +}; + +static inline struct device_access_information *impl_from_IDeviceAccessInformation( IDeviceAccessInformation *iface ) +{ + return CONTAINING_RECORD( iface, struct device_access_information, IDeviceAccessInformation_iface ); +} + +static HRESULT WINAPI device_access_information_QueryInterface( IDeviceAccessInformation *iface, + REFIID iid, void **out ) +{ + struct device_access_information *impl = impl_from_IDeviceAccessInformation( iface ); + + TRACE( "iface %p, iid %s, out %p.\n", iface, debugstr_guid( iid ), out ); + + if (IsEqualGUID( iid, &IID_IUnknown ) || + IsEqualGUID( iid, &IID_IInspectable ) || + IsEqualGUID( iid, &IID_IAgileObject ) || + IsEqualGUID( iid, &IID_IDeviceAccessInformation )) + { + IInspectable_AddRef( (*out = &impl->IDeviceAccessInformation_iface) ); + return S_OK; + } + + FIXME( "%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid( iid ) ); + *out = NULL; + return E_NOINTERFACE; +} + +static ULONG WINAPI device_access_information_AddRef( IDeviceAccessInformation *iface ) +{ + struct device_access_information *impl = impl_from_IDeviceAccessInformation( iface ); + ULONG ref = InterlockedIncrement( &impl->ref ); + TRACE( "iface %p increasing refcount to %lu.\n", iface, ref ); + return ref; +} + +static ULONG WINAPI device_access_information_Release( IDeviceAccessInformation *iface ) +{ + struct device_access_information *impl = impl_from_IDeviceAccessInformation( iface ); + ULONG ref = InterlockedDecrement( &impl->ref ); + + TRACE( "iface %p decreasing refcount to %lu.\n", iface, ref ); + + if (!ref) + free( impl ); + + return ref; +} + +static HRESULT WINAPI device_access_information_GetIids( IDeviceAccessInformation *iface, ULONG *iid_count, IID **iids ) +{ + FIXME( "iface %p, iid_count %p, iids %p stub!\n", iface, iid_count, iids ); + return E_NOTIMPL; +} + +static HRESULT WINAPI device_access_information_GetRuntimeClassName( IDeviceAccessInformation *iface, + HSTRING *class_name ) +{ + return WindowsCreateString( RuntimeClass_Windows_Devices_Enumeration_DeviceAccessInformation, + ARRAY_SIZE(RuntimeClass_Windows_Devices_Enumeration_DeviceAccessInformation), + class_name ); +} + +static HRESULT WINAPI device_access_information_GetTrustLevel( IDeviceAccessInformation *iface, + TrustLevel *trust_level ) +{ + FIXME( "iface %p, trust_level %p stub!\n", iface, trust_level ); + return E_NOTIMPL; +} + +static HRESULT WINAPI device_access_information_add_AccessChanged( + IDeviceAccessInformation *iface, ITypedEventHandler_DeviceAccessInformation_DeviceAccessChangedEventArgs *handler, + EventRegistrationToken *cookie ) +{ + static EventRegistrationToken dummy_token = {.value = 0xdeadbeef}; + + FIXME( "iface %p, handler %p, cookie %p stub.\n", iface, handler, cookie); + + *cookie = dummy_token; + return S_OK; +} + +static HRESULT WINAPI device_access_information_remove_AccessChanged( IDeviceAccessInformation *iface, + EventRegistrationToken cookie ) +{ + FIXME( "iface %p, cookie %#I64x stub.\n", iface, cookie.value); + + return S_OK; +} + +static HRESULT WINAPI device_access_information_CurrentStatus( IDeviceAccessInformation *iface, + enum DeviceAccessStatus *status ) +{ + FIXME( "iface %p, status %p stub.\n", iface, status ); + + *status = DeviceAccessStatus_Allowed; + return S_OK; +} + +static const struct IDeviceAccessInformationVtbl device_access_information_vtbl = +{ + device_access_information_QueryInterface, + device_access_information_AddRef, + device_access_information_Release, + /* IInspectable methods */ + device_access_information_GetIids, + device_access_information_GetRuntimeClassName, + device_access_information_GetTrustLevel, + /* IDeviceAccessInformation methods */ + device_access_information_add_AccessChanged, + device_access_information_remove_AccessChanged, + device_access_information_CurrentStatus, +}; + +static HRESULT device_access_information_create( IDeviceAccessInformation **out ) +{ + struct device_access_information *impl; + + if (!(impl = calloc( 1, sizeof(*impl) ))) return E_OUTOFMEMORY; + impl->IDeviceAccessInformation_iface.lpVtbl = &device_access_information_vtbl; + impl->ref = 1; + + *out = &impl->IDeviceAccessInformation_iface; + TRACE( "created device_access_information %p.\n", *out ); + return S_OK; +} + struct device_access_information_statics { IActivationFactory IActivationFactory_iface; @@ -120,7 +251,7 @@ static HRESULT WINAPI statics_CreateFromId( IDeviceAccessInformationStatics *ifa { FIXME( "device_id %s, value %p stub.\n", debugstr_hstring( device_id ), value ); - return E_NOTIMPL; + return device_access_information_create( value ); } static HRESULT WINAPI statics_CreateFromDeviceClassId( IDeviceAccessInformationStatics *iface, @@ -128,7 +259,7 @@ static HRESULT WINAPI statics_CreateFromDeviceClassId( IDeviceAccessInformationS { FIXME( "device_class_id %s, value %p stub.\n", debugstr_guid( &device_class_id ), value ); - return E_NOTIMPL; + return device_access_information_create( value ); } static HRESULT WINAPI statics_CreateFromDeviceClass( IDeviceAccessInformationStatics *iface, @@ -136,7 +267,7 @@ static HRESULT WINAPI statics_CreateFromDeviceClass( IDeviceAccessInformationSta { FIXME( "device_class %d, value %p stub.\n", device_class, value ); - return E_NOTIMPL; + return device_access_information_create( value ); } static const struct IDeviceAccessInformationStaticsVtbl statics_vtbl = diff --git a/dlls/windows.devices.enumeration/tests/devices.c b/dlls/windows.devices.enumeration/tests/devices.c index 1ffa464d83f..b146f4b0698 100644 --- a/dlls/windows.devices.enumeration/tests/devices.c +++ b/dlls/windows.devices.enumeration/tests/devices.c @@ -272,7 +272,7 @@ static void test_DeviceAccessInformation( void ) ok( hr == S_OK, "got hr %#lx\n", hr ); hr = IDeviceAccessInformationStatics_CreateFromDeviceClass( statics, DeviceClass_AudioCapture, &access_info ); - todo_wine ok( hr == S_OK || broken( hr == RPC_E_CALL_COMPLETE ) /* broken on some Testbot machines */, "got hr %#lx\n", hr ); + ok( hr == S_OK || broken( hr == RPC_E_CALL_COMPLETE ) /* broken on some Testbot machines */, "got hr %#lx\n", hr ); if (hr == S_OK) {
1
0
0
0
Paul Gofman : windows.devices.enumeration: Create stub DeviceAccessInformation class.
by Alexandre Julliard
13 Oct '22
13 Oct '22
Module: wine Branch: master Commit: d0a60ca810ecb7ef71e67cb1a21ca6dc35c18bef URL:
https://gitlab.winehq.org/wine/wine/-/commit/d0a60ca810ecb7ef71e67cb1a21ca6…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Tue Oct 4 13:13:05 2022 -0500 windows.devices.enumeration: Create stub DeviceAccessInformation class. --- dlls/windows.devices.enumeration/Makefile.in | 1 + dlls/windows.devices.enumeration/access.c | 164 +++++++++++++++++++++++ dlls/windows.devices.enumeration/main.c | 18 ++- dlls/windows.devices.enumeration/private.h | 4 + dlls/windows.devices.enumeration/tests/devices.c | 68 +++++++++- 5 files changed, 247 insertions(+), 8 deletions(-)
1
0
0
0
Paul Gofman : include/windows.devices.enumeration: Define DeviceAccessInformation class.
by Alexandre Julliard
13 Oct '22
13 Oct '22
Module: wine Branch: master Commit: 51e1c7069543a43a926e235b03aeb8de8d530c1f URL:
https://gitlab.winehq.org/wine/wine/-/commit/51e1c7069543a43a926e235b03aeb8…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Wed Oct 12 12:28:50 2022 -0500 include/windows.devices.enumeration: Define DeviceAccessInformation class. --- include/windows.devices.enumeration.idl | 80 +++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) diff --git a/include/windows.devices.enumeration.idl b/include/windows.devices.enumeration.idl index 3b3ed383531..a88cb69edac 100644 --- a/include/windows.devices.enumeration.idl +++ b/include/windows.devices.enumeration.idl @@ -32,6 +32,7 @@ namespace Windows.Devices.Enumeration { typedef enum DeviceInformationKind DeviceInformationKind; typedef enum DeviceWatcherStatus DeviceWatcherStatus; typedef enum Panel Panel; + typedef enum DeviceAccessStatus DeviceAccessStatus; interface IDeviceInformation; interface IDeviceInformationStatics; @@ -45,6 +46,8 @@ namespace Windows.Devices.Enumeration { runtimeclass DeviceThumbnail; runtimeclass DeviceWatcher; runtimeclass EnclosureLocation; + runtimeclass DeviceAccessChangedEventArgs; + runtimeclass DeviceAccessInformation; declare { @@ -61,6 +64,7 @@ namespace Windows.Devices.Enumeration { interface Windows.Foundation.TypedEventHandler<Windows.Devices.Enumeration.DeviceWatcher *, IInspectable *>; interface Windows.Foundation.TypedEventHandler<Windows.Devices.Enumeration.DeviceWatcher *, Windows.Devices.Enumeration.DeviceInformation *>; interface Windows.Foundation.TypedEventHandler<Windows.Devices.Enumeration.DeviceWatcher *, Windows.Devices.Enumeration.DeviceInformationUpdate *>; + interface Windows.Foundation.TypedEventHandler<Windows.Devices.Enumeration.DeviceAccessInformation *, Windows.Devices.Enumeration.DeviceAccessChangedEventArgs *>; } } @@ -115,6 +119,15 @@ namespace Windows.Devices.Enumeration { Right = 6, }; + [contract(Windows.Foundation.UniversalApiContract, 1.0)] + enum DeviceAccessStatus + { + Unspecified = 0, + Allowed = 1, + DeniedByUser = 2, + DeniedBySystem = 3, + }; + [ exclusiveto(Windows.Devices.Enumeration.DeviceInformation), uuid(aba0fb95-4398-489d-8e44-e6130927011f) @@ -204,6 +217,51 @@ namespace Windows.Devices.Enumeration { [out, retval] Windows.Devices.Enumeration.DeviceWatcher **watcher); } + [ + contract(Windows.Foundation.UniversalApiContract, 1.0), + exclusiveto(Windows.Devices.Enumeration.DeviceAccessChangedEventArgs), + uuid(deda0bcc-4f9d-4f58-9dba-a9bc800408d5) + ] + interface IDeviceAccessChangedEventArgs : IInspectable + { + [propget] HRESULT Status([out, retval] Windows.Devices.Enumeration.DeviceAccessStatus *value); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 3.0), + exclusiveto(Windows.Devices.Enumeration.DeviceAccessChangedEventArgs), + uuid(82523262-934b-4b30-a178-adc39f2f2be3) + ] + interface IDeviceAccessChangedEventArgs2 : IInspectable + requires Windows.Devices.Enumeration.IDeviceAccessChangedEventArgs + { + [propget] HRESULT Id([out, retval] HSTRING *value); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 1.0), + exclusiveto(Windows.Devices.Enumeration.DeviceAccessInformation), + uuid(0baa9a73-6de5-4915-8ddd-9a0554a6f545) + ] + interface IDeviceAccessInformation : IInspectable + { + [eventadd] HRESULT AccessChanged([in] Windows.Foundation.TypedEventHandler<Windows.Devices.Enumeration.DeviceAccessInformation *, Windows.Devices.Enumeration.DeviceAccessChangedEventArgs *> *handler, [out, retval] EventRegistrationToken *cookie); + [eventremove] HRESULT AccessChanged([in] EventRegistrationToken cookie); + [propget] HRESULT CurrentStatus([out, retval] Windows.Devices.Enumeration.DeviceAccessStatus *status); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 1.0), + exclusiveto(Windows.Devices.Enumeration.DeviceAccessInformation), + uuid(574bd3d3-5f30-45cd-8a94-724fe5973084), + ] + interface IDeviceAccessInformationStatics : IInspectable + { + HRESULT CreateFromId([in] HSTRING device_id, [out, retval] Windows.Devices.Enumeration.DeviceAccessInformation **value); + HRESULT CreateFromDeviceClassId([in] GUID device_class_id, [out, retval] Windows.Devices.Enumeration.DeviceAccessInformation **value); + HRESULT CreateFromDeviceClass([in] Windows.Devices.Enumeration.DeviceClass device_class, [out, retval] Windows.Devices.Enumeration.DeviceAccessInformation **value); + } + [ contract(Windows.Foundation.UniversalApiContract, 1.0), marshaling_behavior(agile), @@ -265,4 +323,26 @@ namespace Windows.Devices.Enumeration { { [default] interface Windows.Devices.Enumeration.IEnclosureLocation; } + + [ + contract(Windows.Foundation.UniversalApiContract, 1.0), + marshaling_behavior(agile) + ] + runtimeclass DeviceAccessChangedEventArgs + { + [default] interface Windows.Devices.Enumeration.IDeviceAccessChangedEventArgs; + [contract(Windows.Foundation.UniversalApiContract, 3.0)] interface Windows.Devices.Enumeration.IDeviceAccessChangedEventArgs2; + } + + [ + contract(Windows.Foundation.UniversalApiContract, 1.0), + marshaling_behavior(agile), + static(Windows.Devices.Enumeration.IDeviceAccessInformationStatics, Windows.Foundation.UniversalApiContract, 1.0), + threading(both) + ] + runtimeclass DeviceAccessInformation + { + [default] interface Windows.Devices.Enumeration.IDeviceAccessInformation; + } + }
1
0
0
0
Esme Povirk : windowscodecs/tests: Accept new error code from win11.
by Alexandre Julliard
13 Oct '22
13 Oct '22
Module: wine Branch: master Commit: fd125d4adeae3cfb7433b5677e63a3b32312ab2e URL:
https://gitlab.winehq.org/wine/wine/-/commit/fd125d4adeae3cfb7433b5677e63a3…
Author: Esme Povirk <esme(a)codeweavers.com> Date: Wed Oct 12 13:22:51 2022 -0500 windowscodecs/tests: Accept new error code from win11. --- dlls/windowscodecs/tests/converter.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dlls/windowscodecs/tests/converter.c b/dlls/windowscodecs/tests/converter.c index 2e77db6b205..eb35621396f 100644 --- a/dlls/windowscodecs/tests/converter.c +++ b/dlls/windowscodecs/tests/converter.c @@ -1510,7 +1510,8 @@ static void test_multi_encoder_impl(const struct bitmap_data **srcs, const CLSID hr = IWICBitmapFrameEncode_WriteSource_Proxy(frameencode, &src_obj->IWICBitmapSource_iface, rc); if (!set_size && rc->Width < 0) todo_wine - ok(hr == WINCODEC_ERR_SOURCERECTDOESNOTMATCHDIMENSIONS, + ok(hr == WINCODEC_ERR_SOURCERECTDOESNOTMATCHDIMENSIONS || + hr == HRESULT_FROM_WIN32(ERROR_ARITHMETIC_OVERFLOW) /* win11 */, "WriteSource_Proxy(%dx%d) got unexpected hr %lx (%s)\n", rc->Width, rc->Height, hr, name); else ok(hr == S_OK, "WriteSource_Proxy failed, %dx%d, hr=%lx (%s)\n", rc->Width, rc->Height, hr, name);
1
0
0
0
Akihiro Sagawa : imm32/tests: Don't expect IME window if the parent is message-only window descendant.
by Alexandre Julliard
12 Oct '22
12 Oct '22
Module: wine Branch: master Commit: f87ad783e23a2b6f5e9b8cf78dbf99bad4471a25 URL:
https://gitlab.winehq.org/wine/wine/-/commit/f87ad783e23a2b6f5e9b8cf78dbf99…
Author: Akihiro Sagawa <sagawa.aki(a)gmail.com> Date: Mon Oct 10 22:01:15 2022 +0900 imm32/tests: Don't expect IME window if the parent is message-only window descendant. It has apparently changed in Win10 21H1+. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=53521
--- dlls/imm32/tests/imm32.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/dlls/imm32/tests/imm32.c b/dlls/imm32/tests/imm32.c index 1ed8ba1f000..75b5cde6c7b 100644 --- a/dlls/imm32/tests/imm32.c +++ b/dlls/imm32/tests/imm32.c @@ -1412,24 +1412,29 @@ static DWORD WINAPI test_default_ime_with_message_only_window_cb(void *arg) { HWND hwnd1, hwnd2, default_ime_wnd; + /* Message-only window doesn't create associated IME window. */ test_phase = PHASE_UNKNOWN; hwnd1 = CreateWindowA(wndcls, "Wine imm32.dll test", WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, 240, 120, HWND_MESSAGE, NULL, GetModuleHandleW(NULL), NULL); default_ime_wnd = ImmGetDefaultIMEWnd(hwnd1); - ok(!IsWindow(default_ime_wnd), "Expected no IME windows, got %p\n", default_ime_wnd); + ok(!default_ime_wnd, "Expected no IME windows, got %p\n", default_ime_wnd); + /* Setting message-only window as owner at creation, + doesn't create associated IME window. */ hwnd2 = CreateWindowA(wndcls, "Wine imm32.dll test", WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, 240, 120, hwnd1, NULL, GetModuleHandleW(NULL), NULL); default_ime_wnd = ImmGetDefaultIMEWnd(hwnd2); - ok(IsWindow(default_ime_wnd), "Expected IME window existence\n"); + todo_wine ok(!default_ime_wnd || broken(IsWindow(default_ime_wnd)), "Expected no IME windows, got %p\n", default_ime_wnd); DestroyWindow(hwnd2); DestroyWindow(hwnd1); + /* Making window message-only after creation, + doesn't disassociate IME window. */ hwnd1 = CreateWindowA(wndcls, "Wine imm32.dll test", WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT,
1
0
0
0
Paul Gofman : msvcp140: Import __ExceptionPtrCompare implementation.
by Alexandre Julliard
12 Oct '22
12 Oct '22
Module: wine Branch: master Commit: 6c55010ef8544e66845ab4a872a3ac871e2cf581 URL:
https://gitlab.winehq.org/wine/wine/-/commit/6c55010ef8544e66845ab4a872a3ac…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Tue Oct 11 14:48:50 2022 -0500 msvcp140: Import __ExceptionPtrCompare implementation. --- dlls/msvcp140/msvcp140.spec | 4 ++-- dlls/msvcp90/exception.c | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/dlls/msvcp140/msvcp140.spec b/dlls/msvcp140/msvcp140.spec index 321e36abb03..dd619c637e1 100644 --- a/dlls/msvcp140/msvcp140.spec +++ b/dlls/msvcp140/msvcp140.spec @@ -1691,8 +1691,8 @@ @ cdecl -arch=win64 ?_Xruntime_error@std@@YAXPEBD@Z(str) _Xruntime_error @ cdecl -arch=win32 ?__ExceptionPtrAssign@@YAXPAXPBX@Z(ptr ptr) __ExceptionPtrAssign @ cdecl -arch=win64 ?__ExceptionPtrAssign@@YAXPEAXPEBX@Z(ptr ptr) __ExceptionPtrAssign -@ cdecl -arch=win32 ?__ExceptionPtrCompare@@YA_NPBX0@Z(ptr ptr) msvcr120.?__ExceptionPtrCompare@@YA_NPBX0@Z -@ cdecl -arch=win64 ?__ExceptionPtrCompare@@YA_NPEBX0@Z(ptr ptr) msvcr120.?__ExceptionPtrCompare@@YA_NPEBX0@Z +@ cdecl -arch=win32 ?__ExceptionPtrCompare@@YA_NPBX0@Z(ptr ptr) __ExceptionPtrCompare +@ cdecl -arch=win64 ?__ExceptionPtrCompare@@YA_NPEBX0@Z(ptr ptr) __ExceptionPtrCompare @ cdecl -arch=win32 ?__ExceptionPtrCopy@@YAXPAXPBX@Z(ptr ptr) __ExceptionPtrCopy @ cdecl -arch=win64 ?__ExceptionPtrCopy@@YAXPEAXPEBX@Z(ptr ptr) __ExceptionPtrCopy @ cdecl -arch=win32 ?__ExceptionPtrCopyException@@YAXPAXPBX1@Z(ptr ptr ptr) __ExceptionPtrCopyException diff --git a/dlls/msvcp90/exception.c b/dlls/msvcp90/exception.c index 6483e21c7b9..8ceaa91e884 100644 --- a/dlls/msvcp90/exception.c +++ b/dlls/msvcp90/exception.c @@ -1309,6 +1309,14 @@ void __cdecl __ExceptionPtrCopyException(exception_ptr *ep, } #endif +/********************************************************************* + * ?__ExceptionPtrCompare@@YA_NPBX0@Z + * ?__ExceptionPtrCompare@@YA_NPEBX0@Z + */ +bool __cdecl __ExceptionPtrCompare(const exception_ptr *ep1, const exception_ptr *ep2) +{ + return ep1->rec == ep2->rec; +} #endif #if _MSVCP_VER >= 70 || defined(_MSVCIRT)
1
0
0
0
Paul Gofman : msvcp140: Import __ExceptionPtrCopyException implementation.
by Alexandre Julliard
12 Oct '22
12 Oct '22
Module: wine Branch: master Commit: 961428dc74631ba6b142a7c9213a036822404870 URL:
https://gitlab.winehq.org/wine/wine/-/commit/961428dc74631ba6b142a7c9213a03…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Tue Oct 11 15:50:26 2022 -0500 msvcp140: Import __ExceptionPtrCopyException implementation. --- dlls/msvcp140/msvcp140.spec | 4 +-- dlls/msvcp90/exception.c | 84 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 86 insertions(+), 2 deletions(-) diff --git a/dlls/msvcp140/msvcp140.spec b/dlls/msvcp140/msvcp140.spec index e5e965db3e8..321e36abb03 100644 --- a/dlls/msvcp140/msvcp140.spec +++ b/dlls/msvcp140/msvcp140.spec @@ -1695,8 +1695,8 @@ @ cdecl -arch=win64 ?__ExceptionPtrCompare@@YA_NPEBX0@Z(ptr ptr) msvcr120.?__ExceptionPtrCompare@@YA_NPEBX0@Z @ cdecl -arch=win32 ?__ExceptionPtrCopy@@YAXPAXPBX@Z(ptr ptr) __ExceptionPtrCopy @ cdecl -arch=win64 ?__ExceptionPtrCopy@@YAXPEAXPEBX@Z(ptr ptr) __ExceptionPtrCopy -@ cdecl -arch=win32 ?__ExceptionPtrCopyException@@YAXPAXPBX1@Z(ptr ptr ptr) msvcr120.?__ExceptionPtrCopyException@@YAXPAXPBX1@Z -@ cdecl -arch=win64 ?__ExceptionPtrCopyException@@YAXPEAXPEBX1@Z(ptr ptr ptr) msvcr120.?__ExceptionPtrCopyException@@YAXPEAXPEBX1@Z +@ cdecl -arch=win32 ?__ExceptionPtrCopyException@@YAXPAXPBX1@Z(ptr ptr ptr) __ExceptionPtrCopyException +@ cdecl -arch=win64 ?__ExceptionPtrCopyException@@YAXPEAXPEBX1@Z(ptr ptr ptr) __ExceptionPtrCopyException @ cdecl -arch=win32 ?__ExceptionPtrCreate@@YAXPAX@Z(ptr) __ExceptionPtrCreate @ cdecl -arch=win64 ?__ExceptionPtrCreate@@YAXPEAX@Z(ptr) __ExceptionPtrCreate @ cdecl -arch=win32 ?__ExceptionPtrCurrentException@@YAXPAX@Z(ptr) __ExceptionPtrCurrentException diff --git a/dlls/msvcp90/exception.c b/dlls/msvcp90/exception.c index aa7cffb8c17..6483e21c7b9 100644 --- a/dlls/msvcp90/exception.c +++ b/dlls/msvcp90/exception.c @@ -26,6 +26,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(msvcp); +#define CXX_FRAME_MAGIC_VC6 0x19930520 + CREATE_TYPE_INFO_VTABLE #define CLASS_IS_SIMPLE_TYPE 1 @@ -1225,6 +1227,88 @@ bool __cdecl __ExceptionPtrToBool(exception_ptr *ep) { return !!ep->rec; } + +/********************************************************************* + * ?__ExceptionPtrCopyException@@YAXPAXPBX1@Z + * ?__ExceptionPtrCopyException@@YAXPEAXPEBX1@Z + */ +#ifndef __x86_64__ +void __cdecl __ExceptionPtrCopyException(exception_ptr *ep, + exception *object, const cxx_exception_type *type) +{ + const cxx_type_info *ti; + void **data; + + __ExceptionPtrDestroy(ep); + + ep->rec = HeapAlloc(GetProcessHeap(), 0, sizeof(EXCEPTION_RECORD)); + ep->ref = HeapAlloc(GetProcessHeap(), 0, sizeof(int)); + *ep->ref = 1; + + memset(ep->rec, 0, sizeof(EXCEPTION_RECORD)); + ep->rec->ExceptionCode = CXX_EXCEPTION; + ep->rec->ExceptionFlags = EH_NONCONTINUABLE; + ep->rec->NumberParameters = 3; + ep->rec->ExceptionInformation[0] = CXX_FRAME_MAGIC_VC6; + ep->rec->ExceptionInformation[2] = (ULONG_PTR)type; + + ti = type->type_info_table->info[0]; + data = HeapAlloc(GetProcessHeap(), 0, ti->size); + if (ti->flags & CLASS_IS_SIMPLE_TYPE) + { + memcpy(data, object, ti->size); + if (ti->size == sizeof(void *)) *data = get_this_pointer(&ti->offsets, *data); + } + else if (ti->copy_ctor) + { + call_copy_ctor(ti->copy_ctor, data, get_this_pointer(&ti->offsets, object), + ti->flags & CLASS_HAS_VIRTUAL_BASE_CLASS); + } + else + memcpy(data, get_this_pointer(&ti->offsets, object), ti->size); + ep->rec->ExceptionInformation[1] = (ULONG_PTR)data; +} +#else +void __cdecl __ExceptionPtrCopyException(exception_ptr *ep, + exception *object, const cxx_exception_type *type) +{ + const cxx_type_info *ti; + void **data; + char *base; + + RtlPcToFileHeader((void*)type, (void**)&base); + __ExceptionPtrDestroy(ep); + + ep->rec = HeapAlloc(GetProcessHeap(), 0, sizeof(EXCEPTION_RECORD)); + ep->ref = HeapAlloc(GetProcessHeap(), 0, sizeof(int)); + *ep->ref = 1; + + memset(ep->rec, 0, sizeof(EXCEPTION_RECORD)); + ep->rec->ExceptionCode = CXX_EXCEPTION; + ep->rec->ExceptionFlags = EH_NONCONTINUABLE; + ep->rec->NumberParameters = 4; + ep->rec->ExceptionInformation[0] = CXX_FRAME_MAGIC_VC6; + ep->rec->ExceptionInformation[2] = (ULONG_PTR)type; + ep->rec->ExceptionInformation[3] = (ULONG_PTR)base; + + ti = (const cxx_type_info*)(base + ((const cxx_type_info_table*)(base + type->type_info_table))->info[0]); + data = HeapAlloc(GetProcessHeap(), 0, ti->size); + if (ti->flags & CLASS_IS_SIMPLE_TYPE) + { + memcpy(data, object, ti->size); + if (ti->size == sizeof(void *)) *data = get_this_pointer(&ti->offsets, *data); + } + else if (ti->copy_ctor) + { + call_copy_ctor(base + ti->copy_ctor, data, get_this_pointer(&ti->offsets, object), + ti->flags & CLASS_HAS_VIRTUAL_BASE_CLASS); + } + else + memcpy(data, get_this_pointer(&ti->offsets, object), ti->size); + ep->rec->ExceptionInformation[1] = (ULONG_PTR)data; +} +#endif + #endif #if _MSVCP_VER >= 70 || defined(_MSVCIRT)
1
0
0
0
Paul Gofman : msvcp140: Import __ExceptionPtrToBool implementation.
by Alexandre Julliard
12 Oct '22
12 Oct '22
Module: wine Branch: master Commit: 1986dcc69c2bf7af3675b1cde3782b4439249964 URL:
https://gitlab.winehq.org/wine/wine/-/commit/1986dcc69c2bf7af3675b1cde3782b…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Tue Oct 11 15:47:24 2022 -0500 msvcp140: Import __ExceptionPtrToBool implementation. --- dlls/msvcp140/msvcp140.spec | 4 ++-- dlls/msvcp90/exception.c | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/dlls/msvcp140/msvcp140.spec b/dlls/msvcp140/msvcp140.spec index 6a63f546625..e5e965db3e8 100644 --- a/dlls/msvcp140/msvcp140.spec +++ b/dlls/msvcp140/msvcp140.spec @@ -1707,8 +1707,8 @@ @ cdecl -arch=win64 ?__ExceptionPtrRethrow@@YAXPEBX@Z(ptr) __ExceptionPtrRethrow @ stub -arch=win32 ?__ExceptionPtrSwap@@YAXPAX0@Z @ stub -arch=win64 ?__ExceptionPtrSwap@@YAXPEAX0@Z -@ cdecl -arch=win32 ?__ExceptionPtrToBool@@YA_NPBX@Z(ptr) msvcr120.?__ExceptionPtrToBool@@YA_NPBX@Z -@ cdecl -arch=win64 ?__ExceptionPtrToBool@@YA_NPEBX@Z(ptr) msvcr120.?__ExceptionPtrToBool@@YA_NPEBX@Z +@ cdecl -arch=win32 ?__ExceptionPtrToBool@@YA_NPBX@Z(ptr) __ExceptionPtrToBool +@ cdecl -arch=win64 ?__ExceptionPtrToBool@@YA_NPEBX@Z(ptr) __ExceptionPtrToBool @ cdecl -arch=arm ?always_noconv@codecvt_base@std@@QBA_NXZ(ptr) codecvt_base_always_noconv @ thiscall -arch=i386 ?always_noconv@codecvt_base@std@@QBE_NXZ(ptr) codecvt_base_always_noconv @ cdecl -arch=win64 ?always_noconv@codecvt_base@std@@QEBA_NXZ(ptr) codecvt_base_always_noconv diff --git a/dlls/msvcp90/exception.c b/dlls/msvcp90/exception.c index 9da49dda732..aa7cffb8c17 100644 --- a/dlls/msvcp90/exception.c +++ b/dlls/msvcp90/exception.c @@ -1216,6 +1216,15 @@ void __cdecl __ExceptionPtrCurrentException(exception_ptr *ep) return; } #endif + +/********************************************************************* + * ?__ExceptionPtrToBool@@YA_NPBX@Z + * ?__ExceptionPtrToBool@@YA_NPEBX@Z + */ +bool __cdecl __ExceptionPtrToBool(exception_ptr *ep) +{ + return !!ep->rec; +} #endif #if _MSVCP_VER >= 70 || defined(_MSVCIRT)
1
0
0
0
Paul Gofman : msvcp140: Import __ExceptionPtrCurrentException implementation.
by Alexandre Julliard
12 Oct '22
12 Oct '22
Module: wine Branch: master Commit: 23dd3b27e42f5d657e30adf259729b2b2da25e91 URL:
https://gitlab.winehq.org/wine/wine/-/commit/23dd3b27e42f5d657e30adf259729b…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Tue Oct 11 15:44:40 2022 -0500 msvcp140: Import __ExceptionPtrCurrentException implementation. --- dlls/msvcp140/msvcp140.spec | 4 +- dlls/msvcp90/exception.c | 149 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 151 insertions(+), 2 deletions(-) diff --git a/dlls/msvcp140/msvcp140.spec b/dlls/msvcp140/msvcp140.spec index 09672daf681..6a63f546625 100644 --- a/dlls/msvcp140/msvcp140.spec +++ b/dlls/msvcp140/msvcp140.spec @@ -1699,8 +1699,8 @@ @ cdecl -arch=win64 ?__ExceptionPtrCopyException@@YAXPEAXPEBX1@Z(ptr ptr ptr) msvcr120.?__ExceptionPtrCopyException@@YAXPEAXPEBX1@Z @ cdecl -arch=win32 ?__ExceptionPtrCreate@@YAXPAX@Z(ptr) __ExceptionPtrCreate @ cdecl -arch=win64 ?__ExceptionPtrCreate@@YAXPEAX@Z(ptr) __ExceptionPtrCreate -@ cdecl -arch=win32 ?__ExceptionPtrCurrentException@@YAXPAX@Z(ptr) msvcr120.?__ExceptionPtrCurrentException@@YAXPAX@Z -@ cdecl -arch=win64 ?__ExceptionPtrCurrentException@@YAXPEAX@Z(ptr) msvcr120.?__ExceptionPtrCurrentException@@YAXPEAX@Z +@ cdecl -arch=win32 ?__ExceptionPtrCurrentException@@YAXPAX@Z(ptr) __ExceptionPtrCurrentException +@ cdecl -arch=win64 ?__ExceptionPtrCurrentException@@YAXPEAX@Z(ptr) __ExceptionPtrCurrentException @ cdecl -arch=win32 ?__ExceptionPtrDestroy@@YAXPAX@Z(ptr) __ExceptionPtrDestroy @ cdecl -arch=win64 ?__ExceptionPtrDestroy@@YAXPEAX@Z(ptr) __ExceptionPtrDestroy @ cdecl -arch=win32 ?__ExceptionPtrRethrow@@YAXPBX@Z(ptr) __ExceptionPtrRethrow diff --git a/dlls/msvcp90/exception.c b/dlls/msvcp90/exception.c index 62a15073320..9da49dda732 100644 --- a/dlls/msvcp90/exception.c +++ b/dlls/msvcp90/exception.c @@ -946,6 +946,55 @@ bool __cdecl MSVCP__uncaught_exception(void) } #if _MSVCP_VER >= 140 +void** CDECL __current_exception(void); + +/* compute the this pointer for a base class of a given type */ +static inline void *get_this_pointer( const this_ptr_offsets *off, void *object ) +{ + if (!object) return NULL; + + if (off->vbase_descr >= 0) + { + int *offset_ptr; + + /* move this ptr to vbase descriptor */ + object = (char *)object + off->vbase_descr; + /* and fetch additional offset from vbase descriptor */ + offset_ptr = (int *)(*(char **)object + off->vbase_offset); + object = (char *)object + *offset_ptr; + } + + object = (char *)object + off->this_offset; + return object; +} + +#ifdef __i386__ +extern void call_copy_ctor( void *func, void *this, void *src, int has_vbase ); +__ASM_GLOBAL_FUNC( call_copy_ctor, + "pushl %ebp\n\t" + __ASM_CFI(".cfi_adjust_cfa_offset 4\n\t") + __ASM_CFI(".cfi_rel_offset %ebp,0\n\t") + "movl %esp, %ebp\n\t" + __ASM_CFI(".cfi_def_cfa_register %ebp\n\t") + "pushl $1\n\t" + "movl 12(%ebp), %ecx\n\t" + "pushl 16(%ebp)\n\t" + "call *8(%ebp)\n\t" + "leave\n" + __ASM_CFI(".cfi_def_cfa %esp,4\n\t") + __ASM_CFI(".cfi_same_value %ebp\n\t") + "ret" ); +#else +static inline void call_copy_ctor( void *func, void *this, void *src, int has_vbase ) +{ + TRACE( "calling copy ctor %p object %p src %p\n", func, this, src ); + if (has_vbase) + ((void (__cdecl*)(void*, void*, BOOL))func)(this, src, 1); + else + ((void (__cdecl*)(void*, void*))func)(this, src); +} +#endif + int __cdecl __uncaught_exceptions(void) { return *__processing_throw(); @@ -1067,6 +1116,106 @@ void __cdecl __ExceptionPtrRethrow(const exception_ptr *ep) ep->rec->NumberParameters, ep->rec->ExceptionInformation); } +/********************************************************************* + * ?__ExceptionPtrCurrentException@@YAXPAX@Z + * ?__ExceptionPtrCurrentException@@YAXPEAX@Z + */ +#ifndef __x86_64__ +void __cdecl __ExceptionPtrCurrentException(exception_ptr *ep) +{ + void **current_exception = __current_exception(); + EXCEPTION_RECORD *rec = current_exception ? *current_exception : NULL; + + TRACE("(%p)\n", ep); + + if (!rec) + { + ep->rec = NULL; + ep->ref = NULL; + return; + } + + ep->rec = HeapAlloc(GetProcessHeap(), 0, sizeof(EXCEPTION_RECORD)); + ep->ref = HeapAlloc(GetProcessHeap(), 0, sizeof(int)); + + *ep->rec = *rec; + *ep->ref = 1; + + if (ep->rec->ExceptionCode == CXX_EXCEPTION) + { + const cxx_exception_type *et = (void*)ep->rec->ExceptionInformation[2]; + const cxx_type_info *ti; + void **data, *obj; + + ti = et->type_info_table->info[0]; + data = HeapAlloc(GetProcessHeap(), 0, ti->size); + + obj = (void*)ep->rec->ExceptionInformation[1]; + if (ti->flags & CLASS_IS_SIMPLE_TYPE) + { + memcpy(data, obj, ti->size); + if (ti->size == sizeof(void *)) *data = get_this_pointer(&ti->offsets, *data); + } + else if (ti->copy_ctor) + { + call_copy_ctor(ti->copy_ctor, data, get_this_pointer(&ti->offsets, obj), + ti->flags & CLASS_HAS_VIRTUAL_BASE_CLASS); + } + else + memcpy(data, get_this_pointer(&ti->offsets, obj), ti->size); + ep->rec->ExceptionInformation[1] = (ULONG_PTR)data; + } + return; +} +#else +void __cdecl __ExceptionPtrCurrentException(exception_ptr *ep) +{ + void **current_exception = __current_exception(); + EXCEPTION_RECORD *rec = current_exception ? *current_exception : NULL; + + TRACE("(%p)\n", ep); + + if (!rec) + { + ep->rec = NULL; + ep->ref = NULL; + return; + } + + ep->rec = HeapAlloc(GetProcessHeap(), 0, sizeof(EXCEPTION_RECORD)); + ep->ref = HeapAlloc(GetProcessHeap(), 0, sizeof(int)); + + *ep->rec = *rec; + *ep->ref = 1; + + if (ep->rec->ExceptionCode == CXX_EXCEPTION) + { + const cxx_exception_type *et = (void*)ep->rec->ExceptionInformation[2]; + const cxx_type_info *ti; + void **data, *obj; + char *base = RtlPcToFileHeader((void*)et, (void**)&base); + + ti = (const cxx_type_info*)(base + ((const cxx_type_info_table*)(base + et->type_info_table))->info[0]); + data = HeapAlloc(GetProcessHeap(), 0, ti->size); + + obj = (void*)ep->rec->ExceptionInformation[1]; + if (ti->flags & CLASS_IS_SIMPLE_TYPE) + { + memcpy(data, obj, ti->size); + if (ti->size == sizeof(void *)) *data = get_this_pointer(&ti->offsets, *data); + } + else if (ti->copy_ctor) + { + call_copy_ctor(base + ti->copy_ctor, data, get_this_pointer(&ti->offsets, obj), + ti->flags & CLASS_HAS_VIRTUAL_BASE_CLASS); + } + else + memcpy(data, get_this_pointer(&ti->offsets, obj), ti->size); + ep->rec->ExceptionInformation[1] = (ULONG_PTR)data; + } + return; +} +#endif #endif #if _MSVCP_VER >= 70 || defined(_MSVCIRT)
1
0
0
0
Paul Gofman : msvcp140: Import __ExceptionPtrRethrow implementation.
by Alexandre Julliard
12 Oct '22
12 Oct '22
Module: wine Branch: master Commit: 58c0d78485a3341df993f92d1d0f10acc60646de URL:
https://gitlab.winehq.org/wine/wine/-/commit/58c0d78485a3341df993f92d1d0f10…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Tue Oct 11 15:39:56 2022 -0500 msvcp140: Import __ExceptionPtrRethrow implementation. --- dlls/msvcp140/msvcp140.spec | 4 ++-- dlls/msvcp90/exception.c | 23 +++++++++++++++++++++++ 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/dlls/msvcp140/msvcp140.spec b/dlls/msvcp140/msvcp140.spec index 388dfbaf38c..09672daf681 100644 --- a/dlls/msvcp140/msvcp140.spec +++ b/dlls/msvcp140/msvcp140.spec @@ -1703,8 +1703,8 @@ @ cdecl -arch=win64 ?__ExceptionPtrCurrentException@@YAXPEAX@Z(ptr) msvcr120.?__ExceptionPtrCurrentException@@YAXPEAX@Z @ cdecl -arch=win32 ?__ExceptionPtrDestroy@@YAXPAX@Z(ptr) __ExceptionPtrDestroy @ cdecl -arch=win64 ?__ExceptionPtrDestroy@@YAXPEAX@Z(ptr) __ExceptionPtrDestroy -@ cdecl -arch=win32 ?__ExceptionPtrRethrow@@YAXPBX@Z(ptr) msvcr120.?__ExceptionPtrRethrow@@YAXPBX@Z -@ cdecl -arch=win64 ?__ExceptionPtrRethrow@@YAXPEBX@Z(ptr) msvcr120.?__ExceptionPtrRethrow@@YAXPEBX@Z +@ cdecl -arch=win32 ?__ExceptionPtrRethrow@@YAXPBX@Z(ptr) __ExceptionPtrRethrow +@ cdecl -arch=win64 ?__ExceptionPtrRethrow@@YAXPEBX@Z(ptr) __ExceptionPtrRethrow @ stub -arch=win32 ?__ExceptionPtrSwap@@YAXPAX0@Z @ stub -arch=win64 ?__ExceptionPtrSwap@@YAXPEAX0@Z @ cdecl -arch=win32 ?__ExceptionPtrToBool@@YA_NPBX@Z(ptr) msvcr120.?__ExceptionPtrToBool@@YA_NPBX@Z diff --git a/dlls/msvcp90/exception.c b/dlls/msvcp90/exception.c index fb605dedcae..62a15073320 100644 --- a/dlls/msvcp90/exception.c +++ b/dlls/msvcp90/exception.c @@ -1044,6 +1044,29 @@ void __cdecl __ExceptionPtrAssign(exception_ptr *ep, const exception_ptr *assign if (ep->ref) InterlockedIncrement(ep->ref); } + +/********************************************************************* + * ?__ExceptionPtrRethrow@@YAXPBX@Z + * ?__ExceptionPtrRethrow@@YAXPEBX@Z + */ +void __cdecl __ExceptionPtrRethrow(const exception_ptr *ep) +{ + TRACE("(%p)\n", ep); + + if (!ep->rec) + { + static const char *exception_msg = "bad exception"; + exception e; + + MSVCP_exception_ctor(&e, &exception_msg); + _CxxThrowException(&e, &exception_cxx_type); + return; + } + + RaiseException(ep->rec->ExceptionCode, ep->rec->ExceptionFlags & (~EH_UNWINDING), + ep->rec->NumberParameters, ep->rec->ExceptionInformation); +} + #endif #if _MSVCP_VER >= 70 || defined(_MSVCIRT)
1
0
0
0
Paul Gofman : msvcp140: Import __ExceptionPtrAssign implementation.
by Alexandre Julliard
12 Oct '22
12 Oct '22
Module: wine Branch: master Commit: 95b8a3a1c93e1fe1ad2913c22f98c4f9b9719bb8 URL:
https://gitlab.winehq.org/wine/wine/-/commit/95b8a3a1c93e1fe1ad2913c22f98c4…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Tue Oct 11 15:36:36 2022 -0500 msvcp140: Import __ExceptionPtrAssign implementation. --- dlls/msvcp140/msvcp140.spec | 4 ++-- dlls/msvcp90/exception.c | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/dlls/msvcp140/msvcp140.spec b/dlls/msvcp140/msvcp140.spec index 241dd4eed2c..388dfbaf38c 100644 --- a/dlls/msvcp140/msvcp140.spec +++ b/dlls/msvcp140/msvcp140.spec @@ -1689,8 +1689,8 @@ @ stub ?_Xregex_error@std@@YAXW4error_type@regex_constants@1@@Z @ cdecl -arch=win32 ?_Xruntime_error@std@@YAXPBD@Z(str) _Xruntime_error @ cdecl -arch=win64 ?_Xruntime_error@std@@YAXPEBD@Z(str) _Xruntime_error -@ cdecl -arch=win32 ?__ExceptionPtrAssign@@YAXPAXPBX@Z(ptr ptr) msvcr120.?__ExceptionPtrAssign@@YAXPAXPBX@Z -@ cdecl -arch=win64 ?__ExceptionPtrAssign@@YAXPEAXPEBX@Z(ptr ptr) msvcr120.?__ExceptionPtrAssign@@YAXPEAXPEBX@Z +@ cdecl -arch=win32 ?__ExceptionPtrAssign@@YAXPAXPBX@Z(ptr ptr) __ExceptionPtrAssign +@ cdecl -arch=win64 ?__ExceptionPtrAssign@@YAXPEAXPEBX@Z(ptr ptr) __ExceptionPtrAssign @ cdecl -arch=win32 ?__ExceptionPtrCompare@@YA_NPBX0@Z(ptr ptr) msvcr120.?__ExceptionPtrCompare@@YA_NPBX0@Z @ cdecl -arch=win64 ?__ExceptionPtrCompare@@YA_NPEBX0@Z(ptr ptr) msvcr120.?__ExceptionPtrCompare@@YA_NPEBX0@Z @ cdecl -arch=win32 ?__ExceptionPtrCopy@@YAXPAXPBX@Z(ptr ptr) __ExceptionPtrCopy diff --git a/dlls/msvcp90/exception.c b/dlls/msvcp90/exception.c index 89465d7578d..fb605dedcae 100644 --- a/dlls/msvcp90/exception.c +++ b/dlls/msvcp90/exception.c @@ -1028,6 +1028,22 @@ void __cdecl __ExceptionPtrCopy(exception_ptr *ep, const exception_ptr *copy) InterlockedIncrement(copy->ref); } +/********************************************************************* + * ?__ExceptionPtrAssign@@YAXPAXPBX@Z + * ?__ExceptionPtrAssign@@YAXPEAXPEBX@Z + */ +void __cdecl __ExceptionPtrAssign(exception_ptr *ep, const exception_ptr *assign) +{ + TRACE("(%p %p)\n", ep, assign); + + /* don't destroy object stored in ep */ + if (ep->ref) + InterlockedDecrement(ep->ref); + + *ep = *assign; + if (ep->ref) + InterlockedIncrement(ep->ref); +} #endif #if _MSVCP_VER >= 70 || defined(_MSVCIRT)
1
0
0
0
Paul Gofman : msvcp140: Import __ExceptionPtrCopy implementation.
by Alexandre Julliard
12 Oct '22
12 Oct '22
Module: wine Branch: master Commit: c590c6b78837e0c2f557376ebfb649a1a7084b54 URL:
https://gitlab.winehq.org/wine/wine/-/commit/c590c6b78837e0c2f557376ebfb649…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Tue Oct 11 15:33:19 2022 -0500 msvcp140: Import __ExceptionPtrCopy implementation. --- dlls/msvcp140/msvcp140.spec | 4 ++-- dlls/msvcp90/exception.c | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/dlls/msvcp140/msvcp140.spec b/dlls/msvcp140/msvcp140.spec index 232a2b959a2..241dd4eed2c 100644 --- a/dlls/msvcp140/msvcp140.spec +++ b/dlls/msvcp140/msvcp140.spec @@ -1693,8 +1693,8 @@ @ cdecl -arch=win64 ?__ExceptionPtrAssign@@YAXPEAXPEBX@Z(ptr ptr) msvcr120.?__ExceptionPtrAssign@@YAXPEAXPEBX@Z @ cdecl -arch=win32 ?__ExceptionPtrCompare@@YA_NPBX0@Z(ptr ptr) msvcr120.?__ExceptionPtrCompare@@YA_NPBX0@Z @ cdecl -arch=win64 ?__ExceptionPtrCompare@@YA_NPEBX0@Z(ptr ptr) msvcr120.?__ExceptionPtrCompare@@YA_NPEBX0@Z -@ cdecl -arch=win32 ?__ExceptionPtrCopy@@YAXPAXPBX@Z(ptr ptr) msvcr120.?__ExceptionPtrCopy@@YAXPAXPBX@Z -@ cdecl -arch=win64 ?__ExceptionPtrCopy@@YAXPEAXPEBX@Z(ptr ptr) msvcr120.?__ExceptionPtrCopy@@YAXPEAXPEBX@Z +@ cdecl -arch=win32 ?__ExceptionPtrCopy@@YAXPAXPBX@Z(ptr ptr) __ExceptionPtrCopy +@ cdecl -arch=win64 ?__ExceptionPtrCopy@@YAXPEAXPEBX@Z(ptr ptr) __ExceptionPtrCopy @ cdecl -arch=win32 ?__ExceptionPtrCopyException@@YAXPAXPBX1@Z(ptr ptr ptr) msvcr120.?__ExceptionPtrCopyException@@YAXPAXPBX1@Z @ cdecl -arch=win64 ?__ExceptionPtrCopyException@@YAXPEAXPEBX1@Z(ptr ptr ptr) msvcr120.?__ExceptionPtrCopyException@@YAXPEAXPEBX1@Z @ cdecl -arch=win32 ?__ExceptionPtrCreate@@YAXPAX@Z(ptr) __ExceptionPtrCreate diff --git a/dlls/msvcp90/exception.c b/dlls/msvcp90/exception.c index effe57063a1..89465d7578d 100644 --- a/dlls/msvcp90/exception.c +++ b/dlls/msvcp90/exception.c @@ -1013,6 +1013,21 @@ void __cdecl __ExceptionPtrDestroy(exception_ptr *ep) HeapFree(GetProcessHeap(), 0, ep->ref); } } + +/********************************************************************* + * ?__ExceptionPtrCopy@@YAXPAXPBX@Z + * ?__ExceptionPtrCopy@@YAXPEAXPEBX@Z + */ +void __cdecl __ExceptionPtrCopy(exception_ptr *ep, const exception_ptr *copy) +{ + TRACE("(%p %p)\n", ep, copy); + + /* don't destroy object stored in ep */ + *ep = *copy; + if (ep->ref) + InterlockedIncrement(copy->ref); +} + #endif #if _MSVCP_VER >= 70 || defined(_MSVCIRT)
1
0
0
0
Francois Gouget : imm32/tests: Mark tests failing randomly on Windows as flaky.
by Alexandre Julliard
12 Oct '22
12 Oct '22
Module: wine Branch: master Commit: 685a917f86033efd112d9b1349e6ea6f866df436 URL:
https://gitlab.winehq.org/wine/wine/-/commit/685a917f86033efd112d9b1349e6ea…
Author: Francois Gouget <fgouget(a)codeweavers.com> Date: Sat Oct 1 09:07:05 2022 +0200 imm32/tests: Mark tests failing randomly on Windows as flaky. Wine-Bug:
https://bugs.winehq.org//show_bug.cgi?id=53523
--- dlls/imm32/tests/imm32.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/imm32/tests/imm32.c b/dlls/imm32/tests/imm32.c index 17369ca9102..1ed8ba1f000 100644 --- a/dlls/imm32/tests/imm32.c +++ b/dlls/imm32/tests/imm32.c @@ -1348,6 +1348,7 @@ static DWORD WINAPI test_default_ime_window_cb(void *arg) broken(!testcase->top_level_window /* Vista */) , "Expected IME window existence\n"); DestroyWindow(hwnd1); + flaky ok(!IsWindow(ime_wnd), "Expected no IME windows\n"); return 1; }
1
0
0
0
Alistair Leslie-Hughes : sapi: Implement ISpRegDataKey GetStringValue.
by Alexandre Julliard
12 Oct '22
12 Oct '22
Module: wine Branch: master Commit: e58bd59277dbe36c2f0344f6406113a4ae47265e URL:
https://gitlab.winehq.org/wine/wine/-/commit/e58bd59277dbe36c2f0344f6406113…
Author: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Date: Wed Sep 22 19:01:44 2021 +1000 sapi: Implement ISpRegDataKey GetStringValue. --- dlls/sapi/tests/token.c | 10 ++++++++++ dlls/sapi/token.c | 29 +++++++++++++++++++++++++++-- 2 files changed, 37 insertions(+), 2 deletions(-) diff --git a/dlls/sapi/tests/token.c b/dlls/sapi/tests/token.c index 63f5c651a50..7778f4e61db 100644 --- a/dlls/sapi/tests/token.c +++ b/dlls/sapi/tests/token.c @@ -33,6 +33,7 @@ static void test_data_key(void) HRESULT hr; HKEY key; LONG res; + WCHAR *value; hr = CoCreateInstance( &CLSID_SpDataKey, NULL, CLSCTX_INPROC_SERVER, &IID_ISpRegDataKey, (void **)&data_key ); @@ -45,11 +46,20 @@ static void test_data_key(void) hr = ISpRegDataKey_CreateKey( data_key, L"Testing", &sub ); ok( hr == E_HANDLE, "got %08lx\n", hr ); + hr = ISpRegDataKey_GetStringValue( data_key, L"Voice", &value ); + ok( hr == E_HANDLE, "got %08lx\n", hr ); + hr = ISpRegDataKey_SetKey( data_key, key, FALSE ); ok( hr == S_OK, "got %08lx\n", hr ); hr = ISpRegDataKey_SetKey( data_key, key, FALSE ); ok( hr == SPERR_ALREADY_INITIALIZED, "got %08lx\n", hr ); + hr = ISpRegDataKey_GetStringValue( data_key, L"Voice", &value ); + ok( hr == SPERR_NOT_FOUND, "got %08lx\n", hr ); + + hr = ISpRegDataKey_GetStringValue( data_key, L"", &value ); + ok( hr == SPERR_NOT_FOUND, "got %08lx\n", hr ); + hr = ISpRegDataKey_CreateKey( data_key, L"Testing", &sub ); ok( hr == S_OK, "got %08lx\n", hr ); ISpDataKey_Release(sub); diff --git a/dlls/sapi/token.c b/dlls/sapi/token.c index 133d27a2a66..b5cfc45e5a3 100644 --- a/dlls/sapi/token.c +++ b/dlls/sapi/token.c @@ -117,8 +117,33 @@ static HRESULT WINAPI data_key_SetStringValue( ISpRegDataKey *iface, static HRESULT WINAPI data_key_GetStringValue( ISpRegDataKey *iface, LPCWSTR name, LPWSTR *value ) { - FIXME( "stub\n" ); - return E_NOTIMPL; + struct data_key *This = impl_from_ISpRegDataKey( iface ); + DWORD ret, size; + WCHAR *content; + + TRACE( "%p, %s, %p\n", This, debugstr_w(name), value); + + if (!This->key) + return E_HANDLE; + + size = 0; + ret = RegGetValueW( This->key, NULL, name, RRF_RT_REG_SZ, NULL, NULL, &size ); + if (ret != ERROR_SUCCESS) + return SPERR_NOT_FOUND; + + content = CoTaskMemAlloc(size); + if (!content) + return E_OUTOFMEMORY; + + ret = RegGetValueW( This->key, NULL, name, RRF_RT_REG_SZ, NULL, content, &size ); + if (ret != ERROR_SUCCESS) + { + CoTaskMemFree(content); + return HRESULT_FROM_WIN32(ret); + } + + *value = content; + return S_OK; } static HRESULT WINAPI data_key_SetDWORD( ISpRegDataKey *iface,
1
0
0
0
Alistair Leslie-Hughes : sapi: Implement ISpRegDataKey CreateKey.
by Alexandre Julliard
12 Oct '22
12 Oct '22
Module: wine Branch: master Commit: 3f0ee3ea2fdfbb57d84d91554a4338b2132b36a4 URL:
https://gitlab.winehq.org/wine/wine/-/commit/3f0ee3ea2fdfbb57d84d91554a4338…
Author: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Date: Wed Sep 22 19:01:44 2021 +1000 sapi: Implement ISpRegDataKey CreateKey. --- dlls/sapi/tests/token.c | 8 ++++++++ dlls/sapi/token.c | 24 ++++++++++++++++++++++-- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/dlls/sapi/tests/token.c b/dlls/sapi/tests/token.c index a65669b585a..63f5c651a50 100644 --- a/dlls/sapi/tests/token.c +++ b/dlls/sapi/tests/token.c @@ -29,6 +29,7 @@ static void test_data_key(void) { ISpRegDataKey *data_key; + ISpDataKey *sub; HRESULT hr; HKEY key; LONG res; @@ -41,11 +42,18 @@ static void test_data_key(void) NULL, &key, NULL ); ok( res == ERROR_SUCCESS, "got %ld\n", res ); + hr = ISpRegDataKey_CreateKey( data_key, L"Testing", &sub ); + ok( hr == E_HANDLE, "got %08lx\n", hr ); + hr = ISpRegDataKey_SetKey( data_key, key, FALSE ); ok( hr == S_OK, "got %08lx\n", hr ); hr = ISpRegDataKey_SetKey( data_key, key, FALSE ); ok( hr == SPERR_ALREADY_INITIALIZED, "got %08lx\n", hr ); + hr = ISpRegDataKey_CreateKey( data_key, L"Testing", &sub ); + ok( hr == S_OK, "got %08lx\n", hr ); + ISpDataKey_Release(sub); + ISpRegDataKey_Release( data_key ); } diff --git a/dlls/sapi/token.c b/dlls/sapi/token.c index 6993ffdbac1..133d27a2a66 100644 --- a/dlls/sapi/token.c +++ b/dlls/sapi/token.c @@ -145,8 +145,28 @@ static HRESULT WINAPI data_key_OpenKey( ISpRegDataKey *iface, static HRESULT WINAPI data_key_CreateKey( ISpRegDataKey *iface, LPCWSTR name, ISpDataKey **sub_key ) { - FIXME( "stub\n" ); - return E_NOTIMPL; + struct data_key *This = impl_from_ISpRegDataKey( iface ); + ISpRegDataKey *spregkey; + HRESULT hr; + HKEY key; + LONG res; + + TRACE( "%p, %s, %p\n", This, debugstr_w(name), sub_key ); + + res = RegCreateKeyExW( This->key, name, 0, NULL, 0, KEY_ALL_ACCESS, NULL, &key, NULL ); + if (res != ERROR_SUCCESS) + return HRESULT_FROM_WIN32(res); + + hr = data_key_create(NULL, &IID_ISpRegDataKey, (void**)&spregkey); + if (SUCCEEDED(hr)) + { + hr = ISpRegDataKey_SetKey(spregkey, key, FALSE); + if (SUCCEEDED(hr)) + hr = ISpRegDataKey_QueryInterface(spregkey, &IID_ISpDataKey, (void**)sub_key); + ISpRegDataKey_Release(spregkey); + } + + return hr; } static HRESULT WINAPI data_key_DeleteKey( ISpRegDataKey *iface, LPCWSTR name )
1
0
0
0
Hans Leidekker : schannel/tests: Get rid of workarounds for old Windows versions.
by Alexandre Julliard
12 Oct '22
12 Oct '22
Module: wine Branch: master Commit: 7cd6a6d960fb7f60f5ac493932325bebcb9c68aa URL:
https://gitlab.winehq.org/wine/wine/-/commit/7cd6a6d960fb7f60f5ac493932325b…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Fri Oct 7 17:21:49 2022 +0200 schannel/tests: Get rid of workarounds for old Windows versions. --- dlls/schannel/tests/main.c | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/dlls/schannel/tests/main.c b/dlls/schannel/tests/main.c index 6eeecc7c2c2..b3875636b0c 100644 --- a/dlls/schannel/tests/main.c +++ b/dlls/schannel/tests/main.c @@ -78,26 +78,20 @@ static void testInitialize(void) /* SpLsaModeInitialize does not care about the LSA version. */ status = pSpLsaModeInitialize(0, &Version, &pTables2, &cTables); ok(status == STATUS_SUCCESS, "status: 0x%lx\n", status); - ok(cTables == 2 || - broken(cTables == 1), /* Win2k */ - "cTables: %ld\n", cTables); + ok(cTables == 2, "cTables: %ld\n", cTables); ok(pTables2 != NULL,"pTables: %p\n", pTables2); /* We can call it as many times we want. */ status = pSpLsaModeInitialize(0x10000, &Version, &pTables, &cTables); ok(status == STATUS_SUCCESS, "status: 0x%lx\n", status); - ok(cTables == 2 || - broken(cTables == 1), /* Win2k */ - "cTables: %ld\n", cTables); + ok(cTables == 2, "cTables: %ld\n", cTables); ok(pTables != NULL, "pTables: %p\n", pTables); /* It will always return the same pointer. */ ok(pTables == pTables2, "pTables: %p, pTables2: %p\n", pTables, pTables2); status = pSpLsaModeInitialize(0x23456, &Version, &pTables, &cTables); ok(status == STATUS_SUCCESS, "status: 0x%lx\n", status); - ok(cTables == 2 || - broken(cTables == 1), /* Win2k */ - "cTables: %ld\n", cTables); + ok(cTables == 2, "cTables: %ld\n", cTables); ok(pTables != NULL, "pTables: %p\n", pTables); ok(pTables == pTables2, "pTables: %p, pTables2: %p\n", pTables, pTables2); @@ -124,9 +118,7 @@ static void testInitialize(void) ok(status == STATUS_SUCCESS, "status: 0x%lx\n", status); ok(Version == SECPKG_INTERFACE_VERSION || Version == SECPKG_INTERFACE_VERSION_2 /* win11 */, "Version: 0x%lx\n", Version); - ok(cUserTables == 2 || - broken(cUserTables == 4), /* Win2k */ - "cUserTables: %ld\n", cUserTables); + ok(cUserTables == 2, "cUserTables: %ld\n", cUserTables); ok(pUserTables != NULL, "pUserTables: %p\n", pUserTables); /* Initializing user again */ @@ -250,9 +242,7 @@ static void testGetInfo(void) return; } status = pTables->GetInfo(&PackageInfo); - ok(SUCCEEDED(status) || - status == SEC_E_UNSUPPORTED_FUNCTION, /* win2k3 */ - "status: 0x%lx\n", status); + ok(SUCCEEDED(status), "status: 0x%lx\n", status); if (SUCCEEDED(status)) {
1
0
0
0
Hans Leidekker : schannel/tests: Fix test failure on Windows 11.
by Alexandre Julliard
12 Oct '22
12 Oct '22
Module: wine Branch: master Commit: 08d0bc64b3eee7feb083cab3e8e111509a7ba2e4 URL:
https://gitlab.winehq.org/wine/wine/-/commit/08d0bc64b3eee7feb083cab3e8e111…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Fri Sep 30 16:44:18 2022 +0200 schannel/tests: Fix test failure on Windows 11. --- dlls/schannel/tests/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dlls/schannel/tests/main.c b/dlls/schannel/tests/main.c index f876d934f3d..6eeecc7c2c2 100644 --- a/dlls/schannel/tests/main.c +++ b/dlls/schannel/tests/main.c @@ -122,7 +122,8 @@ static void testInitialize(void) status = pSpUserModeInitialize(SECPKG_INTERFACE_VERSION, &Version, &pUserTables, &cUserTables); ok(status == STATUS_SUCCESS, "status: 0x%lx\n", status); - ok(Version == SECPKG_INTERFACE_VERSION, "Version: 0x%lx\n", Version); + ok(Version == SECPKG_INTERFACE_VERSION || Version == SECPKG_INTERFACE_VERSION_2 /* win11 */, + "Version: 0x%lx\n", Version); ok(cUserTables == 2 || broken(cUserTables == 4), /* Win2k */ "cUserTables: %ld\n", cUserTables);
1
0
0
0
Rémi Bernon : winemac.drv: Resize desktop window on WM_DISPLAYCHANGE message.
by Alexandre Julliard
12 Oct '22
12 Oct '22
Module: wine Branch: master Commit: 67d3735594003514b32e557bdf25f9ebe021713b URL:
https://gitlab.winehq.org/wine/wine/-/commit/67d3735594003514b32e557bdf25f9…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Tue Sep 27 16:32:21 2022 +0200 winemac.drv: Resize desktop window on WM_DISPLAYCHANGE message. --- dlls/winemac.drv/display.c | 5 +---- dlls/winemac.drv/macdrv.h | 2 +- dlls/winemac.drv/window.c | 44 +++++++++++++++++++++++--------------------- 3 files changed, 25 insertions(+), 26 deletions(-) diff --git a/dlls/winemac.drv/display.c b/dlls/winemac.drv/display.c index 977949fc47f..e8d26dfd241 100644 --- a/dlls/winemac.drv/display.c +++ b/dlls/winemac.drv/display.c @@ -831,10 +831,7 @@ LONG macdrv_ChangeDisplaySettings(LPDEVMODEW displays, HWND hwnd, DWORD flags, L ret = DISP_CHANGE_BADMODE; } else if (macdrv_set_display_mode(&macdrv_displays[0], best_display_mode)) - { macdrv_init_display_devices(TRUE); - send_message(NtUserGetDesktopWindow(), WM_MACDRV_UPDATE_DESKTOP_RECT, 0, 0); - } else { WARN("Failed to set display mode\n"); @@ -1172,7 +1169,7 @@ void macdrv_displays_changed(const macdrv_event *event) { macdrv_init_display_devices(TRUE); init_registry_display_settings(); - send_message(hwnd, WM_MACDRV_UPDATE_DESKTOP_RECT, 0, 0); + macdrv_resize_desktop(); } } diff --git a/dlls/winemac.drv/macdrv.h b/dlls/winemac.drv/macdrv.h index 683fd1851a3..ea51cf0f702 100644 --- a/dlls/winemac.drv/macdrv.h +++ b/dlls/winemac.drv/macdrv.h @@ -92,7 +92,6 @@ extern BOOL CDECL macdrv_SetDeviceGammaRamp(PHYSDEV dev, LPVOID ramp) DECLSPEC_H enum macdrv_window_messages { WM_MACDRV_SET_WIN_REGION = 0x80001000, - WM_MACDRV_UPDATE_DESKTOP_RECT, WM_MACDRV_RESET_DEVICE_METRICS, WM_MACDRV_DISPLAYCHANGE, WM_MACDRV_ACTIVATE_ON_FOLLOWING_FOCUS, @@ -268,6 +267,7 @@ extern void macdrv_status_item_mouse_move(const macdrv_event *event) DECLSPEC_HI extern void check_retina_status(void) DECLSPEC_HIDDEN; extern void macdrv_init_display_devices(BOOL force) DECLSPEC_HIDDEN; +extern void macdrv_resize_desktop(void) DECLSPEC_HIDDEN; extern void init_user_driver(void) DECLSPEC_HIDDEN; /* unixlib interface */ diff --git a/dlls/winemac.drv/window.c b/dlls/winemac.drv/window.c index 7a0f6df6449..37696f02d25 100644 --- a/dlls/winemac.drv/window.c +++ b/dlls/winemac.drv/window.c @@ -1570,6 +1570,26 @@ BOOL macdrv_CreateDesktopWindow(HWND hwnd) return TRUE; } +void macdrv_resize_desktop(void) +{ + HWND hwnd = NtUserGetDesktopWindow(); + CGRect new_desktop_rect; + RECT current_desktop_rect; + + macdrv_reset_device_metrics(); + new_desktop_rect = macdrv_get_desktop_rect(); + if (!NtUserGetWindowRect(hwnd, ¤t_desktop_rect) || + !CGRectEqualToRect(cgrect_from_rect(current_desktop_rect), new_desktop_rect)) + { + send_message_timeout(HWND_BROADCAST, WM_MACDRV_RESET_DEVICE_METRICS, 0, 0, + SMTO_ABORTIFHUNG, 2000, NULL); + NtUserSetWindowPos(hwnd, 0, CGRectGetMinX(new_desktop_rect), CGRectGetMinY(new_desktop_rect), + CGRectGetWidth(new_desktop_rect), CGRectGetHeight(new_desktop_rect), + SWP_NOZORDER | SWP_NOACTIVATE | SWP_DEFERERASE); + send_message_timeout(HWND_BROADCAST, WM_MACDRV_DISPLAYCHANGE, 0, 0, + SMTO_ABORTIFHUNG, 2000, NULL); + } +} #define WM_WINE_NOTIFY_ACTIVITY WM_USER @@ -1591,6 +1611,9 @@ LRESULT macdrv_DesktopWindowProc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp) #pragma clang diagnostic pop break; } + case WM_DISPLAYCHANGE: + macdrv_resize_desktop(); + break; } return NtUserMessageCall(hwnd, msg, wp, lp, 0, NtUserDefWindowProc, FALSE); } @@ -1987,27 +2010,6 @@ LRESULT macdrv_WindowMessage(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp) release_win_data(data); } return 0; - case WM_MACDRV_UPDATE_DESKTOP_RECT: - if (hwnd == NtUserGetDesktopWindow()) - { - CGRect new_desktop_rect; - RECT current_desktop_rect; - - macdrv_reset_device_metrics(); - new_desktop_rect = macdrv_get_desktop_rect(); - if (!NtUserGetWindowRect(hwnd, ¤t_desktop_rect) || - !CGRectEqualToRect(cgrect_from_rect(current_desktop_rect), new_desktop_rect)) - { - send_message_timeout(HWND_BROADCAST, WM_MACDRV_RESET_DEVICE_METRICS, 0, 0, - SMTO_ABORTIFHUNG, 2000, NULL); - NtUserSetWindowPos(hwnd, 0, CGRectGetMinX(new_desktop_rect), CGRectGetMinY(new_desktop_rect), - CGRectGetWidth(new_desktop_rect), CGRectGetHeight(new_desktop_rect), - SWP_NOZORDER | SWP_NOACTIVATE | SWP_DEFERERASE); - send_message_timeout(HWND_BROADCAST, WM_MACDRV_DISPLAYCHANGE, 0, 0, - SMTO_ABORTIFHUNG, 2000, NULL); - } - } - return 0; case WM_MACDRV_RESET_DEVICE_METRICS: macdrv_reset_device_metrics(); return 0;
1
0
0
0
Rémi Bernon : winex11.drv: Resize desktop window on WM_DISPLAYCHANGE message.
by Alexandre Julliard
12 Oct '22
12 Oct '22
Module: wine Branch: master Commit: 63eeb236ed342ba80bf62578bb29085173b8c37f URL:
https://gitlab.winehq.org/wine/wine/-/commit/63eeb236ed342ba80bf62578bb2908…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Tue Sep 27 17:18:04 2022 +0200 winex11.drv: Resize desktop window on WM_DISPLAYCHANGE message. --- dlls/winex11.drv/desktop.c | 6 ------ dlls/winex11.drv/display.c | 9 +-------- dlls/winex11.drv/window.c | 6 +++--- dlls/winex11.drv/x11drv.h | 2 -- dlls/winex11.drv/xrandr.c | 3 ++- 5 files changed, 6 insertions(+), 20 deletions(-) diff --git a/dlls/winex11.drv/desktop.c b/dlls/winex11.drv/desktop.c index 721e805f820..c6a08291f6a 100644 --- a/dlls/winex11.drv/desktop.c +++ b/dlls/winex11.drv/desktop.c @@ -467,12 +467,6 @@ void X11DRV_resize_desktop(void) width = primary_rect.right; height = primary_rect.bottom; - if (NtUserGetWindowThread( hwnd, NULL ) != GetCurrentThreadId()) - { - send_message( hwnd, WM_X11DRV_RESIZE_DESKTOP, 0, 0 ); - return; - } - TRACE( "desktop %p change to (%dx%d)\n", hwnd, width, height ); update_desktop_fullscreen( width, height ); NtUserSetWindowPos( hwnd, 0, virtual_rect.left, virtual_rect.top, diff --git a/dlls/winex11.drv/display.c b/dlls/winex11.drv/display.c index 87f7adb76d2..572b81aa491 100644 --- a/dlls/winex11.drv/display.c +++ b/dlls/winex11.drv/display.c @@ -419,7 +419,7 @@ LONG X11DRV_ChangeDisplaySettings( LPDEVMODEW displays, HWND hwnd, DWORD flags, if (ret == DISP_CHANGE_SUCCESSFUL) ret = apply_display_settings( displays, ids, TRUE ); if (ret == DISP_CHANGE_SUCCESSFUL) - X11DRV_DisplayDevices_Update(); + X11DRV_DisplayDevices_Init(TRUE); done: free( ids ); @@ -558,13 +558,6 @@ void X11DRV_DisplayDevices_RegisterEventHandlers(void) handler->register_event_handlers(); } -void X11DRV_DisplayDevices_Update(void) -{ - X11DRV_DisplayDevices_Init(TRUE); - - X11DRV_resize_desktop(); -} - static BOOL force_display_devices_refresh; BOOL X11DRV_UpdateDisplayDevices( const struct gdi_device_manager *device_manager, BOOL force, void *param ) diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 7f4a92abe5f..70a29d24fb1 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -1893,6 +1893,9 @@ LRESULT X11DRV_DesktopWindowProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp ) case WM_WINE_ADD_TAB: send_notify_message( (HWND)wp, WM_X11DRV_ADD_TAB, 0, 0 ); break; + case WM_DISPLAYCHANGE: + X11DRV_resize_desktop(); + break; } return NtUserMessageCall( hwnd, msg, wp, lp, 0, NtUserDefWindowProc, FALSE ); } @@ -2993,9 +2996,6 @@ LRESULT X11DRV_WindowMessage( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp ) release_win_data( data ); } return 0; - case WM_X11DRV_RESIZE_DESKTOP: - X11DRV_resize_desktop(); - return 0; case WM_X11DRV_DESKTOP_RESIZED: if ((data = get_win_data( hwnd ))) { diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index fc646771acd..f8f8fe3d4d1 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -572,7 +572,6 @@ enum x11drv_window_messages { WM_X11DRV_UPDATE_CLIPBOARD = 0x80001000, WM_X11DRV_SET_WIN_REGION, - WM_X11DRV_RESIZE_DESKTOP, WM_X11DRV_DESKTOP_RESIZED, WM_X11DRV_SET_CURSOR, WM_X11DRV_CLIP_CURSOR_NOTIFY, @@ -805,7 +804,6 @@ extern BOOL get_host_primary_gpu(struct gdi_gpu *gpu) DECLSPEC_HIDDEN; extern void X11DRV_DisplayDevices_SetHandler(const struct x11drv_display_device_handler *handler) DECLSPEC_HIDDEN; extern void X11DRV_DisplayDevices_Init(BOOL force) DECLSPEC_HIDDEN; extern void X11DRV_DisplayDevices_RegisterEventHandlers(void) DECLSPEC_HIDDEN; -extern void X11DRV_DisplayDevices_Update(void) DECLSPEC_HIDDEN; /* Display device handler used in virtual desktop mode */ extern struct x11drv_display_device_handler desktop_handler DECLSPEC_HIDDEN; diff --git a/dlls/winex11.drv/xrandr.c b/dlls/winex11.drv/xrandr.c index a0ac2cb5ec1..c7f922b1aae 100644 --- a/dlls/winex11.drv/xrandr.c +++ b/dlls/winex11.drv/xrandr.c @@ -1198,8 +1198,9 @@ static BOOL xrandr14_device_change_handler( HWND hwnd, XEvent *event ) xrandr14_invalidate_current_mode_cache(); if (hwnd == NtUserGetDesktopWindow() && NtUserGetWindowThread( hwnd, NULL ) == GetCurrentThreadId()) { - X11DRV_DisplayDevices_Update(); + X11DRV_DisplayDevices_Init( TRUE ); init_registry_display_settings(); + X11DRV_resize_desktop(); } return FALSE; }
1
0
0
0
Rémi Bernon : win32u: Send WM_DISPLAYCHANGE message to the desktop window.
by Alexandre Julliard
12 Oct '22
12 Oct '22
Module: wine Branch: master Commit: ba143493d1c15ac6e82683c887e173d77d36600b URL:
https://gitlab.winehq.org/wine/wine/-/commit/ba143493d1c15ac6e82683c887e173…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Tue Sep 27 17:18:04 2022 +0200 win32u: Send WM_DISPLAYCHANGE message to the desktop window. And pass it down to the drivers DesktopWindowProc entry. --- dlls/user32/desktop.c | 1 + dlls/win32u/defwnd.c | 3 ++- dlls/win32u/sysparams.c | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/dlls/user32/desktop.c b/dlls/user32/desktop.c index 377c21d4f48..b0384b6d8c2 100644 --- a/dlls/user32/desktop.c +++ b/dlls/user32/desktop.c @@ -83,6 +83,7 @@ LRESULT WINAPI DesktopWndProc( HWND hwnd, UINT message, WPARAM wParam, LPARAM lP case WM_NCCREATE: case WM_NCCALCSIZE: case WM_PARENTNOTIFY: + case WM_DISPLAYCHANGE: return NtUserMessageCall( hwnd, message, wParam, lParam, 0, NtUserDesktopWindowProc, FALSE ); default: diff --git a/dlls/win32u/defwnd.c b/dlls/win32u/defwnd.c index a5644f594ad..e26e68442ab 100644 --- a/dlls/win32u/defwnd.c +++ b/dlls/win32u/defwnd.c @@ -2953,7 +2953,8 @@ LRESULT desktop_window_proc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam ) } case WM_NCCALCSIZE: return 0; - + case WM_DISPLAYCHANGE: + return user_driver->pDesktopWindowProc( hwnd, msg, wparam, lparam ); default: if (msg >= WM_USER && hwnd == get_desktop_window()) return user_driver->pDesktopWindowProc( hwnd, msg, wparam, lparam ); diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index 494bb94c7f1..1c81dda9dd3 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -2487,6 +2487,8 @@ static LONG apply_display_settings( const WCHAR *devname, const DEVMODEW *devmod user_driver->pGetCurrentDisplaySettings( adapter->dev.device_name, ¤t_mode ); adapter_release( adapter ); + send_message( NtUserGetDesktopWindow(), WM_DISPLAYCHANGE, current_mode.dmBitsPerPel, + MAKELPARAM( current_mode.dmPelsWidth, current_mode.dmPelsHeight ) ); send_message_timeout( HWND_BROADCAST, WM_DISPLAYCHANGE, current_mode.dmBitsPerPel, MAKELPARAM( current_mode.dmPelsWidth, current_mode.dmPelsHeight ), SMTO_ABORTIFHUNG, 2000, FALSE );
1
0
0
0
Rémi Bernon : winex11.drv: Send WM_X11DRV_CLIP_CURSOR_REQUEST message from the deskop.
by Alexandre Julliard
12 Oct '22
12 Oct '22
Module: wine Branch: master Commit: c70b34e3239359fd48f4ddd329f7e8e3d881a9d3 URL:
https://gitlab.winehq.org/wine/wine/-/commit/c70b34e3239359fd48f4ddd329f7e8…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Wed Sep 28 12:01:00 2022 +0200 winex11.drv: Send WM_X11DRV_CLIP_CURSOR_REQUEST message from the deskop. Using send_notify_message directly, which calls clip_fullscreen_window synchronously if the target thread is the same. --- dlls/winex11.drv/desktop.c | 3 +++ dlls/winex11.drv/display.c | 11 ----------- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/dlls/winex11.drv/desktop.c b/dlls/winex11.drv/desktop.c index b912c519947..721e805f820 100644 --- a/dlls/winex11.drv/desktop.c +++ b/dlls/winex11.drv/desktop.c @@ -482,5 +482,8 @@ void X11DRV_resize_desktop(void) send_message_timeout( HWND_BROADCAST, WM_X11DRV_DESKTOP_RESIZED, old_virtual_rect.left, old_virtual_rect.top, SMTO_ABORTIFHUNG, 2000, FALSE ); + /* forward clip_fullscreen_window request to the foreground window */ + send_notify_message( NtUserGetForegroundWindow(), WM_X11DRV_CLIP_CURSOR_REQUEST, TRUE, TRUE ); + old_virtual_rect = virtual_rect; } diff --git a/dlls/winex11.drv/display.c b/dlls/winex11.drv/display.c index b552c52cb56..87f7adb76d2 100644 --- a/dlls/winex11.drv/display.c +++ b/dlls/winex11.drv/display.c @@ -560,20 +560,9 @@ void X11DRV_DisplayDevices_RegisterEventHandlers(void) void X11DRV_DisplayDevices_Update(void) { - DWORD tid, pid; - HWND foreground; - X11DRV_DisplayDevices_Init(TRUE); X11DRV_resize_desktop(); - - /* forward clip_fullscreen_window request to the foreground window */ - if ((foreground = NtUserGetForegroundWindow()) && - (tid = NtUserGetWindowThread( foreground, &pid )) && pid == GetCurrentProcessId()) - { - if (tid == GetCurrentThreadId()) clip_fullscreen_window( foreground, TRUE ); - else send_notify_message( foreground, WM_X11DRV_CLIP_CURSOR_REQUEST, TRUE, TRUE ); - } } static BOOL force_display_devices_refresh;
1
0
0
0
Rémi Bernon : winex11.drv: Sync window positions in a WM_X11DRV_DESKTOP_RESIZED message.
by Alexandre Julliard
12 Oct '22
12 Oct '22
Module: wine Branch: master Commit: bc09f0812cc4d751eca286baba0709cef1ff9a2b URL:
https://gitlab.winehq.org/wine/wine/-/commit/bc09f0812cc4d751eca286baba0709…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Tue Sep 27 17:13:00 2022 +0200 winex11.drv: Sync window positions in a WM_X11DRV_DESKTOP_RESIZED message. After desktop is resized, instead of doing it only for the current process windows. --- dlls/winex11.drv/desktop.c | 23 ++++++++++++++--------- dlls/winex11.drv/display.c | 34 ---------------------------------- dlls/winex11.drv/window.c | 23 +++++++++++++++++++++++ dlls/winex11.drv/x11drv.h | 1 + 4 files changed, 38 insertions(+), 43 deletions(-) diff --git a/dlls/winex11.drv/desktop.c b/dlls/winex11.drv/desktop.c index 3da8f92978d..b912c519947 100644 --- a/dlls/winex11.drv/desktop.c +++ b/dlls/winex11.drv/desktop.c @@ -456,6 +456,8 @@ static void update_desktop_fullscreen( unsigned int width, unsigned int height) */ void X11DRV_resize_desktop(void) { + static RECT old_virtual_rect; + RECT primary_rect, virtual_rect; HWND hwnd = NtUserGetDesktopWindow(); INT width, height; @@ -468,14 +470,17 @@ void X11DRV_resize_desktop(void) if (NtUserGetWindowThread( hwnd, NULL ) != GetCurrentThreadId()) { send_message( hwnd, WM_X11DRV_RESIZE_DESKTOP, 0, 0 ); + return; } - else - { - TRACE( "desktop %p change to (%dx%d)\n", hwnd, width, height ); - update_desktop_fullscreen( width, height ); - NtUserSetWindowPos( hwnd, 0, virtual_rect.left, virtual_rect.top, - virtual_rect.right - virtual_rect.left, virtual_rect.bottom - virtual_rect.top, - SWP_NOZORDER | SWP_NOACTIVATE | SWP_DEFERERASE ); - ungrab_clipping_window(); - } + + TRACE( "desktop %p change to (%dx%d)\n", hwnd, width, height ); + update_desktop_fullscreen( width, height ); + NtUserSetWindowPos( hwnd, 0, virtual_rect.left, virtual_rect.top, + virtual_rect.right - virtual_rect.left, virtual_rect.bottom - virtual_rect.top, + SWP_NOZORDER | SWP_NOACTIVATE | SWP_DEFERERASE ); + ungrab_clipping_window(); + send_message_timeout( HWND_BROADCAST, WM_X11DRV_DESKTOP_RESIZED, old_virtual_rect.left, + old_virtual_rect.top, SMTO_ABORTIFHUNG, 2000, FALSE ); + + old_virtual_rect = virtual_rect; } diff --git a/dlls/winex11.drv/display.c b/dlls/winex11.drv/display.c index 76defa7f0e8..b552c52cb56 100644 --- a/dlls/winex11.drv/display.c +++ b/dlls/winex11.drv/display.c @@ -560,47 +560,13 @@ void X11DRV_DisplayDevices_RegisterEventHandlers(void) void X11DRV_DisplayDevices_Update(void) { - RECT old_virtual_rect, new_virtual_rect; DWORD tid, pid; HWND foreground; - UINT mask = 0, i; - HWND *list; - old_virtual_rect = NtUserGetVirtualScreenRect(); X11DRV_DisplayDevices_Init(TRUE); - new_virtual_rect = NtUserGetVirtualScreenRect(); - - /* Calculate XReconfigureWMWindow() mask */ - if (old_virtual_rect.left != new_virtual_rect.left) - mask |= CWX; - if (old_virtual_rect.top != new_virtual_rect.top) - mask |= CWY; X11DRV_resize_desktop(); - list = build_hwnd_list(); - for (i = 0; list && list[i] != HWND_BOTTOM; i++) - { - struct x11drv_win_data *data; - - if (!(data = get_win_data( list[i] ))) continue; - - /* update the full screen state */ - update_net_wm_states(data); - - if (mask && data->whole_window) - { - POINT pos = virtual_screen_to_root(data->whole_rect.left, data->whole_rect.top); - XWindowChanges changes; - changes.x = pos.x; - changes.y = pos.y; - XReconfigureWMWindow(data->display, data->whole_window, data->vis.screen, mask, &changes); - } - release_win_data(data); - } - - free( list ); - /* forward clip_fullscreen_window request to the foreground window */ if ((foreground = NtUserGetForegroundWindow()) && (tid = NtUserGetWindowThread( foreground, &pid )) && pid == GetCurrentProcessId()) diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index c0c6e779772..7f4a92abe5f 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -2996,6 +2996,29 @@ LRESULT X11DRV_WindowMessage( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp ) case WM_X11DRV_RESIZE_DESKTOP: X11DRV_resize_desktop(); return 0; + case WM_X11DRV_DESKTOP_RESIZED: + if ((data = get_win_data( hwnd ))) + { + /* update the full screen state */ + update_net_wm_states( data ); + + if (data->whole_window) + { + /* sync window position with the new virtual screen rect */ + POINT old_pos = {.x = data->whole_rect.left - wp, .y = data->whole_rect.top - lp}; + POINT pos = virtual_screen_to_root( data->whole_rect.left, data->whole_rect.top ); + XWindowChanges changes = {.x = pos.x, .y = pos.y}; + UINT mask = 0; + + if (old_pos.x != pos.x) mask |= CWX; + if (old_pos.y != pos.y) mask |= CWY; + + if (mask) XReconfigureWMWindow( data->display, data->whole_window, data->vis.screen, mask, &changes ); + } + + release_win_data( data ); + } + return 0; case WM_X11DRV_SET_CURSOR: { Window win = 0; diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index d1a70da9998..fc646771acd 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -573,6 +573,7 @@ enum x11drv_window_messages WM_X11DRV_UPDATE_CLIPBOARD = 0x80001000, WM_X11DRV_SET_WIN_REGION, WM_X11DRV_RESIZE_DESKTOP, + WM_X11DRV_DESKTOP_RESIZED, WM_X11DRV_SET_CURSOR, WM_X11DRV_CLIP_CURSOR_NOTIFY, WM_X11DRV_CLIP_CURSOR_REQUEST,
1
0
0
0
Alexandre Julliard : wined3d: Use a Wine debug channel for vkd3d debug output.
by Alexandre Julliard
12 Oct '22
12 Oct '22
Module: wine Branch: master Commit: 89bb66aff8b34c095773e13cdae2f36a22a87abb URL:
https://gitlab.winehq.org/wine/wine/-/commit/89bb66aff8b34c095773e13cdae2f3…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Sep 29 11:47:43 2022 +0200 wined3d: Use a Wine debug channel for vkd3d debug output. Avoids spamming stderr when debug output is disabled. --- dlls/wined3d/wined3d_main.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/dlls/wined3d/wined3d_main.c b/dlls/wined3d/wined3d_main.c index 2e4dda2c473..576da8034c9 100644 --- a/dlls/wined3d/wined3d_main.c +++ b/dlls/wined3d/wined3d_main.c @@ -30,6 +30,7 @@ #include <vkd3d.h> WINE_DEFAULT_DEBUG_CHANNEL(d3d); +WINE_DECLARE_DEBUG_CHANNEL(vkd3d); WINE_DECLARE_DEBUG_CHANNEL(winediag); struct wined3d_wndproc @@ -471,6 +472,23 @@ static BOOL wined3d_dll_init(HINSTANCE hInstDLL) if (appkey) RegCloseKey( appkey ); if (hkey) RegCloseKey( hkey ); + if (!getenv( "VKD3D_DEBUG" )) + { + if (TRACE_ON(vkd3d)) putenv( "VKD3D_DEBUG=trace" ); + else if (WARN_ON(vkd3d)) putenv( "VKD3D_DEBUG=warn" ); + else if (FIXME_ON(vkd3d)) putenv( "VKD3D_DEBUG=fixme" ); + else if (ERR_ON(vkd3d)) putenv( "VKD3D_DEBUG=err" ); + else putenv( "VKD3D_DEBUG=none" ); + } + if (!getenv( "VKD3D_SHADER_DEBUG" )) + { + if (TRACE_ON(vkd3d)) putenv( "VKD3D_SHADER_DEBUG=trace" ); + else if (WARN_ON(vkd3d)) putenv( "VKD3D_SHADER_DEBUG=warn" ); + else if (FIXME_ON(vkd3d)) putenv( "VKD3D_SHADER_DEBUG=fixme" ); + else if (ERR_ON(vkd3d)) putenv( "VKD3D_SHADER_DEBUG=err" ); + else putenv( "VKD3D_SHADER_DEBUG=none" ); + } + vkd3d_set_log_callback(vkd3d_log_callback); return TRUE;
1
0
0
0
Zebediah Figura : qcap/tests: Test that the video capture filter sets timestamps.
by Alexandre Julliard
12 Oct '22
12 Oct '22
Module: wine Branch: master Commit: cc09167060bcf7ebe1a2de075dc59e38cea20a5b URL:
https://gitlab.winehq.org/wine/wine/-/commit/cc09167060bcf7ebe1a2de075dc59e…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Tue Oct 11 21:39:48 2022 -0500 qcap/tests: Test that the video capture filter sets timestamps. OpenSeeFace depends on this. --- dlls/qcap/tests/videocapture.c | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/dlls/qcap/tests/videocapture.c b/dlls/qcap/tests/videocapture.c index 41b2cbc6a3f..cb74c20481f 100644 --- a/dlls/qcap/tests/videocapture.c +++ b/dlls/qcap/tests/videocapture.c @@ -353,6 +353,7 @@ struct testfilter { struct strmbase_filter filter; struct strmbase_sink sink; + HANDLE got_sample; }; static inline struct testfilter *impl_from_strmbase_filter(struct strmbase_filter *iface) @@ -371,6 +372,8 @@ static struct strmbase_pin *testfilter_get_pin(struct strmbase_filter *iface, un static void testfilter_destroy(struct strmbase_filter *iface) { struct testfilter *filter = impl_from_strmbase_filter(iface); + + CloseHandle(filter->got_sample); strmbase_sink_cleanup(&filter->sink); strmbase_filter_cleanup(&filter->filter); } @@ -396,6 +399,17 @@ static HRESULT testsink_query_interface(struct strmbase_pin *iface, REFIID iid, static HRESULT WINAPI testsink_Receive(struct strmbase_sink *iface, IMediaSample *sample) { + struct testfilter *filter = impl_from_strmbase_filter(iface->pin.filter); + REFERENCE_TIME start, end; + HRESULT hr; + + if (winetest_debug > 1) trace("Receive()\n"); + + hr = IMediaSample_GetTime(sample, &start, &end); + todo_wine ok(hr == S_OK, "Got hr %#lx.\n", hr); + + SetEvent(filter->got_sample); + return S_OK; } @@ -411,13 +425,16 @@ static void testfilter_init(struct testfilter *filter) memset(filter, 0, sizeof(*filter)); strmbase_filter_init(&filter->filter, NULL, &clsid, &testfilter_ops); strmbase_sink_init(&filter->sink, &filter->filter, L"sink", &testsink_ops, NULL); + filter->got_sample = CreateEventW(NULL, FALSE, FALSE, NULL); } -static void test_filter_state(IMediaControl *control, IMemAllocator *allocator) +static void test_filter_state(IMediaControl *control, struct testfilter *filter) { + IMemAllocator *allocator = filter->sink.pAllocator; IMediaSample *sample; OAFilterState state; HRESULT hr; + DWORD ret; hr = IMediaControl_GetState(control, 0, &state); ok(hr == S_OK, "Got hr %#lx.\n", hr); @@ -440,6 +457,13 @@ static void test_filter_state(IMediaControl *control, IMemAllocator *allocator) hr = IMediaControl_Run(control); ok(hr == S_OK, "Got hr %#lx.\n", hr); + /* starting up the webcam can be a little slow */ + ret = WaitForSingleObject(filter->got_sample, 5000); + ok(!ret, "Got %lu.\n", ret); + + ret = WaitForSingleObject(filter->got_sample, 1000); + ok(!ret, "Got %lu.\n", ret); + hr = IMediaControl_GetState(control, 0, &state); ok(hr == S_OK, "Got hr %#lx.\n", hr); ok(state == State_Running, "Got state %lu.\n", state); @@ -547,7 +571,7 @@ static void test_connect_pin(IBaseFilter *filter, IPin *source) ok(!!testsink.sink.pAllocator, "Expected to be assigned an allocator.\n"); - test_filter_state(control, testsink.sink.pAllocator); + test_filter_state(control, &testsink); hr = IPin_ConnectedTo(source, &peer); ok(hr == S_OK, "Got hr %#lx.\n", hr);
1
0
0
0
Zebediah Figura : qcap: Fix reversed max_fps and min_fps.
by Alexandre Julliard
12 Oct '22
12 Oct '22
Module: wine Branch: master Commit: 333a871549aa896038fbeb3d8d218af782da3d48 URL:
https://gitlab.winehq.org/wine/wine/-/commit/333a871549aa896038fbeb3d8d218a…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Tue Oct 11 20:48:50 2022 -0500 qcap: Fix reversed max_fps and min_fps. The maximum FPS is the inverse of the minimum frame time, not the maximum frame time, and vice versa. --- dlls/qcap/v4l.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/qcap/v4l.c b/dlls/qcap/v4l.c index 1b8a3658dcf..b2ccaa6c53e 100644 --- a/dlls/qcap/v4l.c +++ b/dlls/qcap/v4l.c @@ -528,8 +528,8 @@ static NTSTATUS v4l_device_create( void *args ) else if (frmival.type == V4L2_FRMIVAL_TYPE_STEPWISE || frmival.type == V4L2_FRMIVAL_TYPE_CONTINUOUS) { - max_fps = frmival.stepwise.max.denominator / frmival.stepwise.max.numerator; - min_fps = frmival.stepwise.min.denominator / frmival.stepwise.min.numerator; + min_fps = frmival.stepwise.max.denominator / frmival.stepwise.max.numerator; + max_fps = frmival.stepwise.min.denominator / frmival.stepwise.min.numerator; } } else
1
0
0
0
Zebediah Figura : qcap: Fix frame interval calculation.
by Alexandre Julliard
12 Oct '22
12 Oct '22
Module: wine Branch: master Commit: a19ceddeb026250bbd9843cd675f61bff8881bf9 URL:
https://gitlab.winehq.org/wine/wine/-/commit/a19ceddeb026250bbd9843cd675f61…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Tue Oct 11 20:46:38 2022 -0500 qcap: Fix frame interval calculation. --- dlls/qcap/v4l.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/qcap/v4l.c b/dlls/qcap/v4l.c index 577cc829329..1b8a3658dcf 100644 --- a/dlls/qcap/v4l.c +++ b/dlls/qcap/v4l.c @@ -387,8 +387,8 @@ static void fill_caps(__u32 pixelformat, __u32 width, __u32 height, caps->media_type.cbFormat = sizeof(VIDEOINFOHEADER); /* We reallocate the caps array, so pbFormat has to be set after all caps * have been enumerated. */ - caps->config.MaxFrameInterval = 10000000 * max_fps; - caps->config.MinFrameInterval = 10000000 * min_fps; + caps->config.MaxFrameInterval = 10000000 / max_fps; + caps->config.MinFrameInterval = 10000000 / min_fps; caps->config.MaxOutputSize.cx = width; caps->config.MaxOutputSize.cy = height; caps->config.MinOutputSize.cx = width;
1
0
0
0
Rémi Bernon : winegstreamer: Use IWMSyncReader2_GetNextSample in the async reader.
by Alexandre Julliard
12 Oct '22
12 Oct '22
Module: wine Branch: master Commit: 90fb2c3edbbc8623672993478e10cf7ee2122d6c URL:
https://gitlab.winehq.org/wine/wine/-/commit/90fb2c3edbbc8623672993478e10cf…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Fri Sep 16 08:12:43 2022 +0200 winegstreamer: Use IWMSyncReader2_GetNextSample in the async reader. --- dlls/winegstreamer/gst_private.h | 48 --------------------------------- dlls/winegstreamer/wm_asyncreader.c | 16 +++++------ dlls/winegstreamer/wm_reader.c | 53 ++++++++++++++++++++++++++++++++----- 3 files changed, 53 insertions(+), 64 deletions(-) diff --git a/dlls/winegstreamer/gst_private.h b/dlls/winegstreamer/gst_private.h index 033cc008cff..fed5766d3a4 100644 --- a/dlls/winegstreamer/gst_private.h +++ b/dlls/winegstreamer/gst_private.h @@ -143,54 +143,6 @@ HRESULT winegstreamer_stream_handler_create(REFIID riid, void **obj); HRESULT h264_decoder_create(REFIID riid, void **ret); HRESULT video_processor_create(REFIID riid, void **ret); -struct wm_stream -{ - struct wm_reader *reader; - struct wg_parser_stream *wg_stream; - struct wg_format format; - WMT_STREAM_SELECTION selection; - WORD index; - bool eos; - /* Note that we only pretend to read compressed samples, and instead output - * uncompressed samples regardless of whether we are configured to read - * compressed samples. Rather, the behaviour of the reader objects differs - * in nontrivial ways depending on this field. */ - bool read_compressed; - - IWMReaderAllocatorEx *output_allocator; - IWMReaderAllocatorEx *stream_allocator; -}; - -struct wm_reader -{ - IUnknown IUnknown_inner; - IWMSyncReader2 IWMSyncReader2_iface; - IWMHeaderInfo3 IWMHeaderInfo3_iface; - IWMLanguageList IWMLanguageList_iface; - IWMPacketSize2 IWMPacketSize2_iface; - IWMProfile3 IWMProfile3_iface; - IWMReaderPlaylistBurn IWMReaderPlaylistBurn_iface; - IWMReaderTimecode IWMReaderTimecode_iface; - IUnknown *outer; - LONG refcount; - - CRITICAL_SECTION cs; - QWORD start_time; - - IStream *source_stream; - HANDLE file; - HANDLE read_thread; - bool read_thread_shutdown; - struct wg_parser *wg_parser; - - struct wm_stream *streams; - WORD stream_count; -}; - HRESULT WINAPI winegstreamer_create_wm_sync_reader(IUnknown *outer, void **out); -struct wm_reader *wm_reader_from_sync_reader_inner(IUnknown *inner); - -HRESULT wm_reader_get_stream_sample(struct wm_reader *reader, IWMReaderCallbackAdvanced *callback_advanced, WORD stream_number, - INSSBuffer **ret_sample, QWORD *pts, QWORD *duration, DWORD *flags, WORD *ret_stream_number); #endif /* __GST_PRIVATE_INCLUDED__ */ diff --git a/dlls/winegstreamer/wm_asyncreader.c b/dlls/winegstreamer/wm_asyncreader.c index 9f25d726a51..409ebeae1af 100644 --- a/dlls/winegstreamer/wm_asyncreader.c +++ b/dlls/winegstreamer/wm_asyncreader.c @@ -48,7 +48,7 @@ struct sample { INSSBuffer *buffer; QWORD pts, duration; - DWORD flags; + DWORD flags, output; WORD stream; }; @@ -65,7 +65,6 @@ struct async_reader LONG refcount; IWMSyncReader2 *reader; - struct wm_reader *wm_reader; CRITICAL_SECTION cs; @@ -261,9 +260,9 @@ static void async_reader_deliver_sample(struct async_reader *reader, struct samp BOOL read_compressed; HRESULT hr; - TRACE("reader %p, stream %u, pts %s, duration %s, flags %#lx, buffer %p.\n", - reader, sample->stream, debugstr_time(sample->pts), debugstr_time(sample->duration), - sample->flags, sample->buffer); + TRACE("reader %p, output %lu, stream %u, pts %s, duration %s, flags %#lx, buffer %p.\n", + reader, sample->output, sample->stream, debugstr_time(sample->pts), + debugstr_time(sample->duration), sample->flags, sample->buffer); if (FAILED(hr = IWMSyncReader2_GetReadStreamSamples(reader->reader, sample->stream, &read_compressed))) @@ -274,7 +273,7 @@ static void async_reader_deliver_sample(struct async_reader *reader, struct samp hr = IWMReaderCallbackAdvanced_OnStreamSample(callback_advanced, sample->stream, sample->pts, sample->duration, sample->flags, sample->buffer, reader->context); else - hr = IWMReaderCallback_OnSample(callback, sample->stream - 1, sample->pts, sample->duration, + hr = IWMReaderCallback_OnSample(callback, sample->output, sample->pts, sample->duration, sample->flags, sample->buffer, reader->context); EnterCriticalSection(&reader->callback_cs); @@ -295,8 +294,8 @@ static void callback_thread_run(struct async_reader *reader) struct sample sample; LeaveCriticalSection(&reader->callback_cs); - hr = wm_reader_get_stream_sample(reader->wm_reader, callback_advanced, 0, &sample.buffer, - &sample.pts, &sample.duration, &sample.flags, &sample.stream); + hr = IWMSyncReader2_GetNextSample(reader->reader, 0, &sample.buffer, &sample.pts, + &sample.duration, &sample.flags, &sample.output, &sample.stream); EnterCriticalSection(&reader->callback_cs); if (hr != S_OK) break; @@ -1909,7 +1908,6 @@ HRESULT WINAPI winegstreamer_create_wm_async_reader(IWMReader **reader) (void **)&object->reader))) goto failed; IWMReader_Release(&object->IWMReader_iface); - object->wm_reader = wm_reader_from_sync_reader_inner(object->reader_inner); InitializeCriticalSection(&object->cs); object->cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": async_reader.cs"); diff --git a/dlls/winegstreamer/wm_reader.c b/dlls/winegstreamer/wm_reader.c index 81bd9b863cc..e68e0a7d0ca 100644 --- a/dlls/winegstreamer/wm_reader.c +++ b/dlls/winegstreamer/wm_reader.c @@ -20,6 +20,50 @@ WINE_DEFAULT_DEBUG_CHANNEL(wmvcore); +struct wm_stream +{ + struct wm_reader *reader; + struct wg_parser_stream *wg_stream; + struct wg_format format; + WMT_STREAM_SELECTION selection; + WORD index; + bool eos; + /* Note that we only pretend to read compressed samples, and instead output + * uncompressed samples regardless of whether we are configured to read + * compressed samples. Rather, the behaviour of the reader objects differs + * in nontrivial ways depending on this field. */ + bool read_compressed; + + IWMReaderAllocatorEx *output_allocator; + IWMReaderAllocatorEx *stream_allocator; +}; + +struct wm_reader +{ + IUnknown IUnknown_inner; + IWMSyncReader2 IWMSyncReader2_iface; + IWMHeaderInfo3 IWMHeaderInfo3_iface; + IWMLanguageList IWMLanguageList_iface; + IWMPacketSize2 IWMPacketSize2_iface; + IWMProfile3 IWMProfile3_iface; + IWMReaderPlaylistBurn IWMReaderPlaylistBurn_iface; + IWMReaderTimecode IWMReaderTimecode_iface; + IUnknown *outer; + LONG refcount; + + CRITICAL_SECTION cs; + QWORD start_time; + + IStream *source_stream; + HANDLE file; + HANDLE read_thread; + bool read_thread_shutdown; + struct wg_parser *wg_parser; + + struct wm_stream *streams; + WORD stream_count; +}; + static struct wm_stream *get_stream_by_output_number(struct wm_reader *reader, DWORD output) { if (output < reader->stream_count) @@ -1569,7 +1613,7 @@ static WORD get_earliest_buffer(struct wm_reader *reader, struct wg_parser_buffe return stream_number; } -HRESULT wm_reader_get_stream_sample(struct wm_reader *reader, IWMReaderCallbackAdvanced *callback_advanced, WORD stream_number, +static HRESULT wm_reader_get_stream_sample(struct wm_reader *reader, WORD stream_number, INSSBuffer **ret_sample, QWORD *pts, QWORD *duration, DWORD *flags, WORD *ret_stream_number) { struct wg_parser_stream *wg_stream; @@ -1865,7 +1909,7 @@ static HRESULT WINAPI reader_GetNextSample(IWMSyncReader2 *iface, EnterCriticalSection(&reader->cs); - hr = wm_reader_get_stream_sample(reader, NULL, stream_number, sample, pts, duration, flags, &stream_number); + hr = wm_reader_get_stream_sample(reader, stream_number, sample, pts, duration, flags, &stream_number); if (output_number && hr == S_OK) *output_number = stream_number - 1; if (ret_stream_number && (hr == S_OK || stream_number)) @@ -2518,11 +2562,6 @@ static const IWMSyncReader2Vtbl reader_vtbl = reader_GetAllocateForStream }; -struct wm_reader *wm_reader_from_sync_reader_inner(IUnknown *iface) -{ - return impl_from_IUnknown(iface); -} - HRESULT WINAPI winegstreamer_create_wm_sync_reader(IUnknown *outer, void **out) { struct wm_reader *object;
1
0
0
0
Rémi Bernon : winegstreamer: Use IWMSyncReader2_GetAllocateForStream in the async reader.
by Alexandre Julliard
12 Oct '22
12 Oct '22
Module: wine Branch: master Commit: b23154808f78cacf311994c8523349a3f210fac9 URL:
https://gitlab.winehq.org/wine/wine/-/commit/b23154808f78cacf311994c8523349…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Mon Aug 22 16:04:36 2022 +0200 winegstreamer: Use IWMSyncReader2_GetAllocateForStream in the async reader. --- dlls/winegstreamer/wm_asyncreader.c | 18 ++++++++++++++---- dlls/wmvcore/tests/wmvcore.c | 34 ++++++++++++++-------------------- 2 files changed, 28 insertions(+), 24 deletions(-) diff --git a/dlls/winegstreamer/wm_asyncreader.c b/dlls/winegstreamer/wm_asyncreader.c index 4d067dbb239..9f25d726a51 100644 --- a/dlls/winegstreamer/wm_asyncreader.c +++ b/dlls/winegstreamer/wm_asyncreader.c @@ -905,11 +905,21 @@ static HRESULT WINAPI WMReaderAdvanced_SetAllocateForStream(IWMReaderAdvanced6 * return IWMSyncReader2_SetAllocateForStream(reader->reader, stream_number, allocate ? reader->allocator : NULL); } -static HRESULT WINAPI WMReaderAdvanced_GetAllocateForStream(IWMReaderAdvanced6 *iface, WORD output_num, BOOL *allocate) +static HRESULT WINAPI WMReaderAdvanced_GetAllocateForStream(IWMReaderAdvanced6 *iface, WORD stream_number, BOOL *allocate) { - struct async_reader *This = impl_from_IWMReaderAdvanced6(iface); - FIXME("(%p)->(%d %p)\n", This, output_num, allocate); - return E_NOTIMPL; + struct async_reader *reader = impl_from_IWMReaderAdvanced6(iface); + IWMReaderAllocatorEx *allocator; + HRESULT hr; + + TRACE("reader %p, stream_number %u, allocate %p.\n", reader, stream_number, allocate); + + if (FAILED(hr = IWMSyncReader2_GetAllocateForStream(reader->reader, stream_number, &allocator))) + return hr; + + if ((*allocate = allocator != NULL)) + IWMReaderAllocatorEx_Release(allocator); + + return hr; } static HRESULT WINAPI WMReaderAdvanced_GetStatistics(IWMReaderAdvanced6 *iface, WM_READER_STATISTICS *statistics) diff --git a/dlls/wmvcore/tests/wmvcore.c b/dlls/wmvcore/tests/wmvcore.c index fc4b6ac390c..401856eb744 100644 --- a/dlls/wmvcore/tests/wmvcore.c +++ b/dlls/wmvcore/tests/wmvcore.c @@ -2514,17 +2514,15 @@ static void test_async_reader_allocate(IWMReader *reader, ok(hr == E_INVALIDARG, "Got hr %#lx.\n", hr); hr = IWMReaderAdvanced2_GetAllocateForStream(advanced, 0, &allocate); - todo_wine ok(hr == E_INVALIDARG, "Got hr %#lx.\n", hr); + ok(hr == E_INVALIDARG, "Got hr %#lx.\n", hr); hr = IWMReaderAdvanced2_GetAllocateForStream(advanced, 1, &allocate); - todo_wine ok(hr == S_OK, "Got hr %#lx.\n", hr); - if (hr == S_OK) - ok(!allocate, "Got allocate %d.\n", allocate); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + ok(!allocate, "Got allocate %d.\n", allocate); hr = IWMReaderAdvanced2_GetAllocateForStream(advanced, 2, &allocate); - todo_wine ok(hr == S_OK, "Got hr %#lx.\n", hr); - if (hr == S_OK) - ok(!allocate, "Got allocate %d.\n", allocate); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + ok(!allocate, "Got allocate %d.\n", allocate); hr = IWMReaderAdvanced2_GetAllocateForStream(advanced, 3, &allocate); - todo_wine ok(hr == E_INVALIDARG, "Got hr %#lx.\n", hr); + ok(hr == E_INVALIDARG, "Got hr %#lx.\n", hr); hr = IWMReaderAdvanced2_SetAllocateForOutput(advanced, 0, TRUE); ok(hr == S_OK, "Got hr %#lx.\n", hr); @@ -2541,13 +2539,11 @@ static void test_async_reader_allocate(IWMReader *reader, ok(allocate == TRUE, "Got allocate %d.\n", allocate); hr = IWMReaderAdvanced2_GetAllocateForStream(advanced, 1, &allocate); - todo_wine ok(hr == S_OK, "Got hr %#lx.\n", hr); - if (hr == S_OK) - ok(!allocate, "Got allocate %d.\n", allocate); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + ok(!allocate, "Got allocate %d.\n", allocate); hr = IWMReaderAdvanced2_GetAllocateForStream(advanced, 2, &allocate); - todo_wine ok(hr == S_OK, "Got hr %#lx.\n", hr); - if (hr == S_OK) - ok(!allocate, "Got allocate %d.\n", allocate); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + ok(!allocate, "Got allocate %d.\n", allocate); run_async_reader(reader, advanced, callback); @@ -2575,13 +2571,11 @@ static void test_async_reader_allocate(IWMReader *reader, ok(!allocate, "Got allocate %d.\n", allocate); hr = IWMReaderAdvanced2_GetAllocateForStream(advanced, 1, &allocate); - todo_wine ok(hr == S_OK, "Got hr %#lx.\n", hr); - if (hr == S_OK) - ok(allocate == TRUE, "Got allocate %d.\n", allocate); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + ok(allocate == TRUE, "Got allocate %d.\n", allocate); hr = IWMReaderAdvanced2_GetAllocateForStream(advanced, 2, &allocate); - todo_wine ok(hr == S_OK, "Got hr %#lx.\n", hr); - if (hr == S_OK) - ok(allocate == TRUE, "Got allocate %d.\n", allocate); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + ok(allocate == TRUE, "Got allocate %d.\n", allocate); run_async_reader(reader, advanced, callback);
1
0
0
0
Rémi Bernon : winegstreamer: Use IWMSyncReader2_SetAllocateForStream in the async reader.
by Alexandre Julliard
12 Oct '22
12 Oct '22
Module: wine Branch: master Commit: 04fa63913ab0bbad4d5d6eb1473e7b210801d851 URL:
https://gitlab.winehq.org/wine/wine/-/commit/04fa63913ab0bbad4d5d6eb1473e7b…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Mon Aug 22 16:28:15 2022 +0200 winegstreamer: Use IWMSyncReader2_SetAllocateForStream in the async reader. --- dlls/winegstreamer/gst_private.h | 2 -- dlls/winegstreamer/wm_asyncreader.c | 5 ++--- dlls/winegstreamer/wm_reader.c | 21 --------------------- 3 files changed, 2 insertions(+), 26 deletions(-) diff --git a/dlls/winegstreamer/gst_private.h b/dlls/winegstreamer/gst_private.h index 67df97d0c84..033cc008cff 100644 --- a/dlls/winegstreamer/gst_private.h +++ b/dlls/winegstreamer/gst_private.h @@ -151,7 +151,6 @@ struct wm_stream WMT_STREAM_SELECTION selection; WORD index; bool eos; - bool allocate_stream; /* Note that we only pretend to read compressed samples, and instead output * uncompressed samples regardless of whether we are configured to read * compressed samples. Rather, the behaviour of the reader objects differs @@ -193,6 +192,5 @@ struct wm_reader *wm_reader_from_sync_reader_inner(IUnknown *inner); HRESULT wm_reader_get_stream_sample(struct wm_reader *reader, IWMReaderCallbackAdvanced *callback_advanced, WORD stream_number, INSSBuffer **ret_sample, QWORD *pts, QWORD *duration, DWORD *flags, WORD *ret_stream_number); -HRESULT wm_reader_set_allocate_for_stream(struct wm_reader *reader, WORD stream_number, BOOL allocate); #endif /* __GST_PRIVATE_INCLUDED__ */ diff --git a/dlls/winegstreamer/wm_asyncreader.c b/dlls/winegstreamer/wm_asyncreader.c index cd4979ee256..4d067dbb239 100644 --- a/dlls/winegstreamer/wm_asyncreader.c +++ b/dlls/winegstreamer/wm_asyncreader.c @@ -896,14 +896,13 @@ static HRESULT WINAPI WMReaderAdvanced_GetAllocateForOutput(IWMReaderAdvanced6 * return hr; } -static HRESULT WINAPI WMReaderAdvanced_SetAllocateForStream(IWMReaderAdvanced6 *iface, - WORD stream_number, BOOL allocate) +static HRESULT WINAPI WMReaderAdvanced_SetAllocateForStream(IWMReaderAdvanced6 *iface, WORD stream_number, BOOL allocate) { struct async_reader *reader = impl_from_IWMReaderAdvanced6(iface); TRACE("reader %p, stream_number %u, allocate %d.\n", reader, stream_number, allocate); - return wm_reader_set_allocate_for_stream(reader->wm_reader, stream_number, allocate); + return IWMSyncReader2_SetAllocateForStream(reader->reader, stream_number, allocate ? reader->allocator : NULL); } static HRESULT WINAPI WMReaderAdvanced_GetAllocateForStream(IWMReaderAdvanced6 *iface, WORD output_num, BOOL *allocate) diff --git a/dlls/winegstreamer/wm_reader.c b/dlls/winegstreamer/wm_reader.c index 8d026aae723..81bd9b863cc 100644 --- a/dlls/winegstreamer/wm_reader.c +++ b/dlls/winegstreamer/wm_reader.c @@ -1628,9 +1628,6 @@ HRESULT wm_reader_get_stream_sample(struct wm_reader *reader, IWMReaderCallbackA else if (stream->read_compressed && stream->stream_allocator) hr = IWMReaderAllocatorEx_AllocateForStreamEx(stream->stream_allocator, stream->index + 1, wg_buffer.size, &sample, 0, 0, 0, NULL); - else if (callback_advanced && stream->read_compressed && stream->allocate_stream) - hr = IWMReaderCallbackAdvanced_AllocateForStream(callback_advanced, - stream->index + 1, wg_buffer.size, &sample, NULL); /* FIXME: Should these be pooled? */ else if (!(object = calloc(1, offsetof(struct buffer, data[wg_buffer.size])))) hr = E_OUTOFMEMORY; @@ -1689,24 +1686,6 @@ HRESULT wm_reader_get_stream_sample(struct wm_reader *reader, IWMReaderCallbackA } } -HRESULT wm_reader_set_allocate_for_stream(struct wm_reader *reader, WORD stream_number, BOOL allocate) -{ - struct wm_stream *stream; - - EnterCriticalSection(&reader->cs); - - if (!(stream = wm_reader_get_stream_by_stream_number(reader, stream_number))) - { - LeaveCriticalSection(&reader->cs); - return E_INVALIDARG; - } - - stream->allocate_stream = !!allocate; - - LeaveCriticalSection(&reader->cs); - return S_OK; -} - static struct wm_reader *impl_from_IUnknown(IUnknown *iface) { return CONTAINING_RECORD(iface, struct wm_reader, IUnknown_inner);
1
0
0
0
Rémi Bernon : winegstreamer: Use IWMSyncReader2_GetAllocateForOutput in the async reader.
by Alexandre Julliard
12 Oct '22
12 Oct '22
Module: wine Branch: master Commit: 957ac08cd0b62c4f50672d20c0db25cf2ab79354 URL:
https://gitlab.winehq.org/wine/wine/-/commit/957ac08cd0b62c4f50672d20c0db25…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Mon Aug 22 15:44:48 2022 +0200 winegstreamer: Use IWMSyncReader2_GetAllocateForOutput in the async reader. --- dlls/winegstreamer/wm_asyncreader.c | 14 +++++++++++--- dlls/wmvcore/tests/wmvcore.c | 32 +++++++++++++------------------- 2 files changed, 24 insertions(+), 22 deletions(-) diff --git a/dlls/winegstreamer/wm_asyncreader.c b/dlls/winegstreamer/wm_asyncreader.c index fc0090f01c6..cd4979ee256 100644 --- a/dlls/winegstreamer/wm_asyncreader.c +++ b/dlls/winegstreamer/wm_asyncreader.c @@ -879,13 +879,21 @@ static HRESULT WINAPI WMReaderAdvanced_SetAllocateForOutput(IWMReaderAdvanced6 * return IWMSyncReader2_SetAllocateForOutput(reader->reader, output, allocate ? reader->allocator : NULL); } -static HRESULT WINAPI WMReaderAdvanced_GetAllocateForOutput(IWMReaderAdvanced6 *iface, DWORD output_num, BOOL *allocate) +static HRESULT WINAPI WMReaderAdvanced_GetAllocateForOutput(IWMReaderAdvanced6 *iface, DWORD output, BOOL *allocate) { struct async_reader *reader = impl_from_IWMReaderAdvanced6(iface); + IWMReaderAllocatorEx *allocator; + HRESULT hr; - FIXME("reader %p, output %lu, allocate %p, stub!\n", reader, output_num, allocate); + TRACE("reader %p, output %lu, allocate %p.\n", reader, output, allocate); - return E_NOTIMPL; + if (FAILED(hr = IWMSyncReader2_GetAllocateForOutput(reader->reader, output, &allocator))) + return hr; + + if ((*allocate = allocator != NULL)) + IWMReaderAllocatorEx_Release(allocator); + + return hr; } static HRESULT WINAPI WMReaderAdvanced_SetAllocateForStream(IWMReaderAdvanced6 *iface, diff --git a/dlls/wmvcore/tests/wmvcore.c b/dlls/wmvcore/tests/wmvcore.c index 5ba280c3222..fc4b6ac390c 100644 --- a/dlls/wmvcore/tests/wmvcore.c +++ b/dlls/wmvcore/tests/wmvcore.c @@ -2505,15 +2505,13 @@ static void test_async_reader_allocate(IWMReader *reader, callback->allocated_samples = true; hr = IWMReaderAdvanced2_GetAllocateForOutput(advanced, 0, &allocate); - todo_wine ok(hr == S_OK, "Got hr %#lx.\n", hr); - if (hr == S_OK) - ok(!allocate, "Got allocate %d.\n", allocate); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + ok(!allocate, "Got allocate %d.\n", allocate); hr = IWMReaderAdvanced2_GetAllocateForOutput(advanced, 1, &allocate); - todo_wine ok(hr == S_OK, "Got hr %#lx.\n", hr); - if (hr == S_OK) - ok(!allocate, "Got allocate %d.\n", allocate); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + ok(!allocate, "Got allocate %d.\n", allocate); hr = IWMReaderAdvanced2_GetAllocateForOutput(advanced, 2, &allocate); - todo_wine ok(hr == E_INVALIDARG, "Got hr %#lx.\n", hr); + ok(hr == E_INVALIDARG, "Got hr %#lx.\n", hr); hr = IWMReaderAdvanced2_GetAllocateForStream(advanced, 0, &allocate); todo_wine ok(hr == E_INVALIDARG, "Got hr %#lx.\n", hr); @@ -2536,13 +2534,11 @@ static void test_async_reader_allocate(IWMReader *reader, ok(hr == E_INVALIDARG, "Got hr %#lx.\n", hr); hr = IWMReaderAdvanced2_GetAllocateForOutput(advanced, 0, &allocate); - todo_wine ok(hr == S_OK, "Got hr %#lx.\n", hr); - if (hr == S_OK) - ok(allocate == TRUE, "Got allocate %d.\n", allocate); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + ok(allocate == TRUE, "Got allocate %d.\n", allocate); hr = IWMReaderAdvanced2_GetAllocateForOutput(advanced, 1, &allocate); - todo_wine ok(hr == S_OK, "Got hr %#lx.\n", hr); - if (hr == S_OK) - ok(allocate == TRUE, "Got allocate %d.\n", allocate); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + ok(allocate == TRUE, "Got allocate %d.\n", allocate); hr = IWMReaderAdvanced2_GetAllocateForStream(advanced, 1, &allocate); todo_wine ok(hr == S_OK, "Got hr %#lx.\n", hr); @@ -2572,13 +2568,11 @@ static void test_async_reader_allocate(IWMReader *reader, ok(hr == E_INVALIDARG, "Got hr %#lx.\n", hr); hr = IWMReaderAdvanced2_GetAllocateForOutput(advanced, 0, &allocate); - todo_wine ok(hr == S_OK, "Got hr %#lx.\n", hr); - if (hr == S_OK) - ok(!allocate, "Got allocate %d.\n", allocate); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + ok(!allocate, "Got allocate %d.\n", allocate); hr = IWMReaderAdvanced2_GetAllocateForOutput(advanced, 1, &allocate); - todo_wine ok(hr == S_OK, "Got hr %#lx.\n", hr); - if (hr == S_OK) - ok(!allocate, "Got allocate %d.\n", allocate); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + ok(!allocate, "Got allocate %d.\n", allocate); hr = IWMReaderAdvanced2_GetAllocateForStream(advanced, 1, &allocate); todo_wine ok(hr == S_OK, "Got hr %#lx.\n", hr);
1
0
0
0
Rémi Bernon : winegstreamer: Use IWMSyncReader2_SetAllocateForOutput in the async reader.
by Alexandre Julliard
12 Oct '22
12 Oct '22
Module: wine Branch: master Commit: 8de2ec5fa0cbaa3a773ec5be5465acbe56694531 URL:
https://gitlab.winehq.org/wine/wine/-/commit/8de2ec5fa0cbaa3a773ec5be5465ac…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Mon Aug 22 15:44:48 2022 +0200 winegstreamer: Use IWMSyncReader2_SetAllocateForOutput in the async reader. --- dlls/winegstreamer/gst_private.h | 2 -- dlls/winegstreamer/wm_asyncreader.c | 5 ++--- dlls/winegstreamer/wm_reader.c | 21 --------------------- 3 files changed, 2 insertions(+), 26 deletions(-) diff --git a/dlls/winegstreamer/gst_private.h b/dlls/winegstreamer/gst_private.h index fa93ce969c7..67df97d0c84 100644 --- a/dlls/winegstreamer/gst_private.h +++ b/dlls/winegstreamer/gst_private.h @@ -151,7 +151,6 @@ struct wm_stream WMT_STREAM_SELECTION selection; WORD index; bool eos; - bool allocate_output; bool allocate_stream; /* Note that we only pretend to read compressed samples, and instead output * uncompressed samples regardless of whether we are configured to read @@ -194,7 +193,6 @@ struct wm_reader *wm_reader_from_sync_reader_inner(IUnknown *inner); HRESULT wm_reader_get_stream_sample(struct wm_reader *reader, IWMReaderCallbackAdvanced *callback_advanced, WORD stream_number, INSSBuffer **ret_sample, QWORD *pts, QWORD *duration, DWORD *flags, WORD *ret_stream_number); -HRESULT wm_reader_set_allocate_for_output(struct wm_reader *reader, DWORD output, BOOL allocate); HRESULT wm_reader_set_allocate_for_stream(struct wm_reader *reader, WORD stream_number, BOOL allocate); #endif /* __GST_PRIVATE_INCLUDED__ */ diff --git a/dlls/winegstreamer/wm_asyncreader.c b/dlls/winegstreamer/wm_asyncreader.c index 089c96deddf..fc0090f01c6 100644 --- a/dlls/winegstreamer/wm_asyncreader.c +++ b/dlls/winegstreamer/wm_asyncreader.c @@ -870,14 +870,13 @@ static HRESULT WINAPI WMReaderAdvanced_GetReceiveStreamSamples(IWMReaderAdvanced return E_NOTIMPL; } -static HRESULT WINAPI WMReaderAdvanced_SetAllocateForOutput(IWMReaderAdvanced6 *iface, - DWORD output, BOOL allocate) +static HRESULT WINAPI WMReaderAdvanced_SetAllocateForOutput(IWMReaderAdvanced6 *iface, DWORD output, BOOL allocate) { struct async_reader *reader = impl_from_IWMReaderAdvanced6(iface); TRACE("reader %p, output %lu, allocate %d.\n", reader, output, allocate); - return wm_reader_set_allocate_for_output(reader->wm_reader, output, allocate); + return IWMSyncReader2_SetAllocateForOutput(reader->reader, output, allocate ? reader->allocator : NULL); } static HRESULT WINAPI WMReaderAdvanced_GetAllocateForOutput(IWMReaderAdvanced6 *iface, DWORD output_num, BOOL *allocate) diff --git a/dlls/winegstreamer/wm_reader.c b/dlls/winegstreamer/wm_reader.c index acdb7cdc817..8d026aae723 100644 --- a/dlls/winegstreamer/wm_reader.c +++ b/dlls/winegstreamer/wm_reader.c @@ -1631,9 +1631,6 @@ HRESULT wm_reader_get_stream_sample(struct wm_reader *reader, IWMReaderCallbackA else if (callback_advanced && stream->read_compressed && stream->allocate_stream) hr = IWMReaderCallbackAdvanced_AllocateForStream(callback_advanced, stream->index + 1, wg_buffer.size, &sample, NULL); - else if (callback_advanced && !stream->read_compressed && stream->allocate_output) - hr = IWMReaderCallbackAdvanced_AllocateForOutput(callback_advanced, - stream->index, wg_buffer.size, &sample, NULL); /* FIXME: Should these be pooled? */ else if (!(object = calloc(1, offsetof(struct buffer, data[wg_buffer.size])))) hr = E_OUTOFMEMORY; @@ -1692,24 +1689,6 @@ HRESULT wm_reader_get_stream_sample(struct wm_reader *reader, IWMReaderCallbackA } } -HRESULT wm_reader_set_allocate_for_output(struct wm_reader *reader, DWORD output, BOOL allocate) -{ - struct wm_stream *stream; - - EnterCriticalSection(&reader->cs); - - if (!(stream = get_stream_by_output_number(reader, output))) - { - LeaveCriticalSection(&reader->cs); - return E_INVALIDARG; - } - - stream->allocate_output = !!allocate; - - LeaveCriticalSection(&reader->cs); - return S_OK; -} - HRESULT wm_reader_set_allocate_for_stream(struct wm_reader *reader, WORD stream_number, BOOL allocate) { struct wm_stream *stream;
1
0
0
0
Rémi Bernon : winegstreamer: Wrap callback in a IWMReaderAllocatorEx in the async reader.
by Alexandre Julliard
12 Oct '22
12 Oct '22
Module: wine Branch: master Commit: 18b1959749e2f8ecdc6b1cfaa9381241df5d348a URL:
https://gitlab.winehq.org/wine/wine/-/commit/18b1959749e2f8ecdc6b1cfaa93812…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Mon Aug 22 15:44:48 2022 +0200 winegstreamer: Wrap callback in a IWMReaderAllocatorEx in the async reader. --- dlls/winegstreamer/wm_asyncreader.c | 127 ++++++++++++++++++++++++++++++++++++ 1 file changed, 127 insertions(+) diff --git a/dlls/winegstreamer/wm_asyncreader.c b/dlls/winegstreamer/wm_asyncreader.c index 84742d2f40f..089c96deddf 100644 --- a/dlls/winegstreamer/wm_asyncreader.c +++ b/dlls/winegstreamer/wm_asyncreader.c @@ -70,6 +70,7 @@ struct async_reader CRITICAL_SECTION cs; IWMReaderCallbackAdvanced *callback_advanced; + IWMReaderAllocatorEx *allocator; IWMReaderCallback *callback; void *context; @@ -87,6 +88,125 @@ struct async_reader QWORD user_time; }; +struct allocator +{ + IWMReaderAllocatorEx IWMReaderAllocatorEx_iface; + LONG refcount; + + IWMReaderCallbackAdvanced *callback; +}; + +static struct allocator *impl_from_IWMReaderAllocatorEx(IWMReaderAllocatorEx *iface) +{ + return CONTAINING_RECORD(iface, struct allocator, IWMReaderAllocatorEx_iface); +} + +static HRESULT WINAPI allocator_QueryInterface(IWMReaderAllocatorEx *iface, REFIID iid, void **out) +{ + struct allocator *allocator = impl_from_IWMReaderAllocatorEx(iface); + + TRACE("iface %p, iid %s, out %p.\n", iface, debugstr_guid(iid), out); + + if (IsEqualIID(iid, &IID_IUnknown) + || IsEqualIID(iid, &IID_IWMReaderAllocatorEx)) + *out = &allocator->IWMReaderAllocatorEx_iface; + else + { + WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(iid)); + return E_NOINTERFACE; + } + + IUnknown_AddRef((IUnknown *)*out); + return S_OK; +} + +static ULONG WINAPI allocator_AddRef(IWMReaderAllocatorEx *iface) +{ + struct allocator *allocator = impl_from_IWMReaderAllocatorEx(iface); + ULONG refcount = InterlockedIncrement(&allocator->refcount); + TRACE("iface %p increasing refcount to %lu.\n", iface, refcount); + return refcount; +} + +static ULONG WINAPI allocator_Release(IWMReaderAllocatorEx *iface) +{ + struct allocator *allocator = impl_from_IWMReaderAllocatorEx(iface); + ULONG refcount = InterlockedDecrement(&allocator->refcount); + + TRACE("iface %p decreasing refcount to %lu.\n", iface, refcount); + + if (!refcount) + { + if (allocator->callback) + IWMReaderCallbackAdvanced_Release(allocator->callback); + free(allocator); + } + + return refcount; +} + +static HRESULT WINAPI allocator_AllocateForStreamEx(IWMReaderAllocatorEx *iface, + WORD stream_number, DWORD size, INSSBuffer **sample, DWORD flags, + QWORD pts, QWORD duration, void *context) +{ + struct allocator *allocator = impl_from_IWMReaderAllocatorEx(iface); + + TRACE("iface %p, stream_number %u, size %#lx, sample %p, flags %#lx, pts %I64d, duration %I64d, context %p.\n", + iface, stream_number, size, sample, flags, pts, duration, context); + + if (allocator->callback) + return IWMReaderCallbackAdvanced_AllocateForStream(allocator->callback, + stream_number, size, sample, context); + + return E_NOTIMPL; +} + +static HRESULT WINAPI allocator_AllocateForOutputEx(IWMReaderAllocatorEx *iface, + DWORD output, DWORD size, INSSBuffer **sample, DWORD flags, + QWORD pts, QWORD duration, void *context) +{ + struct allocator *allocator = impl_from_IWMReaderAllocatorEx(iface); + + TRACE("iface %p, output %lu, size %#lx, sample %p, flags %#lx, pts %I64d, duration %I64d, context %p.\n", + iface, output, size, sample, flags, pts, duration, context); + + if (allocator->callback) + return IWMReaderCallbackAdvanced_AllocateForOutput(allocator->callback, + output, size, sample, context); + + return E_NOTIMPL; +} + +static const IWMReaderAllocatorExVtbl allocator_vtbl = +{ + allocator_QueryInterface, + allocator_AddRef, + allocator_Release, + allocator_AllocateForStreamEx, + allocator_AllocateForOutputEx, +}; + +static HRESULT allocator_create(IWMReaderCallback *callback, IWMReaderAllocatorEx **out) +{ + struct allocator *allocator; + HRESULT hr; + + if (!(allocator = calloc(1, sizeof(*allocator)))) + return E_OUTOFMEMORY; + allocator->IWMReaderAllocatorEx_iface.lpVtbl = &allocator_vtbl; + allocator->refcount = 1; + + if (FAILED(hr = IWMReaderCallback_QueryInterface(callback, + &IID_IWMReaderCallbackAdvanced, (void **)&allocator->callback))) + { + WARN("Failed to retrieve IWMReaderCallbackAdvanced interface, hr %#lx\n", hr); + allocator->callback = NULL; + } + + *out = &allocator->IWMReaderAllocatorEx_iface; + return S_OK; +} + static REFERENCE_TIME get_current_time(const struct async_reader *reader) { LARGE_INTEGER time; @@ -306,6 +426,10 @@ static void async_reader_close(struct async_reader *reader) free(op); } + if (reader->allocator) + IWMReaderAllocatorEx_Release(reader->allocator); + reader->allocator = NULL; + if (reader->callback_advanced) IWMReaderCallbackAdvanced_Release(reader->callback_advanced); reader->callback_advanced = NULL; @@ -323,6 +447,9 @@ static HRESULT async_reader_open(struct async_reader *reader, IWMReaderCallback IWMReaderCallback_AddRef((reader->callback = callback)); reader->context = context; + if (FAILED(hr = allocator_create(reader->callback, &reader->allocator))) + goto error; + if (FAILED(hr = IWMReaderCallback_QueryInterface(callback, &IID_IWMReaderCallbackAdvanced, (void **)&reader->callback_advanced))) {
1
0
0
0
Rémi Bernon : winegstreamer: Reorder video format struct in wg_format.
by Alexandre Julliard
12 Oct '22
12 Oct '22
Module: wine Branch: master Commit: c185b5a9660140da6716362698cc8b669690d8ac URL:
https://gitlab.winehq.org/wine/wine/-/commit/c185b5a9660140da6716362698cc8b…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Mon Sep 26 12:44:08 2022 +0200 winegstreamer: Reorder video format struct in wg_format. --- dlls/winegstreamer/unixlib.h | 57 ++++++++++++++++++++++---------------------- 1 file changed, 29 insertions(+), 28 deletions(-) diff --git a/dlls/winegstreamer/unixlib.h b/dlls/winegstreamer/unixlib.h index 07f2962f755..8e6c5e4cc0e 100644 --- a/dlls/winegstreamer/unixlib.h +++ b/dlls/winegstreamer/unixlib.h @@ -34,41 +34,17 @@ struct wg_format { enum wg_major_type { - WG_MAJOR_TYPE_UNKNOWN, - WG_MAJOR_TYPE_VIDEO, - WG_MAJOR_TYPE_VIDEO_CINEPAK, - WG_MAJOR_TYPE_VIDEO_H264, + WG_MAJOR_TYPE_UNKNOWN = 0, WG_MAJOR_TYPE_AUDIO, WG_MAJOR_TYPE_AUDIO_MPEG1, WG_MAJOR_TYPE_AUDIO_WMA, + WG_MAJOR_TYPE_VIDEO, + WG_MAJOR_TYPE_VIDEO_CINEPAK, + WG_MAJOR_TYPE_VIDEO_H264, } major_type; union { - struct - { - enum wg_video_format - { - WG_VIDEO_FORMAT_UNKNOWN, - - WG_VIDEO_FORMAT_BGRA, - WG_VIDEO_FORMAT_BGRx, - WG_VIDEO_FORMAT_BGR, - WG_VIDEO_FORMAT_RGB15, - WG_VIDEO_FORMAT_RGB16, - - WG_VIDEO_FORMAT_AYUV, - WG_VIDEO_FORMAT_I420, - WG_VIDEO_FORMAT_NV12, - WG_VIDEO_FORMAT_UYVY, - WG_VIDEO_FORMAT_YUY2, - WG_VIDEO_FORMAT_YV12, - WG_VIDEO_FORMAT_YVYU, - } format; - int32_t width, height; - uint32_t fps_n, fps_d; - RECT padding; - } video; struct { enum wg_audio_format @@ -104,6 +80,31 @@ struct wg_format uint32_t codec_data_len; unsigned char codec_data[64]; } audio_wma; + + struct + { + enum wg_video_format + { + WG_VIDEO_FORMAT_UNKNOWN, + + WG_VIDEO_FORMAT_BGRA, + WG_VIDEO_FORMAT_BGRx, + WG_VIDEO_FORMAT_BGR, + WG_VIDEO_FORMAT_RGB15, + WG_VIDEO_FORMAT_RGB16, + + WG_VIDEO_FORMAT_AYUV, + WG_VIDEO_FORMAT_I420, + WG_VIDEO_FORMAT_NV12, + WG_VIDEO_FORMAT_UYVY, + WG_VIDEO_FORMAT_YUY2, + WG_VIDEO_FORMAT_YV12, + WG_VIDEO_FORMAT_YVYU, + } format; + int32_t width, height; + uint32_t fps_n, fps_d; + RECT padding; + } video; struct { uint32_t width;
1
0
0
0
Rémi Bernon : winegstreamer: Rename WG_MAJOR_TYPE_H264 to WG_MAJOR_TYPE_VIDEO_H264.
by Alexandre Julliard
12 Oct '22
12 Oct '22
Module: wine Branch: master Commit: 4af606298604c51b772bbf16641fa7d0837c743d URL:
https://gitlab.winehq.org/wine/wine/-/commit/4af606298604c51b772bbf16641fa7…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Mon Sep 26 12:41:18 2022 +0200 winegstreamer: Rename WG_MAJOR_TYPE_H264 to WG_MAJOR_TYPE_VIDEO_H264. --- dlls/winegstreamer/h264_decoder.c | 2 +- dlls/winegstreamer/mfplat.c | 24 ++++++++++++------------ dlls/winegstreamer/quartz_parser.c | 4 ++-- dlls/winegstreamer/unixlib.h | 4 ++-- dlls/winegstreamer/wg_format.c | 28 ++++++++++++++-------------- dlls/winegstreamer/wg_transform.c | 4 ++-- dlls/winegstreamer/wm_reader.c | 8 ++++---- 7 files changed, 37 insertions(+), 37 deletions(-)
1
0
0
0
Rémi Bernon : winegstreamer: Rename WG_MAJOR_TYPE_WMA to WG_MAJOR_TYPE_AUDIO_WMA.
by Alexandre Julliard
12 Oct '22
12 Oct '22
Module: wine Branch: master Commit: 725b696a5d528d785239040c3388d02018d2105a URL:
https://gitlab.winehq.org/wine/wine/-/commit/725b696a5d528d785239040c3388d0…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Mon Sep 26 12:40:23 2022 +0200 winegstreamer: Rename WG_MAJOR_TYPE_WMA to WG_MAJOR_TYPE_AUDIO_WMA. --- dlls/winegstreamer/mfplat.c | 24 +++++++++++----------- dlls/winegstreamer/quartz_parser.c | 4 ++-- dlls/winegstreamer/unixlib.h | 4 ++-- dlls/winegstreamer/wg_format.c | 42 +++++++++++++++++++------------------- dlls/winegstreamer/wg_transform.c | 4 ++-- dlls/winegstreamer/wm_reader.c | 8 ++++---- dlls/winegstreamer/wma_decoder.c | 2 +- 7 files changed, 44 insertions(+), 44 deletions(-)
1
0
0
0
Rémi Bernon : winegstreamer: Rename WG_MAJOR_TYPE_MPEG1_AUDIO to WG_MAJOR_TYPE_AUDIO_MPEG1.
by Alexandre Julliard
12 Oct '22
12 Oct '22
Module: wine Branch: master Commit: fdf29b814ccaa5707734c9451d29605e0d1b5524 URL:
https://gitlab.winehq.org/wine/wine/-/commit/fdf29b814ccaa5707734c9451d2960…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Mon Sep 26 12:36:49 2022 +0200 winegstreamer: Rename WG_MAJOR_TYPE_MPEG1_AUDIO to WG_MAJOR_TYPE_AUDIO_MPEG1. --- dlls/winegstreamer/mfplat.c | 2 +- dlls/winegstreamer/quartz_parser.c | 40 +++++++++++++++++------------------ dlls/winegstreamer/quartz_transform.c | 4 ++-- dlls/winegstreamer/unixlib.h | 4 ++-- dlls/winegstreamer/wg_format.c | 22 +++++++++---------- dlls/winegstreamer/wg_transform.c | 4 ++-- dlls/winegstreamer/wm_reader.c | 8 +++---- 7 files changed, 42 insertions(+), 42 deletions(-)
1
0
0
0
Rémi Bernon : winegstreamer: Move CINEPAK encoded format to a separate major type.
by Alexandre Julliard
12 Oct '22
12 Oct '22
Module: wine Branch: master Commit: b5916adfb6596b3a49055a44cae5525d1715e3f8 URL:
https://gitlab.winehq.org/wine/wine/-/commit/b5916adfb6596b3a49055a44cae552…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Mon Sep 26 12:19:55 2022 +0200 winegstreamer: Move CINEPAK encoded format to a separate major type. --- dlls/winegstreamer/mfplat.c | 1 + dlls/winegstreamer/quartz_parser.c | 49 ++++++++++++++++++++++++++++++-------- dlls/winegstreamer/unixlib.h | 10 ++++++-- dlls/winegstreamer/wg_format.c | 35 ++++++++++++++++++++++----- dlls/winegstreamer/wg_parser.c | 1 - dlls/winegstreamer/wg_transform.c | 2 ++ dlls/winegstreamer/wm_reader.c | 4 ++++ 7 files changed, 83 insertions(+), 19 deletions(-)
1
0
0
0
Brendan Shanks : kernel32: Remove shared heap functionality.
by Alexandre Julliard
12 Oct '22
12 Oct '22
Module: wine Branch: master Commit: 9150071b34a666d6618794f13760c5bcab1a033e URL:
https://gitlab.winehq.org/wine/wine/-/commit/9150071b34a666d6618794f13760c5…
Author: Brendan Shanks <bshanks(a)codeweavers.com> Date: Tue Oct 11 13:50:34 2022 -0700 kernel32: Remove shared heap functionality. --- dlls/kernel32/heap.c | 66 ++-------------------------------------------------- 1 file changed, 2 insertions(+), 64 deletions(-) diff --git a/dlls/kernel32/heap.c b/dlls/kernel32/heap.c index a2910688e44..1c1e6b05f25 100644 --- a/dlls/kernel32/heap.c +++ b/dlls/kernel32/heap.c @@ -41,57 +41,9 @@ WINE_DEFAULT_DEBUG_CHANNEL(globalmem); -/* address where we try to map the system heap */ -#define SYSTEM_HEAP_BASE ((void*)0x80000000) -#define SYSTEM_HEAP_SIZE 0x1000000 /* Default heap size = 16Mb */ - -static HANDLE systemHeap; /* globally shared heap */ - BOOLEAN WINAPI RtlGetUserInfoHeap( HANDLE handle, ULONG flags, void *ptr, void **user_value, ULONG *user_flags ); BOOLEAN WINAPI RtlSetUserValueHeap( HANDLE handle, ULONG flags, void *ptr, void *user_value ); -/*********************************************************************** - * HEAP_CreateSystemHeap - * - * Create the system heap. - */ -static inline HANDLE HEAP_CreateSystemHeap(void) -{ - int created; - void *base; - HANDLE map, event; - - /* create the system heap event first */ - event = CreateEventA( NULL, TRUE, FALSE, "__wine_system_heap_event" ); - - if (!(map = CreateFileMappingA( INVALID_HANDLE_VALUE, NULL, SEC_COMMIT | PAGE_READWRITE, - 0, SYSTEM_HEAP_SIZE, "__wine_system_heap" ))) return 0; - created = (GetLastError() != ERROR_ALREADY_EXISTS); - - if (!(base = MapViewOfFileEx( map, FILE_MAP_ALL_ACCESS, 0, 0, 0, SYSTEM_HEAP_BASE ))) - { - /* pre-defined address not available */ - ERR( "system heap base address %p not available\n", SYSTEM_HEAP_BASE ); - return 0; - } - - if (created) /* newly created heap */ - { - systemHeap = RtlCreateHeap( HEAP_SHARED, base, SYSTEM_HEAP_SIZE, - SYSTEM_HEAP_SIZE, NULL, NULL ); - SetEvent( event ); - } - else - { - /* wait for the heap to be initialized */ - WaitForSingleObject( event, INFINITE ); - systemHeap = base; - } - CloseHandle( map ); - return systemHeap; -} - - /*********************************************************************** * HeapCreate (KERNEL32.@) * @@ -108,17 +60,8 @@ HANDLE WINAPI HeapCreate( ) { HANDLE ret; - if ( flags & HEAP_SHARED ) - { - if (!systemHeap) HEAP_CreateSystemHeap(); - else WARN( "Shared Heap requested, returning system heap.\n" ); - ret = systemHeap; - } - else - { - ret = RtlCreateHeap( flags, NULL, maxSize, initialSize, NULL, NULL ); - if (!ret) SetLastError( ERROR_NOT_ENOUGH_MEMORY ); - } + ret = RtlCreateHeap( flags, NULL, maxSize, initialSize, NULL, NULL ); + if (!ret) SetLastError( ERROR_NOT_ENOUGH_MEMORY ); return ret; } @@ -134,11 +77,6 @@ HANDLE WINAPI HeapCreate( */ BOOL WINAPI HeapDestroy( HANDLE heap /* [in] Handle of heap */ ) { - if (heap == systemHeap) - { - WARN( "attempt to destroy system heap, returning TRUE!\n" ); - return TRUE; - } if (!RtlDestroyHeap( heap )) return TRUE; SetLastError( ERROR_INVALID_HANDLE ); return FALSE;
1
0
0
0
Brendan Shanks : ntdll: Remove shared heap functionality.
by Alexandre Julliard
12 Oct '22
12 Oct '22
Module: wine Branch: master Commit: 40c7cb0bcd4213e278d95401e733392988ad59a2 URL:
https://gitlab.winehq.org/wine/wine/-/commit/40c7cb0bcd4213e278d95401e73339…
Author: Brendan Shanks <bshanks(a)codeweavers.com> Date: Tue Oct 11 14:55:01 2022 -0700 ntdll: Remove shared heap functionality. --- dlls/ntdll/heap.c | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/dlls/ntdll/heap.c b/dlls/ntdll/heap.c index ef91096f258..8530bdf223f 100644 --- a/dlls/ntdll/heap.c +++ b/dlls/ntdll/heap.c @@ -186,7 +186,6 @@ struct heap DWORD force_flags; /* 0044/0074 */ /* end of the Windows 10 compatible struct layout */ - BOOL shared; /* System shared heap */ struct list entry; /* Entry in process heap list */ struct list subheap_list; /* Sub-heap list */ struct list large_list; /* Large blocks list */ @@ -753,7 +752,7 @@ static void free_used_block( struct heap *heap, SUBHEAP *subheap, struct block * list_remove( &subheap->entry ); NtFreeVirtualMemory( NtCurrentProcess(), &addr, &size, MEM_RELEASE ); } - else if (!heap->shared) + else { /* keep room for a full committed block as hysteresis */ subheap_decommit( heap, subheap, (char *)(entry + 1) + (COMMIT_MASK + 1) ); @@ -921,7 +920,6 @@ static SUBHEAP *HEAP_CreateSubHeap( struct heap **heap_ptr, LPVOID address, DWOR if (!commitSize) commitSize = COMMIT_MASK + 1; totalSize = min( totalSize, 0xffff0000 ); /* don't allow a heap larger than 4GB */ if (totalSize < commitSize) totalSize = commitSize; - if (flags & HEAP_SHARED) commitSize = totalSize; /* always commit everything in a shared heap */ commitSize = min( totalSize, (commitSize + COMMIT_MASK) & ~COMMIT_MASK ); /* allocate the memory block */ @@ -955,7 +953,6 @@ static SUBHEAP *HEAP_CreateSubHeap( struct heap **heap_ptr, LPVOID address, DWOR heap->ffeeffee = 0xffeeffee; heap->auto_flags = (flags & HEAP_GROWABLE); heap->flags = (flags & ~HEAP_SHARED); - heap->shared = (flags & HEAP_SHARED) != 0; heap->magic = HEAP_MAGIC; heap->grow_size = max( HEAP_DEF_SIZE, totalSize ); heap->min_size = commitSize; @@ -993,19 +990,6 @@ static SUBHEAP *HEAP_CreateSubHeap( struct heap **heap_ptr, LPVOID address, DWOR RtlInitializeCriticalSection( &heap->cs ); heap->cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": heap.cs"); } - - if (heap->shared) - { - /* let's assume that only one thread at a time will try to do this */ - HANDLE sem = heap->cs.LockSemaphore; - if (!sem) NtCreateSemaphore( &sem, SEMAPHORE_ALL_ACCESS, NULL, 0, 1 ); - - NtDuplicateObject( NtCurrentProcess(), sem, NtCurrentProcess(), &sem, 0, 0, - DUPLICATE_MAKE_GLOBAL | DUPLICATE_SAME_ACCESS | DUPLICATE_CLOSE_SOURCE ); - heap->cs.LockSemaphore = sem; - RtlFreeHeap( process_heap, 0, heap->cs.DebugInfo ); - heap->cs.DebugInfo = NULL; - } } block_size = subheap_size( subheap ) - subheap_overhead( subheap );
1
0
0
0
Connor McAdams : uiautomationcore: Add UIAutomationType_Element property support for nested node providers.
by Alexandre Julliard
12 Oct '22
12 Oct '22
Module: wine Branch: master Commit: a6f428fae6313107c34fb7e43c26d1e602bd0a3d URL:
https://gitlab.winehq.org/wine/wine/-/commit/a6f428fae6313107c34fb7e43c26d1…
Author: Connor McAdams <cmcadams(a)codeweavers.com> Date: Wed Oct 5 17:04:14 2022 -0400 uiautomationcore: Add UIAutomationType_Element property support for nested node providers. Signed-off-by: Connor McAdams <cmcadams(a)codeweavers.com> --- dlls/uiautomationcore/tests/uiautomation.c | 214 ++++++++++++++--------------- dlls/uiautomationcore/uia_client.c | 93 ++++++++++--- dlls/uiautomationcore/uia_private.h | 14 ++ dlls/uiautomationcore/uia_provider.c | 5 +- 4 files changed, 194 insertions(+), 132 deletions(-)
1
0
0
0
Connor McAdams : uiautomationcore: Store provider thread nodes that have a runtime ID in an rbtree.
by Alexandre Julliard
12 Oct '22
12 Oct '22
Module: wine Branch: master Commit: 5d3e444b1cbdbbeeef2b6b7b6508b0ca3dbbd9c1 URL:
https://gitlab.winehq.org/wine/wine/-/commit/5d3e444b1cbdbbeeef2b6b7b6508b0…
Author: Connor McAdams <cmcadams(a)codeweavers.com> Date: Mon Oct 10 14:27:35 2022 -0400 uiautomationcore: Store provider thread nodes that have a runtime ID in an rbtree. Signed-off-by: Connor McAdams <cmcadams(a)codeweavers.com> --- dlls/uiautomationcore/uia_client.c | 2 + dlls/uiautomationcore/uia_private.h | 4 +- dlls/uiautomationcore/uia_provider.c | 99 ++++++++++++++++++++++++++++++------ 3 files changed, 87 insertions(+), 18 deletions(-) diff --git a/dlls/uiautomationcore/uia_client.c b/dlls/uiautomationcore/uia_client.c index 2d97ff13159..24de251eb8a 100644 --- a/dlls/uiautomationcore/uia_client.c +++ b/dlls/uiautomationcore/uia_client.c @@ -851,6 +851,7 @@ HRESULT WINAPI UiaNodeFromProvider(IRawElementProviderSimple *elprov, HUIANODE * node->IWineUiaNode_iface.lpVtbl = &uia_node_vtbl; list_init(&node->prov_thread_list_entry); + list_init(&node->node_map_list_entry); node->ref = 1; *huianode = (void *)&node->IWineUiaNode_iface; @@ -1228,6 +1229,7 @@ HRESULT WINAPI UiaNodeFromHandle(HWND hwnd, HUIANODE *huianode) node->hwnd = hwnd; node->IWineUiaNode_iface.lpVtbl = &uia_node_vtbl; list_init(&node->prov_thread_list_entry); + list_init(&node->node_map_list_entry); node->ref = 1; hr = uia_get_provider_from_hwnd(node); diff --git a/dlls/uiautomationcore/uia_private.h b/dlls/uiautomationcore/uia_private.h index c4512ecd046..c94f2b6c1eb 100644 --- a/dlls/uiautomationcore/uia_private.h +++ b/dlls/uiautomationcore/uia_private.h @@ -40,9 +40,9 @@ struct uia_node { HWND hwnd; BOOL nested_node; BOOL disconnected; - /* This RuntimeId is used as a comparison for UiaDisconnectProvider(). */ - SAFEARRAY *runtime_id; struct list prov_thread_list_entry; + struct list node_map_list_entry; + struct uia_provider_thread_map_entry *map; }; static inline struct uia_node *impl_from_IWineUiaNode(IWineUiaNode *iface) diff --git a/dlls/uiautomationcore/uia_provider.c b/dlls/uiautomationcore/uia_provider.c index 76eea75f855..17adf622ffe 100644 --- a/dlls/uiautomationcore/uia_provider.c +++ b/dlls/uiautomationcore/uia_provider.c @@ -21,6 +21,7 @@ #include "wine/debug.h" #include "wine/heap.h" +#include "wine/rbtree.h" #include "initguid.h" #include "wine/iaccessible2.h" @@ -1130,6 +1131,7 @@ HRESULT WINAPI UiaProviderFromIAccessible(IAccessible *acc, long child_id, DWORD */ struct uia_provider_thread { + struct rb_tree node_map; struct list nodes_list; HANDLE hthread; HWND hwnd; @@ -1146,6 +1148,20 @@ static CRITICAL_SECTION_DEBUG provider_thread_cs_debug = }; static CRITICAL_SECTION provider_thread_cs = { &provider_thread_cs_debug, -1, 0, 0, 0, 0 }; +struct uia_provider_thread_map_entry +{ + struct rb_entry entry; + + SAFEARRAY *runtime_id; + struct list nodes_list; +}; + +static int uia_runtime_id_compare(const void *key, const struct rb_entry *entry) +{ + struct uia_provider_thread_map_entry *prov_entry = RB_ENTRY_VALUE(entry, struct uia_provider_thread_map_entry, entry); + return uia_compare_runtime_ids(prov_entry->runtime_id, (SAFEARRAY *)key); +} + void uia_provider_thread_remove_node(HUIANODE node) { struct uia_node *node_data = impl_from_IWineUiaNode((IWineUiaNode *)node); @@ -1153,17 +1169,28 @@ void uia_provider_thread_remove_node(HUIANODE node) TRACE("Removing node %p\n", node); EnterCriticalSection(&provider_thread_cs); + list_remove(&node_data->prov_thread_list_entry); list_init(&node_data->prov_thread_list_entry); - SafeArrayDestroy(node_data->runtime_id); - node_data->runtime_id = NULL; + if (!list_empty(&node_data->node_map_list_entry)) + { + list_remove(&node_data->node_map_list_entry); + list_init(&node_data->node_map_list_entry); + if (list_empty(&node_data->map->nodes_list)) + { + rb_remove(&provider_thread.node_map, &node_data->map->entry); + SafeArrayDestroy(node_data->map->runtime_id); + heap_free(node_data->map); + } + node_data->map = NULL; + } + LeaveCriticalSection(&provider_thread_cs); } static void uia_provider_thread_disconnect_node(SAFEARRAY *sa) { - struct list *cursor, *cursor2; - struct uia_node *node_data; + struct rb_entry *rb_entry; EnterCriticalSection(&provider_thread_cs); @@ -1171,21 +1198,30 @@ static void uia_provider_thread_disconnect_node(SAFEARRAY *sa) if (!provider_thread.ref) goto exit; - LIST_FOR_EACH_SAFE(cursor, cursor2, &provider_thread.nodes_list) + rb_entry = rb_get(&provider_thread.node_map, sa); + if (rb_entry) { - node_data = LIST_ENTRY(cursor, struct uia_node, prov_thread_list_entry); + struct uia_provider_thread_map_entry *prov_map; + struct list *cursor, *cursor2; + struct uia_node *node_data; - if (node_data->runtime_id) + prov_map = RB_ENTRY_VALUE(rb_entry, struct uia_provider_thread_map_entry, entry); + LIST_FOR_EACH_SAFE(cursor, cursor2, &prov_map->nodes_list) { - if (!uia_compare_runtime_ids(sa, node_data->runtime_id)) - { - list_remove(cursor); - list_init(&node_data->prov_thread_list_entry); - IWineUiaNode_disconnect(&node_data->IWineUiaNode_iface); - SafeArrayDestroy(node_data->runtime_id); - node_data->runtime_id = NULL; - } + node_data = LIST_ENTRY(cursor, struct uia_node, node_map_list_entry); + + list_remove(cursor); + list_remove(&node_data->prov_thread_list_entry); + list_init(&node_data->prov_thread_list_entry); + list_init(&node_data->node_map_list_entry); + node_data->map = NULL; + + IWineUiaNode_disconnect(&node_data->IWineUiaNode_iface); } + + rb_remove(&provider_thread.node_map, &prov_map->entry); + SafeArrayDestroy(prov_map->runtime_id); + heap_free(prov_map); } exit: @@ -1206,8 +1242,38 @@ static HRESULT uia_provider_thread_add_node(HUIANODE node) TRACE("Adding node %p\n", node); EnterCriticalSection(&provider_thread_cs); - node_data->runtime_id = sa; list_add_tail(&provider_thread.nodes_list, &node_data->prov_thread_list_entry); + + /* If we have a runtime ID, create an entry in the rb tree. */ + if (sa) + { + struct uia_provider_thread_map_entry *prov_map; + struct rb_entry *rb_entry; + + if ((rb_entry = rb_get(&provider_thread.node_map, sa))) + { + prov_map = RB_ENTRY_VALUE(rb_entry, struct uia_provider_thread_map_entry, entry); + SafeArrayDestroy(sa); + } + else + { + prov_map = heap_alloc_zero(sizeof(*prov_map)); + if (!prov_map) + { + SafeArrayDestroy(sa); + LeaveCriticalSection(&provider_thread_cs); + return E_OUTOFMEMORY; + } + + prov_map->runtime_id = sa; + list_init(&prov_map->nodes_list); + rb_put(&provider_thread.node_map, sa, &prov_map->entry); + } + + list_add_tail(&prov_map->nodes_list, &node_data->node_map_list_entry); + node_data->map = prov_map; + } + LeaveCriticalSection(&provider_thread_cs); return S_OK; @@ -1311,6 +1377,7 @@ static BOOL uia_start_provider_thread(void) (const WCHAR *)uia_start_provider_thread, &hmodule); list_init(&provider_thread.nodes_list); + rb_init(&provider_thread.node_map, uia_runtime_id_compare); events[0] = ready_event = CreateEventW(NULL, FALSE, FALSE, NULL); if (!(provider_thread.hthread = CreateThread(NULL, 0, uia_provider_thread_proc, ready_event, 0, NULL)))
1
0
0
0
← Newer
1
...
6
7
8
9
10
11
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
Results per page:
10
25
50
100
200