-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathuser_tracker_service.h
37 lines (29 loc) · 1.04 KB
/
user_tracker_service.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#ifndef USER_TRACKER_SERVICE_H_
#define USER_TRACKER_SERVICE_H_
#include <fstream>
#include "service_base.h"
class UserTrackerService : public ServiceBase {
public:
UserTrackerService(const UserTrackerService& other) = delete;
UserTrackerService& operator=(const UserTrackerService& other) = delete;
UserTrackerService(UserTrackerService&& other) = delete;
UserTrackerService& operator=(UserTrackerService&& other) = delete;
UserTrackerService()
: ServiceBase(_T("UserTrackerService"),
_T("User tracker service"),
SERVICE_DEMAND_START,
SERVICE_ERROR_NORMAL,
SERVICE_ACCEPT_STOP | SERVICE_ACCEPT_SESSIONCHANGE) {}
private:
void OnStart(DWORD argc, TCHAR* argv[]) override;
void OnStop() override;
void OnSessionChange(DWORD evtType,
WTSSESSION_NOTIFICATION* notification) override;
#ifdef UNICODE
using tofstream = std::wofstream;
#else
using tofstream = std::ofstream;
#endif
tofstream m_logFile;
};
#endif // USER_TRACKER_SERVICE_H_