Skip to content

Update WireSockUI for direct SDK compatibility#104

Merged
wiresock merged 13 commits into
mainfrom
codex/wgbooster-sdk-compat
Jul 1, 2026
Merged

Update WireSockUI for direct SDK compatibility#104
wiresock merged 13 commits into
mainfrom
codex/wgbooster-sdk-compat

Conversation

@wiresock

@wiresock wiresock commented Jul 1, 2026

Copy link
Copy Markdown
Owner

Summary:

  • Keep WireSockUI on the direct wgbooster.dll SDK path, including SDK/minimal install discovery.
  • Update native wgbooster bindings, tunnel lifecycle diagnostics, config parsing, and #@ws extension handling.
  • Add Amnezia/WireSock extension validation, x64 solution mappings, and direct-SDK documentation.

Review notes:

  • Reviewed full local diff for ABI, config parsing, startup detection, single-instance coordination, lifecycle cleanup, and settings migration.
  • Removed the misleading legacy None log-level option; old saved values fall back to Error.
  • No separate automated test project exists in this repository.

Verification:

  • dotnet build WireSockUI.sln
  • dotnet build WireSockUI.sln -p:Configuration=Release -p:Platform=x64

Copilot AI review requested due to automatic review settings July 1, 2026 08:01

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates WireSockUI to support direct integration with the WireSock SDK (wgbooster.dll), adding support for several new configuration directives (such as VirtualAdapterMode and BypassLanTraffic), dynamic library discovery, and x64 build configurations. The review feedback highlights several robustness and validation issues: a bug in range validation that permits malformed inputs, potential startup crashes in Program.cs due to unhandled exceptions from malformed environment paths, unintended signaling of the global service event in IsApplicationAlreadyRunning(), and redundant cleanup logic in WireSockManager.cs.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread WireSockUI/Forms/frmEdit.cs Outdated
Comment thread WireSockUI/Forms/frmMain.cs Outdated
Comment thread WireSockUI/Program.cs
Comment thread WireSockUI/Program.cs Outdated
Comment thread WireSockUI/WireSockManager.cs Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates WireSockUI to remain compatible with the direct wgbooster.dll SDK integration model by improving SDK discovery, aligning native bindings/diagnostics with the updated ABI, and expanding WireSock-specific config parsing/validation and related UI settings.

Changes:

  • Updated native wgbooster bindings (log levels, drop_tunnel(..., preserveNetworkLock), SetLastError) and added richer lifecycle diagnostics.
  • Implemented direct-SDK wgbooster.dll discovery (app dir / PATH / registry install locations) and adjusted single-instance coordination to match the direct client/service name.
  • Enhanced config handling: #@ws directive parsing, additional profile fields/validation, and updated template + documentation.

Reviewed changes

Copilot reviewed 16 out of 18 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
WireSockUI/WireSockUI.csproj Disables Prefer32Bit to better align with direct SDK bitness expectations.
WireSockUI/WireSockManager.cs Updates tunnel lifecycle handling, logging, diagnostics, and drop_tunnel ABI usage.
WireSockUI/Resources/template.conf Updates template to use #@ws: directives and adds new optional directives.
WireSockUI/Properties/Settings.settings Changes default log level from None to Error.
WireSockUI/Properties/Settings.Designer.cs Keeps generated default log level consistent with settings.
WireSockUI/Properties/Resources.resx Updates user-facing strings for direct SDK/client messaging.
WireSockUI/Program.cs Implements wgbooster.dll discovery and process PATH augmentation.
WireSockUI/Native/WireguardConfigParser.cs Adds case-insensitive parsing and #@ws prefix support.
WireSockUI/Native/WireguardBoosterExports.cs Aligns interop with updated SDK ABI and error reporting.
WireSockUI/Global.cs Switches single-instance primitive type to EventWaitHandle.
WireSockUI/Forms/frmSettings.Designer.cs Updates log level dropdown options (removes None, adds Warning/Debug).
WireSockUI/Forms/frmSettings.cs Adds fallback when legacy/unknown log level is loaded from settings.
WireSockUI/Forms/frmMain.cs Updates single-instance logic and supports profile-level adapter override.
WireSockUI/Forms/frmEdit.cs Enhances #@ws syntax highlighting/validation and improves save semantics.
WireSockUI/Config/Profile.cs Expands profile parsing/validation (adapter override, scripts, SOCKS options, etc.).
WireSockUI/app.config Updates default log level to Error.
WireSockUI.sln Adds x64 solution/platform mappings.
README.md Replaces archival messaging with direct-SDK compatibility documentation.
Files not reviewed (2)
  • WireSockUI/Forms/frmSettings.Designer.cs: Generated file
  • WireSockUI/Properties/Settings.Designer.cs: Generated file

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread WireSockUI/WireSockManager.cs Outdated
Comment thread WireSockUI/Program.cs Outdated
@wiresock

wiresock commented Jul 1, 2026

Copy link
Copy Markdown
Owner Author

