https://git.reactos.org/?p=reactos.git;a=commitdiff;h=02c546ced9d74c31d8c3b…
commit 02c546ced9d74c31d8c3b4c7d0eeefb96e4ac05e
Author: Amine Khaldi <amine.khaldi(a)reactos.org>
AuthorDate: Sun May 27 04:13:26 2018 +0100
Commit: Amine Khaldi <amine.khaldi(a)reactos.org>
CommitDate: Sun May 27 04:13:26 2018 +0100
[HNETCFG_WINETEST] Sync with Wine Staging 3.9. CORE-14656
---
modules/rostests/winetests/hnetcfg/CMakeLists.txt | 2 +-
modules/rostests/winetests/hnetcfg/policy.c | 49 ++++++++++++++++++++++-
2 files changed, 49 insertions(+), 2 deletions(-)
diff --git a/modules/rostests/winetests/hnetcfg/CMakeLists.txt
b/modules/rostests/winetests/hnetcfg/CMakeLists.txt
index 396c20e2b8..195bcbf981 100644
--- a/modules/rostests/winetests/hnetcfg/CMakeLists.txt
+++ b/modules/rostests/winetests/hnetcfg/CMakeLists.txt
@@ -3,5 +3,5 @@ add_definitions(-DUSE_WINE_TODOS)
add_executable(hnetcfg_winetest policy.c testlist.c)
target_link_libraries(hnetcfg_winetest uuid)
set_module_type(hnetcfg_winetest win32cui)
-add_importlibs(hnetcfg_winetest ole32 msvcrt kernel32)
+add_importlibs(hnetcfg_winetest ole32 oleaut32 msvcrt kernel32)
add_rostests_file(TARGET hnetcfg_winetest)
diff --git a/modules/rostests/winetests/hnetcfg/policy.c
b/modules/rostests/winetests/hnetcfg/policy.c
index 7b5bef008c..4ee19d8db4 100644
--- a/modules/rostests/winetests/hnetcfg/policy.c
+++ b/modules/rostests/winetests/hnetcfg/policy.c
@@ -102,6 +102,53 @@ static void test_interfaces(void)
INetFwMgr_Release(manager);
}
+static void test_NetFwAuthorizedApplication(void)
+{
+ INetFwAuthorizedApplication *app;
+ HRESULT hr;
+
+ hr = CoCreateInstance(&CLSID_NetFwAuthorizedApplication, NULL,
CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER,
+ &IID_INetFwAuthorizedApplication, (void**)&app);
+ ok(hr == S_OK, "got: %08x\n", hr);
+ if(hr == S_OK)
+ {
+ BSTR image = SysAllocStringLen( NULL, MAX_PATH );
+ static WCHAR empty[] = {0};
+ BSTR bstr;
+
+ if (!GetModuleFileNameW( NULL, image, MAX_PATH ))
+ {
+ ok(0, "Failed to get filename\n");
+ SysFreeString( image );
+ return;
+ }
+
+ hr = INetFwAuthorizedApplication_get_ProcessImageFileName(app, NULL);
+ ok(hr == E_POINTER, "got: %08x\n", hr);
+
+ hr = INetFwAuthorizedApplication_get_ProcessImageFileName(app, &bstr);
+ ok(hr == S_OK || hr == HRESULT_FROM_WIN32(ERROR_NOT_ENOUGH_MEMORY), "got:
%08x\n", hr);
+ ok(!bstr, "got: %s\n", wine_dbgstr_w(bstr));
+
+ hr = INetFwAuthorizedApplication_put_ProcessImageFileName(app, NULL);
+ ok(hr == E_INVALIDARG || hr == HRESULT_FROM_WIN32(ERROR_PATH_NOT_FOUND),
"got: %08x\n", hr);
+
+ hr = INetFwAuthorizedApplication_put_ProcessImageFileName(app, empty);
+ ok(hr == E_INVALIDARG || hr == HRESULT_FROM_WIN32(ERROR_PATH_NOT_FOUND),
"got: %08x\n", hr);
+
+ hr = INetFwAuthorizedApplication_put_ProcessImageFileName(app, image);
+ ok(hr == S_OK, "got: %08x\n", hr);
+
+ hr = INetFwAuthorizedApplication_get_ProcessImageFileName(app, &bstr);
+ ok(hr == S_OK, "got: %08x\n", hr);
+ ok(!lstrcmpiW(bstr,image), "got: %s\n", wine_dbgstr_w(bstr));
+ SysFreeString( bstr );
+
+ SysFreeString( image );
+ INetFwAuthorizedApplication_Release(app);
+ }
+}
+
START_TEST(policy)
{
INetFwMgr *manager;
@@ -121,7 +168,7 @@ START_TEST(policy)
INetFwMgr_Release(manager);
test_interfaces();
-
+ test_NetFwAuthorizedApplication();
CoUninitialize();
}