[SERVMAN]

GetServiceConfig: Use only the required access rights. Makes servman usable for non-admin users.

svn path=/trunk/; revision=71408
This commit is contained in:
Eric Kohl 2016-05-26 15:48:46 +00:00
parent 0b68260492
commit a5a8ffb511

View file

@ -35,12 +35,12 @@ GetServiceConfig(LPWSTR lpServiceName)
hSCManager = OpenSCManagerW(NULL,
NULL,
SC_MANAGER_ALL_ACCESS);
SC_MANAGER_CONNECT);
if (hSCManager)
{
hService = OpenServiceW(hSCManager,
lpServiceName,
SERVICE_QUERY_STATUS | SERVICE_ENUMERATE_DEPENDENTS | SERVICE_QUERY_CONFIG);
SERVICE_QUERY_CONFIG);
if (hService)
{
if (!QueryServiceConfigW(hService,