mirror of
https://github.com/reactos/reactos.git
synced 2024-10-01 23:14:53 +00:00
- Mark service for delete in the registry.
svn path=/trunk/; revision=18930
This commit is contained in:
parent
9c843bd352
commit
b4693503e5
|
@ -11,6 +11,37 @@
|
|||
|
||||
/* FUNCTIONS *****************************************************************/
|
||||
|
||||
|
||||
DWORD
|
||||
ScmOpenServiceKey(LPWSTR lpServiceName,
|
||||
REGSAM samDesired,
|
||||
PHKEY phKey)
|
||||
{
|
||||
HKEY hServicesKey = NULL;
|
||||
DWORD dwError;
|
||||
|
||||
*phKey = NULL;
|
||||
|
||||
dwError = RegOpenKeyExW(HKEY_LOCAL_MACHINE,
|
||||
L"System\\CurrentControlSet\\Services",
|
||||
0,
|
||||
KEY_READ,
|
||||
&hServicesKey);
|
||||
if (dwError != ERROR_SUCCESS)
|
||||
return dwError;
|
||||
|
||||
dwError = RegOpenKeyExW(hServicesKey,
|
||||
lpServiceName,
|
||||
0,
|
||||
samDesired,
|
||||
phKey);
|
||||
|
||||
RegCloseKey(hServicesKey);
|
||||
|
||||
return dwError;
|
||||
}
|
||||
|
||||
|
||||
DWORD
|
||||
ScmWriteDependencies(HKEY hServiceKey,
|
||||
LPWSTR lpDependencies,
|
||||
|
|
|
@ -987,9 +987,28 @@ ScmAutoStartServices(VOID)
|
|||
DWORD
|
||||
ScmMarkServiceForDelete(PSERVICE pService)
|
||||
{
|
||||
DPRINT1("ScmMarkServiceForDelete() called\n");
|
||||
HKEY hServiceKey = NULL;
|
||||
DWORD dwValue = 1;
|
||||
DWORD dwError;
|
||||
|
||||
return ERROR_SUCCESS;
|
||||
DPRINT("ScmMarkServiceForDelete() called\n");
|
||||
|
||||
dwError = ScmOpenServiceKey(pService->lpServiceName,
|
||||
KEY_WRITE,
|
||||
&hServiceKey);
|
||||
if (dwError != ERROR_SUCCESS)
|
||||
return dwError;
|
||||
|
||||
dwError = RegSetValueExW(hServiceKey,
|
||||
L"DeleteFlag",
|
||||
0,
|
||||
REG_DWORD,
|
||||
(LPBYTE)&dwValue,
|
||||
sizeof(DWORD));
|
||||
|
||||
RegCloseKey(hServiceKey);
|
||||
|
||||
return dwError;
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
|
|
@ -43,6 +43,10 @@ extern BOOL ScmShutdown;
|
|||
|
||||
/* config.c */
|
||||
|
||||
DWORD ScmOpenServiceKey(LPWSTR lpServiceName,
|
||||
REGSAM samDesired,
|
||||
PHKEY phKey);
|
||||
|
||||
DWORD ScmWriteDependencies(HKEY hServiceKey,
|
||||
LPWSTR lpDependencies,
|
||||
DWORD dwDependenciesLength);
|
||||
|
|
Loading…
Reference in a new issue