Skip to content

feat(Windows): add broker service and license API - #63

Merged
ReenigneArcher merged 1 commit into
masterfrom
feat/monetize-polar
Aug 11, 2026
Merged

feat(Windows): add broker service and license API#63
ReenigneArcher merged 1 commit into
masterfrom
feat/monetize-polar

Conversation

@ReenigneArcher

Copy link
Copy Markdown
Member

Description

Introduces a brokered architecture for Windows UMDF gamepad creation:

  • Adds libvirtualhid_broker Windows service that gates gamepad creation and destruction behind Polar license validation
  • Adds session tokens to the control protocol so stale or unrelated clients cannot control devices they did not create
  • Adds driver-side broker SID check: only NT SERVICE\libvirtualhid_broker may create/destroy gamepads
  • Adds provider-neutral license.hpp public API (get_license_status, activate_license, validate_license, deactivate_license) with a stub for non-Windows platforms
  • Adds Windows broker client helpers and windows_license.cpp implementing the public API via the broker named pipe
  • Updates install/uninstall scripts to register, start, and stop the broker service with a safe quoted ImagePath and service SID
  • Updates virtualhid_control UI to show broker license status and provide activate/refresh/deactivate controls
  • Updates docs and store-review notes to reflect the broker, Polar licensing flow, and DPAPI-protected license state

Screenshot

Issues Fixed or Closed

Roadmap Issues

Type of Change

  • feat: New feature (non-breaking change which adds functionality)
  • fix: Bug fix (non-breaking change which fixes an issue)
  • docs: Documentation only changes
  • style: Changes that do not affect the meaning of the code (white-space, formatting, missing semicolons, etc.)
  • refactor: Code change that neither fixes a bug nor adds a feature
  • perf: Code change that improves performance
  • test: Adding missing tests or correcting existing tests
  • build: Changes that affect the build system or external dependencies
  • ci: Changes to CI configuration files and scripts
  • chore: Other changes that don't modify src or test files
  • revert: Reverts a previous commit
  • BREAKING CHANGE: Introduces a breaking change (can be combined with any type above)

Checklist

  • Code follows the style guidelines of this project
  • Code has been self-reviewed
  • Code has been commented, particularly in hard-to-understand areas
  • Code docstring/documentation-blocks for new or existing methods/components have been added or updated
  • Unit tests have been added or updated for any new or modified functionality

AI Usage

See our AI usage policy.

  • None: No AI tools were used in creating this PR
  • Light: AI provided minor assistance (formatting, simple suggestions)
  • Moderate: AI helped with code generation or debugging specific parts
  • Heavy: AI generated most or all of the code changes

@ReenigneArcher
ReenigneArcherforce-pushed the feat/monetize-polar branch 8 times, most recently from 8abce31 to fab5f34CompareAugust 10, 2026 19:54
@codecov

codecovBot commented Aug 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 37.50000% with 255 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.73%. Comparing base (0241d0f) to head (8a442ad).
✅ All tests successful. No failed tests found.

Files with missing linesPatch %Lines
tools/virtualhid_control.cpp0.00%103 Missing and 35 partials ⚠️
src/platform/windows/windows_license.cpp0.00%73 Missing ⚠️
src/platform/windows/windows_broker_client.cpp64.70%24 Missing ⚠️
src/platform/windows/windows_backend.cpp76.00%18 Missing ⚠️
src/platform/windows/windows_broker_client.hpp80.00%2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@ Coverage Diff @@## master #63 +/- ##
==========================================
- Coverage 76.12% 73.73% -2.40% 
==========================================
Files 24 30 +6 Lines 7306 7701 +395 Branches 2739 2892 +153 ==========================================
+ Hits 5562 5678 +116 + Misses 1482 1478 -4 - Partials 262 545 +283 
FlagCoverage Δ
Linux-Clang56.55% <22.53%> (-0.93%)⬇️
Linux-GCC67.39% <23.07%> (-1.12%)⬇️
Windows-MSVC87.17% <75.00%> (-1.02%)⬇️
Windows-MinGW-UCRT6463.02% <27.71%> (-2.89%)⬇️
macOS50.28% <22.53%> (-1.03%)⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing linesCoverage Δ
src/include/libvirtualhid/license.hpp100.00% <100.00%> (ø)
src/include/libvirtualhid/types.hpp96.42% <ø> (ø)
src/platform/license_unavailable.cpp100.00% <100.00%> (ø)
src/platform/windows/control_protocol.hpp100.00% <100.00%> (ø)
...s/shared/lvh_windows_github_actions_evaluation.hpp100.00% <100.00%> (ø)
src/platform/windows/windows_broker_client.hpp80.00% <80.00%> (ø)
src/platform/windows/windows_backend.cpp84.07% <76.00%> (-3.16%)⬇️
src/platform/windows/windows_broker_client.cpp64.70% <64.70%> (ø)
src/platform/windows/windows_license.cpp0.00% <0.00%> (ø)
tools/virtualhid_control.cpp0.00% <0.00%> (ø)

... and 10 files with indirect coverage changes


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0241d0f...8a442ad. Read the comment docs.

@ReenigneArcher
ReenigneArcherforce-pushed the feat/monetize-polar branch 11 times, most recently from 7157cc2 to 62dc5e3CompareAugust 10, 2026 23:48
Introduces a brokered architecture for Windows UMDF gamepad creation:
- Adds `libvirtualhid_broker` Windows service that gates gamepad creation and destruction behind Polar license validation
- Adds session tokens to the control protocol so stale or unrelated clients cannot control devices they did not create
- Adds driver-side broker SID check: only `NT SERVICE\libvirtualhid_broker` may create/destroy gamepads
- Adds provider-neutral `license.hpp` public API (`get_license_status`, `activate_license`, `validate_license`, `deactivate_license`) with a stub for non-Windows platforms
- Adds Windows broker client helpers and `windows_license.cpp` implementing the public API via the broker named pipe
- Updates install/uninstall scripts to register, start, and stop the broker service with a safe quoted `ImagePath` and service SID
- Updates `virtualhid_control` UI to show broker license status and provide activate/refresh/deactivate controls
- Updates docs and store-review notes to reflect the broker, Polar licensing flow, and DPAPI-protected license state
@sonarqubecloud

Copy link
Copy Markdown

@ReenigneArcher
ReenigneArcher marked this pull request as ready for review August 11, 2026 00:12
@ReenigneArcher
ReenigneArcher merged commit 88db84c into masterAug 11, 2026
28 of 29 checks passed
@ReenigneArcher
ReenigneArcher deleted the feat/monetize-polar branch August 11, 2026 00:14
Sign up for freeto 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.

1 participant

@ReenigneArcher