Repository navigation
fix(smi): avoid DiskPart during Windows platform detection (8.7) - #28
Open
Yasei-no-otoko wants to merge 1 commit into
Open
Yasei-no-otoko wants to merge 1 commit into
Yasei-no-otoko wants to merge 1 commit into
Conversation
Signed-off-by: 野生の男 <Yasei-no-otoko@users.noreply.github.com>
There was a problem hiding this comment.
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
MININTcomputer-name heuristic. - Removes redundant
DiskPartchecks. - 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.
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.
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 existingMININTcomputer-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:stagingand 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:
smi_cli_platform.cppwith MSVC 2022, C++17,/EHsc /MP32 /c.GetComputerNameWAPI.git diff --checkpasses; no DiskPart references remain in the checked-outsmi-libsources.The full AMD SMI executable and actual WinPE/virtualization environments were not tested. No installed AMD binaries were modified.