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
February 2022
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
2 participants
1495 discussions
Start a n
N
ew thread
Paul Gofman : hnetcfg: Get gateway description location in init_gateway_connection().
by Alexandre Julliard
01 Feb '22
01 Feb '22
Module: wine Branch: master Commit: 583605be049af1ad8a7551b7073c15832b2644a0 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=583605be049af1ad8a7551b7…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Tue Feb 1 13:49:22 2022 +0300 hnetcfg: Get gateway description location in init_gateway_connection(). Signed-off-by: Paul Gofman <pgofman(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/hnetcfg/port.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/dlls/hnetcfg/port.c b/dlls/hnetcfg/port.c index 89a3f571d45..fa866d874c9 100644 --- a/dlls/hnetcfg/port.c +++ b/dlls/hnetcfg/port.c @@ -27,6 +27,7 @@ #include "string.h" #include "assert.h" #include "winsock2.h" +#include "winhttp.h" #include "ole2.h" #include "netfw.h" #include "natupnp.h" @@ -40,11 +41,49 @@ static struct { LONG refs; BOOL winsock_initialized; + WCHAR locationW[256]; } upnp_gateway_connection; static SRWLOCK upnp_gateway_connection_lock = SRWLOCK_INIT; +static BOOL parse_search_response( char *response, WCHAR *locationW, unsigned int location_size ) +{ + char *saveptr = NULL, *tok, *tok2; + unsigned int status; + + tok = strtok_s( response, "\n", &saveptr ); + if (!tok) return FALSE; + + /* HTTP/1.1 200 OK */ + tok2 = strtok( tok, " " ); + if (!tok2) return FALSE; + tok2 = strtok( NULL, " " ); + if (!tok2) return FALSE; + status = atoi( tok2 ); + if (status != HTTP_STATUS_OK) + { + WARN( "status %u.\n", status ); + return FALSE; + } + while ((tok = strtok_s( NULL, "\n", &saveptr ))) + { + tok2 = strtok( tok, " " ); + if (!tok2) continue; + if (!stricmp( tok2, "LOCATION:" )) + { + tok2 = strtok( NULL, " \r" ); + if (!tok2) + { + WARN( "Error parsing location.\n" ); + return FALSE; + } + return !!MultiByteToWideChar( CP_UTF8, 0, tok2, -1, locationW, location_size / 2 ); + } + } + return FALSE; +} + static void gateway_connection_cleanup(void) { TRACE( ".\n" ); @@ -118,6 +157,13 @@ static BOOL init_gateway_connection(void) return FALSE; } TRACE( "Received reply from gateway, len %d.\n", len ); + buffer[len] = 0; + if (!parse_search_response( buffer, upnp_gateway_connection.locationW, sizeof(upnp_gateway_connection.locationW) )) + { + WARN( "Error parsing response.\n" ); + return FALSE; + } + TRACE( "Gateway description location %s.\n", debugstr_w(upnp_gateway_connection.locationW) ); return TRUE; }
1
0
0
0
Paul Gofman : hnetcfg: Return stub interface from upnpnat_get_StaticPortMappingCollection() if UPNP IGD is found.
by Alexandre Julliard
01 Feb '22
01 Feb '22
Module: wine Branch: master Commit: cbf2ca57749874a34f0ce19f30431577fa8a4e66 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=cbf2ca57749874a34f0ce19f…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Tue Feb 1 13:49:21 2022 +0300 hnetcfg: Return stub interface from upnpnat_get_StaticPortMappingCollection() if UPNP IGD is found. Signed-off-by: Paul Gofman <pgofman(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/hnetcfg/Makefile.in | 2 +- dlls/hnetcfg/apps.c | 3 +- dlls/hnetcfg/hnetcfg_private.h | 1 + dlls/hnetcfg/port.c | 348 ++++++++++++++++++++++++++++++++++++++++- dlls/hnetcfg/tests/policy.c | 3 +- 5 files changed, 350 insertions(+), 7 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=cbf2ca57749874a34f0c…
1
0
0
0
Paul Gofman : hnetcfg/tests: Add tests for static port mapping collection.
by Alexandre Julliard
01 Feb '22
01 Feb '22
Module: wine Branch: master Commit: 162dc17e09aaeb169807bf076140ba62805284f0 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=162dc17e09aaeb169807bf07…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Tue Feb 1 13:49:20 2022 +0300 hnetcfg/tests: Add tests for static port mapping collection. Signed-off-by: Paul Gofman <pgofman(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/hnetcfg/tests/policy.c | 132 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 131 insertions(+), 1 deletion(-) diff --git a/dlls/hnetcfg/tests/policy.c b/dlls/hnetcfg/tests/policy.c index e2606933079..6abdcd7fb4e 100644 --- a/dlls/hnetcfg/tests/policy.c +++ b/dlls/hnetcfg/tests/policy.c @@ -29,6 +29,12 @@ #include "netfw.h" #include "natupnp.h" +static ULONG get_refcount(IUnknown *unk) +{ + IUnknown_AddRef(unk); + return IUnknown_Release(unk); +} + static void test_policy2_rules(INetFwPolicy2 *policy2) { HRESULT hr; @@ -164,6 +170,119 @@ static void test_NetFwAuthorizedApplication(void) INetFwAuthorizedApplication_Release(app); } +static void test_static_port_mapping_collection( IStaticPortMappingCollection *ports ) +{ + LONG i, count, count2, expected_count, external_port; + IStaticPortMapping *pm, *pm2; + ULONG refcount, refcount2; + IEnumVARIANT *enum_ports; + IUnknown *unk; + ULONG fetched; + BSTR protocol; + VARIANT var; + HRESULT hr; + + refcount = get_refcount((IUnknown *)ports); + hr = IStaticPortMappingCollection_get__NewEnum(ports, &unk); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + + hr = IUnknown_QueryInterface(unk, &IID_IEnumVARIANT, (void **)&enum_ports); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + + refcount2 = get_refcount((IUnknown *)ports); + ok(refcount2 == refcount, "Got unexpected refcount %u, refcount2 %u.\n", refcount, refcount2); + + hr = IEnumVARIANT_Reset(enum_ports); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + + count = 0xdeadbeef; + hr = IStaticPortMappingCollection_get_Count(ports, &count); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + + hr = IStaticPortMappingCollection_get_Item(ports, 12345, (BSTR)L"UDP", &pm); + if (SUCCEEDED(hr)) + { + expected_count = count; + IStaticPortMapping_Release(pm); + } + else + { + expected_count = count + 1; + } + + hr = IStaticPortMappingCollection_Add(ports, 12345, (BSTR)L"udp", 12345, (BSTR)L"1.2.3.4", + VARIANT_TRUE, (BSTR)L"wine_test", &pm); + ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); + hr = IStaticPortMappingCollection_Add(ports, 12345, (BSTR)L"UDP", 12345, (BSTR)L"1.2.3.4", + VARIANT_TRUE, (BSTR)L"wine_test", &pm); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + + hr = IStaticPortMappingCollection_get_Count(ports, &count2); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + ok(count2 == expected_count, "Got unexpected count2 %u, expected %u.\n", count2, expected_count); + + hr = IStaticPortMappingCollection_get_Item(ports, 12345, NULL, &pm); + ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); + + hr = IStaticPortMappingCollection_get_Item(ports, 12345, (BSTR)L"UDP", NULL); + ok(hr == E_POINTER, "Got unexpected hr %#x.\n", hr); + + hr = IStaticPortMappingCollection_get_Item(ports, 12345, (BSTR)L"udp", &pm); + ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); + + hr = IStaticPortMappingCollection_get_Item(ports, -1, (BSTR)L"UDP", &pm); + ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); + + hr = IStaticPortMappingCollection_get_Item(ports, 65536, (BSTR)L"UDP", &pm); + ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); + + hr = IStaticPortMappingCollection_get_Item(ports, 12346, (BSTR)L"UDP", &pm); + ok(hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), "Got unexpected hr %#x.\n", hr); + + hr = IEnumVARIANT_Reset(enum_ports); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + + for (i = 0; i < count2; ++i) + { + VariantInit(&var); + + fetched = 0xdeadbeef; + hr = IEnumVARIANT_Next(enum_ports, 1, &var, &fetched); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + ok(fetched == 1, "Got unexpected fetched %u.\n", fetched); + ok(V_VT(&var) == VT_DISPATCH, "Got unexpected variant type %u.\n", V_VT(&var)); + + hr = IDispatch_QueryInterface(V_DISPATCH(&var), &IID_IStaticPortMapping, (void **)&pm); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + + hr = IStaticPortMapping_get_Protocol(pm, &protocol); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + external_port = 0xdeadbeef; + hr = IStaticPortMapping_get_ExternalPort(pm, &external_port); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + + ok(!wcscmp(protocol, L"UDP") || !wcscmp(protocol, L"TCP"), "Got unexpected protocol %s.\n", + debugstr_w(protocol)); + hr = IStaticPortMappingCollection_get_Item(ports, external_port, protocol, &pm2); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + ok(pm2 != pm, "Got same interface.\n"); + + IStaticPortMapping_Release(pm); + IStaticPortMapping_Release(pm2); + + SysFreeString(protocol); + + VariantClear(&var); + } + hr = IEnumVARIANT_Next(enum_ports, 1, &var, &fetched); + ok(hr == S_FALSE, "Got unexpected hr %#x.\n", hr); + + hr = IStaticPortMappingCollection_Remove(ports, 12345, (BSTR)L"UDP"); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + + IEnumVARIANT_Release(enum_ports); +} + static void test_IUPnPNAT(void) { IUPnPNAT *nat; @@ -171,6 +290,7 @@ static void test_IUPnPNAT(void) IDynamicPortMappingCollection *dync_ports; INATEventManager *manager; IProvideClassInfo *provider; + ULONG refcount, refcount2; HRESULT hr; hr = CoCreateInstance(&CLSID_UPnPNAT, NULL, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER, &IID_IUPnPNAT, (void**)&nat); @@ -179,11 +299,21 @@ static void test_IUPnPNAT(void) hr = IUPnPNAT_QueryInterface(nat, &IID_IProvideClassInfo, (void**)&provider); ok(hr == E_NOINTERFACE, "got: %08x\n", hr); + refcount = get_refcount((IUnknown *)nat); hr = IUPnPNAT_get_StaticPortMappingCollection(nat, &static_ports); + ok(hr == S_OK, "got: %08x\n", hr); if(hr == S_OK && static_ports) + { + refcount2 = get_refcount((IUnknown *)nat); + ok(refcount2 == refcount, "Got unexpected refcount %u, refcount2 %u.\n", refcount, refcount2); + test_static_port_mapping_collection( static_ports ); IStaticPortMappingCollection_Release(static_ports); - + } + else if (hr == S_OK) + { + skip( "UPNP gateway not found.\n" ); + } hr = IUPnPNAT_get_DynamicPortMappingCollection(nat, &dync_ports); ok(hr == S_OK || hr == E_NOTIMPL /* Windows 8.1 */, "got: %08x\n", hr); if(hr == S_OK && dync_ports)
1
0
0
0
Paul Gofman : hnetcfg: Use CRT allocation functions.
by Alexandre Julliard
01 Feb '22
01 Feb '22
Module: wine Branch: master Commit: f20f98825922030364df3ae0ae9c52ac270964f2 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=f20f98825922030364df3ae0…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Tue Feb 1 13:49:19 2022 +0300 hnetcfg: Use CRT allocation functions. Signed-off-by: Paul Gofman <pgofman(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/hnetcfg/apps.c | 21 ++++++++++----------- dlls/hnetcfg/manager.c | 4 ++-- dlls/hnetcfg/policy.c | 14 +++++++------- dlls/hnetcfg/port.c | 13 ++++++------- dlls/hnetcfg/profile.c | 4 ++-- dlls/hnetcfg/service.c | 8 ++++---- 6 files changed, 31 insertions(+), 33 deletions(-) diff --git a/dlls/hnetcfg/apps.c b/dlls/hnetcfg/apps.c index b6447cf4d63..16379e3457b 100644 --- a/dlls/hnetcfg/apps.c +++ b/dlls/hnetcfg/apps.c @@ -29,7 +29,6 @@ #include "natupnp.h" #include "wine/debug.h" -#include "wine/heap.h" #include "hnetcfg_private.h" WINE_DEFAULT_DEBUG_CHANNEL(hnetcfg); @@ -62,7 +61,7 @@ static ULONG WINAPI fw_app_Release( { TRACE("destroying %p\n", fw_app); SysFreeString( fw_app->filename ); - HeapFree( GetProcessHeap(), 0, fw_app ); + free( fw_app ); } return refs; } @@ -281,7 +280,7 @@ static HRESULT WINAPI fw_app_put_ProcessImageFileName( res = WNetGetUniversalNameW(image, UNIVERSAL_NAME_INFO_LEVEL, NULL, &sz); if (res == WN_MORE_DATA) { - if (!(path = heap_alloc(sz))) + if (!(path = malloc(sz))) return E_OUTOFMEMORY; info = (UNIVERSAL_NAME_INFOW *)&path; @@ -291,21 +290,21 @@ static HRESULT WINAPI fw_app_put_ProcessImageFileName( SysFreeString(This->filename); This->filename = SysAllocString(info->lpUniversalName); } - heap_free(path); + free(path); return HRESULT_FROM_WIN32(res); } sz = GetFullPathNameW(image, 0, NULL, NULL); - if (!(path = heap_alloc(++sz * sizeof(WCHAR)))) + if (!(path = malloc(++sz * sizeof(WCHAR)))) return E_OUTOFMEMORY; GetFullPathNameW(image, sz, path, NULL); longsz = GetLongPathNameW(path, path, sz); if (longsz > sz) { - if (!(path = heap_realloc(path, longsz * sizeof(WCHAR)))) + if (!(path = realloc(path, longsz * sizeof(WCHAR)))) { - heap_free(path); + free(path); return E_OUTOFMEMORY; } GetLongPathNameW(path, path, longsz); @@ -313,7 +312,7 @@ static HRESULT WINAPI fw_app_put_ProcessImageFileName( SysFreeString( This->filename ); This->filename = SysAllocString(path); - heap_free(path); + free(path); return This->filename ? S_OK : E_OUTOFMEMORY; } @@ -432,7 +431,7 @@ HRESULT NetFwAuthorizedApplication_create( IUnknown *pUnkOuter, LPVOID *ppObj ) TRACE("(%p,%p)\n", pUnkOuter, ppObj); - fa = HeapAlloc( GetProcessHeap(), 0, sizeof(*fa) ); + fa = malloc( sizeof(*fa) ); if (!fa) return E_OUTOFMEMORY; fa->INetFwAuthorizedApplication_iface.lpVtbl = &fw_app_vtbl; @@ -470,7 +469,7 @@ static ULONG WINAPI fw_apps_Release( if (!refs) { TRACE("destroying %p\n", fw_apps); - HeapFree( GetProcessHeap(), 0, fw_apps ); + free( fw_apps ); } return refs; } @@ -645,7 +644,7 @@ HRESULT NetFwAuthorizedApplications_create( IUnknown *pUnkOuter, LPVOID *ppObj ) TRACE("(%p,%p)\n", pUnkOuter, ppObj); - fa = HeapAlloc( GetProcessHeap(), 0, sizeof(*fa) ); + fa = malloc( sizeof(*fa) ); if (!fa) return E_OUTOFMEMORY; fa->INetFwAuthorizedApplications_iface.lpVtbl = &fw_apps_vtbl; diff --git a/dlls/hnetcfg/manager.c b/dlls/hnetcfg/manager.c index 2c0790a73b5..fda69729901 100644 --- a/dlls/hnetcfg/manager.c +++ b/dlls/hnetcfg/manager.c @@ -58,7 +58,7 @@ static ULONG WINAPI fw_manager_Release( if (!refs) { TRACE("destroying %p\n", fw_manager); - HeapFree( GetProcessHeap(), 0, fw_manager ); + free( fw_manager ); } return refs; } @@ -244,7 +244,7 @@ HRESULT NetFwMgr_create( IUnknown *pUnkOuter, LPVOID *ppObj ) TRACE("(%p,%p)\n", pUnkOuter, ppObj); - fm = HeapAlloc( GetProcessHeap(), 0, sizeof(*fm) ); + fm = malloc( sizeof(*fm) ); if (!fm) return E_OUTOFMEMORY; fm->INetFwMgr_iface.lpVtbl = &fw_manager_vtbl; diff --git a/dlls/hnetcfg/policy.c b/dlls/hnetcfg/policy.c index 1f5b0daa568..7bdc1563d90 100644 --- a/dlls/hnetcfg/policy.c +++ b/dlls/hnetcfg/policy.c @@ -105,7 +105,7 @@ static ULONG WINAPI netfw_rules_Release( if (!refs) { TRACE("destroying %p\n", This); - HeapFree( GetProcessHeap(), 0, This ); + free( This ); } return refs; } @@ -265,7 +265,7 @@ static HRESULT create_INetFwRules(INetFwRules **object) TRACE("(%p)\n", object); - rules = HeapAlloc( GetProcessHeap(), 0, sizeof(*rules) ); + rules = malloc( sizeof(*rules) ); if (!rules) return E_OUTOFMEMORY; rules->INetFwRules_iface.lpVtbl = &fw_rules_vtbl; @@ -292,7 +292,7 @@ static ULONG WINAPI fw_policy_Release( if (!refs) { TRACE("destroying %p\n", fw_policy); - HeapFree( GetProcessHeap(), 0, fw_policy ); + free( fw_policy ); } return refs; } @@ -435,7 +435,7 @@ HRESULT NetFwPolicy_create( IUnknown *pUnkOuter, LPVOID *ppObj ) TRACE("(%p,%p)\n", pUnkOuter, ppObj); - fp = HeapAlloc( GetProcessHeap(), 0, sizeof(*fp) ); + fp = malloc( sizeof(*fp) ); if (!fp) return E_OUTOFMEMORY; fp->INetFwPolicy_iface.lpVtbl = &fw_policy_vtbl; @@ -487,7 +487,7 @@ static ULONG WINAPI fwpolicy2_Release(INetFwPolicy2 *iface) { INetFwRules_Release(fw_policy->fw_policy2_rules); TRACE("destroying %p\n", fw_policy); - HeapFree( GetProcessHeap(), 0, fw_policy ); + free( fw_policy ); } return refs; } @@ -768,7 +768,7 @@ HRESULT NetFwPolicy2_create( IUnknown *outer, void **obj ) TRACE("(%p,%p)\n", outer, obj); - fp = HeapAlloc( GetProcessHeap(), 0, sizeof(*fp) ); + fp = malloc( sizeof(*fp) ); if (!fp) return E_OUTOFMEMORY; fp->INetFwPolicy2_iface.lpVtbl = &fw_policy2_vtbl; @@ -778,7 +778,7 @@ HRESULT NetFwPolicy2_create( IUnknown *outer, void **obj ) if (FAILED(create_INetFwRules(&fp->fw_policy2_rules))) { - HeapFree( GetProcessHeap(), 0, fp ); + free( fp ); return E_OUTOFMEMORY; } diff --git a/dlls/hnetcfg/port.c b/dlls/hnetcfg/port.c index fd4ac4977d3..9e9264df1dc 100644 --- a/dlls/hnetcfg/port.c +++ b/dlls/hnetcfg/port.c @@ -28,7 +28,6 @@ #include "netfw.h" #include "natupnp.h" -#include "wine/heap.h" #include "wine/debug.h" #include "hnetcfg_private.h" @@ -64,7 +63,7 @@ static ULONG WINAPI fw_port_Release( { TRACE("destroying %p\n", fw_port); SysFreeString( fw_port->name ); - HeapFree( GetProcessHeap(), 0, fw_port ); + free( fw_port ); } return refs; } @@ -363,7 +362,7 @@ HRESULT NetFwOpenPort_create( IUnknown *pUnkOuter, LPVOID *ppObj ) TRACE("(%p,%p)\n", pUnkOuter, ppObj); - fp = HeapAlloc( GetProcessHeap(), 0, sizeof(*fp) ); + fp = malloc( sizeof(*fp) ); if (!fp) return E_OUTOFMEMORY; fp->INetFwOpenPort_iface.lpVtbl = &fw_port_vtbl; @@ -404,7 +403,7 @@ static ULONG WINAPI fw_ports_Release( if (!refs) { TRACE("destroying %p\n", fw_ports); - HeapFree( GetProcessHeap(), 0, fw_ports ); + free( fw_ports ); } return refs; } @@ -592,7 +591,7 @@ HRESULT NetFwOpenPorts_create( IUnknown *pUnkOuter, LPVOID *ppObj ) TRACE("(%p,%p)\n", pUnkOuter, ppObj); - fp = HeapAlloc( GetProcessHeap(), 0, sizeof(*fp) ); + fp = malloc( sizeof(*fp) ); if (!fp) return E_OUTOFMEMORY; fp->INetFwOpenPorts_iface.lpVtbl = &fw_ports_vtbl; @@ -653,7 +652,7 @@ static ULONG WINAPI upnpnat_Release(IUPnPNAT *iface) LONG refs = InterlockedDecrement( &This->ref ); if (!refs) { - heap_free( This ); + free( This ); } return refs; } @@ -762,7 +761,7 @@ HRESULT IUPnPNAT_create(IUnknown *outer, void **object) TRACE("(%p,%p)\n", outer, object); - nat = heap_alloc( sizeof(*nat) ); + nat = malloc( sizeof(*nat) ); if (!nat) return E_OUTOFMEMORY; nat->IUPnPNAT_iface.lpVtbl = &upnpnat_vtbl; diff --git a/dlls/hnetcfg/profile.c b/dlls/hnetcfg/profile.c index d0e9f48dab4..63f6d0cc7ed 100644 --- a/dlls/hnetcfg/profile.c +++ b/dlls/hnetcfg/profile.c @@ -58,7 +58,7 @@ static ULONG WINAPI fw_profile_Release( if (!refs) { TRACE("destroying %p\n", fw_profile); - HeapFree( GetProcessHeap(), 0, fw_profile ); + free( fw_profile ); } return refs; } @@ -334,7 +334,7 @@ HRESULT NetFwProfile_create( IUnknown *pUnkOuter, LPVOID *ppObj ) TRACE("(%p,%p)\n", pUnkOuter, ppObj); - fp = HeapAlloc( GetProcessHeap(), 0, sizeof(*fp) ); + fp = malloc( sizeof(*fp) ); if (!fp) return E_OUTOFMEMORY; fp->INetFwProfile_iface.lpVtbl = &fw_profile_vtbl; diff --git a/dlls/hnetcfg/service.c b/dlls/hnetcfg/service.c index 5bfeedaaedf..122d9797bab 100644 --- a/dlls/hnetcfg/service.c +++ b/dlls/hnetcfg/service.c @@ -58,7 +58,7 @@ static ULONG WINAPI fw_service_Release( if (!refs) { TRACE("destroying %p\n", fw_service); - HeapFree( GetProcessHeap(), 0, fw_service ); + free( fw_service ); } return refs; } @@ -290,7 +290,7 @@ static HRESULT NetFwService_create( IUnknown *pUnkOuter, LPVOID *ppObj ) TRACE("(%p,%p)\n", pUnkOuter, ppObj); - fp = HeapAlloc( GetProcessHeap(), 0, sizeof(*fp) ); + fp = malloc( sizeof(*fp) ); if (!fp) return E_OUTOFMEMORY; fp->INetFwService_iface.lpVtbl = &fw_service_vtbl; @@ -328,7 +328,7 @@ static ULONG WINAPI fw_services_Release( if (!refs) { TRACE("destroying %p\n", fw_services); - HeapFree( GetProcessHeap(), 0, fw_services ); + free( fw_services ); } return refs; } @@ -464,7 +464,7 @@ HRESULT NetFwServices_create( IUnknown *pUnkOuter, LPVOID *ppObj ) TRACE("(%p,%p)\n", pUnkOuter, ppObj); - fp = HeapAlloc( GetProcessHeap(), 0, sizeof(*fp) ); + fp = malloc( sizeof(*fp) ); if (!fp) return E_OUTOFMEMORY; fp->INetFwServices_iface.lpVtbl = &fw_services_vtbl;
1
0
0
0
Rémi Bernon : winehid.sys: Build with nameless unions.
by Alexandre Julliard
01 Feb '22
01 Feb '22
Module: wine Branch: master Commit: eb9da265d3b459be78c9baf0a6293528be1bc0c6 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=eb9da265d3b459be78c9baf0…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Tue Feb 1 09:35:50 2022 +0100 winehid.sys: Build with nameless unions. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winehid.sys/main.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/dlls/winehid.sys/main.c b/dlls/winehid.sys/main.c index a807c0da097..ca549ab4728 100644 --- a/dlls/winehid.sys/main.c +++ b/dlls/winehid.sys/main.c @@ -20,8 +20,6 @@ #include <stdarg.h> -#define NONAMELESSUNION - #include "ntstatus.h" #define WIN32_NO_STATUS #include "windef.h" @@ -36,7 +34,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(hid); static NTSTATUS WINAPI internal_ioctl(DEVICE_OBJECT *device, IRP *irp) { - NTSTATUS status = irp->IoStatus.u.Status; + NTSTATUS status = irp->IoStatus.Status; IO_STACK_LOCATION *irpsp = IoGetCurrentIrpStackLocation(irp); ULONG code = irpsp->Parameters.DeviceIoControl.IoControlCode;
1
0
0
0
Rémi Bernon : winehid.sys: Fix printf format warnings with long types.
by Alexandre Julliard
01 Feb '22
01 Feb '22
Module: wine Branch: master Commit: 4b7a20af16eeddbce35d26289f5160794cb1970b URL:
https://source.winehq.org/git/wine.git/?a=commit;h=4b7a20af16eeddbce35d2628…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Tue Feb 1 09:35:49 2022 +0100 winehid.sys: Fix printf format warnings with long types. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winehid.sys/Makefile.in | 1 - dlls/winehid.sys/main.c | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/dlls/winehid.sys/Makefile.in b/dlls/winehid.sys/Makefile.in index 36302330877..0ae026647c9 100644 --- a/dlls/winehid.sys/Makefile.in +++ b/dlls/winehid.sys/Makefile.in @@ -1,4 +1,3 @@ -EXTRADEFS = -DWINE_NO_LONG_TYPES MODULE = winehid.sys IMPORTS = hidclass ntoskrnl diff --git a/dlls/winehid.sys/main.c b/dlls/winehid.sys/main.c index 975deac993f..a807c0da097 100644 --- a/dlls/winehid.sys/main.c +++ b/dlls/winehid.sys/main.c @@ -61,7 +61,7 @@ static NTSTATUS WINAPI internal_ioctl(DEVICE_OBJECT *device, IRP *irp) return IoCallDriver(((HID_DEVICE_EXTENSION *)device->DeviceExtension)->NextDeviceObject, irp); default: - FIXME("Unsupported ioctl %x (device=%x access=%x func=%x method=%x)\n", + FIXME("Unsupported ioctl %#lx (device=%lx access=%lx func=%lx method=%lx)\n", code, code >> 16, (code >> 14) & 3, (code >> 2) & 0xfff, code & 3); IoCompleteRequest(irp, IO_NO_INCREMENT); return status;
1
0
0
0
Rémi Bernon : hidclass.sys: Fix printf format warnings with long types.
by Alexandre Julliard
01 Feb '22
01 Feb '22
Module: wine Branch: master Commit: 0dd6bc9db06eb9b9bcce51f50235fd1bdef33038 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=0dd6bc9db06eb9b9bcce51f5…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Tue Feb 1 09:35:48 2022 +0100 hidclass.sys: Fix printf format warnings with long types. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/hidclass.sys/Makefile.in | 1 - dlls/hidclass.sys/device.c | 10 +++++----- dlls/hidclass.sys/pnp.c | 20 ++++++++++---------- 3 files changed, 15 insertions(+), 16 deletions(-) diff --git a/dlls/hidclass.sys/Makefile.in b/dlls/hidclass.sys/Makefile.in index b597589dc53..788828ad66a 100644 --- a/dlls/hidclass.sys/Makefile.in +++ b/dlls/hidclass.sys/Makefile.in @@ -1,4 +1,3 @@ -EXTRADEFS = -DWINE_NO_LONG_TYPES MODULE = hidclass.sys IMPORTLIB = hidclass IMPORTS = hal ntoskrnl user32 hidparse diff --git a/dlls/hidclass.sys/device.c b/dlls/hidclass.sys/device.c index 0744865f8f7..c252125d8eb 100644 --- a/dlls/hidclass.sys/device.c +++ b/dlls/hidclass.sys/device.c @@ -351,7 +351,7 @@ static DWORD CALLBACK hid_device_thread(void *args) if (!(report = find_report_with_type_and_id( ext, HidP_Input, buffer[0], FALSE ))) WARN( "dropping unknown input id %u\n", buffer[0] ); else if (!polled && io.Information < report->InputLength) - WARN( "dropping short report, len %u expected %u\n", (ULONG)io.Information, report->InputLength ); + WARN( "dropping short report, len %Iu expected %u\n", io.Information, report->InputLength ); else { packet->reportId = buffer[0]; @@ -364,7 +364,7 @@ static DWORD CALLBACK hid_device_thread(void *args) res = WaitForSingleObject(ext->u.pdo.halt_event, polled ? ext->u.pdo.poll_interval : 0); } while (res == WAIT_TIMEOUT); - TRACE("device thread exiting, res %#x\n", res); + TRACE( "device thread exiting, res %#lx\n", res ); return 1; } @@ -561,7 +561,7 @@ NTSTATUS WINAPI pdo_ioctl(DEVICE_OBJECT *device, IRP *irp) irp->IoStatus.Information = 0; - TRACE("device %p ioctl(%x)\n", device, irpsp->Parameters.DeviceIoControl.IoControlCode); + TRACE( "device %p code %#lx\n", device, irpsp->Parameters.DeviceIoControl.IoControlCode ); KeAcquireSpinLock(&ext->u.pdo.lock, &irql); removed = ext->u.pdo.removed; @@ -661,8 +661,8 @@ NTSTATUS WINAPI pdo_ioctl(DEVICE_OBJECT *device, IRP *irp) default: { ULONG code = irpsp->Parameters.DeviceIoControl.IoControlCode; - FIXME("Unsupported ioctl %x (device=%x access=%x func=%x method=%x)\n", - code, code >> 16, (code >> 14) & 3, (code >> 2) & 0xfff, code & 3); + FIXME( "Unsupported ioctl %#lx (device=%lx access=%lx func=%lx method=%lx)\n", code, + code >> 16, (code >> 14) & 3, (code >> 2) & 0xfff, code & 3 ); irp->IoStatus.Status = STATUS_NOT_SUPPORTED; break; } diff --git a/dlls/hidclass.sys/pnp.c b/dlls/hidclass.sys/pnp.c index 6dafa1b95af..fec51af40a9 100644 --- a/dlls/hidclass.sys/pnp.c +++ b/dlls/hidclass.sys/pnp.c @@ -143,13 +143,13 @@ static NTSTATUS WINAPI driver_add_device(DRIVER_OBJECT *driver, DEVICE_OBJECT *b if ((status = get_device_id(bus_pdo, BusQueryDeviceID, device_id))) { - ERR("Failed to get PDO device id, status %#x.\n", status); + ERR( "Failed to get PDO device id, status %#lx.\n", status ); return status; } if ((status = get_device_id(bus_pdo, BusQueryInstanceID, instance_id))) { - ERR("Failed to get PDO instance id, status %#x.\n", status); + ERR( "Failed to get PDO instance id, status %#lx.\n", status ); return status; } @@ -159,7 +159,7 @@ static NTSTATUS WINAPI driver_add_device(DRIVER_OBJECT *driver, DEVICE_OBJECT *b if ((status = IoCreateDevice(driver, sizeof(*ext) + minidriver->minidriver.DeviceExtensionSize, NULL, FILE_DEVICE_BUS_EXTENDER, 0, FALSE, &fdo))) { - ERR("Failed to create bus FDO, status %#x.\n", status); + ERR( "Failed to create bus FDO, status %#lx.\n", status ); return status; } ext = fdo->DeviceExtension; @@ -177,7 +177,7 @@ static NTSTATUS WINAPI driver_add_device(DRIVER_OBJECT *driver, DEVICE_OBJECT *b status = minidriver->AddDevice(minidriver->minidriver.DriverObject, fdo); if (status != STATUS_SUCCESS) { - ERR("Minidriver AddDevice failed (%x)\n",status); + ERR( "Minidriver AddDevice failed (%lx)\n", status ); IoDeleteDevice(fdo); return status; } @@ -206,7 +206,7 @@ static void create_child(minidriver *minidriver, DEVICE_OBJECT *fdo) call_minidriver( IOCTL_HID_GET_DEVICE_ATTRIBUTES, fdo, NULL, 0, &attr, sizeof(attr), &io ); if (io.Status != STATUS_SUCCESS) { - ERR( "Minidriver failed to get attributes, status %#x.\n", io.Status ); + ERR( "Minidriver failed to get attributes, status %#lx.\n", io.Status ); return; } @@ -215,7 +215,7 @@ static void create_child(minidriver *minidriver, DEVICE_OBJECT *fdo) RtlInitUnicodeString(&string, pdo_name); if ((status = IoCreateDevice(fdo->DriverObject, sizeof(*pdo_ext), &string, 0, 0, FALSE, &child_pdo))) { - ERR( "Failed to create child PDO, status %#x.\n", io.Status ); + ERR( "Failed to create child PDO, status %#lx.\n", io.Status ); return; } fdo_ext->u.fdo.child_pdo = child_pdo; @@ -236,7 +236,7 @@ static void create_child(minidriver *minidriver, DEVICE_OBJECT *fdo) call_minidriver( IOCTL_HID_GET_DEVICE_DESCRIPTOR, fdo, NULL, 0, &descriptor, sizeof(descriptor), &io ); if (io.Status != STATUS_SUCCESS) { - ERR("Cannot get Device Descriptor(%x)\n",status); + ERR( "Cannot get Device Descriptor, status %#lx\n", status ); IoDeleteDevice(child_pdo); return; } @@ -256,7 +256,7 @@ static void create_child(minidriver *minidriver, DEVICE_OBJECT *fdo) descriptor.DescriptorList[i].wReportLength, &io ); if (io.Status != STATUS_SUCCESS) { - ERR("Cannot get Report Descriptor(%x)\n",status); + ERR( "Cannot get Report Descriptor, status %#lx\n", status ); free(reportDescriptor); IoDeleteDevice(child_pdo); return; @@ -290,7 +290,7 @@ static void create_child(minidriver *minidriver, DEVICE_OBJECT *fdo) PLUGPLAY_PROPERTY_PERSISTENT, DEVPROP_TYPE_UINT32, sizeof(pdo_ext->u.pdo.rawinput_handle), &pdo_ext->u.pdo.rawinput_handle))) { - ERR("Failed to set device handle property, status %x\n", status); + ERR( "Failed to set device handle property, status %#lx\n", status ); IoDeleteDevice(child_pdo); return; } @@ -444,7 +444,7 @@ static NTSTATUS pdo_pnp(DEVICE_OBJECT *device, IRP *irp) case IRP_MN_START_DEVICE: if ((status = IoRegisterDeviceInterface(device, ext->class_guid, NULL, &ext->u.pdo.link_name))) { - ERR("Failed to register interface, status %#x.\n", status); + ERR( "Failed to register interface, status %#lx.\n", status ); break; }
1
0
0
0
Zebediah Figura : ws2_32: Return WSAEFAULT instead of WSAEINVAL from WSAStartup() if "data" is NULL.
by Alexandre Julliard
01 Feb '22
01 Feb '22
Module: wine Branch: master Commit: a6cbdb7de82387e1a75bfdb77fa66310a322e6c8 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=a6cbdb7de82387e1a75bfdb7…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Tue Feb 1 00:20:51 2022 -0600 ws2_32: Return WSAEFAULT instead of WSAEINVAL from WSAStartup() if "data" is NULL. Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ws2_32/socket.c | 2 +- dlls/ws2_32/tests/protocol.c | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c index 7a1483f140f..a75aaee68be 100644 --- a/dlls/ws2_32/socket.c +++ b/dlls/ws2_32/socket.c @@ -594,7 +594,7 @@ int WINAPI WSAStartup( WORD version, WSADATA *data ) if (!LOBYTE(version)) return WSAVERNOTSUPPORTED; - if (!data) return WSAEINVAL; + if (!data) return WSAEFAULT; num_startup++; TRACE( "increasing startup count to %d\n", num_startup ); diff --git a/dlls/ws2_32/tests/protocol.c b/dlls/ws2_32/tests/protocol.c index 8b429e5c914..1ff335f7fe2 100644 --- a/dlls/ws2_32/tests/protocol.c +++ b/dlls/ws2_32/tests/protocol.c @@ -2880,8 +2880,7 @@ static void test_startup(void) ok(WSAGetLastError() == WSANOTINITIALISED, "got error %u\n", WSAGetLastError()); ret = WSAStartup(tests[i].version, NULL); - todo_wine_if (LOBYTE(tests[i].version)) - ok(ret == (LOBYTE(tests[i].version) ? WSAEFAULT : WSAVERNOTSUPPORTED), "got %d\n", ret); + ok(ret == (LOBYTE(tests[i].version) ? WSAEFAULT : WSAVERNOTSUPPORTED), "got %d\n", ret); winetest_pop_context(); }
1
0
0
0
Zebediah Figura : ws2_32: Return 65467 or 0 in the iMaxUdpDg field.
by Alexandre Julliard
01 Feb '22
01 Feb '22
Module: wine Branch: master Commit: 5efc6369ebf5d1e262ac68dbcac546a11bded6ca URL:
https://source.winehq.org/git/wine.git/?a=commit;h=5efc6369ebf5d1e262ac68db…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Tue Feb 1 00:20:50 2022 -0600 ws2_32: Return 65467 or 0 in the iMaxUdpDg field. Depending on reported winsock version. Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ws2_32/socket.c | 3 +-- dlls/ws2_32/tests/protocol.c | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c index 19a7d901414..7a1483f140f 100644 --- a/dlls/ws2_32/socket.c +++ b/dlls/ws2_32/socket.c @@ -419,7 +419,6 @@ static BOOL socket_list_remove( SOCKET socket ) return FALSE; } -#define MAX_UDP_DATAGRAM 1024 static INT WINAPI WSA_DefaultBlockingHook( FARPROC x ); int num_startup; @@ -588,7 +587,7 @@ int WINAPI WSAStartup( WORD version, WSADATA *data ) strcpy( data->szDescription, "WinSock 2.0" ); strcpy( data->szSystemStatus, "Running" ); data->iMaxSockets = (LOBYTE(version) == 1 ? 32767 : 0); - data->iMaxUdpDg = MAX_UDP_DATAGRAM; + data->iMaxUdpDg = (LOBYTE(version) == 1 ? 65467 : 0); /* don't fill lpVendorInfo */ } diff --git a/dlls/ws2_32/tests/protocol.c b/dlls/ws2_32/tests/protocol.c index a95b6e685af..8b429e5c914 100644 --- a/dlls/ws2_32/tests/protocol.c +++ b/dlls/ws2_32/tests/protocol.c @@ -2872,7 +2872,7 @@ static void test_startup(void) ok(!strcmp(data.szDescription, "WinSock 2.0"), "got description %s\n", debugstr_a(data.szDescription)); ok(!strcmp(data.szSystemStatus, "Running"), "got status %s\n", debugstr_a(data.szSystemStatus)); ok(data.iMaxSockets == (LOBYTE(tests[i].version) == 1 ? 32767 : 0), "got maximum sockets %u\n", data.iMaxSockets); - todo_wine ok(data.iMaxUdpDg == (LOBYTE(tests[i].version) == 1 ? 65467 : 0), "got maximum datagram size %u\n", data.iMaxUdpDg); + ok(data.iMaxUdpDg == (LOBYTE(tests[i].version) == 1 ? 65467 : 0), "got maximum datagram size %u\n", data.iMaxUdpDg); WSASetLastError(0xdeadbeef); ret = WSACleanup();
1
0
0
0
Zebediah Figura : ws2_32: Return 32767 or 0 in the iMaxSockets field.
by Alexandre Julliard
01 Feb '22
01 Feb '22
Module: wine Branch: master Commit: 699643c4276ad6b73a2077886ed1bef138b5cfef URL:
https://source.winehq.org/git/wine.git/?a=commit;h=699643c4276ad6b73a207788…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Tue Feb 1 00:20:49 2022 -0600 ws2_32: Return 32767 or 0 in the iMaxSockets field. Depending on reported winsock version. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=50352
Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ws2_32/socket.c | 3 +-- dlls/ws2_32/tests/protocol.c | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c index 565f1c89dc0..19a7d901414 100644 --- a/dlls/ws2_32/socket.c +++ b/dlls/ws2_32/socket.c @@ -419,7 +419,6 @@ static BOOL socket_list_remove( SOCKET socket ) return FALSE; } -#define MAX_SOCKETS_PER_PROCESS 128 /* reasonable guess */ #define MAX_UDP_DATAGRAM 1024 static INT WINAPI WSA_DefaultBlockingHook( FARPROC x ); @@ -588,7 +587,7 @@ int WINAPI WSAStartup( WORD version, WSADATA *data ) data->wHighVersion = MAKEWORD(2, 2); strcpy( data->szDescription, "WinSock 2.0" ); strcpy( data->szSystemStatus, "Running" ); - data->iMaxSockets = MAX_SOCKETS_PER_PROCESS; + data->iMaxSockets = (LOBYTE(version) == 1 ? 32767 : 0); data->iMaxUdpDg = MAX_UDP_DATAGRAM; /* don't fill lpVendorInfo */ } diff --git a/dlls/ws2_32/tests/protocol.c b/dlls/ws2_32/tests/protocol.c index db89febff2e..a95b6e685af 100644 --- a/dlls/ws2_32/tests/protocol.c +++ b/dlls/ws2_32/tests/protocol.c @@ -2871,7 +2871,7 @@ static void test_startup(void) ok(data.wHighVersion == 0x202, "got maximum version %#x\n", data.wHighVersion); ok(!strcmp(data.szDescription, "WinSock 2.0"), "got description %s\n", debugstr_a(data.szDescription)); ok(!strcmp(data.szSystemStatus, "Running"), "got status %s\n", debugstr_a(data.szSystemStatus)); - todo_wine ok(data.iMaxSockets == (LOBYTE(tests[i].version) == 1 ? 32767 : 0), "got maximum sockets %u\n", data.iMaxSockets); + ok(data.iMaxSockets == (LOBYTE(tests[i].version) == 1 ? 32767 : 0), "got maximum sockets %u\n", data.iMaxSockets); todo_wine ok(data.iMaxUdpDg == (LOBYTE(tests[i].version) == 1 ? 65467 : 0), "got maximum datagram size %u\n", data.iMaxUdpDg); WSASetLastError(0xdeadbeef);
1
0
0
0
← Newer
1
...
145
146
147
148
149
150
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
Results per page:
10
25
50
100
200