source: nscp/include/EnumNtSrv.h @ 34e7428

0.4.00.4.10.4.2stable
Last change on this file since 34e7428 was 34e7428, checked in by Michael Medin <michael@…>, 5 years ago

Added new option (namespace) to CheckWMI and CheckWMIValue use like so:

CheckWMI namespace=root
cimv2 MaxCrit=3 MinWarn=1 "Query:load=Select * from win32_Processor"

  • Property mode set to 100644
File size: 2.1 KB
Line 
1/*#############################################################################
2# ENUMNTSRV.H
3#
4# SCA Software International S.A.
5# http://www.scasoftware.com
6# scaadmin@scasoftware.com
7#
8# Copyright (c) 1999 SCA Software International S.A.
9#
10# Date: 05.12.1999.
11# Author: Zoran M.Todorovic
12#
13# This software is provided "AS IS", without a warranty of any kind.
14# You are free to use/modify this code but leave this header intact.
15#
16#############################################################################*/
17
18#ifndef __ENUMNTSRV_H__
19#define __ENUMNTSRV_H__
20
21#if _MSC_VER > 1000
22#pragma once
23#endif // _MSC_VER > 1000
24
25#include <list>
26#include <string>
27#include <strEx.h>
28
29class TNtServiceInfo;
30
31typedef std::list<TNtServiceInfo> TNtServiceInfoList;
32
33//=============================================================================
34// class TNtServiceInfo
35//
36//=============================================================================
37
38class NTServiceException {
39private:
40        std::wstring name_;
41        std::wstring msg_;
42public:
43        NTServiceException(std::wstring name,std::wstring msg) : name_(name), msg_(msg) {};
44
45        std::wstring getError() {
46                return _T("Service: '") + name_ + _T("' caused: ") + msg_;
47        }
48};
49
50class TNtServiceInfo {
51public:
52        std::wstring m_strServiceName;
53        std::wstring m_strDisplayName;
54        std::wstring m_strBinaryPath;
55        DWORD m_dwServiceType;
56        DWORD m_dwStartType;
57        DWORD m_dwErrorControl;
58        DWORD m_dwCurrentState;
59
60public:
61        TNtServiceInfo();
62        TNtServiceInfo(const TNtServiceInfo& source);
63        TNtServiceInfo& operator=(const TNtServiceInfo& source);
64        virtual ~TNtServiceInfo();
65
66        std::wstring GetServiceType(void);
67        std::wstring GetStartType(void);
68        std::wstring GetErrorControl(void);
69        std::wstring GetCurrentState(void);
70
71        static TNtServiceInfoList EnumServices(DWORD dwType, DWORD dwState);
72        //static void EnumServices(DWORD dwType, DWORD dwState, TNtServiceInfoList *pList);
73        static TNtServiceInfo GetService(std::wstring);
74};
75
76#endif
77
78/*#############################################################################
79# End of file ENUMNTSRV.H
80#############################################################################*/
Note: See TracBrowser for help on using the repository browser.