[NMRiH/Any] DHooks with detours not superseding function
I'm trying to prevent the execution of:
PHP Code:
I successfully create the detour and simply return MRES_Supercede. Code below:
Spoiler
My gamedata:
Spoiler
My detour executes but so does the original function, why? From dhooks.inc: PHP Code:
Am I doing something wrong? |
Re: [NMRiH/Any] DHooks with detours not superseding function
I think you are failing to set the return value with DHookSetReturn. Supercede will skip the real value, but you have to set a return value for the function.
|
Re: [NMRiH/Any] DHooks with detours not superseding function
Quote:
PHP Code:
There's nothing for it to override. If it expected a return, it would have shown me this: Code:
[SM] Exception reported: Tried to override return value without return value being set |
Re: [NMRiH/Any] DHooks with detours not superseding function
https://bitbucket.org/Peace_Maker/dh....cpp#lines-434
I don't think this line should be here, and might mean that it is ignoring the next call by the game. |
Re: [NMRiH/Any] DHooks with detours not superseding function
That line is about virtual hooks using SourceHook. The example gamedata uses a detour, so it's using a different code path.
|
All times are GMT -4. The time now is 18:22. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.