- CreateServiceW: Calculate the Dependency length.
- Implement NotifyBootConfigStatus.
Modified: trunk/reactos/lib/advapi32/advapi32.def
Modified: trunk/reactos/lib/advapi32/service/scm.c
_____
Modified: trunk/reactos/lib/advapi32/advapi32.def
--- trunk/reactos/lib/advapi32/advapi32.def 2005-10-15 16:39:22 UTC
(rev 18484)
+++ trunk/reactos/lib/advapi32/advapi32.def 2005-10-15 19:34:53 UTC
(rev 18485)
@@ -416,7 +416,7 @@
;MakeAbsoluteSD2
MakeSelfRelativeSD@12
MapGenericMask(a)8=NTDLL.RtlMapGenericMask
-;NotifyBootConfigStatus@4
+NotifyBootConfigStatus@4
NotifyChangeEventLog@8
ObjectCloseAuditAlarmA@12
ObjectCloseAuditAlarmW@12
_____
Modified: trunk/reactos/lib/advapi32/service/scm.c
--- trunk/reactos/lib/advapi32/service/scm.c 2005-10-15 16:39:22 UTC
(rev 18484)
+++ trunk/reactos/lib/advapi32/service/scm.c 2005-10-15 19:34:53 UTC
(rev 18485)
@@ -263,13 +263,31 @@
SC_HANDLE hService = NULL;
DWORD dwError;
HKEY hEnumKey, hKey;
+ DWORD dwDependenciesLength = 0;
+ DWORD dwLength;
+ LPWSTR lpStr;
DPRINT1("CreateServiceW() called\n");
+ /* Calculate the Dependencies length*/
+ if (lpDependencies != NULL)
+ {
+ lpStr = (LPWSTR)lpDependencies;
+ while (*lpStr)
+ {
+ dwLength = wcslen(lpStr) + 1;
+ dwDependenciesLength += dwLength;
+ lpStr = lpStr + dwLength;
+ }
+ dwDependenciesLength++;
+ }
+
+ /* FIXME: Encrypt the password */
+
+#if 0
HandleBind();
/* Call to services.exe using RPC */
-#if 0
dwError = ScmrCreateServiceW(BindingHandle,
(unsigned int)hSCManager,
(LPWSTR)lpServiceName,
@@ -281,8 +299,8 @@
(LPWSTR)lpBinaryPathName,
(LPWSTR)lpLoadOrderGroup,
lpdwTagId,
- NULL, /* FIXME:
lpDependencies */
- 0, /* FIXME:
dwDependenciesLength */
+ lpDependencies,
+ dwDependenciesLength,
(LPWSTR)lpServiceStartName,
NULL, /* FIXME:
lpPassword */
0, /* FIXME:
dwPasswordLength */
@@ -991,9 +1009,7 @@
{
DWORD dwError;
-#if 0
- DPRINT("UnlockServiceDatabase(%x)\n", hSCManager);
-#endif
+ DPRINT("UnlockServiceDatabase(%x)\n", ScLock);
HandleBind();
@@ -1011,11 +1027,40 @@
}
+/**********************************************************************
+ * NotifyBootConfigStatus
+ *
+ * @implemented
+ */
+BOOL STDCALL
+NotifyBootConfigStatus(BOOL BootAcceptable)
+{
+ DWORD dwError;
+
+ DPRINT1("NotifyBootConfigStatus()\n");
+
+ HandleBind();
+
+ /* Call to services.exe using RPC */
+ dwError = ScmrNotifyBootConfigStatus(BindingHandle,
+ BootAcceptable);
+ if (dwError != ERROR_SUCCESS)
+ {
+ DPRINT1("NotifyBootConfigStatus() failed (Error %lu)\n",
dwError);
+ SetLastError(dwError);
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+
void __RPC_FAR * __RPC_USER midl_user_allocate(size_t len)
{
return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len);
}
+
void __RPC_USER midl_user_free(void __RPC_FAR * ptr)
{
HeapFree(GetProcessHeap(), 0, ptr);
Show replies by date