Compare commits
5
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2c586b6012
|
||
|
|
5b5dc11857 | ||
|
|
0de7dc6b27 | ||
|
|
4c07baadeb | ||
|
|
c39d970be3 |
No files matched your search
@@ -47,7 +47,7 @@ jobs:
|
||||
global-json-file: global.json
|
||||
|
||||
- name: Set up MSVC (x64)
|
||||
uses: ilammy/msvc-dev-cmd@v1
|
||||
uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0
|
||||
with:
|
||||
arch: x64
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ jobs:
|
||||
|
||||
- name: Set up MSVC (x64)
|
||||
if: matrix.language == 'cpp'
|
||||
uses: ilammy/msvc-dev-cmd@v1
|
||||
uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0
|
||||
with:
|
||||
arch: x64
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ jobs:
|
||||
global-json-file: global.json
|
||||
|
||||
- name: Set up MSVC (x64)
|
||||
uses: ilammy/msvc-dev-cmd@v1
|
||||
uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0
|
||||
with:
|
||||
arch: x64
|
||||
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
# SonarCloud Automatic Analysis — read from the default branch (docs/13_CI_CD.md §SonarCloud, decision D67).
|
||||
# Automatic Analysis reads only this file: sonar.issue.ignore.* is not supported here, so the rules accepted by design
|
||||
# are recorded in docs/13_CI_CD.md and marked by the owner in SonarCloud's own UI.
|
||||
|
||||
# What is not FrameLedger's code, or not code at all:
|
||||
# - src/native/third_party: the vendored SDK headers (NVAPI, Streamline, FidelityFX, Vulkan-Headers) — 51 headers,
|
||||
# 66 thousand lines, consumed unmodified (each folder's README says so and license-check holds it).
|
||||
# - Strings.Designer.cs: generated by tools/resx-gen.ps1.
|
||||
# - dxr_raygen_dxil.h: a compiled shader as a byte array, generated.
|
||||
# - vendor-stubs: test fixtures that carry the vendors' export names and signatures on purpose.
|
||||
# - tests/fixtures: the detection corpus (empty marker binaries and expected JSON).
|
||||
# - legal/licenses, docs/vendor-exports.json: licence texts and a generated export list.
|
||||
# - Migrations: SQLite scripts, which a SQL analyser reads as another dialect.
|
||||
sonar.exclusions=src/native/third_party/**,**/Strings.Designer.cs,src/native/tools/hook-harness/dxr_raygen_dxil.h,src/native/tools/vendor-stubs/**,tests/fixtures/**,legal/licenses/**,docs/vendor-exports.json,src/FrameLedger.Infrastructure/Persistence/Migrations/**
|
||||
|
||||
# Tests repeat their arrange steps on purpose; duplication there is not a defect.
|
||||
sonar.cpd.exclusions=tests/**,src/native/tests/**
|
||||
|
||||
# The native code is C++20 (src/native/CMakeLists.txt); report against it, not a later standard.
|
||||
sonar.cfamily.reportingCppStandardOverride=c++20
|
||||
|
||||
sonar.sourceEncoding=UTF-8
|
||||
@@ -28,6 +28,41 @@ numeric core and does not move; the heading is the full version — corrected 20
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
### Changed
|
||||
|
||||
- **SonarCloud analyses only FrameLedger's own code** (developers only; owner request 2026-10-19, decision D67). A
|
||||
`.sonarcloud.properties` at the root keeps the vendored SDK headers, generated files, test fixtures, licence texts and
|
||||
the SQLite migrations out of the analysis and reports the native code against C++20; `docs/13_CI_CD.md` §SonarCloud
|
||||
records the triage of the 341 issues the last analysis left — the rules this project breaks by design and why, the
|
||||
false positives, and the ones the next change fixes — with the steps to mark them in SonarCloud.
|
||||
|
||||
### Fixed
|
||||
|
||||
- **Opening a folder in Explorer** — the logs, the data folder, the licences, a bug report's zip and the folder named
|
||||
after a failed start — starts `explorer.exe` from the Windows folder by its full path, never a program of that name
|
||||
found on the search path, and always hands it the path in quotes (three of the five places passed it bare).
|
||||
- **What SonarCloud found that was real** (developers only): the one third-party GitHub Action is pinned to its
|
||||
commit; two string reads in native code are bounded by their buffer (the guard's rules-file path handed to the Agent,
|
||||
and the driver's branch name the NVAPI bridge copies); the pipe server's accept loop states that it ends only when
|
||||
cancelled; a launch's own session names its absent stop token (`CancellationToken.None`, with the reason) where it
|
||||
wrote `default` — the same value, now said on purpose; an unused overload of
|
||||
the process launcher that hid the other is gone; the identifier `module` (a C++20 keyword in some positions) is
|
||||
renamed in the hook layer — a rename only, no code changes; and a hook-overhead probe no longer uses a compound
|
||||
assignment on a `volatile`, which C++20 deprecates. The analyzers Dependabot updates in #314 flag the first-start
|
||||
window's own answer task and one test fake's synchronous wait; both are suppressed with their reasons, so that update
|
||||
can merge.
|
||||
|
||||
## [0.1.0-beta.23] - 2026-10-14
|
||||
|
||||
**The twenty-third pre-release: a game's artwork on its page, in a band that takes the picture's colour, and pages
|
||||
that open and change session without freezing.** The same unsigned installer: verify its hash against
|
||||
`SHA256SUMS.txt`, then *More info → Run anyway*.
|
||||
|
||||
**Updating from `0.1.0-beta.22`:** Help ▸ Check for updates, then *Restart to update* with no game running. The
|
||||
Privacy Policy (2.11) is shown once for you to accept. No game is read again: the detection rules (`2026.10.4`) are
|
||||
beta.22's. The artwork shows by itself for the games Steam or GOG GALAXY installed; **Settings ▸ Games** turns it, or
|
||||
its colour, off.
|
||||
|
||||
### Added
|
||||
|
||||
- **A game's page shows its artwork** (owner request 2026-10-14, decisions D60/D61). At the top of the page: the
|
||||
@@ -40,6 +75,12 @@ numeric core and does not move; the heading is the full version — corrected 20
|
||||
game artwork* and *Colour the game page from its artwork*, both on. **Privacy Policy 2.11** names the images read and
|
||||
the copies kept; FrameLedger still makes no request to any store.
|
||||
|
||||
### Changed
|
||||
|
||||
- **The list of tested games has its first Vulkan game**: Everhex Demo, measured through FrameLedger's Vulkan layer on
|
||||
2026-10-13 when Play started it directly (`docs/LIST_GAME_TESTED.md`, `LIMITATIONS.md`). Four places in the developer
|
||||
documents that described something never built, or kept a count that went stale, are corrected in place.
|
||||
|
||||
### Fixed
|
||||
|
||||
- **A game's page opens and changes session without freezing the window** (owner request 2026-10-14). Measured on the
|
||||
|
||||
@@ -70,7 +70,8 @@ build.ps1 # the quality gate; CI runs this identical script
|
||||
src/
|
||||
native/
|
||||
FrameLedger.Overlay/ # C++20 DLL injected into the game (hooks + ring writer + optional overlay)
|
||||
FrameLedger.Injector/ # C++20 static lib: launch/attach injection, AC guard probe
|
||||
FrameLedger.Injector/ # C++20 static lib: launch/attach injection, AC guard probe; also builds
|
||||
# FrameLedger.Guard.dll, the guard's C ABI the Agent loads (line added 2026-10-14)
|
||||
FrameLedger.VkLayer/ # C++20 Vulkan implicit layer DLL + manifest JSON
|
||||
FrameLedger.Shm/ # header-only: ring buffer + record layout, shared by native & C# (mirrored)
|
||||
FrameLedger.NvapiBridge/ # C++ DLL loaded by the Agent (never a game): NVAPI telemetry, NGX state (P2 PR-E2)
|
||||
|
||||
+3
-2
@@ -5,7 +5,7 @@ hooking on for — and reading the graphics calls the game makes. That is why it
|
||||
resolution, the upscaler, frame generation and ray tracing apart. It is also where its limits come from. This
|
||||
page lists them in plain words; each item links to the document that has the details.
|
||||
|
||||
*Beta software: this page describes version 0.1.0-beta.22.*
|
||||
*Beta software: this page describes version 0.1.0-beta.23.*
|
||||
|
||||
## Games it will not measure
|
||||
|
||||
@@ -162,7 +162,8 @@ you accept the prompt. Turn it on only if you trust everything that runs under y
|
||||
- The games FrameLedger has actually been run with, and what was measured on each, are listed in
|
||||
[LIST_GAME_TESTED.md](docs/LIST_GAME_TESTED.md). Everything was measured on one machine (an NVIDIA
|
||||
GeForce RTX 5080 with an Intel Core i7-14700KF on Windows 11); other hardware is untested.
|
||||
- **No real Vulkan or OpenGL game has been measured yet** — only FrameLedger's own test program.
|
||||
- **One real Vulkan game has been measured** (Everhex Demo, 2026-10-13) **and no OpenGL game**, beyond FrameLedger's
|
||||
own test program.
|
||||
- There is **no in-game overlay**; everything is shown in the FrameLedger window.
|
||||
- **FrameLedger does not tell whether a game is safe to run.** It reads a game's files to find its engine and its
|
||||
anti-cheat, never to judge it, and recording or measuring a game vouches for nothing. Four itch.io downloads this
|
||||
|
||||
@@ -12,7 +12,7 @@ pages.
|
||||
|
||||
<!-- accuracy-block:begin -->
|
||||
> ⚠ **What FrameLedger actually measures today — 2026-10-13.** The software is a beta; its latest
|
||||
> **pre-release is `0.1.0-beta.22`** (2026-10-13), an unsigned installer built from that tag with its
|
||||
> **pre-release is `0.1.0-beta.23`** (2026-10-14), an unsigned installer built from that tag with its
|
||||
> checksums published beside it. The source holds the desktop app
|
||||
> (library, store import, charts, settings) and the background Agent, which records a session when a
|
||||
> game in the library runs (unless you switched its recording off), injects only into games you enabled
|
||||
@@ -167,7 +167,7 @@ Elevation is **optional — for everything.** Hooked capture is the normal path
|
||||
|
||||
## Install
|
||||
|
||||
> **The latest pre-release is `v0.1.0-beta.22` (2026-10-13); before it `v0.1.0-beta.21` (2026-10-13), `v0.1.0-beta.20` (2026-10-12), `v0.1.0-beta.19` (2026-10-12), `v0.1.0-beta.18` (2026-10-07), `v0.1.0-beta.17` (2026-10-07), `v0.1.0-beta.16` (2026-10-06), `v0.1.0-beta.15` (2026-10-06), `v0.1.0-beta.14` (2026-10-06), `v0.1.0-beta.13` (2026-10-04), `v0.1.0-beta.12` (2026-10-04), `v0.1.0-beta.11` (2026-10-03), `v0.1.0-beta.10` (2026-09-28), `v0.1.0-beta.9` (2026-09-26), `v0.1.0-beta.8` (2026-09-25), `v0.1.0-beta.7` (2026-09-23), `v0.1.0-beta.6` (2026-09-23), `v0.1.0-beta.5` (2026-09-22), `v0.1.0-beta.4` (2026-09-21), `v0.1.0-beta.3` (2026-09-21), `v0.1.0-beta.2` (2026-09-17) and `v0.1.0-beta.1` (2026-09-16).** They are pre-releases: read `CHANGELOG.md`'s section for the one you install — what it measures, what it does not yet, and how to update — before installing. A source build is `docs/12_BUILD.md`.
|
||||
> **The latest pre-release is `v0.1.0-beta.23` (2026-10-14); before it `v0.1.0-beta.22` (2026-10-13), `v0.1.0-beta.21` (2026-10-13), `v0.1.0-beta.20` (2026-10-12), `v0.1.0-beta.19` (2026-10-12), `v0.1.0-beta.18` (2026-10-07), `v0.1.0-beta.17` (2026-10-07), `v0.1.0-beta.16` (2026-10-06), `v0.1.0-beta.15` (2026-10-06), `v0.1.0-beta.14` (2026-10-06), `v0.1.0-beta.13` (2026-10-04), `v0.1.0-beta.12` (2026-10-04), `v0.1.0-beta.11` (2026-10-03), `v0.1.0-beta.10` (2026-09-28), `v0.1.0-beta.9` (2026-09-26), `v0.1.0-beta.8` (2026-09-25), `v0.1.0-beta.7` (2026-09-23), `v0.1.0-beta.6` (2026-09-23), `v0.1.0-beta.5` (2026-09-22), `v0.1.0-beta.4` (2026-09-21), `v0.1.0-beta.3` (2026-09-21), `v0.1.0-beta.2` (2026-09-17) and `v0.1.0-beta.1` (2026-09-16).** They are pre-releases: read `CHANGELOG.md`'s section for the one you install — what it measures, what it does not yet, and how to update — before installing. A source build is `docs/12_BUILD.md`.
|
||||
|
||||
1. Download the latest `FrameLedger.App-win-Setup.exe` from [Releases](https://github.com/poli0981/frameledger/releases). It installs into `%LOCALAPPDATA%\FrameLedger.App`; your data stays in `%LOCALAPPDATA%\FrameLedger`, and uninstalling asks before touching it.
|
||||
2. SmartScreen may warn — releases are not code-signed (free, open-source project). Verify the SHA-256 checksum published with each release, then **More info → Run anyway**.
|
||||
@@ -216,4 +216,4 @@ GPU telemetry is layered so the project never depends on a proprietary vendor li
|
||||
|
||||
---
|
||||
|
||||
**Status:** pre-release (beta). Twenty-two tagged pre-releases so far; see `CHANGELOG.md` for what each one changed and the accuracy block at the top of this file for what is and is not measured. It is not feature-complete, it certainly still has bugs, and `legal/DISCLAIMER.md` §0 says what that means for you.
|
||||
**Status:** pre-release (beta). Twenty-three tagged pre-releases so far; see `CHANGELOG.md` for what each one changed and the accuracy block at the top of this file for what is and is not measured. It is not feature-complete, it certainly still has bugs, and `legal/DISCLAIMER.md` §0 says what that means for you.
|
||||
@@ -392,7 +392,7 @@ engine compiled only, reads as not found. One Ren'Py install was measured.
|
||||
> `StoreLibrarySourcesTests.ItchSkipsAVerdictCandidateThatIsARuntimeHelper` (the verdict as stored),
|
||||
> `LibraryImporterTests.AStoreTitleAlreadyInTheLibraryAtAnotherExecutableIsNotOfferedAgain`.
|
||||
|
||||
**Publisher/version order:** store manifest → PE `CompanyName`/`ProductVersion` → *(opt-in)* Steam `appdetails` lookup, cached 7 days. *(Since beta.8 the PE versions are stored beside the store's rather than instead of it — §What the files say about themselves; the page labels a store's value with its store, "Steam build 20374416".)*
|
||||
**Publisher/version order:** store manifest → PE `CompanyName`/`ProductVersion` ~~→ *(opt-in)* Steam `appdetails` lookup, cached 7 days~~ *(never built — FrameLedger makes no request to a store, `privacy.online_metadata` is reserved, and a game's artwork (beta.23, D60) is read from the store app's own files on the disk; struck 2026-10-14)*. *(Since beta.8 the PE versions are stored beside the store's rather than instead of it — §What the files say about themselves; the page labels a store's value with its store, "Steam build 20374416".)*
|
||||
|
||||
## Capability hints (explicitly labelled as such)
|
||||
|
||||
|
||||
@@ -56,7 +56,8 @@ CREATE TABLE games (
|
||||
cover_path TEXT, notes TEXT, -- cover_path: written since beta.23 (D60) — the image the user chose, as
|
||||
-- covers\game-<id>-<unix ms>.png relative to the data folder (a PNG copy
|
||||
-- <= 1200 px); followed only when it is one of those names under covers\
|
||||
-- (a viewer's copy could name a share); NULL = the store app's own artwork
|
||||
-- and never through a junction or a symbolic link (a viewer's copy could
|
||||
-- name a share); NULL = the store app's own artwork
|
||||
removed_at INTEGER, -- schema 0002 (P3 PR-3): FR-1.4 "remove, keep sessions" — the row stays
|
||||
-- (sessions.game_id is NOT NULL, ON DELETE CASCADE) but leaves the
|
||||
-- library; a later launch of the same exe restores it (removed_at = NULL)
|
||||
|
||||
+7
-5
@@ -331,17 +331,19 @@ All screens are `Page`s registered with the navigation page provider and navigat
|
||||
> (`privacy.online_metadata` stays reserved). The page: a band (`ArtBand`, rounded) holding the banner (`ui:Image`, as tall
|
||||
> as its proportions make it, ≤ 240, fading into the band through an alpha mask set in code) above the usual header with the
|
||||
> cover beside the name (120×180, or 230×107 for a landscape header); a game with no artwork shows no band. No text is
|
||||
> drawn on a picture. **The band's colour** (`Controls.ArtTint`, D61): the cover's dominant colour (`Services.ColorMath`: a
|
||||
> drawn on a picture. **The band's colour** (`Controls.ArtTint`, D61): the cover's — else the banner's — dominant colour (`Services.ColorMath`: a
|
||||
> hue histogram of a 48-px copy, vivid pixels weighted, a grey picture none) over the card's fill at the strongest opacity
|
||||
> — ≤ 30 % on a dark theme, ≤ 22 % on a light one — at which primary and secondary text keep 4.5:1, tertiary 3:1, and the
|
||||
> pills' and the warning's text 4.5:1 on their fills; recomputed through a resource reference when the theme changes;
|
||||
> untinted with the option off, a grey picture or high contrast. Everything is read and decoded on the thread pool
|
||||
> (`Services.GameArt`; the twelve newest images kept); the text shows first and the picture when ready. A chosen image's
|
||||
> path is followed only when it is one of these names under the folder's `covers` — a viewer's copy (D52) could name a
|
||||
> share. Settings ▸ Games: *Show game artwork* (`ui.game_art`) and *Colour the game page from its artwork*
|
||||
> path is followed only when it is one of these names in the data folder's `covers`, and never through a junction or a
|
||||
> symbolic link — a viewer's copy (D52) could name a share, or hold a link to one. Settings ▸ Games: *Show game artwork* (`ui.game_art`) and *Colour the game page from its artwork*
|
||||
> (`ui.game_art_tint`), both on. Tests: `GameArtTests`, `CoverStoreTests`, `ColorMathTests` (the hardest colours in both
|
||||
> themes against the tests' own WCAG), `EditGameViewModelTests`, `PagesLoadTests.EveryTextIsReadableInBothThemes` (the
|
||||
> surfaces' game page has artwork) and `…TheArtworkBandFollowsAThemeSwitch`. The library's cards still have no image.
|
||||
> surfaces' game page has artwork), `…TheArtworkBandFollowsAThemeSwitch` and `…TheGamePagesArtworkIsDrawn` with
|
||||
> `AccessibilityTests.NoStyleOfAWpfUiControlLeavesOutItsTemplate` (the cover once took its place and drew nothing, a
|
||||
> `ui:Image` style not based on WPF UI's; caught in a render before it shipped). The library's cards still have no image.
|
||||
|
||||
> **Built 2026-09-14 (P3 PR-5): the grid, the detail page's header, the two rows, the hooking control and
|
||||
> the Sessions tab.** Grid: `ui:CardAction` cards with platform / engine / hooking badges, sessions, playtime,
|
||||
@@ -746,7 +748,7 @@ Sections per FR-10 using the WPF UI settings idiom: `ui:CardControl`/`ui:CardExp
|
||||
|
||||
**System (2026-09-21, FR "show the user's hardware"):** a card above Legal stating this PC as a session's hardware snapshot would record it right now — processor, graphics card, graphics driver, memory, Windows build, primary display — through the same `IHardwareSnapshotSource` the Agent stamps sessions with, read on the thread pool when the page opens, a field that could not be read as N/A, with **Copy** (the same lines as text) and a note that nothing is sent anywhere and what CPU temperature needs. Its own `SystemInfoViewModel`, not `SettingsViewModel`'s. The same snapshot is one tertiary line under the session summary's header (it was loaded for the export and shown nowhere), and `--diag` prints it; the bug bundle's `sysinfo.json` is deliberately NOT given it — its keys are the issue link's prefill.
|
||||
|
||||
Agent section: elevation state with a plain explanation of what elevation *optionally* unlocks (CPU temperature, elevated-game attach — ~~ETW fallback~~, which no longer exists) and that it is **not required by any capture tier**; task state, Register/Repair/Remove task, "Start agent at logon", ~~background capture toggle~~ *(removed in beta.12 — nothing read it; corrected 2026-10-04)*. Privacy: online-metadata opt-in with plain-language explanation. Legal: reopen documents.
|
||||
Agent section: elevation state with a plain explanation of what elevation *optionally* unlocks (CPU temperature, elevated-game attach — ~~ETW fallback~~, which no longer exists) and that it is **not required by any capture tier**; task state, Register/Repair/Remove task, "Start agent at logon", ~~background capture toggle~~ *(removed in beta.12 — nothing read it; corrected 2026-10-04)*. ~~Privacy: online-metadata opt-in with plain-language explanation.~~ *(Not shown since 2026-09-16: no code makes the request and `privacy.online_metadata` stays reserved — the built Settings below; struck 2026-10-14.)* Legal: reopen documents.
|
||||
|
||||
> **The admin mode, beta.10 (owner decision D34; `01_ARCHITECTURE` ADR-9).** The Agent section has a switch, *Run the agent
|
||||
> as administrator* (`capture.run_elevated`, off by default). Turning it on opens a `ContentDialog`
|
||||
|
||||
+62
-1
@@ -7,7 +7,7 @@ FrameLedger uses the **`poli0981/.github` ops repo** where its templates fit, an
|
||||
## Workflows (`.github/workflows/`)
|
||||
|
||||
### `ci.yml` — push to `main` + all PRs + `workflow_dispatch` (added 2026-10-04) · **repo-local**
|
||||
- `runs-on: windows-latest`, .NET SDK pinned by `global.json` via `actions/setup-dotnet`, MSVC via `ilammy/msvc-dev-cmd`, NuGet cached.
|
||||
- `runs-on: windows-latest`, .NET SDK pinned by `global.json` via `actions/setup-dotnet`, MSVC via `ilammy/msvc-dev-cmd` (pinned to its v1.13.0 commit since beta.24 — the one third-party action, SonarCloud `githubactions:S7637`; Dependabot moves the pin), NuGet cached.
|
||||
- Single step of substance: **`./build.ps1 check`** — the same script, with the same switches (none), a developer runs before pushing. The gate list lives in `12_BUILD` §Local quality gate, **once**, rather than being restated here where it goes stale.
|
||||
- ~~**`-SkipIntegration` is the one place local and CI deliberately differ**~~ — **gone since 2026-09-06.** From 2026-08-05 CI passed it for a measured reason: §S16 puts the injecting process's ancestors in the scan set, a .NET test host loads `System.Security.Cryptography.ProtectedData.dll`, and the guard's `protect` fragment refused our own harness (§S19(b)). The signer half now verifies that module's embedded signature offline and reads `O=Microsoft Corporation` on the compiled-in bound, so the `Category=Integration` cases run here — **nine** when this was written, **20 across six classes** as of 2026-09-13 (Agent 6, CaptureHost 7, Infrastructure 7); count them with `grep -rl 'Category", "Integration' tests` rather than trusting either number — and a green CI IS evidence for the managed drain and the capture host's end-to-end behaviour. The switch remains in `build.ps1`, loud, for a developer who must.
|
||||
- **The hosted runner refuses guard scans intermittently — THREE failures in eight gate runs, measured
|
||||
@@ -222,6 +222,67 @@ FrameLedger uses the **`poli0981/.github` ops repo** where its templates fit, an
|
||||
- `permissions: contents: write` — the repository's default workflow token is read-only (read from the API,
|
||||
2026-10-07), and pushing to the wiki repository needs write.
|
||||
|
||||
## SonarCloud — Automatic Analysis, no workflow (beta.24, owner decision D67)
|
||||
|
||||
The project `poli0981_frameledger` is analysed by SonarCloud's GitHub app in **Automatic Analysis** mode: on every
|
||||
push to `main` and on every pull request, with no workflow in this repository and no logs published. Its check on a
|
||||
pull request (*SonarCloud Code Analysis*) is advisory — it is not a required status.
|
||||
|
||||
**What it reads is set by `.sonarcloud.properties`** at the root, the only file Automatic Analysis reads, from the
|
||||
default branch. It excludes what is not FrameLedger's code or not code: the vendored SDK headers under
|
||||
`src/native/third_party/` (51 headers, 66 thousand lines — before this file they were 41.7 thousand of the project's
|
||||
94 thousand counted lines, classed C), the generated `Strings.Designer.cs` and `dxr_raygen_dxil.h`, the vendor stubs
|
||||
(fixtures that carry the vendors' export names on purpose), `tests/fixtures/`, the licence texts, the generated
|
||||
`docs/vendor-exports.json` and the SQLite migrations (a SQL analyser reads them as another dialect). It reports C++
|
||||
against C++20, the standard `src/native/CMakeLists.txt` sets. `build/`, `bin/`, `obj/` and `presentmon/` are
|
||||
git-ignored and never reach it.
|
||||
|
||||
**What it cannot do.** `sonar.issue.ignore.*` is not read by Automatic Analysis, so a rule this project breaks by
|
||||
design is recorded here and marked in SonarCloud's own UI — by the owner, who holds the account. A CI-based scan (the
|
||||
only way to import coverage or analyse one build variant of the C++) would mean turning Automatic Analysis off, a
|
||||
`SONAR_TOKEN` secret, OpenCover output beside today's Cobertura and a full-depth checkout; it is not done.
|
||||
|
||||
**The triage of 2026-10-19** — the analysis of `main` at `372389c` (2026-09-28; nothing had been analysed since),
|
||||
341 open issues, none resolved. Rules broken by design are *Accept*ed and false positives marked as such, each with
|
||||
the comment below; the rest are fixed in the same train (beta.24 PR-2).
|
||||
|
||||
| Rule | Issues | Verdict | Comment for the UI |
|
||||
|---|---|---|---|
|
||||
| `cpp:S8417` atomics should be sequentially consistent | 225 | **Accept** — by design | The SPSC ring and the hook counters use explicit acquire/release and relaxed orders on purpose (`07_IPC`); sequential consistency would add fences on the per-present path. |
|
||||
| `csharpsquid:S6640` unsafe code blocks | 31 | **Accept** — by design | Interop with the native layer and the shared-memory mirror, confined to `Infrastructure` and `Shared` (CLAUDE.md: the native layer is reachable only through `Infrastructure`). |
|
||||
| `cpp:S6232` union type-punning | 24 | **False positive** | `LARGE_INTEGER.QuadPart` is how the Windows API returns the value. |
|
||||
| `cpp:S5813` bounds when computing string length | 19 | **Accept** for the 17 below; the 2 with a buffer bound at hand were bounded (beta.24 PR-2: `FlGuardRulesFilePath` reads `wcsnlen(out, cap)`, the NVAPI bridge `strnlen` over the driver's `NvAPI_ShortString`) | Every string measured is NUL-terminated by construction — see the list under this table. |
|
||||
| `csharpsquid:S2077` dynamic SQL | 3 | **False positive** | A `PRAGMA` argument cannot be bound; the values are an `int` and closed sets of constants (`wal_checkpoint` mode, the tri-state column), never user text. |
|
||||
| `cpp:S935` `FlGetBuildId` returns no value | 1 | **False positive** | `FL_BUILD_ID` is defined by the build (`12_BUILD` §Version); the analysis compiles without it. |
|
||||
| `cpp:S3519` out-of-bounds `memcpy` | 1 | **False positive** | `fl_patch_check.h` reads the prologue of a function this DLL hooked, under SEH, by design (`17_HOOK_ENGINE` §Unhooking). |
|
||||
| `cpp:S836` garbage value returned | 1 | **False positive** | `hook-harness`'s `VtableOf` reads the vtable of a COM object it created itself. |
|
||||
| `csharpsquid:S3869` `DangerousGetHandle` | 1 | **Accept** | `ParentDump` passes the dump file's handle to `MiniDumpWriteDump` inside the `using` that owns the stream, on the same thread, so it cannot be released during the call; CsWin32 generates no `SafeHandle` overload here (`NativeMethods.json`: `useSafeHandles: false`). |
|
||||
| `cpp:S1669`, `cpp:S6191`, `csharpsquid:S4036`, `githubactions:S7637`, `csharpsquid:S2190`, `S3427`, `S8949` | 35 | **Fixed** in beta.24 PR-2 — 5 of the 23 `S1669` were in the vendored Vulkan headers and leave with the exclusions | — |
|
||||
|
||||
**`cpp:S5813`, the 17 accepted, and why each string is terminated** (lines as of beta.24):
|
||||
|
||||
- `fl_ac_rules.cpp` — `IStartsWith`/`IContains` (`:38`, `:43-44`) and `TokenIs` (`:74`) measure rule fragments and
|
||||
literals the guard itself holds; `:151` and `:288` measure a value `CopyToken` has just written, which refuses a token
|
||||
that does not fit and always writes the terminator; `CopyLiteral` (`:176`) measures a compiled literal; `:834`
|
||||
measures `SHGetKnownFolderPath`'s answer, terminated by the API.
|
||||
- `fl_guard.cpp:109` — the guard's own DLL path, built and terminated by its caller before injection.
|
||||
- `fl_guard_sources.cpp` — `:345` measures the executable's path the guard read itself and walked to its terminator
|
||||
in the loop just above; `:753` the install root the guard resolved from it; `VdfValue` (`:582`) measures the
|
||||
compiled keys its callers pass (`"installdir"`, `"appid"`), and `AllDigits` (`:617`) a value `VdfValue` copied with
|
||||
its own bound.
|
||||
- `fl_prescan.cpp` — `IsKernelDriverName` (`:40`) measures a name the directory walk handed over terminated;
|
||||
`SegmentIs` (`:181`) a literal; `:337` the executable's folder the pre-scan built itself.
|
||||
- `layer.cpp:99` (the Vulkan layer) — a leaf of `GetModuleFileNameA`'s result, which the line above has already
|
||||
checked is shorter than `MAX_PATH`, so it is terminated.
|
||||
- `fl-baseline-probe/main.cpp:55` — a literal (a developer probe, not shipped).
|
||||
|
||||
**The owner's steps** after the next analysis of `main`: for each rule above, open
|
||||
`https://sonarcloud.io/project/issues?id=poli0981_frameledger&resolved=false&rules=<rule>`, select all, *Bulk change*,
|
||||
choose *Accept* or *False positive* and paste the comment. Optionally, *Administration ▸ General Settings ▸ Analysis
|
||||
Scope ▸ Ignore issues on multiple criteria*: `cpp:S8417` and `cpp:S6232` on `src/native/**/*`, `csharpsquid:S6640`
|
||||
on `src/FrameLedger.Infrastructure/**/*` and `src/FrameLedger.Shared/**/*`, so new instances of the by-design rules
|
||||
stop reappearing on pull requests.
|
||||
|
||||
## Dependabot (`.github/dependabot.yml`)
|
||||
|
||||
```yaml
|
||||
|
||||
+1
-1
@@ -328,7 +328,7 @@ WPF UI shell (`16_WPFUI_SYNTAX`), library, per-game hooking consent flow, Dashbo
|
||||
~~Static rules engine + `detection-rules.json` (engines, platforms, capabilities, **anticheat blocklist**) + validator + fixtures~~ **landed 2026-09-14 (P4 PR-1: the engine existed since P0; the Agent's `DetectionSweep` is its first caller, `ApplyDetectionAsync` its first writer — HANDOFF §P4)**; ~~store auto-import~~ **landed 2026-09-14 (P4 PR-4)**; ~~capability-vs-measured UI separation~~ **(PR-1: the Supports row reads the sweep's flags)**; ~~i18n en/vi/ja; Legal Gate;~~ ~~Velopack + updater (with the hooked-session deferral)~~ **landed 2026-09-14 (P4 PR-5 — the deferral is `UpdateService`'s shape, not a flag)**; ~~bug bundle incl. overlay logs~~ **landed (overlay logs since P3 PR-8a; 2026-09-15, P4 PR-9: the crash dialog, the minidump in both processes and the dump as the bundle's opt-in — `10_LOGGING` built notes)**; ~~tray + toasts; Settings;~~ ~~DB maintenance~~ **landed 2026-09-15 (P4 PR-7: the sweep is the Agent's over `SweepRetention`; integrity, backup and compaction in the App)**; ~~accessibility pass~~ **landed 2026-09-15 (P4 PR-8: `08_UI` §Accessibility written first — Ctrl+1…5, Esc on every dialog, an automation name on every textless input, theme colours only — each held by `AccessibilityTests`)**; ~~the scheduled task (`--install-task`)~~ (P3 PR-8b) and ~~the Velopack install hooks~~ **(PR-5: the uninstall hook; install registers nothing, by design — `12_BUILD` §The Vulkan layer is not registered at install time)**. *(The struck items moved to P3 on 2026-09-13 — see §P3.)*
|
||||
|
||||
## P5 — Ship (3–4 days)
|
||||
CI/CD with the native build (`release.yml` exists since P4 PR-5, 2026-09-14 — ~~untested by a tag yet~~ **ran on the first tag 2026-09-16** (`13_CI_CD` §release.yml: cancelled by a test hang once, green on the re-run); **rehearsable without one since 2026-09-16**, `13_CI_CD` §release.yml's dry run); CodeQL (C# + C++); Dependabot; CHANGELOG; README with the P0 accuracy comparison — **which is not a percentage, and this line used to send its author looking for one**. The decision is recorded under item 3 and in `spike-notes.md` §8: the baseline can answer **none** of item 4's four runtime questions, so the defensible claim is *"the baseline cannot answer four of these five questions at all"*, not *"N% more accurate"*. Overhead + tier cross-validation measurements; release smoke on clean VMs; ~~`v0.1.0-beta.1`~~ **tagged and published 2026-09-16** — eleven pre-releases through `0.1.0-beta.11` (2026-10-03), added 2026-10-04 — (pre-release, unsigned, `SHA256SUMS.txt` beside the assets). What P5 still owes: the clean-VM smoke (`14_TESTING` §Release smoke — Win 10 22H2 is unmeasured), the overhead run (`spike-notes` §14.3), and the README's accuracy comparison sentence.
|
||||
CI/CD with the native build (`release.yml` exists since P4 PR-5, 2026-09-14 — ~~untested by a tag yet~~ **ran on the first tag 2026-09-16** (`13_CI_CD` §release.yml: cancelled by a test hang once, green on the re-run); **rehearsable without one since 2026-09-16**, `13_CI_CD` §release.yml's dry run); CodeQL (C# + C++); Dependabot; CHANGELOG; README with the P0 accuracy comparison — **which is not a percentage, and this line used to send its author looking for one**. The decision is recorded under item 3 and in `spike-notes.md` §8: the baseline can answer **none** of item 4's four runtime questions, so the defensible claim is *"the baseline cannot answer four of these five questions at all"*, not *"N% more accurate"*. Overhead + tier cross-validation measurements; release smoke on clean VMs; ~~`v0.1.0-beta.1`~~ **tagged and published 2026-09-16** — ~~eleven pre-releases through `0.1.0-beta.11` (2026-10-03), added 2026-10-04~~ a pre-release at each step since, listed in the CHANGELOG *(corrected 2026-10-14: the count went stale at the next release)* — (pre-release, unsigned, `SHA256SUMS.txt` beside the assets). What P5 still owes: the clean-VM smoke (`14_TESTING` §Release smoke — Win 10 22H2 is unmeasured), the overhead run (`spike-notes` §14.3), and the README's accuracy comparison sentence.
|
||||
|
||||
**Total ≈ 5.5–6.5 weeks full-time** — roughly 1.5–2 weeks more than the ETW design, which is the honest price of the accuracy.
|
||||
|
||||
|
||||
+66
-1
@@ -2277,7 +2277,7 @@ Privacy Policy 2.10 — then the release.*
|
||||
|
||||
**Owner-only, added to the list below:** item 17.
|
||||
|
||||
## **START HERE** — 2026-10-13, 0.1.0-beta.22: a request the capture agent never answered
|
||||
## ~~**START HERE**~~ — 2026-10-13, 0.1.0-beta.22: a request the capture agent never answered *(struck 2026-10-14: the head is §beta.23 below)*
|
||||
|
||||
*Status is `CHANGELOG.md` `[0.1.0-beta.22]`; this is what no other file carries.* The owner, during the beta.21
|
||||
train: "Bạn xử lý chip thành 1 pr mới sau release và thành 1 phiên bản mới nhé" — the chip beta.21's review of Play
|
||||
@@ -2305,6 +2305,61 @@ hammering-writer guard, red on a correct ring) became beta.23 PR-1, #308: both c
|
||||
overlapped the writer (§Traps, the native-test entry). Merged for the next pre-release; no release, since nothing a
|
||||
user runs changed.
|
||||
|
||||
## **START HERE** — 2026-10-14, 0.1.0-beta.23: a game's artwork, pages that do not freeze, the documents that drifted
|
||||
|
||||
*Status is `CHANGELOG.md` `[0.1.0-beta.23]`; this is what no other file carries.* The owner, 2026-10-14: "Bạn phân tích
|
||||
và lên plan cho phần tiếp theo gồm những nội dung sau: 1. Thêm ảnh bìa/hero/cover của game từ các nền tảng đó - Đặt trong
|
||||
detail của game. (Nếu được); Tuỳ chọn: có thể sync màu cùa cover với màu của detail; 2. Cập nhật, sync docs; 3. Kiểm tra
|
||||
hiệu suất khi chuyển giữa các tab (nếu có vấn đề hiệu năng)" — then the whole train to the release without asking again.
|
||||
On top of #308 (PR-1): #309 (the pages, measured first), #310 (the artwork), #311 (the drift), then this release.
|
||||
|
||||
**Decisions:**
|
||||
|
||||
- **D60 — a game's artwork is what is already on the PC.** The image the user chose (*Edit… ▸ Choose image…*), else
|
||||
what the Steam or GOG GALAXY app keeps for the game it installed — found through the stores' own records as Play finds
|
||||
them (`StoreRecords.Owning`, never the row's platform alone). Nothing is downloaded: `privacy.online_metadata` stays
|
||||
reserved. A chosen image is a PNG copy, `<data>\covers\game-<id>-<unix ms>.png`, named relative in `cover_path`; only
|
||||
those names are followed — never a rooted, share or `..` path, never through a junction or a symbolic link, because a
|
||||
viewer's copy of a ledger may come from anywhere (D52).
|
||||
- **D61 — the band takes the artwork's colour as far as every text on it reads**: primary and secondary 4.5:1, tertiary
|
||||
3:1, the pills' and the warning's text 4.5:1 on their own fills; at most 30 % on the dark theme, 22 % on the light. On
|
||||
by default (the owner's choice); never in high contrast; it follows a theme switch by resource reference.
|
||||
- **The pages' speed was judged by a bar written before the first measurement** (`spike-notes` §21): fix what keeps the
|
||||
UI thread busy 50 ms or more, can block on I/O, or grows with each visit. Recorded, not fixed: page builds of 85–370 ms,
|
||||
and **the library grid (275 ms at 48 games) — non-virtualizing by the beta.11 decision; a virtualizing one changes the
|
||||
page's look, which is the owner's call** *(answered 2026-10-15: it stays as it is — §After the release below)*; no
|
||||
`sessions.started_at` index (a schema version locks out every earlier
|
||||
build, and nothing measured asked for it).
|
||||
- `LIST_GAME_TESTED`: the Everhex Demo row and the corrected Vulkan sentence, approved by the owner under D35.
|
||||
|
||||
**Traps met on the way:**
|
||||
|
||||
- **Microsoft.Data.Sqlite completes its "async" calls synchronously**: after a ledger read, `ConfigureAwait(false)` is
|
||||
still on the UI thread — the session decode, the sorts and the stutter detection all ran there (`16_WPFUI_SYNTAX`
|
||||
§Gotchas).
|
||||
- **A transient view model that is `IDisposable` lives until the App exits** (the root container keeps it), and every
|
||||
Dashboard ever opened stayed subscribed. FR-3.8's "Session saved" lived in that view model and reached every page only
|
||||
through the leak — it is `Services.SessionNotices` now.
|
||||
- **A `ui:Image` given a `Style` of its own that is not based on `DefaultImageStyle` has no template** and draws nothing
|
||||
in the place it takes. Only a render showed it; `AccessibilityTests.NoStyleOfAWpfUiControlLeavesOutItsTemplate`
|
||||
refuses it now.
|
||||
- **A page just navigated to is mid-fade**: a `RenderTargetBitmap` of it reads every colour washed out unless the
|
||||
presenter's `Transition` is `None`.
|
||||
- **The Bash tool's heredocs halve backslashes**: `covers\game-` became an invalid C# escape, and `\r\n` in a Python
|
||||
heredoc became real line breaks. Write such files with the editor tools.
|
||||
- **`Directory.Delete(…, recursive: true)` over a junction throws without elevation** (it asks Windows to unmount a
|
||||
volume, and the link is removed anyway): a test deletes its junction itself first.
|
||||
|
||||
**Owner-only, added to the list below:** item 19 — **passed 2026-10-15**.
|
||||
|
||||
**After the release (owner, 2026-10-15):** "Item 19 hiện đã đạt 100% yêu cầu. Phần chip sẽ đi kèm với phiên bản tiếp
|
||||
theo. Bạn có thể cập nhật và đóng phiên, thư viện vẫn giữ như cũ." — item 19 passed; the chip the release tree's local
|
||||
gate left goes with the next pre-release (`fl_guard`'s native-log test, red under load: after the stop, the last
|
||||
`UNHOOK_RESTORED` lines were not in the file within its 10-second wait — known since beta.9, and no native code changed
|
||||
in beta.23; green on the re-run); and **the library grid stays as it is**: the beta.11 decision
|
||||
(`Controls/UniformWrapPanel`, non-virtualizing — cards an equal share of the width, each row as tall as its tallest
|
||||
card) holds, at 275 ms for 48 games (`spike-notes` §21). Recorded with no release: nothing a user runs changed.
|
||||
|
||||
## Owner-only — no PR can close these
|
||||
|
||||
1. **§S23-2 — branch protection.** `Rules / validate` is not a required status check on
|
||||
@@ -2440,6 +2495,16 @@ user runs changed.
|
||||
string marked `review` (`Agent_Unanswered`). (b) Nothing else to run: the change answers a request the agent drops
|
||||
mid-way, which the tests make happen and a person can only meet by chance — if a notice ever says the capture agent
|
||||
did not answer, the page beside it shows what was stored.
|
||||
19. ~~**beta.23 on real hardware.**~~ **Passed 2026-10-15** — the owner: "Item 19 hiện đã đạt 100% yêu cầu" (the item
|
||||
met every requirement). *(The item as written:)* (a) **Artwork:** open the page of a Steam game (one on the D: drive)
|
||||
and of a GOG game — the banner, the cover beside the name, the band's colour; an itch game shows none. With a page
|
||||
open, switch Dark → Light → Dark: the band changes with the theme and every text on it stays readable. (b) **Your own
|
||||
image:** *Edit… ▸ Choose image…* then Save — the page shows it; *Edit… ▸ Use the store's image* — the store's again;
|
||||
choosing an image and pressing Cancel leaves nothing new in `%LOCALAPPDATA%\FrameLedger\covers`. (c) **Settings ▸
|
||||
Games:** *Show game artwork* and *Colour the game page from its artwork* off, then on. (d) **Speed:** open WALTO's
|
||||
page and choose its longest session, switch the page's tabs; visit the Dashboard a few times, then end a session —
|
||||
one "Session saved". (e) The Privacy Policy 2.11 is shown once after the update. (f) The `ja` strings marked
|
||||
`review`.
|
||||
|
||||
**Answered 2026-08-05, do not re-ask:** remove `gameguard` and keep `guard` (approved
|
||||
over a red `Rules` gate, with the reasoning recorded in the merge commit); vendor NVAPI
|
||||
|
||||
@@ -9,8 +9,9 @@ the owner's review; sessions since 2026-09-27, and the game-memory figures beta.
|
||||
|
||||
**The machine.** Every row below was run on one PC: an NVIDIA GeForce RTX 5080 (the only graphics card), an Intel Core
|
||||
i7-14700KF, 32 GB of DDR5, Windows 11 (Insider builds 26300 → 29648) and a 2560×1440, 240 Hz monitor. **No AMD or Intel
|
||||
graphics card and no second machine has been tested**, and **no real Vulkan or OpenGL game has been measured** — every
|
||||
measurement below is Direct3D 11 or 12. What the tiers mean and what FrameLedger cannot do: [LIMITATIONS.md](../LIMITATIONS.md).
|
||||
graphics card and no second machine has been tested**, and ~~**no real Vulkan or OpenGL game has been measured** — every
|
||||
measurement below is Direct3D 11 or 12~~ **one real Vulkan game has been measured (Everhex Demo, 2026-10-13) and no
|
||||
OpenGL game** — every other measurement below is Direct3D 11 or 12 *(corrected 2026-10-14)*. What the tiers mean and what FrameLedger cannot do: [LIMITATIONS.md](../LIMITATIONS.md).
|
||||
|
||||
**Two periods.** From 2026-08-03 to 2026-09-06 the games were measured with the developer's capture tool, one run at a
|
||||
time against the game's own settings menu (reports in [spike-notes.md](spike-notes.md)). From 2026-09-16 the shipped
|
||||
@@ -43,6 +44,7 @@ with the 2026-09-16 recovery and with library entries removed since.
|
||||
| 恋しかるべき (KOISHIKARUBEKI) | Unity 6000.3 | D3D11 | Presented 59.6 FPS | 2026-09-03 | [spike-notes §9](spike-notes.md) |
|
||||
| Flower in Us | RPG Maker MV/MZ (NW.js) | D3D11 | Presented 59.8 FPS over three swap chains, after two refusals that found the game's browser process ambiguous (fixed) | 2026-09-03 → 09-04 | [spike-notes §9](spike-notes.md) |
|
||||
| UMIGARI | Unreal Engine 5.5.4 | D3D12 | Presented 95–97 FPS, frame generation *none*, ray tracing *No* | 2026-09-05 → 09-06 | run reports only |
|
||||
| Everhex Demo | — | Vulkan | Presented 239.7 FPS (1 % low 213.5), 14,955 frames in 69 s, through FrameLedger's Vulkan layer — the first real Vulkan game measured; started by Play set to *Start directly* | 2026-10-13 | database *(row added 2026-10-14 from a copy of the database)* |
|
||||
|
||||
## Recorded without measurement (Tier 2)
|
||||
|
||||
|
||||
+2
-1
@@ -2810,6 +2810,7 @@ visual on this PC — and the remaining cost of the game page is its grid's rows
|
||||
one that grows with the data: 275 ms at 48 games, about 5.7 ms a card, so about 0.6 s at 100. Its grid is a
|
||||
non-virtualizing panel by decision (beta.11, `Controls/UniformWrapPanel`: cards an equal share of the width, each row as
|
||||
tall as its tallest card); a virtualizing one builds only the cards on screen but makes every card one height and the
|
||||
grid scroll under a fixed header — a change to how the page looks, offered to the owner instead of made here. Nor was a
|
||||
grid scroll under a fixed header — a change to how the page looks, offered to the owner instead of made here. *(The
|
||||
owner's answer, 2026-10-15: the library stays as it is.)* Nor was a
|
||||
schema migration added for an index on `sessions.started_at` (the Dashboard sorts the table): at the owner's 41 sessions
|
||||
it costs nothing measurable, and a new schema version locks the ledger out of every earlier build.
|
||||
+1
-1
@@ -12,7 +12,7 @@
|
||||
HTML comments are not part of the block.
|
||||
-->
|
||||
> ⚠ **What FrameLedger actually measures today — 2026-10-13.** The software is a beta; its latest
|
||||
> **pre-release is `0.1.0-beta.22`** (2026-10-13), an unsigned installer built from that tag with its
|
||||
> **pre-release is `0.1.0-beta.23`** (2026-10-14), an unsigned installer built from that tag with its
|
||||
> checksums published beside it. The source holds the desktop app
|
||||
> (library, store import, charts, settings) and the background Agent, which records a session when a
|
||||
> game in the library runs (unless you switched its recording off), injects only into games you enabled
|
||||
|
||||
+1
-1
@@ -114,7 +114,7 @@ Frame timing is derived from high-resolution timestamps taken at the moment the
|
||||
|
||||
<!-- accuracy-block:begin -->
|
||||
> ⚠ **What FrameLedger actually measures today — 2026-10-13.** The software is a beta; its latest
|
||||
> **pre-release is `0.1.0-beta.22`** (2026-10-13), an unsigned installer built from that tag with its
|
||||
> **pre-release is `0.1.0-beta.23`** (2026-10-14), an unsigned installer built from that tag with its
|
||||
> checksums published beside it. The source holds the desktop app
|
||||
> (library, store import, charts, settings) and the background Agent, which records a session when a
|
||||
> game in the library runs (unless you switched its recording off), injects only into games you enabled
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
|
||||
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
|
||||
namespace FrameLedger.App.Services;
|
||||
|
||||
/// <summary>
|
||||
/// Opens a folder, or a file selected in its folder, in Windows Explorer — the one way the App does it (beta.24 PR-2).
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>
|
||||
/// <b>Started by its full path in the Windows folder, never by a name the <c>PATH</c> resolves</b> (SonarCloud
|
||||
/// <c>csharpsquid:S4036</c>): five places started <c>"explorer.exe"</c> by name, so a program of that name earlier on
|
||||
/// the search path would have been run in its place.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// <b>The path is always quoted</b>, as two of the five already did: a bare one leaves Explorer to guess where it ends,
|
||||
/// and its command line is a list of comma-separated switches. A trailing separator is dropped first, because
|
||||
/// <c>\"</c> would read as an escaped quote.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
internal static class Explorer
|
||||
{
|
||||
/// <summary><c>%WINDIR%\explorer.exe</c>.</summary>
|
||||
public static string ExecutablePath => Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Windows), "explorer.exe");
|
||||
|
||||
/// <summary>Explorer's arguments that open <paramref name="folder"/>.</summary>
|
||||
public static string FolderArguments(string folder)
|
||||
{
|
||||
ArgumentException.ThrowIfNullOrWhiteSpace(folder);
|
||||
return Quote(folder);
|
||||
}
|
||||
|
||||
/// <summary>Explorer's arguments that open the folder <paramref name="file"/> is in, with it selected.</summary>
|
||||
public static string SelectArguments(string file)
|
||||
{
|
||||
ArgumentException.ThrowIfNullOrWhiteSpace(file);
|
||||
return "/select," + Quote(file);
|
||||
}
|
||||
|
||||
/// <summary>Opens <paramref name="folder"/>; throws what <see cref="Process.Start(ProcessStartInfo)"/> throws.</summary>
|
||||
public static void OpenFolder(string folder) => Start(FolderArguments(folder));
|
||||
|
||||
/// <summary>Opens the folder <paramref name="file"/> is in, with it selected; throws what <see cref="Process.Start(ProcessStartInfo)"/> throws.</summary>
|
||||
public static void ShowFile(string file) => Start(SelectArguments(file));
|
||||
|
||||
private static void Start(string arguments)
|
||||
{
|
||||
using Process? _ = Process.Start(new ProcessStartInfo(ExecutablePath, arguments) { UseShellExecute = true });
|
||||
}
|
||||
|
||||
private static string Quote(string path) => "\"" + Path.TrimEndingDirectorySeparator(path.Trim('"')) + "\"";
|
||||
}
|
||||
@@ -2,7 +2,6 @@
|
||||
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
|
||||
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Globalization;
|
||||
using System.Windows;
|
||||
@@ -26,7 +25,7 @@ internal static class StartupFailureDialog
|
||||
|
||||
try
|
||||
{
|
||||
using Process? _ = Process.Start(new ProcessStartInfo("explorer.exe", logsDirectory) { UseShellExecute = true });
|
||||
Explorer.OpenFolder(logsDirectory);
|
||||
}
|
||||
catch (Exception ex) when (ex is Win32Exception or InvalidOperationException)
|
||||
{
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
|
||||
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Globalization;
|
||||
using CommunityToolkit.Mvvm.Input;
|
||||
@@ -36,7 +35,7 @@ public sealed partial class BugReportPreviewViewModel
|
||||
{
|
||||
try
|
||||
{
|
||||
using Process? _ = Process.Start(new ProcessStartInfo("explorer.exe", "/select,\"" + _model.ZipPath + "\"") { UseShellExecute = true });
|
||||
Explorer.ShowFile(_model.ZipPath);
|
||||
}
|
||||
catch (Exception ex) when (ex is Win32Exception or InvalidOperationException)
|
||||
{
|
||||
|
||||
@@ -80,6 +80,7 @@ public sealed partial class FirstRunViewModel : ObservableObject, IDisposable
|
||||
public IUrlOpener Urls => _urls;
|
||||
|
||||
/// <summary>True when the user accepted (and the rows are written), false when they declined or closed the window.</summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "VSTHRD003:Avoid awaiting foreign Tasks", Justification = "the task of this view model's own TaskCompletionSource, completed by the window's buttons on the dispatcher; FirstRunFlow awaits it for the user's answer, and RunContinuationsAsynchronously keeps the completion from running the waiter inline (VS Threading Analyzers 18.12 flag it; Dependabot #314)")]
|
||||
public Task<bool> Outcome => _outcome.Task;
|
||||
|
||||
public bool IsLegalStep => Step == LegalStep;
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
|
||||
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
@@ -120,7 +119,7 @@ public sealed partial class LogsViewModel : ObservableObject
|
||||
{
|
||||
try
|
||||
{
|
||||
using Process? _ = Process.Start(new ProcessStartInfo("explorer.exe", UiPaths.Logs) { UseShellExecute = true });
|
||||
Explorer.OpenFolder(UiPaths.Logs);
|
||||
}
|
||||
catch (Exception ex) when (ex is Win32Exception or InvalidOperationException)
|
||||
{
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
|
||||
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Globalization;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
@@ -191,7 +190,7 @@ public sealed partial class MainWindowViewModel : ObservableObject, IDisposable,
|
||||
{
|
||||
try
|
||||
{
|
||||
using Process? _ = Process.Start(new ProcessStartInfo("explorer.exe", UiPaths.DataDirectory) { UseShellExecute = true });
|
||||
Explorer.OpenFolder(UiPaths.DataDirectory);
|
||||
}
|
||||
catch (Exception ex) when (ex is Win32Exception or InvalidOperationException)
|
||||
{
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
|
||||
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
@@ -81,7 +80,7 @@ public partial class AboutWindow : FluentWindow
|
||||
|
||||
try
|
||||
{
|
||||
using Process? _ = Process.Start(new ProcessStartInfo("explorer.exe", "\"" + LicencesFolder + "\"") { UseShellExecute = true });
|
||||
Explorer.OpenFolder(LicencesFolder);
|
||||
}
|
||||
catch (Exception ex) when (ex is Win32Exception or InvalidOperationException)
|
||||
{
|
||||
|
||||
@@ -343,7 +343,10 @@ public sealed class CaptureOrchestrator
|
||||
_log($"election: pid {elected.Value.Pid} ({path}) is the newest tracked descendant; attaching");
|
||||
if (current is not null && current.SessionGuid == launched.SessionGuid)
|
||||
{
|
||||
session = _recorder.RecordAsync(Attach(path, row?.Name, null, default), ct);
|
||||
// No stop token: this session runs under the launch's own entry and StopSession cannot address it
|
||||
// (its summary above). CancellationToken.None says so: ct, the host's shutdown, is the recording's own
|
||||
// token (RecordAsync's second argument), and as the stop token it would turn a shutdown into a user stop.
|
||||
session = _recorder.RecordAsync(Attach(path, row?.Name, null, CancellationToken.None), ct);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -60,24 +60,12 @@ public sealed class ProcessLauncher : IProcessLauncher
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public (int Pid, ITargetLiveness Alive)? Start(string exePath, string arguments) => Start(exePath, arguments, _environment, _enableVulkanLayer);
|
||||
public (int Pid, ITargetLiveness Alive)? Start(string exePath, string arguments) => StartCore(exePath, arguments, _environment, _enableVulkanLayer, out _);
|
||||
|
||||
/// <inheritdoc />
|
||||
public (int Pid, ITargetLiveness Alive)? Start(string exePath, string arguments, out int? win32Error) =>
|
||||
StartCore(exePath, arguments, _environment, _enableVulkanLayer, out win32Error);
|
||||
|
||||
/// <summary>Start <paramref name="exePath"/> with <paramref name="arguments"/>; null when it could not be started or pinned.</summary>
|
||||
/// <param name="exePath">The consented executable.</param>
|
||||
/// <param name="arguments">Its own command line, verbatim.</param>
|
||||
/// <param name="environment">
|
||||
/// Variables added to the child's environment — the Vulkan layer's, from
|
||||
/// <c>VkLayerLaunchEnvironment</c>, when the layer is staged beside this host (P1 item 3).
|
||||
/// </param>
|
||||
/// <param name="enableVulkanLayer">False leaves <see cref="VkLayerLaunchEnvironment.EnableVariable"/> unset (the kill switch, decision D7).</param>
|
||||
public static (int Pid, ITargetLiveness Alive)? Start(string exePath, string arguments,
|
||||
IReadOnlyDictionary<string, string>? environment = null, bool enableVulkanLayer = true) =>
|
||||
StartCore(exePath, arguments, environment, enableVulkanLayer, out _);
|
||||
|
||||
/// <summary>The start, keeping the Win32 error of one that failed (beta.8: it was swallowed, and the user read only "could not start").</summary>
|
||||
private static (int Pid, ITargetLiveness Alive)? StartCore(string exePath, string arguments,
|
||||
IReadOnlyDictionary<string, string>? environment, bool enableVulkanLayer, out int? error)
|
||||
|
||||
@@ -93,7 +93,7 @@ public sealed class PipeServer : IIpcEventPublisher, IDisposable
|
||||
public async Task RunAsync(CancellationToken ct)
|
||||
{
|
||||
var failures = new AcceptFailures(_log);
|
||||
while (true)
|
||||
while (!ct.IsCancellationRequested)
|
||||
{
|
||||
await _slots.WaitAsync(ct).ConfigureAwait(false);
|
||||
NamedPipeServerStream? stream = null;
|
||||
@@ -123,6 +123,10 @@ public sealed class PipeServer : IIpcEventPublisher, IDisposable
|
||||
_clients[id] = client;
|
||||
client.Start(ct);
|
||||
}
|
||||
|
||||
// The loop's only way out is cancellation, and the task ends cancelled as it did when the wait threw
|
||||
// (SonarCloud csharpsquid:S2190 read the old while (true) as a loop that never ends).
|
||||
ct.ThrowIfCancellationRequested();
|
||||
}
|
||||
|
||||
public void Publish<T>(string type, T payload)
|
||||
|
||||
@@ -88,7 +88,8 @@ std::int32_t FlGuardRulesFilePath(wchar_t* out, std::int32_t cap) {
|
||||
out[0] = L'\0'; // never hand back a partial path: it names a different file
|
||||
return 0;
|
||||
}
|
||||
return static_cast<std::int32_t>(wcslen(out));
|
||||
// Bounded by the caller's buffer, never only by the terminator (SonarCloud cpp:S5813, beta.24).
|
||||
return static_cast<std::int32_t>(wcsnlen(out, static_cast<std::size_t>(cap)));
|
||||
}
|
||||
|
||||
std::int32_t FlGuardBuildId(char* out, std::int32_t cap) {
|
||||
|
||||
@@ -326,7 +326,9 @@ FL_NV_API int32_t FlNvDriverVersion(uint32_t* version, char* branch, uint32_t br
|
||||
}
|
||||
*version = v;
|
||||
if (branch != nullptr && branchCapacity > 0u) {
|
||||
const size_t n = std::strlen(b);
|
||||
// Bounded by the buffer, not by the terminator: the string is the driver's, and a driver that filled all
|
||||
// NVAPI_SHORT_STRING_MAX bytes without one must not send this read past it (SonarCloud cpp:S5813, beta.24).
|
||||
const size_t n = strnlen(b, sizeof(b));
|
||||
const size_t copy = n < branchCapacity - 1u ? n : branchCapacity - 1u;
|
||||
std::memcpy(branch, b, copy);
|
||||
branch[copy] = '\0';
|
||||
|
||||
@@ -278,9 +278,9 @@ constexpr bool SameA(const char* a, const char* b) noexcept {
|
||||
}
|
||||
|
||||
// Which leaf slot a row's module is, exactly as spelled in the table. -1 if none.
|
||||
constexpr int FfxLeafOfExact(const wchar_t* module) noexcept {
|
||||
constexpr int FfxLeafOfExact(const wchar_t* moduleName) noexcept {
|
||||
for (uint32_t i = 0; i < kFfxLeafCount; ++i) {
|
||||
if (SameW(module, kFfxLeafModules[i])) {
|
||||
if (SameW(moduleName, kFfxLeafModules[i])) {
|
||||
return static_cast<int>(i);
|
||||
}
|
||||
}
|
||||
@@ -289,12 +289,12 @@ constexpr int FfxLeafOfExact(const wchar_t* module) noexcept {
|
||||
|
||||
// The runtime twin: the loader is case-insensitive about module names, so this is
|
||||
// too. dllmain's installer indexes its per-leaf storage with the result.
|
||||
inline int FfxLeafOf(const wchar_t* module) noexcept {
|
||||
if (module == nullptr) {
|
||||
inline int FfxLeafOf(const wchar_t* moduleName) noexcept {
|
||||
if (moduleName == nullptr) {
|
||||
return -1;
|
||||
}
|
||||
for (uint32_t i = 0; i < kFfxLeafCount; ++i) {
|
||||
if (_wcsicmp(module, kFfxLeafModules[i]) == 0) {
|
||||
if (_wcsicmp(moduleName, kFfxLeafModules[i]) == 0) {
|
||||
return static_cast<int>(i);
|
||||
}
|
||||
}
|
||||
@@ -353,9 +353,9 @@ inline constexpr const wchar_t* kModuleSlInterposer = L"sl.interposer.dll";
|
||||
inline constexpr const char* kSymbolSlSetTag = "slSetTag";
|
||||
inline constexpr const char* kSymbolSlSetTagForFrame = "slSetTagForFrame";
|
||||
|
||||
constexpr bool InventoryHasRow(const wchar_t* module, const char* symbol) noexcept {
|
||||
constexpr bool InventoryHasRow(const wchar_t* moduleName, const char* symbol) noexcept {
|
||||
#define FL_ROW_HAS(mod, sym, family) \
|
||||
if (SameW(mod, module) && SameA(sym, symbol)) { \
|
||||
if (SameW(mod, moduleName) && SameA(sym, symbol)) { \
|
||||
return true; \
|
||||
}
|
||||
FL_HOOK_INVENTORY(FL_ROW_HAS)
|
||||
@@ -374,9 +374,9 @@ static_assert(InventoryHasRow(kModuleFfxFsr3Host, kSymbolFfxFsr3DispatchUpscale)
|
||||
// without a leaf would resolve, reach InstallByFamily, and find no slot -- and the
|
||||
// installer's answer to that is to install nothing, silently, which is the shape
|
||||
// this whole file exists to make loud.
|
||||
constexpr bool FfxDispatchRowExistsFor(const wchar_t* module) noexcept {
|
||||
constexpr bool FfxDispatchRowExistsFor(const wchar_t* moduleName) noexcept {
|
||||
#define FL_FFX_ROW_FOR(mod, sym, family) \
|
||||
if (SameW(mod, module) && SameA(sym, "ffxDispatch")) { \
|
||||
if (SameW(mod, moduleName) && SameA(sym, "ffxDispatch")) { \
|
||||
return true; \
|
||||
}
|
||||
FL_HOOK_INVENTORY(FL_FFX_ROW_FOR)
|
||||
@@ -392,9 +392,9 @@ constexpr bool EveryFfxDispatchRowIsALeaf() noexcept {
|
||||
#undef FL_FFX_ROW_IS_LEAF
|
||||
return true;
|
||||
}
|
||||
constexpr bool AnyRowNames(const wchar_t* module) noexcept {
|
||||
constexpr bool AnyRowNames(const wchar_t* moduleName) noexcept {
|
||||
#define FL_ANY_ROW_NAMES(mod, sym, family) \
|
||||
if (SameW(mod, module)) { \
|
||||
if (SameW(mod, moduleName)) { \
|
||||
return true; \
|
||||
}
|
||||
FL_HOOK_INVENTORY(FL_ANY_ROW_NAMES)
|
||||
@@ -511,20 +511,20 @@ inline bool SpeaksFsr3Host(HMODULE h) noexcept {
|
||||
GetProcAddress(h, "ffxFsr3SkipPresent") != nullptr;
|
||||
}
|
||||
|
||||
inline bool SpeaksExpectedAbi(const wchar_t* module, HMODULE h) noexcept {
|
||||
if (module == nullptr) {
|
||||
inline bool SpeaksExpectedAbi(const wchar_t* moduleName, HMODULE h) noexcept {
|
||||
if (moduleName == nullptr) {
|
||||
return false;
|
||||
}
|
||||
if (_wcsicmp(module, L"sl.interposer.dll") == 0) {
|
||||
if (_wcsicmp(moduleName, L"sl.interposer.dll") == 0) {
|
||||
return SpeaksStreamline2(h);
|
||||
}
|
||||
if (_wcsicmp(module, kModuleFfxFsr3Host) == 0) {
|
||||
if (_wcsicmp(moduleName, kModuleFfxFsr3Host) == 0) {
|
||||
return SpeaksFsr3Host(h);
|
||||
}
|
||||
// THE AMD ARM, by leaf name, for the same reason the Streamline arm is by name:
|
||||
// the loader also exports all five and is not a leaf, so a prefix test would
|
||||
// approve a module the inventory deliberately does not hook.
|
||||
if (FfxLeafOf(module) >= 0) {
|
||||
if (FfxLeafOf(moduleName) >= 0) {
|
||||
return SpeaksFfxApi(h);
|
||||
}
|
||||
return true;
|
||||
@@ -549,19 +549,19 @@ inline bool SpeaksExpectedAbi(const wchar_t* module, HMODULE h) noexcept {
|
||||
// would do the same thing irreversibly; a plain reference is the smaller claim.
|
||||
//
|
||||
// Allocation-free and syscall-cheap: two documented calls, no enumeration.
|
||||
inline void* ResolveScoped(const wchar_t* module, const char* symbol) noexcept {
|
||||
if (module == nullptr || symbol == nullptr) {
|
||||
inline void* ResolveScoped(const wchar_t* moduleName, const char* symbol) noexcept {
|
||||
if (moduleName == nullptr || symbol == nullptr) {
|
||||
return nullptr;
|
||||
}
|
||||
HMODULE h = nullptr;
|
||||
if (!GetModuleHandleExW(0, module, &h) || h == nullptr) {
|
||||
if (!GetModuleHandleExW(0, moduleName, &h) || h == nullptr) {
|
||||
return nullptr; // the game has not loaded it; that is an answer, not a failure
|
||||
}
|
||||
// A module of the right NAME whose ABI is not ours is the same answer as no
|
||||
// module: we cannot read its arguments, so we do not hook it. See
|
||||
// SpeaksExpectedAbi -- this is the Witcher 3 case, and refusing here is what
|
||||
// keeps a wrong upscaler name out of the record.
|
||||
if (!SpeaksExpectedAbi(module, h)) {
|
||||
if (!SpeaksExpectedAbi(moduleName, h)) {
|
||||
return nullptr;
|
||||
}
|
||||
return reinterpret_cast<void*>(GetProcAddress(h, symbol));
|
||||
@@ -606,9 +606,9 @@ inline void* ResolveScoped(const wchar_t* module, const char* symbol) noexcept {
|
||||
// Is a module of this name in the process right now? UNCHANGED_REFCOUNT, unlike
|
||||
// ResolveScoped: the census patches nothing, so it has no reason to keep the
|
||||
// module alive and takes the smaller claim. Allocation-free, one documented call.
|
||||
inline bool IsModuleLoaded(const wchar_t* module) noexcept {
|
||||
inline bool IsModuleLoaded(const wchar_t* moduleName) noexcept {
|
||||
HMODULE h = nullptr;
|
||||
return GetModuleHandleExW(GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, module, &h) && h != nullptr;
|
||||
return GetModuleHandleExW(GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, moduleName, &h) && h != nullptr;
|
||||
}
|
||||
|
||||
// One census pass. Always carries FL_CENSUS_RAN, so a word without it means the
|
||||
|
||||
@@ -1990,9 +1990,9 @@ void PublishSlTagCensus() noexcept {
|
||||
// that is not there is the ordinary case, a mapped module without the export is
|
||||
// the one a bug report needs to say.
|
||||
const char* g_symbolMissingSeen[16]{};
|
||||
void NoteSymbolMissingOnce(const wchar_t* module, const char* symbol) noexcept {
|
||||
void NoteSymbolMissingOnce(const wchar_t* moduleName, const char* symbol) noexcept {
|
||||
HMODULE h = nullptr;
|
||||
if (!GetModuleHandleExW(GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, module, &h) || h == nullptr) {
|
||||
if (!GetModuleHandleExW(GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, moduleName, &h) || h == nullptr) {
|
||||
return;
|
||||
}
|
||||
for (const char*& seen : g_symbolMissingSeen) {
|
||||
@@ -2007,18 +2007,18 @@ void NoteSymbolMissingOnce(const wchar_t* module, const char* symbol) noe
|
||||
}
|
||||
}
|
||||
|
||||
bool InstallRow(const wchar_t* module, const char* symbol, uint32_t family, void* detour, void** original,
|
||||
bool InstallRow(const wchar_t* moduleName, const char* symbol, uint32_t family, void* detour, void** original,
|
||||
std::atomic<uint32_t>& live) noexcept {
|
||||
if (live.load(std::memory_order_acquire) != 0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
void* target = fl::inventory::ResolveScoped(module, symbol);
|
||||
void* target = fl::inventory::ResolveScoped(moduleName, symbol);
|
||||
if (target == nullptr) {
|
||||
// The game has not loaded Streamline, or loaded a generation whose ABI we
|
||||
// do not speak (#71). An answer, not a failure -- logged once when the
|
||||
// module IS there and the symbol is not, which is the shape worth reading.
|
||||
NoteSymbolMissingOnce(module, symbol);
|
||||
NoteSymbolMissingOnce(moduleName, symbol);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -2036,13 +2036,13 @@ bool InstallRow(const wchar_t* module, const char* symbol, uint32_t family, void
|
||||
// is the safe direction: an unbound row is a table entry somebody added without
|
||||
// writing its hook, and hooking it with a neighbour's body is exactly what this
|
||||
// function exists to stop.
|
||||
bool InstallByFamily(const wchar_t* module, const char* symbol, uint32_t family) noexcept {
|
||||
bool InstallByFamily(const wchar_t* moduleName, const char* symbol, uint32_t family) noexcept {
|
||||
// EQUALITY AGAINST THE COMPOUND CONSTANT, not `& FL_HOOK_UPSCALER_IDENTITY`. A
|
||||
// bit test would bind any future row that happens to include identity to THIS
|
||||
// detour -- which is the neighbour's-body defect this function exists to stop,
|
||||
// and it would arrive silently because the row would still install.
|
||||
if (family == fl::inventory::kFamilyEvaluateFeature) {
|
||||
return InstallRow(module, symbol, family, reinterpret_cast<void*>(&Hook_SlEvaluateFeature),
|
||||
return InstallRow(moduleName, symbol, family, reinterpret_cast<void*>(&Hook_SlEvaluateFeature),
|
||||
reinterpret_cast<void**>(&g_origSlEvaluateFeature), g_upscalerIdentityLive);
|
||||
}
|
||||
if (family == static_cast<uint32_t>(fl::FL_HOOK_UPSCALER_PARAMS)) {
|
||||
@@ -2060,7 +2060,7 @@ bool InstallByFamily(const wchar_t* module, const char* symbol, uint32_t family)
|
||||
if (patched.load(std::memory_order_acquire) != 0) {
|
||||
return true;
|
||||
}
|
||||
void* target = fl::inventory::ResolveScoped(module, symbol);
|
||||
void* target = fl::inventory::ResolveScoped(moduleName, symbol);
|
||||
if (target == nullptr) {
|
||||
return false; // not loaded, a generation without this export, or an ABI we do not speak
|
||||
}
|
||||
@@ -2075,7 +2075,7 @@ bool InstallByFamily(const wchar_t* module, const char* symbol, uint32_t family)
|
||||
return true;
|
||||
}
|
||||
if (family == static_cast<uint32_t>(fl::FL_HOOK_FG_EVALUATIONS)) {
|
||||
return InstallRow(module, symbol, family, reinterpret_cast<void*>(&Hook_SlGetNewFrameToken),
|
||||
return InstallRow(moduleName, symbol, family, reinterpret_cast<void*>(&Hook_SlGetNewFrameToken),
|
||||
reinterpret_cast<void**>(&g_origSlGetNewFrameToken), g_frameTokensLive);
|
||||
}
|
||||
if (family == fl::inventory::kFamilyFfxDispatch) {
|
||||
@@ -2096,15 +2096,15 @@ bool InstallByFamily(const wchar_t* module, const char* symbol, uint32_t family)
|
||||
// nothing: fl_hook_inventory.h's static_asserts make the latter unreachable for
|
||||
// the rows as written, and installing nothing is the safe direction for a row
|
||||
// somebody adds later.
|
||||
const int leaf = fl::inventory::FfxLeafOf(module);
|
||||
const int leaf = fl::inventory::FfxLeafOf(moduleName);
|
||||
if (leaf < 0) {
|
||||
if (_wcsicmp(module, fl::inventory::kModuleFfxFsr3Host) != 0) {
|
||||
if (_wcsicmp(moduleName, fl::inventory::kModuleFfxFsr3Host) != 0) {
|
||||
return false;
|
||||
}
|
||||
if (g_fsr3HostPatched.load(std::memory_order_acquire) != 0) {
|
||||
return true;
|
||||
}
|
||||
void* target = fl::inventory::ResolveScoped(module, symbol);
|
||||
void* target = fl::inventory::ResolveScoped(moduleName, symbol);
|
||||
if (target == nullptr) {
|
||||
return false; // not loaded, or a module of the name that does not speak the 3.0 host ABI
|
||||
}
|
||||
@@ -2119,7 +2119,7 @@ bool InstallByFamily(const wchar_t* module, const char* symbol, uint32_t family)
|
||||
if (g_ffxPatched[slot].load(std::memory_order_acquire) != 0) {
|
||||
return true;
|
||||
}
|
||||
void* target = fl::inventory::ResolveScoped(module, symbol);
|
||||
void* target = fl::inventory::ResolveScoped(moduleName, symbol);
|
||||
if (target == nullptr) {
|
||||
return false; // not loaded, or a module of the name that does not speak ffx-api
|
||||
}
|
||||
@@ -3386,12 +3386,12 @@ __declspec(dllexport) void FlRequestUnhook() {
|
||||
|
||||
} // extern "C"
|
||||
|
||||
BOOL APIENTRY DllMain(HMODULE module, DWORD reason, LPVOID) {
|
||||
BOOL APIENTRY DllMain(HMODULE self, DWORD reason, LPVOID) {
|
||||
if (reason == DLL_PROCESS_ATTACH) {
|
||||
// ONLY these two calls. Everything else -- mapping creation, MinHook,
|
||||
// dummy-device creation, hook installation -- happens on the init thread,
|
||||
// outside the loader lock.
|
||||
DisableThreadLibraryCalls(module);
|
||||
DisableThreadLibraryCalls(self);
|
||||
g_initThread = CreateThread(nullptr, 0, InitThread, nullptr, 0, nullptr);
|
||||
}
|
||||
// No DLL_PROCESS_DETACH teardown: 17_HOOK_ENGINE §Unhooking is explicit that
|
||||
|
||||
@@ -53,8 +53,10 @@ using TargetFn = int(__stdcall*)(int);
|
||||
// function body with enough bytes to patch.
|
||||
__declspec(noinline) int __stdcall TargetFunction(int x) {
|
||||
volatile int acc = x;
|
||||
acc += 1;
|
||||
acc *= 2;
|
||||
// Plain assignments, not += / *=: a compound assignment to a volatile is deprecated in C++20 (SonarCloud
|
||||
// cpp:S6191, beta.24). Same loads and stores, so the body MinHook patches is unchanged in kind.
|
||||
acc = acc + 1;
|
||||
acc = acc * 2;
|
||||
return acc;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
|
||||
|
||||
using System.IO;
|
||||
using FluentAssertions;
|
||||
using FrameLedger.App.Services;
|
||||
|
||||
namespace FrameLedger.App.Tests;
|
||||
|
||||
/// <summary>
|
||||
/// Explorer is started by its full path and handed a quoted path (beta.24 PR-2, SonarCloud <c>csharpsquid:S4036</c>):
|
||||
/// never a name the search path resolves, never a path Explorer has to guess the end of. Nothing here starts it.
|
||||
/// </summary>
|
||||
public sealed class ExplorerTests
|
||||
{
|
||||
[Fact]
|
||||
public void ItIsTheOneInTheWindowsFolder()
|
||||
{
|
||||
string windows = Environment.GetFolderPath(Environment.SpecialFolder.Windows);
|
||||
|
||||
Explorer.ExecutablePath.Should().Be(Path.Combine(windows, "explorer.exe"));
|
||||
Path.IsPathRooted(Explorer.ExecutablePath).Should().BeTrue("a bare name would be resolved through PATH");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void AFolderIsQuotedWhateverItHoldsAndLosesItsTrailingSeparator()
|
||||
{
|
||||
Explorer.FolderArguments(@"C:\Users\Ann Lee\AppData\Local\FrameLedger\logs")
|
||||
.Should().Be("\"C:\\Users\\Ann Lee\\AppData\\Local\\FrameLedger\\logs\"");
|
||||
Explorer.FolderArguments(@"D:\Games\Dying Light, The Beast\")
|
||||
.Should().Be("\"D:\\Games\\Dying Light, The Beast\"", "a trailing \\ before the closing quote would escape it");
|
||||
Explorer.FolderArguments("\"C:\\already quoted\"").Should().Be("\"C:\\already quoted\"", "a quoted path is not quoted twice");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void AFileIsSelectedInItsFolder() =>
|
||||
Explorer.SelectArguments(@"C:\Users\Ann Lee\Desktop\frameledger-bug.zip")
|
||||
.Should().Be("/select,\"C:\\Users\\Ann Lee\\Desktop\\frameledger-bug.zip\"");
|
||||
|
||||
[Theory]
|
||||
[InlineData("")]
|
||||
[InlineData(" ")]
|
||||
public void NoPathIsRefused(string path)
|
||||
{
|
||||
FluentActions.Invoking(() => Explorer.FolderArguments(path)).Should().Throw<ArgumentException>();
|
||||
FluentActions.Invoking(() => Explorer.SelectArguments(path)).Should().Throw<ArgumentException>();
|
||||
}
|
||||
}
|
||||
@@ -388,6 +388,7 @@ public sealed class GameDetailViewModelTests
|
||||
// The fake Agent answers Written; the real one would have stamped the row — mirror that here so the reload shows it.
|
||||
agent.Answer = r =>
|
||||
{
|
||||
#pragma warning disable VSTHRD002 // the fake Agent's answer is synchronous by its interface, and Microsoft.Data.Sqlite completes this write synchronously anyway
|
||||
_ = new Infrastructure.Persistence.SqliteGameConsentStore(s.Db).RecordOperatorAcknowledgementAsync(new Application.Consent.OperatorAcknowledgement
|
||||
{
|
||||
Fingerprint = game.Fingerprint,
|
||||
@@ -395,6 +396,7 @@ public sealed class GameDetailViewModelTests
|
||||
AcknowledgedAt = DateTimeOffset.UtcNow,
|
||||
Provenance = Domain.Consent.ConsentProvenance.ConsentDialog,
|
||||
}, Ct).AsTask().GetAwaiter().GetResult();
|
||||
#pragma warning restore VSTHRD002
|
||||
return IpcCodec.Decode(IpcCodec.Encode(IpcMessageType.HookEnabledAck, "1", new HookEnabledAck(r.GameId, true, "Written", "clean")));
|
||||
};
|
||||
vm.ToggleHookingCommand.Execute(null);
|
||||
|
||||
Reference in new issue
Block a user