Repository navigation
feat: add a classic Services page - #26
Conversation
List Win32 services with name, description, status, startup type, and a verified owning process. Start and stop use the minimum SCM rights and report failures immediately. Go to Process requires a ProcIdentity. Co-authored-by: jameslincn <jameslincn@outlook.sg>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 838524d0a9
ℹ️ 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".
| match (&*pending, &incoming) { | ||
| (ServiceRequest::Control { .. }, ServiceRequest::Refresh) => {} | ||
| _ => *pending = incoming, |
There was a problem hiding this comment.
Preserve every queued service control request
When a refresh or control request is already in flight, one service action becomes pending; if the user invokes another action before completion, this branch replaces the first action with the second. This can readily happen during the full per-service metadata refresh, and the discarded Start/Stop request never reaches the SCM or produces an error. Preserve pending control requests in order, or reject/disable additional controls while continuing to coalesce refreshes.
AGENTS.md reference: AGENTS.md:L53-L55
Useful? React with 👍 / 👎.
| stop: matches!( | ||
| selected.status, | ||
| ServiceRunState::Running | ServiceRunState::Paused | ||
| ), |
There was a problem hiding this comment.
Require SERVICE_ACCEPT_STOP before enabling Stop
For a running or paused service that does not advertise SERVICE_ACCEPT_STOP, status alone still enables Stop, even though ControlService(SERVICE_CONTROL_STOP) will reject it. ENUM_SERVICE_STATUS_PROCESSW already supplies dwControlsAccepted, but the sampler discards it; carry that capability into the row and gate the button and menu on it so their enabled state reflects whether the service accepts the command.
AGENTS.md reference: AGENTS.md:L62-L64
Useful? React with 👍 / 👎.
| start: selected.status == ServiceRunState::Stopped | ||
| && selected.startup != ServiceStartupType::Disabled, |
There was a problem hiding this comment.
Keep Start disabled when startup metadata is unknown
When QueryServiceConfigW fails for a stopped service, the sampler records ServiceStartupType::Unknown(0), but Unknown != Disabled makes Start appear enabled. If the inaccessible service is actually disabled, the UI therefore presents an operation it cannot safely determine is allowed and only discovers that through an avoidable action failure; require a known startable startup type instead of treating unknown metadata as non-disabled.
AGENTS.md reference: AGENTS.md:L52-L55
Useful? React with 👍 / 👎.
Summary
Adds a Services page in the style of the existing classic Task Manager pages. No dependency upgrades, no new platform targets, and no Options field changes. The page is appended as
PageId::Services = 7, so existing saved page indexes stay valid.ProcIdentityexists. Enumeration usesSC_MANAGER_CONNECT | SC_MANAGER_ENUMERATE_SERVICE. Per-service config and description useSERVICE_QUERY_CONFIG. A row-level failure keeps the other rows.SERVICE_START | SERVICE_QUERY_STATUS. Stop usesSERVICE_STOP | SERVICE_QUERY_STATUS. Success is only a following status of running/start-pending or stopped/stop-pending. Any API failure or unchanged state opens an error dialog immediately. A disabled command beeps.WM_FINDPROCwith pid plus creation time. The command stays disabled when the service has no verified process identity.TextKeyand every locale. The three commands have unique resource IDs, routing, enabled state, and status-bar help. The Services menu separator is explicit.Tests
PID {n}when the name is missing.Verification
This host is Linux.
cargo fmt --all -- --check,cargo check --all-targets --locked, andcargo clippy --all-targets --locked -- -D warningspassed for the defaultx86_64-pc-windows-msvctarget. The same check passed fori686-pc-windows-msvcandaarch64-pc-windows-msvc.cargo test --all-targets --lockedstops atlink.exe, which is not on this machine. Linking the i686 tests withrust-lldstops because the Windows import libraries are absent. Those checks are not a Windows device test.CI on this PR runs Quality (x86_64) and Architecture (i686, aarch64), including the Windows test and release builds.