mirror of
https://github.com/reactos/reactos.git
synced 2025-01-13 01:22:03 +00:00
Add functionality for changing the service config. unused at the moment.
svn path=/trunk/; revision=28644
This commit is contained in:
parent
8da0438ac6
commit
a4ebd5b085
2 changed files with 46 additions and 3 deletions
|
@ -74,7 +74,7 @@ VOID CompleteProgressBar(HWND hProgDlg);
|
|||
/* query.c */
|
||||
ENUM_SERVICE_STATUS_PROCESS* GetSelectedService(PMAIN_WND_INFO Info);
|
||||
LPQUERY_SERVICE_CONFIG GetServiceConfig(LPTSTR lpServiceName);
|
||||
VOID SetServiceConfig(LPQUERY_SERVICE_CONFIG);
|
||||
BOOL SetServiceConfig(LPQUERY_SERVICE_CONFIG pServiceConfig, LPTSTR lpServiceName, LPTSTR lpPassword);
|
||||
LPTSTR GetServiceDescription(LPTSTR lpServiceName);
|
||||
LPTSTR GetExecutablePath(LPTSTR lpServiceName);
|
||||
BOOL RefreshServiceList(PMAIN_WND_INFO Info);
|
||||
|
|
|
@ -90,10 +90,53 @@ cleanup:
|
|||
}
|
||||
|
||||
|
||||
VOID
|
||||
SetServiceConfig(LPQUERY_SERVICE_CONFIG pServiceConfig)
|
||||
BOOL
|
||||
SetServiceConfig(LPQUERY_SERVICE_CONFIG pServiceConfig,
|
||||
LPTSTR lpServiceName,
|
||||
LPTSTR lpPassword)
|
||||
{
|
||||
SC_HANDLE hSCManager;
|
||||
SC_HANDLE hSc;
|
||||
SC_LOCK scLock;
|
||||
BOOL bRet = FALSE;
|
||||
|
||||
hSCManager = OpenSCManager(NULL,
|
||||
NULL,
|
||||
SC_MANAGER_LOCK);
|
||||
if (hSCManager)
|
||||
{
|
||||
scLock = LockServiceDatabase(hSCManager);
|
||||
if (scLock)
|
||||
{
|
||||
hSc = OpenService(hSCManager,
|
||||
lpServiceName,
|
||||
SERVICE_QUERY_CONFIG);
|
||||
if (hSc)
|
||||
{
|
||||
if (ChangeServiceConfig(hSc,
|
||||
pServiceConfig->dwServiceType,
|
||||
pServiceConfig->dwStartType,
|
||||
pServiceConfig->dwErrorControl,
|
||||
pServiceConfig->lpBinaryPathName,
|
||||
pServiceConfig->lpLoadOrderGroup,
|
||||
&pServiceConfig->dwTagId,
|
||||
pServiceConfig->lpDependencies,
|
||||
pServiceConfig->lpServiceStartName,
|
||||
lpPassword,
|
||||
pServiceConfig->lpDisplayName))
|
||||
{
|
||||
bRet = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
UnlockServiceDatabase(scLock);
|
||||
}
|
||||
}
|
||||
|
||||
if (!bRet)
|
||||
GetError();
|
||||
|
||||
return bRet;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue