Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
ab40cf2
KillSwitch Phase 1: KillSwitchFilters WFP wrapper (i221)
TimE4DNSF May 7, 2026
740714f
KillSwitch Phase 1: smoke-test console for KillSwitchFilters primitives
TimE4DNSF May 7, 2026
8346218
KillSwitch: pull LAN-permit filters forward + add --allow-lan to smok…
TimE4DNSF May 8, 2026
3975a45
KillSwitch Phase 2A: add DNS block + DNS-via-tunnel permit filters
TimE4DNSF May 8, 2026
8cad062
KillSwitch Phase 2B: AdapterLuidResolver for tunnel-permit filter LUI…
TimE4DNSF May 8, 2026
5d9fd51
KillSwitch Phase 2C: KillSwitchService orchestrator + Abstractions types
TimE4DNSF May 8, 2026
559b713
KillSwitch Phase 3 (SDK): IPC contract + dispatcher + ClientPipe pass…
TimE4DNSF May 8, 2026
73f267c
KillSwitch fix: VPN state never observed — wrong source of truth
TimE4DNSF May 8, 2026
f373648
KillSwitch alpha.6: tunnel LUID resolver fallbacks + diagnostic dump
TimE4DNSF May 8, 2026
63e3e99
KillSwitch alpha.7: permit IKEv2 transport (UDP/500, UDP/4500) outbound
TimE4DNSF May 8, 2026
754b2de
KillSwitch alpha.8: switch from 1Hz polling to event-driven RAS state…
TimE4DNSF May 8, 2026
ee70868
KillSwitch alpha.9: read fresh RAS state in ReevaluateUnsafe
TimE4DNSF May 8, 2026
a344c2d
KillSwitch alpha.10: fire C# event at watcher arm time, not just on s…
TimE4DNSF May 8, 2026
185ad21
KillSwitch alpha.11: status-changed named event for UI auto-refresh
TimE4DNSF May 8, 2026
02f1f03
KillSwitch alpha.13: permit IPSec tunnel transport (proto 4 IP-in-IP,…
TimE4DNSF May 9, 2026
321bdc7
KillSwitch alpha.14: handle suspend/resume and close ICMP gap
TimE4DNSF May 9, 2026
f89f737
KillSwitch alpha.15: SDK version bump only
TimE4DNSF May 9, 2026
318a60f
KillSwitch alpha.16: SDK version bump only
TimE4DNSF May 9, 2026
3dbed80
KillSwitch alpha.17: publish KS state to HKLM for cross-process auto-…
TimE4DNSF May 9, 2026
765a095
KillSwitch alpha.18: SDK version bump only
TimE4DNSF May 9, 2026
49c5ffd
WireGuard wg-alpha.1: vendor wireguard.dll for win-x64 and win-arm64
TimE4DNSF May 12, 2026
32778c5
WireGuard wg-alpha.1: fix x64 DLL path (win-amd64 -> win-x64/wireguar…
TimE4DNSF May 12, 2026
72f3051
WireGuard wg-alpha.1: add Win32Calls.WireGuard project + P/Invoke layer
TimE4DNSF May 12, 2026
af16253
WireGuard wg-alpha.1: implement VpnTunnelManager (Step 4a, crypto only)
TimE4DNSF May 12, 2026
5608454
WireGuard wg-alpha.1: adapter IP/DNS/routes for traffic flow (Step 4b)
TimE4DNSF May 12, 2026
d4140f1
WireGuard wg-alpha.1: fix SetInterfaceDnsSettings DLL (dnsapi -> iphl…
TimE4DNSF May 12, 2026
9bf70a9
WireGuard wg-alpha.1: fix DNS_INTERFACE_SETTINGS flag values
TimE4DNSF May 12, 2026
95d135c
WireGuard wg-alpha.1: transport selection in dispatcher (Step 6)
TimE4DNSF May 12, 2026
2514dc1
WireGuard wg-alpha.1: ship Win32Calls.WireGuard + wireguard.dll (Step 7)
TimE4DNSF May 12, 2026
0df4ea7
WireGuard wg-alpha.1: LUID-keyed DNS permit filters (Step 5)
TimE4DNSF May 12, 2026
8b50fc8
WireGuard wg-alpha.1: bump VersionSuffix alpha.18 -> wg-alpha.1
TimE4DNSF May 12, 2026
df32ee0
WireGuard wg-alpha.2: process-wide transport singleton + Exception se…
TimE4DNSF May 12, 2026
f5e1c8b
WireGuard wg-alpha.3: reject duplicate Connect instead of silently re…
TimE4DNSF May 12, 2026
422707e
WireGuard wg-alpha.4: drain service startup ACK in ReopenNamedPipe
TimE4DNSF May 12, 2026
f309d68
WireGuard wg-alpha.5: route Connect to WG transport via user preference
TimE4DNSF May 12, 2026
d7e8df0
WireGuard wg-alpha.6: make WG connection state observable to client
TimE4DNSF May 13, 2026
ca3fe28
WireGuard wg-alpha.7: fix WG Disconnect pipe-protocol race + stop wak…
TimE4DNSF May 13, 2026
aa15ae5
WireGuard wg-alpha.8: install WFP DNS-leak protection on WG connect
TimE4DNSF May 13, 2026
909c32f
WireGuard wg-alpha.9: dynamic config negotiation (Curve25519 + /api/v…
TimE4DNSF May 13, 2026
68afdfe
WireGuard wg-alpha.10: wire negotiate path into ConnectVpnWithConfigu…
TimE4DNSF May 13, 2026
5f8c039
WireGuard wg-alpha.11: host enumeration + per-host override on negotiate
TimE4DNSF May 15, 2026
78e839d
WireGuard wg-alpha.12: move HKLM service-broadcast values to Software…
TimE4DNSF May 15, 2026
0672300
WireGuard wg-alpha.13: realign HKCU user-settings root to GuardianFir…
TimE4DNSF May 15, 2026
efe8b69
SignPath: add curve25519.dll (x64 + arm64) to deep-sign zip filelist
TimE4DNSF May 15, 2026
dcfe0e4
WireGuard wg-alpha.14: bump for signed curve25519.dll re-release
TimE4DNSF May 15, 2026
b89bf33
WireGuard wg-alpha.15: honor host override on _hostLookup cache miss
TimE4DNSF May 16, 2026
64809cb
WireGuard wg-alpha.16: honor kGuardianPreferredHost on IKEv2 path
TimE4DNSF May 16, 2026
80041cf
WireGuard wg-alpha.17: rebuild curve25519.dll with /MT (static CRT)
TimE4DNSF May 16, 2026
e0def56
WireGuard wg-alpha.18: fix StreamString.ReadStringAsync short-read
TimE4DNSF May 17, 2026
bd541bf
WireGuard wg-alpha.19: serialize all ClientPipe writes through _pipeIO
TimE4DNSF May 17, 2026
ee1a4db
WireGuard wg-alpha.20: fix post-disconnect DNS resolution failures
TimE4DNSF May 17, 2026
05473ba
WireGuard wg-alpha.21: replace curve25519 (was GPL-2.0 OR MIT) with G…
TimE4DNSF May 19, 2026
33e05bd
WireGuard wg-alpha.22: build curve25519.dll in CI for proper provenance
TimE4DNSF May 19, 2026
88de81c
WireGuard wg-alpha.23: consolidate transport-protocol enum + registry…
TimE4DNSF May 19, 2026
d03b4bb
WireGuard wg-alpha.24: unified credentials check + symmetric protocol…
TimE4DNSF May 19, 2026
a66d6ad
Scrub personal names from code comments — use role aliases instead
TimE4DNSF May 19, 2026
00760ff
Per code review, move GRDCredentialManager.ClearMainCredential() call…
TimE4DNSF May 19, 2026
4cf73e1
WireGuard wg-alpha.26: bump Go to 1.25, scrub curve25519 NOTICES history
TimE4DNSF May 20, 2026
e7726c0
Move TransportProtocolStringFor into GRDTransportProtocol
TimE4DNSF May 20, 2026
467962a
WireGuard wg-alpha.27: symmetric GetServerStatus + awaitable ClearVpn…
TimE4DNSF May 20, 2026
6161461
WireGuard wg-alpha.28: KillSwitchService learns about WireGuard
TimE4DNSF May 20, 2026
44b9912
WireGuard wg-alpha.29: KillSwitchService restores user-intent state o…
TimE4DNSF May 20, 2026
85ea2f2
WireGuard wg-alpha.30: fix IKEv2 DNS-leak filter pipeline (latent bug)
TimE4DNSF May 20, 2026
de9df37
WireGuard wg-alpha.31: rename WireGuardDnsPermit -> TunnelDnsPermit
TimE4DNSF May 21, 2026
a45959b
WireGuard wg-alpha.32: post-Dispose quiet period to mitigate WireGuar…
TimE4DNSF May 21, 2026
70f539b
WireGuard wg-alpha.33: async-void hardening (no UI crash on transient…
TimE4DNSF May 21, 2026
e4e39ad
WireGuard wg-alpha.34: KS rock-and-hard-place recovery + ClientPipeSe…
TimE4DNSF May 28, 2026
0977e18
WireGuard wg-alpha.35: back out KS-tear-down-on-unplanned-drop; add c…
TimE4DNSF May 28, 2026
6fe2a6c
WireGuard wg-alpha.36: add GRDServerManager.GetAllHostnamesAsync (dev…
TimE4DNSF May 29, 2026
89f189c
WireGuard wg-alpha.37: GetAllHostnamesAsync — log response status + p…
TimE4DNSF May 30, 2026
3a2a7cf
WireGuard wg-alpha.38: bound SendVoidCommand response read (fixes UI …
TimE4DNSF Jun 1, 2026
10021ec
WireGuard wg-alpha.39: don't lose region cache on a failed refresh; n…
TimE4DNSF Jun 2, 2026
83f3b1a
WireGuard wg-alpha.40: error-aware geo refresh + re-solicit + swap ga…
TimE4DNSF Jun 2, 2026
7e6cb4d
WireGuard wg-alpha.41: permit WG encrypted carrier under kill switch …
TimE4DNSF Jun 3, 2026
b11640f
Release 0.46.0: drop wg-alpha prerelease suffix (WireGuard transport …
TimE4DNSF Jun 12, 2026
63b5f8b
Add 0.46.0 release changelog (changes since 0.46.0-alpha.2)
TimE4DNSF Jun 12, 2026
fa1bbaf
Clean up per PR #222 comments
TimE4DNSF Jun 15, 2026
6fd36c1
Made changes to wording in comments or usage of Negotiate where it wa…
TimE4DNSF Jun 16, 2026
c83140a
version bump
TimE4DNSF Jun 16, 2026
6b01364
negotiate -> registration,
TimE4DNSF Jun 16, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 46 additions & 1 deletion .github/workflows/DualPlatformBuildAndPackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,52 @@ jobs:

- name: Build GuardianConnectSDK.Services.Abstractions for any CPU
run: msbuild /t:restore /t:Build /p:Configuration=Release GuardianConnect.Abstractions\GuardianConnect.Abstractions.csproj


##############################################################################
# curve25519.dll — built from Go source on every SDK CI run for proper
# provenance. The .nuspec at the SDK root expects the DLLs at
# native/curve25519/win-x64/curve25519.dll
# native/curve25519/win-arm64/curve25519.dll
# so this step must run BEFORE the SignPath zip step (which packs per
# ListOfGuardianConnectSDKFilesToSign.fls) and the nuget pack steps further
# down. Source is `native/curve25519/src/curve25519.go` (Go's BSD-3-Clause
# crypto/ecdh.X25519 wrapped with cgo //export). build.cmd handles both
# arches; we feed it the runner's Go (PATH-resolved) and llvm-mingw via
# GO_EXE and LLVM_MINGW_BIN env vars.
##############################################################################

- name: Set up Go (for curve25519.dll build)
uses: actions/setup-go@v5
with:
go-version: '1.26.4'

- name: Cache llvm-mingw cross-toolchain
id: cache-llvm-mingw
uses: actions/cache@v4
with:
path: C:\llvm-mingw
key: llvm-mingw-20250709-ucrt-x86_64

- name: Download llvm-mingw (only if cache miss)
if: steps.cache-llvm-mingw.outputs.cache-hit != 'true'
shell: pwsh
run: |
$url = 'https://github.com/mstorsjo/llvm-mingw/releases/download/20250709/llvm-mingw-20250709-ucrt-x86_64.zip'
$dl = "$env:RUNNER_TEMP\llvm-mingw.zip"
$ProgressPreference = 'SilentlyContinue'
Write-Host "Downloading llvm-mingw..."
Invoke-WebRequest -Uri $url -OutFile $dl -UseBasicParsing
Write-Host "Downloaded $((Get-Item $dl).Length / 1MB) MB; extracting..."
if (Test-Path C:\llvm-mingw) { Remove-Item C:\llvm-mingw -Recurse -Force }
Expand-Archive -Path $dl -DestinationPath C:\llvm-mingw -Force
Comment thread
tzeejay marked this conversation as resolved.

- name: Build curve25519.dll (x64 + arm64) from Go source
shell: cmd
run: |
for /d %%D in (C:\llvm-mingw\llvm-mingw-*) do set "LLVM_MINGW_BIN=%%D\bin"
set "GO_EXE=go"
call native\curve25519\build.cmd

#### - name: Build GuardianFirewall Service for x64 CPU
#### run: |
#### msbuild /t:restore /t:Build /p:Configuration=Release /p:Platform=x64 /p:WarningLevel=0 /p:RuntimeIdentifier=win-x64 GuardianFirewallService\GuardianFirewallService.csproj
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
/GuardianConnectSDK/x64
/GuardianConnectSDK/ARM64
/GuardianConnectSDK/BuildOutput
/GuardianConnectSDK/**/BuildOutput
/GuardianConnectSDK/GuardianConnect/BuildOutput
/GuardianConnectSDK/.vs
/GuardianConnectSDK/NativeRoutinesLoadTest/obj
Expand Down
10 changes: 5 additions & 5 deletions GuardianConnectSDK/Directory.Build.Props
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
<Authors>DNSFilter, Inc.</Authors>
<RepositoryUrl>https://github.com/GuardianFirewall/GuardianConnect-Windows</RepositoryUrl>

<AssemblyVersion>0.46.0</AssemblyVersion>
<FileVersion>0.46.0</FileVersion>
<Version>0.46.0</Version>
<!-- Set this for prerelease builds (e.g., "alpha.1", "beta.1", "rc.1"); remove or leave empty for stable releases. -->
<VersionSuffix>alpha.2</VersionSuffix>
<AssemblyVersion>0.46.1</AssemblyVersion>
<FileVersion>0.46.1</FileVersion>
<Version>0.46.1</Version>
<!-- Set this for prerelease builds (e.g., "alpha.1", "beta.1", "rc.1"); remove or leave empty for stable releases.-->
<VersionSuffix></VersionSuffix>
</PropertyGroup>

<PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@ public enum NPCommands
ToggleLogging,
RequestLogLines,
SwitchLoggingLevel,
SendPowerAndNetworkEvents
SendPowerAndNetworkEvents,
SetKillSwitchMode,
SetKillSwitchAllowLan,
GetKillSwitchStatus,
EnterConnectingMode,
ExitConnectingMode
}

public enum SystemEventType
Expand Down Expand Up @@ -46,4 +51,27 @@ public enum SystemEventType
void ToggleLogging(bool whetherToDeleteLogFiles);

void SwitchServiceLoggingLevel(Common.LoggingLevels loggingLevel);

ErrorResponse SetKillSwitchMode(KillSwitchMode mode);

ErrorResponse SetKillSwitchAllowLan(bool allow);

KillSwitchStatus GetKillSwitchStatus();

/// <summary>
/// Tell the service "I'm about to attempt a Connect; open the kill-switch
/// connecting-overlay so my credential-registration HTTP calls can escape
/// the DNS-block + block-all set". Idempotent; watchdog auto-exits after
/// 60s if no paired ExitConnectingMode arrives. See KillSwitchService.cs
/// for full lifecycle notes.
/// </summary>
ErrorResponse EnterConnectingMode();

/// <summary>
/// Optional explicit teardown of the connecting-overlay (e.g., registration
/// failed in the client and we don't want to wait for the watchdog).
/// Idempotent. Normally not needed — the overlay is cleared automatically
/// when the tunnel comes up via the wgConnected / RasConnected event paths.
/// </summary>
ErrorResponse ExitConnectingMode();
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@ namespace GuardianConnect.Abstractions;

public interface ITransportProvider
{
public TransportProtocol ProtocolType { get; }
// TransportProtocol enum moved to GRDTransportProtocol.cs (still in
// this Abstractions assembly) as part of the consolidation that put
// the registry Get/Set helpers and the enum into one canonical
// location. Property type below is now
// GRDTransportProtocol.TransportProtocol; on-disk ordinal values are
// unchanged so credential serialization stays wire-compatible.
public GRDTransportProtocol.TransportProtocol ProtocolType { get; }
public VPNProviderStatus VPNStatus { get; }
public VPNConnectionError LastVPNError { get; }

Expand All @@ -19,13 +25,6 @@ public interface ITransportProvider

#region CommonEnumerations

public enum TransportProtocol
{
TransportUnknown,
TransportIKEv2,
TransportWireGuard
}

public enum VPNProviderStatus
{
/*! @const NEVPNStatusInvalid The VPN is not configured. */
Expand Down
43 changes: 43 additions & 0 deletions GuardianConnectSDK/GuardianConnect.Abstractions/KillSwitchMode.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
using System.Text.Json.Serialization;

namespace GuardianConnect.Abstractions;

/// <summary>
/// Kill switch mode. v1 ships only Off and OnConnected. Any other mode (e.g. Always-On - here meaning
/// survive process exit and reboot), is not implemented at this time.
/// </summary>
public enum KillSwitchMode
{
/// <summary>No filters installed. Default.</summary>
Off = 0,

/// <summary>
/// Filters active while VPN is connecting/connected/reconnecting. Removed on
/// user-initiated disconnect; kept across unexpected drops so traffic stays
/// blocked until the user either re-establishes the tunnel or disables the
/// kill switch.
/// </summary>
OnConnected = 1,
}

/// <summary>
/// Snapshot of kill switch state, returned over IPC to the client UI.
/// </summary>
public sealed class KillSwitchStatus
{
public KillSwitchMode Mode { get; init; }
public bool AllowLan { get; init; }

/// <summary>
/// True when filters are currently installed (block-all is in force). Read-only;
/// driven by the service based on Mode and the live VPN state.
/// </summary>
public bool IsActive { get; init; }
}

[JsonSerializable(typeof(KillSwitchStatus))]
[JsonSerializable(typeof(KillSwitchMode))]
public partial class KillSwitchStatusJsonContext : JsonSerializerContext
{
}

101 changes: 97 additions & 4 deletions GuardianConnectSDK/GuardianConnect.Services/ClientPipeService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,19 @@ public async void ServerThread(object? data)

var threadId = Thread.CurrentThread.ManagedThreadId;

// Outer try logs an unhandled escape with a diagnostic-rich message,
// then re-throws so the exception propagates out to the ThreadPool's
// unhandled-exception handler and Windows Service Recovery restarts
// the service. This is the self-healing path. Previous versions
// of this catch swallowed the exception silently, which
// left the service alive-but-dead with no functional pipe listeners
// after a quick stop+start (pipe-bind hit "All pipe instances are
// busy" while the OS was still releasing the prior instance's
// handles, all listener threads exited cleanly, service stayed up
// accepting no clients). Re-throwing restores the self-heal while
// keeping the diagnostic log.
try
{
Comment thread
tzeejay marked this conversation as resolved.
while (!_cancellationToken.IsCancellationRequested && !AdministrativeShutdownRequested)
{
var pipeSecurity = new PipeSecurity();
Expand All @@ -161,10 +174,53 @@ public async void ServerThread(object? data)
PipeAccessRights.FullControl,
AccessControlType.Allow));

//NamedPipeServerStream pipeServer = new NamedPipeServerStream("GuardianFirewallService", PipeDirection.InOut, numThreads);
var pipeServer = NamedPipeServerStreamAcl.Create("GuardianFirewallService",
PipeDirection.InOut, numThreads, PipeTransmissionMode.Byte, PipeOptions.Asynchronous,
65536, 65536, pipeSecurity);
// Pipe bind with retry. NamedPipeServerStreamAcl.Create can throw
// IOException("All pipe instances are busy.") when the service
// restarts quickly after a prior instance: the OS has not yet
// released the previous service's named-pipe instance count.
// 15 seconds is empirically not enough; the failure mode was
// observed in test logs.
//
// Recoverable in-process via backoff. We retry up to N times with
// increasing delay before giving up and letting the outer catch
// tear the service down for restart. The other listener threads
// are competing for the same pipe-instance pool, so a few of them
// will succeed earlier and the others later as old instances
// release one at a time.
Comment thread
tzeejay marked this conversation as resolved.
NamedPipeServerStream? pipeServer = null;
const int maxBindAttempts = 12;
var bindAttempt = 0;
while (pipeServer is null && !_cancellationToken.IsCancellationRequested && !AdministrativeShutdownRequested)
{
try
{
pipeServer = NamedPipeServerStreamAcl.Create("GuardianFirewallService",
PipeDirection.InOut, numThreads, PipeTransmissionMode.Byte, PipeOptions.Asynchronous,
65536, 65536, pipeSecurity);
}
catch (IOException ex) when (ex.Message.Contains("All pipe instances are busy", StringComparison.OrdinalIgnoreCase))
{
bindAttempt++;
if (bindAttempt >= maxBindAttempts)
{
_logger.Log(LogLevel.Error,
$"ClientPipeService[{threadId}]: pipe bind still failing after {maxBindAttempts} attempts. Giving up — outer catch will tear the service down for Windows Service Recovery restart.");
throw;
}
var delayMs = Math.Min(bindAttempt * 2000, 10000);
_logger.Log(LogLevel.Warning,
$"ClientPipeService[{threadId}]: pipe bind failed (attempt {bindAttempt}/{maxBindAttempts}, prior service handles still releasing). Retrying in {delayMs} ms.");
Thread.Sleep(delayMs);
}
}

if (pipeServer is null)
{
// Cancelled or shutdown during retry — exit the listener loop cleanly.
_logger.Log(LogLevel.Information,
$"ClientPipeService[{threadId}]: pipe bind aborted by cancellation/shutdown.");
break;
}

// Wait for a client to connect
_logger.Log(LogLevel.Information,
Expand Down Expand Up @@ -288,6 +344,33 @@ public async void ServerThread(object? data)
_logger.Log(LogLevel.Information, $"ClientPipeService[{threadId}]: Received PowerAndNetworkEvent: Event Type: {systemEventType}");
ServicePowerEventsHandler.HandleSystemEventsFromclient(systemEventType, cmdPayload);
break;
case IGuardianNPContract.NPCommands.SetKillSwitchMode:
_logger.Log(LogLevel.Information, $"ClientPipeService[{threadId}]: Performing SetKillSwitchMode (payload='{cmdPayload}')");
var ksMode = (KillSwitchMode)int.Parse(cmdPayload);
var ksModeResp = cmdDispatcher.SetKillSwitchMode(ksMode);
ss.WriteString(JsonSerializer.Serialize(ksModeResp, ErrorResponseJsonContext.Default.ErrorResponse));
break;
case IGuardianNPContract.NPCommands.SetKillSwitchAllowLan:
_logger.Log(LogLevel.Information, $"ClientPipeService[{threadId}]: Performing SetKillSwitchAllowLan (payload='{cmdPayload}')");
var ksLan = bool.Parse(cmdPayload);
var ksLanResp = cmdDispatcher.SetKillSwitchAllowLan(ksLan);
ss.WriteString(JsonSerializer.Serialize(ksLanResp, ErrorResponseJsonContext.Default.ErrorResponse));
break;
case IGuardianNPContract.NPCommands.GetKillSwitchStatus:
_logger.Log(LogLevel.Information, $"ClientPipeService[{threadId}]: Performing GetKillSwitchStatus");
var ksStatus = cmdDispatcher.GetKillSwitchStatus();
ss.WriteString(JsonSerializer.Serialize(ksStatus, KillSwitchStatusJsonContext.Default.KillSwitchStatus));
break;
case IGuardianNPContract.NPCommands.EnterConnectingMode:
_logger.Log(LogLevel.Information, $"ClientPipeService[{threadId}]: Performing EnterConnectingMode");
var enterResp = cmdDispatcher.EnterConnectingMode();
ss.WriteString(JsonSerializer.Serialize(enterResp, ErrorResponseJsonContext.Default.ErrorResponse));
break;
case IGuardianNPContract.NPCommands.ExitConnectingMode:
_logger.Log(LogLevel.Information, $"ClientPipeService[{threadId}]: Performing ExitConnectingMode");
var exitResp = cmdDispatcher.ExitConnectingMode();
ss.WriteString(JsonSerializer.Serialize(exitResp, ErrorResponseJsonContext.Default.ErrorResponse));
break;
default:
_logger.Log(LogLevel.Information, "WHY ARE WE HERE?");
break;
Expand All @@ -313,5 +396,15 @@ public async void ServerThread(object? data)
}

_logger.Log(LogLevel.Information, "ClientPipeService.End -- outer While()...");
}
catch (Exception ex)
{
_logger.Log(LogLevel.Error, $"ClientPipeService[{threadId}]: ServerThread terminated by unhandled exception: {ex.GetType().Name}: {ex.Message}");
// Re-throw: lets the exception escape to the ThreadPool unhandled-exception
// handler, which terminates the service. Windows Service Recovery then
// restarts us. This restores previous self-heal behavior; the
// outer catch is now diagnostic-only, not a swallow.
throw;
}
Comment thread
tzeejay marked this conversation as resolved.
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
<ProjectReference Include="..\GuardianConnect\GuardianConnect.csproj"/>
<ProjectReference Include="..\Shared\GuardianConnect.Shared.csproj"/>
<ProjectReference Include="..\Win32Calls.WFP\Win32Calls.WFP.csproj"/>
<ProjectReference Include="..\Win32Calls.WireGuard\Win32Calls.WireGuard.csproj"/>
<ProjectReference Include="..\Win32Calls\Win32Calls.csproj"/>
</ItemGroup>

Expand Down
Loading
Loading