summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--windows/winfw/src/extras/cli/commands/winfw/policy.cpp20
-rw-r--r--windows/winfw/src/winfw/winfw.cpp2
-rw-r--r--windows/winfw/src/winfw/winfw.h2
3 files changed, 16 insertions, 8 deletions
diff --git a/windows/winfw/src/extras/cli/commands/winfw/policy.cpp b/windows/winfw/src/extras/cli/commands/winfw/policy.cpp
index 7f5b9d980c..328a0bf863 100644
--- a/windows/winfw/src/extras/cli/commands/winfw/policy.cpp
+++ b/windows/winfw/src/extras/cli/commands/winfw/policy.cpp
@@ -109,10 +109,12 @@ void Policy::processConnecting(const KeyValuePairs &arguments)
GetArgumentValue(arguments, L"protocol")
);
- auto success = WinFw_ApplyPolicyConnecting
+ auto success = WINFW_POLICY_STATUS_SUCCESS == WinFw_ApplyPolicyConnecting
(
&settings,
&relay,
+ GetArgumentValue(arguments, L"client").c_str(),
+ nullptr,
nullptr
);
@@ -138,13 +140,19 @@ void Policy::processConnected(const KeyValuePairs &arguments)
GetArgumentValue(arguments, L"protocol")
);
- auto success = WinFw_ApplyPolicyConnected
+ const auto v4Gateway = GetArgumentValue(arguments, L"v4Gateway");
+ const auto dnsCstr = v4Gateway.c_str();
+
+ auto success = WINFW_POLICY_STATUS_SUCCESS == WinFw_ApplyPolicyConnected
(
&settings,
&relay,
+ GetArgumentValue(arguments, L"client").c_str(),
GetArgumentValue(arguments, L"tunnel").c_str(),
- GetArgumentValue(arguments, L"dns").c_str(),
- nullptr
+ dnsCstr,
+ nullptr,
+ &dnsCstr,
+ 1
);
m_messageSink((success
@@ -160,7 +168,7 @@ void Policy::processBlocked(const KeyValuePairs &arguments)
GetArgumentValue(arguments, L"lan")
);
- auto success = WinFw_ApplyPolicyBlocked(&settings);
+ auto success = WINFW_POLICY_STATUS_SUCCESS == WinFw_ApplyPolicyBlocked(&settings, nullptr);
m_messageSink((success
? L"Successfully applied policy."
@@ -169,7 +177,7 @@ void Policy::processBlocked(const KeyValuePairs &arguments)
void Policy::processReset()
{
- auto success = WinFw_Reset();
+ auto success = WINFW_POLICY_STATUS_SUCCESS == WinFw_Reset();
m_messageSink((success
? L"Successfully reset policy."
diff --git a/windows/winfw/src/winfw/winfw.cpp b/windows/winfw/src/winfw/winfw.cpp
index ee7842877e..a3ad1737ac 100644
--- a/windows/winfw/src/winfw/winfw.cpp
+++ b/windows/winfw/src/winfw/winfw.cpp
@@ -323,7 +323,7 @@ WinFw_ApplyPolicyConnected(
const wchar_t *tunnelInterfaceAlias,
const wchar_t *v4Gateway,
const wchar_t *v6Gateway,
- const wchar_t **dnsServers,
+ const wchar_t * const *dnsServers,
size_t numDnsServers
)
{
diff --git a/windows/winfw/src/winfw/winfw.h b/windows/winfw/src/winfw/winfw.h
index 23163786e9..308bb32645 100644
--- a/windows/winfw/src/winfw/winfw.h
+++ b/windows/winfw/src/winfw/winfw.h
@@ -190,7 +190,7 @@ WinFw_ApplyPolicyConnected(
const wchar_t *tunnelInterfaceAlias,
const wchar_t *v4Gateway,
const wchar_t *v6Gateway,
- const wchar_t **dnsServers,
+ const wchar_t * const *dnsServers,
size_t numDnsServers
);