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
September 2012
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
2 participants
828 discussions
Start a n
N
ew thread
André Hentschel : iphlpapi: Implement GetIcmpStatisticsEx on Linux.
by Alexandre Julliard
20 Sep '12
20 Sep '12
Module: wine Branch: master Commit: 92e24af5e8f3849ed4282afba8c468fc98aec578 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=92e24af5e8f3849ed4282afba…
Author: André Hentschel <nerv(a)dawncrow.de> Date: Wed Sep 19 23:53:37 2012 +0200 iphlpapi: Implement GetIcmpStatisticsEx on Linux. --- dlls/iphlpapi/iphlpapi.spec | 2 +- dlls/iphlpapi/ipstats.c | 172 ++++++++++++++++++++++++++++++++++++++++ dlls/iphlpapi/tests/iphlpapi.c | 6 +- include/ipmib.h | 36 ++++++++ 4 files changed, 214 insertions(+), 2 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=92e24af5e8f3849ed4282…
1
0
0
0
André Hentschel : iphlpapi: Implement GetUdpStatisticsEx on Linux.
by Alexandre Julliard
20 Sep '12
20 Sep '12
Module: wine Branch: master Commit: 5e3cc410044eab23a0368389456cc32779948506 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5e3cc410044eab23a03683894…
Author: André Hentschel <nerv(a)dawncrow.de> Date: Wed Sep 19 23:52:30 2012 +0200 iphlpapi: Implement GetUdpStatisticsEx on Linux. --- dlls/iphlpapi/iphlpapi.spec | 2 +- dlls/iphlpapi/ipstats.c | 78 ++++++++++++++++++++++++++++++++++++++-- dlls/iphlpapi/tests/iphlpapi.c | 22 +++++++----- 3 files changed, 89 insertions(+), 13 deletions(-) diff --git a/dlls/iphlpapi/iphlpapi.spec b/dlls/iphlpapi/iphlpapi.spec index 1bf4a71..d1cf196 100644 --- a/dlls/iphlpapi/iphlpapi.spec +++ b/dlls/iphlpapi/iphlpapi.spec @@ -142,7 +142,7 @@ @ stub GetTcpTableFromStack #@ stub GetTeredoPort #@ stub GetUdp6Table -#@ stub GetUdpStatisticsEx +@ stdcall GetUdpStatisticsEx( ptr long ) @ stdcall GetUdpStatistics( ptr ) @ stub GetUdpStatsFromStack @ stdcall GetUdpTable( ptr ptr long ) diff --git a/dlls/iphlpapi/ipstats.c b/dlls/iphlpapi/ipstats.c index 65c070d..f314745 100644 --- a/dlls/iphlpapi/ipstats.c +++ b/dlls/iphlpapi/ipstats.c @@ -943,22 +943,78 @@ DWORD WINAPI GetTcpStatistics(PMIB_TCPSTATS stats) /****************************************************************** * GetUdpStatistics (IPHLPAPI.@) * - * Get the UDP statistics for the local computer. + * Get the IPv4 and IPv6 UDP statistics for the local computer. * * PARAMS * stats [Out] buffer for UDP statistics + * family [In] specifies wether IPv4 or IPv6 statistics are returned * * RETURNS * Success: NO_ERROR * Failure: error code from winerror.h */ -DWORD WINAPI GetUdpStatistics(PMIB_UDPSTATS stats) +DWORD WINAPI GetUdpStatisticsEx(PMIB_UDPSTATS stats, DWORD family) { DWORD ret = ERROR_NOT_SUPPORTED; if (!stats) return ERROR_INVALID_PARAMETER; + if (family != WS_AF_INET && family != WS_AF_INET6) return ERROR_INVALID_PARAMETER; memset( stats, 0, sizeof(*stats) ); + stats->dwNumAddrs = getNumInterfaces(); + + if (family == WS_AF_INET6) + { +#ifdef __linux__ + { + FILE *fp; + + if ((fp = fopen("/proc/net/snmp6", "r"))) + { + struct { + const char *name; + DWORD *elem; + } udpstatlist[] = { + { "Udp6InDatagrams", &stats->dwInDatagrams }, + { "Udp6NoPorts", &stats->dwNoPorts }, + { "Udp6InErrors", &stats->dwInErrors }, + { "Udp6OutDatagrams", &stats->dwOutDatagrams }, + }; + char buf[512], *ptr, *value; + DWORD res, i; + + while ((ptr = fgets(buf, sizeof(buf), fp))) + { + if (!(value = strchr(buf, ' '))) + continue; + + /* terminate the valuename */ + ptr = value - 1; + *(ptr + 1) = '\0'; + + /* and strip leading spaces from value */ + value += 1; + while (*value==' ') value++; + if ((ptr = strchr(value, '\n'))) + *ptr='\0'; + + for (i = 0; i < sizeof(udpstatlist)/sizeof(udpstatlist[0]); i++) + if (!strcasecmp(buf, udpstatlist[i].name)) + { + if (sscanf(value, "%d", &res)) *udpstatlist[i].elem = res; + continue; + } + } + fclose(fp); + ret = NO_ERROR; + } + } +#else + FIXME( "unimplemented for IPv6\n" ); +#endif + return ret; + } + #ifdef __linux__ { FILE *fp; @@ -1035,11 +1091,27 @@ DWORD WINAPI GetUdpStatistics(PMIB_UDPSTATS stats) else ERR ("failed to get udpstat\n"); } #else - FIXME( "unimplemented\n" ); + FIXME( "unimplemented for IPv4\n" ); #endif return ret; } +/****************************************************************** + * GetUdpStatistics (IPHLPAPI.@) + * + * Get the UDP statistics for the local computer. + * + * PARAMS + * stats [Out] buffer for UDP statistics + * + * RETURNS + * Success: NO_ERROR + * Failure: error code from winerror.h + */ +DWORD WINAPI GetUdpStatistics(PMIB_UDPSTATS stats) +{ + return GetUdpStatisticsEx(stats, WS_AF_INET); +} static MIB_IPFORWARDTABLE *append_ipforward_row( HANDLE heap, DWORD flags, MIB_IPFORWARDTABLE *table, DWORD *count, const MIB_IPFORWARDROW *row ) diff --git a/dlls/iphlpapi/tests/iphlpapi.c b/dlls/iphlpapi/tests/iphlpapi.c index 1c0e2cc..02a299f 100644 --- a/dlls/iphlpapi/tests/iphlpapi.c +++ b/dlls/iphlpapi/tests/iphlpapi.c @@ -546,7 +546,7 @@ static void testGetIcmpStatisticsEx(void) if (apiReturn == NO_ERROR && winetest_debug > 1) { INT i; - trace( "ICMP Ex stats: %8s %8s\n", "in", "out" ); + trace( "ICMP IPv4 Ex stats: %8s %8s\n", "in", "out" ); trace( " dwMsgs: %8u %8u\n", stats.icmpInStats.dwMsgs, stats.icmpOutStats.dwMsgs ); trace( " dwErrors: %8u %8u\n", stats.icmpInStats.dwErrors, stats.icmpOutStats.dwErrors ); for (i = 0; i < 256; i++) @@ -559,7 +559,7 @@ static void testGetIcmpStatisticsEx(void) if (apiReturn == NO_ERROR && winetest_debug > 1) { INT i; - trace( "ICMP Ex stats: %8s %8s\n", "in", "out" ); + trace( "ICMP IPv6 Ex stats: %8s %8s\n", "in", "out" ); trace( " dwMsgs: %8u %8u\n", stats.icmpInStats.dwMsgs, stats.icmpOutStats.dwMsgs ); trace( " dwErrors: %8u %8u\n", stats.icmpInStats.dwErrors, stats.icmpOutStats.dwErrors ); for (i = 0; i < 256; i++) @@ -590,7 +590,7 @@ static void testGetIpStatisticsEx(void) ok(apiReturn == NO_ERROR, "GetIpStatisticsEx returned %d, expected NO_ERROR\n", apiReturn); if (apiReturn == NO_ERROR && winetest_debug > 1) { - trace( "IP Ex stats:\n" ); + trace( "IP IPv4 Ex stats:\n" ); trace( " dwForwarding: %u\n", U(stats).dwForwarding ); trace( " dwDefaultTTL: %u\n", stats.dwDefaultTTL ); trace( " dwInReceives: %u\n", stats.dwInReceives ); @@ -621,7 +621,7 @@ static void testGetIpStatisticsEx(void) "GetIpStatisticsEx returned %d, expected NO_ERROR\n", apiReturn); if (apiReturn == NO_ERROR && winetest_debug > 1) { - trace( "IP Ex stats:\n" ); + trace( "IP IPv6 Ex stats:\n" ); trace( " dwForwarding: %u\n", U(stats).dwForwarding ); trace( " dwDefaultTTL: %u\n", stats.dwDefaultTTL ); trace( " dwInReceives: %u\n", stats.dwInReceives ); @@ -667,7 +667,7 @@ static void testGetTcpStatisticsEx(void) ok(apiReturn == NO_ERROR, "GetTcpStatisticsEx returned %d, expected NO_ERROR\n", apiReturn); if (apiReturn == NO_ERROR && winetest_debug > 1) { - trace( "TCP stats:\n" ); + trace( "TCP IPv4 Ex stats:\n" ); trace( " dwRtoAlgorithm: %u\n", U(stats).dwRtoAlgorithm ); trace( " dwRtoMin: %u\n", stats.dwRtoMin ); trace( " dwRtoMax: %u\n", stats.dwRtoMax ); @@ -690,7 +690,7 @@ static void testGetTcpStatisticsEx(void) "GetTcpStatisticsEx returned %d, expected NO_ERROR\n", apiReturn); if (apiReturn == NO_ERROR && winetest_debug > 1) { - trace( "TCP stats:\n" ); + trace( "TCP IPv6 Ex stats:\n" ); trace( " dwRtoAlgorithm: %u\n", U(stats).dwRtoAlgorithm ); trace( " dwRtoMin: %u\n", stats.dwRtoMin ); trace( " dwRtoMax: %u\n", stats.dwRtoMax ); @@ -716,7 +716,7 @@ static void testGetUdpStatisticsEx(void) if (!pGetUdpStatisticsEx) { - skip( "GetUdpStatisticsEx not available\n" ); + win_skip( "GetUdpStatisticsEx not available\n" ); return; } @@ -724,11 +724,15 @@ static void testGetUdpStatisticsEx(void) ok(apiReturn == ERROR_INVALID_PARAMETER, "GetUdpStatisticsEx(NULL, AF_INET); returned %d, expected ERROR_INVALID_PARAMETER\n", apiReturn); + apiReturn = pGetUdpStatisticsEx(&stats, AF_BAN); + ok(apiReturn == ERROR_INVALID_PARAMETER || apiReturn == ERROR_NOT_SUPPORTED, + "GetUdpStatisticsEx(&stats, AF_BAN) returned %d, expected ERROR_INVALID_PARAMETER\n", apiReturn); + apiReturn = pGetUdpStatisticsEx(&stats, AF_INET); ok(apiReturn == NO_ERROR, "GetUdpStatisticsEx returned %d, expected NO_ERROR\n", apiReturn); if (apiReturn == NO_ERROR && winetest_debug > 1) { - trace( "UDP stats:\n" ); + trace( "UDP IPv4 Ex stats:\n" ); trace( " dwInDatagrams: %u\n", stats.dwInDatagrams ); trace( " dwNoPorts: %u\n", stats.dwNoPorts ); trace( " dwInErrors: %u\n", stats.dwInErrors ); @@ -741,7 +745,7 @@ static void testGetUdpStatisticsEx(void) "GetUdpStatisticsEx returned %d, expected NO_ERROR\n", apiReturn); if (apiReturn == NO_ERROR && winetest_debug > 1) { - trace( "UDP stats:\n" ); + trace( "UDP IPv6 Ex stats:\n" ); trace( " dwInDatagrams: %u\n", stats.dwInDatagrams ); trace( " dwNoPorts: %u\n", stats.dwNoPorts ); trace( " dwInErrors: %u\n", stats.dwInErrors );
1
0
0
0
André Hentschel : iphlpapi: Implement GetIpStatisticsEx on Linux.
by Alexandre Julliard
20 Sep '12
20 Sep '12
Module: wine Branch: master Commit: f2626c31af9ab192b9fc5a6132848687c3da3fb9 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f2626c31af9ab192b9fc5a613…
Author: André Hentschel <nerv(a)dawncrow.de> Date: Wed Sep 19 23:48:59 2012 +0200 iphlpapi: Implement GetIpStatisticsEx on Linux. --- dlls/iphlpapi/iphlpapi.spec | 2 +- dlls/iphlpapi/ipstats.c | 92 ++++++++++++++++++++++++++++++++++++++-- dlls/iphlpapi/tests/iphlpapi.c | 6 ++- 3 files changed, 94 insertions(+), 6 deletions(-) diff --git a/dlls/iphlpapi/iphlpapi.spec b/dlls/iphlpapi/iphlpapi.spec index cadb247..1bf4a71 100644 --- a/dlls/iphlpapi/iphlpapi.spec +++ b/dlls/iphlpapi/iphlpapi.spec @@ -112,7 +112,7 @@ @ stub GetIpNetTableFromStack #@ stub GetIpPathEntry #@ stub GetIpPathTable -#@ stub GetIpStatisticsEx +@ stdcall GetIpStatisticsEx( ptr long ) @ stdcall GetIpStatistics( ptr ) @ stub GetIpStatsFromStack #@ stub GetMulticastIpAddressEntry diff --git a/dlls/iphlpapi/ipstats.c b/dlls/iphlpapi/ipstats.c index 7c64b41..65c070d 100644 --- a/dlls/iphlpapi/ipstats.c +++ b/dlls/iphlpapi/ipstats.c @@ -553,23 +553,25 @@ DWORD WINAPI GetIcmpStatistics(PMIB_ICMP stats) /****************************************************************** - * GetIpStatistics (IPHLPAPI.@) + * GetIpStatisticsEx (IPHLPAPI.@) * - * Get the IP statistics for the local computer. + * Get the IPv4 and IPv6 statistics for the local computer. * * PARAMS * stats [Out] buffer for IP statistics + * family [In] specifies wether IPv4 or IPv6 statistics are returned * * RETURNS * Success: NO_ERROR * Failure: error code from winerror.h */ -DWORD WINAPI GetIpStatistics(PMIB_IPSTATS stats) +DWORD WINAPI GetIpStatisticsEx(PMIB_IPSTATS stats, DWORD family) { DWORD ret = ERROR_NOT_SUPPORTED; MIB_IPFORWARDTABLE *fwd_table; if (!stats) return ERROR_INVALID_PARAMETER; + if (family != WS_AF_INET && family != WS_AF_INET6) return ERROR_INVALID_PARAMETER; memset( stats, 0, sizeof(*stats) ); stats->dwNumIf = stats->dwNumAddr = getNumInterfaces(); @@ -579,6 +581,72 @@ DWORD WINAPI GetIpStatistics(PMIB_IPSTATS stats) HeapFree( GetProcessHeap(), 0, fwd_table ); } + if (family == WS_AF_INET6) + { +#ifdef __linux__ + { + FILE *fp; + + if ((fp = fopen("/proc/net/snmp6", "r"))) + { + struct { + const char *name; + DWORD *elem; + } ipstatlist[] = { + { "Ip6InReceives", &stats->dwInReceives }, + { "Ip6InHdrErrors", &stats->dwInHdrErrors }, + { "Ip6InAddrErrors", &stats->dwInAddrErrors }, + { "Ip6OutForwDatagrams", &stats->dwForwDatagrams }, + { "Ip6InUnknownProtos", &stats->dwInUnknownProtos }, + { "Ip6InDiscards", &stats->dwInDiscards }, + { "Ip6InDelivers", &stats->dwInDelivers }, + { "Ip6OutRequests", &stats->dwOutRequests }, + { "Ip6OutDiscards", &stats->dwOutDiscards }, + { "Ip6OutNoRoutes", &stats->dwOutNoRoutes }, + { "Ip6ReasmTimeout", &stats->dwReasmTimeout }, + { "Ip6ReasmReqds", &stats->dwReasmReqds }, + { "Ip6ReasmOKs", &stats->dwReasmOks }, + { "Ip6ReasmFails", &stats->dwReasmFails }, + { "Ip6FragOKs", &stats->dwFragOks }, + { "Ip6FragFails", &stats->dwFragFails }, + { "Ip6FragCreates", &stats->dwFragCreates }, + /* hmm, no routingDiscards, defaultTTL and forwarding? */ + }; + char buf[512], *ptr, *value; + DWORD res, i; + + while ((ptr = fgets(buf, sizeof(buf), fp))) + { + if (!(value = strchr(buf, ' '))) + continue; + + /* terminate the valuename */ + ptr = value - 1; + *(ptr + 1) = '\0'; + + /* and strip leading spaces from value */ + value += 1; + while (*value==' ') value++; + if ((ptr = strchr(value, '\n'))) + *ptr='\0'; + + for (i = 0; i < sizeof(ipstatlist)/sizeof(ipstatlist[0]); i++) + if (!strcasecmp(buf, ipstatlist[i].name)) + { + if (sscanf(value, "%d", &res)) *ipstatlist[i].elem = res; + continue; + } + } + fclose(fp); + ret = NO_ERROR; + } + } +#else + FIXME( "unimplemented for IPv6\n" ); +#endif + return ret; + } + #ifdef __linux__ { FILE *fp; @@ -712,11 +780,27 @@ DWORD WINAPI GetIpStatistics(PMIB_IPSTATS stats) ret = NO_ERROR; } #else - FIXME( "unimplemented\n" ); + FIXME( "unimplemented for IPv4\n" ); #endif return ret; } +/****************************************************************** + * GetIpStatistics (IPHLPAPI.@) + * + * Get the IP statistics for the local computer. + * + * PARAMS + * stats [Out] buffer for IP statistics + * + * RETURNS + * Success: NO_ERROR + * Failure: error code from winerror.h + */ +DWORD WINAPI GetIpStatistics(PMIB_IPSTATS stats) +{ + return GetIpStatisticsEx(stats, WS_AF_INET); +} /****************************************************************** * GetTcpStatistics (IPHLPAPI.@) diff --git a/dlls/iphlpapi/tests/iphlpapi.c b/dlls/iphlpapi/tests/iphlpapi.c index 638d7e5..1c0e2cc 100644 --- a/dlls/iphlpapi/tests/iphlpapi.c +++ b/dlls/iphlpapi/tests/iphlpapi.c @@ -574,7 +574,7 @@ static void testGetIpStatisticsEx(void) if (!pGetIpStatisticsEx) { - skip( "GetIpStatisticsEx not available\n" ); + win_skip( "GetIpStatisticsEx not available\n" ); return; } @@ -582,6 +582,10 @@ static void testGetIpStatisticsEx(void) ok(apiReturn == ERROR_INVALID_PARAMETER, "GetIpStatisticsEx(NULL, AF_INET) returned %d, expected ERROR_INVALID_PARAMETER\n", apiReturn); + apiReturn = pGetIpStatisticsEx(&stats, AF_BAN); + ok(apiReturn == ERROR_INVALID_PARAMETER, + "GetIpStatisticsEx(&stats, AF_BAN) returned %d, expected ERROR_INVALID_PARAMETER\n", apiReturn); + apiReturn = pGetIpStatisticsEx(&stats, AF_INET); ok(apiReturn == NO_ERROR, "GetIpStatisticsEx returned %d, expected NO_ERROR\n", apiReturn); if (apiReturn == NO_ERROR && winetest_debug > 1)
1
0
0
0
Jacek Caban : mshtml: Don' t do anything in handle_htmlevent if document is already detached.
by Alexandre Julliard
20 Sep '12
20 Sep '12
Module: wine Branch: master Commit: 481abdb304f1d8458dafd236016d9d487f22b3f9 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=481abdb304f1d8458dafd2360…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Thu Sep 20 15:05:07 2012 +0200 mshtml: Don't do anything in handle_htmlevent if document is already detached. --- dlls/mshtml/nsevents.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/dlls/mshtml/nsevents.c b/dlls/mshtml/nsevents.c index 3fd1962..4f970df 100644 --- a/dlls/mshtml/nsevents.c +++ b/dlls/mshtml/nsevents.c @@ -288,6 +288,11 @@ static nsresult NSAPI handle_htmlevent(nsIDOMEventListener *iface, nsIDOMEvent * TRACE("%p\n", This->This); + if(!doc) { + WARN("NULL doc\n"); + return NS_OK; + } + nsAString_Init(&type_str, NULL); nsIDOMEvent_GetType(event, &type_str); nsAString_GetData(&type_str, &type);
1
0
0
0
Jacek Caban : jscript: Get rid of unused hres.
by Alexandre Julliard
20 Sep '12
20 Sep '12
Module: wine Branch: master Commit: e374449e3052fcb29d60ed3b0b07501a6d014010 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e374449e3052fcb29d60ed3b0…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Thu Sep 20 15:04:01 2012 +0200 jscript: Get rid of unused hres. Spotted by Michael Stefaniuc. --- dlls/jscript/engine.c | 4 +--- 1 files changed, 1 insertions(+), 3 deletions(-) diff --git a/dlls/jscript/engine.c b/dlls/jscript/engine.c index 6ff55e9..d1d85fa 100644 --- a/dlls/jscript/engine.c +++ b/dlls/jscript/engine.c @@ -771,15 +771,13 @@ static HRESULT interp_end_finally(exec_ctx_t *ctx) assert(is_bool(stack_top(ctx))); if(!get_bool(stack_top(ctx))) { - HRESULT hres; - TRACE("passing exception\n"); jsval_release(v); stack_popn(ctx, 1); ctx->script->ei.val = stack_pop(ctx); - return SUCCEEDED(hres) ? DISP_E_EXCEPTION : hres; + return DISP_E_EXCEPTION; } stack_popn(ctx, 2);
1
0
0
0
Jacek Caban : jscript: Added support for RegExp.$* properties.
by Alexandre Julliard
20 Sep '12
20 Sep '12
Module: wine Branch: master Commit: 87d6e2385a028788ee89ab6beb5fc7bbcd8ec059 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=87d6e2385a028788ee89ab6be…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Thu Sep 20 15:02:55 2012 +0200 jscript: Added support for RegExp.$* properties. --- dlls/jscript/jscript.h | 11 ++-- dlls/jscript/regexp.c | 122 ++++++++++++++++++++++++++++++++++++++++++ dlls/jscript/tests/regexp.js | 23 ++++++++ 3 files changed, 151 insertions(+), 5 deletions(-) diff --git a/dlls/jscript/jscript.h b/dlls/jscript/jscript.h index 87d43e8..99d3863 100644 --- a/dlls/jscript/jscript.h +++ b/dlls/jscript/jscript.h @@ -299,6 +299,11 @@ typedef struct { jsval_t val; } jsexcept_t; +typedef struct { + const WCHAR *str; + DWORD len; +} match_result_t; + struct _script_ctx_t { LONG ref; @@ -321,6 +326,7 @@ struct _script_ctx_t { IDispatch *host_global; BSTR last_match; + match_result_t match_parens[9]; DWORD last_match_index; DWORD last_match_length; @@ -371,11 +377,6 @@ HRESULT create_vbarray_constr(script_ctx_t*,jsdisp_t*,jsdisp_t**) DECLSPEC_HIDDE IUnknown *create_ax_site(script_ctx_t*) DECLSPEC_HIDDEN; HRESULT create_jscaller(script_ctx_t*) DECLSPEC_HIDDEN; -typedef struct { - const WCHAR *str; - DWORD len; -} match_result_t; - #define REM_CHECK_GLOBAL 0x0001 #define REM_RESET_INDEX 0x0002 #define REM_NO_CTX_UPDATE 0x0004 diff --git a/dlls/jscript/regexp.c b/dlls/jscript/regexp.c index fc4be4f..b53b848 100644 --- a/dlls/jscript/regexp.c +++ b/dlls/jscript/regexp.c @@ -101,6 +101,16 @@ static const WCHAR leftContextW[] = static const WCHAR rightContextW[] = {'r','i','g','h','t','C','o','n','t','e','x','t',0}; +static const WCHAR idx1W[] = {'$','1',0}; +static const WCHAR idx2W[] = {'$','2',0}; +static const WCHAR idx3W[] = {'$','3',0}; +static const WCHAR idx4W[] = {'$','4',0}; +static const WCHAR idx5W[] = {'$','5',0}; +static const WCHAR idx6W[] = {'$','6',0}; +static const WCHAR idx7W[] = {'$','7',0}; +static const WCHAR idx8W[] = {'$','8',0}; +static const WCHAR idx9W[] = {'$','9',0}; + static const WCHAR undefinedW[] = {'u','n','d','e','f','i','n','e','d',0}; static const WCHAR emptyW[] = {0}; @@ -3388,6 +3398,23 @@ static HRESULT do_regexp_match_next(script_ctx_t *ctx, RegExpInstance *regexp, D } } + if(!(rem_flags & REM_NO_CTX_UPDATE)) { + DWORD i, n = min(sizeof(ctx->match_parens)/sizeof(ctx->match_parens[0]), regexp->jsregexp->parenCount); + + for(i=0; i < n; i++) { + if(result->parens[i].index == -1) { + ctx->match_parens[i].str = NULL; + ctx->match_parens[i].len = 0; + }else { + ctx->match_parens[i].str = ctx->last_match + result->parens[i].index; + ctx->match_parens[i].len = result->parens[i].length; + } + } + + if(n < sizeof(ctx->match_parens)/sizeof(ctx->match_parens[0])) + memset(ctx->match_parens+n, 0, sizeof(ctx->match_parens) - n*sizeof(ctx->match_parens[0])); + } + matchlen = (result->cp-*cp) - gData.skipped; *cp = result->cp; ret->str = result->cp-matchlen; @@ -4000,6 +4027,92 @@ HRESULT regexp_string_match(script_ctx_t *ctx, jsdisp_t *re, BSTR str, jsval_t * return hres; } +static HRESULT global_idx(script_ctx_t *ctx, DWORD flags, DWORD idx, jsval_t *r) +{ + switch(flags) { + case DISPATCH_PROPERTYGET: { + BSTR ret = NULL; + + ret = SysAllocStringLen(ctx->match_parens[idx].str, ctx->match_parens[idx].len); + if(!ret) + return E_OUTOFMEMORY; + + *r = jsval_string(ret); + break; + } + case DISPATCH_PROPERTYPUT: + break; + default: + FIXME("unsupported flags\n"); + return E_NOTIMPL; + } + + return S_OK; +} + +static HRESULT RegExpConstr_idx1(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, + unsigned argc, jsval_t *argv, jsval_t *r) +{ + TRACE("\n"); + return global_idx(ctx, flags, 0, r); +} + +static HRESULT RegExpConstr_idx2(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, + unsigned argc, jsval_t *argv, jsval_t *r) +{ + TRACE("\n"); + return global_idx(ctx, flags, 1, r); +} + +static HRESULT RegExpConstr_idx3(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, + unsigned argc, jsval_t *argv, jsval_t *r) +{ + TRACE("\n"); + return global_idx(ctx, flags, 2, r); +} + +static HRESULT RegExpConstr_idx4(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, + unsigned argc, jsval_t *argv, jsval_t *r) +{ + TRACE("\n"); + return global_idx(ctx, flags, 3, r); +} + +static HRESULT RegExpConstr_idx5(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, + unsigned argc, jsval_t *argv, jsval_t *r) +{ + TRACE("\n"); + return global_idx(ctx, flags, 4, r); +} + +static HRESULT RegExpConstr_idx6(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, + unsigned argc, jsval_t *argv, jsval_t *r) +{ + TRACE("\n"); + return global_idx(ctx, flags, 5, r); +} + +static HRESULT RegExpConstr_idx7(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, + unsigned argc, jsval_t *argv, jsval_t *r) +{ + TRACE("\n"); + return global_idx(ctx, flags, 6, r); +} + +static HRESULT RegExpConstr_idx8(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, + unsigned argc, jsval_t *argv, jsval_t *r) +{ + TRACE("\n"); + return global_idx(ctx, flags, 7, r); +} + +static HRESULT RegExpConstr_idx9(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, + unsigned argc, jsval_t *argv, jsval_t *r) +{ + TRACE("\n"); + return global_idx(ctx, flags, 8, r); +} + static HRESULT RegExpConstr_leftContext(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r) { @@ -4108,6 +4221,15 @@ static HRESULT RegExpConstr_value(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags } static const builtin_prop_t RegExpConstr_props[] = { + {idx1W, RegExpConstr_idx1, 0}, + {idx2W, RegExpConstr_idx2, 0}, + {idx3W, RegExpConstr_idx3, 0}, + {idx4W, RegExpConstr_idx4, 0}, + {idx5W, RegExpConstr_idx5, 0}, + {idx6W, RegExpConstr_idx6, 0}, + {idx7W, RegExpConstr_idx7, 0}, + {idx8W, RegExpConstr_idx8, 0}, + {idx9W, RegExpConstr_idx9, 0}, {leftContextW, RegExpConstr_leftContext, 0}, {rightContextW, RegExpConstr_rightContext, 0} }; diff --git a/dlls/jscript/tests/regexp.js b/dlls/jscript/tests/regexp.js index 7b363dd..38d5377 100644 --- a/dlls/jscript/tests/regexp.js +++ b/dlls/jscript/tests/regexp.js @@ -598,4 +598,27 @@ ok(tmp === "x*y", '"x/y".replace(/[/]/, "*") = ' + tmp); tmp = "x/y".replace(/[xy/]/g, "*"); ok(tmp === "***", '"x/y".replace(/[xy/]/, "*") = ' + tmp); +/(b)/.exec("abc"); +ok(RegExp.$1 === "b", "RegExp.$1 = " + RegExp.$1); +ok("$2" in RegExp, "RegExp.$2 doesn't exist"); +ok(RegExp.$2 === "", "RegExp.$2 = " + RegExp.$2); +ok(RegExp.$9 === "", "RegExp.$9 = " + RegExp.$9); +ok(!("$10" in RegExp), "RegExp.$10 exists"); + +/(b)(b)(b)(b)(b)(b)(b)(b)(b)(b)(b)/.exec("abbbbbbbbbbbc"); +ok(RegExp.$1 === "b", "RegExp.$1 = " + RegExp.$1); +ok(RegExp.$2 === "b", "[2] RegExp.$2 = " + RegExp.$2); +ok(RegExp.$9 === "b", "RegExp.$9 = " + RegExp.$9); +ok(!("$10" in RegExp), "RegExp.$10 exists"); + +/(b)/.exec("abc"); +ok(RegExp.$1 === "b", "RegExp.$1 = " + RegExp.$1); +ok("$2" in RegExp, "RegExp.$2 doesn't exist"); +ok(RegExp.$2 === "", "RegExp.$2 = " + RegExp.$2); +ok(RegExp.$9 === "", "RegExp.$9 = " + RegExp.$9); +ok(!("$10" in RegExp), "RegExp.$10 exists"); + +RegExp.$1 = "a"; +ok(RegExp.$1 === "b", "RegExp.$1 = " + RegExp.$1); + reportSuccess();
1
0
0
0
Michael Stefaniuc : user32: Remove superfluous function pointer casts.
by Alexandre Julliard
20 Sep '12
20 Sep '12
Module: wine Branch: master Commit: 1e5328c77c861e163081b5e084b648bc6f6a72e8 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1e5328c77c861e163081b5e08…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Thu Sep 20 13:29:17 2012 +0200 user32: Remove superfluous function pointer casts. --- dlls/user32/dialog.c | 3 +-- dlls/user32/tests/msg.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/dlls/user32/dialog.c b/dlls/user32/dialog.c index f0fdf49..497d545 100644 --- a/dlls/user32/dialog.c +++ b/dlls/user32/dialog.c @@ -1513,8 +1513,7 @@ BOOL WINAPI CheckRadioButton( HWND hwndDlg, int firstID, radioGroup.lastID = lastID; radioGroup.checkID = checkID; - return EnumChildWindows(hwndDlg, (WNDENUMPROC)CheckRB, - (LPARAM)&radioGroup); + return EnumChildWindows(hwndDlg, CheckRB, (LPARAM)&radioGroup); } diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c index 2e4ad7d..7d14b12 100644 --- a/dlls/user32/tests/msg.c +++ b/dlls/user32/tests/msg.c @@ -11268,8 +11268,7 @@ static void test_EndDialog(void) ok(GetClassInfo(0, "#32770", &cls), "GetClassInfo failed\n"); cls.lpszClassName = "MyDialogClass"; cls.hInstance = GetModuleHandle(0); - /* need a cast since a dlgproc is used as a wndproc */ - cls.lpfnWndProc = (WNDPROC)test_dlg_proc; + cls.lpfnWndProc = test_dlg_proc; if (!RegisterClass(&cls)) assert(0); flush_sequence();
1
0
0
0
Francois Gouget : comdlg32: Make FD31_GetFldrHeight() static.
by Alexandre Julliard
20 Sep '12
20 Sep '12
Module: wine Branch: master Commit: bfd9cd1c427584d96b31f6d8a961990178d31fb5 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=bfd9cd1c427584d96b31f6d8a…
Author: Francois Gouget <fgouget(a)free.fr> Date: Thu Sep 20 11:06:29 2012 +0200 comdlg32: Make FD31_GetFldrHeight() static. --- dlls/comdlg32/filedlg31.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/dlls/comdlg32/filedlg31.c b/dlls/comdlg32/filedlg31.c index 4ede0b3..4a78958 100644 --- a/dlls/comdlg32/filedlg31.c +++ b/dlls/comdlg32/filedlg31.c @@ -1069,7 +1069,7 @@ static LONG FD31_WMInitDialog(HWND hWnd, WPARAM wParam, LPARAM lParam) return TRUE; } -int FD31_GetFldrHeight(void) +static int FD31_GetFldrHeight(void) { return fldrHeight; }
1
0
0
0
Christian Costa : dmusic: Rename params of SynthPortImpl_IDirectMusicPort_DownloadInstrument.
by Alexandre Julliard
20 Sep '12
20 Sep '12
Module: wine Branch: master Commit: 4262ecf91039c258de8b510f59a4ccd031e3e062 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4262ecf91039c258de8b510f5…
Author: Christian Costa <titan.costa(a)gmail.com> Date: Thu Sep 20 00:17:35 2012 +0200 dmusic: Rename params of SynthPortImpl_IDirectMusicPort_DownloadInstrument. --- dlls/dmusic/port.c | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dlls/dmusic/port.c b/dlls/dmusic/port.c index bc9c3e7..cfe4265 100644 --- a/dlls/dmusic/port.c +++ b/dlls/dmusic/port.c @@ -146,16 +146,16 @@ static HRESULT WINAPI SynthPortImpl_IDirectMusicPort_Read(LPDIRECTMUSICPORT ifac return S_OK; } -static HRESULT WINAPI SynthPortImpl_IDirectMusicPort_DownloadInstrument(LPDIRECTMUSICPORT iface, IDirectMusicInstrument* pInstrument, IDirectMusicDownloadedInstrument** ppDownloadedInstrument, DMUS_NOTERANGE* pNoteRanges, DWORD dwNumNoteRanges) +static HRESULT WINAPI SynthPortImpl_IDirectMusicPort_DownloadInstrument(LPDIRECTMUSICPORT iface, IDirectMusicInstrument* instrument, IDirectMusicDownloadedInstrument** downloaded_instrument, DMUS_NOTERANGE* note_ranges, DWORD num_note_ranges) { - SynthPortImpl *This = impl_from_SynthPortImpl_IDirectMusicPort(iface); + SynthPortImpl *This = impl_from_SynthPortImpl_IDirectMusicPort(iface); - FIXME("(%p, %p, %p, %p, %d): stub\n", This, pInstrument, ppDownloadedInstrument, pNoteRanges, dwNumNoteRanges); + FIXME("(%p/%p)->(%p, %p, %p, %d): stub\n", iface, This, instrument, downloaded_instrument, note_ranges, num_note_ranges); - if (!pInstrument || !ppDownloadedInstrument || (dwNumNoteRanges && !pNoteRanges)) - return E_POINTER; + if (!instrument || !downloaded_instrument || (num_note_ranges && !note_ranges)) + return E_POINTER; - return DMUSIC_CreateDirectMusicDownloadedInstrumentImpl(&IID_IDirectMusicDownloadedInstrument, (LPVOID*)ppDownloadedInstrument, NULL); + return DMUSIC_CreateDirectMusicDownloadedInstrumentImpl(&IID_IDirectMusicDownloadedInstrument, (LPVOID*)downloaded_instrument, NULL); } static HRESULT WINAPI SynthPortImpl_IDirectMusicPort_UnloadInstrument(LPDIRECTMUSICPORT iface, IDirectMusicDownloadedInstrument *downloaded_instrument)
1
0
0
0
Christian Costa : dmusic: Add comments to Synth port vtables.
by Alexandre Julliard
20 Sep '12
20 Sep '12
Module: wine Branch: master Commit: 57e6d416d6390b46ac5cef09948465ebd95398e6 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=57e6d416d6390b46ac5cef099…
Author: Christian Costa <titan.costa(a)gmail.com> Date: Thu Sep 20 00:17:28 2012 +0200 dmusic: Add comments to Synth port vtables. --- dlls/dmusic/port.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/dlls/dmusic/port.c b/dlls/dmusic/port.c index 5a7776a..bc9c3e7 100644 --- a/dlls/dmusic/port.c +++ b/dlls/dmusic/port.c @@ -332,9 +332,11 @@ static HRESULT WINAPI SynthPortImpl_IDirectMusicPort_GetFormat(LPDIRECTMUSICPORT } static const IDirectMusicPortVtbl SynthPortImpl_DirectMusicPort_Vtbl = { + /**** IDirectMusicPort IUnknown part methods ***/ SynthPortImpl_IDirectMusicPort_QueryInterface, SynthPortImpl_IDirectMusicPort_AddRef, SynthPortImpl_IDirectMusicPort_Release, + /**** IDirectMusicPort methods ***/ SynthPortImpl_IDirectMusicPort_PlayBuffer, SynthPortImpl_IDirectMusicPort_SetReadNotificationHandle, SynthPortImpl_IDirectMusicPort_Read, @@ -441,9 +443,11 @@ static HRESULT WINAPI SynthPortImpl_IDirectMusicPortDownload_Unload(LPDIRECTMUSI } static const IDirectMusicPortDownloadVtbl SynthPortImpl_DirectMusicPortDownload_Vtbl = { + /*** IDirectMusicPortDownload IUnknown part methods ***/ SynthPortImpl_IDirectMusicPortDownload_QueryInterface, SynthPortImpl_IDirectMusicPortDownload_AddRef, SynthPortImpl_IDirectMusicPortDownload_Release, + /*** IDirectMusicPortDownload methods ***/ SynthPortImpl_IDirectMusicPortDownload_GetBuffer, SynthPortImpl_IDirectMusicPortDownload_AllocateBuffer, SynthPortImpl_IDirectMusicPortDownload_GetDLId, @@ -492,9 +496,11 @@ static HRESULT WINAPI SynthPortImpl_IDirectMusicThru_ThruChannel(LPDIRECTMUSICTH } static const IDirectMusicThruVtbl SynthPortImpl_DirectMusicThru_Vtbl = { + /*** IDirectMusicThru IUnknown part methods */ SynthPortImpl_IDirectMusicThru_QueryInterface, SynthPortImpl_IDirectMusicThru_AddRef, SynthPortImpl_IDirectMusicThru_Release, + /*** IDirectMusicThru methods ***/ SynthPortImpl_IDirectMusicThru_ThruChannel };
1
0
0
0
← Newer
1
...
28
29
30
31
32
33
34
...
83
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
Results per page:
10
25
50
100
200