Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

svcmgr — Windows service manager for Far Manager 3 (x64)

Manage Windows services and drivers from a Far Manager panel: start, stop, pause, continue, restart, create, delete, reconfigure and change the logon account, locally or on a remote host.

Far does not need to run as administrator. Privileged operations are handed to a small elevated helper on demand, one UAC prompt per batch.

version far license

What this is

Andrew Grechkin's svcmgr plugin, revived. The last release was 2.3.15 in 2017 and its source was never published; the newest source that survived was an unreleased 2.1.14 working copy from 2013, written for MinGW/GCC against the Far 3.0 build 3064 API.

This tree takes that source, restores the functionality the 2.3.15 changelog describes, builds it with MSVC against the current build 6638 API, fixes what Windows 10/11 broke, and adds per-operation elevation.

What changed

Elevation (new). Every mutating operation is tried normally first and only offers to elevate on ERROR_ACCESS_DENIED, so no prompt appears when you already have the rights. A whole selection is retried in one helper run — twenty services, one prompt. The helper handles one batch and exits rather than lingering as an elevated process taking orders over IPC. Payloads can carry a service account password, so they travel over a user-only named pipe rather than the command line, and the plugin verifies the connecting process is genuinely elevated and same-user first.

Far's own elevation prompt covers file system calls only — there is no elevation API for plugins — so service control has to ask for itself.

Restored from the 2.3.15 changelog.

  • Alt-F7 search. GetFilesW was implemented but never exported, so Far could not extract a panel item for content search or View. It is exported now, and search mode no longer opens dialogs mid-scan. (SetFindListW is deliberately not exported - see below.)
  • Windows 10/11. QUERY_SERVICE_CONFIGW fields are optional and modern Windows returns NULL for them — on a stock Windows 11, 458 of 459 drivers return a NULL account string, which the old code fed straight into std::wstring. Enumeration also ignored the resume handle and assumed the sizing call always fails with ERROR_MORE_DATA.
  • Language switching. Key bar and column captions were resolved once and cached; they are re-read now.

2.4.17. Alt-F7 in a normal file panel put an empty svcmgr panel on screen instead of the search results. Far asks every plugin exporting SetFindList whether it will host the results panel and the first to accept wins; svcmgr accepted, then filtered its service list by the found file names, so nothing matched. It now declines OPEN_FINDLIST and no longer exports SetFindListW, leaving the job to a plugin that can show files. Four other entry points that had no implementation (DeleteFilesW, MakeDirectoryW, ProcessHostFileW, PutFilesW) are no longer exported either.

Also fixed. A static destruction order bug that crashed on plugin unload (and would have taken Far down on exit), and unconditional logging to a hardcoded path on the author's disk (now opt-in via SVCMGR_LOG).

Ported. MinGW/GCC → MSVC: the elvis operator, VLAs, GCC named-variadic macros, std::binary_function. The Far API gap turned out small and additive.

Full history in dist/changelog.

Install

Download the release archive, drop the svcmgr folder into Far Manager\Plugins, restart Far. Keep svcmgr-elevator-x64.exe beside the DLL — without it, privileged operations only work when Far is already elevated.

Requires Far Manager 3.0 build 6638 or newer, x64, on Windows 10 or 11.

Build

Needs the Visual Studio Build Tools (MSVC) and CMake + Ninja, which ship with them.

build.cmd            # output in dist/
install.cmd          # copies into Far Manager\Plugins (elevated prompt)

Tests — neither changes anything on the machine:

cmake --build build --target svcmgr-tests svcmgr-panel-test

svcmgr-tests enumerates the real service database, round-trips the elevation wire format and drives the helper's protocol end to end. svcmgr-panel-test drives the built DLL through Far's own call sequence against a stub host.

Known gaps

  • Service dependencies can be viewed but not edited — the author's original TODO. Both set_dependencies calls are commented out; the .lng files still carry unused captions (Depends, Select new dependency) for the editor that was planned as a second tab beside Logon as.
  • x64 only. The 2017 release also shipped an x32 build.
  • Remote hosts don't benefit from elevation — connection credentials are deliberately not retained in memory, so the helper reaches a remote host as the current user.
  • The live UAC prompt is not covered by tests, since approving it needs a human. Everything up to and including the helper's protocol is.

Credits

Original plugin © 2013 Andrew Grechkin — https://github.com/andrew-grechkin/main. Russian .lng file by VictorVG @ VikSoft.Ru.

Licensed under the GNU GPL v3 (see dist/license.txt). This is a modified version, redistributed with source and with the changes described above, as the GPL requires.

About

Windows service manager plugin for Far Manager 3 (x64) - revival of Andrew Grechkin's svcmgr with Windows 10/11 fixes and per-operation UAC elevation

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages