Author: ekohl
Date: Wed Dec 30 18:17:58 2009
New Revision: 44816
URL:
http://svn.reactos.org/svn/reactos?rev=44816&view=rev
Log:
[services] Set the given service start name or LocalSystem for a new service.
Modified:
trunk/reactos/base/system/services/rpcserver.c
Modified: trunk/reactos/base/system/services/rpcserver.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/services/rpcse…
==============================================================================
--- trunk/reactos/base/system/services/rpcserver.c [iso-8859-1] (original)
+++ trunk/reactos/base/system/services/rpcserver.c [iso-8859-1] Wed Dec 30 18:17:58 2009
@@ -1733,6 +1733,7 @@
SC_HANDLE hServiceHandle = NULL;
LPWSTR lpImagePath = NULL;
HKEY hServiceKey = NULL;
+ LPWSTR lpObjectName;
DPRINT("RCreateServiceW() called\n");
DPRINT("lpServiceName = %S\n", lpServiceName);
@@ -1973,16 +1974,16 @@
goto done;
}
- /* FIXME: Handle lpServiceStartName propertly! */
- /* If a non driver and NULL for lpServiceStartName, write ObjectName as LocalSystem
*/
- if ((dwServiceType & SERVICE_WIN32) && (!lpServiceStartName))
- {
+ /* Write service start name */
+ if (dwServiceType & SERVICE_WIN32)
+ {
+ lpObjectName = (lpServiceStartName != NULL) ? (LPWSTR)lpServiceStartName :
L"LocalSystem";
dwError = RegSetValueExW(hServiceKey,
L"ObjectName",
0,
REG_SZ,
- (LPBYTE)L"LocalSystem",
- 24);
+ (LPBYTE)lpObjectName,
+ (wcslen(lpObjectName) + 1) * sizeof(WCHAR));
if (dwError != ERROR_SUCCESS)
goto done;
}