From 88900f429a9c2cf7e2c00d085f694a89ff8da77b Mon Sep 17 00:00:00 2001 From: Dmitry Timoshkov Date: Wed, 22 Sep 2010 15:49:45 +0900 Subject: [PATCH] user32: Make sure that SendInput always initializes the time field. --- dlls/user32/input.c | 4 ++-- dlls/winex11.drv/keyboard.c | 2 ++ dlls/winex11.drv/mouse.c | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/dlls/user32/input.c b/dlls/user32/input.c index 0dccf211425..6e1e459cfb2 100644 --- a/dlls/user32/input.c +++ b/dlls/user32/input.c @@ -167,7 +167,7 @@ void WINAPI keybd_event( BYTE bVk, BYTE bScan, input.u.ki.wVk = bVk; input.u.ki.wScan = bScan; input.u.ki.dwFlags = dwFlags; - input.u.ki.time = GetTickCount(); + input.u.ki.time = 0; input.u.ki.dwExtraInfo = dwExtraInfo; SendInput( 1, &input, sizeof(input) ); } @@ -186,7 +186,7 @@ void WINAPI mouse_event( DWORD dwFlags, DWORD dx, DWORD dy, input.u.mi.dy = dy; input.u.mi.mouseData = dwData; input.u.mi.dwFlags = dwFlags; - input.u.mi.time = GetCurrentTime(); + input.u.mi.time = 0; input.u.mi.dwExtraInfo = dwExtraInfo; SendInput( 1, &input, sizeof(input) ); } diff --git a/dlls/winex11.drv/keyboard.c b/dlls/winex11.drv/keyboard.c index 02fd6bbac60..d6054d6bd9f 100644 --- a/dlls/winex11.drv/keyboard.c +++ b/dlls/winex11.drv/keyboard.c @@ -1158,6 +1158,8 @@ void X11DRV_send_keyboard_input( WORD wVk, WORD wScan, DWORD event_flags, DWORD WORD flags, wVkStripped, wVkL, wVkR, vk_hook = wVk; LPARAM lParam = 0; + if (!time) time = GetTickCount(); + wVk = LOBYTE(wVk); flags = LOBYTE(wScan); diff --git a/dlls/winex11.drv/mouse.c b/dlls/winex11.drv/mouse.c index cf988c9c700..922df659593 100644 --- a/dlls/winex11.drv/mouse.c +++ b/dlls/winex11.drv/mouse.c @@ -345,6 +345,8 @@ void X11DRV_send_mouse_input( HWND hwnd, DWORD flags, DWORD x, DWORD y, { POINT pt; + if (!time) time = GetTickCount(); + if (flags & MOUSEEVENTF_MOVE && flags & MOUSEEVENTF_ABSOLUTE) { if (injected_flags & LLMHF_INJECTED) -- 2.11.4.GIT