Hooking IServerTools finctions leads to compile-time errors
I'm trying to hook SetKeyValue functions from IServerTools:
PHP Code:
error: redefinition of '__SourceHook_FHCls_IServerToolsSetKeyValue0' Though the functions are not the same and have different parameters. What is the proper way to define them? Here my corrent definitions: PHP Code:
|
Re: Hooking IServerTools finctions leads to compile-time errors
As the docs say, you need to use the fourth parameter to the macro for overloads. Make them 0, 1, and 2 (or whatever as long as they're different).
|
Re: Hooking IServerTools finctions leads to compile-time errors
Thanks, I managed to hook them. I have one last question, how can I bypass the hooks?
That's how I try to do it: PHP Code:
Code:
error: no matching function for call to 'SH_CALL2' |
Re: Hooking IServerTools finctions leads to compile-time errors
Off the top of my head, I'm not sure. If the reason it can't infer the template parameters is because the function is an overload, you could try casting the MFP and do something like this:
Code:
SH_CALL(servertools, static_cast<bool (IServerTools::*)(void *, const char *, const char *)>(&IServerTools::SetKeyValue))(p1, p2, p3) |
Re: Hooking IServerTools finctions leads to compile-time errors
I agree with what Fyren said.
EmitSound methods are overloaded too and they use something similar in SDKTools. |
All times are GMT -4. The time now is 19:21. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.