[PATCH 4/7] hnetcfg: Implement static_ports_get_Count().
Paul Gofman
pgofman at codeweavers.com
Wed Feb 2 02:32:56 CST 2022
Signed-off-by: Paul Gofman <pgofman at codeweavers.com>
---
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(
--
2.34.1
More information about the wine-devel
mailing list