SetWindowsHookEx for DeviceIOControl, what hookid to be used?

时光怂恿深爱的人放手 提交于 2019-12-12 04:09:41

问题


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?


回答1:


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).



来源:https://stackoverflow.com/questions/12278529/setwindowshookex-for-deviceiocontrol-what-hookid-to-be-used

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!