Repository navigation
Conversation
Replace the fixed `%TEMP%\xcl-menu.manifest` `std::fs::write` in `Ui::enter()` with an exclusively created `TempManifest` (`create_new(true)`, `share_mode(0)`, `FILE_FLAG_OPEN_REPARSE_POINT`) named `xcl-menu-<pid>-<seq>.manifest` that skips colliding files/links/directories, closes the file before `CreateActCtxW`, deletes any partial file on write failure, and removes the manifest immediately after `CreateActCtxW` finishes. Also release the activation context handle if `ActivateActCtx` fails and only call `CoUninitialize()` when `CoInitializeEx` succeeded (`hr >= 0`). Fixes xcl-dev#2272 Assisted-by: Google Antigravity (Gemini 4 Neon)
|
NVIDIA run. Setup: RTX 3060 12 GB (32-lane waves, driver 32.0.16.2101), Ryzen 5 5600X, 32 GB RAM, Windows 11 build 26300, Rust 1.100.0, DXC 1.9.2609.5, debug build. Head 0ec32af. Result: cargo test --workspace -- --test-threads=4: 1252 passed, 0 failed, 46 ignored. SKIPPED: 18 GPU tests for no wave64 (expected on this card) and the usual per-lane / heap-window / driver-cache skips. Not tested: opening xcl.exe from Explorer and using the menu by hand. AI use: Claude Code (Claude Opus 5.5) ran the tests and wrote this report. |
|
Test report for Tested
Regression run (retail title, main: this PR: Not tested
AI use: Claude Code with Claude Opus 5.5 ran the build, the suite and the regression run and wrote this report at my request. |
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
What is in it
Fixes #2272 by hardening and cleaning up the temporary Common Controls 6 activation-context manifest created in
crates/xcl/src/main.rs:TempManifest): Replacesstd::fs::writeto the fixed path%TEMP%\xcl-menu.manifestwithTempManifest::create_in, which generates uniquexcl-menu-<pid>-<seq>.manifestpaths and creates them exclusively viaOpenOptions::new().write(true).create_new(true).share_mode(0).custom_flags(FILE_FLAG_OPEN_REPARSE_POINT). Colliding files, hard links, symlinks, directories, or junctions (AlreadyExists, orPermissionDeniedwhensymlink_metadata().is_ok()) are skipped without truncating or overwriting existing targets, write/flush errors close the file handle before removing the partial file, and the handle is flushed and closed before callingCreateActCtxWwith lossless UTF-16 encoding (OsStrExt::encode_wide).activate_manifest_indropsTempManifestimmediately afterCreateActCtxWreturns (on both success and failure), so no temporary manifest file stays in%TEMP%while the menu is open or after teardown.activate_manifest_incallsReleaseActCtx(h)ifActivateActCtxfails (fixing the handle leak), andUirecordscom_init = CoInitializeEx(...) >= 0soUi::droponly callsCoUninitialize()whenCoInitializeExactually succeeded (avoiding an unbalancedCoUninitialize()afterRPC_E_CHANGED_MODE).Tested
cargo test --release -p xcl --bin xcl -- --test-threads=1 --nocapture): confirmed unmodifiedUi::enter()overwrote a pre-existingxcl-menu.manifestsentinel (FAILED,0 passed; 1 failed).cargo test --release -p xcl --bin xcl -- --nocapture:2 passed, 0 failed, 0 ignored:temp_manifest_skips_collisions_and_removes_on_drop: pre-populatesxcl-menu.manifest, a hard link tovictim.txtat candidate0, and a directory at candidate1; verifiesTempManifestskips both collisions without touchingxcl-menu.manifestorvictim.txt, writes exactMENU_MANIFESTto candidate2, deletes it onDrop, and returnsErrfor a non-existent directory.live_actctx_activates_after_manifest_removal_and_ui_guards_com: verifies liveCreateActCtxW-> dropTempManifest(confirming file deleted before activation) ->ActivateActCtx+GetCurrentActCtxsucceeds,Ui::enter_inon a fresh STA thread initializes COM and leaves zero extra temp files while active and after drop, andUi::enter_inon an already-MTA thread observesRPC_E_CHANGED_MODE(com_init == false) and drops cleanly.cargo test --release --workspace --no-fail-fast -- --test-threads=4 --nocaptureon NVIDIA GeForce RTX 4060):23test binaries,1252 passed, 0 failed, 46 ignored(27pre-existing hardware/debug-layerSKIPPED:20no wave64on 32-lane GPU,3wave32 per-lanerefused,2missing D3D12 debug layer,1driver cache toggle,1no heap windows;0skipped inmain.rs).Regression run
Paired 60 s
scripts/smoke.ps1runs on the same RTX 4060 host againstorigin/main(1a0bbe3a2ba91ea8f5b6fc29130a053868d3c9e6) and PR head (0ec32afd07a6ce5de24259703cb2e10f983aa372):Baseline (
origin/main):PR head:
Not tested
FILE_FLAG_OPEN_REPARSE_POINTprevents reparse-point traversal).d3d12SDKLayers.dllis not installed on this host).AI use
Implemented and verified with Google Antigravity (Gemini 4 Neon).
Fixes #2272