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: Implement static_ports_Add().
by Alexandre Julliard
02 Feb '22
02 Feb '22
Module: wine Branch: master Commit: 8f8fe74f89ec5e76e03d702e67dd3233d0b6af4c URL:
https://source.winehq.org/git/wine.git/?a=commit;h=8f8fe74f89ec5e76e03d702e…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Wed Feb 2 11:32:59 2022 +0300 hnetcfg: Implement static_ports_Add(). Signed-off-by: Paul Gofman <pgofman(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/hnetcfg/port.c | 76 +++++++++++++++++++++++++++++++++++++++++++-- dlls/hnetcfg/tests/policy.c | 6 ++-- 2 files changed, 76 insertions(+), 6 deletions(-) diff --git a/dlls/hnetcfg/port.c b/dlls/hnetcfg/port.c index 88816b7ee34..def77621764 100644 --- a/dlls/hnetcfg/port.c +++ b/dlls/hnetcfg/port.c @@ -638,6 +638,51 @@ static BOOL remove_port_mapping( LONG port, BSTR protocol ) return ret; } +static BOOL add_port_mapping( LONG external, BSTR protocol, LONG internal, BSTR client, + VARIANT_BOOL enabled, BSTR description ) +{ + struct xml_value_desc mapping_desc[PM_LAST]; + WCHAR externalW[6], internalW[6]; + DWORD status = 0; + BSTR error_str; + BOOL ret; + + AcquireSRWLockExclusive( &upnp_gateway_connection_lock ); + memcpy( mapping_desc, port_mapping_template, sizeof(mapping_desc) ); + swprintf( externalW, ARRAY_SIZE(externalW), L"%u", external ); + swprintf( internalW, ARRAY_SIZE(internalW), L"%u", internal ); + mapping_desc[PM_EXTERNAL_IP].value = SysAllocString( L"" ); + mapping_desc[PM_EXTERNAL].value = SysAllocString( externalW ); + mapping_desc[PM_PROTOCOL].value = protocol; + mapping_desc[PM_INTERNAL].value = SysAllocString( internalW ); + mapping_desc[PM_CLIENT].value = client; + mapping_desc[PM_ENABLED].value = SysAllocString( enabled ? L"1" : L"0" ); + mapping_desc[PM_DESC].value = description; + mapping_desc[PM_LEASE_DURATION].value = SysAllocString( L"0" ); + + ret = request_service( L"AddPortMapping", mapping_desc, PM_LAST, + NULL, 0, &status, &error_str ); + if (ret && status != HTTP_STATUS_OK) + { + WARN( "status %u, server returned error %s.\n", status, debugstr_w(error_str) ); + SysFreeString( error_str ); + ret = FALSE; + } + else if (!ret) + { + WARN( "Request failed.\n" ); + } + update_mapping_list(); + ReleaseSRWLockExclusive( &upnp_gateway_connection_lock ); + + SysFreeString( mapping_desc[PM_EXTERNAL_IP].value ); + SysFreeString( mapping_desc[PM_EXTERNAL].value ); + SysFreeString( mapping_desc[PM_INTERNAL].value ); + SysFreeString( mapping_desc[PM_ENABLED].value ); + SysFreeString( mapping_desc[PM_LEASE_DURATION].value ); + return ret; +} + static BOOL init_gateway_connection(void) { static const char upnp_search_request[] = @@ -1458,12 +1503,37 @@ static HRESULT WINAPI static_ports_Add( BSTR description, IStaticPortMapping **mapping ) { - FIXME( "iface %p, external %d, protocol %s, internal %d, client %s, enabled %d, descritption %s, mapping %p stub.\n", + struct port_mapping mapping_data; + HRESULT ret; + + TRACE( "iface %p, external %d, protocol %s, internal %d, client %s, enabled %d, descritption %s, mapping %p.\n", iface, external, debugstr_w(protocol), internal, debugstr_w(client), enabled, debugstr_w(description), mapping ); - if (mapping) *mapping = NULL; - return E_NOTIMPL; + if (!mapping) return E_POINTER; + *mapping = NULL; + + if (!is_valid_protocol( protocol )) return E_INVALIDARG; + if (external < 0 || external > 65535) return E_INVALIDARG; + if (internal < 0 || internal > 65535) return E_INVALIDARG; + if (!client || !description) return E_INVALIDARG; + + if (!add_port_mapping( external, protocol, internal, client, enabled, description )) return E_FAIL; + + mapping_data.external_ip = NULL; + mapping_data.external = external; + mapping_data.protocol = SysAllocString( protocol ); + mapping_data.internal = internal; + mapping_data.client = SysAllocString( client ); + mapping_data.enabled = enabled; + mapping_data.descr = SysAllocString( description ); + if (!mapping_data.protocol || !mapping_data.client || !mapping_data.descr) + { + free_port_mapping( &mapping_data ); + return E_OUTOFMEMORY; + } + if (FAILED(ret = static_port_mapping_create( &mapping_data, mapping ))) free_port_mapping( &mapping_data ); + return ret; } static const IStaticPortMappingCollectionVtbl static_ports_vtbl = diff --git a/dlls/hnetcfg/tests/policy.c b/dlls/hnetcfg/tests/policy.c index f9178f9b07b..b6b353ac87d 100644 --- a/dlls/hnetcfg/tests/policy.c +++ b/dlls/hnetcfg/tests/policy.c @@ -212,14 +212,14 @@ static void test_static_port_mapping_collection( IStaticPortMappingCollection *p hr = IStaticPortMappingCollection_Add(ports, 12345, (BSTR)L"udp", 12345, (BSTR)L"1.2.3.4", VARIANT_TRUE, (BSTR)L"wine_test", &pm); - todo_wine ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); + 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); - todo_wine ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + 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); - todo_wine ok(count2 == expected_count, "Got unexpected count2 %u, expected %u.\n", count2, expected_count); + 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);
1
0
0
0
Paul Gofman : hnetcfg: Implement static_ports_Remove().
by Alexandre Julliard
02 Feb '22
02 Feb '22
Module: wine Branch: master Commit: 559b1d2ccf09b4a567468603035fd31477644722 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=559b1d2ccf09b4a567468603…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Wed Feb 2 11:32:58 2022 +0300 hnetcfg: Implement static_ports_Remove(). Signed-off-by: Paul Gofman <pgofman(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/hnetcfg/port.c | 47 ++++++++++++++++++++++++++++++++++++++++++--- dlls/hnetcfg/tests/policy.c | 2 +- 2 files changed, 45 insertions(+), 4 deletions(-) diff --git a/dlls/hnetcfg/port.c b/dlls/hnetcfg/port.c index 8c80b02babc..88816b7ee34 100644 --- a/dlls/hnetcfg/port.c +++ b/dlls/hnetcfg/port.c @@ -515,7 +515,8 @@ enum port_mapping_parameter PM_ENABLED, PM_DESC, PM_LEASE_DURATION, - PM_LAST + PM_LAST, + PM_REMOVE_PORT_LAST = PM_INTERNAL, }; static struct xml_value_desc port_mapping_template[] = @@ -602,6 +603,41 @@ static void update_mapping_list(void) } } +static BOOL remove_port_mapping( LONG port, BSTR protocol ) +{ + struct xml_value_desc mapping_desc[PM_REMOVE_PORT_LAST]; + DWORD status = 0; + BSTR error_str; + WCHAR portW[6]; + BOOL ret; + + AcquireSRWLockExclusive( &upnp_gateway_connection_lock ); + memcpy( mapping_desc, port_mapping_template, sizeof(mapping_desc) ); + swprintf( portW, ARRAY_SIZE(portW), L"%u", port ); + mapping_desc[PM_EXTERNAL_IP].value = SysAllocString( L"" ); + mapping_desc[PM_EXTERNAL].value = SysAllocString( portW ); + mapping_desc[PM_PROTOCOL].value = protocol; + + ret = request_service( L"DeletePortMapping", mapping_desc, PM_REMOVE_PORT_LAST, + NULL, 0, &status, &error_str ); + if (ret && status != HTTP_STATUS_OK) + { + WARN( "status %u, server returned error %s.\n", status, debugstr_w(error_str) ); + SysFreeString( error_str ); + ret = FALSE; + } + else if (!ret) + { + WARN( "Request failed.\n" ); + } + update_mapping_list(); + ReleaseSRWLockExclusive( &upnp_gateway_connection_lock ); + + SysFreeString( mapping_desc[PM_EXTERNAL_IP].value ); + SysFreeString( mapping_desc[PM_EXTERNAL].value ); + return ret; +} + static BOOL init_gateway_connection(void) { static const char upnp_search_request[] = @@ -1402,9 +1438,14 @@ static HRESULT WINAPI static_ports_Remove( LONG port, BSTR protocol ) { - FIXME( "iface %p, port %d, protocol %s stub.\n", iface, port, debugstr_w(protocol) ); + TRACE( "iface %p, port %d, protocol %s.\n", iface, port, debugstr_w(protocol) ); - return E_NOTIMPL; + if (!is_valid_protocol( protocol )) return E_INVALIDARG; + if (port < 0 || port > 65535) return E_INVALIDARG; + + if (!remove_port_mapping( port, protocol )) return E_FAIL; + + return S_OK; } static HRESULT WINAPI static_ports_Add( diff --git a/dlls/hnetcfg/tests/policy.c b/dlls/hnetcfg/tests/policy.c index ffe3442dcd0..f9178f9b07b 100644 --- a/dlls/hnetcfg/tests/policy.c +++ b/dlls/hnetcfg/tests/policy.c @@ -280,7 +280,7 @@ static void test_static_port_mapping_collection( IStaticPortMappingCollection *p hr = IStaticPortMappingCollection_Remove(ports, 12345, (BSTR)L"UDP"); ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); hr = IStaticPortMappingCollection_Remove(ports, 12345, (BSTR)L"UDP"); - todo_wine ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); IEnumVARIANT_Release(enum_ports); }
1
0
0
0
Paul Gofman : hnetcfg: Implement static_ports__NewEnum().
by Alexandre Julliard
02 Feb '22
02 Feb '22
Module: wine Branch: master Commit: de05efdea217d25c296ecd9fb698075cc91528e5 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=de05efdea217d25c296ecd9f…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Wed Feb 2 11:32:57 2022 +0300 hnetcfg: Implement static_ports__NewEnum(). Signed-off-by: Paul Gofman <pgofman(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/hnetcfg/port.c | 181 +++++++++++++++++++++++++++++++++++++++++++- dlls/hnetcfg/tests/policy.c | 11 +-- 2 files changed, 184 insertions(+), 8 deletions(-) diff --git a/dlls/hnetcfg/port.c b/dlls/hnetcfg/port.c index 34e054527d9..8c80b02babc 100644 --- a/dlls/hnetcfg/port.c +++ b/dlls/hnetcfg/port.c @@ -735,6 +735,22 @@ static BOOL find_port_mapping( LONG port, BSTR protocol, struct port_mapping *re return found; } +static unsigned int get_port_mapping_range( unsigned int index, unsigned int count, struct port_mapping *ret ) +{ + unsigned int i; + + AcquireSRWLockExclusive( &upnp_gateway_connection_lock ); + for (i = 0; i < count && index + i < upnp_gateway_connection.mapping_count; ++i) + if (!copy_port_mapping( &ret[i], &upnp_gateway_connection.mappings[index + i] )) + { + ERR( "No memory.\n" ); + break; + } + ReleaseSRWLockExclusive( &upnp_gateway_connection_lock ); + + return i; +} + static unsigned int get_port_mapping_count(void) { unsigned int ret; @@ -1048,6 +1064,164 @@ static HRESULT static_port_mapping_create( const struct port_mapping *mapping_da return S_OK; } +struct port_mapping_enum +{ + IEnumVARIANT IEnumVARIANT_iface; + LONG refs; + unsigned int index; +}; + +static inline struct port_mapping_enum *impl_from_IEnumVARIANT( IEnumVARIANT *iface ) +{ + return CONTAINING_RECORD(iface, struct port_mapping_enum, IEnumVARIANT_iface); +} + +static ULONG WINAPI port_mapping_enum_AddRef( + IEnumVARIANT *iface ) +{ + struct port_mapping_enum *mapping_enum = impl_from_IEnumVARIANT( iface ); + return InterlockedIncrement( &mapping_enum->refs ); +} + +static ULONG WINAPI port_mapping_enum_Release( + IEnumVARIANT *iface ) +{ + struct port_mapping_enum *mapping_enum = impl_from_IEnumVARIANT( iface ); + LONG refs = InterlockedDecrement( &mapping_enum->refs ); + if (!refs) + { + TRACE("destroying %p\n", mapping_enum); + free( mapping_enum ); + release_gateway_connection(); + } + return refs; +} + +static HRESULT WINAPI port_mapping_enum_QueryInterface( + IEnumVARIANT *iface, + REFIID riid, + void **ppvObject ) +{ + struct port_mapping_enum *mapping_enum = impl_from_IEnumVARIANT( iface ); + + TRACE("%p %s %p\n", mapping_enum, debugstr_guid( riid ), ppvObject ); + + if ( IsEqualGUID( riid, &IID_IEnumVARIANT ) || + IsEqualGUID( riid, &IID_IUnknown ) ) + { + *ppvObject = iface; + } + else + { + FIXME("interface %s not implemented\n", debugstr_guid(riid)); + return E_NOINTERFACE; + } + IEnumVARIANT_AddRef( iface ); + return S_OK; +} + +static HRESULT WINAPI port_mapping_enum_Next( IEnumVARIANT *iface, ULONG celt, VARIANT *var, ULONG *fetched ) +{ + struct port_mapping_enum *mapping_enum = impl_from_IEnumVARIANT( iface ); + struct port_mapping *data; + IStaticPortMapping *pm; + unsigned int i, count; + HRESULT ret; + + TRACE( "iface %p, celt %u, var %p, fetched %p.\n", iface, celt, var, fetched ); + + if (fetched) *fetched = 0; + if (!celt) return S_OK; + if (!var) return E_POINTER; + + if (!(data = calloc( 1, celt * sizeof(*data) ))) return E_OUTOFMEMORY; + count = get_port_mapping_range( mapping_enum->index, celt, data ); + TRACE( "count %u.\n", count ); + for (i = 0; i < count; ++i) + { + if (FAILED(static_port_mapping_create( &data[i], &pm ))) break; + + V_VT(&var[i]) = VT_DISPATCH; + V_DISPATCH(&var[i]) = (IDispatch *)pm; + } + mapping_enum->index += i; + if (fetched) *fetched = i; + ret = (i < celt) ? S_FALSE : S_OK; + for ( ; i < count; ++i) + { + free_port_mapping( &data[i] ); + VariantInit( &var[i] ); + } + for ( ; i < celt; ++i) + VariantInit( &var[i] ); + + free( data ); + return ret; +} + +static HRESULT WINAPI port_mapping_enum_Skip( IEnumVARIANT *iface, ULONG celt ) +{ + struct port_mapping_enum *mapping_enum = impl_from_IEnumVARIANT( iface ); + unsigned int count = get_port_mapping_count(); + + TRACE( "iface %p, celt %u.\n", iface, celt ); + + mapping_enum->index += celt; + return mapping_enum->index <= count ? S_OK : S_FALSE; +} + +static HRESULT WINAPI port_mapping_enum_Reset( IEnumVARIANT *iface ) +{ + struct port_mapping_enum *mapping_enum = impl_from_IEnumVARIANT( iface ); + + TRACE( "iface %p.\n", iface ); + + mapping_enum->index = 0; + return S_OK; +} + +static HRESULT create_port_mapping_enum( IUnknown **ret ); + +static HRESULT WINAPI port_mapping_enum_Clone( IEnumVARIANT *iface, IEnumVARIANT **ret ) +{ + struct port_mapping_enum *mapping_enum = impl_from_IEnumVARIANT( iface ); + HRESULT hr; + + TRACE( "iface %p, ret %p.\n", iface, ret ); + + if (!ret) return E_POINTER; + *ret = NULL; + if (FAILED(hr = create_port_mapping_enum( (IUnknown **)ret ))) return hr; + impl_from_IEnumVARIANT( *ret )->index = mapping_enum->index; + return S_OK; +} + +static const IEnumVARIANTVtbl port_mapping_enum_vtbl = +{ + port_mapping_enum_QueryInterface, + port_mapping_enum_AddRef, + port_mapping_enum_Release, + port_mapping_enum_Next, + port_mapping_enum_Skip, + port_mapping_enum_Reset, + port_mapping_enum_Clone, +}; + +static HRESULT create_port_mapping_enum( IUnknown **ret ) +{ + struct port_mapping_enum *mapping_enum; + + if (!(mapping_enum = calloc( 1, sizeof(*mapping_enum) ))) return E_OUTOFMEMORY; + + grab_gateway_connection(); + + mapping_enum->refs = 1; + mapping_enum->IEnumVARIANT_iface.lpVtbl = &port_mapping_enum_vtbl; + mapping_enum->index = 0; + *ret = (IUnknown *)&mapping_enum->IEnumVARIANT_iface; + return S_OK; +} + struct static_port_mapping_collection { IStaticPortMappingCollection IStaticPortMappingCollection_iface; @@ -1183,11 +1357,12 @@ static HRESULT WINAPI static_ports__NewEnum( IStaticPortMappingCollection *iface, IUnknown **ret ) { - FIXME( "iface %p, ret %p stub.\n", iface, ret ); + TRACE( "iface %p, ret %p.\n", iface, ret ); - if (ret) *ret = NULL; + if (!ret) return E_POINTER; - return E_NOTIMPL; + *ret = NULL; + return create_port_mapping_enum( ret ); } static HRESULT WINAPI static_ports_get_Item( diff --git a/dlls/hnetcfg/tests/policy.c b/dlls/hnetcfg/tests/policy.c index 19b6e3f6f2e..ffe3442dcd0 100644 --- a/dlls/hnetcfg/tests/policy.c +++ b/dlls/hnetcfg/tests/policy.c @@ -184,8 +184,7 @@ static void test_static_port_mapping_collection( IStaticPortMappingCollection *p refcount = get_refcount((IUnknown *)ports); hr = IStaticPortMappingCollection_get__NewEnum(ports, &unk); - todo_wine ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); - if (FAILED(hr)) return; + 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); @@ -213,14 +212,14 @@ static void test_static_port_mapping_collection( IStaticPortMappingCollection *p 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); + todo_wine 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); + todo_wine 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); + todo_wine 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); @@ -280,6 +279,8 @@ static void test_static_port_mapping_collection( IStaticPortMappingCollection *p hr = IStaticPortMappingCollection_Remove(ports, 12345, (BSTR)L"UDP"); ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + hr = IStaticPortMappingCollection_Remove(ports, 12345, (BSTR)L"UDP"); + todo_wine ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); IEnumVARIANT_Release(enum_ports); }
1
0
0
0
Paul Gofman : hnetcfg: Implement static_ports_get_Count().
by Alexandre Julliard
02 Feb '22
02 Feb '22
Module: wine Branch: master Commit: 7ed9fb0a6876aa6f3ebaf92ec7f519d37a2a7b7a URL:
https://source.winehq.org/git/wine.git/?a=commit;h=7ed9fb0a6876aa6f3ebaf92e…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Wed Feb 2 11:32:56 2022 +0300 hnetcfg: Implement static_ports_get_Count(). Signed-off-by: Paul Gofman <pgofman(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/hnetcfg/port.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/dlls/hnetcfg/port.c b/dlls/hnetcfg/port.c index c04aaefe56a..34e054527d9 100644 --- a/dlls/hnetcfg/port.c +++ b/dlls/hnetcfg/port.c @@ -735,6 +735,16 @@ static BOOL find_port_mapping( LONG port, BSTR protocol, struct port_mapping *re return found; } +static unsigned int get_port_mapping_count(void) +{ + unsigned int ret; + + AcquireSRWLockExclusive( &upnp_gateway_connection_lock ); + ret = upnp_gateway_connection.mapping_count; + ReleaseSRWLockExclusive( &upnp_gateway_connection_lock ); + return ret; +} + static BOOL is_valid_protocol( BSTR protocol ) { if (!protocol) return FALSE; @@ -1205,10 +1215,11 @@ static HRESULT WINAPI static_ports_get_Count( IStaticPortMappingCollection *iface, LONG *count ) { - FIXME( "iface %p, count %p stub.\n", iface, count ); + TRACE( "iface %p, count %p.\n", iface, count ); - if (count) *count = 0; - return E_NOTIMPL; + if (!count) return E_POINTER; + *count = get_port_mapping_count(); + return S_OK; } static HRESULT WINAPI static_ports_Remove(
1
0
0
0
Paul Gofman : hnetcfg: Implement static_ports_get_Item().
by Alexandre Julliard
02 Feb '22
02 Feb '22
Module: wine Branch: master Commit: 15fac20f2c2cc9bde7576d41ab92b4cf8884d238 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=15fac20f2c2cc9bde7576d41…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Wed Feb 2 11:32:55 2022 +0300 hnetcfg: Implement static_ports_get_Item(). Signed-off-by: Paul Gofman <pgofman(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/hnetcfg/apps.c | 1 + dlls/hnetcfg/hnetcfg_private.h | 1 + dlls/hnetcfg/port.c | 358 ++++++++++++++++++++++++++++++++++++++++- 3 files changed, 357 insertions(+), 3 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=15fac20f2c2cc9bde757…
1
0
0
0
Paul Gofman : hnetcfg: Get port mapping list in init_gateway_connection().
by Alexandre Julliard
02 Feb '22
02 Feb '22
Module: wine Branch: master Commit: e98a102bdda143aec57851f93220cc362fa7e325 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=e98a102bdda143aec57851f9…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Wed Feb 2 11:32:54 2022 +0300 hnetcfg: Get port mapping list 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 | 306 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 306 insertions(+) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=e98a102bdda143aec578…
1
0
0
0
Paul Gofman : hnetcfg: Fix realloc handling in fw_app_put_ProcessImageFileName().
by Alexandre Julliard
02 Feb '22
02 Feb '22
Module: wine Branch: master Commit: 42b2a69a67b78163a1b2ed091dee0abd74745c57 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=42b2a69a67b78163a1b2ed09…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Wed Feb 2 11:32:53 2022 +0300 hnetcfg: Fix realloc handling in fw_app_put_ProcessImageFileName(). Signed-off-by: Paul Gofman <pgofman(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/hnetcfg/apps.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dlls/hnetcfg/apps.c b/dlls/hnetcfg/apps.c index c5fe5e41f5e..f351e2482e8 100644 --- a/dlls/hnetcfg/apps.c +++ b/dlls/hnetcfg/apps.c @@ -269,7 +269,7 @@ static HRESULT WINAPI fw_app_put_ProcessImageFileName( fw_app *This = impl_from_INetFwAuthorizedApplication( iface ); UNIVERSAL_NAME_INFOW *info; DWORD sz, longsz; - WCHAR *path; + WCHAR *path, *new_path; DWORD res; FIXME("%p, %s\n", This, debugstr_w(image)); @@ -303,11 +303,12 @@ static HRESULT WINAPI fw_app_put_ProcessImageFileName( longsz = GetLongPathNameW(path, path, sz); if (longsz > sz) { - if (!(path = realloc(path, longsz * sizeof(WCHAR)))) + if (!(new_path = realloc(path, longsz * sizeof(WCHAR)))) { free(path); return E_OUTOFMEMORY; } + path = new_path; GetLongPathNameW(path, path, longsz); }
1
0
0
0
Zebediah Figura : devenum: Build without -DWINE_NO_LONG_TYPES.
by Alexandre Julliard
02 Feb '22
02 Feb '22
Module: wine Branch: master Commit: 95aa1bab76d6582df2e64b6fc6ac5f4ddcfdeb78 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=95aa1bab76d6582df2e64b6f…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Tue Feb 1 23:47:09 2022 -0600 devenum: Build without -DWINE_NO_LONG_TYPES. Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/devenum/Makefile.in | 1 - dlls/devenum/createdevenum.c | 2 +- dlls/devenum/mediacatenum.c | 48 ++++++++++++++++++++++++-------------------- 3 files changed, 27 insertions(+), 24 deletions(-) diff --git a/dlls/devenum/Makefile.in b/dlls/devenum/Makefile.in index c1a88ac8e4e..16ae8e1abfa 100644 --- a/dlls/devenum/Makefile.in +++ b/dlls/devenum/Makefile.in @@ -1,4 +1,3 @@ -EXTRADEFS = -DWINE_NO_LONG_TYPES MODULE = devenum.dll IMPORTS = dmoguids strmiids uuid ole32 oleaut32 avicap32 winmm user32 advapi32 dsound msdmo DELAYIMPORTS = msvfw32 diff --git a/dlls/devenum/createdevenum.c b/dlls/devenum/createdevenum.c index bec462e0f5a..8d59d6b385d 100644 --- a/dlls/devenum/createdevenum.c +++ b/dlls/devenum/createdevenum.c @@ -769,7 +769,7 @@ static HRESULT WINAPI devenum_factory_CreateClassEnumerator(ICreateDevEnum *ifac HRESULT hr; HKEY key; - TRACE("iface %p, class %s, out %p, flags %#x.\n", iface, debugstr_guid(class), out, flags); + TRACE("iface %p, class %s, out %p, flags %#lx.\n", iface, debugstr_guid(class), out, flags); if (!out) return E_POINTER; diff --git a/dlls/devenum/mediacatenum.c b/dlls/devenum/mediacatenum.c index 9d8069a3aa2..2d87709bea6 100644 --- a/dlls/devenum/mediacatenum.c +++ b/dlls/devenum/mediacatenum.c @@ -137,8 +137,8 @@ static HRESULT WINAPI property_bag_Read(IPropertyBag *iface, } else if (!wcscmp(name, L"FilterData")) { - unsigned int count = 1, input_count, output_count, i; DMO_PARTIAL_MEDIATYPE *types = NULL, *new_array; + ULONG count = 1, input_count, output_count, i; REGFILTERPINS2 reg_pins[2] = {{0}}; REGFILTER2 reg_filter = {0}; REGPINTYPES *reg_types; @@ -287,7 +287,7 @@ static HRESULT WINAPI property_bag_Read(IPropertyBag *iface, return S_OK; } default: - FIXME("Unhandled type %#x.\n", type); + FIXME("Unhandled type %#lx.\n", type); free(data); return E_NOTIMPL; } @@ -396,26 +396,27 @@ static HRESULT WINAPI moniker_QueryInterface(IMoniker *iface, REFIID riid, void static ULONG WINAPI moniker_AddRef(IMoniker *iface) { - struct moniker *This = impl_from_IMoniker(iface); - ULONG ref = InterlockedIncrement(&This->ref); + struct moniker *moniker = impl_from_IMoniker(iface); + ULONG refcount = InterlockedIncrement(&moniker->ref); - TRACE("(%p) ref=%d\n", This, ref); + TRACE("%p increasing refcount to %lu.\n", moniker, refcount); - return ref; + return refcount; } static ULONG WINAPI moniker_Release(IMoniker *iface) { struct moniker *This = impl_from_IMoniker(iface); - ULONG ref = InterlockedDecrement(&This->ref); + ULONG refcount = InterlockedDecrement(&This->ref); - TRACE("(%p) ref=%d\n", This, ref); + TRACE("%p decreasing refcount to %lu.\n", This, refcount); - if (ref == 0) { + if (!refcount) + { free(This->name); free(This); } - return ref; + return refcount; } static HRESULT WINAPI moniker_GetClassID(IMoniker *iface, CLSID *pClassID) @@ -558,7 +559,10 @@ static HRESULT WINAPI moniker_BindToStorage(IMoniker *iface, IBindCtx *pbc, static HRESULT WINAPI moniker_Reduce(IMoniker *iface, IBindCtx *pbc, DWORD dwReduceHowFar, IMoniker **ppmkToLeft, IMoniker **ppmkReduced) { - TRACE("(%p)->(%p, %d, %p, %p)\n", iface, pbc, dwReduceHowFar, ppmkToLeft, ppmkReduced); + struct moniker *moniker = impl_from_IMoniker(iface); + + TRACE("moniker %p, bind_ctx %p, how_far %#lx, left %p, reduced %p.\n", + moniker, pbc, dwReduceHowFar, ppmkToLeft, ppmkReduced); if (ppmkToLeft) *ppmkToLeft = NULL; @@ -848,22 +852,22 @@ static HRESULT WINAPI enum_moniker_QueryInterface(IEnumMoniker *iface, REFIID ri static ULONG WINAPI enum_moniker_AddRef(IEnumMoniker *iface) { - EnumMonikerImpl *This = impl_from_IEnumMoniker(iface); - ULONG ref = InterlockedIncrement(&This->ref); + EnumMonikerImpl *enumerator = impl_from_IEnumMoniker(iface); + ULONG refcount = InterlockedIncrement(&enumerator->ref); - TRACE("(%p) ref=%d\n", This, ref); + TRACE("%p increasing refcount to %lu.\n", enumerator, refcount); - return ref; + return refcount; } static ULONG WINAPI enum_moniker_Release(IEnumMoniker *iface) { EnumMonikerImpl *This = impl_from_IEnumMoniker(iface); - ULONG ref = InterlockedDecrement(&This->ref); + ULONG refcount = InterlockedDecrement(&This->ref); - TRACE("(%p) ref=%d\n", This, ref); + TRACE("%p decreasing refcount to %lu.\n", This, refcount); - if (!ref) + if (!refcount) { if (This->dmo_enum) IEnumDMO_Release(This->dmo_enum); @@ -874,7 +878,7 @@ static ULONG WINAPI enum_moniker_Release(IEnumMoniker *iface) free(This); return 0; } - return ref; + return refcount; } static struct moniker *get_dmo_moniker(EnumMonikerImpl *enum_moniker) @@ -907,7 +911,7 @@ static HRESULT WINAPI enum_moniker_Next(IEnumMoniker *iface, ULONG celt, IMonike ULONG fetched = 0; HKEY hkey; - TRACE("(%p)->(%d, %p, %p)\n", iface, celt, rgelt, pceltFetched); + TRACE("enumerator %p, count %lu, monikers %p, ret_count %p.\n", This, celt, rgelt, pceltFetched); while (fetched < celt) { @@ -944,7 +948,7 @@ static HRESULT WINAPI enum_moniker_Next(IEnumMoniker *iface, ULONG celt, IMonike rgelt[fetched++] = &moniker->IMoniker_iface; } - TRACE("-- fetched %d\n", fetched); + TRACE("Returning %lu monikers.\n", fetched); if (pceltFetched) *pceltFetched = fetched; @@ -959,7 +963,7 @@ static HRESULT WINAPI enum_moniker_Skip(IEnumMoniker *iface, ULONG celt) { EnumMonikerImpl *This = impl_from_IEnumMoniker(iface); - TRACE("(%p)->(%d)\n", iface, celt); + TRACE("enumerator %p, count %lu.\n", This, celt); while (celt--) {
1
0
0
0
Zebediah Figura : quartz/filtergraph: Implement the IDispatch methods for IMediaEvent.
by Alexandre Julliard
02 Feb '22
02 Feb '22
Module: wine Branch: master Commit: 75b8dcd29ff5db9421e013712025dfacb8f42a0f URL:
https://source.winehq.org/git/wine.git/?a=commit;h=75b8dcd29ff5db9421e01371…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Tue Feb 1 22:37:44 2022 -0600 quartz/filtergraph: Implement the IDispatch methods for IMediaEvent. Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/quartz/filtergraph.c | 58 ++++++++++++++++++++++------------------- dlls/quartz/tests/filtergraph.c | 35 +++++++++++++++++++++++++ 2 files changed, 66 insertions(+), 27 deletions(-) diff --git a/dlls/quartz/filtergraph.c b/dlls/quartz/filtergraph.c index 7e3d9fac16a..4132ffa5b2f 100644 --- a/dlls/quartz/filtergraph.c +++ b/dlls/quartz/filtergraph.c @@ -4733,50 +4733,54 @@ static ULONG WINAPI MediaEvent_Release(IMediaEventEx *iface) return IUnknown_Release(graph->outer_unk); } -/*** IDispatch methods ***/ -static HRESULT WINAPI MediaEvent_GetTypeInfoCount(IMediaEventEx *iface, UINT *pctinfo) +static HRESULT WINAPI MediaEvent_GetTypeInfoCount(IMediaEventEx *iface, UINT *count) { - struct filter_graph *This = impl_from_IMediaEventEx(iface); - - TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pctinfo); - + TRACE("iface %p, count %p.\n", iface, count); + *count = 1; return S_OK; } -static HRESULT WINAPI MediaEvent_GetTypeInfo(IMediaEventEx *iface, UINT iTInfo, LCID lcid, - ITypeInfo **ppTInfo) +static HRESULT WINAPI MediaEvent_GetTypeInfo(IMediaEventEx *iface, UINT index, + LCID lcid, ITypeInfo **typeinfo) { - struct filter_graph *This = impl_from_IMediaEventEx(iface); - - TRACE("(%p/%p)->(%d, %d, %p): stub !!!\n", This, iface, iTInfo, lcid, ppTInfo); - - return S_OK; + TRACE("iface %p, index %u, lcid %#x, typeinfo %p.\n", iface, index, lcid, typeinfo); + return strmbase_get_typeinfo(IMediaEvent_tid, typeinfo); } -static HRESULT WINAPI MediaEvent_GetIDsOfNames(IMediaEventEx *iface, REFIID riid, - LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId) +static HRESULT WINAPI MediaEvent_GetIDsOfNames(IMediaEventEx *iface, REFIID iid, + LPOLESTR *names, UINT count, LCID lcid, DISPID *ids) { - struct filter_graph *This = impl_from_IMediaEventEx(iface); + ITypeInfo *typeinfo; + HRESULT hr; - TRACE("(%p/%p)->(%s, %p, %d, %d, %p): stub !!!\n", This, iface, debugstr_guid(riid), rgszNames, - cNames, lcid, rgDispId); + TRACE("iface %p, iid %s, names %p, count %u, lcid %#x, ids %p.\n", + iface, debugstr_guid(iid), names, count, lcid, ids); - return S_OK; + if (SUCCEEDED(hr = strmbase_get_typeinfo(IMediaEvent_tid, &typeinfo))) + { + hr = ITypeInfo_GetIDsOfNames(typeinfo, names, count, ids); + ITypeInfo_Release(typeinfo); + } + return hr; } -static HRESULT WINAPI MediaEvent_Invoke(IMediaEventEx *iface, DISPID dispIdMember, REFIID riid, - LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExepInfo, - UINT *puArgErr) +static HRESULT WINAPI MediaEvent_Invoke(IMediaEventEx *iface, DISPID id, REFIID iid, LCID lcid, + WORD flags, DISPPARAMS *params, VARIANT *result, EXCEPINFO *excepinfo, UINT *error_arg) { - struct filter_graph *This = impl_from_IMediaEventEx(iface); + ITypeInfo *typeinfo; + HRESULT hr; - TRACE("(%p/%p)->(%d, %s, %d, %04x, %p, %p, %p, %p): stub !!!\n", This, iface, dispIdMember, - debugstr_guid(riid), lcid, wFlags, pDispParams, pVarResult, pExepInfo, puArgErr); + TRACE("iface %p, id %d, iid %s, lcid %#x, flags %#x, params %p, result %p, excepinfo %p, error_arg %p.\n", + iface, id, debugstr_guid(iid), lcid, flags, params, result, excepinfo, error_arg); - return S_OK; + if (SUCCEEDED(hr = strmbase_get_typeinfo(IMediaEvent_tid, &typeinfo))) + { + hr = ITypeInfo_Invoke(typeinfo, iface, id, flags, params, result, excepinfo, error_arg); + ITypeInfo_Release(typeinfo); + } + return hr; } -/*** IMediaEvent methods ***/ static HRESULT WINAPI MediaEvent_GetEventHandle(IMediaEventEx *iface, OAEVENT *event) { struct filter_graph *graph = impl_from_IMediaEventEx(iface); diff --git a/dlls/quartz/tests/filtergraph.c b/dlls/quartz/tests/filtergraph.c index 620a1a56bad..bd086445a3b 100644 --- a/dlls/quartz/tests/filtergraph.c +++ b/dlls/quartz/tests/filtergraph.c @@ -5663,6 +5663,40 @@ static void test_events(void) SysFreeString(status); } +static void test_event_dispatch(void) +{ + IFilterGraph2 *graph = create_graph(); + IMediaEventEx *event_ex; + ITypeInfo *typeinfo; + IMediaEvent *event; + TYPEATTR *typeattr; + unsigned int count; + HRESULT hr; + ULONG ref; + + IFilterGraph2_QueryInterface(graph, &IID_IMediaEvent, (void **)&event); + IFilterGraph2_QueryInterface(graph, &IID_IMediaEventEx, (void **)&event_ex); + ok((void *)event == event_ex, "Interface pointers didn't match.\n"); + IMediaEventEx_Release(event_ex); + + hr = IMediaEvent_GetTypeInfoCount(event, &count); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(count == 1, "Got count %u.\n", count); + + hr = IMediaEvent_GetTypeInfo(event, 0, 0, &typeinfo); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = ITypeInfo_GetTypeAttr(typeinfo, &typeattr); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(typeattr->typekind == TKIND_DISPATCH, "Got kind %u.\n", typeattr->typekind); + ok(IsEqualGUID(&typeattr->guid, &IID_IMediaEvent), "Got IID %s.\n", debugstr_guid(&typeattr->guid)); + ITypeInfo_ReleaseTypeAttr(typeinfo, typeattr); + ITypeInfo_Release(typeinfo); + + IMediaEvent_Release(event); + ref = IFilterGraph2_Release(graph); + ok(!ref, "Got outstanding refcount %d.\n", ref); +} + START_TEST(filtergraph) { CoInitializeEx(NULL, COINIT_MULTITHREADED); @@ -5690,6 +5724,7 @@ START_TEST(filtergraph) test_autoplug_uyvy(); test_set_notify_flags(); test_events(); + test_event_dispatch(); CoUninitialize(); test_render_with_multithread();
1
0
0
0
Zebediah Figura : quartz/filtergraph: Implement the IDispatch methods for IMediaPosition.
by Alexandre Julliard
02 Feb '22
02 Feb '22
Module: wine Branch: master Commit: 8a2cdd7aa655d2cc213a4bc76187d9d9b5bfb3dd URL:
https://source.winehq.org/git/wine.git/?a=commit;h=8a2cdd7aa655d2cc213a4bc7…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Tue Feb 1 22:37:43 2022 -0600 quartz/filtergraph: Implement the IDispatch methods for IMediaPosition. Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/quartz/filtergraph.c | 49 ++++++++++++++++++++++++++++++++++------------- 1 file changed, 36 insertions(+), 13 deletions(-) diff --git a/dlls/quartz/filtergraph.c b/dlls/quartz/filtergraph.c index a98b0360e20..7e3d9fac16a 100644 --- a/dlls/quartz/filtergraph.c +++ b/dlls/quartz/filtergraph.c @@ -2543,29 +2543,52 @@ static ULONG WINAPI MediaPosition_Release(IMediaPosition *iface) return IUnknown_Release(graph->outer_unk); } -/*** IDispatch methods ***/ -static HRESULT WINAPI MediaPosition_GetTypeInfoCount(IMediaPosition *iface, UINT* pctinfo) +static HRESULT WINAPI MediaPosition_GetTypeInfoCount(IMediaPosition *iface, UINT *count) { - FIXME("(%p) stub!\n", iface); - return E_NOTIMPL; + TRACE("iface %p, count %p.\n", iface, count); + *count = 1; + return S_OK; } -static HRESULT WINAPI MediaPosition_GetTypeInfo(IMediaPosition *iface, UINT iTInfo, LCID lcid, ITypeInfo** ppTInfo) +static HRESULT WINAPI MediaPosition_GetTypeInfo(IMediaPosition *iface, UINT index, + LCID lcid, ITypeInfo **typeinfo) { - FIXME("(%p) stub!\n", iface); - return E_NOTIMPL; + TRACE("iface %p, index %u, lcid %#x, typeinfo %p.\n", iface, index, lcid, typeinfo); + return strmbase_get_typeinfo(IMediaPosition_tid, typeinfo); } -static HRESULT WINAPI MediaPosition_GetIDsOfNames(IMediaPosition* iface, REFIID riid, LPOLESTR* rgszNames, UINT cNames, LCID lcid, DISPID* rgDispId) +static HRESULT WINAPI MediaPosition_GetIDsOfNames(IMediaPosition *iface, REFIID iid, + LPOLESTR *names, UINT count, LCID lcid, DISPID *ids) { - FIXME("(%p) stub!\n", iface); - return E_NOTIMPL; + ITypeInfo *typeinfo; + HRESULT hr; + + TRACE("iface %p, iid %s, names %p, count %u, lcid %#x, ids %p.\n", + iface, debugstr_guid(iid), names, count, lcid, ids); + + if (SUCCEEDED(hr = strmbase_get_typeinfo(IMediaPosition_tid, &typeinfo))) + { + hr = ITypeInfo_GetIDsOfNames(typeinfo, names, count, ids); + ITypeInfo_Release(typeinfo); + } + return hr; } -static HRESULT WINAPI MediaPosition_Invoke(IMediaPosition* iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS* pDispParams, VARIANT* pVarResult, EXCEPINFO* pExcepInfo, UINT* puArgErr) +static HRESULT WINAPI MediaPosition_Invoke(IMediaPosition *iface, DISPID id, REFIID iid, LCID lcid, + WORD flags, DISPPARAMS *params, VARIANT *result, EXCEPINFO *excepinfo, UINT *error_arg) { - FIXME("(%p) stub!\n", iface); - return E_NOTIMPL; + ITypeInfo *typeinfo; + HRESULT hr; + + TRACE("iface %p, id %d, iid %s, lcid %#x, flags %#x, params %p, result %p, excepinfo %p, error_arg %p.\n", + iface, id, debugstr_guid(iid), lcid, flags, params, result, excepinfo, error_arg); + + if (SUCCEEDED(hr = strmbase_get_typeinfo(IMediaPosition_tid, &typeinfo))) + { + hr = ITypeInfo_Invoke(typeinfo, iface, id, flags, params, result, excepinfo, error_arg); + ITypeInfo_Release(typeinfo); + } + return hr; } static HRESULT ConvertFromREFTIME(IMediaSeeking *seek, REFTIME time_in, LONGLONG *time_out)
1
0
0
0
← Newer
1
...
138
139
140
141
142
143
144
...
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