Repository navigation
fix(windows): harden PE metadata, static TaskDialog, and screenshot helper - #1306
Merged
Merged
Conversation
|
No actionable comments were generated in the recent review. Summary
Merge Risk:
|
This was referenced Nov 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Hardens Windows PE hygiene and reduces high-sensitivity static imports in the resident
bin/codexhost.exelauncher to mitigate Microsoft Defender false positives while preserving all runtime contracts:asInvokermanifests across all 7 self-built.exebinaries:CompanyName,ProductName,FileDescription,OriginalFilename,InternalName,LegalCopyright, version metadata, and<trustInfo><requestedExecutionLevel level="asInvoker" uiAccess="false"/></trustInfo>(preservingCommon-Controls6.0, DPI awareness, andlongPathAware) acrosscodexhost.exe,codexhost-start.exe,codexhost-shim.exe,codexhost-node-repl.exe,codexhost-updater.exe,codexhost-shell.exe, andcodexhost-screenshot.exe.cargo:rustc-link-arg-binresource linking in multi-bin crates (crates/launcher,crates/shim) pluscargo:rustc-link-arg-testsforcrates/launchertest targets, and configuresapps/desktop-shell/src-tauriviatauri_build::WindowsAttributes+tauri.conf.jsonto avoidCVT1100duplicate resources.LoadLibraryW+GetProcAddressdynamic loading:LoadLibraryW("comctl32.dll")/GetProcAddress("TaskDialogIndirect")/FreeLibrary/transmutefromcrates/platform/src/windows_ui.rs.windows-task-dialogfeature incrates/platform/src/windows_task_dialog.rsusing staticwindows::Win32::UI::Controls::TaskDialogIndirectbinding (only enabled bycodexhost-launcher, which embeds the Common Controls v6 manifest).codexhost.exe:crates/screenshot(libexec/codexhost-screenshot.exeon Windows) to isolatexcap,OpenInputDesktop,GetThreadDesktop, and HiDPI capture APIs from the residentbin/codexhost.exebinary.codexhost desktop-screenshotCLI andweb-servercontract verbatim (Windows delegates on demand tolibexec/codexhost-screenshot.exewithCREATE_NO_WINDOW; macOS retains its existing in-process implementation to preserve Screen Recording TCC attribution).crates/updater/src/prepare_install.rs,scripts/release/prepare-payload.mjs,scripts/release/prepare-npm.mjs, and corresponding release tests.Related issues
无 / N/A
UI Demo
No visual changes: changes under
apps/desktop-shell/src-tauri/only configure Windows PE metadata (publisher,copyright,OriginalFilename,InternalName) and the embeddedwindows.manifest(asInvoker/longPathAware/Common-Controls6.0) without modifying any UI layout, styles, or interactive behavior.Test plan
Executed locally on macOS (arm64):
cargo fmt --all --check— passedcargo clippy --workspace --all-targets --locked --features codexhost-shim/test-utils,codexhost-gate-a-native/gate-tools -- -D warnings— passedcargo test --workspace --locked --features codexhost-shim/test-utils,codexhost-gate-a-native/gate-tools— passed (including newcodexhost-screenshottests)cargo check --manifest-path apps/desktop-shell/src-tauri/Cargo.toml --locked— passedcargo check --target x86_64-pc-windows-msvc --locked -p codexhost-platform --all-targets(default and--features windows-task-dialog) — passedcargo clippy --target x86_64-pc-windows-msvc --workspace --all-targets --locked --features codexhost-shim/test-utils,codexhost-gate-a-native/gate-tools -- -D warnings(with mockRC_PATHverifying generated.rcfiles contain no external#includeheaders) — passedcargo check --target x86_64-pc-windows-msvc --locked -p codexhost-launcher -p codexhost-screenshot --all-targets -v— confirmed each bin/test target links exactly one.reswithout duplicationcargo tree --locked --target x86_64-pc-windows-msvc -p codexhost-launcher— confirmed zeroxcap,Win32_System_StationsAndDesktops, orWin32_UI_HiDpidependencies in Windowscodexhost.exenpx vitest run --config tests/vitest.config.js tests/release/payload.test.mjs tests/release/npm-package.test.mjs— 85 passed, 1 Windows-only skippednode --import tsx --test packages/web-server/test/desktop-screenshot.test.ts— 6 passedNot executed locally (deferred to Windows CI / Windows machine):
rc.exe+link.exeresource compilation and linking across all 7.exetargets (includingtauri_build)cargo test --workspaceruntime check verifyingTaskDialogIndirectstatic import works withoutSTATUS_ENTRYPOINT_NOT_FOUNDcodexhost desktop-screenshot+ installer/npm packaging run