#ifndef _WATCHDOG_CBTHUNKSVCMAIN_HPP_ #define _HOOKPROC_CBTHUNKSVCMAIN_HPP_ #ifndef _HOOKPROC_APIENTRY_HPP_ #include #endif #ifndef _HOOKPROC_PROCADDRESS_HPP_ #include #endif class CBThunkSvcMain; typedef ProcAddress 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::LPFNMETHODVOID)&CBThunkSvcMain::entryProc)) { } inline CBThunkSvcMain &CBThunkSvcMain::operator=(const CBThunkSvcMain &cbThunkSvcMain) { // no implementation return *this; } inline DWORD CBThunkSvcMain::getAddress(void) { return codeBase(); } #endif