campo-sirio/SSAservice/ESignService.h

47 lines
1.7 KiB
C++

/****************************** Module Header ******************************\
* Module Name: SampleService.h
* Project: CppWindowsService
* Copyright (c) Microsoft Corporation.
*
* Provides a sample service class that derives from the service base class -
* CServiceBase. The sample service logs the service start and stop
* information to the Application event log, and shows how to run the main
* function of the service in a thread pool worker thread.
*
* This source is subject to the Microsoft Public License.
* See http://www.microsoft.com/en-us/openness/resources/licenses.aspx#MPL.
* All other rights reserved.
*
* THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
* EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
\***************************************************************************/
#pragma once
#include "ServiceBase.h"
#include "PathName.h"
class CESignService : public CServiceBase
{
private:
BOOL m_fStopping;
HANDLE m_hStoppedEvent;
protected:
virtual void OnStart(DWORD dwArgc, PWSTR *pszArgv);
virtual void OnStop();
char ParseHex(const char* hex) const;
const char* ParseString(const char* s, std::string& str) const;
bool ParseGET(const char* get, CPathName& src, CPathName& dst,
CPathName& bck, std::string& pin, std::string& ext) const;
public:
CESignService(LPCTSTR pszServiceName, BOOL fCanStop = TRUE,
BOOL fCanShutdown = TRUE, BOOL fCanPauseContinue = FALSE);
void ServiceLoop(void);
virtual ~CESignService();
};