winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
June 2021
----- 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
811 discussions
Start a n
N
ew thread
Huw Davies : iphlpapi: For unknown interface types set the physical address length to zero.
by Alexandre Julliard
30 Jun '21
30 Jun '21
Module: wine Branch: master Commit: ed79dd2125d306405b9486a5ae64092567c70634 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=ed79dd2125d306405b9486a5…
Author: Huw Davies <huw(a)codeweavers.com> Date: Wed Jun 30 09:59:23 2021 +0100 iphlpapi: For unknown interface types set the physical address length to zero. Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/iphlpapi/ifenum.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/iphlpapi/ifenum.c b/dlls/iphlpapi/ifenum.c index 2e99ebe03fd..3b4ac775db7 100644 --- a/dlls/iphlpapi/ifenum.c +++ b/dlls/iphlpapi/ifenum.c @@ -498,7 +498,7 @@ static DWORD getInterfacePhysicalByName(const char *name, PDWORD len, PBYTE addr break; #endif default: - addrLen = min(MAX_INTERFACE_PHYSADDR, sizeof(ifr.ifr_hwaddr.sa_data)); + addrLen = 0; *type = MIB_IF_TYPE_OTHER; } if (addrLen > *len) {
1
0
0
0
Huw Davies : iphlpapi: Fill out a few more MIB_IF_ROW2 entries.
by Alexandre Julliard
30 Jun '21
30 Jun '21
Module: wine Branch: master Commit: c8bfc8d64f5f3cd5ae926baf1fa9e66b0aef1e74 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=c8bfc8d64f5f3cd5ae926baf…
Author: Huw Davies <huw(a)codeweavers.com> Date: Wed Jun 30 09:59:22 2021 +0100 iphlpapi: Fill out a few more MIB_IF_ROW2 entries. Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/iphlpapi/iphlpapi_main.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/dlls/iphlpapi/iphlpapi_main.c b/dlls/iphlpapi/iphlpapi_main.c index 21edd9ee128..7b104330ba7 100644 --- a/dlls/iphlpapi/iphlpapi_main.c +++ b/dlls/iphlpapi/iphlpapi_main.c @@ -1781,7 +1781,7 @@ DWORD WINAPI GetIfEntry(PMIB_IFROW pIfRow) */ DWORD WINAPI GetIfEntry2( MIB_IF_ROW2 *row2 ) { - DWORD ret, len = ARRAY_SIZE(row2->Description); + DWORD ret; char buf[MAX_ADAPTER_NAME], *name; MIB_IFROW row; @@ -1803,14 +1803,19 @@ DWORD WINAPI GetIfEntry2( MIB_IF_ROW2 *row2 ) ConvertInterfaceLuidToGuid( &row2->InterfaceLuid, &row2->InterfaceGuid ); row2->Type = row.dwType; row2->Mtu = row.dwMtu; - MultiByteToWideChar( CP_UNIXCP, 0, (const char *)row.bDescr, -1, row2->Description, len ); + MultiByteToWideChar( CP_UNIXCP, 0, (const char *)row.bDescr, -1, row2->Description, ARRAY_SIZE(row2->Description) ); + MultiByteToWideChar( CP_UNIXCP, 0, (const char *)row.bDescr, -1, row2->Alias, ARRAY_SIZE(row2->Alias) ); row2->PhysicalAddressLength = row.dwPhysAddrLen; memcpy( &row2->PhysicalAddress, &row.bPhysAddr, row.dwPhysAddrLen ); memcpy( &row2->PermanentPhysicalAddress, &row.bPhysAddr, row.dwPhysAddrLen ); - row2->OperStatus = IfOperStatusUp; + row2->OperStatus = row.dwOperStatus == MIB_IF_OPER_STATUS_OPERATIONAL ? IfOperStatusUp : IfOperStatusDown; row2->AdminStatus = NET_IF_ADMIN_STATUS_UP; row2->MediaConnectState = MediaConnectStateConnected; row2->ConnectionType = NET_IF_CONNECTION_DEDICATED; + row2->TransmitLinkSpeed = row2->ReceiveLinkSpeed = row.dwSpeed; + row2->AccessType = (row2->Type == MIB_IF_TYPE_LOOPBACK) ? NET_IF_ACCESS_LOOPBACK : NET_IF_ACCESS_BROADCAST; + row2->InterfaceAndOperStatusFlags.ConnectorPresent = row2->Type != MIB_IF_TYPE_LOOPBACK; + row2->InterfaceAndOperStatusFlags.HardwareInterface = row2->Type != MIB_IF_TYPE_LOOPBACK; /* stats */ row2->InOctets = row.dwInOctets;
1
0
0
0
Alexandre Julliard : configure: Disable nsiproxy.sys for the Windows build.
by Alexandre Julliard
30 Jun '21
30 Jun '21
Module: wine Branch: master Commit: 9a7bf63bb2f1df5a9cfb65eb0bb4dd24297fd87a URL:
https://source.winehq.org/git/wine.git/?a=commit;h=9a7bf63bb2f1df5a9cfb65eb…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Jun 30 20:01:00 2021 +0200 configure: Disable nsiproxy.sys for the Windows build. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- configure | 1 + configure.ac | 1 + 2 files changed, 2 insertions(+) diff --git a/configure b/configure index 25089c31e18..14c9dd2ff7d 100755 --- a/configure +++ b/configure @@ -8345,6 +8345,7 @@ if test "x$ac_cv_cflags__Wl___disable_stdcall_fixup" = xyes; then : fi ;; esac enable_iphlpapi=${enable_iphlpapi:-no} + enable_nsiproxy_sys=${enable_nsiproxy_sys:-no} enable_ws2_32=${enable_ws2_32:-no} enable_loader=${enable_loader:-no} enable_server=${enable_server:-no} diff --git a/configure.ac b/configure.ac index 5c4f0c8a6cb..09c58aaff28 100644 --- a/configure.ac +++ b/configure.ac @@ -735,6 +735,7 @@ case $host_os in esac dnl Disable modules that can't be used on Windows enable_iphlpapi=${enable_iphlpapi:-no} + enable_nsiproxy_sys=${enable_nsiproxy_sys:-no} enable_ws2_32=${enable_ws2_32:-no} enable_loader=${enable_loader:-no} enable_server=${enable_server:-no}
1
0
0
0
Zebediah Figura : server: Create linked tokens as impersonation tokens.
by Alexandre Julliard
30 Jun '21
30 Jun '21
Module: wine Branch: master Commit: 4cca8b67d03d33a2c2edda4c3a825a36c2f5c286 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=4cca8b67d03d33a2c2edda4c…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Wed Jun 30 00:01:06 2021 -0500 server: Create linked tokens as impersonation tokens. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=51347
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/advapi32/tests/security.c | 4 ++-- server/process.c | 2 +- server/security.h | 2 +- server/token.c | 8 ++++---- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c index d39aaba7323..d32bf27bd83 100644 --- a/dlls/advapi32/tests/security.c +++ b/dlls/advapi32/tests/security.c @@ -8202,9 +8202,9 @@ static void test_elevation(void) ok(elevation.TokenIsElevated == FALSE, "got elevation %#x\n", elevation.TokenIsElevated); ret = GetTokenInformation(linked.LinkedToken, TokenType, &type, sizeof(type), &size); ok(ret, "got error %u\n", GetLastError()); - todo_wine ok(type == TokenImpersonation, "got type %#x\n", type); + ok(type == TokenImpersonation, "got type %#x\n", type); ret = GetTokenInformation(linked.LinkedToken, TokenImpersonationLevel, &type, sizeof(type), &size); - todo_wine ok(ret, "got error %u\n", GetLastError()); + ok(ret, "got error %u\n", GetLastError()); ok(type == SecurityIdentification, "got impersonation level %#x\n", type); /* Asking for the linked token again gives us a different token. */ diff --git a/server/process.c b/server/process.c index 24b7abb49d5..9288bcc27d5 100644 --- a/server/process.c +++ b/server/process.c @@ -664,7 +664,7 @@ struct process *create_process( int fd, struct process *parent, unsigned int fla if (!parent) { process->handles = alloc_handle_table( process, 0 ); - process->token = token_create_admin( TokenElevationTypeFull ); + process->token = token_create_admin( TRUE, -1, TokenElevationTypeFull ); process->affinity = ~0; } else diff --git a/server/security.h b/server/security.h index 416e1b6902d..f7e644aa1b7 100644 --- a/server/security.h +++ b/server/security.h @@ -54,7 +54,7 @@ extern const PSID security_high_label_sid; /* token functions */ extern struct token *get_token_obj( struct process *process, obj_handle_t handle, unsigned int access ); -extern struct token *token_create_admin( int elevation ); +extern struct token *token_create_admin( unsigned primary, int impersonation_level, int elevation ); extern int token_assign_label( struct token *token, PSID label ); extern struct token *token_duplicate( struct token *src_token, unsigned primary, int impersonation_level, const struct security_descriptor *sd, diff --git a/server/token.c b/server/token.c index ad5d7cda323..fed7d93753e 100644 --- a/server/token.c +++ b/server/token.c @@ -830,7 +830,7 @@ struct token *get_token_obj( struct process *process, obj_handle_t handle, unsig return (struct token *)get_handle_obj( process, handle, access, &token_ops ); } -struct token *token_create_admin( int elevation ) +struct token *token_create_admin( unsigned primary, int impersonation_level, int elevation ) { struct token *token = NULL; static const SID_IDENTIFIER_AUTHORITY nt_authority = { SECURITY_NT_AUTHORITY }; @@ -890,9 +890,9 @@ struct token *token_create_admin( int elevation ) { logon_sid, SE_GROUP_ENABLED|SE_GROUP_ENABLED_BY_DEFAULT|SE_GROUP_MANDATORY|SE_GROUP_LOGON_ID }, }; static const TOKEN_SOURCE admin_source = {"SeMgr", {0, 0}}; - token = create_token( TRUE, user_sid, admin_groups, ARRAY_SIZE( admin_groups ), + token = create_token( primary, user_sid, admin_groups, ARRAY_SIZE( admin_groups ), admin_privs, ARRAY_SIZE( admin_privs ), default_dacl, - admin_source, NULL, -1, elevation ); + admin_source, NULL, impersonation_level, elevation ); /* we really need a primary group */ assert( token->primary_group ); } @@ -1669,7 +1669,7 @@ DECL_HANDLER(create_linked_token) release_object( token ); return; } - if ((linked = token_create_admin( elevation ))) + if ((linked = token_create_admin( FALSE, SecurityIdentification, elevation ))) { reply->linked = alloc_handle( current->process, linked, TOKEN_ALL_ACCESS, 0 ); release_object( linked );
1
0
0
0
Zebediah Figura : advapi32/tests: Test the type and impersonation level of a linked token.
by Alexandre Julliard
30 Jun '21
30 Jun '21
Module: wine Branch: master Commit: 2cbed066096794b06bcbecd7db9975c50605d176 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=2cbed066096794b06bcbecd7…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Wed Jun 30 00:01:05 2021 -0500 advapi32/tests: Test the type and impersonation level of a linked token. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/advapi32/tests/security.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c index 77748abe9ec..d39aaba7323 100644 --- a/dlls/advapi32/tests/security.c +++ b/dlls/advapi32/tests/security.c @@ -8139,6 +8139,12 @@ static void test_elevation(void) ret = GetTokenInformation(linked.LinkedToken, TokenElevation, &elevation, sizeof(elevation), &size); ok(ret, "got error %u\n", GetLastError()); ok(elevation.TokenIsElevated == TRUE, "got elevation %#x\n", elevation.TokenIsElevated); + ret = GetTokenInformation(linked.LinkedToken, TokenType, &type, sizeof(type), &size); + ok(ret, "got error %u\n", GetLastError()); + ok(type == TokenImpersonation, "got type %#x\n", type); + ret = GetTokenInformation(linked.LinkedToken, TokenImpersonationLevel, &type, sizeof(type), &size); + ok(ret, "got error %u\n", GetLastError()); + ok(type == SecurityIdentification, "got impersonation level %#x\n", type); /* Asking for the linked token again gives us a different token. */ ret = GetTokenInformation(token, TokenLinkedToken, &linked2, sizeof(linked2), &size); @@ -8194,6 +8200,12 @@ static void test_elevation(void) ret = GetTokenInformation(linked.LinkedToken, TokenElevation, &elevation, sizeof(elevation), &size); ok(ret, "got error %u\n", GetLastError()); ok(elevation.TokenIsElevated == FALSE, "got elevation %#x\n", elevation.TokenIsElevated); + ret = GetTokenInformation(linked.LinkedToken, TokenType, &type, sizeof(type), &size); + ok(ret, "got error %u\n", GetLastError()); + todo_wine ok(type == TokenImpersonation, "got type %#x\n", type); + ret = GetTokenInformation(linked.LinkedToken, TokenImpersonationLevel, &type, sizeof(type), &size); + todo_wine ok(ret, "got error %u\n", GetLastError()); + ok(type == SecurityIdentification, "got impersonation level %#x\n", type); /* Asking for the linked token again gives us a different token. */ ret = GetTokenInformation(token, TokenLinkedToken, &linked2, sizeof(linked2), &size); @@ -8249,10 +8261,18 @@ static void test_elevation(void) ret = GetTokenInformation(token2, TokenLinkedToken, &linked, sizeof(linked), &size); ok(ret, "got error %u\n", GetLastError()); if (type == TokenElevationTypeDefault) + { ok(!linked.LinkedToken, "expected no linked token\n"); + ret = GetTokenInformation(linked.LinkedToken, TokenType, &type, sizeof(type), &size); + ok(ret, "got error %u\n", GetLastError()); + ok(type == TokenImpersonation, "got type %#x\n", type); + ret = GetTokenInformation(linked.LinkedToken, TokenImpersonationLevel, &type, sizeof(type), &size); + ok(ret, "got error %u\n", GetLastError()); + ok(type == SecurityIdentification, "got impersonation level %#x\n", type); + CloseHandle(linked.LinkedToken); + } else ok(!!linked.LinkedToken, "expected a linked token\n"); - CloseHandle(linked.LinkedToken); CloseHandle(token2); ret = CreateRestrictedToken(token, 0, 0, NULL, 0, NULL, 0, NULL, &token2);
1
0
0
0
Alexandre Julliard : ntdll: Implement RtlWow64GetCurrentCpuArea().
by Alexandre Julliard
30 Jun '21
30 Jun '21
Module: wine Branch: master Commit: 17716bc7f325e5f7606c74c0af8d425b98e60054 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=17716bc7f325e5f7606c74c0…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Jun 30 11:16:01 2021 +0200 ntdll: Implement RtlWow64GetCurrentCpuArea(). Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/ntdll.spec | 1 + dlls/ntdll/process.c | 18 ++++++++++++++++++ include/winternl.h | 1 + 3 files changed, 20 insertions(+) diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec index 0e1706f2dd2..42de54c895e 100644 --- a/dlls/ntdll/ntdll.spec +++ b/dlls/ntdll/ntdll.spec @@ -1075,6 +1075,7 @@ @ stdcall RtlWow64EnableFsRedirection(long) @ stdcall RtlWow64EnableFsRedirectionEx(long ptr) @ stdcall -arch=win64 RtlWow64GetCpuAreaInfo(ptr long ptr) +@ stdcall -arch=win64 RtlWow64GetCurrentCpuArea(ptr ptr ptr) @ stdcall RtlWow64GetCurrentMachine() @ stdcall RtlWow64GetProcessMachines(long ptr ptr) @ stdcall -arch=win64 RtlWow64GetThreadContext(long ptr) diff --git a/dlls/ntdll/process.c b/dlls/ntdll/process.c index 3ed31e22100..e8b7785ce31 100644 --- a/dlls/ntdll/process.c +++ b/dlls/ntdll/process.c @@ -143,6 +143,24 @@ NTSTATUS WINAPI RtlWow64GetCpuAreaInfo( WOW64_CPURESERVED *cpu, ULONG reserved, } +/********************************************************************** + * RtlWow64GetCurrentCpuArea (NTDLL.@) + */ +NTSTATUS WINAPI RtlWow64GetCurrentCpuArea( USHORT *machine, void **context, void **context_ex ) +{ + WOW64_CPU_AREA_INFO info; + NTSTATUS status; + + if (!(status = RtlWow64GetCpuAreaInfo( NtCurrentTeb()->TlsSlots[WOW64_TLS_CPURESERVED], 0, &info ))) + { + if (machine) *machine = info.Machine; + if (context) *context = info.Context; + if (context_ex) *context_ex = *(void **)info.ContextEx; + } + return status; +} + + /****************************************************************************** * RtlWow64GetThreadContext (NTDLL.@) */ diff --git a/include/winternl.h b/include/winternl.h index 71be1f5816d..b07a5465d86 100644 --- a/include/winternl.h +++ b/include/winternl.h @@ -4404,6 +4404,7 @@ NTSYSAPI int __cdecl _strnicmp(LPCSTR,LPCSTR,size_t); #ifdef _WIN64 NTSYSAPI NTSTATUS WINAPI RtlWow64GetCpuAreaInfo(WOW64_CPURESERVED*,ULONG,WOW64_CPU_AREA_INFO*); +NTSYSAPI NTSTATUS WINAPI RtlWow64GetCurrentCpuArea(USHORT*,void**,void**); NTSYSAPI NTSTATUS WINAPI RtlWow64GetThreadContext(HANDLE,WOW64_CONTEXT*); NTSYSAPI NTSTATUS WINAPI RtlWow64SetThreadContext(HANDLE,const WOW64_CONTEXT*); #else
1
0
0
0
Alexandre Julliard : ntdll/tests: Add tests for RtlWow64GetCurrentCpuArea().
by Alexandre Julliard
30 Jun '21
30 Jun '21
Module: wine Branch: master Commit: c9d23a15cef7c8508bc9b82a9247b10a12d4fb49 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=c9d23a15cef7c8508bc9b82a…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Jun 30 11:12:46 2021 +0200 ntdll/tests: Add tests for RtlWow64GetCurrentCpuArea(). Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/tests/wow64.c | 130 +++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 127 insertions(+), 3 deletions(-) diff --git a/dlls/ntdll/tests/wow64.c b/dlls/ntdll/tests/wow64.c index d31afa373e2..b7b63f3fd8c 100644 --- a/dlls/ntdll/tests/wow64.c +++ b/dlls/ntdll/tests/wow64.c @@ -34,6 +34,7 @@ static NTSTATUS (WINAPI *pNtWow64WriteVirtualMemory64)(HANDLE,ULONG64,const void #endif static BOOL is_wow64; +static void *code_mem; static void init(void) { @@ -54,6 +55,8 @@ static void init(void) GET_PROC( NtWow64WriteVirtualMemory64 ); #endif #undef GET_PROC + + code_mem = VirtualAlloc( NULL, 65536, MEM_RESERVE | MEM_COMMIT, PAGE_EXECUTE_READWRITE ); } static void test_process_architecture( HANDLE process, USHORT expect_machine, USHORT expect_native ) @@ -463,6 +466,52 @@ static void test_cpu_area(void) #else /* _WIN64 */ +static const BYTE call_func64_code[] = +{ + 0x58, /* pop %eax */ + 0x0e, /* push %cs */ + 0x50, /* push %eax */ + 0x6a, 0x33, /* push $0x33 */ + 0xe8, 0x00, 0x00, 0x00, 0x00, /* call 1f */ + 0x83, 0x04, 0x24, 0x05, /* 1: addl $0x5,(%esp) */ + 0xcb, /* lret */ + /* in 64-bit mode: */ + 0x4c, 0x87, 0xf4, /* xchg %r14,%rsp */ + 0x55, /* push %rbp */ + 0x48, 0x89, 0xe5, /* mov %rsp,%rbp */ + 0x56, /* push %rsi */ + 0x57, /* push %rdi */ + 0x41, 0x8b, 0x4e, 0x10, /* mov 0x10(%r14),%ecx */ + 0x41, 0x8b, 0x76, 0x14, /* mov 0x14(%r14),%esi */ + 0x67, 0x8d, 0x04, 0xcd, 0, 0, 0, 0, /* lea 0x0(,%ecx,8),%eax */ + 0x83, 0xf8, 0x20, /* cmp $0x20,%eax */ + 0x7d, 0x05, /* jge 1f */ + 0xb8, 0x20, 0x00, 0x00, 0x00, /* mov $0x20,%eax */ + 0x48, 0x29, 0xc4, /* 1: sub %rax,%rsp */ + 0x48, 0x83, 0xe4, 0xf0, /* and $~15,%rsp */ + 0x48, 0x89, 0xe7, /* mov %rsp,%rdi */ + 0xf3, 0x48, 0xa5, /* rep movsq */ + 0x48, 0x8b, 0x0c, 0x24, /* mov (%rsp),%rcx */ + 0x48, 0x8b, 0x54, 0x24, 0x08, /* mov 0x8(%rsp),%rdx */ + 0x4c, 0x8b, 0x44, 0x24, 0x10, /* mov 0x10(%rsp),%r8 */ + 0x4c, 0x8b, 0x4c, 0x24, 0x18, /* mov 0x18(%rsp),%r9 */ + 0x41, 0xff, 0x56, 0x08, /* callq *0x8(%r14) */ + 0x48, 0x8d, 0x65, 0xf0, /* lea -0x10(%rbp),%rsp */ + 0x5f, /* pop %rdi */ + 0x5e, /* pop %rsi */ + 0x5d, /* pop %rbp */ + 0x4c, 0x87, 0xf4, /* xchg %r14,%rsp */ + 0xcb, /* lret */ +}; + +static NTSTATUS call_func64( ULONG64 func64, int nb_args, ULONG64 *args ) +{ + NTSTATUS (WINAPI *func)( ULONG64 func64, int nb_args, ULONG64 *args ) = code_mem; + + memcpy( code_mem, call_func64_code, sizeof(call_func64_code) ); + return func( func64, nb_args, args ); +} + static ULONG64 main_module, ntdll_module, wow64_module, wow64cpu_module, wow64win_module; static void enum_modules64( void (*func)(ULONG64,const WCHAR *) ) @@ -514,6 +563,53 @@ done: NtClose( process ); } +static ULONG64 get_proc_address64( ULONG64 module, const char *name ) +{ + IMAGE_DOS_HEADER dos; + IMAGE_NT_HEADERS64 nt; + IMAGE_EXPORT_DIRECTORY exports; + ULONG i, *names, *funcs; + USHORT *ordinals; + NTSTATUS status; + HANDLE process; + ULONG64 ret = 0; + char buffer[64]; + + if (!module) return 0; + process = OpenProcess( PROCESS_ALL_ACCESS, FALSE, GetCurrentProcessId() ); + ok( process != 0, "failed to open current process %u\n", GetLastError() ); + status = pNtWow64ReadVirtualMemory64( process, module, &dos, sizeof(dos), NULL ); + ok( !status, "NtWow64ReadVirtualMemory64 failed %x\n", status ); + status = pNtWow64ReadVirtualMemory64( process, module + dos.e_lfanew, &nt, sizeof(nt), NULL ); + ok( !status, "NtWow64ReadVirtualMemory64 failed %x\n", status ); + status = pNtWow64ReadVirtualMemory64( process, module + nt.OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_EXPORT].VirtualAddress, + &exports, sizeof(exports), NULL ); + ok( !status, "NtWow64ReadVirtualMemory64 failed %x\n", status ); + names = calloc( exports.NumberOfNames, sizeof(*names) ); + ordinals = calloc( exports.NumberOfNames, sizeof(*ordinals) ); + funcs = calloc( exports.NumberOfFunctions, sizeof(*funcs) ); + status = pNtWow64ReadVirtualMemory64( process, module + exports.AddressOfNames, + names, exports.NumberOfNames * sizeof(*names), NULL ); + ok( !status, "NtWow64ReadVirtualMemory64 failed %x\n", status ); + status = pNtWow64ReadVirtualMemory64( process, module + exports.AddressOfNameOrdinals, + ordinals, exports.NumberOfNames * sizeof(*ordinals), NULL ); + ok( !status, "NtWow64ReadVirtualMemory64 failed %x\n", status ); + status = pNtWow64ReadVirtualMemory64( process, module + exports.AddressOfFunctions, + funcs, exports.NumberOfFunctions * sizeof(*funcs), NULL ); + ok( !status, "NtWow64ReadVirtualMemory64 failed %x\n", status ); + for (i = 0; i < exports.NumberOfNames && !ret; i++) + { + status = pNtWow64ReadVirtualMemory64( process, module + names[i], buffer, sizeof(buffer), NULL ); + ok( !status, "NtWow64ReadVirtualMemory64 failed %x\n", status ); + if (!strcmp( buffer, name )) ret = module + funcs[ordinals[i]]; + } + free( funcs ); + free( ordinals ); + free( names ); + NtClose( process ); + return ret; +} + static void check_module( ULONG64 base, const WCHAR *name ) { if (base == (ULONG_PTR)GetModuleHandleW(0)) @@ -650,6 +746,35 @@ static void test_nt_wow64(void) NtClose( process ); } +static void test_cpu_area(void) +{ + TEB64 *teb64 = (TEB64 *)NtCurrentTeb()->GdiBatchCount; + ULONG64 ptr; + NTSTATUS status; + + if (!is_wow64) return; + if (!ntdll_module) return; + + if ((ptr = get_proc_address64( ntdll_module, "RtlWow64GetCurrentCpuArea" ))) + { + USHORT machine = 0xdead; + ULONG64 context, context_ex; + ULONG64 args[] = { (ULONG_PTR)&machine, (ULONG_PTR)&context, (ULONG_PTR)&context_ex }; + + status = call_func64( ptr, ARRAY_SIZE(args), args ); + ok( !status, "RtlWow64GetCpuAreaInfo failed %x\n", status ); + ok( machine == IMAGE_FILE_MACHINE_I386, "wrong machine %x\n", machine ); + ok( context == teb64->TlsSlots[WOW64_TLS_CPURESERVED] + 4, "wrong context %s / %s\n", + wine_dbgstr_longlong(context), wine_dbgstr_longlong(teb64->TlsSlots[WOW64_TLS_CPURESERVED]) ); + ok( !context_ex, "got context_ex %s\n", wine_dbgstr_longlong(context_ex) ); + args[0] = args[1] = args[2] = 0; + status = call_func64( ptr, ARRAY_SIZE(args), args ); + ok( !status, "RtlWow64GetCpuAreaInfo failed %x\n", status ); + } + else win_skip( "RtlWow64GetCpuAreaInfo not supported\n" ); + +} + #endif /* _WIN64 */ @@ -658,10 +783,9 @@ START_TEST(wow64) init(); test_query_architectures(); test_peb_teb(); -#ifdef _WIN64 - test_cpu_area(); -#else +#ifndef _WIN64 test_nt_wow64(); test_modules(); #endif + test_cpu_area(); }
1
0
0
0
Alexandre Julliard : ntdll/tests: Add tests for 64-bit modules in Wow64 mode.
by Alexandre Julliard
30 Jun '21
30 Jun '21
Module: wine Branch: master Commit: 7700467a38408b7a4161e2a180f00abdf466164c URL:
https://source.winehq.org/git/wine.git/?a=commit;h=7700467a38408b7a4161e2a1…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Jun 30 11:11:32 2021 +0200 ntdll/tests: Add tests for 64-bit modules in Wow64 mode. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/tests/wow64.c | 89 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) diff --git a/dlls/ntdll/tests/wow64.c b/dlls/ntdll/tests/wow64.c index 8065221c416..d31afa373e2 100644 --- a/dlls/ntdll/tests/wow64.c +++ b/dlls/ntdll/tests/wow64.c @@ -463,6 +463,94 @@ static void test_cpu_area(void) #else /* _WIN64 */ +static ULONG64 main_module, ntdll_module, wow64_module, wow64cpu_module, wow64win_module; + +static void enum_modules64( void (*func)(ULONG64,const WCHAR *) ) +{ + typedef struct + { + LIST_ENTRY64 InLoadOrderLinks; + LIST_ENTRY64 InMemoryOrderLinks; + LIST_ENTRY64 InInitializationOrderLinks; + ULONG64 DllBase; + ULONG64 EntryPoint; + ULONG SizeOfImage; + UNICODE_STRING64 FullDllName; + UNICODE_STRING64 BaseDllName; + /* etc. */ + } LDR_DATA_TABLE_ENTRY64; + + TEB64 *teb64 = (TEB64 *)NtCurrentTeb()->GdiBatchCount; + PEB64 peb64; + ULONG64 ptr; + PEB_LDR_DATA64 ldr; + LDR_DATA_TABLE_ENTRY64 entry; + NTSTATUS status; + HANDLE process; + + process = OpenProcess( PROCESS_ALL_ACCESS, FALSE, GetCurrentProcessId() ); + ok( process != 0, "failed to open current process %u\n", GetLastError() ); + status = pNtWow64ReadVirtualMemory64( process, teb64->Peb, &peb64, sizeof(peb64), NULL ); + ok( !status, "NtWow64ReadVirtualMemory64 failed %x\n", status ); + todo_wine + ok( peb64.LdrData, "LdrData not initialized\n" ); + if (!peb64.LdrData) goto done; + status = pNtWow64ReadVirtualMemory64( process, peb64.LdrData, &ldr, sizeof(ldr), NULL ); + ok( !status, "NtWow64ReadVirtualMemory64 failed %x\n", status ); + ptr = ldr.InLoadOrderModuleList.Flink; + for (;;) + { + WCHAR buffer[256]; + status = pNtWow64ReadVirtualMemory64( process, ptr, &entry, sizeof(entry), NULL ); + ok( !status, "NtWow64ReadVirtualMemory64 failed %x\n", status ); + status = pNtWow64ReadVirtualMemory64( process, entry.BaseDllName.Buffer, buffer, sizeof(buffer), NULL ); + ok( !status, "NtWow64ReadVirtualMemory64 failed %x\n", status ); + if (status) break; + func( entry.DllBase, buffer ); + ptr = entry.InLoadOrderLinks.Flink; + if (ptr == peb64.LdrData + offsetof( PEB_LDR_DATA64, InLoadOrderModuleList )) break; + } +done: + NtClose( process ); +} + +static void check_module( ULONG64 base, const WCHAR *name ) +{ + if (base == (ULONG_PTR)GetModuleHandleW(0)) + { + WCHAR *p, module[MAX_PATH]; + + GetModuleFileNameW( 0, module, MAX_PATH ); + if ((p = wcsrchr( module, '\\' ))) p++; + else p = module; + ok( !wcsicmp( name, p ), "wrong name %s / %s\n", debugstr_w(name), debugstr_w(module)); + main_module = base; + return; + } +#define CHECK_MODULE(mod) if (!wcsicmp( name, L"" #mod ".dll" )) { mod ## _module = base; return; } + CHECK_MODULE(ntdll); + CHECK_MODULE(wow64); + CHECK_MODULE(wow64cpu); + CHECK_MODULE(wow64win); +#undef CHECK_MODULE + ok( 0, "unknown module %s %s found\n", wine_dbgstr_longlong(base), wine_dbgstr_w(name)); +} + +static void test_modules(void) +{ + if (!is_wow64) return; + if (!pNtWow64ReadVirtualMemory64) return; + enum_modules64( check_module ); + todo_wine + { + ok( main_module, "main module not found\n" ); + ok( ntdll_module, "64-bit ntdll not found\n" ); + ok( wow64_module, "wow64.dll not found\n" ); + ok( wow64cpu_module, "wow64cpu.dll not found\n" ); + ok( wow64win_module, "wow64win.dll not found\n" ); + } +} + static void test_nt_wow64(void) { const char str[] = "hello wow64"; @@ -574,5 +662,6 @@ START_TEST(wow64) test_cpu_area(); #else test_nt_wow64(); + test_modules(); #endif }
1
0
0
0
Zebediah Figura : ws2_32: Handle SO_SNDTIMEO in the server.
by Alexandre Julliard
30 Jun '21
30 Jun '21
Module: wine Branch: master Commit: 20c19903721faf7bbb0afc1cd878c4199abc6f96 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=20c19903721faf7bbb0afc1c…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Tue Jun 29 23:25:43 2021 -0500 ws2_32: Handle SO_SNDTIMEO in the server. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ws2_32/socket.c | 70 +++------------------------------------------------- include/wine/afd.h | 2 ++ server/sock.c | 40 ++++++++++++++++++++++++------ 3 files changed, 39 insertions(+), 73 deletions(-) diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c index 562d05ed4be..ce71e25d63d 100644 --- a/dlls/ws2_32/socket.c +++ b/dlls/ws2_32/socket.c @@ -913,34 +913,6 @@ static int convert_sockopt(INT *level, INT *optname) return 0; } -/* Utility: get the SO_RCVTIMEO or SO_SNDTIMEO socket option - * from an fd and return the value converted to milli seconds - * or 0 if there is an infinite time out */ -static inline INT64 get_rcvsnd_timeo( int fd, BOOL is_recv) -{ - struct timeval tv; - socklen_t len = sizeof(tv); - int optname, res; - - if (is_recv) -#ifdef SO_RCVTIMEO - optname = SO_RCVTIMEO; -#else - return 0; -#endif - else -#ifdef SO_SNDTIMEO - optname = SO_SNDTIMEO; -#else - return 0; -#endif - - res = getsockopt(fd, SOL_SOCKET, optname, &tv, &len); - if (res < 0) - return 0; - return (UINT64)tv.tv_sec * 1000 + tv.tv_usec / 1000; -} - int convert_socktype_w2u(int windowssocktype) { unsigned int i; @@ -2283,23 +2255,8 @@ INT WINAPI WS_getsockopt(SOCKET s, INT level, return server_getsockopt( s, IOCTL_AFD_WINE_GET_SO_SNDBUF, optval, optlen ); case WS_SO_SNDTIMEO: - { - INT64 timeout; + return server_getsockopt( s, IOCTL_AFD_WINE_GET_SO_SNDTIMEO, optval, optlen ); - if (!optlen || *optlen < sizeof(int)|| !optval) - { - SetLastError(WSAEFAULT); - return SOCKET_ERROR; - } - if ( (fd = get_sock_fd( s, 0, NULL )) == -1) - return SOCKET_ERROR; - - timeout = get_rcvsnd_timeo(fd, optname == WS_SO_RCVTIMEO); - *(int *)optval = timeout <= UINT_MAX ? timeout : UINT_MAX; - - release_sock_fd( s, fd ); - return ret; - } case WS_SO_TYPE: { int sock_type; @@ -3504,7 +3461,6 @@ int WINAPI WS_setsockopt(SOCKET s, int level, int optname, { int fd; int woptval; - struct timeval tval; struct ip_mreq_source mreq_source; TRACE("(socket %04lx, %s, optval %s, optlen %d)\n", s, @@ -3567,6 +3523,9 @@ int WINAPI WS_setsockopt(SOCKET s, int level, int optname, case WS_SO_SNDBUF: return server_setsockopt( s, IOCTL_AFD_WINE_SET_SO_SNDBUF, optval, optlen ); + case WS_SO_SNDTIMEO: + return server_setsockopt( s, IOCTL_AFD_WINE_SET_SO_SNDTIMEO, optval, optlen ); + /* SO_DEBUG is a privileged operation, ignore it. */ case WS_SO_DEBUG: TRACE("Ignoring SO_DEBUG\n"); @@ -3607,27 +3566,6 @@ int WINAPI WS_setsockopt(SOCKET s, int level, int optname, TRACE("setting global SO_OPENTYPE = 0x%x\n", *((const int*)optval) ); return 0; -#ifdef SO_SNDTIMEO - case WS_SO_SNDTIMEO: - if (optval && optlen == sizeof(UINT32)) { - /* WinSock passes milliseconds instead of struct timeval */ - tval.tv_usec = (*(const UINT32*)optval % 1000) * 1000; - tval.tv_sec = *(const UINT32*)optval / 1000; - /* min of 500 milliseconds */ - if (tval.tv_sec == 0 && tval.tv_usec && tval.tv_usec < 500000) - tval.tv_usec = 500000; - optlen = sizeof(struct timeval); - optval = (char*)&tval; - } else if (optlen == sizeof(struct timeval)) { - WARN("SO_SND/RCVTIMEO for %d bytes: assuming unixism\n", optlen); - } else { - WARN("SO_SND/RCVTIMEO for %d bytes is weird: ignored\n", optlen); - return 0; - } - convert_sockopt(&level, &optname); - break; -#endif - case WS_SO_RANDOMIZE_PORT: FIXME("Ignoring WS_SO_RANDOMIZE_PORT\n"); return 0; diff --git a/include/wine/afd.h b/include/wine/afd.h index f2a5abf726d..44a8b1a5ff9 100644 --- a/include/wine/afd.h +++ b/include/wine/afd.h @@ -177,6 +177,8 @@ struct afd_get_events_params #define IOCTL_AFD_WINE_SET_SO_REUSEADDR CTL_CODE(FILE_DEVICE_NETWORK, 234, METHOD_BUFFERED, FILE_ANY_ACCESS) #define IOCTL_AFD_WINE_SET_SO_SNDBUF CTL_CODE(FILE_DEVICE_NETWORK, 235, METHOD_BUFFERED, FILE_ANY_ACCESS) #define IOCTL_AFD_WINE_GET_SO_SNDBUF CTL_CODE(FILE_DEVICE_NETWORK, 236, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_AFD_WINE_GET_SO_SNDTIMEO CTL_CODE(FILE_DEVICE_NETWORK, 237, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_AFD_WINE_SET_SO_SNDTIMEO CTL_CODE(FILE_DEVICE_NETWORK, 238, METHOD_BUFFERED, FILE_ANY_ACCESS) struct afd_create_params { diff --git a/server/sock.c b/server/sock.c index 9a99e512c0d..befa9117c13 100644 --- a/server/sock.c +++ b/server/sock.c @@ -210,6 +210,7 @@ struct sock unsigned int rcvbuf; /* advisory recv buffer size */ unsigned int sndbuf; /* advisory send buffer size */ unsigned int rcvtimeo; /* receive timeout in ms */ + unsigned int sndtimeo; /* send timeout in ms */ unsigned int rd_shutdown : 1; /* is the read end shut down? */ unsigned int wr_shutdown : 1; /* is the write end shut down? */ unsigned int wr_shutdown_pending : 1; /* is a write shutdown pending? */ @@ -1392,6 +1393,7 @@ static struct sock *create_socket(void) sock->rcvbuf = 0; sock->sndbuf = 0; sock->rcvtimeo = 0; + sock->sndtimeo = 0; init_async_queue( &sock->read_q ); init_async_queue( &sock->write_q ); init_async_queue( &sock->ifchange_q ); @@ -2697,6 +2699,35 @@ static int sock_ioctl( struct fd *fd, ioctl_code_t code, struct async *async ) return 0; } + case IOCTL_AFD_WINE_GET_SO_SNDTIMEO: + { + DWORD sndtimeo = sock->sndtimeo; + + if (get_reply_max_size() < sizeof(sndtimeo)) + { + set_error( STATUS_BUFFER_TOO_SMALL ); + return 0; + } + + set_reply_data( &sndtimeo, sizeof(sndtimeo) ); + return 1; + } + + case IOCTL_AFD_WINE_SET_SO_SNDTIMEO: + { + DWORD sndtimeo; + + if (get_req_data_size() < sizeof(sndtimeo)) + { + set_error( STATUS_BUFFER_TOO_SMALL ); + return 0; + } + sndtimeo = *(DWORD *)get_req_data(); + + sock->sndtimeo = sndtimeo; + return 0; + } + default: set_error( STATUS_NOT_SUPPORTED ); return 0; @@ -3217,19 +3248,14 @@ DECL_HANDLER(send_socket) /* send() returned EWOULDBLOCK or a short write, i.e. cannot send all data yet */ if (status == STATUS_DEVICE_NOT_READY && !sock->nonblocking) { -#ifdef SO_SNDTIMEO - struct timeval tv; - socklen_t len = sizeof(tv); - /* Set a timeout on the async if necessary. * * We want to do this *only* if the client gave us STATUS_DEVICE_NOT_READY. * If the client gave us STATUS_PENDING, it expects the async to always * block (it was triggered by WSASend*() with a valid OVERLAPPED * structure) and for the timeout not to be respected. */ - if (is_fd_overlapped( fd ) && !getsockopt( get_unix_fd( fd ), SOL_SOCKET, SO_SNDTIMEO, (char *)&tv, &len )) - timeout = tv.tv_sec * -10000000 + tv.tv_usec * -10; -#endif + if (is_fd_overlapped( fd )) + timeout = (timeout_t)sock->sndtimeo * -10000; status = STATUS_PENDING; }
1
0
0
0
Zebediah Figura : ws2_32: Use IOCTL_AFD_WINE_GET_SO_SNDBUF.
by Alexandre Julliard
30 Jun '21
30 Jun '21
Module: wine Branch: master Commit: 35288d6537652989473dd87258de5b006d60b589 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=35288d6537652989473dd872…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Tue Jun 29 23:25:42 2021 -0500 ws2_32: Use IOCTL_AFD_WINE_GET_SO_SNDBUF. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=8606
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ws2_32/socket.c | 17 +++-------------- dlls/ws2_32/tests/sock.c | 2 +- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c index 3f15bb4e39b..562d05ed4be 100644 --- a/dlls/ws2_32/socket.c +++ b/dlls/ws2_32/socket.c @@ -2088,20 +2088,6 @@ INT WINAPI WS_getsockopt(SOCKET s, INT level, case WS_SO_BROADCAST: return server_getsockopt( s, IOCTL_AFD_WINE_GET_SO_BROADCAST, optval, optlen ); - /* Handle common cases. The special cases are below, sorted - * alphabetically */ - case WS_SO_SNDBUF: - if ( (fd = get_sock_fd( s, 0, NULL )) == -1) - return SOCKET_ERROR; - convert_sockopt(&level, &optname); - if (getsockopt(fd, level, optname, optval, (socklen_t *)optlen) != 0 ) - { - SetLastError(wsaErrno()); - ret = SOCKET_ERROR; - } - release_sock_fd( s, fd ); - return ret; - case WS_SO_BSP_STATE: { CSADDR_INFO *csinfo = (CSADDR_INFO *)optval; @@ -2293,6 +2279,9 @@ INT WINAPI WS_getsockopt(SOCKET s, INT level, case WS_SO_REUSEADDR: return server_getsockopt( s, IOCTL_AFD_WINE_GET_SO_REUSEADDR, optval, optlen ); + case WS_SO_SNDBUF: + return server_getsockopt( s, IOCTL_AFD_WINE_GET_SO_SNDBUF, optval, optlen ); + case WS_SO_SNDTIMEO: { INT64 timeout; diff --git a/dlls/ws2_32/tests/sock.c b/dlls/ws2_32/tests/sock.c index a3f7e002ce7..e579b72ecb5 100644 --- a/dlls/ws2_32/tests/sock.c +++ b/dlls/ws2_32/tests/sock.c @@ -1214,7 +1214,7 @@ static void test_set_getsockopt(void) value = 0xdeadbeef; err = getsockopt(s, SOL_SOCKET, SO_SNDBUF, (char *)&value, &size); ok( !err, "getsockopt(SO_SNDBUF) failed error: %u\n", WSAGetLastError() ); - todo_wine ok( value == 4096, "expected 4096, got %u\n", value ); + ok( value == 4096, "expected 4096, got %u\n", value ); /* SO_RCVBUF */ value = 4096;
1
0
0
0
← Newer
1
2
3
4
5
...
82
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
Results per page:
10
25
50
100
200