Author: khornicek
Date: Sat Nov 21 15:05:22 2009
New Revision: 44251
URL:
http://svn.reactos.org/svn/reactos?rev=44251&view=rev
Log:
- add dummy hooks for mouse and keyboard so WH_MOUSE_LL and WH_KEYBOARD_LL hooks are
flagged as active
- needed until these two are implemented via SendMessage
Modified:
branches/arwinss/reactos/subsystems/win32/csrss/win32csr/input.c
Modified: branches/arwinss/reactos/subsystems/win32/csrss/win32csr/input.c
URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win3…
==============================================================================
--- branches/arwinss/reactos/subsystems/win32/csrss/win32csr/input.c [iso-8859-1]
(original)
+++ branches/arwinss/reactos/subsystems/win32/csrss/win32csr/input.c [iso-8859-1] Sat Nov
21 15:05:22 2009
@@ -14,6 +14,8 @@
#include <ntddmou.h>
#include <ntddkbd.h>
+static HHOOK gKeyboardHook, gMouseHook;
+
#define ClearMouseInput(mi) \
mi.dx = 0; \
mi.dy = 0; \
@@ -26,6 +28,12 @@
if(mi.dwFlags) \
mouse_event(mi.dwFlags,mi.dx,mi.dy, mi.mouseData, 0); \
ClearMouseInput(mi);
+
+
+static LRESULT CALLBACK DummyHookProc( INT code, WPARAM wparam, LPARAM lparam ){
+ return CallNextHookEx( 0, code, wparam, lparam );
+}
+
VOID FASTCALL
ProcessMouseInputData(PMOUSE_INPUT_DATA Data, ULONG InputCount)
@@ -172,6 +180,9 @@
return Status;
}
DPRINT("MouseEvent\n");
+
+ if(!gMouseHook)
+ gMouseHook = SetWindowsHookEx(WH_MOUSE_LL, DummyHookProc, NULL, 0);
ProcessMouseInputData(&MouseInput, Iosb.Information /
sizeof(MOUSE_INPUT_DATA));
}
@@ -351,6 +362,9 @@
if (KeyInput.Flags & KEY_BREAK)
flags |= KEYEVENTF_KEYUP;
+ if(!gKeyboardHook)
+ gKeyboardHook = SetWindowsHookEx(WH_KEYBOARD_LL, DummyHookProc, NULL, 0);
+
keybd_event(MapVirtualKey(KeyInput.MakeCode & 0xff, MAPVK_VSC_TO_VK),
KeyInput.MakeCode & 0xff, flags , 0);
}