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
August 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
1051 discussions
Start a n
N
ew thread
Zhiyi Zhang : wordpad: Use large icons for toolbar when DPI is greater than 120.
by Alexandre Julliard
17 Aug '21
17 Aug '21
Module: wine Branch: master Commit: 766388c552a4b04fa62b3874fe841c87f6ca66ac URL:
https://source.winehq.org/git/wine.git/?a=commit;h=766388c552a4b04fa62b3874…
Author: Zhiyi Zhang <zzhang(a)codeweavers.com> Date: Tue Aug 17 16:36:56 2021 +0800 wordpad: Use large icons for toolbar when DPI is greater than 120. Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- programs/wordpad/wordpad.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/programs/wordpad/wordpad.c b/programs/wordpad/wordpad.c index d48346e3c4a..e87475ad06b 100644 --- a/programs/wordpad/wordpad.c +++ b/programs/wordpad/wordpad.c @@ -1881,7 +1881,7 @@ static LRESULT OnCreate( HWND hWnd ) HFONT font; HDC hdc; SIZE name_sz, size_sz; - int height; + int height, dpi; static const WCHAR wszRichEditDll[] = {'R','I','C','H','E','D','2','0','.','D','L','L','\0'}; static const WCHAR wszRichEditText[] = {'R','i','c','h','E','d','i','t',' ','t','e','x','t','\0'}; static const WCHAR font_text[] = {'T','i','m','e','s',' ','N','e','w',' ','R','o','m','a','n',0}; /* a long font name */ @@ -1905,8 +1905,12 @@ static LRESULT OnCreate( HWND hWnd ) NULL, 0, 24, 24, 16, 16, sizeof(TBBUTTON)); + hdc = GetDC(hWnd); + dpi = GetDeviceCaps(hdc, LOGPIXELSY); + ReleaseDC(hWnd, hdc); + ab.hInst = HINST_COMMCTRL; - ab.nID = IDB_STD_SMALL_COLOR; + ab.nID = dpi >= 120 ? IDB_STD_LARGE_COLOR : IDB_STD_SMALL_COLOR; nStdBitmaps = SendMessageW(hToolBarWnd, TB_ADDBITMAP, 0, (LPARAM)&ab); AddButton(hToolBarWnd, nStdBitmaps+STD_FILENEW, ID_FILE_NEW);
1
0
0
0
Zhiyi Zhang : user32: Report a fake monitor when running on an invisible window station.
by Alexandre Julliard
17 Aug '21
17 Aug '21
Module: wine Branch: master Commit: f8ce819ab57b42329b52d18fa29e5a79cfd1abf6 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=f8ce819ab57b42329b52d18f…
Author: Zhiyi Zhang <zzhang(a)codeweavers.com> Date: Tue Aug 17 16:29:59 2021 +0800 user32: Report a fake monitor when running on an invisible window station. The visible window station check was accidentally deleted in 95be042. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=51590
Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/sysparams.c | 10 +++++++++- dlls/user32/tests/monitor.c | 7 +++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/dlls/user32/sysparams.c b/dlls/user32/sysparams.c index 1c943767927..24e39206746 100644 --- a/dlls/user32/sysparams.c +++ b/dlls/user32/sysparams.c @@ -4111,12 +4111,20 @@ static BOOL CALLBACK enum_mon_callback( HMONITOR monitor, HDC hdc, LPRECT rect, BOOL CDECL nulldrv_EnumDisplayMonitors( HDC hdc, RECT *rect, MONITORENUMPROC proc, LPARAM lp ) { + BOOL is_winstation_visible = FALSE; + USEROBJECTFLAGS flags; + HWINSTA winstation; RECT monitor_rect; DWORD i = 0; TRACE("(%p, %p, %p, 0x%lx)\n", hdc, rect, proc, lp); - if (update_monitor_cache()) + /* Report physical monitor information only if window station has visible display surfaces */ + winstation = GetProcessWindowStation(); + if (GetUserObjectInformationW( winstation, UOI_FLAGS, &flags, sizeof(flags), NULL )) + is_winstation_visible = flags.dwFlags & WSF_VISIBLE; + + if (is_winstation_visible && update_monitor_cache()) { while (TRUE) { diff --git a/dlls/user32/tests/monitor.c b/dlls/user32/tests/monitor.c index 654f77ed617..dfb57d3e2c2 100644 --- a/dlls/user32/tests/monitor.c +++ b/dlls/user32/tests/monitor.c @@ -1563,6 +1563,7 @@ static void test_EnumDisplayMonitors(void) static const DWORD DESKTOP_ALL_ACCESS = 0x01ff; HWINSTA winstation, old_winstation; HDESK desktop, old_desktop; + USEROBJECTFLAGS flags; INT count, old_count; DWORD error; BOOL ret; @@ -1602,6 +1603,12 @@ static void test_EnumDisplayMonitors(void) ok(ret, "SetProcessWindowStation failed, error %#x.\n", GetLastError()); ok(winstation == GetProcessWindowStation(), "Expected %p, got %p.\n", GetProcessWindowStation(), winstation); + flags.fInherit = FALSE; + flags.fReserved = FALSE; + flags.dwFlags = WSF_VISIBLE; + ret = SetUserObjectInformationW(winstation, UOI_FLAGS, &flags, sizeof(flags)); + ok(ret, "SetUserObjectInformationW failed, error %#x.\n", GetLastError()); + desktop = CreateDesktopW(L"test_desktop", NULL, NULL, 0, DESKTOP_ALL_ACCESS, NULL); ok(!!desktop && desktop != old_desktop, "CreateDesktopW failed, error %#x.\n", GetLastError()); ret = SetThreadDesktop(desktop);
1
0
0
0
Huw Davies : iphlpapi: Implement AllocateAndGetTcp(Ex)TableFromStack() on top of nsi.
by Alexandre Julliard
17 Aug '21
17 Aug '21
Module: wine Branch: master Commit: 7341bee1dc77b933a5924af4d1c6c9cb03dbb03d URL:
https://source.winehq.org/git/wine.git/?a=commit;h=7341bee1dc77b933a5924af4…
Author: Huw Davies <huw(a)codeweavers.com> Date: Tue Aug 17 09:27:17 2021 +0100 iphlpapi: Implement AllocateAndGetTcp(Ex)TableFromStack() on top of nsi. Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/iphlpapi/iphlpapi_main.c | 43 +++ dlls/iphlpapi/ipstats.c | 644 ------------------------------------------ dlls/iphlpapi/ipstats.h | 2 - 3 files changed, 43 insertions(+), 646 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=7341bee1dc77b933a592…
1
0
0
0
Huw Davies : iphlpapi: Implement GetTcpTable2() and GetTcp6Table2().
by Alexandre Julliard
17 Aug '21
17 Aug '21
Module: wine Branch: master Commit: f535ab7197e41e1e1301d032f862094da9559000 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=f535ab7197e41e1e1301d032…
Author: Huw Davies <huw(a)codeweavers.com> Date: Tue Aug 17 09:27:16 2021 +0100 iphlpapi: Implement GetTcpTable2() and GetTcp6Table2(). Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/iphlpapi/iphlpapi_main.c | 76 +++++++++++++++++++++++++++++++++---------- 1 file changed, 58 insertions(+), 18 deletions(-) diff --git a/dlls/iphlpapi/iphlpapi_main.c b/dlls/iphlpapi/iphlpapi_main.c index 5595088e093..65a72379e60 100644 --- a/dlls/iphlpapi/iphlpapi_main.c +++ b/dlls/iphlpapi/iphlpapi_main.c @@ -2870,6 +2870,8 @@ DWORD WINAPI GetTcpStatisticsEx( MIB_TCPSTATS *stats, DWORD family ) return err; } +#define TCP_TABLE2 ~0u /* Internal tcp table for GetTcp(6)Table2() */ + static DWORD tcp_table_id( ULONG table_class ) { switch (table_class) @@ -2887,6 +2889,7 @@ static DWORD tcp_table_id( ULONG table_class ) case TCP_TABLE_BASIC_ALL: case TCP_TABLE_OWNER_PID_ALL: case TCP_TABLE_OWNER_MODULE_ALL: + case TCP_TABLE2: return NSI_TCP_ALL_TABLE; default: @@ -2920,6 +2923,11 @@ static DWORD tcp_table_size( ULONG family, ULONG table_class, DWORD row_count, D return (family == WS_AF_INET) ? FIELD_OFFSET(MIB_TCPTABLE_OWNER_MODULE, table[row_count]) : FIELD_OFFSET(MIB_TCP6TABLE_OWNER_MODULE, table[row_count]); + case TCP_TABLE2: + *row_size = (family == WS_AF_INET) ? sizeof(MIB_TCPROW2) : sizeof(MIB_TCP6ROW2); + return (family == WS_AF_INET) ? FIELD_OFFSET(MIB_TCPTABLE2, table[row_count]) : + FIELD_OFFSET(MIB_TCP6TABLE2, table[row_count]); + default: ERR( "unhandled class %u\n", table_class ); return 0; @@ -2975,6 +2983,18 @@ static void tcp_row_fill( void *table, DWORD num, ULONG family, ULONG table_clas memset( row->OwningModuleInfo + 1, 0, sizeof(row->OwningModuleInfo) - sizeof(row->OwningModuleInfo[0]) ); return; } + case TCP_TABLE2: + { + MIB_TCPROW2 *row = ((MIB_TCPTABLE2 *)table)->table + num; + row->dwState = dyn->state; + row->dwLocalAddr = key->local.Ipv4.sin_addr.WS_s_addr; + row->dwLocalPort = key->local.Ipv4.sin_port; + row->dwRemoteAddr = key->remote.Ipv4.sin_addr.WS_s_addr; + row->dwRemotePort = key->remote.Ipv4.sin_port; + row->dwOwningPid = stat->pid; + row->dwOffloadState = 0; /* FIXME */ + return; + } default: ERR( "Unknown class %d\n", table_class ); return; @@ -3031,6 +3051,20 @@ static void tcp_row_fill( void *table, DWORD num, ULONG family, ULONG table_clas memset( row->OwningModuleInfo + 1, 0, sizeof(row->OwningModuleInfo) - sizeof(row->OwningModuleInfo[0]) ); return; } + case TCP_TABLE2: + { + MIB_TCP6ROW2 *row = ((MIB_TCP6TABLE2 *)table)->table + num; + memcpy( &row->LocalAddr, &key->local.Ipv6.sin6_addr, sizeof(row->LocalAddr) ); + row->dwLocalScopeId = key->local.Ipv6.sin6_scope_id; + row->dwLocalPort = key->local.Ipv6.sin6_port; + memcpy( &row->RemoteAddr, &key->remote.Ipv6.sin6_addr, sizeof(row->RemoteAddr) ); + row->dwRemoteScopeId = key->remote.Ipv6.sin6_scope_id; + row->dwRemotePort = key->remote.Ipv6.sin6_port; + row->State = dyn->state; + row->dwOwningPid = stat->pid; + row->dwOffloadState = 0; /* FIXME */ + return; + } default: ERR( "Unknown class %d\n", table_class ); return; @@ -3079,6 +3113,12 @@ static int tcp6_row_owner_cmp( const void *a, const void *b ) return RtlUshortByteSwap( rowA->dwRemotePort ) - RtlUshortByteSwap( rowB->dwRemotePort ); } +/************************************************************************************* + * get_extended_tcp_table + * + * Implementation of GetExtendedTcpTable() which additionally handles TCP_TABLE2 + * corresponding to GetTcp(6)Table2() + */ DWORD get_extended_tcp_table( void *table, DWORD *size, BOOL sort, ULONG family, ULONG table_class ) { DWORD err, count, needed, i, num = 0, row_size = 0; @@ -3182,6 +3222,24 @@ ULONG WINAPI GetTcp6Table( MIB_TCP6TABLE *table, ULONG *size, BOOL sort ) return get_extended_tcp_table( table, size, sort, WS_AF_INET6, TCP_TABLE_BASIC_ALL ); } +/****************************************************************** + * GetTcpTable2 (IPHLPAPI.@) + */ +ULONG WINAPI GetTcpTable2( MIB_TCPTABLE2 *table, ULONG *size, BOOL sort ) +{ + TRACE( "table %p, size %p, sort %d\n", table, size, sort ); + return get_extended_tcp_table( table, size, sort, WS_AF_INET, TCP_TABLE2 ); +} + +/****************************************************************** + * GetTcp6Table2 (IPHLPAPI.@) + */ +ULONG WINAPI GetTcp6Table2( MIB_TCP6TABLE2 *table, ULONG *size, BOOL sort ) +{ + TRACE( "table %p, size %p, sort %d\n", table, size, sort ); + return get_extended_tcp_table( table, size, sort, WS_AF_INET6, TCP_TABLE2 ); +} + /****************************************************************** * GetUdpTable (IPHLPAPI.@) * @@ -3812,24 +3870,6 @@ DWORD WINAPI PfBindInterfaceToIPAddress(INTERFACE_HANDLE interface, PFADDRESSTYP return ERROR_CALL_NOT_IMPLEMENTED; } -/****************************************************************** - * GetTcpTable2 (IPHLPAPI.@) - */ -ULONG WINAPI GetTcpTable2(PMIB_TCPTABLE2 table, PULONG size, BOOL order) -{ - FIXME("pTcpTable2 %p, pdwSize %p, bOrder %d: stub\n", table, size, order); - return ERROR_NOT_SUPPORTED; -} - -/****************************************************************** - * GetTcp6Table2 (IPHLPAPI.@) - */ -ULONG WINAPI GetTcp6Table2(PMIB_TCP6TABLE2 table, PULONG size, BOOL order) -{ - FIXME("pTcp6Table2 %p, size %p, order %d: stub\n", table, size, order); - return ERROR_NOT_SUPPORTED; -} - /****************************************************************** * ConvertInterfaceAliasToLuid (IPHLPAPI.@) */
1
0
0
0
Huw Davies : iphlpapi: Implement GetExtendedTcpTable() on top of nsi.
by Alexandre Julliard
17 Aug '21
17 Aug '21
Module: wine Branch: master Commit: 6bac492b1f71a271e3e1f4886074e16e4aac1e24 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=6bac492b1f71a271e3e1f488…
Author: Huw Davies <huw(a)codeweavers.com> Date: Tue Aug 17 09:27:15 2021 +0100 iphlpapi: Implement GetExtendedTcpTable() on top of nsi. Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/iphlpapi/iphlpapi_main.c | 350 ++++++++++++++++++++++++++++++++++-------- 1 file changed, 288 insertions(+), 62 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=6bac492b1f71a271e3e1…
1
0
0
0
Huw Davies : nsiproxy: Add support for TCP pid lookup.
by Alexandre Julliard
17 Aug '21
17 Aug '21
Module: wine Branch: master Commit: e152d40641f098f77a883b4db9849dc719a9eb36 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=e152d40641f098f77a883b4d…
Author: Huw Davies <huw(a)codeweavers.com> Date: Tue Aug 17 09:27:14 2021 +0100 nsiproxy: Add support for TCP pid lookup. Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/nsi/tests/nsi.c | 2 - dlls/nsiproxy.sys/tcp.c | 207 +++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 203 insertions(+), 6 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=e152d40641f098f77a88…
1
0
0
0
Huw Davies : nsiproxy: Add support for IPv6 scope ids.
by Alexandre Julliard
17 Aug '21
17 Aug '21
Module: wine Branch: master Commit: 40a60061d73015d894f115ca567e7f09605a0268 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=40a60061d73015d894f115ca…
Author: Huw Davies <huw(a)codeweavers.com> Date: Tue Aug 17 09:27:13 2021 +0100 nsiproxy: Add support for IPv6 scope ids. Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/nsi/tests/nsi.c | 2 - dlls/nsiproxy.sys/tcp.c | 136 ++++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 132 insertions(+), 6 deletions(-) diff --git a/dlls/nsi/tests/nsi.c b/dlls/nsi/tests/nsi.c index 8e19df83684..f8ba9aff5da 100644 --- a/dlls/nsi/tests/nsi.c +++ b/dlls/nsi/tests/nsi.c @@ -916,14 +916,12 @@ todo_wine_if( !unstable(0) && row->dwOwningPid ) { ok( unstable( !memcmp( row6->ucLocalAddr, keys[i].local.Ipv6.sin6_addr.s6_addr, sizeof(IN6_ADDR) ) ), "mismatch\n" ); -todo_wine_if( !unstable(0) && row6->dwLocalScopeId ) ok( unstable( row6->dwLocalScopeId == keys[i].local.Ipv6.sin6_scope_id ), "%x vs %x\n", row6->dwLocalScopeId, keys[i].local.Ipv6.sin6_scope_id ); ok( unstable( row6->dwLocalPort == keys[i].local.Ipv6.sin6_port ), "%d vs %d\n", row6->dwLocalPort, keys[i].local.Ipv6.sin6_port ); ok( unstable( !memcmp( row6->ucRemoteAddr, keys[i].remote.Ipv6.sin6_addr.s6_addr, sizeof(IN6_ADDR) ) ), "mismatch\n" ); -todo_wine_if( !unstable(0) && row6->dwRemoteScopeId ) ok( unstable( row6->dwRemoteScopeId == keys[i].remote.Ipv6.sin6_scope_id ), "%x vs %x\n", row6->dwRemoteScopeId, keys[i].remote.Ipv6.sin6_scope_id ); ok( unstable( row6->dwRemotePort == keys[i].remote.Ipv6.sin6_port ), "%d vs %d\n", diff --git a/dlls/nsiproxy.sys/tcp.c b/dlls/nsiproxy.sys/tcp.c index 710aed5d6c3..5b4a4b68765 100644 --- a/dlls/nsiproxy.sys/tcp.c +++ b/dlls/nsiproxy.sys/tcp.c @@ -54,6 +54,10 @@ #include <sys/sysctl.h> #endif +#ifdef HAVE_IFADDRS_H +#include <ifaddrs.h> +#endif + #include "ntstatus.h" #define WIN32_NO_STATUS #include "windef.h" @@ -209,6 +213,119 @@ static inline MIB_TCP_STATE tcp_state_to_mib_state( int state ) } } +struct ipv6_addr_scope +{ + IN6_ADDR addr; + DWORD scope; +}; + +static struct ipv6_addr_scope *get_ipv6_addr_scope_table( unsigned int *size ) +{ + struct ipv6_addr_scope *table = NULL; + unsigned int table_size = 0, num = 0; + +#ifdef __linux__ + { + char buf[512], *ptr; + FILE *fp; + + if (!(fp = fopen( "/proc/net/if_inet6", "r" ))) goto failed; + + while ((ptr = fgets( buf, sizeof(buf), fp ))) + { + WORD a[8]; + DWORD scope; + struct ipv6_addr_scope *entry; + unsigned int i; + + if (sscanf( ptr, "%4hx%4hx%4hx%4hx%4hx%4hx%4hx%4hx %*s %*s %x", + a, a + 1, a + 2, a + 3, a + 4, a + 5, a + 6, a + 7, &scope ) != 9) + continue; + + if (++num > table_size) + { + if (!table_size) table_size = 4; + else table_size *= 2; + if (!(table = heap_realloc( table, table_size * sizeof(table[0]) ))) + { + fclose( fp ); + goto failed; + } + } + + entry = table + num - 1; + for (i = 0; i < 8; i++) + entry->addr.u.Word[i] = htons( a[i] ); + entry->scope = htons( scope ); + } + + fclose( fp ); + } +#elif defined(HAVE_GETIFADDRS) + { + struct ifaddrs *addrs, *cur; + + if (getifaddrs( &addrs ) == -1) goto failed; + + for (cur = addrs; cur; cur = cur->ifa_next) + { + struct sockaddr_in6 *sin6; + struct ipv6_addr_scope *entry; + + if (cur->ifa_addr->sa_family != AF_INET6) continue; + + if (++num > table_size) + { + if (!table_size) table_size = 4; + else table_size *= 2; + if (!(table = heap_realloc( table, table_size * sizeof(table[0]) ))) + { + freeifaddrs( addrs ); + goto failed; + } + } + + sin6 = (struct sockaddr_in6 *)cur->ifa_addr; + entry = table + num - 1; + memcpy( &entry->addr, &sin6->sin6_addr, sizeof(entry->addr) ); + entry->scope = sin6->sin6_scope_id; + } + + freeifaddrs( addrs ); + } +#else + FIXME( "not implemented\n" ); + goto failed; +#endif + + *size = num; + return table; + +failed: + heap_free( table ); + return NULL; +} + +static DWORD find_ipv6_addr_scope( const IN6_ADDR *addr, const struct ipv6_addr_scope *table, unsigned int size ) +{ + const BYTE multicast_scope_mask = 0x0F; + const BYTE multicast_scope_shift = 0; + unsigned int i; + + if (WS_IN6_IS_ADDR_UNSPECIFIED( addr )) return 0; + + if (WS_IN6_IS_ADDR_MULTICAST( addr )) + return htons( (addr->u.Byte[1] & multicast_scope_mask) >> multicast_scope_shift ); + + if (!table) return -1; + + for (i = 0; i < size; i++) + if (!memcmp( &table[i].addr, addr, sizeof(table[i].addr) )) + return table[i].scope; + + return -1; +} + static NTSTATUS tcp_conns_enumerate_all( DWORD filter, struct nsi_tcp_conn_key *key_data, DWORD key_size, void *rw, DWORD rw_size, struct nsi_tcp_conn_dynamic *dynamic_data, DWORD dynamic_size, @@ -220,6 +337,8 @@ static NTSTATUS tcp_conns_enumerate_all( DWORD filter, struct nsi_tcp_conn_key * struct nsi_tcp_conn_key key; struct nsi_tcp_conn_dynamic dyn; struct nsi_tcp_conn_static stat; + struct ipv6_addr_scope *addr_scopes = NULL; + unsigned int addr_scopes_size = 0; #ifdef __linux__ { @@ -269,6 +388,8 @@ static NTSTATUS tcp_conns_enumerate_all( DWORD filter, struct nsi_tcp_conn_key * memset( &dyn, 0, sizeof(dyn) ); memset( &stat, 0, sizeof(stat) ); + addr_scopes = get_ipv6_addr_scope_table( &addr_scopes_size ); + /* skip header line */ ptr = fgets( buf, sizeof(buf), fp ); while ((ptr = fgets( buf, sizeof(buf), fp ))) @@ -286,8 +407,10 @@ static NTSTATUS tcp_conns_enumerate_all( DWORD filter, struct nsi_tcp_conn_key * key.local.Ipv6.sin6_family = key.remote.Ipv6.sin6_family = WS_AF_INET6; key.local.Ipv6.sin6_port = htons( key.local.Ipv6.sin6_port ); key.remote.Ipv6.sin6_port = htons( key.remote.Ipv6.sin6_port ); - key.local.Ipv6.sin6_scope_id = 0; /* FIXME */ - key.remote.Ipv6.sin6_scope_id = 0; /* FIXME */ + key.local.Ipv6.sin6_scope_id = find_ipv6_addr_scope( &key.local.Ipv6.sin6_addr, addr_scopes, + addr_scopes_size ); + key.remote.Ipv6.sin6_scope_id = find_ipv6_addr_scope( &key.remote.Ipv6.sin6_addr, addr_scopes, + addr_scopes_size ); stat.pid = 0; /* FIXME */ stat.create_time = 0; /* FIXME */ @@ -335,6 +458,8 @@ static NTSTATUS tcp_conns_enumerate_all( DWORD filter, struct nsi_tcp_conn_key * /* Might be nothing here; first entry is just a header it seems */ if (len <= sizeof(struct xinpgen)) goto err; + addr_scopes = get_ipv6_addr_scope_table( &addr_scopes_size ); + orig_xig = (struct xinpgen *)buf; xig = orig_xig; @@ -384,10 +509,12 @@ static NTSTATUS tcp_conns_enumerate_all( DWORD filter, struct nsi_tcp_conn_key * key.local.Ipv6.sin6_family = key.remote.Ipv6.sin6_family = WS_AF_INET6; memcpy( &key.local.Ipv6.sin6_addr, &in->in6p_laddr, sizeof(in->in6p_laddr) ); key.local.Ipv6.sin6_port = in->inp_lport; + key.local.Ipv6.sin6_scope_id = find_ipv6_addr_scope( &key.local.Ipv6.sin6_addr, addr_scopes, + addr_scopes_size ); memcpy( &key.remote.Ipv6.sin6_addr, &in->in6p_faddr, sizeof(in->in6p_faddr) ); key.remote.Ipv6.sin6_port = in->inp_fport; - key.local.Ipv6.sin6_scope_id = 0; /* FIXME */ - key.remote.Ipv6.sin6_scope_id = 0; /* FIXME */ + key.remote.Ipv6.sin6_scope_id = find_ipv6_addr_scope( &key.remote.Ipv6.sin6_addr, addr_scopes, + addr_scopes_size ); } stat.pid = 0; /* FIXME */ @@ -413,6 +540,7 @@ static NTSTATUS tcp_conns_enumerate_all( DWORD filter, struct nsi_tcp_conn_key * if (!want_data || num <= *count) *count = num; else status = STATUS_MORE_ENTRIES; + heap_free( addr_scopes ); return status; }
1
0
0
0
Huw Davies : nsiproxy: Implement TCP connections enumerate_all.
by Alexandre Julliard
17 Aug '21
17 Aug '21
Module: wine Branch: master Commit: 14fc764756d2b12ade492385867aff94503dd945 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=14fc764756d2b12ade492385…
Author: Huw Davies <huw(a)codeweavers.com> Date: Tue Aug 17 09:27:12 2021 +0100 nsiproxy: Implement TCP connections enumerate_all. Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/nsi/tests/nsi.c | 101 ++++++++++++++++ dlls/nsiproxy.sys/tcp.c | 302 ++++++++++++++++++++++++++++++++++++++++++++++++ include/wine/nsi.h | 25 ++++ 3 files changed, 428 insertions(+) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=14fc764756d2b12ade49…
1
0
0
0
Huw Davies : iphlpapi: Use the correct size to allocate the process map.
by Alexandre Julliard
17 Aug '21
17 Aug '21
Module: wine Branch: master Commit: b2600726fcb45b18e6e161640547e32df265c668 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=b2600726fcb45b18e6e16164…
Author: Huw Davies <huw(a)codeweavers.com> Date: Tue Aug 17 09:27:11 2021 +0100 iphlpapi: Use the correct size to allocate the process map. The size is known at the start, so there's no need to grow it. Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/iphlpapi/ipstats.c | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/dlls/iphlpapi/ipstats.c b/dlls/iphlpapi/ipstats.c index ececfcdcecd..af14cddb0ca 100644 --- a/dlls/iphlpapi/ipstats.c +++ b/dlls/iphlpapi/ipstats.c @@ -546,7 +546,7 @@ struct pid_map static struct pid_map *get_pid_map( unsigned int *num_entries ) { struct pid_map *map; - unsigned int i = 0, map_count = 16, buffer_len = 4096, process_count, pos = 0; + unsigned int i = 0, buffer_len = 4096, process_count, pos = 0; NTSTATUS ret; char *buffer = NULL, *new_buffer; @@ -573,7 +573,7 @@ static struct pid_map *get_pid_map( unsigned int *num_entries ) buffer = new_buffer; } - if (!(map = HeapAlloc( GetProcessHeap(), 0, map_count * sizeof(*map) ))) + if (!(map = HeapAlloc( GetProcessHeap(), 0, process_count * sizeof(*map) ))) { HeapFree( GetProcessHeap(), 0, buffer ); return NULL; @@ -586,19 +586,6 @@ static struct pid_map *get_pid_map( unsigned int *num_entries ) pos = (pos + 7) & ~7; process = (const struct process_info *)(buffer + pos); - if (i >= map_count) - { - struct pid_map *new_map; - map_count *= 2; - if (!(new_map = HeapReAlloc( GetProcessHeap(), 0, map, map_count * sizeof(*map)))) - { - HeapFree( GetProcessHeap(), 0, map ); - HeapFree( GetProcessHeap(), 0, buffer ); - return NULL; - } - map = new_map; - } - map[i].pid = process->pid; map[i].unix_pid = process->unix_pid;
1
0
0
0
Rémi Bernon : winebus.sys: Unlink device before releasing it.
by Alexandre Julliard
16 Aug '21
16 Aug '21
Module: wine Branch: master Commit: db410052a397d257dbbe88903336285741d8cb0b URL:
https://source.winehq.org/git/wine.git/?a=commit;h=db410052a397d257dbbe8890…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Mon Aug 16 09:04:28 2021 +0200 winebus.sys: Unlink device before releasing it. Otherwise the device will still be linked in the device list and any thread iterating it to find a matching device will access stale pointer. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winebus.sys/main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/winebus.sys/main.c b/dlls/winebus.sys/main.c index 23c40e6895e..a60e3cc9a2c 100644 --- a/dlls/winebus.sys/main.c +++ b/dlls/winebus.sys/main.c @@ -712,6 +712,7 @@ static NTSTATUS pdo_pnp_dispatch(DEVICE_OBJECT *device, IRP *irp) remove_pending_irps(device); + bus_unlink_hid_device(device); ext->vtbl->free_device(device); ext->cs.DebugInfo->Spare[0] = 0;
1
0
0
0
← Newer
1
...
53
54
55
56
57
58
59
...
106
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
Results per page:
10
25
50
100
200