Files
Work/watchdog/CBThunkSvcMain.hpp
2024-08-07 09:16:27 -04:00

45 lines
1.1 KiB
C++

#ifndef _WATCHDOG_CBTHUNKSVCMAIN_HPP_
#define _HOOKPROC_CBTHUNKSVCMAIN_HPP_
#ifndef _HOOKPROC_APIENTRY_HPP_
#include <hookproc/apientry.hpp>
#endif
#ifndef _HOOKPROC_PROCADDRESS_HPP_
#include <hookproc/procaddr.hpp>
#endif
class CBThunkSvcMain;
typedef ProcAddress<CBThunkSvcMain> CBThunkSvcMainProc;
class CBThunkSvcMain : protected APIEntry, private CBThunkSvcMainProc
{
public:
typedef void (WINAPI *LPFNSERVICEMAIN)(DWORD dwArg,LPTSTR *pszArg);
CBThunkSvcMain(void);
virtual ~CBThunkSvcMain();
DWORD getAddress(void);
protected:
virtual void serviceMain(DWORD dwArg,LPTSTR *pszArg);
private:
enum {ParamLength=8};
CBThunkSvcMain &operator=(const CBThunkSvcMain &cbThunkSvcMain);
void entryProc(DWORD dwArg,LPTSTR *pszArg);
};
inline
CBThunkSvcMain::CBThunkSvcMain(void)
: APIEntry(ParamLength,(DWORD)this,getProcAddress((ProcAddress<CBThunkSvcMain>::LPFNMETHODVOID)&CBThunkSvcMain::entryProc))
{
}
inline
CBThunkSvcMain &CBThunkSvcMain::operator=(const CBThunkSvcMain &cbThunkSvcMain)
{ // no implementation
return *this;
}
inline
DWORD CBThunkSvcMain::getAddress(void)
{
return codeBase();
}
#endif