Initial
This commit is contained in:
45
watchdog/CBThunkCtrlhandler.hpp
Normal file
45
watchdog/CBThunkCtrlhandler.hpp
Normal file
@@ -0,0 +1,45 @@
|
||||
#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
|
||||
Reference in New Issue
Block a user