1
0
mirror of https://github.com/FunkyFr3sh/cnc-ddraw.git synced 2025-03-14 22:03:27 +01:00

log SetWindowsHookExA hook types

This commit is contained in:
FunkyFr3sh 2024-11-25 21:20:29 +01:00
parent 6a22fcf142
commit e6c9eea473
3 changed files with 54 additions and 0 deletions

View File

@ -28,6 +28,7 @@ void dbg_dump_dds_flags(DWORD flags);
void dbg_dump_dds_blt_fast_flags(DWORD flags);
void dbg_dump_dds_lock_flags(DWORD flags);
void dbg_dump_di_scm_flags(DWORD flags);
void dbg_dump_hook_type(int idHook);
char* dbg_d3d9_hr_to_str(HRESULT hr);
char* dbg_mes_to_str(int id);
void __cdecl dbg_invoke_watson(wchar_t const*, wchar_t const*, wchar_t const*, unsigned int, uintptr_t);

View File

@ -1114,6 +1114,57 @@ void dbg_dump_di_scm_flags(DWORD flags)
#endif
}
void dbg_dump_hook_type(int idHook)
{
#ifdef _DEBUG
if (idHook == 0) {
TRACE(" WH_JOURNALRECORD\n");
}
if (idHook == 1) {
TRACE(" WH_JOURNALPLAYBACK\n");
}
if (idHook == 2) {
TRACE(" WH_KEYBOARD\n");
}
if (idHook == 3) {
TRACE(" WH_GETMESSAGE\n");
}
if (idHook == 4) {
TRACE(" WH_CALLWNDPROC\n");
}
if (idHook == 5) {
TRACE(" WH_CBT\n");
}
if (idHook == 6) {
TRACE(" WH_SYSMSGFILTER\n");
}
if (idHook == 7) {
TRACE(" WH_MOUSE\n");
}
if (idHook == 9) {
TRACE(" WH_DEBUG\n");
}
if (idHook == 10) {
TRACE(" WH_SHELL\n");
}
if (idHook == 11) {
TRACE(" WH_FOREGROUNDIDLE\n");
}
if (idHook == 12) {
TRACE(" WH_CALLWNDPROCRET\n");
}
if (idHook == 13) {
TRACE(" WH_KEYBOARD_LL\n");
}
if (idHook == 14) {
TRACE(" WH_MOUSE_LL\n");
}
if (idHook == -1) {
TRACE(" WH_MSGFILTER\n");
}
#endif
}
char* dbg_d3d9_hr_to_str(HRESULT hr)
{
#define HR_TO_STR(x) if (x == hr) return #x

View File

@ -591,6 +591,8 @@ HHOOK WINAPI fake_SetWindowsHookExA(int idHook, HOOKPROC lpfn, HINSTANCE hmod, D
dwThreadId,
_ReturnAddress());
dbg_dump_hook_type(idHook);
if (idHook == WH_KEYBOARD_LL && hmod && GetModuleHandle("AcGenral") == hmod)
{
return NULL;