dont remove all hooks when 0 in hcode

This commit is contained in:
Akash Mozumdar 2019-02-16 00:24:36 -05:00
parent 95a988f19b
commit 9ed3900512

View File

@ -164,7 +164,7 @@ void NewHook(HookParam hp, LPCSTR lpname, DWORD flag)
if (++currentHook >= MAX_HOOK) return ConsoleOutput(TOO_MANY_HOOKS); if (++currentHook >= MAX_HOOK) return ConsoleOutput(TOO_MANY_HOOKS);
if (lpname && *lpname) strncpy_s(hp.name, lpname, HOOK_NAME_SIZE - 1); if (lpname && *lpname) strncpy_s(hp.name, lpname, HOOK_NAME_SIZE - 1);
ConsoleOutput(INSERTING_HOOK, hp.name); ConsoleOutput(INSERTING_HOOK, hp.name);
RemoveHook(hp.address, 0); if (hp.address) RemoveHook(hp.address, 0);
if (!hooks[currentHook].Insert(hp, flag)) ConsoleOutput(HOOK_FAILED); if (!hooks[currentHook].Insert(hp, flag)) ConsoleOutput(HOOK_FAILED);
} }
} }