How can I know, by using C++ code, which user runs a specific service? The program I need to write might run under a local administrator account, so I guess there won't be permissions problems.
Is it possible?
TIA.
Depending on whether you need the user of the currently running service or the user specified in startup parameters of the service, see QueryServiceObjectSecurity and QueryServiceConfig functions in Windows API respectively.