Nikolay Sivov : hnetcfg: Store port name for INetFwOpenPort.

Alexandre Julliard julliard at wine.codeweavers.com
Mon Nov 9 08:34:17 CST 2015


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

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Sun Nov  8 21:11:30 2015 +0300

hnetcfg: Store port name for INetFwOpenPort.

Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/hnetcfg/port.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/dlls/hnetcfg/port.c b/dlls/hnetcfg/port.c
index 8468d30..0ef2a1d 100644
--- a/dlls/hnetcfg/port.c
+++ b/dlls/hnetcfg/port.c
@@ -38,6 +38,7 @@ typedef struct fw_port
 {
     INetFwOpenPort INetFwOpenPort_iface;
     LONG refs;
+    BSTR name;
 } fw_port;
 
 static inline fw_port *impl_from_INetFwOpenPort( INetFwOpenPort *iface )
@@ -60,6 +61,7 @@ static ULONG WINAPI fw_port_Release(
     if (!refs)
     {
         TRACE("destroying %p\n", fw_port);
+        SysFreeString( fw_port->name );
         HeapFree( GetProcessHeap(), 0, fw_port );
     }
     return refs;
@@ -179,8 +181,14 @@ static HRESULT WINAPI fw_port_put_Name(
 {
     fw_port *This = impl_from_INetFwOpenPort( iface );
 
-    FIXME("%p %s\n", This, debugstr_w(name));
-    return E_NOTIMPL;
+    TRACE("%p %s\n", This, debugstr_w(name));
+
+    if (!(name = SysAllocString( name )))
+        return E_OUTOFMEMORY;
+
+    SysFreeString( This->name );
+    This->name = name;
+    return S_OK;
 }
 
 static HRESULT WINAPI fw_port_get_IpVersion(
@@ -352,6 +360,7 @@ HRESULT NetFwOpenPort_create( IUnknown *pUnkOuter, LPVOID *ppObj )
 
     fp->INetFwOpenPort_iface.lpVtbl = &fw_port_vtbl;
     fp->refs = 1;
+    fp->name = NULL;
 
     *ppObj = &fp->INetFwOpenPort_iface;
 




More information about the wine-cvs mailing list