[Bug 2981] direct input device only works when created in the thread which created the window

Wine Bugs wine-bugs at winehq.org
Sat May 28 08:20:46 CDT 2005


http://bugs.winehq.org/show_bug.cgi?id=2981





------- Additional Comments From allefant at gmail.com  2005-28-05 08:20 -------
Quoting MSDN about SetWindowsHookEx:

http://msdn.microsoft.com/library/en-us/winui/winui/windowsuserinterface/windowing/hooks/hookreference/hookfunctions/setwindowshookex.asp?frame=true

[quote]
dwThreadId
[in] Specifies the identifier of the thread with which the hook procedure is to
be associated. If this parameter is zero, the hook procedure is associated with
all existing threads running in the same desktop as the calling thread.
[/quote]

The case of zero is exactly what I believe is not handled, but ironically, is
what the implementor of the dinput keyboard in Wine is relying on. As I said,
fixing that would also work, but it needs a more knowledgeable person of the
wine internals to help with it (either getting a list of all threads in the
current process ("desktop" in MSDN), and always using all hooks where tid = 0,
or modifying the hooks stuff so additionally to per-thread hooks, there are
global hooks). For both, I'd need some advice, and generally a Wine developer
would be more apt to create a patch.)

About the user32 include, all I use out of it is this:

static inline struct user_thread_info *get_user_thread_info(void)
{
    return (struct user_thread_info *)NtCurrentTeb()->Win32ClientInfo;
}

So whoever applies it can simply move that into keyboard.c. Or should I do it
and re-submit the patch?

-- 
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the wine-bugs mailing list