ReactOS 0.4.15-dev-7961-gdcf9eb0
AttachThreadInput.c
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS api tests
3 * LICENSE: GPL - See COPYING in the top level directory
4 * PURPOSE: Test for AttachThreadInput
5 * PROGRAMMERS: Giannis Adamopoulos
6 */
7
8#include "precomp.h"
9
10typedef struct {
18
21
22static THREAD_DATA data[6];
23static HHOOK hMouseHookLL = NULL;
24static HHOOK hKbdHookLL = NULL;
25
26
27#define EXPECT_FOREGROUND(expected) ok(GetForegroundWindow() == expected, \
28 "Expected hwnd%d at the foreground, got hwnd%d\n", \
29 get_iwnd(expected), get_iwnd(GetForegroundWindow()));
30
31#define EXPECT_ACTIVE(expected) ok(GetActiveWindow() == expected, \
32 "Expected hwnd%d to be active, got hwnd%d\n", \
33 get_iwnd(expected), get_iwnd(GetActiveWindow()));
34
35/*
36 * Helper functions
37 */
38
39static int get_iwnd(HWND hWnd)
40{
41 if(hWnd == data[0].hWnd) return 0;
42 else if(hWnd == data[1].hWnd) return 1;
43 else if(hWnd == data[2].hWnd) return 2;
44 else if(hWnd == data[3].hWnd) return 3;
45 else if(hWnd == data[4].hWnd) return 4;
46 else return -1;
47}
48
50{
51 int iwnd = get_iwnd(hWnd);
52
53 if(iwnd >= 0 && message > 0 && message < WM_APP && message != WM_TIMER)
54 record_message(&data[iwnd].cache, iwnd, message, SENT, wParam,0);
55
57}
58
59static void FlushMessages()
60{
61 MSG msg;
63
64 while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE ))
65 {
66 int iwnd = get_iwnd(msg.hwnd);
67 if( iwnd >= 0 && msg.message > 0 && msg.message < WM_APP && msg.message != WM_TIMER)
68 record_message(&data[0].cache, iwnd, msg.message, POST, msg.wParam,0);
70 }
71
72 /* Use SendMessage to sync with the other queues */
74 ok (res != ERROR_TIMEOUT, "SendMessageTimeout timed out\n");
76 ok (res != ERROR_TIMEOUT, "SendMessageTimeout timed out\n");
78 ok (res != ERROR_TIMEOUT, "SendMessageTimeout timed out\n");
80 ok (res != ERROR_TIMEOUT, "SendMessageTimeout timed out\n");
81}
82
84{
85 THREAD_DATA* current_data = (THREAD_DATA*)param;
86 MSG msg;
87 HDESK hdesk = NULL;
88 int iwnd;
89
90 if(current_data->Desktop)
91 {
92 hdesk = CreateDesktopW(current_data->Desktop, NULL, NULL, 0, DESKTOP_ALL_ACCESS, NULL );
93 SetThreadDesktop(hdesk);
94 }
95
96 /* create test window */
97 current_data->hWnd = CreateWindowW(L"TestClass", L"test", WS_OVERLAPPEDWINDOW,
98 100, 100, 500, 500, NULL, NULL, 0, NULL);
99 SetEvent( current_data->StartEvent );
100
101 iwnd = get_iwnd(current_data->hWnd);
102
103 /* Use MsgWaitForMultipleObjects to let the thread process apcs */
104 while( GetMessage(&msg, 0,0,0) )
105 {
106 if(msg.message > 0 && msg.message < WM_APP && msg.message != WM_TIMER )
107 record_message(&data[iwnd].cache, iwnd, msg.message, POST, msg.wParam,0);
109 }
110
111 if(hdesk)
112 CloseDesktop(hdesk);
113
114 return 0;
115}
116
118{
119 DWORD ret;
120
121 data[i].StartEvent = CreateEventW(NULL, 0, 0, NULL);
122 data[i].Desktop = Desktop;
123 data[i].hThread = CreateThread(NULL, 0, thread_proc, &data[i], 0, &data[i].tid);
124 if(!data[i].hThread) goto fail;
127 if(ret == WAIT_TIMEOUT)
128 {
129fail:
130 win_skip("child thread failed to initialize\n");
131 return FALSE;
132 }
133 return TRUE;
134}
135
137{
138 LRESULT ret;
140
142
143 if((params->flags & LLKHF_INJECTED) == 0)
144 return TRUE;
145
146 return ret;
147}
148
150{
151 LRESULT ret;
153
155
156 if((params->flags & LLKHF_INJECTED) == 0)
157 return TRUE;
158
159 return ret;
160}
161
163{
164 /* Create a LL hook that drops any physical keyboard and mouse action
165 and prevent the user from interfering with the test results */
166 if(!IsDebuggerPresent())
167 {
169 ok(hMouseHookLL!=NULL,"failed to set hook\n");
171 ok(hKbdHookLL!=NULL,"failed to set hook\n");
172 }
173
174 /* create test clases */
175 RegisterSimpleClass(TestProc, L"TestClass");
176
177 memset(&data[0], 0, sizeof(data[0]));
178
179 data[0].tid = GetCurrentThreadId();
180
181 /* create test window */
182 data[0].hWnd = CreateWindowW(L"TestClass", L"test", WS_OVERLAPPEDWINDOW,
183 100, 100, 500, 500, NULL, NULL, 0, NULL);
184 if(!data[0].hWnd)
185 {
186 win_skip("CreateWindowW failed\n");
187 return FALSE;
188 }
189
190 /* create thread1(same desktop) */
191 if(!CreateTestThread(1, NULL)) return FALSE;
192
193 /* create thread2(same desktop) */
194 if(!CreateTestThread(2, NULL)) return FALSE;
195
196 /* create thread3(different desktop) */
197 if(!CreateTestThread(3, L"ThreadTestDesktop")) return FALSE;
198
199 /* create thread4(different desktop) */
200 if(!CreateTestThread(4, L"ThreadTestDesktop")) return FALSE;
201
202 return TRUE;
203}
204
206{
207 int i,j;
208 BOOL ret;
209
210 for(i = 0; i< 4; i++)
211 {
212 for(j = 0; j< 4; j++)
213 {
215 ok(ret==0, "expected AttachThreadInput to fail\n");
216 }
217 }
218}
219
220
221
222
223/*
224 * The actual tests
225 */
226
228{
229 BOOL ret;
230 /* FIXME: acording to msdn xp doesn't set last error but vista+ does*/
231
232 /* test wrong thread */
233 ret = AttachThreadInput( 0, 1, TRUE);
234 ok(ret==0, "expected AttachThreadInput to fail\n");
235
236 /* test same thread */
238 ok(ret==0, "expected AttachThreadInput to fail\n");
239
240 /* try to attach to a thread on another desktop*/
242 ok(ret==0, "expected AttachThreadInput to fail\n");
243 if(ret == 1 )
245
246 /* test other desktop to this */
248 ok(ret==0, "expected AttachThreadInput to fail\n");
249 if(ret == 1 )
251
252 /* attach two threads that are both in ThreadTestDesktop */
253 {
254 /* Attach thread 3 and 4 */
256 ok(ret==1, "expected AttachThreadInput to succeed\n");
257
258 /* cleanup previous attachment */
260 ok(ret==1, "expected AttachThreadInput to succeed\n");
261 }
262
263 {
264 /* Attach thread 1 and 2 */
266 ok(ret==1, "expected AttachThreadInput to succeed\n");
267
268 /* attach already attached*/
270 ok(ret==1, "expected AttachThreadInput to succeed\n");
271
272 /* attach in the opposite order */
274 ok(ret==1, "expected AttachThreadInput to succeed\n");
275
276 /* Now try to detach 0 from 1 */
278 ok(ret==0, "expected AttachThreadInput to fail\n");
279
280 /* also try to detach 3 from 2 */
282 ok(ret==0, "expected AttachThreadInput to fail\n");
283
284 /* cleanup previous attachment */
286 ok(ret==1, "expected AttachThreadInput to succeed\n");
287
289 ok(ret==1, "expected AttachThreadInput to succeed\n");
290
292 ok(ret==1, "expected AttachThreadInput to succeed\n");
293 }
294
295 /* test triple attach */
296 {
298 ok(ret==1, "expected AttachThreadInput to succeed\n");
300 ok(ret==1, "expected AttachThreadInput to succeed\n");
301
302 /* try to detach 2 and 0 */
304 ok(ret==0, "expected AttachThreadInput to fail\n");
306 ok(ret==0, "expected AttachThreadInput to fail\n");
307
308 /* try to to attach 0 to 2. it works! */
310 ok(ret==1, "expected AttachThreadInput to succeed\n");
311
313 ok(ret==1, "expected AttachThreadInput to succeed\n");
314
315 /* detach in inverse order */
317 ok(ret==1, "expected AttachThreadInput to succeed\n");
319 ok(ret==1, "expected AttachThreadInput to succeed\n");
320 }
321
322 /* test detaching in thread cleanup */
323 {
325 ok(ret==1, "expected AttachThreadInput to succeed\n");
327 ok(ret==1, "expected AttachThreadInput to succeed\n");
329 ok(ret==1, "expected AttachThreadInput to succeed\n");
331 ok(ret==1, "expected AttachThreadInput to succeed\n");
332
334
336 ok(ret==0, "expected AttachThreadInput to fail\n");
338 ok(ret==0, "expected AttachThreadInput to fail\n");
339
340 /* Create Thread1 again */
342 }
343
344}
345
346void Test_Focus() //Focus Active Capture Foreground Capture
347{
348 BOOL ret;
349
350 trace("Thread hWnd0 0x%p hWnd1 0x%p\n",data[0].hWnd, data[1].hWnd);
351 /* Window 1 is in the foreground */
355
358
359 /* attach thread 0 to 1 */
360 {
362 ok(ret==1, "expected AttachThreadInput to succeed\n");
364
367
369 ok(ret==1, "expected AttachThreadInput to succeed\n");
370 }
371
373 EXPECT_ACTIVE(0);
374
378
381
382 /* attach thread 1 to 0 */
383 {
385 ok(ret==1, "expected AttachThreadInput to succeed\n");
387
390
392 ok(ret==1, "expected AttachThreadInput to succeed\n");
393 }
394
395 /* Window 0 is in the foreground */
399
402
403 /* attach thread 0 to 1 */
404 {
406 ok(ret==1, "expected AttachThreadInput to succeed\n");
408
411
415
418
420 ok(ret==1, "expected AttachThreadInput to succeed\n");
421 }
422
424 EXPECT_ACTIVE(0);
425
429
432
433 /* attach thread 1 to 0 */
434 {
436 ok(ret==1, "expected AttachThreadInput to succeed\n");
438
441
445
448
450 ok(ret==1, "expected AttachThreadInput to succeed\n");
451 }
452}
453
454/* test some functions like PostMessage and SendMessage that shouldn't be affected */
456{
457 BOOL ret;
458 LRESULT res;
459
462
463 /* test that messages posted before and after attachment are unaffected
464 and that we don't receive a meassage from a window we shouldn't */
465 PostMessage(data[0].hWnd, WM_USER, 0,0);
466 PostMessage(data[1].hWnd, WM_USER, 1,0);
467
468 {
469 MSG_ENTRY Thread0_chain[]={
470 {0,WM_USER, POST, 0, 0},
471 {0,WM_USER, POST, 2, 0},
472 {0,0}};
473 MSG_ENTRY Thread1_chain[]={
474 {1,WM_USER, POST, 1, 0},
475 {1,WM_USER, POST, 3, 0},
476 {0,0}};
477
479 ok(ret==1, "expected AttachThreadInput to succeed\n");
480
481 PostMessage(data[0].hWnd, WM_USER, 2,0);
482 PostMessage(data[1].hWnd, WM_USER, 3,0);
483
485 Sleep(100);
486
487 COMPARE_CACHE_(&data[0].cache, Thread0_chain);
488 COMPARE_CACHE_(&data[1].cache, Thread1_chain);
489
491 ok(ret==1, "expected AttachThreadInput to succeed\n");
492 }
493
494 /* test messages send to the wrong thread */
496 ok (res != ERROR_TIMEOUT, "SendMessageTimeout timed out\n");
498 ok (res != ERROR_TIMEOUT, "SendMessageTimeout timed out\n");
499
500 {
501 MSG_ENTRY Thread0_chain[]={
502 {0,WM_USER, SENT, 0, 0},
503 {0,WM_USER, SENT, 2, 0},
504 {0,0}};
505 MSG_ENTRY Thread1_chain[]={
506 {1,WM_USER, SENT, 1, 0},
507 {1,WM_USER, SENT, 3, 0},
508 {1,WM_MOUSEMOVE, SENT, 0, 0},
509 {0,0}};
510
512 ok(ret==1, "expected AttachThreadInput to succeed\n");
513
515 ok (res != ERROR_TIMEOUT, "SendMessageTimeout timed out\n");
517 ok (res != ERROR_TIMEOUT, "SendMessageTimeout timed out\n");
518
519 /* Try to send a fake input message */
521 ok (res != ERROR_TIMEOUT, "SendMessageTimeout timed out\n");
522
523 COMPARE_CACHE_(&data[0].cache, Thread0_chain);
524 COMPARE_CACHE_(&data[1].cache, Thread1_chain);
525
527 ok(ret==1, "expected AttachThreadInput to succeed\n");
528 }
529
530 /* todo: test keyboard layout that shouldn't be affected */
531}
532
534{
535 MSG_ENTRY Thread1_chain[]={
536 {1,WM_KEYDOWN, POST, VK_SHIFT, 0},
537 {1,WM_KEYUP, POST, VK_SHIFT, 0},
538 {0,0}};
539 MSG_ENTRY Thread0_chain[]={
540 {0,WM_KEYDOWN, POST, VK_SHIFT, 0},
541 {0,WM_KEYUP, POST, VK_SHIFT, 0},
542 {0,0}};
543
544 BOOL ret;
545
546 //trace("Thread hWnd0 0x%p hWnd1 0x%p\n",data[0].hWnd, data[1].hWnd);
547
548 /* First try sending input without attaching. It will go to the foreground */
549 {
552
553 ok(GetForegroundWindow() == data[1].hWnd, "wrong foreground got 0x%p\n",GetForegroundWindow());
554 ok(GetActiveWindow() == data[0].hWnd, "wrong active got 0x%p\n",GetActiveWindow());
555
559
560 keybd_event(VK_SHIFT, 0,0,0);
562 Sleep(100);
564
566 COMPARE_CACHE_(&data[1].cache, Thread1_chain);
567 }
568
569 /* Next attach and send input. It will go to the same thread as before */
570 { // from to
572 ok(ret==1, "expected AttachThreadInput to succeed\n");
573
577
578 keybd_event(VK_SHIFT, 0,0,0);
580 Sleep(100);
582
584 COMPARE_CACHE_(&data[1].cache, Thread1_chain);
585 }
586
587 /* Now set foreground and active again. Input will go to thread 0 */
588 {
592
593 ok(GetForegroundWindow() == data[0].hWnd, "wrong foreground got 0x%p\n",GetForegroundWindow());
594 ok(GetActiveWindow() == data[0].hWnd, "wrong active got 0x%p\n",GetActiveWindow());
595
598
599 keybd_event(VK_SHIFT, 0,0,0);
601 Sleep(100);
603
604 COMPARE_CACHE_(&data[0].cache, Thread0_chain);
606
608 ok(ret==1, "expected AttachThreadInput to succeed\n");
609 }
610
611 /* Attach in the opposite order and send input */
612 {
614 ok(ret==1, "expected AttachThreadInput to succeed\n");
615
619
620 keybd_event(VK_SHIFT, 0,0,0);
622 Sleep(100);
624
625 COMPARE_CACHE_(&data[0].cache, Thread0_chain);
627 }
628
629 /* Now set foreground and active again. Input will go to thread 0 */
630 {
634
635 ok(GetForegroundWindow() == data[0].hWnd, "wrong foreground got 0x%p\n",GetForegroundWindow());
636 ok(GetActiveWindow() == data[0].hWnd, "wrong active got 0x%p\n",GetActiveWindow());
637
640
641 keybd_event(VK_SHIFT, 0,0,0);
643 Sleep(100);
645
646 COMPARE_CACHE_(&data[0].cache, Thread0_chain);
648
650 ok(ret==1, "expected AttachThreadInput to succeed\n");
651 }
652}
653
655{
656 if(!InitThreads())
657 return;
658
661 Test_Focus();
667
668 if(hMouseHookLL)
670 if(hKbdHookLL)
672
673 /* Stop all threads and exit gratefully */
678}
679
LRESULT CALLBACK KbdLLHookProc(int nCode, WPARAM wParam, LPARAM lParam)
static void FlushMessages()
static DWORD WINAPI thread_proc(void *param)
void Test_UnaffectedMessages()
static HHOOK hMouseHookLL
void Test_SendInput()
BOOL CreateTestThread(int i, WCHAR *Desktop)
#define EXPECT_FOREGROUND(expected)
static int get_iwnd(HWND hWnd)
static void cleanup_attachments()
static LRESULT CALLBACK MouseLLHookProc(int nCode, WPARAM wParam, LPARAM lParam)
void Test_SimpleParameters()
#define EXPECT_ACTIVE(expected)
static HHOOK hKbdHookLL
void Test_Focus()
BOOLEAN InitThreads()
unsigned char BOOLEAN
#define trace
Definition: atltest.h:70
#define ok(value,...)
Definition: atltest.h:57
#define START_TEST(x)
Definition: atltest.h:75
#define msg(x)
Definition: auth_time.c:54
HWND hWnd
Definition: settings.c:17
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define WAIT_TIMEOUT
Definition: dderror.h:14
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define CloseHandle
Definition: compat.h:739
#define CALLBACK
Definition: compat.h:35
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
Definition: loader.c:838
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
Definition: thread.c:137
BOOL WINAPI TerminateThread(IN HANDLE hThread, IN DWORD dwExitCode)
Definition: thread.c:587
#define WM_APP
Definition: eventvwr.h:73
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLuint res
Definition: glext.h:9613
GLenum const GLfloat * params
Definition: glext.h:5645
GLfloat param
Definition: glext.h:5796
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
#define DESKTOP_ALL_ACCESS
Definition: precomp.h:22
static TfClientId tid
MSG_ENTRY empty_chain[]
Definition: msgtrace.c:20
void record_message(MSG_CACHE *cache, int iwnd, UINT message, MSG_TYPE type, int param1, int param2)
Definition: msgtrace.c:179
#define COMPARE_CACHE_(cache, msg_chain)
Definition: msgtrace.h:62
@ POST
Definition: msgtrace.h:7
@ SENT
Definition: msgtrace.h:6
#define EMPTY_CACHE_(cache)
Definition: msgtrace.h:64
unsigned int UINT
Definition: ndis.h:50
HANDLE hThread
Definition: wizard.c:28
#define L(x)
Definition: ntvdm.h:50
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
#define TestProc(n)
Definition: queuetest.c:15
#define DefWindowProc
Definition: ros2win.h:31
#define win_skip
Definition: test.h:160
#define memset(x, y, z)
Definition: compat.h:39
MSG_CACHE cache
HANDLE QueueStatusEvent
Definition: msgtrace.h:15
Definition: cache.c:49
Definition: tftpd.h:60
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
Definition: synch.c:790
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventW(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCWSTR lpName OPTIONAL)
Definition: synch.c:651
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
Definition: synch.c:733
HANDLE StartEvent
Definition: thmsvc.c:26
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829
static __inline ATOM RegisterSimpleClass(WNDPROC lpfnWndProc, LPCWSTR lpszClassName)
int ret
HDESK WINAPI CreateDesktopW(LPCWSTR lpszDesktop, LPCWSTR lpszDevice, LPDEVMODEW pDevmode, DWORD dwFlags, ACCESS_MASK dwDesiredAccess, LPSECURITY_ATTRIBUTES lpsa)
Definition: desktop.c:473
DWORD WINAPI GetCurrentThreadId(void)
Definition: thread.c:459
BOOL WINAPI IsDebuggerPresent(void)
Definition: debugger.c:580
LONG_PTR LPARAM
Definition: windef.h:208
LONG_PTR LRESULT
Definition: windef.h:209
UINT_PTR WPARAM
Definition: windef.h:207
#define WINAPI
Definition: msvc.h:6
#define ERROR_TIMEOUT
Definition: winerror.h:941
LRESULT WINAPI DispatchMessageA(_In_ const MSG *)
#define SendMessageTimeout
Definition: winuser.h:5845
HWND WINAPI GetActiveWindow(void)
Definition: winpos.c:138
#define WM_QUIT
Definition: winuser.h:1623
#define WM_KEYUP
Definition: winuser.h:1716
HWND WINAPI GetForegroundWindow(void)
Definition: ntwrapper.h:392
BOOL WINAPI AttachThreadInput(_In_ DWORD, _In_ DWORD, _In_ BOOL)
BOOL WINAPI SetThreadDesktop(_In_ HDESK)
HHOOK WINAPI SetWindowsHookExW(_In_ int, _In_ HOOKPROC, _In_opt_ HINSTANCE, _In_ DWORD)
BOOL WINAPI SetForegroundWindow(_In_ HWND)
#define WM_MOUSEMOVE
Definition: winuser.h:1775
#define PostThreadMessage
Definition: winuser.h:5833
#define GetMessage
Definition: winuser.h:5790
#define WH_MOUSE_LL
Definition: winuser.h:44
BOOL WINAPI UnhookWindowsHookEx(_In_ HHOOK)
HWND WINAPI SetActiveWindow(_In_ HWND)
#define WM_TIMER
Definition: winuser.h:1742
#define PM_REMOVE
Definition: winuser.h:1196
#define PeekMessage
Definition: winuser.h:5830
#define WH_KEYBOARD_LL
Definition: winuser.h:43
#define LLKHF_INJECTED
Definition: winuser.h:2646
#define CreateWindowW(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4316
VOID WINAPI keybd_event(_In_ BYTE, _In_ BYTE, _In_ DWORD, _In_ ULONG_PTR)
#define PostMessage
Definition: winuser.h:5832
LRESULT WINAPI CallNextHookEx(_In_opt_ HHOOK, _In_ int, _In_ WPARAM, _In_ LPARAM)
#define WM_USER
Definition: winuser.h:1895
#define VK_SHIFT
Definition: winuser.h:2202
#define WM_KEYDOWN
Definition: winuser.h:1715
#define DispatchMessage
Definition: winuser.h:5765
BOOL WINAPI CloseDesktop(_In_ HDESK)
#define KEYEVENTF_KEYUP
Definition: winuser.h:1102
#define SMTO_NORMAL
Definition: winuser.h:1225
__wchar_t WCHAR
Definition: xmlstorage.h:180