Initial
This commit is contained in:
44
socket/HOOKER.HPP
Normal file
44
socket/HOOKER.HPP
Normal file
@@ -0,0 +1,44 @@
|
||||
#ifndef _SOCKET_BLOCKHOOKER_HPP_
|
||||
#define _SOCKET_BLOCKHOOKER_HPP_
|
||||
#ifndef _COMMON_WINDOWS_HPP_
|
||||
#include <common/windows.hpp>
|
||||
#endif
|
||||
#ifndef _COMMON_CODEGEN_HPP_
|
||||
#include <common/codegen.hpp>
|
||||
#endif
|
||||
#ifndef _COMMON_CALLBACK_HPP_
|
||||
#include <common/callback.hpp>
|
||||
#endif
|
||||
#ifndef _SOCKET_PROCADDRESS_HPP_
|
||||
#include <socket/procaddr.hpp>
|
||||
#endif
|
||||
|
||||
class BlockHooker
|
||||
{
|
||||
public:
|
||||
BlockHooker(void);
|
||||
virtual ~BlockHooker();
|
||||
BOOL hookBlock(void);
|
||||
BOOL unhookBlock(void);
|
||||
BOOL cancelBlocking(void);
|
||||
void setHandler(PureCallback *lpCallback);
|
||||
private:
|
||||
BlockHooker(const BlockHooker &someBlockHooker);
|
||||
BlockHooker &operator=(const BlockHooker &someBlockHooker);
|
||||
BOOL operator==(const BlockHooker &someBlockHooker)const;
|
||||
BOOL cancelBlockingCall(void);
|
||||
BOOL isBlocking(void);
|
||||
BOOL hookProc(void);
|
||||
BOOL yield(void);
|
||||
|
||||
CodeGen mCodeGenerator;
|
||||
BOOL mIsHooked;
|
||||
CallbackPointer mCallback;
|
||||
};
|
||||
|
||||
inline
|
||||
void BlockHooker::setHandler(PureCallback *lpCallback)
|
||||
{
|
||||
mCallback=CallbackPointer(lpCallback);
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user