Skip to content

Add Auto Sort to prefer DLL version winners and handle Sysnative/WOW64 access - #3

Open
Darkaxt wants to merge 3 commits into
masterfrom
codex/analyze-forked-repo-for-issues-and-improvements
Open

Add Auto Sort to prefer DLL version winners and handle Sysnative/WOW64 access#3
Darkaxt wants to merge 3 commits into
masterfrom
codex/analyze-forked-repo-for-issues-and-improvements

Conversation

@Darkaxt

@Darkaxt Darkaxt commented Mar 30, 2026

Copy link
Copy Markdown
Owner

Motivation

  • Provide an automatic way to reorder PATH entries to reduce DLL shadowing by preferring directories that win version conflicts.
  • Correct file access and existence checks on 32-bit process running on 64-bit OS (WOW64/System32 redirection) so comparisons and scans see the intended System32 contents.

Description

  • Added an Auto Sort button to the UI (MainWindow.xaml) and an AutoSort_Click handler in MainWindow.xaml.cs that applies suggested ordering for both system and user PATH lists using the new reordering logic.
  • Implemented PathChecker.SuggestBestOrder to score and suggest a better ordering by enumerating DLL owners, comparing file versions and rewarding directories that contain the winning versions, with a versionCache to avoid repeated FileVersionInfo lookups.
  • Improved file enumeration and path comparisons to account for WOW64 redirection by adding ResolvePathForAccess in PathChecker, ActualPathForAccess in PathEntry, and switching uses of ActualPath to ActualPathForAccess where needed; updated caches to key on resolved paths.
  • Enhanced checking logic: CheckPath now delegates DLL-specific diagnostics to AddIssueIfNeeded, which reports more informative messages including version numbers; added a reusable PathListEqual overload and made equality/hash comparisons case-insensitive in PathEntry.

Testing

  • Built the solution to verify compilation (build succeeded).
  • No automated unit tests were added or modified as part of this change.

Codex Task

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3066252a1e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread WindowsPathEditor/PathChecker.cs Outdated
Comment on lines +302 to +306
path.AddIssue(string.Format(
"{0} v{1} shadowed by {2} (v{3})",
filename,
FormatVersion(winningPath.Version),
firstHit.FullPath,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Limit DLL winner warning to the winning path entry

When AddIssueIfNeeded handles a DLL conflict, it always formats the warning with winningPath.Version even if the currently checked path is not that winning entry. In a PATH like A(v1) -> B(v3) -> C(v2), checking C still emits a message saying v3 is shadowed by A, which is inaccurate for that row and can mislead users about which directory to move. This warning should either be emitted only when path.Path is the winningPath.Entry, or the message should use the current entry’s version instead of the global winner.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant