mirror of
https://github.com/reactos/reactos.git
synced 2025-06-22 15:50:17 +00:00
[services] Set the given service start name or LocalSystem for a new service.
svn path=/trunk/; revision=44816
This commit is contained in:
parent
5ad3e6fe72
commit
a7b546562e
1 changed files with 6 additions and 5 deletions
|
@ -1733,6 +1733,7 @@ DWORD RCreateServiceW(
|
||||||
SC_HANDLE hServiceHandle = NULL;
|
SC_HANDLE hServiceHandle = NULL;
|
||||||
LPWSTR lpImagePath = NULL;
|
LPWSTR lpImagePath = NULL;
|
||||||
HKEY hServiceKey = NULL;
|
HKEY hServiceKey = NULL;
|
||||||
|
LPWSTR lpObjectName;
|
||||||
|
|
||||||
DPRINT("RCreateServiceW() called\n");
|
DPRINT("RCreateServiceW() called\n");
|
||||||
DPRINT("lpServiceName = %S\n", lpServiceName);
|
DPRINT("lpServiceName = %S\n", lpServiceName);
|
||||||
|
@ -1973,16 +1974,16 @@ DWORD RCreateServiceW(
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* FIXME: Handle lpServiceStartName propertly! */
|
/* Write service start name */
|
||||||
/* If a non driver and NULL for lpServiceStartName, write ObjectName as LocalSystem */
|
if (dwServiceType & SERVICE_WIN32)
|
||||||
if ((dwServiceType & SERVICE_WIN32) && (!lpServiceStartName))
|
|
||||||
{
|
{
|
||||||
|
lpObjectName = (lpServiceStartName != NULL) ? (LPWSTR)lpServiceStartName : L"LocalSystem";
|
||||||
dwError = RegSetValueExW(hServiceKey,
|
dwError = RegSetValueExW(hServiceKey,
|
||||||
L"ObjectName",
|
L"ObjectName",
|
||||||
0,
|
0,
|
||||||
REG_SZ,
|
REG_SZ,
|
||||||
(LPBYTE)L"LocalSystem",
|
(LPBYTE)lpObjectName,
|
||||||
24);
|
(wcslen(lpObjectName) + 1) * sizeof(WCHAR));
|
||||||
if (dwError != ERROR_SUCCESS)
|
if (dwError != ERROR_SUCCESS)
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue