summaryrefslogtreecommitdiff
path: root/sql/nt_servc.cc
diff options
context:
space:
mode:
authorunknown <miguel@hegel.local>2002-05-08 05:46:30 -0300
committerunknown <miguel@hegel.local>2002-05-08 05:46:30 -0300
commit2f379cef010275ff83531e3e0cbc5ed1cae1ff3d (patch)
treee9c69476eed5e4a97a2cc67982b7c4181189475f /sql/nt_servc.cc
parentc46074f1cdcd29ab9661dbb18c39b1fde1be75e9 (diff)
downloadmariadb-git-2f379cef010275ff83531e3e0cbc5ed1cae1ff3d.tar.gz
Add several services for NT
Diffstat (limited to 'sql/nt_servc.cc')
-rw-r--r--sql/nt_servc.cc30
1 files changed, 30 insertions, 0 deletions
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;
+}