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.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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.