Namespaces:
Logitech.RawPeripheralAccessLogitech.RawPeripheralAccess.ProtocolDiscovery
Creates the process-global controller and creates or attaches to the Logitech virtual mouse. Returns true if this process created the child.
Submits validated relative mouse input. The API mirrors the WinAPI function and structures but throws on error instead of setting a thread last-error value.
Constructs one INPUT_MOUSE record.
Releases held buttons, disposes the controller, and removes a process-owned child. Safe to call repeatedly.
INPUTINPUTUNIONMOUSEINPUTKEYBDINPUTHARDWAREINPUT
INPUT.Size is 40 in the supported x64 process.
The LRPA class exports the standard relative mouse flags, X-button identifiers, input-type values, and WHEEL_DELTA.
| Member | Purpose |
|---|---|
TryCreateMouse() |
Create the global mouse or return false if it exists |
CreateMouse() |
Create the mouse or throw if it exists |
Submit(MouseReport) |
Submit one eight-byte report |
Move(short, short, MouseButtons) |
Relative movement |
SetButtons(MouseButtons) |
Replace the 16-bit button state |
Wheel(sbyte, sbyte, MouseButtons) |
Wheel/pan report |
Click(MouseButtons, int) |
Bounded press and release |
RemoveOwnedMouse() |
Remove only this controller's child |
ForceRemoveMouse() |
Explicitly remove the global child |
Instance-based WinAPI translation used by both the static .NET façade and native FFI handles.
| Member | Purpose |
|---|---|
Created |
Whether this session created the driver-global mouse |
Protocol |
Validated protocol profile |
SendInput(ReadOnlySpan<INPUT>) |
Validate and translate WinAPI-shaped input |
Submit(MouseReport) |
Submit a typed report and track button state |
Dispose() |
Release buttons and ownership-aware device cleanup |
| Offset | Width | Value |
|---|---|---|
| 0 | 2 | 16 button bits |
| 2 | 2 | signed relative X |
| 4 | 2 | signed relative Y |
| 6 | 1 | signed vertical wheel |
| 7 | 1 | signed horizontal pan |
Write(Span<byte>) is the allocation-free encoder. Encode() is available for diagnostics and tests.
| Property | Default |
|---|---|
DevicePath |
SetupAPI auto-discovery |
DriverPath |
Installed Logitech bus-driver path |
Protocol |
Auto-resolved and validated |
RemoveOwnedMouseOnDispose |
true |
CreationSettlingDelayMilliseconds |
750 |
Returns a process-cached DriverProtocol keyed by normalized full path. Restart the process after updating G HUB. The first resolution:
- reads the small driver image once;
- parses PE sections;
- runs registered fingerprints;
- requires exactly one semantic match; and
- calculates the image SHA-256 for evidence.
DriverProtocol includes the fingerprint ID, driver identity, evidence offsets/RVAs, and recovered create/report/remove IOCTLs.
New recovery strategies belong in src/LRPA.ProtocolDiscovery/Fingerprints. They must validate semantics and fail on missing or ambiguous matches.
| Exception | Meaning |
|---|---|
LrpaException |
Native open or IOCTL failure; includes the Win32 code |
InvalidDataException |
Malformed, unsupported, or ambiguous driver image |
InvalidOperationException |
Interface or device lifecycle conflict |
NotSupportedException |
Unsupported WinAPI input type or mode |
| Argument exception | Invalid size, count, flag, or bounded value |
The native ABI, result codes, layouts, and language bindings are documented in FFI.md.