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
July 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
728 discussions
Start a n
N
ew thread
Alistair Leslie-Hughes : dbghelp: Initialize new structure members.
by Alexandre Julliard
20 Jul '21
20 Jul '21
Module: wine Branch: master Commit: bad67b14214b8d64719cf4b8473d7cd45acfc303 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=bad67b14214b8d64719cf4b8…
Author: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Date: Sat Jul 17 08:17:39 2021 +1000 dbghelp: Initialize new structure members. Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dbghelp/module.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dlls/dbghelp/module.c b/dlls/dbghelp/module.c index cadb285accb..247aadcef0e 100644 --- a/dlls/dbghelp/module.c +++ b/dlls/dbghelp/module.c @@ -207,6 +207,8 @@ struct module* module_new(struct process* pcs, const WCHAR* name, module->module.TypeInfo = FALSE; module->module.SourceIndexed = FALSE; module->module.Publics = FALSE; + module->module.MachineType = 0; + module->module.Reserved = 0; module->reloc_delta = 0; module->type = type; @@ -1201,6 +1203,8 @@ BOOL WINAPI SymGetModuleInfo64(HANDLE hProcess, DWORD64 dwAddr, mi64.TypeInfo = miw64.TypeInfo; mi64.SourceIndexed = miw64.SourceIndexed; mi64.Publics = miw64.Publics; + mi64.MachineType = miw64.MachineType; + mi64.Reserved = miw64.Reserved; memcpy(ModuleInfo, &mi64, ModuleInfo->SizeOfStruct);
1
0
0
0
Alistair Leslie-Hughes : include: Update _IMAGEHLP_MODULEW64 stucture.
by Alexandre Julliard
20 Jul '21
20 Jul '21
Module: wine Branch: master Commit: 95580835bb048508f1a5ba6f6b56ff8d4083178e URL:
https://source.winehq.org/git/wine.git/?a=commit;h=95580835bb048508f1a5ba6f…
Author: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Date: Sat Jul 17 08:17:38 2021 +1000 include: Update _IMAGEHLP_MODULEW64 stucture. Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- include/dbghelp.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/dbghelp.h b/include/dbghelp.h index 1b234899195..303c0109d1f 100644 --- a/include/dbghelp.h +++ b/include/dbghelp.h @@ -280,6 +280,8 @@ typedef struct _IMAGEHLP_MODULE64 BOOL TypeInfo; BOOL SourceIndexed; BOOL Publics; + DWORD MachineType; + DWORD Reserved; } IMAGEHLP_MODULE64, *PIMAGEHLP_MODULE64; typedef struct _IMAGEHLP_MODULEW64 @@ -307,6 +309,8 @@ typedef struct _IMAGEHLP_MODULEW64 BOOL TypeInfo; BOOL SourceIndexed; BOOL Publics; + DWORD MachineType; + DWORD Reserved; } IMAGEHLP_MODULEW64, *PIMAGEHLP_MODULEW64; #if !defined(_IMAGEHLP_SOURCE_) && defined(_IMAGEHLP64)
1
0
0
0
Paul Gofman : ntdll: Comment out stubs for Nt and Zw functions.
by Alexandre Julliard
20 Jul '21
20 Jul '21
Module: wine Branch: master Commit: 52202224d9ab8316896370db2af6399a5fb7b916 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=52202224d9ab8316896370db…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Tue Jul 20 12:59:54 2021 +0300 ntdll: Comment out stubs for Nt and Zw functions. Signed-off-by: Paul Gofman <pgofman(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/ntdll.spec | 188 ++++++++++++++++++++++++------------------------ dlls/ntdll/tests/port.c | 4 +- 2 files changed, 96 insertions(+), 96 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=52202224d9ab83168963…
1
0
0
0
Huw Davies : netapi32: Default to CP_UTF8 when WINEUNIXCP is not set.
by Alexandre Julliard
20 Jul '21
20 Jul '21
Module: wine Branch: master Commit: 4c10543b6a54cdcc57b5ce7efd839b17d60471e6 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=4c10543b6a54cdcc57b5ce7e…
Author: Huw Davies <huw(a)codeweavers.com> Date: Tue Jul 20 08:44:19 2021 +0100 netapi32: Default to CP_UTF8 when WINEUNIXCP is not set. Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/netapi32/unixlib.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/dlls/netapi32/unixlib.c b/dlls/netapi32/unixlib.c index 6a8999a6de4..cd04a1116ce 100644 --- a/dlls/netapi32/unixlib.c +++ b/dlls/netapi32/unixlib.c @@ -68,9 +68,9 @@ static NET_API_STATUS (*pNetShareDel)( const char *, const char *, unsigned int static NET_API_STATUS (*pNetWkstaGetInfo)( const char *, unsigned int, unsigned char ** ); static CPTABLEINFO unix_cptable; -static ULONG unix_cp; +static ULONG unix_cp = CP_UTF8; -static BOOL get_unix_codepage(void) +static DWORD WINAPI get_unix_codepage_once( RTL_RUN_ONCE *once, void *param, void **context ) { static const WCHAR wineunixcpW[] = {'W','I','N','E','U','N','I','X','C','P',0}; UNICODE_STRING name, value; @@ -78,19 +78,23 @@ static BOOL get_unix_codepage(void) SIZE_T size; void *ptr; - if (unix_cp) return TRUE; - RtlInitUnicodeString( &name, wineunixcpW ); value.Buffer = value_buffer; value.MaximumLength = sizeof(value_buffer); if (!RtlQueryEnvironmentVariable_U( NULL, &name, &value )) RtlUnicodeStringToInteger( &value, 10, &unix_cp ); - if (NtGetNlsSectionPtr( 11, unix_cp, NULL, &ptr, &size )) - return FALSE; - RtlInitCodePageTable( ptr, &unix_cptable ); + if (unix_cp != CP_UTF8 && !NtGetNlsSectionPtr( 11, unix_cp, NULL, &ptr, &size )) + RtlInitCodePageTable( ptr, &unix_cptable ); return TRUE; } +static BOOL get_unix_codepage( void ) +{ + static RTL_RUN_ONCE once = RTL_RUN_ONCE_INIT; + + return !RtlRunOnceExecuteOnce( &once, get_unix_codepage_once, NULL, NULL ); +} + static DWORD netapi_wcstoumbs( const WCHAR *src, char *dst, DWORD dstlen ) { DWORD srclen = (strlenW( src ) + 1) * sizeof(WCHAR);
1
0
0
0
Huw Davies : iphlpapi: Implement GetUnicastIpAddressEntry() on top of nsi.
by Alexandre Julliard
20 Jul '21
20 Jul '21
Module: wine Branch: master Commit: 67c8a82f3d0a43709a3be622dbe15a5ff8165475 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=67c8a82f3d0a43709a3be622…
Author: Huw Davies <huw(a)codeweavers.com> Date: Tue Jul 20 08:43:27 2021 +0100 iphlpapi: Implement GetUnicastIpAddressEntry() 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 | 87 ++++++++++++++++-------------------------- dlls/iphlpapi/tests/iphlpapi.c | 4 +- 2 files changed, 35 insertions(+), 56 deletions(-) diff --git a/dlls/iphlpapi/iphlpapi_main.c b/dlls/iphlpapi/iphlpapi_main.c index f4e6ea1a504..93d9b0440dd 100644 --- a/dlls/iphlpapi/iphlpapi_main.c +++ b/dlls/iphlpapi/iphlpapi_main.c @@ -2696,69 +2696,48 @@ static void unicast_row_fill( MIB_UNICASTIPADDRESS_ROW *row, USHORT fam, void *k DWORD WINAPI GetUnicastIpAddressEntry(MIB_UNICASTIPADDRESS_ROW *row) { - IP_ADAPTER_ADDRESSES *aa, *ptr; - ULONG size = 0; - DWORD ret; + struct nsi_ipv4_unicast_key key4; + struct nsi_ipv6_unicast_key key6; + struct nsi_ip_unicast_rw rw; + struct nsi_ip_unicast_dynamic dyn; + struct nsi_ip_unicast_static stat; + const NPI_MODULEID *mod; + DWORD err, key_size; + void *key; - TRACE("%p\n", row); + TRACE( "%p\n", row ); - if (!row) - return ERROR_INVALID_PARAMETER; + if (!row) return ERROR_INVALID_PARAMETER; + mod = ip_module_id( row->Address.si_family ); + if (!mod) return ERROR_INVALID_PARAMETER; - ret = GetAdaptersAddresses(row->Address.si_family, 0, NULL, NULL, &size); - if (ret != ERROR_BUFFER_OVERFLOW) - return ret; - if (!(ptr = HeapAlloc(GetProcessHeap(), 0, size))) - return ERROR_OUTOFMEMORY; - if ((ret = GetAdaptersAddresses(row->Address.si_family, 0, NULL, ptr, &size))) + if (!row->InterfaceLuid.Value) { - HeapFree(GetProcessHeap(), 0, ptr); - return ret; + err = ConvertInterfaceIndexToLuid( row->InterfaceIndex, &row->InterfaceLuid ); + if (err) return err; } - ret = ERROR_FILE_NOT_FOUND; - for (aa = ptr; aa; aa = aa->Next) + if (row->Address.si_family == WS_AF_INET) { - IP_ADAPTER_UNICAST_ADDRESS *ua; - - if (aa->u.s.IfIndex != row->InterfaceIndex && - memcmp(&aa->Luid, &row->InterfaceLuid, sizeof(row->InterfaceLuid))) - continue; - ret = ERROR_NOT_FOUND; - - ua = aa->FirstUnicastAddress; - while (ua) - { - SOCKADDR_INET *uaaddr = (SOCKADDR_INET *)ua->Address.lpSockaddr; - - if ((row->Address.si_family == WS_AF_INET6 && - !memcmp(&row->Address.Ipv6.sin6_addr, &uaaddr->Ipv6.sin6_addr, sizeof(uaaddr->Ipv6.sin6_addr))) || - (row->Address.si_family == WS_AF_INET && - row->Address.Ipv4.sin_addr.S_un.S_addr == uaaddr->Ipv4.sin_addr.S_un.S_addr)) - { - memcpy(&row->InterfaceLuid, &aa->Luid, sizeof(aa->Luid)); - row->InterfaceIndex = aa->u.s.IfIndex; - row->PrefixOrigin = ua->PrefixOrigin; - row->SuffixOrigin = ua->SuffixOrigin; - row->ValidLifetime = ua->ValidLifetime; - row->PreferredLifetime = ua->PreferredLifetime; - row->OnLinkPrefixLength = ua->OnLinkPrefixLength; - row->SkipAsSource = 0; - row->DadState = ua->DadState; - if (row->Address.si_family == WS_AF_INET6) - row->ScopeId.u.Value = row->Address.Ipv6.sin6_scope_id; - else - row->ScopeId.u.Value = 0; - NtQuerySystemTime(&row->CreationTimeStamp); - HeapFree(GetProcessHeap(), 0, ptr); - return NO_ERROR; - } - ua = ua->Next; - } + key4.luid = row->InterfaceLuid; + key4.addr = row->Address.Ipv4.sin_addr; + key4.pad = 0; + key = &key4; + key_size = sizeof(key4); } - HeapFree(GetProcessHeap(), 0, ptr); + else if (row->Address.si_family == WS_AF_INET6) + { + key6.luid = row->InterfaceLuid; + key6.addr = row->Address.Ipv6.sin6_addr; + key = &key6; + key_size = sizeof(key6); + } + else return ERROR_INVALID_PARAMETER; - return ret; + err = NsiGetAllParameters( 1, mod, NSI_IP_UNICAST_TABLE, key, key_size, &rw, sizeof(rw), + &dyn, sizeof(dyn), &stat, sizeof(stat) ); + if (!err) unicast_row_fill( row, row->Address.si_family, key, &rw, &dyn, &stat ); + return err; } DWORD WINAPI GetUnicastIpAddressTable(ADDRESS_FAMILY family, MIB_UNICASTIPADDRESS_TABLE **table) diff --git a/dlls/iphlpapi/tests/iphlpapi.c b/dlls/iphlpapi/tests/iphlpapi.c index 893d6041287..1deac9b64f1 100644 --- a/dlls/iphlpapi/tests/iphlpapi.c +++ b/dlls/iphlpapi/tests/iphlpapi.c @@ -1962,7 +1962,7 @@ static void test_GetUnicastIpAddressEntry(void) memset( &row, 0, sizeof(row) ); ret = pGetUnicastIpAddressEntry( &row ); - todo_wine ok( ret == ERROR_INVALID_PARAMETER, "got %u\n", ret ); + ok( ret == ERROR_INVALID_PARAMETER, "got %u\n", ret ); memset( &row, 0, sizeof(row) ); row.Address.Ipv4.sin_family = AF_INET; @@ -1974,7 +1974,7 @@ static void test_GetUnicastIpAddressEntry(void) memset( &row, 0, sizeof(row) ); row.InterfaceIndex = 123; ret = pGetUnicastIpAddressEntry( &row ); - todo_wine ok( ret == ERROR_INVALID_PARAMETER, "got %u\n", ret ); + ok( ret == ERROR_INVALID_PARAMETER, "got %u\n", ret ); memset( &row, 0, sizeof(row) ); row.InterfaceIndex = get_interface_index();
1
0
0
0
Huw Davies : iphlpapi: Implement GetUnicastIpAddressTable() on top of nsi.
by Alexandre Julliard
20 Jul '21
20 Jul '21
Module: wine Branch: master Commit: 2f3ab0b242321a044ca68794f811165a8f748a74 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=2f3ab0b242321a044ca68794…
Author: Huw Davies <huw(a)codeweavers.com> Date: Tue Jul 20 08:43:26 2021 +0100 iphlpapi: Implement GetUnicastIpAddressTable() 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 | 132 ++++++++++++++++++++++++------------------ dlls/nsi/tests/nsi.c | 1 - 2 files changed, 76 insertions(+), 57 deletions(-) diff --git a/dlls/iphlpapi/iphlpapi_main.c b/dlls/iphlpapi/iphlpapi_main.c index 4ff9feb57f2..f4e6ea1a504 100644 --- a/dlls/iphlpapi/iphlpapi_main.c +++ b/dlls/iphlpapi/iphlpapi_main.c @@ -77,6 +77,13 @@ WINE_DEFAULT_DEBUG_CHANNEL(iphlpapi); DWORD WINAPI AllocateAndGetIfTableFromStack( MIB_IFTABLE **table, BOOL sort, HANDLE heap, DWORD flags ); +static const NPI_MODULEID *ip_module_id( USHORT family ) +{ + if (family == WS_AF_INET) return &NPI_MS_IPV4_MODULEID; + if (family == WS_AF_INET6) return &NPI_MS_IPV6_MODULEID; + return NULL; +} + DWORD WINAPI ConvertGuidToStringA( const GUID *guid, char *str, DWORD len ) { if (len < CHARS_IN_GUID) return ERROR_INSUFFICIENT_BUFFER; @@ -2651,6 +2658,42 @@ DWORD WINAPI GetExtendedUdpTable(PVOID pUdpTable, PDWORD pdwSize, BOOL bOrder, return ret; } +static void unicast_row_fill( MIB_UNICASTIPADDRESS_ROW *row, USHORT fam, void *key, struct nsi_ip_unicast_rw *rw, + struct nsi_ip_unicast_dynamic *dyn, struct nsi_ip_unicast_static *stat ) +{ + struct nsi_ipv4_unicast_key *key4 = (struct nsi_ipv4_unicast_key *)key; + struct nsi_ipv6_unicast_key *key6 = (struct nsi_ipv6_unicast_key *)key; + + if (fam == WS_AF_INET) + { + row->Address.Ipv4.sin_family = fam; + row->Address.Ipv4.sin_port = 0; + row->Address.Ipv4.sin_addr = key4->addr; + memset( row->Address.Ipv4.sin_zero, 0, sizeof(row->Address.Ipv4.sin_zero) ); + row->InterfaceLuid.Value = key4->luid.Value; + } + else + { + row->Address.Ipv6.sin6_family = fam; + row->Address.Ipv6.sin6_port = 0; + row->Address.Ipv6.sin6_flowinfo = 0; + row->Address.Ipv6.sin6_addr = key6->addr; + row->Address.Ipv6.sin6_scope_id = dyn->scope_id; + row->InterfaceLuid.Value = key6->luid.Value; + } + + ConvertInterfaceLuidToIndex( &row->InterfaceLuid, &row->InterfaceIndex ); + row->PrefixOrigin = rw->prefix_origin; + row->SuffixOrigin = rw->suffix_origin; + row->ValidLifetime = rw->valid_lifetime; + row->PreferredLifetime = rw->preferred_lifetime; + row->OnLinkPrefixLength = rw->on_link_prefix; + row->SkipAsSource = 0; + row->DadState = dyn->dad_state; + row->ScopeId.u.Value = dyn->scope_id; + row->CreationTimeStamp.QuadPart = stat->creation_time; +} + DWORD WINAPI GetUnicastIpAddressEntry(MIB_UNICASTIPADDRESS_ROW *row) { IP_ADAPTER_ADDRESSES *aa, *ptr; @@ -2720,80 +2763,57 @@ DWORD WINAPI GetUnicastIpAddressEntry(MIB_UNICASTIPADDRESS_ROW *row) DWORD WINAPI GetUnicastIpAddressTable(ADDRESS_FAMILY family, MIB_UNICASTIPADDRESS_TABLE **table) { - IP_ADAPTER_ADDRESSES *aa, *ptr; - MIB_UNICASTIPADDRESS_TABLE *data; - DWORD ret, count = 0; - ULONG size, flags; + void *key[2] = { NULL, NULL }; + struct nsi_ip_unicast_rw *rw[2] = { NULL, NULL }; + struct nsi_ip_unicast_dynamic *dyn[2] = { NULL, NULL }; + struct nsi_ip_unicast_static *stat[2] = { NULL, NULL }; + static const USHORT fam[2] = { WS_AF_INET, WS_AF_INET6 }; + static const DWORD key_size[2] = { sizeof(struct nsi_ipv4_unicast_key), sizeof(struct nsi_ipv6_unicast_key) }; + DWORD err, i, size, count[2] = { 0, 0 }; - TRACE("%u, %p\n", family, table); + TRACE( "%u, %p\n", family, table ); if (!table || (family != WS_AF_INET && family != WS_AF_INET6 && family != WS_AF_UNSPEC)) return ERROR_INVALID_PARAMETER; - flags = GAA_FLAG_SKIP_ANYCAST | - GAA_FLAG_SKIP_MULTICAST | - GAA_FLAG_SKIP_DNS_SERVER | - GAA_FLAG_SKIP_FRIENDLY_NAME; - - ret = GetAdaptersAddresses(family, flags, NULL, NULL, &size); - if (ret != ERROR_BUFFER_OVERFLOW) - return ret; - if (!(ptr = HeapAlloc(GetProcessHeap(), 0, size))) - return ERROR_OUTOFMEMORY; - if ((ret = GetAdaptersAddresses(family, flags, NULL, ptr, &size))) + for (i = 0; i < 2; i++) { - HeapFree(GetProcessHeap(), 0, ptr); - return ret; + if (family != WS_AF_UNSPEC && family != fam[i]) continue; + + err = NsiAllocateAndGetTable( 1, ip_module_id( fam[i] ), NSI_IP_UNICAST_TABLE, key + i, key_size[i], + (void **)rw + i, sizeof(**rw), (void **)dyn + i, sizeof(**dyn), + (void **)stat + i, sizeof(**stat), count + i, 0 ); + if (err) goto err; } - for (aa = ptr; aa; aa = aa->Next) + size = FIELD_OFFSET(MIB_UNICASTIPADDRESS_TABLE, Table[ count[0] + count[1] ]); + *table = heap_alloc( size ); + if (!*table) { - IP_ADAPTER_UNICAST_ADDRESS *ua = aa->FirstUnicastAddress; - while (ua) - { - count++; - ua = ua->Next; - } + err = ERROR_NOT_ENOUGH_MEMORY; + goto err; } - if (!(data = HeapAlloc(GetProcessHeap(), 0, sizeof(*data) + (count - 1) * sizeof(data->Table[0])))) + (*table)->NumEntries = count[0] + count[1]; + for (i = 0; i < count[0]; i++) { - HeapFree(GetProcessHeap(), 0, ptr); - return ERROR_OUTOFMEMORY; + MIB_UNICASTIPADDRESS_ROW *row = (*table)->Table + i; + struct nsi_ipv4_unicast_key *key4 = (struct nsi_ipv4_unicast_key *)key[0]; + + unicast_row_fill( row, fam[0], (void *)(key4 + i), rw[0] + i, dyn[0] + i, stat[0] + i ); } - data->NumEntries = 0; - for (aa = ptr; aa; aa = aa->Next) + for (i = 0; i < count[1]; i++) { - IP_ADAPTER_UNICAST_ADDRESS *ua = aa->FirstUnicastAddress; - while (ua) - { - MIB_UNICASTIPADDRESS_ROW *row = &data->Table[data->NumEntries]; - memcpy(&row->Address, ua->Address.lpSockaddr, ua->Address.iSockaddrLength); - memcpy(&row->InterfaceLuid, &aa->Luid, sizeof(aa->Luid)); - row->InterfaceIndex = aa->u.s.IfIndex; - row->PrefixOrigin = ua->PrefixOrigin; - row->SuffixOrigin = ua->SuffixOrigin; - row->ValidLifetime = ua->ValidLifetime; - row->PreferredLifetime = ua->PreferredLifetime; - row->OnLinkPrefixLength = ua->OnLinkPrefixLength; - row->SkipAsSource = 0; - row->DadState = ua->DadState; - if (row->Address.si_family == WS_AF_INET6) - row->ScopeId.u.Value = row->Address.Ipv6.sin6_scope_id; - else - row->ScopeId.u.Value = 0; - NtQuerySystemTime(&row->CreationTimeStamp); + MIB_UNICASTIPADDRESS_ROW *row = (*table)->Table + count[0] + i; + struct nsi_ipv6_unicast_key *key6 = (struct nsi_ipv6_unicast_key *)key[1]; - data->NumEntries++; - ua = ua->Next; - } + unicast_row_fill( row, fam[1], (void *)(key6 + i), rw[1] + i, dyn[1] + i, stat[1] + i ); } - HeapFree(GetProcessHeap(), 0, ptr); - - *table = data; - return ret; +err: + for (i = 0; i < 2; i++) NsiFreeTable( key[i], rw[i], dyn[i], stat[i] ); + return err; } /****************************************************************** diff --git a/dlls/nsi/tests/nsi.c b/dlls/nsi/tests/nsi.c index c07653c2ede..869fa255bb2 100644 --- a/dlls/nsi/tests/nsi.c +++ b/dlls/nsi/tests/nsi.c @@ -470,7 +470,6 @@ static void test_ip_unicast( int family ) /* SkipAsSource */ ok( row->DadState == dyn->dad_state, "mismatch\n" ); ok( row->ScopeId.Value == dyn->scope_id, "mismatch\n" ); -todo_wine ok( row->CreationTimeStamp.QuadPart == stat->creation_time, "mismatch\n" ); winetest_pop_context(); }
1
0
0
0
Huw Davies : nsiproxy: Implement IP unicast get_all_parameters.
by Alexandre Julliard
20 Jul '21
20 Jul '21
Module: wine Branch: master Commit: 4c7c7d07d4dd30b0751c7ad0bbc1db5577807b72 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=4c7c7d07d4dd30b0751c7ad0…
Author: Huw Davies <huw(a)codeweavers.com> Date: Tue Jul 20 08:43:25 2021 +0100 nsiproxy: Implement IP unicast get_all_parameters. Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/nsi/tests/nsi.c | 14 +++++++++---- dlls/nsiproxy.sys/ip.c | 39 ++++++++++++++++++++++++++++++++++++ dlls/nsiproxy.sys/ndis.c | 21 +++++++++++++++++++ dlls/nsiproxy.sys/nsiproxy_private.h | 1 + 4 files changed, 71 insertions(+), 4 deletions(-) diff --git a/dlls/nsi/tests/nsi.c b/dlls/nsi/tests/nsi.c index 3408dfae58f..c07653c2ede 100644 --- a/dlls/nsi/tests/nsi.c +++ b/dlls/nsi/tests/nsi.c @@ -415,11 +415,11 @@ static void test_ip_unicast( int family ) { DWORD rw_sizes[] = { FIELD_OFFSET(struct nsi_ip_unicast_rw, unk[0]), FIELD_OFFSET(struct nsi_ip_unicast_rw, unk[1]), sizeof(struct nsi_ip_unicast_rw) }; - struct nsi_ipv4_unicast_key *key_tbl, *key4; + struct nsi_ipv4_unicast_key *key_tbl, *key4, get_key; struct nsi_ipv6_unicast_key *key6; - struct nsi_ip_unicast_rw *rw_tbl, *rw; - struct nsi_ip_unicast_dynamic *dyn_tbl, *dyn; - struct nsi_ip_unicast_static *stat_tbl, *stat; + struct nsi_ip_unicast_rw *rw_tbl, *rw, get_rw; + struct nsi_ip_unicast_dynamic *dyn_tbl, *dyn, get_dyn; + struct nsi_ip_unicast_static *stat_tbl, *stat, get_stat; MIB_UNICASTIPADDRESS_TABLE *table; const NPI_MODULEID *mod = (family == AF_INET) ? &NPI_MS_IPV4_MODULEID : &NPI_MS_IPV6_MODULEID; DWORD err, count, i, rw_size, key_size = (family == AF_INET) ? sizeof(*key4) : sizeof(*key6); @@ -475,6 +475,12 @@ todo_wine winetest_pop_context(); } + get_key.luid.Value = ~0u; + get_key.addr.s_addr = 0; + err = NsiGetAllParameters( 1, &NPI_MS_IPV4_MODULEID, NSI_IP_UNICAST_TABLE, &get_key, sizeof(get_key), + &get_rw, rw_size, &get_dyn, sizeof(get_dyn), &get_stat, sizeof(get_stat) ); + ok( err == ERROR_NOT_FOUND, "got %d\n", err ); + FreeMibTable( table ); NsiFreeTable( key_tbl, rw_tbl, dyn_tbl, stat_tbl ); winetest_pop_context(); diff --git a/dlls/nsiproxy.sys/ip.c b/dlls/nsiproxy.sys/ip.c index d5fcc689fc4..ab1b6294bea 100644 --- a/dlls/nsiproxy.sys/ip.c +++ b/dlls/nsiproxy.sys/ip.c @@ -180,6 +180,43 @@ static NTSTATUS ip_unicast_enumerate_all( void *key_data, DWORD key_size, void * return status; } +static NTSTATUS ip_unicast_get_all_parameters( const void *key, DWORD key_size, void *rw_data, DWORD rw_size, + void *dynamic_data, DWORD dynamic_size, + void *static_data, DWORD static_size ) +{ + int family = (key_size == sizeof(struct nsi_ipv4_unicast_key)) ? AF_INET : AF_INET6; + NTSTATUS status = STATUS_NOT_FOUND; + const struct nsi_ipv6_unicast_key *key6 = key; + const struct nsi_ipv4_unicast_key *key4 = key; + struct ifaddrs *addrs, *entry; + const char *unix_name; + + TRACE( "%p %d %p %d %p %d %p %d\n", key, key_size, rw_data, rw_size, dynamic_data, dynamic_size, + static_data, static_size ); + + if (!convert_luid_to_unix_name( &key6->luid, &unix_name )) return STATUS_NOT_FOUND; + + if (getifaddrs( &addrs )) return STATUS_NO_MORE_ENTRIES; + + for (entry = addrs; entry; entry = entry->ifa_next) + { + if (!entry->ifa_addr || entry->ifa_addr->sa_family != family) continue; + if (strcmp( entry->ifa_name, unix_name )) continue; + + if (family == AF_INET && + memcmp( &key4->addr, &((struct sockaddr_in *)entry->ifa_addr)->sin_addr, sizeof(key4->addr) )) continue; + if (family == AF_INET6 && + memcmp( &key6->addr, &((struct sockaddr_in6 *)entry->ifa_addr)->sin6_addr, sizeof(key6->addr) )) continue; + + unicast_fill_entry( entry, NULL, rw_data, dynamic_data, static_data ); + status = STATUS_SUCCESS; + break; + } + + freeifaddrs( addrs ); + return status; +} + static struct module_table ipv4_tables[] = { { @@ -189,6 +226,7 @@ static struct module_table ipv4_tables[] = sizeof(struct nsi_ip_unicast_dynamic), sizeof(struct nsi_ip_unicast_static) }, ip_unicast_enumerate_all, + ip_unicast_get_all_parameters, }, { ~0u @@ -210,6 +248,7 @@ static struct module_table ipv6_tables[] = sizeof(struct nsi_ip_unicast_dynamic), sizeof(struct nsi_ip_unicast_static) }, ip_unicast_enumerate_all, + ip_unicast_get_all_parameters, }, { ~0u diff --git a/dlls/nsiproxy.sys/ndis.c b/dlls/nsiproxy.sys/ndis.c index b08d5bbcc79..40a60e45c46 100644 --- a/dlls/nsiproxy.sys/ndis.c +++ b/dlls/nsiproxy.sys/ndis.c @@ -634,6 +634,27 @@ BOOL convert_unix_name_to_luid( const char *unix_name, NET_LUID *luid ) return ret; } +BOOL convert_luid_to_unix_name( const NET_LUID *luid, const char **unix_name ) +{ + struct if_entry *entry; + BOOL ret = FALSE; + + EnterCriticalSection( &if_list_cs ); + + update_if_table(); + + LIST_FOR_EACH_ENTRY( entry, &if_list, struct if_entry, entry ) + if (entry->if_luid.Value == luid->Value) + { + *unix_name = entry->if_unix_name; + ret = TRUE; + + } + LeaveCriticalSection( &if_list_cs ); + + return ret; +} + static const struct module_table tables[] = { { diff --git a/dlls/nsiproxy.sys/nsiproxy_private.h b/dlls/nsiproxy.sys/nsiproxy_private.h index 1c62a3df038..0f6e7b05c59 100644 --- a/dlls/nsiproxy.sys/nsiproxy_private.h +++ b/dlls/nsiproxy.sys/nsiproxy_private.h @@ -22,6 +22,7 @@ NTSTATUS nsi_enumerate_all_ex( struct nsi_enumerate_all_ex *params ) DECLSPEC_HI NTSTATUS nsi_get_all_parameters_ex( struct nsi_get_all_parameters_ex *params ) DECLSPEC_HIDDEN; NTSTATUS nsi_get_parameter_ex( struct nsi_get_parameter_ex *params ) DECLSPEC_HIDDEN; +BOOL convert_luid_to_unix_name( const NET_LUID *luid, const char **unix_name ) DECLSPEC_HIDDEN; BOOL convert_unix_name_to_luid( const char *unix_name, NET_LUID *luid ) DECLSPEC_HIDDEN; struct module_table
1
0
0
0
Huw Davies : nsiproxy: Implement IP unicast enumerate_all.
by Alexandre Julliard
20 Jul '21
20 Jul '21
Module: wine Branch: master Commit: 0978421102910d7a7443f9f57ea0bfe3c882270e URL:
https://source.winehq.org/git/wine.git/?a=commit;h=0978421102910d7a7443f9f5…
Author: Huw Davies <huw(a)codeweavers.com> Date: Tue Jul 20 08:43:24 2021 +0100 nsiproxy: Implement IP unicast 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 | 72 +++++++++++ dlls/nsiproxy.sys/Makefile.in | 1 + dlls/nsiproxy.sys/ip.c | 223 +++++++++++++++++++++++++++++++++++ dlls/nsiproxy.sys/ndis.c | 21 ++++ dlls/nsiproxy.sys/nsi.c | 2 + dlls/nsiproxy.sys/nsiproxy_private.h | 4 + include/netioapi.h | 1 + include/wine/nsi.h | 39 ++++++ 8 files changed, 363 insertions(+) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=0978421102910d7a7443…
1
0
0
0
Huw Davies : iphlpapi: Remove unused function getInterfaceStatsByName().
by Alexandre Julliard
20 Jul '21
20 Jul '21
Module: wine Branch: master Commit: 8e13903665fdf81fcd6054fb3de981d5a3f617f1 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=8e13903665fdf81fcd6054fb…
Author: Huw Davies <huw(a)codeweavers.com> Date: Tue Jul 20 08:43:23 2021 +0100 iphlpapi: Remove unused function getInterfaceStatsByName(). This should have been part of commit 0b5a6c704c06. Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/iphlpapi/ipstats.c | 130 ------------------------------------------------ dlls/iphlpapi/ipstats.h | 5 -- 2 files changed, 135 deletions(-) diff --git a/dlls/iphlpapi/ipstats.c b/dlls/iphlpapi/ipstats.c index 3cf0e811437..43c481c749f 100644 --- a/dlls/iphlpapi/ipstats.c +++ b/dlls/iphlpapi/ipstats.c @@ -199,16 +199,6 @@ static DWORD kstat_get_ui32( kstat_t *ksp, const char *name ) if (!strcmp( data[i].name, name )) return data[i].value.ui32; return 0; } - -static ULONGLONG kstat_get_ui64( kstat_t *ksp, const char *name ) -{ - unsigned int i; - kstat_named_t *data = ksp->ks_data; - - for (i = 0; i < ksp->ks_ndata; i++) - if (!strcmp( data[i].name, name )) return data[i].value.ui64; - return 0; -} #endif #if defined(HAVE_SYS_TIHDR_H) && defined(T_OPTMGMT_ACK) @@ -286,126 +276,6 @@ static void *read_mib_entry( int fd, int level, int name, int *len ) } #endif /* HAVE_SYS_TIHDR_H && T_OPTMGMT_ACK */ -DWORD getInterfaceStatsByName(const char *name, PMIB_IFROW entry) -{ - DWORD ret = ERROR_NOT_SUPPORTED; - - if (!name || !entry) return ERROR_INVALID_PARAMETER; - -#ifdef __linux__ - { - FILE *fp; - - if ((fp = fopen("/proc/net/dev", "r"))) - { - DWORD skip; - char buf[512], *ptr; - int nameLen = strlen(name); - - while ((ptr = fgets(buf, sizeof(buf), fp))) - { - while (*ptr && isspace(*ptr)) ptr++; - if (_strnicmp(ptr, name, nameLen) == 0 && *(ptr + nameLen) == ':') - { - ptr += nameLen + 1; - sscanf( ptr, "%u %u %u %u %u %u %u %u %u %u %u %u", - &entry->dwInOctets, &entry->dwInUcastPkts, - &entry->dwInErrors, &entry->dwInDiscards, - &skip, &skip, &skip, - &entry->dwInNUcastPkts, &entry->dwOutOctets, - &entry->dwOutUcastPkts, &entry->dwOutErrors, - &entry->dwOutDiscards ); - break; - } - } - fclose(fp); - ret = NO_ERROR; - } - } -#elif defined(HAVE_LIBKSTAT) - { - kstat_ctl_t *kc; - kstat_t *ksp; - - if ((kc = kstat_open()) && - (ksp = kstat_lookup( kc, NULL, -1, (char *)name )) && - kstat_read( kc, ksp, NULL ) != -1 && - ksp->ks_type == KSTAT_TYPE_NAMED) - { - entry->dwMtu = 1500; /* FIXME */ - entry->dwSpeed = min( kstat_get_ui64( ksp, "ifspeed" ), ~0u ); - entry->dwInOctets = kstat_get_ui32( ksp, "rbytes" ); - entry->dwInNUcastPkts = kstat_get_ui32( ksp, "multircv" ); - entry->dwInNUcastPkts += kstat_get_ui32( ksp, "brdcstrcv" ); - entry->dwInUcastPkts = kstat_get_ui32( ksp, "ipackets" ) - entry->dwInNUcastPkts; - entry->dwInDiscards = kstat_get_ui32( ksp, "norcvbuf" ); - entry->dwInErrors = kstat_get_ui32( ksp, "ierrors" ); - entry->dwInUnknownProtos = kstat_get_ui32( ksp, "unknowns" ); - entry->dwOutOctets = kstat_get_ui32( ksp, "obytes" ); - entry->dwOutNUcastPkts = kstat_get_ui32( ksp, "multixmt" ); - entry->dwOutNUcastPkts += kstat_get_ui32( ksp, "brdcstxmt" ); - entry->dwOutUcastPkts = kstat_get_ui32( ksp, "opackets" ) - entry->dwOutNUcastPkts; - entry->dwOutDiscards = 0; /* FIXME */ - entry->dwOutErrors = kstat_get_ui32( ksp, "oerrors" ); - entry->dwOutQLen = kstat_get_ui32( ksp, "noxmtbuf" ); - ret = NO_ERROR; - } - if (kc) kstat_close( kc ); - } -#elif defined(HAVE_SYS_SYSCTL_H) && defined(NET_RT_IFLIST) - { - int mib[] = {CTL_NET, PF_ROUTE, 0, AF_INET, NET_RT_IFLIST, if_nametoindex(name)}; - size_t needed; - char *buf = NULL, *end; - struct if_msghdr *ifm; - struct if_data ifdata; - - if(sysctl(mib, ARRAY_SIZE(mib), NULL, &needed, NULL, 0) == -1) - { - ERR ("failed to get size of iflist\n"); - goto done; - } - buf = HeapAlloc (GetProcessHeap (), 0, needed); - if (!buf) - { - ret = ERROR_OUTOFMEMORY; - goto done; - } - if(sysctl(mib, ARRAY_SIZE(mib), buf, &needed, NULL, 0) == -1) - { - ERR ("failed to get iflist\n"); - goto done; - } - for ( end = buf + needed; buf < end; buf += ifm->ifm_msglen) - { - ifm = (struct if_msghdr *) buf; - if(ifm->ifm_type == RTM_IFINFO) - { - ifdata = ifm->ifm_data; - entry->dwMtu = ifdata.ifi_mtu; - entry->dwSpeed = ifdata.ifi_baudrate; - entry->dwInOctets = ifdata.ifi_ibytes; - entry->dwInErrors = ifdata.ifi_ierrors; - entry->dwInDiscards = ifdata.ifi_iqdrops; - entry->dwInUcastPkts = ifdata.ifi_ipackets; - entry->dwInNUcastPkts = ifdata.ifi_imcasts; - entry->dwOutOctets = ifdata.ifi_obytes; - entry->dwOutUcastPkts = ifdata.ifi_opackets; - entry->dwOutErrors = ifdata.ifi_oerrors; - ret = NO_ERROR; - break; - } - } - done: - HeapFree (GetProcessHeap (), 0, buf); - } -#else - FIXME( "unimplemented\n" ); -#endif - return ret; -} - - /****************************************************************** * GetIcmpStatistics (IPHLPAPI.@) * diff --git a/dlls/iphlpapi/ipstats.h b/dlls/iphlpapi/ipstats.h index 68bcb9c9ad8..bb0c77758f7 100644 --- a/dlls/iphlpapi/ipstats.h +++ b/dlls/iphlpapi/ipstats.h @@ -27,11 +27,6 @@ #include "winbase.h" #include "iprtrmib.h" -/* Fills in entry's interface stats, using name to find them. - * Returns ERROR_INVALID_PARAMETER if name or entry is NULL, NO_ERROR otherwise. - */ -DWORD getInterfaceStatsByName(const char *name, PMIB_IFROW entry) DECLSPEC_HIDDEN; - DWORD build_tcp_table(TCP_TABLE_CLASS, void **, BOOL, HANDLE, DWORD, DWORD *) DECLSPEC_HIDDEN; DWORD build_tcp6_table(TCP_TABLE_CLASS, void **, BOOL, HANDLE, DWORD, DWORD *) DECLSPEC_HIDDEN; DWORD build_udp_table(UDP_TABLE_CLASS, void **, BOOL, HANDLE, DWORD, DWORD *) DECLSPEC_HIDDEN;
1
0
0
0
Zebediah Figura : quartz: Free outstanding advise requests when destroying a system clock.
by Alexandre Julliard
20 Jul '21
20 Jul '21
Module: wine Branch: master Commit: 4e74fdcebeaf7a98ef72194fdd27ce5db85d2bda URL:
https://source.winehq.org/git/wine.git/?a=commit;h=4e74fdcebeaf7a98ef72194f…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Mon Jul 19 22:25:27 2021 -0500 quartz: Free outstanding advise requests when destroying a system clock. Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/quartz/systemclock.c | 8 ++++++++ dlls/quartz/tests/systemclock.c | 12 ++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/dlls/quartz/systemclock.c b/dlls/quartz/systemclock.c index 597373a4112..73a923a7b99 100644 --- a/dlls/quartz/systemclock.c +++ b/dlls/quartz/systemclock.c @@ -90,6 +90,7 @@ static ULONG WINAPI system_clock_inner_Release(IUnknown *iface) { struct system_clock *clock = impl_from_IUnknown(iface); ULONG refcount = InterlockedDecrement(&clock->refcount); + struct advise_sink *sink, *cursor; TRACE("%p decreasing refcount to %u.\n", clock, refcount); @@ -104,6 +105,13 @@ static ULONG WINAPI system_clock_inner_Release(IUnknown *iface) WaitForSingleObject(clock->thread, INFINITE); CloseHandle(clock->thread); } + + LIST_FOR_EACH_ENTRY_SAFE(sink, cursor, &clock->sinks, struct advise_sink, entry) + { + list_remove(&sink->entry); + heap_free(sink); + } + clock->cs.DebugInfo->Spare[0] = 0; DeleteCriticalSection(&clock->cs); heap_free(clock); diff --git a/dlls/quartz/tests/systemclock.c b/dlls/quartz/tests/systemclock.c index fa9464429f0..be5472ed6e1 100644 --- a/dlls/quartz/tests/systemclock.c +++ b/dlls/quartz/tests/systemclock.c @@ -272,11 +272,19 @@ static void test_advise(void) ok(hr == S_OK, "Got hr %#x.\n", hr); ok(WaitForSingleObject(semaphore, 200) == WAIT_TIMEOUT, "Semaphore should not be signaled.\n"); - CloseHandle(event); - CloseHandle(semaphore); + ResetEvent(event); + hr = IReferenceClock_GetTime(clock, ¤t); + ok(SUCCEEDED(hr), "Got hr %#x.\n", hr); + hr = IReferenceClock_AdviseTime(clock, current, 500 * 10000, (HEVENT)event, &cookie); + ok(hr == S_OK, "Got hr %#x.\n", hr); ref = IReferenceClock_Release(clock); ok(!ref, "Got outstanding refcount %d.\n", ref); + + ok(WaitForSingleObject(event, 0) == WAIT_TIMEOUT, "Event should not be signaled.\n"); + + CloseHandle(event); + CloseHandle(semaphore); } START_TEST(systemclock)
1
0
0
0
← Newer
1
...
31
32
33
34
35
36
37
...
73
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
Results per page:
10
25
50
100
200