Quantcast
Channel: CodeGuru Forums - Visual C++ Programming
Viewing all articles
Browse latest Browse all 3027

Token Pasting Question

$
0
0
I want to paste a prototype signature in every call like this
Code:

//tLocalAlloc newdata = HookedLocalAlloc;
// ##1
void* newdata = hs.hookerFunc;

For the first line, it is already working.
But the third line, the Hooking program doesn't understand void*,
I must specify the prototype in each call.
How can I use token pasting to replace the prototype over void* in every call?
Again. Nothing Malicious here, just proof of concepts. I swear...

Update:
Alternatively, I can do this instead, But I still need token pasting
Where the (tLocalAlloc) is a variable...
Code:

pHookedLocalAlloc = (tLocalAlloc)hs.hookedFunc;
Thanks
Jack

Viewing all articles
Browse latest Browse all 3027