Addressed review feedback in f4ff47b:\n- preserve empty H-range parts so malformed ranges like 10- / -10 are rejected\n- avoid signaling the shared direct-client event during instance detection\n- ignore malformed PATH/registry path entries while locating wgbooster.dll and normalizing PATH\n- trim quoted PATH entries during duplicate checks\n- use DropCurrentHandle() on start failure\n- complete the log queue on the finalizer path\n\nVerification:\n- dotnet build WireSockUI.sln\n- dotnet build WireSockUI.sln -p:Configuration=Release -p:Platform=x64

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 16 out of 18 changed files in this pull request and generated 2 comments.

Files not reviewed (2)
  • WireSockUI/Forms/frmSettings.Designer.cs: Generated file
  • WireSockUI/Properties/Settings.Designer.cs: Generated file

Comment thread WireSockUI/WireSockManager.cs
Comment thread WireSockUI/Forms/frmEdit.cs
@wiresock

wiresock commented Jul 1, 2026

Copy link
Copy Markdown
Owner Author

Addressed the latest review feedback in e09f711:\n- Dispose(false) no longer runs managed cleanup; explicit Dispose() still disconnects and completes the log queue.\n- Missing AllowedApps/DisallowedApps insertions now use the #@ws: extension prefix.\n\nVerification repeated:\n- dotnet build WireSockUI.sln\n- dotnet build WireSockUI.sln -p:Configuration=Release -p:Platform=x64

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 16 out of 18 changed files in this pull request and generated 1 comment.

Files not reviewed (2)
  • WireSockUI/Forms/frmSettings.Designer.cs: Generated file
  • WireSockUI/Properties/Settings.Designer.cs: Generated file

Comment thread WireSockUI/WireSockManager.cs
@wiresock

wiresock commented Jul 1, 2026

Copy link
Copy Markdown
Owner Author

Addressed the latest disconnect cleanup review in 76d6f6f:\n- Disconnect() now attempts _dropTunnel even if _stopTunnel throws, logging stop/drop failures separately before clearing managed state.\n\nVerification repeated:\n- dotnet build WireSockUI.sln\n- dotnet build WireSockUI.sln -p:Configuration=Release -p:Platform=x64

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 16 out of 18 changed files in this pull request and generated 3 comments.

Files not reviewed (2)
  • WireSockUI/Forms/frmSettings.Designer.cs: Generated file
  • WireSockUI/Properties/Settings.Designer.cs: Generated file

Comment thread WireSockUI/WireSockManager.cs Outdated
Comment thread WireSockUI/Forms/frmEdit.cs
Comment thread WireSockUI/Config/Profile.cs
@wiresock

wiresock commented Jul 1, 2026

Copy link
Copy Markdown
Owner Author

Addressed the latest review feedback in 823aaaf:\n- Dispose(false) now quietly releases the native tunnel handle without managed queue/UI cleanup.\n- SOCKS5 proxy editor validation trims whitespace before address validation.\n- Profile ValidateInt/ValidateBool trim values and ValidateInt uses invariant parsing.\n\nVerification repeated:\n- dotnet build WireSockUI.sln\n- dotnet build WireSockUI.sln -p:Configuration=Release -p:Platform=x64

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 16 out of 18 changed files in this pull request and generated 3 comments.

Files not reviewed (2)
  • WireSockUI/Forms/frmSettings.Designer.cs: Generated file
  • WireSockUI/Properties/Settings.Designer.cs: Generated file

Comment thread WireSockUI/Program.cs Outdated
Comment thread WireSockUI/Program.cs
Comment thread WireSockUI/Program.cs
@wiresock

wiresock commented Jul 1, 2026

Copy link
Copy Markdown
Owner Author

Addressed the latest Copilot review in 96c7a4e: registry install locations now take precedence over inherited PATH probing, invalid wgbooster.dll candidate paths emit Trace warnings, and PATH mutation failures emit Trace warnings. Verified with dotnet build WireSockUI.sln and dotnet build WireSockUI.sln -p:Configuration=Release -p:Platform=x64.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 16 out of 18 changed files in this pull request and generated 1 comment.

Files not reviewed (2)
  • WireSockUI/Forms/frmSettings.Designer.cs: Generated file
  • WireSockUI/Properties/Settings.Designer.cs: Generated file

Comment thread WireSockUI/WireSockManager.cs

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 16 out of 18 changed files in this pull request and generated 4 comments.

Files not reviewed (2)
  • WireSockUI/Forms/frmSettings.Designer.cs: Generated file
  • WireSockUI/Properties/Settings.Designer.cs: Generated file
Comments suppressed due to low confidence (1)

WireSockUI/Forms/frmEdit.cs:541

  • In the error path, File.Delete(tmpProfile) is called even if File.WriteAllText(tmpProfile, ...) failed before creating the file. That can throw (e.g., FileNotFoundException) and crash the save flow while already handling an exception. Guard the cleanup with File.Exists and/or wrap deletion in a try/catch to avoid masking the original validation/write error.
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, Resources.EditProfileError, MessageBoxButtons.OK, MessageBoxIcon.Error);
                File.Delete(tmpProfile);

                DialogResult = DialogResult.None;
                return;

