Open luca2125 opened 4 years ago
I think this is not related to MinHook, it's just deadlock in DllMain because it's useless for anything than simple variables initialization: https://docs.microsoft.com/en-us/windows/win32/dlls/dynamic-link-library-best-practices
Thank you for share !!
Do you have an easy example of source code in DllMain with MinHook that work ?
My source code originally work fine with ms detours, but not with MinHook.
Thanks !
@luca2125 did you manage to find a way to initialize minhook in your dll? having the same issues as you
For the moment I use ms detours that probably is not best solution, but In my case work.
i got mine to work by adding libMinHook-x86-v140-mtd.lib to the additional dependencies in the linker option and not using #pragma comment(lib, "MinHook.x86.lib")
Check if your project has generated another DLL file. (minhook.x64d.dll)
When i use MH_Initialize im my code it will require that minhook.x64d.dll will be injected first so my original ClientBaseWindow.dll is able to load.
Sadly i don't know how to fix it. send help
You have two project files: MinHook and libMinHook - use the second one in your solution and add reference to libMinHook in your project then Visual Studio will automatically build and link MinHook when you build your project.
libMinHook should be configured to output static library, so your project should not need any other dll files
Hi,
I have a full working project with ms detours and becouse I like to switch to MinHook I have replace detours code with MinHook equivalent.
I use VS2017 v141 SDK 8.1. To do the test I used "MinHook.x86.lib" v 1.3.3 in this repository (not compiled by me).
This is my reduced test code:
For some strange reason my project don't do nothing if I add this line:
if I remove this work normally.
I attach my complete project.
BattleZone Redux (MinHook).zip
and my setting:
Can you help me please ?
Thank you !!