Avoid assertion failure when loading an empty data file.
[wine] / dlls / user / hook.c
1 /*
2  * Windows hook functions
3  *
4  * Copyright 2002 Alexandre Julliard
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  *
20  * NOTES:
21  *   Status of the various hooks:
22  *     WH_MSGFILTER                 OK
23  *     WH_JOURNALRECORD             Partially implemented
24  *     WH_JOURNALPLAYBACK           Partially implemented
25  *     WH_KEYBOARD                  OK
26  *     WH_GETMESSAGE                OK (FIXME: A/W mapping?)
27  *     WH_CALLWNDPROC               OK (FIXME: A/W mapping?)
28  *     WH_CBT
29  *       HCBT_MOVESIZE              OK
30  *       HCBT_MINMAX                OK
31  *       HCBT_QS                    OK
32  *       HCBT_CREATEWND             OK
33  *       HCBT_DESTROYWND            OK
34  *       HCBT_ACTIVATE              OK
35  *       HCBT_CLICKSKIPPED          OK
36  *       HCBT_KEYSKIPPED            OK
37  *       HCBT_SYSCOMMAND            OK
38  *       HCBT_SETFOCUS              OK
39  *     WH_SYSMSGFILTER              OK
40  *     WH_MOUSE                     OK
41  *     WH_HARDWARE                  Not supported in Win32
42  *     WH_DEBUG                     Not implemented
43  *     WH_SHELL
44  *       HSHELL_WINDOWCREATED       OK
45  *       HSHELL_WINDOWDESTROYED     OK
46  *       HSHELL_ACTIVATESHELLWINDOW Not implemented
47  *       HSHELL_WINDOWACTIVATED     Not implemented
48  *       HSHELL_GETMINRECT          Not implemented
49  *       HSHELL_REDRAW              Not implemented
50  *       HSHELL_TASKMAN             Not implemented
51  *       HSHELL_LANGUAGE            Not implemented
52  *       HSHELL_SYSMENU             Not implemented
53  *       HSHELL_ENDTASK             Not implemented
54  *       HSHELL_ACCESSIBILITYSTATE  Not implemented
55  *       HSHELL_APPCOMMAND          Not implemented
56  *       HSHELL_WINDOWREPLACED      Not implemented
57  *       HSHELL_WINDOWREPLACING     Not implemented
58  *     WH_FOREGROUNDIDLE            Not implemented
59  *     WH_CALLWNDPROCRET            OK (FIXME: A/W mapping?)
60  *     WH_KEYBOARD_LL               Implemented but should use SendMessage instead
61  *     WH_MOUSE_LL                  Implemented but should use SendMessage instead
62  */
63
64 #include "config.h"
65 #include "wine/port.h"
66
67 #include <stdarg.h>
68
69 #include "windef.h"
70 #include "winbase.h"
71 #include "winuser.h"
72 #include "winerror.h"
73 #include "message.h"
74 #include "win.h"
75 #include "user_private.h"
76 #include "wine/server.h"
77 #include "wine/unicode.h"
78 #include "wine/debug.h"
79 #include "winternl.h"
80
81 WINE_DEFAULT_DEBUG_CHANNEL(hook);
82 WINE_DECLARE_DEBUG_CHANNEL(relay);
83
84 static const char * const hook_names[WH_MAXHOOK - WH_MINHOOK + 1] =
85 {
86     "WH_MSGFILTER",
87     "WH_JOURNALRECORD",
88     "WH_JOURNALPLAYBACK",
89     "WH_KEYBOARD",
90     "WH_GETMESSAGE",
91     "WH_CALLWNDPROC",
92     "WH_CBT",
93     "WH_SYSMSGFILTER",
94     "WH_MOUSE",
95     "WH_HARDWARE",
96     "WH_DEBUG",
97     "WH_SHELL",
98     "WH_FOREGROUNDIDLE",
99     "WH_CALLWNDPROCRET",
100     "WH_KEYBOARD_LL",
101     "WH_MOUSE_LL"
102 };
103
104
105 /***********************************************************************
106  *              get_ll_hook_timeout
107  *
108  */
109 static UINT get_ll_hook_timeout(void)
110 {
111     /* FIXME: should retrieve LowLevelHooksTimeout in HKEY_CURRENT_USER\Control Panel\Desktop */
112     return 2000;
113 }
114
115
116 /***********************************************************************
117  *              set_windows_hook
118  *
119  * Implementation of SetWindowsHookExA and SetWindowsHookExW.
120  */
121 static HHOOK set_windows_hook( INT id, HOOKPROC proc, HINSTANCE inst, DWORD tid, BOOL unicode )
122 {
123     HHOOK handle = 0;
124     WCHAR module[MAX_PATH];
125     DWORD len;
126
127     if (!proc)
128     {
129         SetLastError( ERROR_INVALID_FILTER_PROC );
130         return 0;
131     }
132
133     if (tid)  /* thread-local hook */
134     {
135         if (id == WH_JOURNALRECORD ||
136             id == WH_JOURNALPLAYBACK ||
137             id == WH_KEYBOARD_LL ||
138             id == WH_MOUSE_LL ||
139             id == WH_SYSMSGFILTER)
140         {
141             /* these can only be global */
142             SetLastError( ERROR_INVALID_PARAMETER );
143             return 0;
144         }
145         inst = 0;
146     }
147     else  /* system-global hook */
148     {
149         if (id == WH_KEYBOARD_LL || id == WH_MOUSE_LL) inst = 0;
150         else if (!inst || !(len = GetModuleFileNameW( inst, module, MAX_PATH )) || len >= MAX_PATH)
151         {
152             SetLastError( ERROR_HOOK_NEEDS_HMOD );
153             return 0;
154         }
155     }
156
157     SERVER_START_REQ( set_hook )
158     {
159         req->id      = id;
160         req->tid     = tid;
161         req->unicode = unicode;
162         if (inst) /* make proc relative to the module base */
163         {
164             req->proc = (void *)((char *)proc - (char *)inst);
165             wine_server_add_data( req, module, strlenW(module) * sizeof(WCHAR) );
166         }
167         else req->proc = proc;
168
169         if (!wine_server_call_err( req )) handle = reply->handle;
170     }
171     SERVER_END_REQ;
172
173     TRACE( "%s %p %lx -> %p\n", hook_names[id-WH_MINHOOK], proc, tid, handle );
174     return handle;
175 }
176
177
178 /***********************************************************************
179  *              call_hook_AtoW
180  */
181 static LRESULT call_hook_AtoW( HOOKPROC proc, INT id, INT code, WPARAM wparam, LPARAM lparam )
182 {
183     LRESULT ret;
184     UNICODE_STRING usBuffer;
185     if (id != WH_CBT || code != HCBT_CREATEWND) ret = proc( code, wparam, lparam );
186     else
187     {
188         CBT_CREATEWNDA *cbtcwA = (CBT_CREATEWNDA *)lparam;
189         CBT_CREATEWNDW cbtcwW;
190         CREATESTRUCTW csW;
191
192         cbtcwW.lpcs = &csW;
193         cbtcwW.hwndInsertAfter = cbtcwA->hwndInsertAfter;
194         csW = *(CREATESTRUCTW *)cbtcwA->lpcs;
195
196         if (HIWORD(cbtcwA->lpcs->lpszName))
197         {
198             RtlCreateUnicodeStringFromAsciiz(&usBuffer,cbtcwA->lpcs->lpszName);
199             csW.lpszName = usBuffer.Buffer;
200         }
201         if (HIWORD(cbtcwA->lpcs->lpszClass))
202         {
203             RtlCreateUnicodeStringFromAsciiz(&usBuffer,cbtcwA->lpcs->lpszClass);
204             csW.lpszClass = usBuffer.Buffer;
205         }
206         ret = proc( code, wparam, (LPARAM)&cbtcwW );
207         cbtcwA->hwndInsertAfter = cbtcwW.hwndInsertAfter;
208         if (HIWORD(csW.lpszName)) HeapFree( GetProcessHeap(), 0, (LPWSTR)csW.lpszName );
209         if (HIWORD(csW.lpszClass)) HeapFree( GetProcessHeap(), 0, (LPWSTR)csW.lpszClass );
210     }
211     return ret;
212 }
213
214
215 /***********************************************************************
216  *              call_hook_WtoA
217  */
218 static LRESULT call_hook_WtoA( HOOKPROC proc, INT id, INT code, WPARAM wparam, LPARAM lparam )
219 {
220     LRESULT ret;
221
222     if (id != WH_CBT || code != HCBT_CREATEWND) ret = proc( code, wparam, lparam );
223     else
224     {
225         CBT_CREATEWNDW *cbtcwW = (CBT_CREATEWNDW *)lparam;
226         CBT_CREATEWNDA cbtcwA;
227         CREATESTRUCTA csA;
228         int len;
229
230         cbtcwA.lpcs = &csA;
231         cbtcwA.hwndInsertAfter = cbtcwW->hwndInsertAfter;
232         csA = *(CREATESTRUCTA *)cbtcwW->lpcs;
233
234         if (HIWORD(cbtcwW->lpcs->lpszName)) {
235             len = WideCharToMultiByte( CP_ACP, 0, cbtcwW->lpcs->lpszName, -1, NULL, 0, NULL, NULL );
236             csA.lpszName = HeapAlloc( GetProcessHeap(), 0, len*sizeof(CHAR) );
237             WideCharToMultiByte( CP_ACP, 0, cbtcwW->lpcs->lpszName, -1, (LPSTR)csA.lpszName, len, NULL, NULL );
238         }
239
240         if (HIWORD(cbtcwW->lpcs->lpszClass)) {
241             len = WideCharToMultiByte( CP_ACP, 0, cbtcwW->lpcs->lpszClass, -1, NULL, 0, NULL, NULL );
242             csA.lpszClass = HeapAlloc( GetProcessHeap(), 0, len*sizeof(CHAR) );
243             WideCharToMultiByte( CP_ACP, 0, cbtcwW->lpcs->lpszClass, -1, (LPSTR)csA.lpszClass, len, NULL, NULL );
244         }
245
246         ret = proc( code, wparam, (LPARAM)&cbtcwA );
247         cbtcwW->hwndInsertAfter = cbtcwA.hwndInsertAfter;
248         if (HIWORD(csA.lpszName)) HeapFree( GetProcessHeap(), 0, (LPSTR)csA.lpszName );
249         if (HIWORD(csA.lpszClass)) HeapFree( GetProcessHeap(), 0, (LPSTR)csA.lpszClass );
250     }
251     return ret;
252 }
253
254
255 /***********************************************************************
256  *              call_hook
257  */
258 static LRESULT call_hook( HOOKPROC proc, INT id, INT code, WPARAM wparam, LPARAM lparam,
259                           BOOL prev_unicode, BOOL next_unicode )
260 {
261     LRESULT ret;
262
263     if (TRACE_ON(relay))
264         DPRINTF( "%04lx:Call hook proc %p (id=%s,code=%x,wp=%08x,lp=%08lx)\n",
265                  GetCurrentThreadId(), proc, hook_names[id-WH_MINHOOK], code, wparam, lparam );
266
267     if (!prev_unicode == !next_unicode) ret = proc( code, wparam, lparam );
268     else if (prev_unicode) ret = call_hook_WtoA( proc, id, code, wparam, lparam );
269     else ret = call_hook_AtoW( proc, id, code, wparam, lparam );
270
271     if (TRACE_ON(relay))
272         DPRINTF( "%04lx:Ret  hook proc %p (id=%s,code=%x,wp=%08x,lp=%08lx) retval=%08lx\n",
273                  GetCurrentThreadId(), proc, hook_names[id-WH_MINHOOK], code, wparam, lparam, ret );
274
275     return ret;
276 }
277
278
279 /***********************************************************************
280  *              get_hook_proc
281  *
282  * Retrieve the hook procedure real value for a module-relative proc
283  */
284 static HOOKPROC get_hook_proc( HOOKPROC proc, const WCHAR *module )
285 {
286     HMODULE mod;
287
288     if (!(mod = GetModuleHandleW(module)))
289     {
290         TRACE( "loading %s\n", debugstr_w(module) );
291         /* FIXME: the library will never be freed */
292         if (!(mod = LoadLibraryW(module))) return NULL;
293     }
294     return (HOOKPROC)((char *)mod + (ULONG_PTR)proc);
295 }
296
297
298 /***********************************************************************
299  *              HOOK_CallHooks
300  */
301 LRESULT HOOK_CallHooks( INT id, INT code, WPARAM wparam, LPARAM lparam, BOOL unicode )
302 {
303     MESSAGEQUEUE *queue = QUEUE_Current();
304     HOOKPROC proc = NULL;
305     HHOOK handle = 0;
306     DWORD pid = 0, tid = 0;
307     WCHAR module[MAX_PATH];
308     BOOL unicode_hook = FALSE;
309     LRESULT ret = 0;
310
311     if (!queue) return 0;
312     SERVER_START_REQ( start_hook_chain )
313     {
314         req->id = id;
315         wine_server_set_reply( req, module, sizeof(module)-sizeof(WCHAR) );
316         if (!wine_server_call( req ))
317         {
318             module[wine_server_reply_size(req) / sizeof(WCHAR)] = 0;
319             handle       = reply->handle;
320             proc         = reply->proc;
321             pid          = reply->pid;
322             tid          = reply->tid;
323             unicode_hook = reply->unicode;
324         }
325     }
326     SERVER_END_REQ;
327
328     if (tid)
329     {
330         TRACE( "calling hook in thread %04lx %s code %x wp %x lp %lx\n",
331                tid, hook_names[id-WH_MINHOOK], code, wparam, lparam );
332
333         switch(id)
334         {
335         case WH_KEYBOARD_LL:
336             MSG_SendInternalMessageTimeout( pid, tid, WM_WINE_KEYBOARD_LL_HOOK, wparam, lparam,
337                                             SMTO_ABORTIFHUNG, get_ll_hook_timeout(), &ret );
338             break;
339         case WH_MOUSE_LL:
340             MSG_SendInternalMessageTimeout( pid, tid, WM_WINE_MOUSE_LL_HOOK, wparam, lparam,
341                                             SMTO_ABORTIFHUNG, get_ll_hook_timeout(), &ret );
342             break;
343         }
344     }
345     else if (proc)
346     {
347         TRACE( "calling hook %p %s code %x wp %x lp %lx module %s\n",
348                proc, hook_names[id-WH_MINHOOK], code, wparam, lparam, debugstr_w(module) );
349
350         if (!module[0] || (proc = get_hook_proc( proc, module )) != NULL)
351         {
352             int locks = WIN_SuspendWndsLock();
353             HHOOK prev = queue->hook;
354             queue->hook = handle;
355             ret = call_hook( proc, id, code, wparam, lparam, unicode, unicode_hook );
356             queue->hook = prev;
357             WIN_RestoreWndsLock( locks );
358         }
359
360     }
361     else return 0;
362
363     SERVER_START_REQ( finish_hook_chain )
364     {
365         req->id = id;
366         wine_server_call( req );
367     }
368     SERVER_END_REQ;
369     return ret;
370 }
371
372
373 /***********************************************************************
374  *           HOOK_IsHooked
375  */
376 BOOL HOOK_IsHooked( INT id )
377 {
378     return TRUE;  /* FIXME */
379 }
380
381
382 /***********************************************************************
383  *              SetWindowsHookA (USER32.@)
384  */
385 HHOOK WINAPI SetWindowsHookA( INT id, HOOKPROC proc )
386 {
387     return SetWindowsHookExA( id, proc, 0, GetCurrentThreadId() );
388 }
389
390
391 /***********************************************************************
392  *              SetWindowsHookW (USER32.@)
393  */
394 HHOOK WINAPI SetWindowsHookW( INT id, HOOKPROC proc )
395 {
396     return SetWindowsHookExW( id, proc, 0, GetCurrentThreadId() );
397 }
398
399
400 /***********************************************************************
401  *              SetWindowsHookExA (USER32.@)
402  */
403 HHOOK WINAPI SetWindowsHookExA( INT id, HOOKPROC proc, HINSTANCE inst, DWORD tid )
404 {
405     return set_windows_hook( id, proc, inst, tid, FALSE );
406 }
407
408 /***********************************************************************
409  *              SetWindowsHookExW (USER32.@)
410  */
411 HHOOK WINAPI SetWindowsHookExW( INT id, HOOKPROC proc, HINSTANCE inst, DWORD tid )
412 {
413     return set_windows_hook( id, proc, inst, tid, TRUE );
414 }
415
416
417 /***********************************************************************
418  *              UnhookWindowsHook (USER32.@)
419  */
420 BOOL WINAPI UnhookWindowsHook( INT id, HOOKPROC proc )
421 {
422     BOOL ret;
423
424     TRACE( "%s %p\n", hook_names[id-WH_MINHOOK], proc );
425
426     SERVER_START_REQ( remove_hook )
427     {
428         req->handle = 0;
429         req->id   = id;
430         req->proc = proc;
431         ret = !wine_server_call_err( req );
432     }
433     SERVER_END_REQ;
434     return ret;
435 }
436
437
438
439 /***********************************************************************
440  *              UnhookWindowsHookEx (USER32.@)
441  */
442 BOOL WINAPI UnhookWindowsHookEx( HHOOK hhook )
443 {
444     BOOL ret;
445
446     TRACE( "%p\n", hhook );
447
448     SERVER_START_REQ( remove_hook )
449     {
450         req->handle = hhook;
451         ret = !wine_server_call_err( req );
452     }
453     SERVER_END_REQ;
454     return ret;
455 }
456
457
458 /***********************************************************************
459  *              CallNextHookEx (USER32.@)
460  */
461 LRESULT WINAPI CallNextHookEx( HHOOK hhook, INT code, WPARAM wparam, LPARAM lparam )
462 {
463     MESSAGEQUEUE *queue = QUEUE_Current();
464     HOOKPROC proc = NULL;
465     WCHAR module[MAX_PATH];
466     HHOOK handle = 0;
467     DWORD pid = 0, tid = 0;
468     INT id = 0;
469     BOOL prev_unicode = FALSE, next_unicode = FALSE;
470     LRESULT ret = 0;
471
472     if (!queue) return 0;
473
474     SERVER_START_REQ( get_next_hook )
475     {
476         req->handle = queue->hook;
477         wine_server_set_reply( req, module, sizeof(module)-sizeof(WCHAR) );
478         if (!wine_server_call_err( req ))
479         {
480             module[wine_server_reply_size(req) / sizeof(WCHAR)] = 0;
481             handle       = reply->next;
482             id           = reply->id;
483             pid          = reply->pid;
484             tid          = reply->tid;
485             proc         = reply->proc;
486             prev_unicode = reply->prev_unicode;
487             next_unicode = reply->next_unicode;
488         }
489     }
490     SERVER_END_REQ;
491
492     if (tid)
493     {
494         TRACE( "calling hook in thread %04lx %s code %x wp %x lp %lx\n",
495                tid, hook_names[id-WH_MINHOOK], code, wparam, lparam );
496
497         switch(id)
498         {
499         case WH_KEYBOARD_LL:
500             MSG_SendInternalMessageTimeout( pid, tid, WM_WINE_KEYBOARD_LL_HOOK, wparam, lparam,
501                                             SMTO_ABORTIFHUNG, get_ll_hook_timeout(), &ret );
502             break;
503         case WH_MOUSE_LL:
504             MSG_SendInternalMessageTimeout( pid, tid, WM_WINE_MOUSE_LL_HOOK, wparam, lparam,
505                                             SMTO_ABORTIFHUNG, get_ll_hook_timeout(), &ret );
506             break;
507         }
508     }
509     else if (proc)
510     {
511         TRACE( "calling hook %p %s code %x wp %x lp %lx module %s\n",
512                proc, hook_names[id-WH_MINHOOK], code, wparam, lparam, debugstr_w(module) );
513
514         if (!module[0] || (proc = get_hook_proc( proc, module )) != NULL)
515         {
516             HHOOK prev = queue->hook;
517             queue->hook = handle;
518             ret = call_hook( proc, id, code, wparam, lparam, prev_unicode, next_unicode );
519             queue->hook = prev;
520         }
521     }
522     return ret;
523 }
524
525
526 /***********************************************************************
527  *              CallMsgFilterA (USER32.@)
528  */
529 BOOL WINAPI CallMsgFilterA( LPMSG msg, INT code )
530 {
531     if (HOOK_CallHooks( WH_SYSMSGFILTER, code, 0, (LPARAM)msg, FALSE )) return TRUE;
532     return HOOK_CallHooks( WH_MSGFILTER, code, 0, (LPARAM)msg, FALSE );
533 }
534
535
536 /***********************************************************************
537  *              CallMsgFilterW (USER32.@)
538  */
539 BOOL WINAPI CallMsgFilterW( LPMSG msg, INT code )
540 {
541     if (HOOK_CallHooks( WH_SYSMSGFILTER, code, 0, (LPARAM)msg, TRUE )) return TRUE;
542     return HOOK_CallHooks( WH_MSGFILTER, code, 0, (LPARAM)msg, TRUE );
543 }
544
545
546 /***********************************************************************
547  *           SetWinEventHook                            [USER32.@]
548  *
549  * Set up an event hook for a set of events.
550  *
551  * PARAMS
552  *  dwMin     [I] Lowest event handled by pfnProc
553  *  dwMax     [I] Highest event handled by pfnProc
554  *  hModule   [I] DLL containing pfnProc
555  *  pfnProc   [I] Callback event hook function
556  *  dwProcess [I] Process to get events from, or 0 for all processes
557  *  dwThread  [I] Thread to get events from, or 0 for all threads
558  *  dwFlags   [I] Flags indicating the status of pfnProc
559  *
560  * RETURNS
561  *  Success: A handle representing the hook.
562  *  Failure: A NULL handle.
563  *
564  * BUGS
565  *  Not implemented.
566  */
567 HWINEVENTHOOK WINAPI SetWinEventHook(DWORD dwMin, DWORD dwMax, HMODULE hModule,
568                                      WINEVENTPROC pfnProc, DWORD dwProcess,
569                                      DWORD dwThread, DWORD dwFlags)
570 {
571     FIXME("(%ld,%ld,%p,%p,%ld,%ld,0x%08lx)-stub!\n", dwMin, dwMax, hModule,
572           pfnProc, dwProcess, dwThread, dwFlags);
573     return 0;
574 }
575
576
577 /***********************************************************************
578  *           UnhookWinEvent                             [USER32.@]
579  *
580  * Remove an event hook for a set of events.
581  *
582  * PARAMS
583  *  hEventHook [I] Event hook to remove
584  *
585  * RETURNS
586  *  Success: TRUE. The event hook has been removed.
587  *  Failure: FALSE, if hEventHook is invalid.
588  *
589  * BUGS
590  *  Not implemented.
591  */
592 BOOL WINAPI UnhookWinEvent(HWINEVENTHOOK hEventHook)
593 {
594     FIXME("(%p)-stub!\n", hEventHook);
595
596     return (hEventHook != 0);
597 }
598
599
600 /***********************************************************************
601  *           NotifyWinEvent                             [USER32.@]
602  *
603  * Inform the OS that an event has occurred.
604  *
605  * PARAMS
606  *  dwEvent  [I] Id of the event
607  *  hWnd     [I] Window holding the object that created the event
608  *  nId      [I] Type of object that created the event
609  *  nChildId [I] Child object of nId, or CHILDID_SELF.
610  *
611  * RETURNS
612  *  Nothing.
613  *
614  * BUGS
615  *  Not implemented.
616  */
617 void WINAPI NotifyWinEvent(DWORD dwEvent, HWND hWnd, LONG nId, LONG nChildId)
618 {
619     FIXME("(%ld,%p,%ld,%ld)-stub!\n", dwEvent, hWnd, nId, nChildId);
620 }
621
622
623 /***********************************************************************
624  *           IsWinEventHookInstalled                       [USER32.@]
625  *
626  * Determine if an event hook is installed for an event.
627  *
628  * PARAMS
629  *  dwEvent  [I] Id of the event
630  *
631  * RETURNS
632  *  TRUE,  If there are any hooks installed for the event.
633  *  FALSE, Otherwise.
634  *
635  * BUGS
636  *  Not implemented.
637  */
638 BOOL WINAPI IsWinEventHookInstalled(DWORD dwEvent)
639 {
640     FIXME("(%ld)-stub!\n", dwEvent);
641     return TRUE;
642 }