From 1bf66532283cfddd46792781c5d95fb6b516e0c8 Mon Sep 17 00:00:00 2001 From: Ged Murphy Date: Thu, 30 Aug 2007 09:29:45 +0000 Subject: [PATCH] - remove the last of the reactos hacks of reading directly from the service's registry keys. - servman appears to be broken in reactos at the moment, but it is actually implemented correctly now. It awaits widl / rpcrt4 updates and a working services.exe. svn path=/trunk/; revision=28668 --- .../base/applications/mscutils/servman/reg.c | 59 ------------------- .../mscutils/servman/servman.rbuild | 1 - 2 files changed, 60 deletions(-) delete mode 100644 reactos/base/applications/mscutils/servman/reg.c diff --git a/reactos/base/applications/mscutils/servman/reg.c b/reactos/base/applications/mscutils/servman/reg.c deleted file mode 100644 index 6c163855cc2..00000000000 --- a/reactos/base/applications/mscutils/servman/reg.c +++ /dev/null @@ -1,59 +0,0 @@ -/* - * PROJECT: ReactOS Services - * LICENSE: GPL - See COPYING in the top level directory - * FILE: base/applications/mscutils/servman/reg.c - * PURPOSE: functions for querying a services registry key - * COPYRIGHT: Copyright 2007 Ged Murphy - * - */ - -#include "precomp.h" - -static HKEY -OpenServiceKey(LPTSTR lpServiceName) -{ - HKEY hKey = NULL; - LPCTSTR Path = _T("System\\CurrentControlSet\\Services\\%s"); - TCHAR buf[300]; - - _sntprintf(buf, sizeof(buf) / sizeof(TCHAR), Path, lpServiceName); - if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, - buf, - 0, - KEY_READ, - &hKey) == ERROR_SUCCESS) - { - return hKey; - } - else - { - return NULL; - } -} - -BOOL -SetDescription(LPTSTR lpServiceName, - LPTSTR lpDescription) -{ - HKEY hKey; - TCHAR szBuf[MAX_PATH]; - BOOL bRet = FALSE; - - hKey = OpenServiceKey(lpServiceName); - if (hKey) - { - if (RegSetValueEx(hKey, - _T("Description"), - 0, - REG_SZ, - (LPBYTE)lpDescription, - (DWORD)(_tcslen(szBuf) + 1 ) * sizeof(TCHAR)) == ERROR_SUCCESS) - { - bRet = TRUE; - } - - RegCloseKey(hKey); - } - - return bRet; -} diff --git a/reactos/base/applications/mscutils/servman/servman.rbuild b/reactos/base/applications/mscutils/servman/servman.rbuild index 0429b0dbbad..d5fb13f1b4f 100644 --- a/reactos/base/applications/mscutils/servman/servman.rbuild +++ b/reactos/base/applications/mscutils/servman/servman.rbuild @@ -26,7 +26,6 @@ progress.c propsheet.c query.c - reg.c servman.c start.c