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

45 lines
1.1 KiB
C++

#ifndef _WATCHDOG_CBTHUNKCTRLHANDLER_HPP_
#define _HOOKPROC_CBTHUNKCTRLHANDLER_HPP_
#ifndef _HOOKPROC_APIENTRY_HPP_
#include <hookproc/apientry.hpp>
#endif
#ifndef _HOOKPROC_PROCADDRESS_HPP_
#include <hookproc/procaddr.hpp>
#endif
class CBThunkCtrlHandler;
typedef ProcAddress<CBThunkCtrlHandler> CBThunkCtrlHandlerProc;
class CBThunkCtrlHandler : protected APIEntry, private CBThunkCtrlHandlerProc
{
public:
typedef void (WINAPI *LPFNCONTROLHANDLER)(DWORD control);
CBThunkCtrlHandler(void);
virtual ~CBThunkCtrlHandler();
DWORD getAddress(void);
protected:
virtual void controlHandler(DWORD control);
private:
enum {ParamLength=4};
CBThunkCtrlHandler &operator=(const CBThunkCtrlHandler &cbThunkSvcMain);
void entryProc(DWORD control);
};
inline
CBThunkCtrlHandler::CBThunkCtrlHandler(void)
: APIEntry(ParamLength,(DWORD)this,getProcAddress((ProcAddress<CBThunkCtrlHandler>::LPFNMETHODVOID)&CBThunkCtrlHandler::entryProc))
{
}
inline
CBThunkCtrlHandler &CBThunkCtrlHandler::operator=(const CBThunkCtrlHandler &CBThunkCtrlHandler)
{ // no implementation
return *this;
}
inline
DWORD CBThunkCtrlHandler::getAddress(void)
{
return codeBase();
}
#endif