[PATCH] hnetcfg: Add Dispatch support to interface INetFwOpenPort

Alistair Leslie-Hughes leslie_alistair at hotmail.com
Mon Nov 9 03:49:39 CST 2015


Signed-off-by: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
---
 dlls/hnetcfg/apps.c            |  1 +
 dlls/hnetcfg/hnetcfg_private.h |  1 +
 dlls/hnetcfg/port.c            | 36 ++++++++++++++++++++++++++++--------
 3 files changed, 30 insertions(+), 8 deletions(-)

diff --git a/dlls/hnetcfg/apps.c b/dlls/hnetcfg/apps.c
index d21ed98..ea6d411 100644
--- a/dlls/hnetcfg/apps.c
+++ b/dlls/hnetcfg/apps.c
@@ -109,6 +109,7 @@ static REFIID tid_id[] =
     &IID_INetFwAuthorizedApplications,
     &IID_INetFwMgr,
     &IID_INetFwOpenPort,
+    &IID_INetFwOpenPorts,
     &IID_INetFwPolicy,
     &IID_INetFwProfile
 };
diff --git a/dlls/hnetcfg/hnetcfg_private.h b/dlls/hnetcfg/hnetcfg_private.h
index 6fe69d5..bb3f3aa 100644
--- a/dlls/hnetcfg/hnetcfg_private.h
+++ b/dlls/hnetcfg/hnetcfg_private.h
@@ -22,6 +22,7 @@ enum type_id
     INetFwAuthorizedApplications_tid,
     INetFwMgr_tid,
     INetFwOpenPort_tid,
+    INetFwOpenPorts_tid,
     INetFwPolicy_tid,
     INetFwProfile_tid,
     last_tid
diff --git a/dlls/hnetcfg/port.c b/dlls/hnetcfg/port.c
index 8468d30..b3f20e6 100644
--- a/dlls/hnetcfg/port.c
+++ b/dlls/hnetcfg/port.c
@@ -420,8 +420,9 @@ static HRESULT WINAPI fw_ports_GetTypeInfoCount(
 {
     fw_ports *This = impl_from_INetFwOpenPorts( iface );
 
-    FIXME("%p %p\n", This, pctinfo);
-    return E_NOTIMPL;
+    TRACE("%p %p\n", This, pctinfo);
+    *pctinfo = 1;
+    return S_OK;
 }
 
 static HRESULT WINAPI fw_ports_GetTypeInfo(
@@ -432,8 +433,8 @@ static HRESULT WINAPI fw_ports_GetTypeInfo(
 {
     fw_ports *This = impl_from_INetFwOpenPorts( iface );
 
-    FIXME("%p %u %u %p\n", This, iTInfo, lcid, ppTInfo);
-    return E_NOTIMPL;
+    TRACE("%p %u %u %p\n", This, iTInfo, lcid, ppTInfo);
+    return get_typeinfo( INetFwOpenPorts_tid, ppTInfo );
 }
 
 static HRESULT WINAPI fw_ports_GetIDsOfNames(
@@ -445,9 +446,18 @@ static HRESULT WINAPI fw_ports_GetIDsOfNames(
     DISPID *rgDispId )
 {
     fw_ports *This = impl_from_INetFwOpenPorts( iface );
+    ITypeInfo *typeinfo;
+    HRESULT hr;
 
-    FIXME("%p %s %p %u %u %p\n", This, debugstr_guid(riid), rgszNames, cNames, lcid, rgDispId);
-    return E_NOTIMPL;
+    TRACE("%p %s %p %u %u %p\n", This, debugstr_guid(riid), rgszNames, cNames, lcid, rgDispId);
+
+    hr = get_typeinfo( INetFwOpenPorts_tid, &typeinfo );
+    if (SUCCEEDED(hr))
+    {
+        hr = ITypeInfo_GetIDsOfNames( typeinfo, rgszNames, cNames, rgDispId );
+        ITypeInfo_Release( typeinfo );
+    }
+    return hr;
 }
 
 static HRESULT WINAPI fw_ports_Invoke(
@@ -462,10 +472,20 @@ static HRESULT WINAPI fw_ports_Invoke(
     UINT *puArgErr )
 {
     fw_ports *This = impl_from_INetFwOpenPorts( iface );
+    ITypeInfo *typeinfo;
+    HRESULT hr;
 
-    FIXME("%p %d %s %d %d %p %p %p %p\n", This, dispIdMember, debugstr_guid(riid),
+    TRACE("%p %d %s %d %d %p %p %p %p\n", This, dispIdMember, debugstr_guid(riid),
           lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
-    return E_NOTIMPL;
+
+    hr = get_typeinfo( INetFwOpenPorts_tid, &typeinfo );
+    if (SUCCEEDED(hr))
+    {
+        hr = ITypeInfo_Invoke( typeinfo, &This->INetFwOpenPorts_iface, dispIdMember,
+                               wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr );
+        ITypeInfo_Release( typeinfo );
+    }
+    return hr;
 }
 
 static HRESULT WINAPI fw_ports_get_Count(
-- 
1.9.1




More information about the wine-patches mailing list