Skip to content

fix(smi): avoid DiskPart during Windows platform detection (8.7) - #28

Open
Yasei-no-otoko wants to merge 1 commit into
amd:release/8.7.0.K-rcfrom
Yasei-no-otoko:fix/windows-platform-without-diskpart
Open

Yasei-no-otoko wants to merge 1 commit into
amd:release/8.7.0.K-rcfrom
Yasei-no-otoko:fix/windows-platform-without-diskpart

Conversation

@Yasei-no-otoko

Copy link
Copy Markdown

The 8.7 CLI runs diskpart /? during Windows platform detection and can run it again when WMI returns an unknown virtualization status. DiskPart requires administrator privileges, so starting a GPU monitoring tool can trigger an unrelated elevation prompt.

Replace these subprocess calls with GetComputerNameW. This retains the existing MININT computer-name heuristic and early bare-metal/NV classification without launching a shell or DiskPart. If the name query fails, continue with the existing WMI detection. The second name check is redundant after the early return and is removed.

This PR deliberately targets release/8.7.0.K-rc: staging and the 9.0/9.1 release branches already omit DiskPart, while 8.7 still contains both calls. This is a narrow fix for the older release, not a change to the current staging implementation. It does not claim that computer-name matching is a general WinPE detector.

Validation on Windows x64:

  • Compiled the complete modified smi_cli_platform.cpp with MSVC 2022, C++17, /EHsc /MP32 /c.
  • Ran a temporary C++ harness using the exact modified detection block with a mocked name API: five names (MININT prefix, embedded MININT, ordinary, empty, maximum-length), plus API failure. Verified early-return flags, fallback, and one name query.
  • Passed a smoke check using the native GetComputerNameW API.
  • git diff --check passes; no DiskPart references remain in the checked-out smi-lib sources.

The full AMD SMI executable and actual WinPE/virtualization environments were not tested. No installed AMD binaries were modified.

Signed-off-by: 野生の男 <Yasei-no-otoko@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings September 21, 2026 09:40

Copilot AI 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.

Copilot review overview

🟢 Approval recommended

The narrow change was reviewed with no unresolved blocking issues.

Review effort: Lite
Findings: None

What changed in this PR

Replaces Windows DiskPart platform checks with GetComputerNameW, avoiding elevation prompts while preserving WMI fallback.

Changes:

  • Uses the existing MININT computer-name heuristic.
  • Removes redundant DiskPart checks.
  • Retains WMI detection when name lookup fails.
File Summary
smi-lib/​cli/​cpp/​src/​smi_cli_platform.cpp Updates Windows platform detection to avoid launching DiskPart.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants