https://git.reactos.org/?p=reactos.git;a=commitdiff;h=36755f12cbf8e8b7fbf35…
commit 36755f12cbf8e8b7fbf35f1da48aa6c943e1d7c4
Author:     Amine Khaldi <amine.khaldi(a)reactos.org>
AuthorDate: Thu Mar 15 12:23:02 2018 +0100
Commit:     Amine Khaldi <amine.khaldi(a)reactos.org>
CommitDate: Thu Mar 15 12:23:02 2018 +0100
    [HNETCFG] Sync with Wine Staging 3.3. CORE-14434
---
 dll/win32/hnetcfg/CMakeLists.txt    |  4 ++--
 dll/win32/hnetcfg/apps.c            | 43 +++++++++++++++++++++++++++++++++----
 dll/win32/hnetcfg/hnetcfg.c         | 13 ++++++++++-
 dll/win32/hnetcfg/hnetcfg_private.h | 23 +-------------------
 dll/win32/hnetcfg/manager.c         | 17 +++++++++++++++
 dll/win32/hnetcfg/policy.c          | 16 ++++++++++++++
 dll/win32/hnetcfg/port.c            | 16 +++++++++++++-
 dll/win32/hnetcfg/precomp.h         | 24 +++++++++++++++++++++
 dll/win32/hnetcfg/profile.c         | 16 ++++++++++++++
 dll/win32/hnetcfg/service.c         | 16 ++++++++++++++
 media/doc/README.WINE               |  2 +-
 11 files changed, 159 insertions(+), 31 deletions(-)
diff --git a/dll/win32/hnetcfg/CMakeLists.txt b/dll/win32/hnetcfg/CMakeLists.txt
index fd216b2a2c..fd3ab10d92 100644
--- a/dll/win32/hnetcfg/CMakeLists.txt
+++ b/dll/win32/hnetcfg/CMakeLists.txt
@@ -11,7 +11,7 @@ list(APPEND SOURCE
     port.c
     profile.c
     service.c
-    hnetcfg_private.h)
+    precomp.h)
 add_library(hnetcfg SHARED
     ${SOURCE}
@@ -30,5 +30,5 @@ set_module_type(hnetcfg win32dll)
 add_dependencies(hnetcfg stdole2)
 target_link_libraries(hnetcfg wine uuid)
 add_importlibs(hnetcfg ole32 oleaut32 advapi32 msvcrt kernel32 ntdll)
-add_pch(hnetcfg hnetcfg_private.h SOURCE)
+add_pch(hnetcfg precomp.h SOURCE)
 add_cd_file(TARGET hnetcfg DESTINATION reactos/system32 FOR all)
diff --git a/dll/win32/hnetcfg/apps.c b/dll/win32/hnetcfg/apps.c
index 51463e0b27..e63da7f56e 100644
--- a/dll/win32/hnetcfg/apps.c
+++ b/dll/win32/hnetcfg/apps.c
@@ -16,15 +16,29 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
+#include "config.h"
+#include <stdarg.h>
+#include <stdio.h>
+
+#define COBJMACROS
+
+#include "windef.h"
+#include "winbase.h"
+#include "winuser.h"
+#include "ole2.h"
+#include "netfw.h"
+
+#include "wine/debug.h"
+#include "wine/unicode.h"
 #include "hnetcfg_private.h"
-#include <winnls.h>
-#include <ole2.h>
+WINE_DEFAULT_DEBUG_CHANNEL(hnetcfg);
 typedef struct fw_app
 {
     INetFwAuthorizedApplication INetFwAuthorizedApplication_iface;
     LONG refs;
+    BSTR filename;
 } fw_app;
 static inline fw_app *impl_from_INetFwAuthorizedApplication( INetFwAuthorizedApplication
*iface )
@@ -47,6 +61,7 @@ static ULONG WINAPI fw_app_Release(
     if (!refs)
     {
         TRACE("destroying %p\n", fw_app);
+        if (fw_app->filename) SysFreeString( fw_app->filename );
         HeapFree( GetProcessHeap(), 0, fw_app );
     }
     return refs;
@@ -239,7 +254,18 @@ static HRESULT WINAPI fw_app_get_ProcessImageFileName(
     fw_app *This = impl_from_INetFwAuthorizedApplication( iface );
     FIXME("%p, %p\n", This, imageFileName);
-    return E_NOTIMPL;
+
+    if (!imageFileName)
+        return E_INVALIDARG;
+
+    if (!This->filename)
+    {
+        *imageFileName = NULL;
+        return S_OK;
+    }
+
+    *imageFileName = SysAllocString( This->filename );
+    return *imageFileName ? S_OK : E_OUTOFMEMORY;
 }
 static HRESULT WINAPI fw_app_put_ProcessImageFileName(
@@ -249,7 +275,15 @@ static HRESULT WINAPI fw_app_put_ProcessImageFileName(
     fw_app *This = impl_from_INetFwAuthorizedApplication( iface );
     FIXME("%p, %s\n", This, debugstr_w(imageFileName));
-    return S_OK;
+
+    if (!imageFileName)
+    {
+        This->filename = NULL;
+        return S_OK;
+    }
+
+    This->filename = SysAllocString( imageFileName );
+    return This->filename ? S_OK : E_OUTOFMEMORY;
 }
 static HRESULT WINAPI fw_app_get_IpVersion(
@@ -372,6 +406,7 @@ HRESULT NetFwAuthorizedApplication_create( IUnknown *pUnkOuter, LPVOID
*ppObj )
     fa->INetFwAuthorizedApplication_iface.lpVtbl = &fw_app_vtbl;
     fa->refs = 1;
+    fa->filename = NULL;
     *ppObj = &fa->INetFwAuthorizedApplication_iface;
diff --git a/dll/win32/hnetcfg/hnetcfg.c b/dll/win32/hnetcfg/hnetcfg.c
index 5473838dbd..e56dbab9e7 100644
--- a/dll/win32/hnetcfg/hnetcfg.c
+++ b/dll/win32/hnetcfg/hnetcfg.c
@@ -16,9 +16,20 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
+#include <stdarg.h>
+
+#define COBJMACROS
+
+#include "windef.h"
+#include "winbase.h"
+#include "objbase.h"
+#include "rpcproxy.h"
+#include "netfw.h"
+
+#include "wine/debug.h"
 #include "hnetcfg_private.h"
-#include <rpcproxy.h>
+WINE_DEFAULT_DEBUG_CHANNEL(hnetcfg);
 static HINSTANCE instance;
diff --git a/dll/win32/hnetcfg/hnetcfg_private.h b/dll/win32/hnetcfg/hnetcfg_private.h
index a901d0d972..26b52d9231 100644
--- a/dll/win32/hnetcfg/hnetcfg_private.h
+++ b/dll/win32/hnetcfg/hnetcfg_private.h
@@ -16,26 +16,7 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
-#ifndef _HNETCFG_PRIVATE_H_
-#define _HNETCFG_PRIVATE_H_
-
-#include <wine/config.h>
-
-#include <stdarg.h>
-
-#define WIN32_NO_STATUS
-#define _INC_WINDOWS
-#define COM_NO_WINDOWS_H
-
-#define COBJMACROS
-
-#include <windef.h>
-#include <winbase.h>
-#include <objbase.h>
-#include <netfw.h>
-
-#include <wine/debug.h>
-WINE_DEFAULT_DEBUG_CHANNEL(hnetcfg);
+#pragma once
 enum type_id
 {
@@ -63,5 +44,3 @@ HRESULT NetFwAuthorizedApplications_create(IUnknown *, LPVOID *)
DECLSPEC_HIDDEN
 HRESULT NetFwOpenPorts_create(IUnknown *, LPVOID *) DECLSPEC_HIDDEN;
 HRESULT NetFwOpenPort_create(IUnknown *, LPVOID *) DECLSPEC_HIDDEN;
 HRESULT NetFwServices_create(IUnknown *, LPVOID *) DECLSPEC_HIDDEN;
-
-#endif /* _HNETCFG_PRIVATE_H_ */
diff --git a/dll/win32/hnetcfg/manager.c b/dll/win32/hnetcfg/manager.c
index c76df2b9d0..1d548b41a9 100644
--- a/dll/win32/hnetcfg/manager.c
+++ b/dll/win32/hnetcfg/manager.c
@@ -16,8 +16,25 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
+#include "config.h"
+#include <stdarg.h>
+#include <stdio.h>
+
+#define COBJMACROS
+
+#include "windef.h"
+#include "winbase.h"
+#include "winuser.h"
+#include "initguid.h"
+#include "ole2.h"
+#include "netfw.h"
+
+#include "wine/debug.h"
+#include "wine/unicode.h"
 #include "hnetcfg_private.h"
+WINE_DEFAULT_DEBUG_CHANNEL(hnetcfg);
+
 typedef struct fw_manager
 {
     INetFwMgr INetFwMgr_iface;
diff --git a/dll/win32/hnetcfg/policy.c b/dll/win32/hnetcfg/policy.c
index a6ea0b10c5..c2f32520bd 100644
--- a/dll/win32/hnetcfg/policy.c
+++ b/dll/win32/hnetcfg/policy.c
@@ -16,8 +16,24 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
+#include "config.h"
+#include <stdarg.h>
+#include <stdio.h>
+
+#define COBJMACROS
+
+#include "windef.h"
+#include "winbase.h"
+#include "winuser.h"
+#include "ole2.h"
+#include "netfw.h"
+
+#include "wine/debug.h"
+#include "wine/unicode.h"
 #include "hnetcfg_private.h"
+WINE_DEFAULT_DEBUG_CHANNEL(hnetcfg);
+
 typedef struct fw_policy
 {
     INetFwPolicy INetFwPolicy_iface;
diff --git a/dll/win32/hnetcfg/port.c b/dll/win32/hnetcfg/port.c
index 2dc71b2b08..7d74965076 100644
--- a/dll/win32/hnetcfg/port.c
+++ b/dll/win32/hnetcfg/port.c
@@ -16,9 +16,23 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
+#include "config.h"
+#include <stdarg.h>
+#include <stdio.h>
+
+#define COBJMACROS
+
+#include "windef.h"
+#include "winbase.h"
+#include "winuser.h"
+#include "ole2.h"
+#include "netfw.h"
+
+#include "wine/debug.h"
+#include "wine/unicode.h"
 #include "hnetcfg_private.h"
-#include <ole2.h>
+WINE_DEFAULT_DEBUG_CHANNEL(hnetcfg);
 typedef struct fw_port
 {
diff --git a/dll/win32/hnetcfg/precomp.h b/dll/win32/hnetcfg/precomp.h
new file mode 100644
index 0000000000..770f1ea075
--- /dev/null
+++ b/dll/win32/hnetcfg/precomp.h
@@ -0,0 +1,24 @@
+
+#ifndef _HNETCFG_PRECOMP_H_
+#define _HNETCFG_PRECOMP_H_
+
+#include <wine/config.h>
+
+#include <stdarg.h>
+
+#define WIN32_NO_STATUS
+#define _INC_WINDOWS
+#define COM_NO_WINDOWS_H
+
+#define COBJMACROS
+
+#include <windef.h>
+#include <winbase.h>
+#include <objbase.h>
+#include <netfw.h>
+
+#include <wine/debug.h>
+
+#include "hnetcfg_private.h"
+
+#endif /* !_HNETCFG_PRECOMP_H_ */
diff --git a/dll/win32/hnetcfg/profile.c b/dll/win32/hnetcfg/profile.c
index 446ef9325a..835e82ed14 100644
--- a/dll/win32/hnetcfg/profile.c
+++ b/dll/win32/hnetcfg/profile.c
@@ -16,8 +16,24 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
+#include "config.h"
+#include <stdarg.h>
+#include <stdio.h>
+
+#define COBJMACROS
+
+#include "windef.h"
+#include "winbase.h"
+#include "winuser.h"
+#include "ole2.h"
+#include "netfw.h"
+
+#include "wine/debug.h"
+#include "wine/unicode.h"
 #include "hnetcfg_private.h"
+WINE_DEFAULT_DEBUG_CHANNEL(hnetcfg);
+
 typedef struct fw_profile
 {
     INetFwProfile INetFwProfile_iface;
diff --git a/dll/win32/hnetcfg/service.c b/dll/win32/hnetcfg/service.c
index ab2ea38ee2..fa214b6760 100644
--- a/dll/win32/hnetcfg/service.c
+++ b/dll/win32/hnetcfg/service.c
@@ -16,8 +16,24 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
+#include "config.h"
+#include <stdarg.h>
+#include <stdio.h>
+
+#define COBJMACROS
+
+#include "windef.h"
+#include "winbase.h"
+#include "winuser.h"
+#include "ole2.h"
+#include "netfw.h"
+
+#include "wine/debug.h"
+#include "wine/unicode.h"
 #include "hnetcfg_private.h"
+WINE_DEFAULT_DEBUG_CHANNEL(hnetcfg);
+
 typedef struct fw_service
 {
     INetFwService INetFwService_iface;
diff --git a/media/doc/README.WINE b/media/doc/README.WINE
index 36fc36a97a..b4ebdd7438 100644
--- a/media/doc/README.WINE
+++ b/media/doc/README.WINE
@@ -71,7 +71,7 @@ reactos/dll/win32/fusion              # Synced to WineStaging-3.3
 reactos/dll/win32/gdiplus             # Synced to WineStaging-3.3
 reactos/dll/win32/hhctrl.ocx          # Synced to WineStaging-3.3
 reactos/dll/win32/hlink               # Synced to WineStaging-3.3
-reactos/dll/win32/hnetcfg             # Synced to Wine-3.0
+reactos/dll/win32/hnetcfg             # Synced to WineStaging-3.3
 reactos/dll/win32/httpapi             # Synced to WineStaging-2.9
 reactos/dll/win32/iccvid              # Synced to Wine-3.0
 reactos/dll/win32/ieframe             # Synced to Wine-3.0