Comment thread WireSockUI/WireSockManager.cs
Comment thread WireSockUI/WireSockManager.cs
Comment thread WireSockUI/WireSockManager.cs
Comment thread WireSockUI/Program.cs Outdated
@wiresock

wiresock commented Jul 1, 2026

Copy link
Copy Markdown
Owner Author

Addressed the latest Copilot review in 9e5a421: Disconnect and DropCurrentHandle now log native diagnostics when stop_tunnel/drop_tunnel return false, PATH is no longer scanned for wgbooster.dll discovery, README discovery order was updated, and temporary profile cleanup is guarded so it cannot mask write/validation errors. Verification repeated: dotnet build WireSockUI.sln and dotnet build WireSockUI.sln -p:Configuration=Release -p:Platform=x64.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 16 out of 18 changed files in this pull request and generated 4 comments.

Files not reviewed (2)
  • WireSockUI/Forms/frmSettings.Designer.cs: Generated file
  • WireSockUI/Properties/Settings.Designer.cs: Generated file

Comment thread WireSockUI/WireSockManager.cs Outdated
Comment thread WireSockUI/Native/WireguardConfigParser.cs
Comment thread WireSockUI/Native/WireguardConfigParser.cs
Comment thread WireSockUI/Native/WireguardBoosterExports.cs Outdated
@wiresock

wiresock commented Jul 1, 2026

Copy link
Copy Markdown
Owner Author

Addressed the latest Copilot review in 3ac9d5f: log queue completion now works on both dispose paths without the worker capturing the WireSockManager instance, #@ws directive parsing/stripping now requires a real directive prefix, and the unused struct-based wgb_create_tunnel bindings were removed so WireSockUI relies on the SDK file-based Unicode tunnel creation path it actually uses. Verified against the local wgbooster.h header before removing the unused ABI surface. Verification repeated: dotnet build WireSockUI.sln and dotnet build WireSockUI.sln -p:Configuration=Release -p:Platform=x64.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 16 out of 18 changed files in this pull request and generated 4 comments.

Files not reviewed (2)
  • WireSockUI/Forms/frmSettings.Designer.cs: Generated file
  • WireSockUI/Properties/Settings.Designer.cs: Generated file

Comment thread WireSockUI/WireSockManager.cs
Comment thread WireSockUI/WireSockManager.cs
Comment thread WireSockUI/Program.cs Outdated
Comment thread WireSockUI/Forms/frmMain.cs Outdated
@wiresock

wiresock commented Jul 1, 2026

Copy link
Copy Markdown
Owner Author

Addressed the latest Copilot review in de50aeb: native stop/drop cleanup now removes unreachable null branches and logs EntryPointNotFoundException explicitly for missing exports, PATH normalization trims both Windows separator styles, and the single-instance EventWaitHandle path now catches IOException instead of the unreachable WaitHandleCannotBeOpenedException. Verification repeated: dotnet build WireSockUI.sln and dotnet build WireSockUI.sln -p:Configuration=Release -p:Platform=x64.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 16 out of 18 changed files in this pull request and generated 1 comment.

Files not reviewed (2)
  • WireSockUI/Forms/frmSettings.Designer.cs: Generated file
  • WireSockUI/Properties/Settings.Designer.cs: Generated file

Comment thread WireSockUI/Config/Profile.cs Outdated
@wiresock

wiresock commented Jul 1, 2026

Copy link
Copy Markdown
Owner Author

Addressed the latest Copilot review in f19ec94: corrected the Peer-section validation message grammar from 'an Peer' to 'a Peer'. Verification repeated: dotnet build WireSockUI.sln and dotnet build WireSockUI.sln -p:Configuration=Release -p:Platform=x64.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 16 out of 18 changed files in this pull request and generated 2 comments.

Files not reviewed (2)
  • WireSockUI/Forms/frmSettings.Designer.cs: Generated file
  • WireSockUI/Properties/Settings.Designer.cs: Generated file

Comment thread WireSockUI/Config/Profile.cs Outdated
Comment thread WireSockUI/Config/Profile.cs Outdated
@wiresock

wiresock commented Jul 1, 2026

Copy link
Copy Markdown
Owner Author

Addressed the latest Copilot review in e987b36: removed redundant DNS/Dns and PresharedKey/PreSharedKey fallback reads now that profile sections and keys are case-insensitive. Kept distinct compatibility aliases such as Socks5ProxyUsername/Socks5Username. Verification repeated: dotnet build WireSockUI.sln and dotnet build WireSockUI.sln -p:Configuration=Release -p:Platform=x64.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 16 out of 18 changed files in this pull request and generated no new comments.

Files not reviewed (2)
  • WireSockUI/Forms/frmSettings.Designer.cs: Generated file
  • WireSockUI/Properties/Settings.Designer.cs: Generated file

@wiresock wiresock merged commit 319ef60 into main Jul 1, 2026
1 check passed
@wiresock wiresock deleted the codex/wgbooster-sdk-compat branch July 1, 2026 12:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants