[ADVAPI32]
[reactos.git] / reactos / dll / win32 / advapi32 / service / sctrl.c
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
  *