I have a template class where typename is a pointer to a function:
CHook<NTSTATUS(__stdcall*)(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,HANDLE,PCLIENT_ID,PCONTEXT,PUSER_STACK,BOOLEAN)> hZwCreateThread;
Now I call them like hZwCreateThread.Call()(…params…); but I want to make it hZwCreateThread(…params…) using () operator overloading.
This code:
const FuncType operator()() { return m_OrigFunc; };
Makes it work only in such way: hZwCreateThread()(…params…). How to make it work as I wrote above?
You can use a conversion operator.
This would allow code like this: