0
HHOOK WINAPI SetWindowsHookEx(
  _In_  int idHook,
  _In_  HOOKPROC lpfn,
  _In_  HINSTANCE hMod,
  _In_  DWORD dwThreadId
);

On MSDN listed available idHook values, there are:

  • WH_CALLWNDPROC
  • WH_CALLWNDPROCRET
  • WH_CBT WH_DEBUG
  • WH_FOREGROUNDIDLE
  • WH_GETMESSAGE
  • WH_JOURNALPLAYBACK
  • WH_JOURNALRECORD
  • WH_KEYBOARD
  • WH_KEYBOARD_LL
  • WH_MOUSE
  • WH_MOUSE_LL
  • WH_MSGFILTER
  • WH_SHELL
  • WH_SYSMSGFILTER

So, what idHook should be used for hook DeviceIOControl function (for console application)? Or may i'd use some other hook method?

Reddy
  • 943
  • 6
  • 12
  • 21

1 Answers1

2

DeviceIOControl is for interacting with drivers, and non of the hooks windows provides in user mode allow hooking driver interaction, instead you best best would be to write a filter using the windows DDK/WDK/Windows SDK (depending what windows version you are targeting).

Necrolis
  • 25,836
  • 3
  • 63
  • 101
  • Hm, i've heard from several people it is possible. For example: http://forum.madshi.net/viewtopic.php?p=14942 – Reddy Sep 05 '12 at 09:48
  • 1
    @Reddy: thats a different type of hooking, which is not only intrusive, but not officially supported by windows (which my cause AV problems etc), but if you want that kind of thing, then that link is your answer... – Necrolis Sep 05 '12 at 10:22