[ADVAPI32]
authorEric Kohl <eric.kohl@reactos.org>
Sat, 14 Jan 2017 15:17:29 +0000 (15:17 +0000)
committerEric Kohl <eric.kohl@reactos.org>
Sat, 14 Jan 2017 15:17:29 +0000 (15:17 +0000)
Implement I_ScPnPGetServiceName().

svn path=/trunk/; revision=73547

reactos/dll/win32/advapi32/advapi32.spec
reactos/dll/win32/advapi32/service/sctrl.c

index 89eb880..b6355c1 100644 (file)
 296 stdcall GetWindowsAccountDomainSid(ptr ptr ptr)
 297 stub I_QueryTagInformation
 298 stub I_ScIsSecurityProcess
-299 stub I_ScPnPGetServiceName
+299 stdcall I_ScPnPGetServiceName(ptr wstr long)
 300 stub I_ScSendTSMessage
 301 stdcall I_ScSetServiceBitsA(ptr long long long str)
 302 stdcall I_ScSetServiceBitsW(ptr long long long wstr)
index 9859657..833d2ed 100644 (file)
@@ -183,6 +183,7 @@ ScServiceMainStubA(LPVOID Context)
     return ERROR_SUCCESS;
 }
 
+
 static DWORD WINAPI
 ScServiceMainStubW(LPVOID Context)
 {
@@ -742,6 +743,34 @@ RegisterServiceCtrlHandlerExW(LPCWSTR lpServiceName,
 }
 
 
+/**********************************************************************
+ *     I_ScPnPGetServiceName
+ *
+ * Undocumented
+ *
+ * @implemented
+ */
+DWORD
+WINAPI
+I_ScPnPGetServiceName(IN SERVICE_STATUS_HANDLE hServiceStatus,
+                      OUT LPWSTR lpServiceName,
+                      IN DWORD cchServiceName)
+{
+    DWORD i;
+
+    for (i = 0; i < dwActiveServiceCount; i++)
+    {
+        if (lpActiveServices[i].hServiceStatus == hServiceStatus)
+        {
+            wcscpy(lpServiceName, lpActiveServices[i].ServiceName.Buffer);
+            return ERROR_SUCCESS;
+        }
+    }
+
+    return ERROR_SERVICE_NOT_IN_EXE;
+}
+
+
 /**********************************************************************
  *     I_ScSetServiceBitsA
  *