mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 01:35:47 +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 */
|
/* query.c */
|
||||||
ENUM_SERVICE_STATUS_PROCESS* GetSelectedService(PMAIN_WND_INFO Info);
|
ENUM_SERVICE_STATUS_PROCESS* GetSelectedService(PMAIN_WND_INFO Info);
|
||||||
LPQUERY_SERVICE_CONFIG GetServiceConfig(LPTSTR lpServiceName);
|
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 GetServiceDescription(LPTSTR lpServiceName);
|
||||||
LPTSTR GetExecutablePath(LPTSTR lpServiceName);
|
LPTSTR GetExecutablePath(LPTSTR lpServiceName);
|
||||||
BOOL RefreshServiceList(PMAIN_WND_INFO Info);
|
BOOL RefreshServiceList(PMAIN_WND_INFO Info);
|
||||||
|
|
|
@ -90,10 +90,53 @@ cleanup:
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
VOID
|
BOOL
|
||||||
SetServiceConfig(LPQUERY_SERVICE_CONFIG pServiceConfig)
|
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…
Add table
Add a link
Reference in a new issue