From 2f379cef010275ff83531e3e0cbc5ed1cae1ff3d Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 8 May 2002 05:46:30 -0300 Subject: Add several services for NT --- sql/nt_servc.cc | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'sql/nt_servc.cc') diff --git a/sql/nt_servc.cc b/sql/nt_servc.cc index 8c705a94f55..be2ceb9cb7a 100644 --- a/sql/nt_servc.cc +++ b/sql/nt_servc.cc @@ -479,3 +479,33 @@ If this condition persist, reboot the machine and try again\n"); return ret_value; } +/* ------------------------------------------------------------------------ + -------------------------------------------------------------------------- */ +BOOL NTService::IsService(LPCSTR ServiceName) +{ + BOOL ret_value=FALSE; + SC_HANDLE service, scm; + + if (scm = OpenSCManager(0, 0,SC_MANAGER_ENUMERATE_SERVICE)) + { + if ((service = OpenService(scm,ServiceName, SERVICE_ALL_ACCESS ))) + { + ret_value=TRUE; + CloseServiceHandle(service); + } + CloseServiceHandle(scm); + } + return ret_value; +} +/* ------------------------------------------------------------------------ + -------------------------------------------------------------------------- */ +BOOL NTService::got_service_option(char **argv, char *service_option) +{ + char *option = argv[1]; + + while (*option) + if (!strcmp(option++, service_option)) + return TRUE; + + return FALSE; +} -- cgit v1.2.1