Alistair Leslie-Hughes : hnetcfg: Add Dispatch support to interface INetFwOpenPorts.

Alexandre Julliard julliard at wine.codeweavers.com
Wed Nov 11 08:36:44 CST 2015


Module: wine
Branch: master
Commit: 376fe634f52aa2d35455f4704eb1a3f39e52cf8c
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=376fe634f52aa2d35455f4704eb1a3f39e52cf8c

Author: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
Date:   Wed Nov 11 08:43:05 2015 +1100

hnetcfg: Add Dispatch support to interface INetFwOpenPorts.

Signed-off-by: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 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 4cc1ba6..f4c755b 100644
--- a/dlls/hnetcfg/port.c
+++ b/dlls/hnetcfg/port.c
@@ -439,8 +439,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(
@@ -451,8 +452,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(
@@ -464,9 +465,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(
@@ -481,10 +491,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(




More information about the wine-cvs mailing list