winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
October 2022
----- 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
← Newer
1
...
38
39
40
41
42
43
44
...
54
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
Results per page:
10
25
50
100
200