From eb31df80a71481824e57eb0003bb7ebdb223ae77 Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Sat, 14 Jan 2017 15:17:29 +0000 Subject: [PATCH] [ADVAPI32] Implement I_ScPnPGetServiceName(). svn path=/trunk/; revision=73547 --- reactos/dll/win32/advapi32/advapi32.spec | 2 +- reactos/dll/win32/advapi32/service/sctrl.c | 29 ++++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/reactos/dll/win32/advapi32/advapi32.spec b/reactos/dll/win32/advapi32/advapi32.spec index 89eb88002ea..b6355c125ca 100644 --- a/reactos/dll/win32/advapi32/advapi32.spec +++ b/reactos/dll/win32/advapi32/advapi32.spec @@ -296,7 +296,7 @@ 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) diff --git a/reactos/dll/win32/advapi32/service/sctrl.c b/reactos/dll/win32/advapi32/service/sctrl.c index 985965757bd..833d2edef17 100644 --- a/reactos/dll/win32/advapi32/service/sctrl.c +++ b/reactos/dll/win32/advapi32/service/sctrl.c @@ -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 *