feat: windows implementation#19
Conversation
Documentation build overview
135 files changed ·
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #19 +/- ##
==========================================
- Coverage 87.05% 86.50% -0.56%
==========================================
Files 10 12 +2
Lines 3152 3586 +434
Branches 1109 1230 +121
==========================================
+ Hits 2744 3102 +358
- Misses 250 375 +125
+ Partials 158 109 -49
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 6 files with indirect coverage changes Continue to review full report in Codecov by Harness.
|
3312431 to
f919c1f
Compare
8f275cf to
24ed49a
Compare
Refine Windows packaging and driver build integration: - cmake/packaging/windows.cmake: configure CPack for driver component when building driver and set CPACK_INSTALL_CMAKE_PROJECTS for driver installs. - cmake/packaging/windows_wix.cmake: point CPACK_WIX_EXTENSIONS to the full WixToolset.UI extension DLL path and remove use of a separate patch file. - Remove wix_resources/patch.xml and the FeatureRef from libvirtualhid-driver-installer.wxs. - src/platform/windows/driver/CMakeLists.txt: normalize and deduplicate WDK root paths, search for UM import libraries (ntdll) and expose LIBVIRTUALHID_NTDLL_LIBRARY; update error messages; link ntdll; restructure custom targets to prepare/stamp the INF and then generate the driver catalog with proper dependencies and working directories. - src/platform/windows/driver/libvirtualhid.inf.in: add SourceDisksNames/Files and DiskName entry so the INF lists source disk information. - src/platform/windows/windows_backend.cpp: replace getenv usage with GetEnvironmentVariableA for robust environment variable reading and remove unused <cstdlib> include. These changes improve robustness when locating WDK components, produce correct installer inputs, and make INF/catalog generation deterministic in the build.
4461727 to
98df18a
Compare
Refactor WiX packaging CMake: add WIX_BUILD_DIRECTORY and set a comment about UI extension versioning, always run dotnet tool install for WiX and fail on install errors, and add installation of the WixToolset.Util extension with error handling. Replace a hardcoded extension DLL path with logical extension names in CPACK_WIX_EXTENSIONS and emit the cpack package directory for debugging. These changes make extension installation more robust and simplify extension referencing for packaging.
44c2a75 to
2dc8581
Compare
2dc8581 to
db8e222
Compare
Add CI steps for MSVC on pull requests to configure, build, sign, install and uninstall a Windows test driver package, enabling driver packaging and validation in PR builds. Update unit tests: enhance RuntimeTest to exercise gamepad creation, submit and close behavior when backend is available; adjust Windows protocol tests to use string_view and protocol structs, add coverage for unknown enum values, and rewrite copy helpers to use bounded buffers and verify truncation/zero-fill behavior. Also update includes accordingly.
Introduce test hooks and a fake control-channel for the Windows backend to allow unit testing without an installed driver. Refactor WindowsControlChannel into an abstract interface and provide a Win32 implementation; add FakeWindowsControlChannel, supporting state, helpers (enqueue/read/wait) and test-only APIs that exercise lifecycle and failure cases. Add a test-only header (windows_backend_test_hooks.hpp) and unit tests (tests/unit/test_windows_backend.cpp), and include the test source on Windows in tests/CMakeLists.txt. Enable LIBVIRTUALHID_ENABLE_TEST_HOOKS when BUILD_TESTS in src/CMakeLists.txt so tests can compile the hooks, and make a minor PowerShell formatting tweak in .github/workflows/ci.yml.
Encapsulate FakeWindowsControlChannelState into a class with thread-safe accessors and operations (create_gamepad, destroy_device, submit_input_report, output event queueing and counters). Update FakeWindowsControlChannel to delegate behavior to the new state methods. Tighten create_gamepad API to accept a const reference and use a local copy for device IO. Add windows_backend_fake_channel_utilities() and WindowsBackendUtilityResult to exercise environment-variable handling, error formatting, context start/stop, and timeout branches; include new unit test verifying these utilities. Also add a missing <string> include in the test hooks header.
Change enqueue_output_event to take LvhWindowsOutputReportEvent by const reference instead of by value to avoid an unnecessary copy when pushing to the output_events_ vector. This is a non-functional refactor that reduces allocation/copy overhead and slightly improves performance.
e27d3c2 to
099c517
Compare
Expose HID gamepads via the Windows VHF (Virtual HID Framework). Updates README to mark VHF visibility items done and document VHF behavior. CMakeLists: discover VHF headers/libraries, add VHF include/library to the UMDF target, set NTDDI_VERSION, and print VHF status. INF: add registry entry to attach the VHF lower filter. libvirtualhid_umdf.cpp: integrate VHF (include vhf.h), create/manage VHF child devices per create requests, initialize a VHF I/O target, start/delete VHF devices, handle VHF async write reports by queuing/output-report events, buffer pending output reads, and perform cleanup on device removal. Overall this enables published HID gamepads to be visible to DirectInput, SDL/HIDAPI, Windows.Gaming.Input and browser Gamepad APIs.
099c517 to
30ecbd9
Compare
Remove in-tree test hooks and the LIBVIRTUALHID_ENABLE_TEST_HOOKS build define, and relocate Windows backend test-only code into the test fixtures. Changes: removed the test-hook compile definition from src/CMakeLists.txt and removed the guarded test hooks from src/platform/windows/windows_backend.cpp; renamed header into tests/fixtures/include/fixtures/windows_backend_test_hooks.hpp; added tests/fixtures/windows_backend_test_hooks.cpp (defines test hook implementations and includes the backend implementation under a test-only macro); updated tests/CMakeLists.txt to compile the new fixture source and adjusted test include in tests/unit/test_windows_backend.cpp. This keeps test-only hooks out of the production library build and centralizes test fixtures in the tests tree.
6c49cf3 to
a62fa9a
Compare
Add a new "CMake Consumption" section describing how to consume libvirtualhid via an installed package (CMAKE_PREFIX_PATH), add_subdirectory (vendored checkout), and FetchContent, and document the exported CMake target libvirtualhid::libvirtualhid. Clarifies that tests/examples/docs and the Windows driver package are opt-in and notes Linux consumers still need backend dev packages (libevdev, pkg-config). Also marks several roadmap checklist items as completed: unified API surface, CMake/FetchContent support, deferring language bindings, and decision on signed Windows driver packages.
|



Description
Windows implementation.
Screenshot
Issues Fixed or Closed
Roadmap Issues
Type of Change
Checklist
AI Usage