src/Common/Service/ServiceManager.h

Go to the documentation of this file.
00001 #pragma once
00002 
00003 namespace AppSecInc 
00004 {
00005     namespace Service 
00006     {
00008         class ServiceManager
00009         {
00010         private:
00011             SC_HANDLE m_h;
00012         public:
00013             ServiceManager();
00014             virtual ~ServiceManager();
00016             void Open(const std::wstring& computer_name, const std::wstring& database_name, DWORD access = SC_MANAGER_ALL_ACCESS);
00018             void Open(DWORD access = SC_MANAGER_ALL_ACCESS);
00020             void Close();
00022             bool IsOpen() const { return m_h != NULL; }
00024             SC_HANDLE GetHandle() const { return m_h; }
00026                         std::list<ServiceStatusProcess> GetServices(
00027                                 DWORD service_type = SERVICE_WIN32, 
00028                                 DWORD service_state = SERVICE_STATE_ALL,
00029                                 LPCTSTR service_group_name = NULL) const;
00031                         bool ServiceExists(const std::wstring& name);
00032         };
00033     }
00034 }
00035 


© Application Security Inc. - All Rights Reserved http://msiext.codeplex.com