ReactOS  0.4.15-dev-1070-ge1a01de
message.c
Go to the documentation of this file.
1 /*
2  * COPYRIGHT: See COPYING in the top level directory
3  * PROJECT: ReactOS user32.dll
4  * FILE: win32ss/user/user32/windows/message.c
5  * PURPOSE: Messages
6  * PROGRAMMER: Casper S. Hornstrup (chorns@users.sourceforge.net)
7  * UPDATE HISTORY:
8  * 06-06-2001 CSH Created
9  */
10 
11 #include <user32.h>
12 
14 
15 #ifdef __i386__
16 /* For bad applications which provide bad (non stdcall) WndProc */
17 extern
18 LRESULT
19 __cdecl
22  HWND hWnd,
23  UINT Msg,
24  WPARAM wParam,
25  LPARAM lParam);
26 #else
27 # define CALL_EXTERN_WNDPROC(proc, h, m, w, l) proc(h, m, w, l)
28 #endif
29 
30 /* From wine: */
31 /* flag for messages that contain pointers */
32 /* 32 messages per entry, messages 0..31 map to bits 0..31 */
33 
34 #define SET(msg) (1 << ((msg) & 31))
35 
36 static const unsigned int message_pointer_flags[] =
37 {
38  /* 0x00 - 0x1f */
41  /* 0x20 - 0x3f */
44  /* 0x40 - 0x5f */
46  /* 0x60 - 0x7f */
47  SET(WM_STYLECHANGING) | SET(WM_STYLECHANGED),
48  /* 0x80 - 0x9f */
50  /* 0xa0 - 0xbf */
52  /* 0xc0 - 0xdf */
54  /* 0xe0 - 0xff */
55  SET(SBM_GETRANGE) | SET(SBM_SETSCROLLINFO) | SET(SBM_GETSCROLLINFO) | SET(SBM_GETSCROLLBARINFO),
56  /* 0x100 - 0x11f */
57  0,
58  /* 0x120 - 0x13f */
59  0,
60  /* 0x140 - 0x15f */
64  /* 0x160 - 0x17f */
65  0,
66  /* 0x180 - 0x19f */
70  /* 0x1a0 - 0x1bf */
72  /* 0x1c0 - 0x1df */
73  0,
74  /* 0x1e0 - 0x1ff */
75  0,
76  /* 0x200 - 0x21f */
78  /* 0x220 - 0x23f */
81  /* 0x240 - 0x25f */
82  0,
83  /* 0x260 - 0x27f */
84  0,
85  /* 0x280 - 0x29f */
86  0,
87  /* 0x2a0 - 0x2bf */
88  0,
89  /* 0x2c0 - 0x2df */
90  0,
91  /* 0x2e0 - 0x2ff */
92  0,
93  /* 0x300 - 0x31f */
95 };
96 
97 /* check whether a given message type includes pointers */
99 {
100  if (message >= 8*sizeof(message_pointer_flags)) return FALSE;
101  if (message == WM_DEVICECHANGE && !(wparam & 0x8000)) return FALSE;
102  return (message_pointer_flags[message / 32] & SET(message)) != 0;
103 }
104 
105 #undef SET
106 
107 /* check whether a combobox expects strings or ids in CB_ADDSTRING/CB_INSERTSTRING */
109 {
112 }
113 
114 /* check whether a listbox expects strings or ids in LB_ADDSTRING/LB_INSERTSTRING */
116 {
119 }
120 
121 /* DDE message exchange
122  *
123  * - Session initialization
124  * Client sends a WM_DDE_INITIATE message, usually a broadcast message. lParam of
125  * this message contains a pair of global atoms, the Application and Topic atoms.
126  * The client must destroy the atoms.
127  * Server window proc handles the WM_DDE_INITIATE message and if the Application
128  * and Topic atoms are recognized sends a WM_DDE_ACK message to the client. lParam
129  * of the reply message contains another pair of global atoms (Application and
130  * Topic again), which must be destroyed by the server.
131  *
132  * - Execute
133  * Client posts a WM_DDE_EXECUTE message to the server window. lParam of that message
134  * is a global memory handle containing the string to execute. After the command has
135  * been executed the server posts a WM_DDE_ACK message to the client, which contains
136  * a packed lParam which in turn contains that global memory handle. The client takes
137  * ownership of both the packed lParam (meaning it needs to call FreeDDElParam() on
138  * it and the global memory handle.
139  * This might work nice and easy in Win3.1, but things are more complicated for NT.
140  * Global memory handles in NT are not really global, they're still local to the
141  * process. So, what happens under the hood is that PostMessage must handle the
142  * WM_DDE_EXECUTE message specially. It will obtain the contents of the global memory
143  * area, repack that into a new structure together with the original memory handle
144  * and pass that off to the win32k. Win32k will marshall that data over to the target
145  * (server) process where it will be unpacked and stored in a newly allocated global
146  * memory area. The handle of that area will then be sent to the window proc, after
147  * storing it together with the "original" (client) handle in a table.
148  * The server will eventually post the WM_DDE_ACK response, containing the global
149  * memory handle it received. PostMessage must then lookup that memory handle (only
150  * valid in the server process) and replace it with the corresponding client memory
151  * handle. To avoid memory leaks, the server-side global memory block must be freed.
152  * Also, the WM_DDE_ACK lParam (a PackDDElParam() result) is unpacked and the
153  * individual components are handed to win32k.sys to post to the client side. Since
154  * the server side app hands over ownership of the packed lParam when it calls
155  * PostMessage(), the packed lParam needs to be freed on the server side too.
156  * When the WM_DDE_ACK message (containing the client-side global memory handle)
157  * arrives at the client side a new lParam is PackDDElParam()'ed and this is handed
158  * to the client side window proc which is expected to free/reuse it.
159  */
160 
161 /* since the WM_DDE_ACK response to a WM_DDE_EXECUTE message should contain the handle
162  * to the memory handle, we keep track (in the server side) of all pairs of handle
163  * used (the client passes its value and the content of the memory handle), and
164  * the server stored both values (the client, and the local one, created after the
165  * content). When a ACK message is generated, the list of pair is searched for a
166  * matching pair, so that the client memory handle can be returned.
167  */
168 
169 typedef struct tagDDEPAIR
170 {
173 } DDEPAIR, *PDDEPAIR;
174 
176 static unsigned DdeNumAlloc = 0;
177 static unsigned DdeNumUsed = 0;
179 
181 DdeAddPair(HGLOBAL ClientMem, HGLOBAL ServerMem)
182 {
183  unsigned i;
184 
186 
187  /* now remember the pair of hMem on both sides */
188  if (DdeNumUsed == DdeNumAlloc)
189  {
190 #define GROWBY 4
191  PDDEPAIR New;
192  if (NULL != DdePairs)
193  {
195  (DdeNumAlloc + GROWBY) * sizeof(DDEPAIR));
196  }
197  else
198  {
200  (DdeNumAlloc + GROWBY) * sizeof(DDEPAIR));
201  }
202 
203  if (NULL == New)
204  {
206  return FALSE;
207  }
208  DdePairs = New;
209  /* zero out newly allocated part */
210  memset(&DdePairs[DdeNumAlloc], 0, GROWBY * sizeof(DDEPAIR));
211  DdeNumAlloc += GROWBY;
212 #undef GROWBY
213  }
214 
215  for (i = 0; i < DdeNumAlloc; i++)
216  {
217  if (NULL == DdePairs[i].ServerMem)
218  {
219  DdePairs[i].ClientMem = ClientMem;
220  DdePairs[i].ServerMem = ServerMem;
221  DdeNumUsed++;
222  break;
223  }
224  }
226 
227  return TRUE;
228 }
229 
231 DdeGetPair(HGLOBAL ServerMem)
232 {
233  unsigned i;
234  HGLOBAL Ret = NULL;
235 
237  for (i = 0; i < DdeNumAlloc; i++)
238  {
239  if (DdePairs[i].ServerMem == ServerMem)
240  {
241  /* free this pair */
242  DdePairs[i].ServerMem = 0;
243  DdeNumUsed--;
244  Ret = DdePairs[i].ClientMem;
245  break;
246  }
247  }
249 
250  return Ret;
251 }
252 
254 {
255  DWORD cp;
256  int ret;
257  HKL hkl = GetKeyboardLayout( 0 );
258  ret = GetLocaleInfoW( LOWORD(hkl), LOCALE_IDEFAULTANSICODEPAGE | LOCALE_RETURN_NUMBER, (WCHAR *)&cp, sizeof(cp) / sizeof(WCHAR) );
259  if (!ret) cp = CP_ACP;
260  return cp;
261 }
262 
264 {
265  WCHAR wch = wParam;
266  BYTE ch[2];
268 
269  len = WideCharToMultiByte( cp, 0, &wch, 1, (LPSTR)ch, len, NULL, NULL );
270  if (len == 2)
271  return MAKEWPARAM( (ch[0] << 8) | ch[1], HIWORD(wParam) );
272  else
273  return MAKEWPARAM( ch[0], HIWORD(wParam) );
274 }
275 
276 /***********************************************************************
277  * map_wparam_AtoW
278  *
279  * Convert the wparam of an ASCII message to Unicode.
280  */
281 static WPARAM FASTCALL
283 {
284  char ch[2];
285  WCHAR wch[2];
286 
287  wch[0] = wch[1] = 0;
288  switch(message)
289  {
290  case WM_CHAR:
291  /* WM_CHAR is magic: a DBCS char can be sent/posted as two consecutive WM_CHAR
292  * messages, in which case the first char is stored, and the conversion
293  * to Unicode only takes place once the second char is sent/posted.
294  */
295 #if 0
296  if (mapping != WMCHAR_MAP_NOMAPPING) // NlsMbCodePageTag
297  {
299 
300  struct wm_char_mapping_data *data = get_user_thread_info()->wmchar_data;
301 
302  BYTE low = LOBYTE(wparam);
303 
304  if (HIBYTE(wparam))
305  {
306  ch[0] = low;
307  ch[1] = HIBYTE(wparam);
308  RtlMultiByteToUnicodeN( wch, sizeof(wch), NULL, ch, 2 );
309  TRACE( "map %02x,%02x -> %04x mapping %u\n", (BYTE)ch[0], (BYTE)ch[1], wch[0], mapping );
310  if (data) data->lead_byte[mapping] = 0;
311  }
312  else if (data && data->lead_byte[mapping])
313  {
314  ch[0] = data->lead_byte[mapping];
315  ch[1] = low;
316  RtlMultiByteToUnicodeN( wch, sizeof(wch), NULL, ch, 2 );
317  TRACE( "map stored %02x,%02x -> %04x mapping %u\n", (BYTE)ch[0], (BYTE)ch[1], wch[0], mapping );
318  data->lead_byte[mapping] = 0;
319  }
320  else if (!IsDBCSLeadByte( low ))
321  {
322  ch[0] = low;
323  RtlMultiByteToUnicodeN( wch, sizeof(wch), NULL, ch, 1 );
324  TRACE( "map %02x -> %04x\n", (BYTE)ch[0], wch[0] );
325  if (data) data->lead_byte[mapping] = 0;
326  }
327  else /* store it and wait for trail byte */
328  {
329  if (!data)
330  {
331  if (!(data = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*data) )))
332  return FALSE;
333  get_user_thread_info()->wmchar_data = data;
334  }
335  TRACE( "storing lead byte %02x mapping %u\n", low, mapping );
336  data->lead_byte[mapping] = low;
337  return FALSE;
338  }
339  wparam = MAKEWPARAM(wch[0], wch[1]);
340  break;
341  }
342 #endif
343  /* else fall through */
344  case WM_CHARTOITEM:
345  case EM_SETPASSWORDCHAR:
346  case WM_DEADCHAR:
347  case WM_SYSCHAR:
348  case WM_SYSDEADCHAR:
349  case WM_MENUCHAR:
350  ch[0] = LOBYTE(wparam);
351  ch[1] = HIBYTE(wparam);
352  RtlMultiByteToUnicodeN( wch, sizeof(wch), NULL, ch, 2 );
353  wparam = MAKEWPARAM(wch[0], wch[1]);
354  break;
355  case WM_IME_CHAR:
356  ch[0] = HIBYTE(wparam);
357  ch[1] = LOBYTE(wparam);
358  if (ch[0]) RtlMultiByteToUnicodeN( wch, sizeof(wch[0]), NULL, ch, 2 );
359  else RtlMultiByteToUnicodeN( wch, sizeof(wch[0]), NULL, ch + 1, 1 );
360  wparam = MAKEWPARAM(wch[0], HIWORD(wparam));
361  break;
362  }
363  return wparam;
364 }
365 
366 static
368 MsgiUMToKMMessage(PMSG UMMsg, PMSG KMMsg, BOOL Posted)
369 {
370  *KMMsg = *UMMsg;
371 
372  switch (UMMsg->message)
373  {
374  case WM_COPYDATA:
375  {
376  PCOPYDATASTRUCT pUMCopyData = (PCOPYDATASTRUCT)UMMsg->lParam;
377  PCOPYDATASTRUCT pKMCopyData;
378 
379  pKMCopyData = HeapAlloc(GetProcessHeap(), 0, sizeof(COPYDATASTRUCT) + pUMCopyData->cbData);
380  if (!pKMCopyData)
381  {
383  return FALSE;
384  }
385 
386  pKMCopyData->dwData = pUMCopyData->dwData;
387  pKMCopyData->cbData = pUMCopyData->cbData;
388  pKMCopyData->lpData = pKMCopyData + 1;
389 
390  RtlCopyMemory(pKMCopyData + 1, pUMCopyData->lpData, pUMCopyData->cbData);
391 
392  KMMsg->lParam = (LPARAM)pKMCopyData;
393  }
394  break;
395 
396  case WM_COPYGLOBALDATA:
397  {
398  KMMsg->lParam = (LPARAM)GlobalLock((HGLOBAL)UMMsg->lParam);;
399  TRACE("WM_COPYGLOBALDATA get data ptr %p\n",KMMsg->lParam);
400  }
401  break;
402 
403  default:
404  break;
405  }
406 
407  return TRUE;
408 }
409 
410 static
413 {
414  switch (KMMsg->message)
415  {
416  case WM_COPYDATA:
417  HeapFree(GetProcessHeap(), 0, (LPVOID) KMMsg->lParam);
418  break;
419  case WM_COPYGLOBALDATA:
420  TRACE("WM_COPYGLOBALDATA cleanup return\n");
421  GlobalUnlock((HGLOBAL)UMMsg->lParam);
422  GlobalFree((HGLOBAL)UMMsg->lParam);
423  break;
424  default:
425  break;
426  }
427 
428  return;
429 }
430 
431 static BOOL FASTCALL
433 {
434  *UMMsg = *KMMsg;
435 
436  if (KMMsg->lParam == 0) return TRUE;
437 
438  switch (UMMsg->message)
439  {
440  case WM_CREATE:
441  case WM_NCCREATE:
442  {
443  CREATESTRUCTW *Cs = (CREATESTRUCTW *) KMMsg->lParam;
444  PCHAR Class;
445  Cs->lpszName = (LPCWSTR) ((PCHAR) Cs + (DWORD_PTR) Cs->lpszName);
446  Class = (PCHAR) Cs + (DWORD_PTR) Cs->lpszClass;
447  if (L'A' == *((WCHAR *) Class))
448  {
449  Class += sizeof(WCHAR);
450  Cs->lpszClass = (LPCWSTR)(DWORD_PTR) (*((ATOM *) Class));
451  }
452  else
453  {
454  ASSERT(L'S' == *((WCHAR *) Class));
455  Class += sizeof(WCHAR);
456  Cs->lpszClass = (LPCWSTR) Class;
457  }
458  }
459  break;
460 
461  case WM_COPYDATA:
462  {
463  PCOPYDATASTRUCT pKMCopyData = (PCOPYDATASTRUCT)KMMsg->lParam;
464  pKMCopyData->lpData = pKMCopyData + 1;
465  }
466  break;
467 
468  case WM_COPYGLOBALDATA:
469  {
470  PVOID Data;
471  HGLOBAL hGlobal = GlobalAlloc(GHND | GMEM_SHARE, KMMsg->wParam);
472  Data = GlobalLock(hGlobal);
473  if (Data) RtlCopyMemory(Data, (PVOID)KMMsg->lParam, KMMsg->wParam);
474  GlobalUnlock(hGlobal);
475  TRACE("WM_COPYGLOBALDATA to User hGlobal %p\n",hGlobal);
476  UMMsg->lParam = (LPARAM)hGlobal;
477  }
478  break;
479 
480  default:
481  break;
482  }
483 
484  return TRUE;
485 }
486 
487 static VOID FASTCALL
489 {
490  switch (KMMsg->message)
491  {
492  case WM_DDE_EXECUTE:
493 #ifdef TODO // Kept as historic.
494  HeapFree(GetProcessHeap(), 0, (LPVOID) KMMsg->lParam);
495  GlobalUnlock((HGLOBAL) UMMsg->lParam);
496 #endif
497  break;
498  default:
499  break;
500  }
501 
502  return;
503 }
504 
505 static BOOL FASTCALL
507 {
508  MsgiKMToUMCleanup(KMMsg, UMMsg);
509 
510  return TRUE;
511 }
512 
513 //
514 // Ansi to Unicode -> callout
515 //
516 static BOOL FASTCALL
518 {
520 
521  *UnicodeMsg = *AnsiMsg;
522 
523  switch (AnsiMsg->message)
524  {
525  case WM_GETTEXT:
526  case WM_ASKCBFORMATNAME:
527  {
528  LPWSTR Buffer;
529  if (!AnsiMsg->lParam) break;
531  //ERR("WM_GETTEXT A2U Size %d\n",AnsiMsg->wParam);
532  if (!Buffer) return FALSE;
533  UnicodeMsg->lParam = (LPARAM)Buffer;
534  break;
535  }
536 
537  case LB_GETTEXT:
538  {
539  DWORD Size = 1024 * sizeof(WCHAR);
540  if (!AnsiMsg->lParam || !listbox_has_strings( AnsiMsg->hwnd )) break;
541  /*Size = SendMessageW( AnsiMsg->hwnd, LB_GETTEXTLEN, AnsiMsg->wParam, 0 );
542  if (Size == LB_ERR)
543  {
544  ERR("LB_GETTEXT LB_ERR\n");
545  Size = sizeof(ULONG_PTR);
546  }
547  Size = (Size + 1) * sizeof(WCHAR);*/
549  if (!UnicodeMsg->lParam) return FALSE;
550  break;
551  }
552 
553  case CB_GETLBTEXT:
554  {
555  DWORD Size = 1024 * sizeof(WCHAR);
556  if (!AnsiMsg->lParam || !combobox_has_strings( AnsiMsg->hwnd )) break;
557  /*Size = SendMessageW( AnsiMsg->hwnd, CB_GETLBTEXTLEN, AnsiMsg->wParam, 0 );
558  if (Size == LB_ERR)
559  {
560  ERR("CB_GETTEXT LB_ERR\n");
561  Size = sizeof(ULONG_PTR);
562  }
563  Size = (Size + 1) * sizeof(WCHAR);*/
565  if (!UnicodeMsg->lParam) return FALSE;
566  break;
567  }
568 
569  /* AnsiMsg->lParam is string (0-terminated) */
570  case WM_SETTEXT:
571  case WM_WININICHANGE:
572  case WM_DEVMODECHANGE:
573  case CB_DIR:
574  case LB_DIR:
575  case LB_ADDFILE:
576  case EM_REPLACESEL:
577  {
578  if (!AnsiMsg->lParam) break;
580  UnicodeMsg->lParam = (LPARAM)UnicodeString.Buffer;
581  break;
582  }
583 
584  case LB_ADDSTRING:
585  case LB_ADDSTRING_LOWER:
586  case LB_ADDSTRING_UPPER:
587  case LB_INSERTSTRING:
590  case LB_FINDSTRING:
591  case LB_FINDSTRINGEXACT:
592  case LB_SELECTSTRING:
593  {
594  if (AnsiMsg->lParam && listbox_has_strings(AnsiMsg->hwnd))
595  {
597  UnicodeMsg->lParam = (LPARAM)UnicodeString.Buffer;
598  }
599  break;
600  }
601 
602  case CB_ADDSTRING:
603  case CB_INSERTSTRING:
604  case CB_FINDSTRING:
605  case CB_FINDSTRINGEXACT:
606  case CB_SELECTSTRING:
607  {
608  if (AnsiMsg->lParam && combobox_has_strings(AnsiMsg->hwnd))
609  {
611  UnicodeMsg->lParam = (LPARAM)UnicodeString.Buffer;
612  }
613  break;
614  }
615 
616  case WM_NCCREATE:
617  case WM_CREATE:
618  {
619  struct s
620  {
621  CREATESTRUCTW cs; /* new structure */
622  MDICREATESTRUCTW mdi_cs; /* MDI info */
623  LPCWSTR lpszName; /* allocated Name */
624  LPCWSTR lpszClass; /* allocated Class */
625  };
626 
627  struct s *xs = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(struct s));
628  if (!xs)
629  {
630  return FALSE;
631  }
632  xs->cs = *(CREATESTRUCTW *)AnsiMsg->lParam;
633  if (!IS_INTRESOURCE(xs->cs.lpszName))
634  {
636  xs->lpszName = xs->cs.lpszName = UnicodeString.Buffer;
637  }
638  if (!IS_ATOM(xs->cs.lpszClass))
639  {
641  xs->lpszClass = xs->cs.lpszClass = UnicodeString.Buffer;
642  }
643 
645  {
646  xs->mdi_cs = *(MDICREATESTRUCTW *)xs->cs.lpCreateParams;
647  xs->mdi_cs.szTitle = xs->cs.lpszName;
648  xs->mdi_cs.szClass = xs->cs.lpszClass;
649  xs->cs.lpCreateParams = &xs->mdi_cs;
650  }
651 
652  UnicodeMsg->lParam = (LPARAM)xs;
653  break;
654  }
655 
656  case WM_MDICREATE:
657  {
659  (MDICREATESTRUCTW *)HeapAlloc(GetProcessHeap(), 0, sizeof(*cs));
660 
661  if (!cs)
662  {
663  return FALSE;
664  }
665 
666  *cs = *(MDICREATESTRUCTW *)AnsiMsg->lParam;
667 
668  if (!IS_ATOM(cs->szClass))
669  {
671  cs->szClass = UnicodeString.Buffer;
672  }
673 
675  cs->szTitle = UnicodeString.Buffer;
676 
677  UnicodeMsg->lParam = (LPARAM)cs;
678  break;
679  }
680 
681  case WM_GETDLGCODE:
682  if (UnicodeMsg->lParam)
683  {
684  MSG newmsg = *(MSG *)UnicodeMsg->lParam;
685  newmsg.wParam = map_wparam_AtoW( newmsg.message, newmsg.wParam);
686  }
687  break;
688 
689  case WM_CHARTOITEM:
690  case WM_MENUCHAR:
691  case WM_CHAR:
692  case WM_DEADCHAR:
693  case WM_SYSCHAR:
694  case WM_SYSDEADCHAR:
695  case EM_SETPASSWORDCHAR:
696  case WM_IME_CHAR:
697  UnicodeMsg->wParam = map_wparam_AtoW( AnsiMsg->message, AnsiMsg->wParam );
698  break;
699  case EM_GETLINE:
700  ERR("FIXME EM_GETLINE A2U\n");
701  break;
702 
703  }
704 
705  return TRUE;
706 }
707 
708 static BOOL FASTCALL
710 {
712 
713  switch (AnsiMsg->message)
714  {
715  case LB_GETTEXT:
716  if (!listbox_has_strings( UnicodeMsg->hwnd )) break;
717  case CB_GETLBTEXT:
718  if (UnicodeMsg->message == CB_GETLBTEXT && !combobox_has_strings( UnicodeMsg->hwnd )) break;
719  case WM_GETTEXT:
720  case WM_ASKCBFORMATNAME:
721  {
722  if (!UnicodeMsg->lParam) break;
723  RtlFreeHeap(GetProcessHeap(), 0, (PVOID) UnicodeMsg->lParam);
724  break;
725  }
726 
727  case WM_SETTEXT:
728  case WM_WININICHANGE:
729  case WM_DEVMODECHANGE:
730  case CB_DIR:
731  case LB_DIR:
732  case LB_ADDFILE:
733  case EM_REPLACESEL:
734  {
735  if (!UnicodeMsg->lParam) break;
738  break;
739  }
740 
741  case LB_ADDSTRING:
742  case LB_ADDSTRING_LOWER:
743  case LB_ADDSTRING_UPPER:
744  case LB_INSERTSTRING:
747  case LB_FINDSTRING:
748  case LB_FINDSTRINGEXACT:
749  case LB_SELECTSTRING:
750  {
751  if (UnicodeMsg->lParam && listbox_has_strings(AnsiMsg->hwnd))
752  {
755  }
756  break;
757  }
758 
759  case CB_ADDSTRING:
760  case CB_INSERTSTRING:
761  case CB_FINDSTRING:
762  case CB_FINDSTRINGEXACT:
763  case CB_SELECTSTRING:
764  {
765  if (UnicodeMsg->lParam && combobox_has_strings(AnsiMsg->hwnd))
766  {
769  }
770  break;
771  }
772 
773  case WM_NCCREATE:
774  case WM_CREATE:
775  {
776  struct s
777  {
778  CREATESTRUCTW cs; /* new structure */
779  MDICREATESTRUCTW mdi_cs; /* MDI info */
780  LPWSTR lpszName; /* allocated Name */
781  LPWSTR lpszClass; /* allocated Class */
782  };
783 
784  struct s *xs = (struct s *)UnicodeMsg->lParam;
785  if (xs->lpszName)
786  {
787  RtlInitUnicodeString(&UnicodeString, (PCWSTR)xs->lpszName);
789  }
790  if (xs->lpszClass)
791  {
792  RtlInitUnicodeString(&UnicodeString, (PCWSTR)xs->lpszClass);
794  }
795  HeapFree(GetProcessHeap(), 0, xs);
796  break;
797  }
798 
799  case WM_MDICREATE:
800  {
801  MDICREATESTRUCTW *cs = (MDICREATESTRUCTW *)UnicodeMsg->lParam;
804  if (!IS_ATOM(cs->szClass))
805  {
808  }
809  HeapFree(GetProcessHeap(), 0, cs);
810  break;
811  }
812  }
813 
814  return(TRUE);
815 }
816 
817 /*
818  * callout return -> Unicode Result to Ansi Result
819  */
820 static BOOL FASTCALL
822 {
823  LPWSTR Buffer = (LPWSTR)UnicodeMsg->lParam;
824  LPSTR AnsiBuffer = (LPSTR)AnsiMsg->lParam;
825 
826  switch (AnsiMsg->message)
827  {
828  case WM_GETTEXT:
829  case WM_ASKCBFORMATNAME:
830  {
831  if (UnicodeMsg->wParam)
832  {
833  DWORD len = 0;
834  if (*Result) RtlUnicodeToMultiByteN( AnsiBuffer, UnicodeMsg->wParam - 1, &len, Buffer, strlenW(Buffer) * sizeof(WCHAR));
835  AnsiBuffer[len] = 0;
836  *Result = len;
837  //ERR("WM_GETTEXT U2A Result %d Size %d\n",*Result,AnsiMsg->wParam);
838  }
839  break;
840  }
841  case LB_GETTEXT:
842  {
843  if (!AnsiBuffer || !listbox_has_strings( UnicodeMsg->hwnd )) break;
844  if (*Result >= 0)
845  {
846  DWORD len;
847  RtlUnicodeToMultiByteN( AnsiBuffer, ~0u, &len, Buffer, (strlenW(Buffer) + 1) * sizeof(WCHAR) );
848  *Result = len - 1;
849  }
850  break;
851  }
852  case CB_GETLBTEXT:
853  {
854  if (!AnsiBuffer || !combobox_has_strings( UnicodeMsg->hwnd )) break;
855  if (*Result >= 0)
856  {
857  DWORD len;
858  RtlUnicodeToMultiByteN( AnsiBuffer, ~0u, &len, Buffer, (strlenW(Buffer) + 1) * sizeof(WCHAR) );
859  *Result = len - 1;
860  }
861  break;
862  }
863  }
864 
865  MsgiAnsiToUnicodeCleanup(UnicodeMsg, AnsiMsg);
866 
867  return TRUE;
868 }
869 
870 //
871 // Unicode to Ansi callout ->
872 //
873 static BOOL FASTCALL
875 {
878 
879  *AnsiMsg = *UnicodeMsg;
880 
881  switch(UnicodeMsg->message)
882  {
883  case WM_CREATE:
884  case WM_NCCREATE:
885  {
886  MDICREATESTRUCTA *pmdi_cs;
887  CREATESTRUCTA* CsA;
888  CREATESTRUCTW* CsW;
889  ULONG NameSize, ClassSize;
891 
892  CsW = (CREATESTRUCTW*)(UnicodeMsg->lParam);
895  if (NameSize == 0)
896  {
897  return FALSE;
898  }
899  ClassSize = 0;
900  if (!IS_ATOM(CsW->lpszClass))
901  {
904  if (ClassSize == 0)
905  {
906  return FALSE;
907  }
908  }
909 
910  CsA = RtlAllocateHeap(GetProcessHeap(), 0, sizeof(CREATESTRUCTA) + sizeof(MDICREATESTRUCTA) + NameSize + ClassSize);
911  if (NULL == CsA)
912  {
913  return FALSE;
914  }
915  memcpy(CsA, CsW, sizeof(CREATESTRUCTW));
916 
917  /* pmdi_cs starts right after CsA */
918  pmdi_cs = (MDICREATESTRUCTA*)(CsA + 1);
919 
921  RtlInitEmptyAnsiString(&AnsiString, (PCHAR)(pmdi_cs + 1), NameSize);
923  if (! NT_SUCCESS(Status))
924  {
925  RtlFreeHeap(GetProcessHeap(), 0, CsA);
926  return FALSE;
927  }
928  CsA->lpszName = AnsiString.Buffer;
929  if (!IS_ATOM(CsW->lpszClass))
930  {
932  RtlInitEmptyAnsiString(&AnsiString, (PCHAR)(pmdi_cs + 1) + NameSize, ClassSize);
934  if (! NT_SUCCESS(Status))
935  {
936  RtlFreeHeap(GetProcessHeap(), 0, CsA);
937  return FALSE;
938  }
939  CsA->lpszClass = AnsiString.Buffer;
940  }
941 
943  {
944  *pmdi_cs = *(MDICREATESTRUCTA *)CsW->lpCreateParams;
945  pmdi_cs->szTitle = CsA->lpszName;
946  pmdi_cs->szClass = CsA->lpszClass;
947  CsA->lpCreateParams = pmdi_cs;
948  }
949 
950  AnsiMsg->lParam = (LPARAM)CsA;
951  break;
952  }
953  case WM_GETTEXT:
954  case WM_ASKCBFORMATNAME:
955  {
956  if (!UnicodeMsg->lParam) break;
957  /* Ansi string might contain MBCS chars so we need 2 * the number of chars */
958  AnsiMsg->lParam = (LPARAM) RtlAllocateHeap(GetProcessHeap(), HEAP_ZERO_MEMORY, UnicodeMsg->wParam * 2);
959  //ERR("WM_GETTEXT U2A Size %d\n",AnsiMsg->wParam);
960 
961  if (!AnsiMsg->lParam) return FALSE;
962  break;
963  }
964 
965  case LB_GETTEXT:
966  {
967  DWORD Size = 1024;
968  if (!UnicodeMsg->lParam || !listbox_has_strings( UnicodeMsg->hwnd )) break;
969  /*Size = SendMessageA( UnicodeMsg->hwnd, LB_GETTEXTLEN, UnicodeMsg->wParam, 0 );
970  if (Size == LB_ERR)
971  {
972  ERR("LB_GETTEXT LB_ERR\n");
973  Size = sizeof(ULONG_PTR);
974  }
975  Size = (Size + 1) * sizeof(WCHAR);*/
977  if (!AnsiMsg->lParam) return FALSE;
978  break;
979  }
980 
981  case CB_GETLBTEXT:
982  {
983  DWORD Size = 1024;
984  if (!UnicodeMsg->lParam || !combobox_has_strings( UnicodeMsg->hwnd )) break;
985  /*Size = SendMessageA( UnicodeMsg->hwnd, CB_GETLBTEXTLEN, UnicodeMsg->wParam, 0 );
986  if (Size == LB_ERR)
987  {
988  ERR("CB_GETTEXT LB_ERR\n");
989  Size = sizeof(ULONG_PTR);
990  }
991  Size = (Size + 1) * sizeof(WCHAR);*/
993  if (!AnsiMsg->lParam) return FALSE;
994  break;
995  }
996 
997  case WM_SETTEXT:
998  case WM_WININICHANGE:
999  case WM_DEVMODECHANGE:
1000  case CB_DIR:
1001  case LB_DIR:
1002  case LB_ADDFILE:
1003  case EM_REPLACESEL:
1004  {
1005  if (!UnicodeMsg->lParam) break;
1008  &UnicodeString,
1009  TRUE)))
1010  {
1011  return FALSE;
1012  }
1013  AnsiMsg->lParam = (LPARAM) AnsiString.Buffer;
1014  break;
1015  }
1016 
1017  case LB_ADDSTRING:
1018  case LB_ADDSTRING_LOWER:
1019  case LB_ADDSTRING_UPPER:
1020  case LB_INSERTSTRING:
1021  case LB_INSERTSTRING_UPPER:
1022  case LB_INSERTSTRING_LOWER:
1023  case LB_FINDSTRING:
1024  case LB_FINDSTRINGEXACT:
1025  case LB_SELECTSTRING:
1026  {
1027  if (UnicodeMsg->lParam && listbox_has_strings(AnsiMsg->hwnd))
1028  {
1031  &UnicodeString,
1032  TRUE)))
1033  {
1034  return FALSE;
1035  }
1036  AnsiMsg->lParam = (LPARAM) AnsiString.Buffer;
1037  }
1038  break;
1039  }
1040 
1041  case CB_ADDSTRING:
1042  case CB_INSERTSTRING:
1043  case CB_FINDSTRING:
1044  case CB_FINDSTRINGEXACT:
1045  case CB_SELECTSTRING:
1046  {
1047  if (UnicodeMsg->lParam && combobox_has_strings(AnsiMsg->hwnd))
1048  {
1051  &UnicodeString,
1052  TRUE)))
1053  {
1054  return FALSE;
1055  }
1056  AnsiMsg->lParam = (LPARAM) AnsiString.Buffer;
1057  }
1058  break;
1059  }
1060 
1061  case WM_MDICREATE:
1062  {
1063  MDICREATESTRUCTA *cs =
1064  (MDICREATESTRUCTA *)HeapAlloc(GetProcessHeap(), 0, sizeof(*cs));
1065 
1066  if (!cs)
1067  {
1068  return FALSE;
1069  }
1070 
1071  *cs = *(MDICREATESTRUCTA *)UnicodeMsg->lParam;
1072 
1073  if (!IS_ATOM(cs->szClass))
1074  {
1077  &UnicodeString,
1078  TRUE)))
1079  {
1080  HeapFree(GetProcessHeap(), 0, cs);
1081  return FALSE;
1082  }
1083  cs->szClass = AnsiString.Buffer;
1084  }
1085 
1088  &UnicodeString,
1089  TRUE)))
1090  {
1091  if (!IS_ATOM(cs->szClass))
1092  {
1093  RtlInitAnsiString(&AnsiString, cs->szClass);
1095  }
1096 
1097  HeapFree(GetProcessHeap(), 0, cs);
1098  return FALSE;
1099  }
1100  cs->szTitle = AnsiString.Buffer;
1101 
1102  AnsiMsg->lParam = (LPARAM)cs;
1103  break;
1104  }
1105 
1106  case WM_GETDLGCODE:
1107  if (UnicodeMsg->lParam)
1108  {
1109  MSG newmsg = *(MSG *)UnicodeMsg->lParam;
1110  switch(newmsg.message)
1111  {
1112  case WM_CHAR:
1113  case WM_DEADCHAR:
1114  case WM_SYSCHAR:
1115  case WM_SYSDEADCHAR:
1116  newmsg.wParam = map_wparam_char_WtoA( newmsg.wParam, 1 );
1117  break;
1118  case WM_IME_CHAR:
1119  newmsg.wParam = map_wparam_char_WtoA( newmsg.wParam, 2 );
1120  break;
1121  }
1122  }
1123  break;
1124 
1125  case WM_CHAR:
1126  {
1127  WCHAR wch = UnicodeMsg->wParam;
1128  char ch[2];
1130  DWORD len = WideCharToMultiByte( cp, 0, &wch, 1, ch, 2, NULL, NULL );
1131  AnsiMsg->wParam = (BYTE)ch[0];
1132  if (len == 2) AnsiMsg->wParam = (BYTE)ch[1];
1133  }
1134  break;
1135 
1136  case WM_CHARTOITEM:
1137  case WM_MENUCHAR:
1138  case WM_DEADCHAR:
1139  case WM_SYSCHAR:
1140  case WM_SYSDEADCHAR:
1141  case EM_SETPASSWORDCHAR:
1142  AnsiMsg->wParam = map_wparam_char_WtoA(UnicodeMsg->wParam,1);
1143  break;
1144 
1145  case WM_IME_CHAR:
1146  AnsiMsg->wParam = map_wparam_char_WtoA(UnicodeMsg->wParam,2);
1147  break;
1148  case EM_GETLINE:
1149  ERR("FIXME EM_GETLINE U2A\n");
1150  break;
1151  }
1152  return TRUE;
1153 }
1154 
1155 static BOOL FASTCALL
1157 {
1159 
1160  switch(UnicodeMsg->message)
1161  {
1162  case LB_GETTEXT:
1163  if (!listbox_has_strings( AnsiMsg->hwnd )) break;
1164  case CB_GETLBTEXT:
1165  if (AnsiMsg->message == CB_GETLBTEXT && !combobox_has_strings( AnsiMsg->hwnd )) break;
1166  case WM_GETTEXT:
1167  case WM_ASKCBFORMATNAME:
1168  {
1169  if (!AnsiMsg->lParam) break;
1170  RtlFreeHeap(GetProcessHeap(), 0, (PVOID) AnsiMsg->lParam);
1171  break;
1172  }
1173  case WM_CREATE:
1174  case WM_NCCREATE:
1175  {
1176  CREATESTRUCTA* Cs;
1177 
1178  Cs = (CREATESTRUCTA*) AnsiMsg->lParam;
1179  RtlFreeHeap(GetProcessHeap(), 0, Cs);
1180  break;
1181  }
1182 
1183  case WM_SETTEXT:
1184  case WM_WININICHANGE:
1185  case WM_DEVMODECHANGE:
1186  case CB_DIR:
1187  case LB_DIR:
1188  case LB_ADDFILE:
1189  case EM_REPLACESEL:
1190  {
1191  if (!AnsiMsg->lParam) break;
1192  RtlInitAnsiString(&AnsiString, (PSTR) AnsiMsg->lParam);
1194  break;
1195  }
1196 
1197  case LB_ADDSTRING:
1198  case LB_ADDSTRING_LOWER:
1199  case LB_ADDSTRING_UPPER:
1200  case LB_INSERTSTRING:
1201  case LB_INSERTSTRING_UPPER:
1202  case LB_INSERTSTRING_LOWER:
1203  case LB_FINDSTRING:
1204  case LB_FINDSTRINGEXACT:
1205  case LB_SELECTSTRING:
1206  {
1207  if (AnsiMsg->lParam && listbox_has_strings(AnsiMsg->hwnd))
1208  {
1209  RtlInitAnsiString(&AnsiString, (PSTR) AnsiMsg->lParam);
1211  }
1212  break;
1213  }
1214 
1215  case CB_ADDSTRING:
1216  case CB_INSERTSTRING:
1217  case CB_FINDSTRING:
1218  case CB_FINDSTRINGEXACT:
1219  case CB_SELECTSTRING:
1220  {
1221  if (AnsiMsg->lParam && combobox_has_strings(AnsiMsg->hwnd))
1222  {
1223  RtlInitAnsiString(&AnsiString, (PSTR) AnsiMsg->lParam);
1225  }
1226  break;
1227  }
1228 
1229  case WM_MDICREATE:
1230  {
1231  MDICREATESTRUCTA *cs = (MDICREATESTRUCTA *)AnsiMsg->lParam;
1232  RtlInitAnsiString(&AnsiString, (PCSTR)cs->szTitle);
1234  if (!IS_ATOM(cs->szClass))
1235  {
1236  RtlInitAnsiString(&AnsiString, (PCSTR)cs->szClass);
1238  }
1239  HeapFree(GetProcessHeap(), 0, cs);
1240  break;
1241  }
1242 
1243  }
1244 
1245  return TRUE;
1246 }
1247 
1248 /*
1249  * callout return -> Ansi Result to Unicode Result
1250  */
1251 static BOOL FASTCALL
1253 {
1254  LPSTR Buffer = (LPSTR) AnsiMsg->lParam;
1255  LPWSTR UBuffer = (LPWSTR) UnicodeMsg->lParam;
1256 
1257  switch (UnicodeMsg->message)
1258  {
1259  case WM_GETTEXT:
1260  case WM_ASKCBFORMATNAME:
1261  {
1262  DWORD len = AnsiMsg->wParam;// * 2;
1263  if (len)
1264  {
1265  if (*Result)
1266  {
1267  RtlMultiByteToUnicodeN( UBuffer, AnsiMsg->wParam*sizeof(WCHAR), &len, Buffer, strlen(Buffer)+1 );
1268  *Result = len/sizeof(WCHAR) - 1; /* do not count terminating null */
1269  //ERR("WM_GETTEXT U2A Result %d Size %d\n",*Result,AnsiMsg->wParam);
1270  }
1271  UBuffer[*Result] = 0;
1272  }
1273  break;
1274  }
1275  case LB_GETTEXT:
1276  {
1277  if (!UBuffer || !listbox_has_strings( UnicodeMsg->hwnd )) break;
1278  if (*Result >= 0)
1279  {
1280  DWORD len;
1281  RtlMultiByteToUnicodeN( UBuffer, ~0u, &len, Buffer, strlen(Buffer) + 1 );
1282  *Result = len / sizeof(WCHAR) - 1;
1283  }
1284  break;
1285  }
1286  case CB_GETLBTEXT:
1287  {
1288  if (!UBuffer || !combobox_has_strings( UnicodeMsg->hwnd )) break;
1289  if (*Result >= 0)
1290  {
1291  DWORD len;
1292  RtlMultiByteToUnicodeN( UBuffer, ~0u, &len, Buffer, strlen(Buffer) + 1 );
1293  *Result = len / sizeof(WCHAR) - 1;
1294  }
1295  break;
1296  }
1297  }
1298 
1299  MsgiUnicodeToAnsiCleanup(AnsiMsg, UnicodeMsg);
1300 
1301  return TRUE;
1302 }
1303 
1304 
1305 LRESULT
1306 WINAPI
1308 {
1309  LRESULT Result;
1310  MSG AnsiMsg, UcMsg;
1311 
1312  TRACE("Desktop A Class Atom! hWnd 0x%x, Msg %d\n", hwnd, message);
1313 
1314  AnsiMsg.hwnd = hwnd;
1315  AnsiMsg.message = message;
1316  AnsiMsg.wParam = wParam;
1317  AnsiMsg.lParam = lParam;
1318  AnsiMsg.time = 0;
1319  AnsiMsg.pt.x = 0;
1320  AnsiMsg.pt.y = 0;
1321 
1322  // Desktop is always Unicode so convert Ansi here.
1323  if (!MsgiAnsiToUnicodeMessage(hwnd, &UcMsg, &AnsiMsg))
1324  {
1325  return FALSE;
1326  }
1327 
1328  Result = DesktopWndProcW(hwnd, message, UcMsg.wParam, UcMsg.lParam);
1329 
1330  MsgiAnsiToUnicodeCleanup(&UcMsg, &AnsiMsg);
1331 
1332  return Result;
1333  }
1334 
1335 /*
1336  * @implemented
1337  */
1338 LPARAM
1339 WINAPI
1341 {
1342  return NtUserxGetMessageExtraInfo();
1343 }
1344 
1345 
1346 /*
1347  * @implemented
1348  */
1349 DWORD
1350 WINAPI
1352 {
1353  return NtUserxGetMessagePos();
1354 }
1355 
1356 
1357 /*
1358  * @implemented
1359  */
1360 LONG WINAPI
1362 {
1364 }
1365 
1366 
1367 /*
1368  * @implemented
1369  */
1370 BOOL
1371 WINAPI
1373 {
1374  PCLIENTTHREADINFO pcti = GetWin32ClientInfo()->pClientThreadInfo;
1375  if ( pcti )
1376  {
1377  if (pcti->CTI_flags & CTI_INSENDMESSAGE)
1378  {
1379  return TRUE;
1380  }
1381  }
1382  return(NtUserGetThreadState(THREADSTATE_INSENDMESSAGE) != ISMEX_NOSEND);
1383 }
1384 
1385 
1386 /*
1387  * @implemented
1388  */
1389 DWORD
1390 WINAPI
1392  LPVOID lpReserved)
1393 {
1394  PCLIENTTHREADINFO pcti = GetWin32ClientInfo()->pClientThreadInfo;
1395  if (pcti && !(pcti->CTI_flags & CTI_INSENDMESSAGE))
1396  return ISMEX_NOSEND;
1397  else
1399 }
1400 
1401 
1402 /*
1403  * @implemented
1404  */
1405 BOOL
1406 WINAPI
1408 {
1409  return NtUserxReplyMessage(lResult);
1410 }
1411 
1412 
1413 /*
1414  * @implemented
1415  */
1416 LPARAM
1417 WINAPI
1419  LPARAM lParam)
1420 {
1422 }
1423 
1426  WNDPROC WndProc,
1427  PWND pWnd,
1428  HWND hWnd,
1429  UINT Msg,
1430  WPARAM wParam,
1431  LPARAM lParam)
1432 {
1433  MSG AnsiMsg;
1434  MSG UnicodeMsg;
1435  BOOL Hook = FALSE, MsgOverride = FALSE, Dialog, DlgOverride = FALSE;
1436  LRESULT Result = 0, PreResult = 0;
1437  DWORD Data = 0;
1438 
1439  if (WndProc == NULL)
1440  {
1441  WARN("IntCallWindowsProcW() called with WndProc = NULL!\n");
1442  return FALSE;
1443  }
1444 
1445  if (pWnd)
1446  Dialog = (pWnd->fnid == FNID_DIALOG);
1447  else
1448  Dialog = FALSE;
1449 
1450  Hook = BeginIfHookedUserApiHook();
1451  if (Hook)
1452  {
1453  if (Dialog)
1454  DlgOverride = IsMsgOverride( Msg, &guah.DlgProcArray);
1455  MsgOverride = IsMsgOverride( Msg, &guah.WndProcArray);
1456  }
1457 
1458  if (IsAnsiProc)
1459  {
1460  UnicodeMsg.hwnd = hWnd;
1461  UnicodeMsg.message = Msg;
1462  UnicodeMsg.wParam = wParam;
1463  UnicodeMsg.lParam = lParam;
1464  UnicodeMsg.time = 0;
1465  UnicodeMsg.pt.x = 0;
1466  UnicodeMsg.pt.y = 0;
1467  if (! MsgiUnicodeToAnsiMessage(hWnd, &AnsiMsg, &UnicodeMsg))
1468  {
1469  goto Exit;
1470  }
1471 
1472  if (Hook && (MsgOverride || DlgOverride))
1473  {
1474  _SEH2_TRY
1475  {
1476  if (!DlgOverride)
1477  PreResult = guah.PreWndProc(AnsiMsg.hwnd, AnsiMsg.message, AnsiMsg.wParam, AnsiMsg.lParam, (ULONG_PTR)&Result, &Data );
1478  else
1479  PreResult = guah.PreDefDlgProc(AnsiMsg.hwnd, AnsiMsg.message, AnsiMsg.wParam, AnsiMsg.lParam, (ULONG_PTR)&Result, &Data );
1480  }
1482  {
1483  ERR("Got exception in hooked PreWndProc, dlg:%d!\n", DlgOverride);
1484  }
1485  _SEH2_END;
1486  }
1487 
1488  if (PreResult) goto Exit;
1489 
1490  if (!Dialog)
1491  Result = CALL_EXTERN_WNDPROC(WndProc, AnsiMsg.hwnd, AnsiMsg.message, AnsiMsg.wParam, AnsiMsg.lParam);
1492  else
1493  {
1494  _SEH2_TRY
1495  {
1496  Result = CALL_EXTERN_WNDPROC(WndProc, AnsiMsg.hwnd, AnsiMsg.message, AnsiMsg.wParam, AnsiMsg.lParam);
1497  }
1499  {
1500  ERR("Exception Dialog Ansi %p Msg %d pti %p Wndpti %p\n",WndProc,Msg,GetW32ThreadInfo(),pWnd->head.pti);
1501  }
1502  _SEH2_END;
1503  }
1504 
1505  if (Hook && (MsgOverride || DlgOverride))
1506  {
1507  _SEH2_TRY
1508  {
1509  if (!DlgOverride)
1510  guah.PostWndProc(AnsiMsg.hwnd, AnsiMsg.message, AnsiMsg.wParam, AnsiMsg.lParam, (ULONG_PTR)&Result, &Data );
1511  else
1512  guah.PostDefDlgProc(AnsiMsg.hwnd, AnsiMsg.message, AnsiMsg.wParam, AnsiMsg.lParam, (ULONG_PTR)&Result, &Data );
1513  }
1515  {
1516  ERR("Got exception in hooked PostWndProc, dlg:%d!\n", DlgOverride);
1517  }
1518  _SEH2_END;
1519  }
1520 
1521  if (! MsgiUnicodeToAnsiReply(&AnsiMsg, &UnicodeMsg, &Result))
1522  {
1523  goto Exit;
1524  }
1525  }
1526  else
1527  {
1528  if (Hook && (MsgOverride || DlgOverride))
1529  {
1530  _SEH2_TRY
1531  {
1532  if (!DlgOverride)
1533  PreResult = guah.PreWndProc(hWnd, Msg, wParam, lParam, (ULONG_PTR)&Result, &Data );
1534  else
1535  PreResult = guah.PreDefDlgProc(hWnd, Msg, wParam, lParam, (ULONG_PTR)&Result, &Data );
1536  }
1538  {
1539  ERR("Got exception in hooked PreWndProc, dlg:%d!\n", DlgOverride);
1540  }
1541  _SEH2_END;
1542  }
1543 
1544  if (PreResult) goto Exit;
1545 
1546  if (!Dialog)
1548  else
1549  {
1550  _SEH2_TRY
1551  {
1553  }
1555  {
1556  ERR("Exception Dialog unicode %p Msg %d pti %p Wndpti %p\n",WndProc, Msg,GetW32ThreadInfo(),pWnd->head.pti);
1557  }
1558  _SEH2_END;
1559  }
1560 
1561  if (Hook && (MsgOverride || DlgOverride))
1562  {
1563  _SEH2_TRY
1564  {
1565  if (!DlgOverride)
1567  else
1569  }
1571  {
1572  ERR("Got exception in hooked PostWndProc, dlg:%d!\n", DlgOverride);
1573  }
1574  _SEH2_END;
1575  }
1576  }
1577 
1578 Exit:
1579  if (Hook) EndUserApiHook();
1580  return Result;
1581 }
1582 
1583 static LRESULT FASTCALL
1585  WNDPROC WndProc,
1586  PWND pWnd,
1587  HWND hWnd,
1588  UINT Msg,
1589  WPARAM wParam,
1590  LPARAM lParam)
1591 {
1592  MSG AnsiMsg;
1593  MSG UnicodeMsg;
1594  BOOL Hook = FALSE, MsgOverride = FALSE, Dialog, DlgOverride = FALSE;
1595  LRESULT Result = 0, PreResult = 0;
1596  DWORD Data = 0;
1597 
1598  TRACE("IntCallWindowProcA: IsAnsiProc : %s, WndProc %p, pWnd %p, hWnd %p, Msg %u, wParam %Iu, lParam %Iu.\n",
1599  IsAnsiProc ? "TRUE" : "FALSE", WndProc, pWnd, hWnd, Msg, wParam, lParam);
1600 
1601  if (WndProc == NULL)
1602  {
1603  WARN("IntCallWindowsProcA() called with WndProc = NULL!\n");
1604  return FALSE;
1605  }
1606 
1607  if (pWnd)
1608  Dialog = (pWnd->fnid == FNID_DIALOG);
1609  else
1610  Dialog = FALSE;
1611 
1612  Hook = BeginIfHookedUserApiHook();
1613  if (Hook)
1614  {
1615  if (Dialog)
1616  DlgOverride = IsMsgOverride( Msg, &guah.DlgProcArray);
1617  MsgOverride = IsMsgOverride( Msg, &guah.WndProcArray);
1618  }
1619 
1620  if (IsAnsiProc)
1621  {
1622  if (Hook && (MsgOverride || DlgOverride))
1623  {
1624  _SEH2_TRY
1625  {
1626  if (!DlgOverride)
1627  PreResult = guah.PreWndProc(hWnd, Msg, wParam, lParam, (ULONG_PTR)&Result, &Data );
1628  else
1629  PreResult = guah.PreDefDlgProc(hWnd, Msg, wParam, lParam, (ULONG_PTR)&Result, &Data );
1630  }
1632  {
1633  ERR("Got exception in hooked PreWndProc, dlg:%d!\n", DlgOverride);
1634  }
1635  _SEH2_END;
1636  }
1637 
1638  if (PreResult) goto Exit;
1639 
1640  if (!Dialog)
1642  else
1643  {
1644  _SEH2_TRY
1645  {
1647  }
1649  {
1650  ERR("Exception Dialog Ansi %p Msg %d pti %p Wndpti %p\n",WndProc,Msg,GetW32ThreadInfo(),pWnd->head.pti);
1651  }
1652  _SEH2_END;
1653  }
1654 
1655  if (Hook && (MsgOverride || DlgOverride))
1656  {
1657  _SEH2_TRY
1658  {
1659  if (!DlgOverride)
1661  else
1663  }
1665  {
1666  ERR("Got exception in hooked PostWndProc, dlg:%d!\n", DlgOverride);
1667  }
1668  _SEH2_END;
1669  }
1670  }
1671  else
1672  {
1673  AnsiMsg.hwnd = hWnd;
1674  AnsiMsg.message = Msg;
1675  AnsiMsg.wParam = wParam;
1676  AnsiMsg.lParam = lParam;
1677  AnsiMsg.time = 0;
1678  AnsiMsg.pt.x = 0;
1679  AnsiMsg.pt.y = 0;
1680  if (! MsgiAnsiToUnicodeMessage(hWnd, &UnicodeMsg, &AnsiMsg))
1681  {
1682  goto Exit;
1683  }
1684 
1685  if (Hook && (MsgOverride || DlgOverride))
1686  {
1687  _SEH2_TRY
1688  {
1689  if (!DlgOverride)
1690  PreResult = guah.PreWndProc(UnicodeMsg.hwnd, UnicodeMsg.message, UnicodeMsg.wParam, UnicodeMsg.lParam, (ULONG_PTR)&Result, &Data );
1691  else
1692  PreResult = guah.PreDefDlgProc(UnicodeMsg.hwnd, UnicodeMsg.message, UnicodeMsg.wParam, UnicodeMsg.lParam, (ULONG_PTR)&Result, &Data );
1693  }
1695  {
1696  ERR("Got exception in hooked PreWndProc, dlg:%d!\n", DlgOverride);
1697  }
1698  _SEH2_END;
1699  }
1700 
1701  if (PreResult) goto Exit;
1702 
1703  if (!Dialog)
1704  Result = CALL_EXTERN_WNDPROC(WndProc, UnicodeMsg.hwnd, UnicodeMsg.message, UnicodeMsg.wParam, UnicodeMsg.lParam);
1705  else
1706  {
1707  _SEH2_TRY
1708  {
1709  Result = CALL_EXTERN_WNDPROC(WndProc, UnicodeMsg.hwnd, UnicodeMsg.message, UnicodeMsg.wParam, UnicodeMsg.lParam);
1710  }
1712  {
1713  ERR("Exception Dialog unicode %p Msg %d pti %p Wndpti %p\n",WndProc, Msg,GetW32ThreadInfo(),pWnd->head.pti);
1714  }
1715  _SEH2_END;
1716  }
1717 
1718  if (Hook && (MsgOverride || DlgOverride))
1719  {
1720  _SEH2_TRY
1721  {
1722  if (!DlgOverride)
1723  guah.PostWndProc(UnicodeMsg.hwnd, UnicodeMsg.message, UnicodeMsg.wParam, UnicodeMsg.lParam, (ULONG_PTR)&Result, &Data );
1724  else
1725  guah.PostDefDlgProc(UnicodeMsg.hwnd, UnicodeMsg.message, UnicodeMsg.wParam, UnicodeMsg.lParam, (ULONG_PTR)&Result, &Data );
1726  }
1728  {
1729  ERR("Got exception in hooked PostWndProc, dlg:%d!\n", DlgOverride);
1730  }
1731  _SEH2_END;
1732  }
1733 
1734  if (! MsgiAnsiToUnicodeReply(&UnicodeMsg, &AnsiMsg, &Result))
1735  {
1736  goto Exit;
1737  }
1738  }
1739 
1740 Exit:
1741  if (Hook) EndUserApiHook();
1742  return Result;
1743 }
1744 
1745 
1746 static LRESULT WINAPI
1748 {
1749  WNDPROC WndProc;
1750  BOOL IsAnsi;
1751  PCLS Class;
1752 
1753  Class = DesktopPtrToUser(Wnd->pcls);
1754  WndProc = NULL;
1755 
1756  if ( Wnd->head.pti != GetW32ThreadInfo())
1757  { // Must be inside the same thread!
1759  return 0;
1760  }
1761  /*
1762  This is the message exchange for user32. If there's a need to monitor messages,
1763  do it here!
1764  */
1765  TRACE("HWND %p, MSG %u, WPARAM %p, LPARAM %p, Ansi %d\n", hWnd, Msg, wParam, lParam, Ansi);
1766 // if (Class->fnid <= FNID_GHOST && Class->fnid >= FNID_BUTTON )
1767  if (Class->fnid <= FNID_GHOST && Class->fnid >= FNID_FIRST )
1768  {
1769  if (Ansi)
1770  {
1771  if (GETPFNCLIENTW(Class->fnid) == Wnd->lpfnWndProc)
1772  WndProc = GETPFNCLIENTA(Class->fnid);
1773  }
1774  else
1775  {
1776  if (GETPFNCLIENTA(Class->fnid) == Wnd->lpfnWndProc)
1777  WndProc = GETPFNCLIENTW(Class->fnid);
1778  }
1779 
1780  IsAnsi = Ansi;
1781 
1782  if (!WndProc)
1783  {
1784  IsAnsi = !Wnd->Unicode;
1785  WndProc = Wnd->lpfnWndProc;
1786  }
1787  }
1788  else
1789  {
1790  IsAnsi = !Wnd->Unicode;
1791  WndProc = Wnd->lpfnWndProc;
1792  }
1793 /*
1794  Message caller can be Ansi/Unicode and the receiver can be Unicode/Ansi or
1795  the same.
1796  */
1797  if (!Ansi)
1798  return IntCallWindowProcW(IsAnsi, WndProc, Wnd, hWnd, Msg, wParam, lParam);
1799  else
1800  return IntCallWindowProcA(IsAnsi, WndProc, Wnd, hWnd, Msg, wParam, lParam);
1801 }
1802 
1803 
1804 /*
1805  * @implemented
1806  */
1808 CallWindowProcA(WNDPROC lpPrevWndFunc,
1809  HWND hWnd,
1810  UINT Msg,
1811  WPARAM wParam,
1812  LPARAM lParam)
1813 {
1814  PWND pWnd;
1815  PCALLPROCDATA CallProc;
1816 
1817  if (lpPrevWndFunc == NULL)
1818  {
1819  WARN("CallWindowProcA: lpPrevWndFunc == NULL!\n");
1820  return 0;
1821  }
1822 
1823  pWnd = ValidateHwnd(hWnd);
1824 
1825  if (!IsCallProcHandle(lpPrevWndFunc))
1826  return IntCallWindowProcA(TRUE, lpPrevWndFunc, pWnd, hWnd, Msg, wParam, lParam);
1827  else
1828  {
1829  CallProc = ValidateCallProc((HANDLE)lpPrevWndFunc);
1830  if (CallProc != NULL)
1831  {
1832  return IntCallWindowProcA(!(CallProc->wType & UserGetCPDA2U),
1833  CallProc->pfnClientPrevious,
1834  pWnd,
1835  hWnd,
1836  Msg,
1837  wParam,
1838  lParam);
1839  }
1840  else
1841  {
1842  WARN("CallWindowProcA: can not dereference WndProcHandle\n");
1843  return 0;
1844  }
1845  }
1846 }
1847 
1848 
1849 /*
1850  * @implemented
1851  */
1853 CallWindowProcW(WNDPROC lpPrevWndFunc,
1854  HWND hWnd,
1855  UINT Msg,
1856  WPARAM wParam,
1857  LPARAM lParam)
1858 {
1859  PWND pWnd;
1860  PCALLPROCDATA CallProc;
1861 
1862  /* FIXME - can the first parameter be NULL? */
1863  if (lpPrevWndFunc == NULL)
1864  {
1865  WARN("CallWindowProcA: lpPrevWndFunc == NULL!\n");
1866  return 0;
1867  }
1868 
1869  pWnd = ValidateHwnd(hWnd);
1870 
1871  if (!IsCallProcHandle(lpPrevWndFunc))
1872  return IntCallWindowProcW(FALSE, lpPrevWndFunc, pWnd, hWnd, Msg, wParam, lParam);
1873  else
1874  {
1875  CallProc = ValidateCallProc((HANDLE)lpPrevWndFunc);
1876  if (CallProc != NULL)
1877  {
1878  return IntCallWindowProcW(!(CallProc->wType & UserGetCPDA2U),
1879  CallProc->pfnClientPrevious,
1880  pWnd,
1881  hWnd,
1882  Msg,
1883  wParam,
1884  lParam);
1885  }
1886  else
1887  {
1888  WARN("CallWindowProcW: can not dereference WndProcHandle\n");
1889  return 0;
1890  }
1891  }
1892 }
1893 
1894 
1895 /*
1896  * @implemented
1897  */
1898 LRESULT
1899 WINAPI
1902 {
1903  LRESULT Ret = 0;
1904  MSG UnicodeMsg;
1905  PWND Wnd;
1906 
1907  if ( lpmsg->message & ~WM_MAXIMUM )
1908  {
1910  return 0;
1911  }
1912 
1913  if (lpmsg->hwnd != NULL)
1914  {
1915  Wnd = ValidateHwnd(lpmsg->hwnd);
1916  if (!Wnd) return 0;
1917  }
1918  else
1919  Wnd = NULL;
1920 
1921  if (is_pointer_message(lpmsg->message, lpmsg->wParam))
1922  {
1924  return 0;
1925  }
1926 
1927  if ((lpmsg->message == WM_TIMER || lpmsg->message == WM_SYSTIMER) && lpmsg->lParam != 0)
1928  {
1929  WNDPROC WndProc = (WNDPROC)lpmsg->lParam;
1930 
1931  if ( lpmsg->message == WM_SYSTIMER )
1932  return NtUserDispatchMessage( (PMSG)lpmsg );
1933 
1934  if (!NtUserValidateTimerCallback(lpmsg->lParam))
1935  {
1936  WARN("Validating Timer Callback failed!\n");
1937  return 0;
1938  }
1939 
1940  _SEH2_TRY // wine does this. Hint: Prevents call to another thread....
1941  {
1942  Ret = WndProc(lpmsg->hwnd,
1943  lpmsg->message,
1944  lpmsg->wParam,
1945  GetTickCount());
1946  }
1948  {
1949  ERR("Exception in Timer Callback!\n");
1950  }
1951  _SEH2_END;
1952  }
1953  else if (Wnd != NULL)
1954  {
1955  if ( (lpmsg->message != WM_PAINT) && !(Wnd->state & WNDS_SERVERSIDEWINDOWPROC) )
1956  {
1957  Ret = IntCallMessageProc(Wnd,
1958  lpmsg->hwnd,
1959  lpmsg->message,
1960  lpmsg->wParam,
1961  lpmsg->lParam,
1962  TRUE);
1963  }
1964  else
1965  {
1966  if (!MsgiAnsiToUnicodeMessage(lpmsg->hwnd, &UnicodeMsg, (LPMSG)lpmsg))
1967  {
1968  return FALSE;
1969  }
1970 
1971  Ret = NtUserDispatchMessage(&UnicodeMsg);
1972 
1973  if (!MsgiAnsiToUnicodeReply(&UnicodeMsg, (LPMSG)lpmsg, &Ret))
1974  {
1975  return FALSE;
1976  }
1977  }
1978  }
1979 
1980  return Ret;
1981 }
1982 
1983 
1984 /*
1985  * @implemented
1986  */
1987 LRESULT
1988 WINAPI
1991 {
1992  LRESULT Ret = 0;
1993  PWND Wnd;
1994  BOOL Hit = FALSE;
1995 
1996  if ( lpmsg->message & ~WM_MAXIMUM )
1997  {
1999  return 0;
2000  }
2001 
2002  if (lpmsg->hwnd != NULL)
2003  {
2004  Wnd = ValidateHwnd(lpmsg->hwnd);
2005  if (!Wnd) return 0;
2006  }
2007  else
2008  Wnd = NULL;
2009 
2010  if (is_pointer_message(lpmsg->message, lpmsg->wParam))
2011  {
2013  return 0;
2014  }
2015 
2016  if ((lpmsg->message == WM_TIMER || lpmsg->message == WM_SYSTIMER) && lpmsg->lParam != 0)
2017  {
2018  WNDPROC WndProc = (WNDPROC)lpmsg->lParam;
2019 
2020  if ( lpmsg->message == WM_SYSTIMER )
2021  return NtUserDispatchMessage( (PMSG) lpmsg );
2022 
2023  if (!NtUserValidateTimerCallback(lpmsg->lParam))
2024  {
2025  WARN("Validating Timer Callback failed!\n");
2026  return 0;
2027  }
2028 
2029  _SEH2_TRY
2030  {
2031  Ret = WndProc(lpmsg->hwnd,
2032  lpmsg->message,
2033  lpmsg->wParam,
2034  GetTickCount());
2035  }
2037  {
2038  Hit = TRUE;
2039  }
2040  _SEH2_END;
2041  }
2042  else if (Wnd != NULL)
2043  {
2044  if ( (lpmsg->message != WM_PAINT) && !(Wnd->state & WNDS_SERVERSIDEWINDOWPROC) )
2045  {
2046  Ret = IntCallMessageProc(Wnd,
2047  lpmsg->hwnd,
2048  lpmsg->message,
2049  lpmsg->wParam,
2050  lpmsg->lParam,
2051  FALSE);
2052  }
2053  else
2054  Ret = NtUserDispatchMessage( (PMSG) lpmsg );
2055  }
2056 
2057  if (Hit)
2058  {
2059  WARN("Exception in Timer Callback WndProcW!\n");
2060  }
2061  return Ret;
2062 }
2063 
2064 static VOID
2066 {
2067  CHAR ch[2];
2068  WCHAR wch[2];
2069 
2070  switch (lpMsg->message)
2071  {
2072  case WM_CHAR:
2073  case WM_DEADCHAR:
2074  case WM_SYSCHAR:
2075  case WM_SYSDEADCHAR:
2076  case WM_MENUCHAR:
2077  wch[0] = LOWORD(lpMsg->wParam);
2078  wch[1] = HIWORD(lpMsg->wParam);
2079  ch[0] = ch[1] = 0;
2080  WideCharToMultiByte(CP_THREAD_ACP, 0, wch, 2, ch, 2, NULL, NULL);
2081  lpMsg->wParam = MAKEWPARAM(ch[0] | (ch[1] << 8), 0);
2082  break;
2083  }
2084 }
2085 
2086 /*
2087  * @implemented
2088  */
2089 BOOL
2090 WINAPI
2093  HWND hWnd,
2094  UINT wMsgFilterMin,
2095  UINT wMsgFilterMax)
2096 {
2097  BOOL Res;
2098 
2099  if ( (wMsgFilterMin|wMsgFilterMax) & ~WM_MAXIMUM )
2100  {
2102  return FALSE;
2103  }
2104 
2105  Res = NtUserGetMessage(lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax);
2106  if (-1 == (int) Res)
2107  {
2108  return Res;
2109  }
2110 
2111  IntConvertMsgToAnsi(lpMsg);
2112 
2113  return Res;
2114 }
2115 
2116 /*
2117  * @implemented
2118  */
2119 BOOL
2120 WINAPI
2123  HWND hWnd,
2124  UINT wMsgFilterMin,
2125  UINT wMsgFilterMax)
2126 {
2127  BOOL Res;
2128 
2129  if ( (wMsgFilterMin|wMsgFilterMax) & ~WM_MAXIMUM )
2130  {
2132  return FALSE;
2133  }
2134 
2135  Res = NtUserGetMessage(lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax);
2136  if (-1 == (int) Res)
2137  {
2138  return Res;
2139  }
2140 
2141  return Res;
2142 }
2143 
2144 BOOL WINAPI
2146  HWND hWnd,
2147  UINT wMsgFilterMin,
2148  UINT wMsgFilterMax,
2149  UINT wRemoveMsg)
2150 {
2151  PCLIENTINFO pci;
2152  PCLIENTTHREADINFO pcti;
2153  pci = GetWin32ClientInfo();
2154  pcti = pci->pClientThreadInfo;
2155 
2156  if (!hWnd && pci && pcti)
2157  {
2158  pci->cSpins++;
2159 
2160  if ((pci->cSpins >= 100) && (pci->dwTIFlags & TIF_SPINNING))
2161  { // Yield after 100 spin cycles and ready to swap vinyl.
2162  if (!(pci->dwTIFlags & TIF_WAITFORINPUTIDLE))
2163  { // Not waiting for idle event.
2164  if (!pcti->fsChangeBits && !pcti->fsWakeBits)
2165  { // No messages are available.
2166  if ((GetTickCount() - pcti->timeLastRead) > 1000)
2167  { // Up the msg read count if over 1 sec.
2169  }
2170  pci->cSpins = 0;
2171  ZwYieldExecution();
2172  FIXME("seeSpins!\n");
2173  return FALSE;
2174  }
2175  }
2176  }
2177  }
2178  return NtUserPeekMessage(pMsg, hWnd, wMsgFilterMin, wMsgFilterMax, wRemoveMsg);
2179 }
2180 
2181 /*
2182  * @implemented
2183  */
2184 BOOL
2185 WINAPI
2188  HWND hWnd,
2189  UINT wMsgFilterMin,
2190  UINT wMsgFilterMax,
2191  UINT wRemoveMsg)
2192 {
2193  BOOL Res;
2194 
2195  Res = PeekMessageWorker(lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax, wRemoveMsg);
2196  if (-1 == (int) Res || !Res)
2197  {
2198  return FALSE;
2199  }
2200 
2201  IntConvertMsgToAnsi(lpMsg);
2202 
2203  return Res;
2204 }
2205 
2206 
2207 /*
2208  * @implemented
2209  */
2210 BOOL
2211 WINAPI
2214  LPMSG lpMsg,
2215  HWND hWnd,
2216  UINT wMsgFilterMin,
2217  UINT wMsgFilterMax,
2218  UINT wRemoveMsg)
2219 {
2220  BOOL Res;
2221 
2222  Res = PeekMessageWorker(lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax, wRemoveMsg);
2223  if (-1 == (int) Res || !Res)
2224  {
2225  return FALSE;
2226  }
2227 
2228  return Res;
2229 }
2230 
2231 /*
2232  * @implemented
2233  */
2234 BOOL
2235 WINAPI
2237  HWND hWnd,
2238  UINT Msg,
2239  WPARAM wParam,
2240  LPARAM lParam)
2241 {
2242  LRESULT Ret;
2243 
2244  /* Check for combo box or a list box to send names. */
2245  if (Msg == CB_DIR || Msg == LB_DIR)
2246  {
2247  /*
2248  Set DDL_POSTMSGS, so use the PostMessage function to send messages to the
2249  combo/list box. Forces a call like DlgDirListComboBox.
2250  */
2251  //wParam |= DDL_POSTMSGS;
2252  return NtUserPostMessage(hWnd, Msg, wParam, lParam);
2253  }
2254 
2255  /* No drop files or current Process, just post message. */
2256  if ( (Msg != WM_DROPFILES) ||
2259  {
2260  return NtUserPostMessage(hWnd, Msg, wParam, lParam);
2261  }
2262 
2263  /* We have drop files and this is not the same process for this window. */
2264 
2265  /* Just incase, check wParam for Global memory handle and send size. */
2266  Ret = SendMessageA( hWnd,
2268  (WPARAM)GlobalSize((HGLOBAL)wParam), // Zero if not a handle.
2269  (LPARAM)wParam); // Send wParam as lParam.
2270 
2271  if ( Ret ) return NtUserPostMessage(hWnd, Msg, (WPARAM)Ret, lParam);
2272 
2273  return FALSE;
2274 }
2275 
2276 /*
2277  * @implemented
2278  */
2279 BOOL
2280 WINAPI
2282  HWND hWnd,
2283  UINT Msg,
2284  WPARAM wParam,
2285  LPARAM lParam)
2286 {
2287  LRESULT Ret;
2288 
2289  /* Check for combo box or a list box to send names. */
2290  if (Msg == CB_DIR || Msg == LB_DIR)
2291  {
2292  /*
2293  Set DDL_POSTMSGS, so use the PostMessage function to send messages to the
2294  combo/list box. Forces a call like DlgDirListComboBox.
2295  */
2296  //wParam |= DDL_POSTMSGS;
2297  return NtUserPostMessage(hWnd, Msg, wParam, lParam);
2298  }
2299 
2300  /* No drop files or current Process, just post message. */
2301  if ( (Msg != WM_DROPFILES) ||
2304  {
2305  return NtUserPostMessage(hWnd, Msg, wParam, lParam);
2306  }
2307 
2308  /* We have drop files and this is not the same process for this window. */
2309 
2310  /* Just incase, check wParam for Global memory handle and send size. */
2311  Ret = SendMessageW( hWnd,
2313  (WPARAM)GlobalSize((HGLOBAL)wParam), // Zero if not a handle.
2314  (LPARAM)wParam); // Send wParam as lParam.
2315 
2316  if ( Ret ) return NtUserPostMessage(hWnd, Msg, (WPARAM)Ret, lParam);
2317 
2318  return FALSE;
2319 }
2320 
2321 /*
2322  * @implemented
2323  */
2324 VOID
2325 WINAPI
2327  int nExitCode)
2328 {
2329  NtUserxPostQuitMessage(nExitCode);
2330 }
2331 
2332 
2333 /*
2334  * @implemented
2335  */
2336 BOOL
2337 WINAPI
2339  DWORD idThread,
2340  UINT Msg,
2341  WPARAM wParam,
2342  LPARAM lParam)
2343 {
2344  return NtUserPostThreadMessage(idThread, Msg, wParam, lParam);
2345 }
2346 
2347 
2348 /*
2349  * @implemented
2350  */
2351 BOOL
2352 WINAPI
2354  DWORD idThread,
2355  UINT Msg,
2356  WPARAM wParam,
2357  LPARAM lParam)
2358 {
2359  return NtUserPostThreadMessage(idThread, Msg, wParam, lParam);
2360 }
2361 
2362 
2363 /*
2364  * @implemented
2365  */
2368  UINT Msg,
2369  WPARAM wParam,
2370  LPARAM lParam)
2371 {
2372  MSG UMMsg, KMMsg;
2373  LRESULT Result;
2374  BOOL Ret;
2375  PWND Window;
2377 
2378  if ( Msg & ~WM_MAXIMUM )
2379  {
2381  return 0;
2382  }
2383 
2384  if (Wnd != HWND_TOPMOST && Wnd != HWND_BROADCAST && (Msg < WM_DDE_FIRST || Msg > WM_DDE_LAST))
2385  {
2386  Window = ValidateHwnd(Wnd);
2387 
2388  if ( Window != NULL &&
2389  Window->head.pti == ti &&
2392  !(Window->state & WNDS_SERVERSIDEWINDOWPROC) )
2393  {
2394  /* NOTE: We can directly send messages to the window procedure
2395  if *all* the following conditions are met:
2396 
2397  * Window belongs to calling thread
2398  * The calling thread is not being hooked for CallWndProc
2399  * Not calling a server side proc:
2400  Desktop, Switch, ScrollBar, Menu, IconTitle, or hWndMessage
2401  */
2402 
2403  return IntCallMessageProc(Window, Wnd, Msg, wParam, lParam, FALSE);
2404  }
2405  }
2406 
2407  UMMsg.hwnd = Wnd;
2408  UMMsg.message = Msg;
2409  UMMsg.wParam = wParam;
2410  UMMsg.lParam = lParam;
2411  UMMsg.time = 0;
2412  UMMsg.pt.x = 0;
2413  UMMsg.pt.y = 0;
2414 
2415  if (! MsgiUMToKMMessage(&UMMsg, &KMMsg, FALSE))
2416  {
2417  return FALSE;
2418  }
2419 
2420  Ret = NtUserMessageCall( Wnd,
2421  KMMsg.message,
2422  KMMsg.wParam,
2423  KMMsg.lParam,
2424  (ULONG_PTR)&Result,
2426  FALSE);
2427  if (!Ret)
2428  {
2429  ERR("SendMessageW Error\n");
2430  }
2431 
2432  MsgiUMToKMCleanup(&UMMsg, &KMMsg);
2433 
2434  return Result;
2435 }
2436 
2437 
2438 /*
2439  * @implemented
2440  */
2443 {
2444  MSG AnsiMsg, UcMsg, KMMsg;
2445  LRESULT Result;
2446  BOOL Ret;
2447  PWND Window;
2449 
2450  if ( Msg & ~WM_MAXIMUM )
2451  {
2453  return 0;
2454  }
2455 
2456  if (Wnd != HWND_TOPMOST && Wnd != HWND_BROADCAST && (Msg < WM_DDE_FIRST || Msg > WM_DDE_LAST))
2457  {
2458  Window = ValidateHwnd(Wnd);
2459 
2460  if ( Window != NULL &&
2461  Window->head.pti == ti &&
2464  !(Window->state & WNDS_SERVERSIDEWINDOWPROC) )
2465  {
2466  /* NOTE: We can directly send messages to the window procedure
2467  if *all* the following conditions are met:
2468 
2469  * Window belongs to calling thread
2470  * The calling thread is not being hooked for CallWndProc
2471  * Not calling a server side proc:
2472  Desktop, Switch, ScrollBar, Menu, IconTitle, or hWndMessage
2473  */
2474 
2475  return IntCallMessageProc(Window, Wnd, Msg, wParam, lParam, TRUE);
2476  }
2477  }
2478 
2479  AnsiMsg.hwnd = Wnd;
2480  AnsiMsg.message = Msg;
2481  AnsiMsg.wParam = wParam;
2482  AnsiMsg.lParam = lParam;
2483  AnsiMsg.time = 0;
2484  AnsiMsg.pt.x = 0;
2485  AnsiMsg.pt.y = 0;
2486 
2487  if (!MsgiAnsiToUnicodeMessage(Wnd, &UcMsg, &AnsiMsg))
2488  {
2489  return FALSE;
2490  }
2491 
2492  if (!MsgiUMToKMMessage(&UcMsg, &KMMsg, FALSE))
2493  {
2494  MsgiAnsiToUnicodeCleanup(&UcMsg, &AnsiMsg);
2495  return FALSE;
2496  }
2497 
2498  Ret = NtUserMessageCall( Wnd,
2499  KMMsg.message,
2500  KMMsg.wParam,
2501  KMMsg.lParam,
2502  (ULONG_PTR)&Result,
2504  TRUE);
2505  if (!Ret)
2506  {
2507  ERR("SendMessageA Error\n");
2508  }
2509 
2510  MsgiUMToKMCleanup(&UcMsg, &KMMsg);
2511  MsgiAnsiToUnicodeReply(&UcMsg, &AnsiMsg, &Result);
2512 
2513  return Result;
2514 }
2515 
2516 /*
2517  * @implemented
2518  */
2519 BOOL
2520 WINAPI
2522  HWND hWnd,
2523  UINT Msg,
2524  WPARAM wParam,
2525  LPARAM lParam,
2526  SENDASYNCPROC lpCallBack,
2527  ULONG_PTR dwData)
2528 {
2529  BOOL Result;
2530  MSG AnsiMsg, UcMsg;
2531  CALL_BACK_INFO CallBackInfo;
2532 
2534  {
2536  return FALSE;
2537  }
2538 
2539  CallBackInfo.CallBack = lpCallBack;
2540  CallBackInfo.Context = dwData;
2541 
2542  AnsiMsg.hwnd = hWnd;
2543  AnsiMsg.message = Msg;
2544  AnsiMsg.wParam = wParam;
2545  AnsiMsg.lParam = lParam;
2546  AnsiMsg.time = 0;
2547  AnsiMsg.pt.x = 0;
2548  AnsiMsg.pt.y = 0;
2549 
2550  if (!MsgiAnsiToUnicodeMessage(hWnd, &UcMsg, &AnsiMsg))
2551  {
2552  return FALSE;
2553  }
2554 
2556  UcMsg.message,
2557  UcMsg.wParam,
2558  UcMsg.lParam,
2559  (ULONG_PTR)&CallBackInfo,
2561  TRUE);
2562 
2563  MsgiAnsiToUnicodeCleanup(&UcMsg, &AnsiMsg);
2564 
2565  return Result;
2566 }
2567 
2568 /*
2569  * @implemented
2570  */
2571 BOOL
2572 WINAPI
2574  HWND hWnd,
2575  UINT Msg,
2576  WPARAM wParam,
2577  LPARAM lParam,
2578  SENDASYNCPROC lpCallBack,
2579  ULONG_PTR dwData)
2580 {
2581  CALL_BACK_INFO CallBackInfo;
2582 
2584  {
2586  return FALSE;
2587  }
2588 
2589  CallBackInfo.CallBack = lpCallBack;
2590  CallBackInfo.Context = dwData;
2591 
2592  return NtUserMessageCall(hWnd,
2593  Msg,
2594  wParam,
2595  lParam,
2596  (ULONG_PTR)&CallBackInfo,
2598  FALSE);
2599 }
2600 
2601 /*
2602  * @implemented
2603  */
2604 LRESULT
2605 WINAPI
2607  HWND hWnd,
2608  UINT Msg,
2609  WPARAM wParam,
2610  LPARAM lParam,
2611  UINT fuFlags,
2612  UINT uTimeout,
2613  PDWORD_PTR lpdwResult)
2614 {
2615  MSG AnsiMsg, UcMsg, KMMsg;
2616  LRESULT Result;
2617  DOSENDMESSAGE dsm;
2618 
2619  if ( Msg & ~WM_MAXIMUM || fuFlags & ~(SMTO_NOTIMEOUTIFNOTHUNG|SMTO_ABORTIFHUNG|SMTO_BLOCK))
2620  {
2622  return 0;
2623  }
2624 
2625  if (lpdwResult) *lpdwResult = 0;
2626 
2628 
2629  dsm.uFlags = fuFlags;
2630  dsm.uTimeout = uTimeout;
2631  dsm.Result = 0;
2632 
2633  AnsiMsg.hwnd = hWnd;
2634  AnsiMsg.message = Msg;
2635  AnsiMsg.wParam = wParam;
2636  AnsiMsg.lParam = lParam;
2637  AnsiMsg.time = 0;
2638  AnsiMsg.pt.x = 0;
2639  AnsiMsg.pt.y = 0;
2640 
2641  if (! MsgiAnsiToUnicodeMessage(hWnd, &UcMsg, &AnsiMsg))
2642  {
2643  return FALSE;
2644  }
2645 
2646  if (!MsgiUMToKMMessage(&UcMsg, &KMMsg, FALSE))
2647  {
2648  MsgiAnsiToUnicodeCleanup(&UcMsg, &AnsiMsg);
2649  return FALSE;
2650  }
2651 
2653  KMMsg.message,
2654  KMMsg.wParam,
2655  KMMsg.lParam,
2656  (ULONG_PTR)&dsm,
2658  TRUE);
2659 
2660  MsgiUMToKMCleanup(&UcMsg, &KMMsg);
2661  MsgiAnsiToUnicodeReply(&UcMsg, &AnsiMsg, &Result);
2662 
2663  if (lpdwResult) *lpdwResult = dsm.Result;
2664 
2666 
2667  return Result;
2668 }
2669 
2670 
2671 /*
2672  * @implemented
2673  */
2674 LRESULT
2675 WINAPI
2677  HWND hWnd,
2678  UINT Msg,
2679  WPARAM wParam,
2680  LPARAM lParam,
2681  UINT fuFlags,
2682  UINT uTimeout,
2683  PDWORD_PTR lpdwResult)
2684 {
2685  LRESULT Result;
2686  DOSENDMESSAGE dsm;
2687  MSG UMMsg, KMMsg;
2688 
2689  if ( Msg & ~WM_MAXIMUM || fuFlags & ~(SMTO_NOTIMEOUTIFNOTHUNG|SMTO_ABORTIFHUNG|SMTO_BLOCK))
2690  {
2692  return 0;
2693  }
2694 
2695  if (lpdwResult) *lpdwResult = 0;
2696 
2698 
2699  dsm.uFlags = fuFlags;
2700  dsm.uTimeout = uTimeout;
2701  dsm.Result = 0;
2702 
2703  UMMsg.hwnd = hWnd;
2704  UMMsg.message = Msg;
2705  UMMsg.wParam = wParam;
2706  UMMsg.lParam = lParam;
2707  UMMsg.time = 0;
2708  UMMsg.pt.x = 0;
2709  UMMsg.pt.y = 0;
2710  if (! MsgiUMToKMMessage(&UMMsg, &KMMsg, TRUE))
2711  {
2712  return FALSE;
2713  }
2714 
2716  KMMsg.message,
2717  KMMsg.wParam,
2718  KMMsg.lParam,
2719  (ULONG_PTR)&dsm,
2721  FALSE);
2722 
2723  MsgiUMToKMCleanup(&UMMsg, &KMMsg);
2724 
2725  if (lpdwResult) *lpdwResult = dsm.Result;
2726 
2728 
2729  return Result;
2730 }
2731 
2732 /*
2733  * @implemented
2734  */
2735 BOOL
2736 WINAPI
2738  HWND hWnd,
2739  UINT Msg,
2740  WPARAM wParam,
2741  LPARAM lParam)
2742 {
2743  BOOL Ret;
2744  MSG AnsiMsg, UcMsg;
2745 
2747  {
2749  return FALSE;
2750  }
2751 
2752  AnsiMsg.hwnd = hWnd;
2753  AnsiMsg.message = Msg;
2754  AnsiMsg.wParam = wParam;
2755  AnsiMsg.lParam = lParam;
2756  AnsiMsg.time = 0;
2757  AnsiMsg.pt.x = 0;
2758  AnsiMsg.pt.y = 0;
2759  if (! MsgiAnsiToUnicodeMessage(hWnd, &UcMsg, &AnsiMsg))
2760  {
2761  return FALSE;
2762  }
2763  Ret = SendNotifyMessageW(hWnd, UcMsg.message, UcMsg.wParam, UcMsg.lParam);
2764 
2765  MsgiAnsiToUnicodeCleanup(&UcMsg, &AnsiMsg);
2766 
2767  return Ret;
2768 }
2769 
2770 /*
2771  * @implemented
2772  */
2773 BOOL
2774 WINAPI
2776  HWND hWnd,
2777  UINT Msg,
2778  WPARAM wParam,
2779  LPARAM lParam)
2780 {
2781  LRESULT Result;
2782 
2784  {
2786  return FALSE;
2787  }
2788 
2790  Msg,
2791  wParam,
2792  lParam,
2793  0,
2795  FALSE);
2796 
2797  return Result;
2798 }
2799 
2800 /*
2801  * @implemented
2802  */
2803 BOOL WINAPI
2805 {
2806  switch (lpMsg->message)
2807  {
2808  case WM_KEYDOWN:
2809  case WM_KEYUP:
2810  case WM_SYSKEYDOWN:
2811  case WM_SYSKEYUP:
2812  return(NtUserTranslateMessage((LPMSG)lpMsg, Flags));
2813 
2814  default:
2815  if ( lpMsg->message & ~WM_MAXIMUM )
2817  return FALSE;
2818  }
2819 }
2820 
2821 
2822 /*
2823  * @implemented
2824  */
2825 BOOL WINAPI
2827 {
2828  BOOL Ret = FALSE;
2829 
2830 // Ref: msdn ImmGetVirtualKey:
2831 // http://msdn.microsoft.com/en-us/library/aa912145.aspx
2832 /*
2833  if ( (LOWORD(lpMsg->wParam) != VK_PROCESSKEY) ||
2834  !(Ret = IMM_ImmTranslateMessage( lpMsg->hwnd,
2835  lpMsg->message,
2836  lpMsg->wParam,
2837  lpMsg->lParam)) )*/
2838  {
2839  Ret = TranslateMessageEx((LPMSG)lpMsg, 0);
2840  }
2841  return Ret;
2842 }
2843 
2844 
2845 /*
2846  * @implemented
2847  */
2848 UINT WINAPI
2850 {
2852  UINT Atom;
2853 
2854  if (!RtlCreateUnicodeStringFromAsciiz(&String, (PCSZ)lpString))
2855  {
2856  return(0);
2857  }
2860  return(Atom);
2861 }
2862 
2863 
2864 /*
2865  * @implemented
2866  */
2867 UINT WINAPI
2869 {
2871 
2872  RtlInitUnicodeString(&String, lpString);
2874 }
2875 
2876 /*
2877  * @implemented
2878  */
2879 HWND WINAPI
2881 {
2883 }
2884 
2885 /*
2886  * @implemented
2887  */
2888 BOOL WINAPI
2890 {
2891  return NtUserxReleaseCapture();
2892 }
2893 
2894 
2895 /*
2896  * @implemented
2897  */
2898 DWORD
2899 WINAPI
2901 {
2902  #define QS_TEMPALLINPUT 255 // ATM, do not support QS_RAWINPUT
2904  {
2906  return 0;
2907  }
2908  return NtUserxGetQueueStatus(flags);
2909 }
2910 
2911 
2912 /*
2913  * @implemented
2914  */
2916 {
2917  PCLIENTTHREADINFO pcti = GetWin32ClientInfo()->pClientThreadInfo;
2918 
2919  if ((!pcti) || (pcti->fsChangeBits & (QS_KEY|QS_MOUSEBUTTON)))
2921 
2922  return FALSE;
2923 }
2924 
2925 
2927 User32CallWindowProcFromKernel(PVOID Arguments, ULONG ArgumentLength)
2928 {
2929  PWINDOWPROC_CALLBACK_ARGUMENTS CallbackArgs;
2930  MSG KMMsg, UMMsg;
2931  PWND pWnd = NULL;
2933 
2934  /* Make sure we don't try to access mem beyond what we were given */
2935  if (ArgumentLength < sizeof(WINDOWPROC_CALLBACK_ARGUMENTS))
2936  {
2938  }
2939 
2940  CallbackArgs = (PWINDOWPROC_CALLBACK_ARGUMENTS) Arguments;
2941  KMMsg.hwnd = CallbackArgs->Wnd;
2942  KMMsg.message = CallbackArgs->Msg;
2943  KMMsg.wParam = CallbackArgs->wParam;
2944  KMMsg.time = 0;
2945  KMMsg.pt.x = 0;
2946  KMMsg.pt.y = 0;
2947  /* Check if lParam is really a pointer and adjust it if it is */
2948  if (0 <= CallbackArgs->lParamBufferSize)
2949  {
2950  if (ArgumentLength != sizeof(WINDOWPROC_CALLBACK_ARGUMENTS)
2951  + CallbackArgs->lParamBufferSize)
2952  {
2954  }
2955  KMMsg.lParam = (LPARAM) ((char *) CallbackArgs + sizeof(WINDOWPROC_CALLBACK_ARGUMENTS));
2956  switch(KMMsg.message)
2957  {
2958  case WM_CREATE:
2959  {
2960  TRACE("WM_CREATE CB %p lParam %p\n",CallbackArgs, KMMsg.lParam);
2961  break;
2962  }
2963  case WM_NCCREATE:
2964  {
2965  TRACE("WM_NCCREATE CB %p lParam %p\n",CallbackArgs, KMMsg.lParam);
2966  break;
2967  }
2968  case WM_SYSTIMER:
2969  {
2970  TRACE("WM_SYSTIMER %p\n",KMMsg.hwnd);
2971  break;
2972  }
2973  case WM_SIZING:
2974  {
2975  PRECT prect = (PRECT) KMMsg.lParam;
2976  TRACE("WM_SIZING 1 t %d l %d r %d b %d\n",prect->top,prect->left,prect->right,prect->bottom);
2977  break;
2978  }
2979  default:
2980  break;
2981  }
2982  }
2983  else
2984  {
2985  if (ArgumentLength != sizeof(WINDOWPROC_CALLBACK_ARGUMENTS))
2986  {
2988  }
2989  KMMsg.lParam = CallbackArgs->lParam;
2990  }
2991 
2992  if (WM_NCCALCSIZE == CallbackArgs->Msg && CallbackArgs->wParam)
2993  {
2994  NCCALCSIZE_PARAMS *Params = (NCCALCSIZE_PARAMS *) KMMsg.lParam;
2995  Params->lppos = (PWINDOWPOS) (Params + 1);
2996  }
2997 
2998  if (! MsgiKMToUMMessage(&KMMsg, &UMMsg))
2999  {
3000  }
3001 
3002  if (pci->CallbackWnd.hWnd == UMMsg.hwnd)
3003  pWnd = pci->CallbackWnd.pWnd;
3004 
3005  CallbackArgs->Result = IntCallWindowProcW( CallbackArgs->IsAnsiProc,
3006  CallbackArgs->Proc,
3007  pWnd,
3008  UMMsg.hwnd,
3009  UMMsg.message,
3010  UMMsg.wParam,
3011  UMMsg.lParam);
3012 
3013  if (! MsgiKMToUMReply(&KMMsg, &UMMsg, &CallbackArgs->Result))
3014  {
3015  }
3016 
3017  if (0 <= CallbackArgs->lParamBufferSize)
3018  {
3019  switch(KMMsg.message)
3020  {
3021  case WM_SIZING:
3022  {
3023  PRECT prect = (PRECT) KMMsg.lParam;
3024  TRACE("WM_SIZING 2 t %d l %d r %d b %d\n",prect->top,prect->left,prect->right,prect->bottom);
3025  break;
3026  }
3027  default:
3028  break;
3029  }
3030  }
3031  return ZwCallbackReturn(CallbackArgs, ArgumentLength, STATUS_SUCCESS);
3032 }
3033 
3034 /*
3035  * @implemented
3036  */
3037 BOOL WINAPI SetMessageQueue(int cMessagesMax)
3038 {
3039  /* Function does nothing on 32 bit windows */
3040  return TRUE;
3041 }
3043 typedef DWORD (WINAPI * RealMsgWaitForMultipleObjectsExProc)(DWORD nCount, CONST HANDLE *lpHandles, DWORD dwMilliseconds, DWORD dwWakeMask, DWORD dwFlags);
3046 
3054 
3055 DWORD
3056 WINAPI
3058  DWORD nCount,
3059  CONST HANDLE *pHandles,
3060  DWORD dwMilliseconds,
3061  DWORD dwWakeMask,
3062  DWORD dwFlags);
3063 
3064 typedef BOOL (WINAPI * MESSAGEPUMPHOOKPROC)(BOOL Unregistering,PUSER_MESSAGE_PUMP_ADDRESSES MessagePumpAddresses);
3065 
3074 };
3075 
3077 
3079 { // FF uses this and polls it when Min/Max
3080  PCLIENTTHREADINFO pcti = GetWin32ClientInfo()->pClientThreadInfo;
3081  return (gfMessagePumpHook && pcti && (pcti->dwcPumpHook > 0));
3082 }
3083 
3085 {
3086  Addresses->cbSize = sizeof(USER_MESSAGE_PUMP_ADDRESSES);
3091 }
3092 
3094 {
3096  if(!Hook) {
3099  return FALSE;
3100  }
3101  if(!gcLoadMPH) {
3102  USER_MESSAGE_PUMP_ADDRESSES Addresses;
3103  gpfnInitMPH = Hook;
3104  ResetMessagePumpHook(&Addresses);
3105  if(!Hook(FALSE, &Addresses) || !Addresses.cbSize) {
3107  return FALSE;
3108  }
3109  memcpy(&gmph, &Addresses, Addresses.cbSize);
3110  } else {
3111  if(gpfnInitMPH != Hook) {
3113  return FALSE;
3114  }
3115  }
3116  if(NtUserxInitMessagePump()) {
3118  return FALSE;
3119  }
3120  if (!gcLoadMPH++) {
3122  }
3124  return TRUE;
3125 }
3126 
3128 {
3130  if(gcLoadMPH > 0) {
3131  if(NtUserxUnInitMessagePump()) {
3132  gcLoadMPH--;
3133  if(!gcLoadMPH) {
3135  gpfnInitMPH(TRUE, NULL);
3137  gpfnInitMPH = 0;
3138  }
3140  return TRUE;
3141  }
3142  }
3144  return FALSE;
3145 }
3146 
3148 {
3150 }
3151 
3172 DWORD WINAPI
3174  DWORD nCount,
3175  const HANDLE *pHandles,
3176  DWORD dwMilliseconds,
3177  DWORD dwWakeMask,
3178  DWORD dwFlags)
3179 {
3180  LPHANDLE RealHandles;
3181  HANDLE MessageQueueHandle;
3182  DWORD Result;
3183  PCLIENTINFO pci;
3184  PCLIENTTHREADINFO pcti;
3185 
3187  {
3189  return WAIT_FAILED;
3190  }
3191 
3192  pci = GetWin32ClientInfo();
3193  if (!pci) return WAIT_FAILED;
3194 
3195  pcti = pci->pClientThreadInfo;
3196  if (pcti && ( !nCount || !(dwFlags & MWMO_WAITALL) ))
3197  {
3198  if ( (pcti->fsChangeBits & LOWORD(dwWakeMask)) ||
3199  ( (dwFlags & MWMO_INPUTAVAILABLE) && (pcti->fsWakeBits & LOWORD(dwWakeMask)) ) )
3200  {
3201  //FIXME("Return Chg 0x%x Wake 0x%x Mask 0x%x nCnt %d\n",pcti->fsChangeBits, pcti->fsWakeBits, dwWakeMask, nCount);
3202  return nCount;
3203  }
3204  }
3205 
3206  MessageQueueHandle = NtUserxMsqSetWakeMask(MAKELONG(dwWakeMask, dwFlags));
3207  if (MessageQueueHandle == NULL)
3208  {
3209  SetLastError(0); /* ? */
3210  return WAIT_FAILED;
3211  }
3212 
3213  RealHandles = HeapAlloc(GetProcessHeap(), 0, (nCount + 1) * sizeof(HANDLE));
3214  if (RealHandles == NULL)
3215  {
3218  return WAIT_FAILED;
3219  }
3220 
3221  RtlCopyMemory(RealHandles, pHandles, nCount * sizeof(HANDLE));
3222  RealHandles[nCount] = MessageQueueHandle;
3223 
3224  //FIXME("1 Chg 0x%x Wake 0x%x Mask 0x%x nCnt %d\n",pcti->fsChangeBits, pcti->fsWakeBits, dwWakeMask, nCount);
3225 
3226  Result = WaitForMultipleObjectsEx( nCount + 1,
3227  RealHandles,
3229  dwMilliseconds,
3230  dwFlags & MWMO_ALERTABLE );
3231 
3232  //FIXME("2 Chg 0x%x Wake 0x%x Mask 0x%x nCnt %d\n",pcti->fsChangeBits, pcti->fsWakeBits, dwWakeMask, nCount);
3233 
3234  HeapFree(GetProcessHeap(), 0, RealHandles);
3236 
3237  // wine hack! MSDN: If dwMilliseconds is zero,,specified objects are not signaled; it always returns immediately.
3238  if (!Result && !nCount && !dwMilliseconds) Result = WAIT_TIMEOUT;
3239 
3240  //FIXME("Result 0X%x\n",Result);
3241  return Result;
3242 }
3243 
3244 /*
3245  * @implemented
3246  */
3247 DWORD WINAPI
3249  DWORD nCount,
3250  CONST HANDLE *lpHandles,
3251  DWORD dwMilliseconds,
3252  DWORD dwWakeMask,
3253  DWORD dwFlags)
3254 {
3255  return IsInsideMessagePumpHook() ? gmph.RealMsgWaitForMultipleObjectsEx(nCount, lpHandles, dwMilliseconds, dwWakeMask, dwFlags) : RealMsgWaitForMultipleObjectsEx(nCount, lpHandles,dwMilliseconds, dwWakeMask, dwFlags);
3256 }
3257 
3258 /*
3259  * @implemented
3260  */
3261 DWORD WINAPI
3263  DWORD nCount,
3264  CONST HANDLE *lpHandles,
3265  BOOL fWaitAll,
3266  DWORD dwMilliseconds,
3267  DWORD dwWakeMask)
3268 {
3269  return MsgWaitForMultipleObjectsEx(nCount, lpHandles, dwMilliseconds,
3270  dwWakeMask, fWaitAll ? MWMO_WAITALL : 0);
3271 }
3272 
3273 
3275 {
3278 
3279  return TRUE;
3280 }
3281 
3283 {
3286 }
3287 
3288 /*
3289  * @implemented
3290  */
3291 BOOL WINAPI
3292 IsDialogMessageA( HWND hwndDlg, LPMSG pmsg )
3293 {
3294  MSG msg = *pmsg;
3295  msg.wParam = map_wparam_AtoW( msg.message, msg.wParam );
3296  return IsDialogMessageW( hwndDlg, &msg );
3297 }
3298 
3299 LONG
3300 WINAPI
3302  DWORD dwflags,
3303  LPDWORD lpdwRecipients,
3304  UINT uiMessage,
3305  WPARAM wParam,
3306  LPARAM lParam,
3307  PBSMINFO pBSMInfo,
3308  BOOL Ansi)
3309 {
3310  BROADCASTPARM parm;
3311  DWORD recips = BSM_ALLCOMPONENTS;
3312  BOOL ret = -1; // Set to return fail
3313  static const DWORD all_flags = ( BSF_QUERY | BSF_IGNORECURRENTTASK | BSF_FLUSHDISK | BSF_NOHANG
3315  | BSF_ALLOWSFW | BSF_SENDNOTIFYMESSAGE | BSF_RETURNHDESK | BSF_LUID );
3316 
3317  if ((dwflags & ~all_flags) ||
3318  (!pBSMInfo && (dwflags & (BSF_RETURNHDESK|BSF_LUID))) )
3319  {
3321  return 0;
3322  }
3323 
3324  if(uiMessage >= WM_USER && uiMessage < 0xC000)
3325  {
3327  return 0;
3328  }
3329 
3331 
3332  if (dwflags & BSF_QUERY) dwflags &= ~BSF_SENDNOTIFYMESSAGE|BSF_POSTMESSAGE;
3333 
3334  if (!lpdwRecipients)
3335  lpdwRecipients = &recips;
3336 
3338  {
3340  return 0;
3341  }
3342 
3343  if ( pBSMInfo && (dwflags & BSF_QUERY) )
3344  {
3345  if (pBSMInfo->cbSize != sizeof(BSMINFO))
3346  {
3348  return 0;
3349  }
3350  }
3351 
3352  parm.hDesk = NULL;
3353  parm.hWnd = NULL;
3354  parm.flags = dwflags;
3355  parm.recipients = *lpdwRecipients;
3356 
3357  if (dwflags & BSF_LUID) parm.luid = pBSMInfo->luid;
3358 
3360  uiMessage,
3361  wParam,
3362  lParam,
3363  (ULONG_PTR)&parm,
3365  Ansi);
3366 
3367  if (!ret)
3368  {
3369  if ( pBSMInfo && (dwflags & BSF_QUERY) )
3370  {
3371  pBSMInfo->hdesk = parm.hDesk;
3372  pBSMInfo->hwnd = parm.hWnd;
3373  }
3374  }
3375  return ret;
3376 }
3377 
3378 /*
3379  * @implemented
3380  */
3381 LONG
3382 WINAPI
3384  DWORD dwFlags,
3385  LPDWORD lpdwRecipients,
3386  UINT uiMessage,
3387  WPARAM wParam,
3388  LPARAM lParam)
3389 {
3390  return IntBroadcastSystemMessage( dwFlags, lpdwRecipients, uiMessage, wParam, lParam, NULL, TRUE );
3391 }
3392 
3393 /*
3394  * @implemented
3395  */
3396 LONG
3397 WINAPI
3399  DWORD dwFlags,
3400  LPDWORD lpdwRecipients,
3401  UINT uiMessage,
3402  WPARAM wParam,
3403  LPARAM lParam)
3404 {
3405  return IntBroadcastSystemMessage( dwFlags, lpdwRecipients, uiMessage, wParam, lParam, NULL, FALSE );
3406 }
3407 
3408 /*
3409  * @implemented
3410  */
3411 LONG
3412 WINAPI
3414  DWORD dwflags,
3415  LPDWORD lpdwRecipients,
3416  UINT uiMessage,
3417  WPARAM wParam,
3418  LPARAM lParam,
3419  PBSMINFO pBSMInfo)
3420 {
3421  return IntBroadcastSystemMessage( dwflags, lpdwRecipients, uiMessage, wParam, lParam , pBSMInfo, TRUE );
3422 }
3423 
3424 /*
3425  * @implemented
3426  */
3427 LONG
3428 WINAPI
3430  DWORD dwflags,
3431  LPDWORD lpdwRecipients,
3432  UINT uiMessage,
3433  WPARAM wParam,
3434  LPARAM lParam,
3435  PBSMINFO pBSMInfo)
3436 {
3437  return IntBroadcastSystemMessage( dwflags, lpdwRecipients, uiMessage, wParam, lParam , pBSMInfo, FALSE );
3438 }
3439 
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 * u
Definition: glfuncs.h:240
#define CBS_OWNERDRAWFIXED
Definition: winuser.h:289
LRESULT WINAPI SendMessageA(HWND Wnd, UINT Msg, WPARAM wParam, LPARAM lParam)
Definition: message.c:2442
CRITICAL_SECTION gcsMPH
Definition: message.c:3066
#define BSM_ALLCOMPONENTS
Definition: dbt.h:47
signed char * PCHAR
Definition: retypes.h:7
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
static const WCHAR Class[]
Definition: cfgmgr.c:39
BOOL WINAPI SendNotifyMessageW(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
Definition: message.c:2775
#define CALL_EXTERN_WNDPROC(proc, h, m, w, l)
Definition: message.c:27
CONST char * PCSZ
Definition: umtypes.h:125
static LRESULT FASTCALL IntCallWindowProcA(BOOL IsAnsiProc, WNDPROC WndProc, PWND pWnd, HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
Definition: message.c:1584
struct _USER_MESSAGE_PUMP_ADDRESSES * PUSER_MESSAGE_PUMP_ADDRESSES
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
BOOL FASTCALL EndUserApiHook(VOID)
Definition: usrapihk.c:164
const uint16_t * PCWSTR
Definition: typedefs.h:57
#define IN
Definition: typedefs.h:39
CALLBACKWND CallbackWnd
Definition: ntuser.h:297
#define LOCALE_IDEFAULTANSICODEPAGE
Definition: winnls.h:38
#define PtrToUint(p)
Definition: basetsd.h:85
LRESULT WINAPI DesktopWndProcW(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: desktop.c:33
#define BSF_FORCEIFHUNG
Definition: dbt.h:54
Definition: tftpd.h:59
#define LB_INSERTSTRING_LOWER
Definition: controls.h:87
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
BOOL FASTCALL MessageInit(VOID)
Definition: message.c:3274
#define MAKEWPARAM(l, h)
Definition: winuser.h:3984
HGLOBAL NTAPI GlobalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:368
#define QUERY_WINDOW_UNIQUE_PROCESS_ID
Definition: ntuser.h:2802
BOOL WINAPI TranslateMessageEx(CONST MSG *lpMsg, UINT Flags)
Definition: message.c:2804
#define LB_DIR
Definition: winuser.h:2015
WNDPROC pfnClientPrevious
Definition: ntuser.h:520
*BytesInUnicodeString PWCH UnicodeString
Definition: rtlfuncs.h:1979
DWORD_PTR NTAPI NtUserGetThreadState(DWORD Routine)
Definition: misc.c:231
#define LB_FINDSTRINGEXACT
Definition: winuser.h:2017
#define LB_ADDFILE
Definition: winuser.h:2012
#define STATUS_INFO_LENGTH_MISMATCH
Definition: udferr_usr.h:133
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
#define WM_GETDLGCODE
Definition: winuser.h:1671
#define WM_CHAR
Definition: winuser.h:1699
#define WideCharToMultiByte
Definition: compat.h:111
#define WM_IME_CHAR
Definition: winuser.h:1816
#define __cdecl
Definition: accygwin.h:79
#define BSF_IGNORECURRENTTASK
Definition: dbt.h:55
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
struct _WINDOWPROC_CALLBACK_ARGUMENTS * PWINDOWPROC_CALLBACK_ARGUMENTS
#define QS_TEMPALLINPUT
PCALLPROCDATA FASTCALL ValidateCallProc(HANDLE hCallProc)
Definition: misc.c:349
#define LB_ADDSTRING
Definition: winuser.h:2013
static BOOL FASTCALL MsgiUnicodeToAnsiCleanup(LPMSG AnsiMsg, LPMSG UnicodeMsg)
Definition: message.c:1156
#define LOBYTE(W)
Definition: jmemdos.c:487
#define WM_SYSTIMER
Definition: comctl32.h:112
static BOOL FASTCALL MsgiUMToKMMessage(PMSG UMMsg, PMSG KMMsg, BOOL Posted)
Definition: message.c:368
HGLOBAL ServerMem
Definition: message.c:172
BOOL APIENTRY NtUserTranslateMessage(LPMSG lpMsg, UINT flags)
Definition: message.c:2449
#define WM_MENUCHAR
Definition: winuser.h:1730
EXTINLINE LPARAM NtUserxGetMessageExtraInfo(VOID)
Definition: ntwrapper.h:796
#define GETPFNCLIENTW(fnid)
Definition: ntuser.h:867
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
WORD ATOM
Definition: dimm.idl:113
WNDPROC_OWP PostDefDlgProc
Definition: undocuser.h:343
DWORD WINAPI MsgWaitForMultipleObjects(DWORD nCount, CONST HANDLE *lpHandles, BOOL fWaitAll, DWORD dwMilliseconds, DWORD dwWakeMask)
Definition: message.c:3262
#define MWMO_INPUTAVAILABLE
Definition: winuser.h:900
RealInternalGetMessageProc NtUserRealInternalGetMessage
Definition: message.c:3049
#define SPY_RESULT_OK
Definition: user32p.h:71
UAHOWP DlgProcArray
Definition: undocuser.h:344
#define TRUE
Definition: types.h:120
#define QS_ALLPOSTMESSAGE
Definition: winuser.h:876
#define CB_GETLBTEXT
Definition: winuser.h:1934
uint16_t * PWSTR
Definition: typedefs.h:56
UINT WINAPI RegisterWindowMessageW(LPCWSTR lpString)
Definition: message.c:2868
#define WM_NCCALCSIZE
Definition: winuser.h:1667
#define CP_ACP
Definition: compat.h:109
#define WM_ASKCBFORMATNAME
Definition: winuser.h:1855
#define LBS_HASSTRINGS
Definition: pedump.c:684
#define GROWBY
char CHAR
Definition: xmlstorage.h:175
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
BOOL(WINAPI * MESSAGEPUMPHOOKPROC)(BOOL Unregistering, PUSER_MESSAGE_PUMP_ADDRESSES MessagePumpAddresses)
Definition: message.c:3064
#define WM_GETTEXT
Definition: winuser.h:1600
HDESK hDesk
Definition: ntuser.h:1063
RealWaitMessageExProc NtUserRealWaitMessageEx
Definition: message.c:3050
DWORD recipients
Definition: ntuser.h:1062
#define WARN(fmt,...)
Definition: debug.h:112
struct @1607 Msg[]
LONG NTSTATUS
Definition: precomp.h:26
USERAPIHOOK guah
Definition: usrapihk.c:344
#define LB_SETTABSTOPS
Definition: winuser.h:2051
LONG WINAPI BroadcastSystemMessageW(DWORD dwFlags, LPDWORD lpdwRecipients, UINT uiMessage, WPARAM wParam, LPARAM lParam)
Definition: message.c:3398
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
Definition: heap.c:606
GLenum GLuint GLenum GLsizei const GLchar * message
Definition: glext.h:5579
#define BSF_NOTIMEOUTIFNOTHUNG
Definition: dbt.h:57
#define BSF_QUERY
Definition: dbt.h:59
LPARAM WINAPI GetMessageExtraInfo(VOID)
Definition: message.c:1340
HWND hWnd
Definition: settings.c:17
DWORD WINAPI GetQueueStatus(UINT flags)
Definition: message.c:3147
DWORD WINAPI GetTickCount(VOID)
Definition: time.c:455
#define HIBYTE(W)
Definition: jmemdos.c:486
DWORD(WINAPI * RealMsgWaitForMultipleObjectsExProc)(DWORD nCount, CONST HANDLE *lpHandles, DWORD dwMilliseconds, DWORD dwWakeMask, DWORD dwFlags)
Definition: message.c:3043
#define New(t)
Definition: rtf.h:1086
LONG top
Definition: windef.h:307
HANDLE HWND
Definition: compat.h:19
static LRESULT WINAPI IntCallMessageProc(IN PWND Wnd, IN HWND hWnd, IN UINT Msg, IN WPARAM wParam, IN LPARAM lParam, IN BOOL Ansi)
Definition: message.c:1747
static HANDLE ULONG_PTR dwData
Definition: file.c:35
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
BOOL WINAPI PostMessageA(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
Definition: message.c:2236
#define SPY_SENDMESSAGE
Definition: user32p.h:69
static BOOL FASTCALL MsgiAnsiToUnicodeReply(LPMSG UnicodeMsg, LPMSG AnsiMsg, LRESULT *Result)
Definition: message.c:821
#define WM_DEVMODECHANGE
Definition: winuser.h:1613
BOOL WINAPI SendMessageCallbackW(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, SENDASYNCPROC lpCallBack, ULONG_PTR dwData)
Definition: message.c:2573
BOOL WINAPI SetMessageQueue(int cMessagesMax)
Definition: message.c:3037
#define GWL_EXSTYLE
Definition: winuser.h:845
#define HWND_TOPMOST
Definition: winuser.h:1194
#define QS_SMRESULT
Definition: undocuser.h:93
BOOL WINAPI InSendMessage(VOID)
Definition: message.c:1372
WPARAM wParam
Definition: winuser.h:3091
static unsigned DdeNumUsed
Definition: message.c:177
BOOL APIENTRY NtUserPostThreadMessage(DWORD idThread, UINT Msg, WPARAM wParam, LPARAM lParam)
Definition: message.c:2242
MESSAGEPUMPHOOKPROC gpfnInitMPH
Definition: message.c:3067
static WCHAR String[]
Definition: stringtable.c:55
UINT_PTR WPARAM
Definition: windef.h:207
struct tagDDEPAIR DDEPAIR
#define GetWin32ClientInfo()
Definition: ntuser.h:320
#define TIF_WAITFORINPUTIDLE
Definition: ntuser.h:254
LONG left
Definition: windef.h:306
#define GMEM_SHARE
Definition: winbase.h:302
EXTINLINE DWORD NtUserxGetQueueStatus(UINT flags)
Definition: ntwrapper.h:666
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
RealMsgWaitForMultipleObjectsExProc RealMsgWaitForMultipleObjectsEx
Definition: message.c:3052
char * LPSTR
Definition: xmlstorage.h:182
BOOL WINAPI IsDialogMessageA(HWND hwndDlg, LPMSG pmsg)
Definition: message.c:3292
HANDLE UniqueProcess
Definition: compat.h:573
_Out_ RTL_ATOM * Atom
Definition: class.h:54
#define BSF_NOHANG
Definition: dbt.h:56
LONG right
Definition: windef.h:308
#define BSF_POSTMESSAGE
Definition: dbt.h:58
DWORD WINAPI RealMsgWaitForMultipleObjectsEx(DWORD nCount, CONST HANDLE *pHandles, DWORD dwMilliseconds, DWORD dwWakeMask, DWORD dwFlags)
#define FASTCALL
Definition: nt_native.h:50
#define WM_NCCREATE
Definition: winuser.h:1665
void SPY_ExitMessage(INT iFlag, HWND hwnd, UINT msg, LRESULT lReturn, WPARAM wParam, LPARAM lParam)
Definition: spy.c:2648
HGLOBAL ClientMem
Definition: message.c:171
WPARAM wParam
Definition: combotst.c:138
#define WM_QUERYDROPOBJECT
Definition: undocuser.h:54
#define LB_SELECTSTRING
Definition: winuser.h:2038
#define LB_ADDSTRING_UPPER
Definition: controls.h:88
#define CBS_OWNERDRAWVARIABLE
Definition: winuser.h:290
#define SMTO_ABORTIFHUNG
Definition: winuser.h:1209
#define SET(msg)
Definition: message.c:34
struct tagDDEPAIR * PDDEPAIR
_SEH2_TRY
Definition: create.c:4226
BOOL WINAPI DECLSPEC_HOTPATCH PeekMessageA(LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax, UINT wRemoveMsg)
Definition: message.c:2187
#define LBS_OWNERDRAWFIXED
Definition: pedump.c:682
struct _THREADINFO * GetW32ThreadInfo(VOID)
Definition: misc.c:779
PCLIENTTHREADINFO pClientThreadInfo
Definition: ntuser.h:300
NTSYSAPI VOID NTAPI RtlInitAnsiString(PANSI_STRING DestinationString, PCSZ SourceString)
#define EM_GETSEL
Definition: winuser.h:1979
uint32_t ULONG_PTR
Definition: typedefs.h:65
EXTINLINE VOID NtUserxMsqClearWakeMask(VOID)
Definition: ntwrapper.h:546
GETCPD wType
Definition: ntuser.h:521
NTSYSAPI NTSTATUS NTAPI ZwCallbackReturn(_In_ PVOID Result, _In_ ULONG ResultLength, _In_ NTSTATUS Status)
#define CB_GETEDITSEL
Definition: winuser.h:1929
EXTINLINE BOOL NtUserxUnInitMessagePump(VOID)
Definition: ntwrapper.h:576
LONG WINAPI BroadcastSystemMessageExW(DWORD dwflags, LPDWORD lpdwRecipients, UINT uiMessage, WPARAM wParam, LPARAM lParam, PBSMINFO pBSMInfo)
Definition: message.c:3429
LPCSTR lpszName
Definition: winuser.h:2924
INT WINAPI GetLocaleInfoW(LCID lcid, LCTYPE lctype, LPWSTR buffer, INT len)
Definition: lang.c:1098
LONG WINAPI IntBroadcastSystemMessage(DWORD dwflags, LPDWORD lpdwRecipients, UINT uiMessage, WPARAM wParam, LPARAM lParam, PBSMINFO pBSMInfo, BOOL Ansi)
Definition: message.c:3301
DWORD_PTR NTAPI NtUserQueryWindow(HWND hWnd, DWORD Index)
Definition: window.c:3929
SIZE_T NTAPI GlobalSize(HGLOBAL hMem)
Definition: heapmem.c:1090
BOOL FASTCALL IsMsgOverride(UINT, PUAHOWP)
Definition: usrapihk.c:63
#define WM_NEXTMENU
Definition: winuser.h:1788
RealGetQueueStatusProc RealGetQueueStatus
Definition: message.c:3051
EXTINLINE DWORD NtUserxGetMessagePos(VOID)
Definition: ntwrapper.h:561
#define GHND
Definition: winbase.h:294
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
static WPARAM FASTCALL map_wparam_AtoW(UINT message, WPARAM wparam)
Definition: message.c:282
uint32_t cs
Definition: isohybrid.c:75
Definition: window.c:28
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
#define WS_EX_MDICHILD
Definition: winuser.h:394
ULONG_PTR dwData
Definition: winuser.h:2976
#define WM_CHARTOITEM
Definition: winuser.h:1631
static BOOL FASTCALL combobox_has_strings(HWND hwnd)
Definition: message.c:108
static __inline PVOID DesktopPtrToUser(PVOID Ptr)
Definition: user_x.h:12
BOOL WINAPI DECLSPEC_HOTPATCH GetMessageW(LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax)
Definition: message.c:2122
WNDPROC_OWP PostWndProc
Definition: undocuser.h:340
LONG WINAPI GetWindowLongA(_In_ HWND, _In_ int)
#define FALSE
Definition: types.h:117
static const unsigned int message_pointer_flags[]
Definition: message.c:36
DWORD fnid
Definition: ntuser.h:673
unsigned int BOOL
Definition: ntddk_ex.h:94
BOOL WINAPI SendNotifyMessageA(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
Definition: message.c:2737
long LONG
Definition: pedump.c:60
DWORD WINAPI RealGetQueueStatus(UINT flags)
Definition: message.c:2900
#define WM_DELETEITEM
Definition: winuser.h:1629
static BOOL FASTCALL MsgiUnicodeToAnsiMessage(HWND hwnd, LPMSG AnsiMsg, LPMSG UnicodeMsg)
Definition: message.c:874
#define FNID_DIALOG
Definition: ntuser.h:831
LRESULT FASTCALL IntCallWindowProcW(BOOL IsAnsiProc, WNDPROC WndProc, PWND pWnd, HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
Definition: message.c:1425
#define FIXME(fmt,...)
Definition: debug.h:111
static WPARAM FASTCALL map_wparam_char_WtoA(WPARAM wParam, DWORD len)
Definition: message.c:263
#define WM_DROPFILES
Definition: winuser.h:1807
#define WM_SYSCHAR
Definition: winuser.h:1703
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
static BOOL FASTCALL MsgiKMToUMReply(PMSG KMMsg, PMSG UMMsg, LRESULT *Result)
Definition: message.c:506
#define TIF_SPINNING
Definition: ntuser.h:250
#define WM_SIZING
Definition: winuser.h:1789
THRDESKHEAD head
Definition: ntuser.h:659
#define CB_ADDSTRING
Definition: winuser.h:1918
#define WM_DRAGSELECT
Definition: undocuser.h:57
DWORD gcLoadMPH
Definition: message.c:3068
NTSYSAPI NTSTATUS NTAPI ZwYieldExecution(VOID)
#define LB_GETSELITEMS
Definition: winuser.h:2030
VOID WINAPI PostQuitMessage(int nExitCode)
Definition: message.c:2326
LONG WINAPI GetWindowLongW(_In_ HWND, _In_ int)
#define MAKELONG(a, b)
Definition: typedefs.h:249
#define CB_INSERTSTRING
Definition: winuser.h:1939
static BOOL FASTCALL MsgiAnsiToUnicodeMessage(HWND hwnd, LPMSG UnicodeMsg, LPMSG AnsiMsg)
Definition: message.c:517
VOID WINAPI InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection)
Definition: synch.c:751
BOOL WINAPI RegisterMessagePumpHook(MESSAGEPUMPHOOKPROC Hook)
Definition: message.c:3093
smooth NULL
Definition: ftsmooth.c:416
LRESULT WINAPI CallWindowProcW(WNDPROC lpPrevWndFunc, HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
Definition: message.c:1853
HWND WINAPI GetDesktopWindow(void)
Definition: window.c:656
#define WM_WININICHANGE
Definition: winuser.h:1612
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
Definition: wsk.h:426
_In_ LPGUID _In_ PVOID Data
Definition: classpnp.h:971
Definition: ntuser.h:533
BOOL WINAPI IsDBCSLeadByte(BYTE TestByte)
Definition: nls.c:2232
#define WM_KEYDOWN
Definition: winuser.h:1697
LPARAM lParam
Definition: winuser.h:3092
LONG_PTR LPARAM
Definition: windef.h:208
WORD fsChangeBits
Definition: ntuser.h:166
BOOL WINAPI UnregisterMessagePumpHook(VOID)
Definition: message.c:3127
LRESULT WINAPI DesktopWndProcA(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: message.c:1307
NTSYSAPI BOOLEAN NTAPI RtlCreateUnicodeStringFromAsciiz(_Out_ PUNICODE_STRING Destination, _In_ PCSZ Source)
BOOL WINAPI GetInputState(VOID)
Definition: message.c:2915
Definition: bufpool.h:45
PWINDOWPOS lppos
Definition: winuser.h:3574
NTSYSAPI NTSTATUS NTAPI RtlUnicodeStringToAnsiString(PANSI_STRING DestinationString, PUNICODE_STRING SourceString, BOOLEAN AllocateDestinationString)
const char * LPCSTR
Definition: xmlstorage.h:183
#define WH_CALLWNDPROCRET
Definition: winuser.h:42
#define WM_DROPOBJECT
Definition: undocuser.h:53
BOOL APIENTRY NtUserGetMessage(PMSG pMsg, HWND hWnd, UINT MsgFilterMin, UINT MsgFilterMax)
Definition: message.c:2293
#define WM_SETTEXT
Definition: winuser.h:1599
#define CBS_HASSTRINGS
Definition: winuser.h:285
BOOL WINAPI PostMessageW(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
Definition: message.c:2281
BOOL WINAPI ReleaseCapture(VOID)
Definition: message.c:2889
#define FNID_SENDMESSAGE
Definition: ntuser.h:844
ULONG_PTR cSpins
Definition: ntuser.h:288
DWORD CTI_flags
Definition: ntuser.h:165
#define PCHAR
Definition: match.c:90
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
Definition: heap.c:588
#define DECLSPEC_HOTPATCH
Definition: _mingw.h:246
BOOL(WINAPI * RealWaitMessageExProc)(DWORD, UINT)
Definition: message.c:3045
struct _WINDOWPROC_CALLBACK_ARGUMENTS WINDOWPROC_CALLBACK_ARGUMENTS
BOOL APIENTRY NtUserMessageCall(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, ULONG_PTR ResultInfo, DWORD dwType, BOOL Ansi)
Definition: message.c:2486
#define WM_COPYDATA
Definition: winuser.h:1646
#define WM_DEADCHAR
Definition: winuser.h:1700
DWORD WINAPI GetMessagePos(VOID)
Definition: message.c:1351
static BOOL FASTCALL MsgiAnsiToUnicodeCleanup(LPMSG UnicodeMsg, LPMSG AnsiMsg)
Definition: message.c:709
EXTINLINE VOID NtUserxPostQuitMessage(int nExitCode)
Definition: ntwrapper.h:661
#define TRACE(s)
Definition: solgame.cpp:4
SENDASYNCPROC CallBack
Definition: callback.h:48
_Out_ PCLIENT_ID ClientId
Definition: kefuncs.h:1163
#define IS_INTRESOURCE(i)
Definition: winuser.h:580
#define CB_GETDROPPEDCONTROLRECT
Definition: winuser.h:1926
#define GetProcessHeap()
Definition: compat.h:484
#define EM_SETPASSWORDCHAR
Definition: winuser.h:1996
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
NTSYSAPI NTSTATUS WINAPI RtlMultiByteToUnicodeN(LPWSTR, DWORD, LPDWORD, LPCSTR, DWORD)
if(!(yy_init))
Definition: macro.lex.yy.c:714
__wchar_t WCHAR
Definition: xmlstorage.h:180
void WINAPI DeleteCriticalSection(PCRITICAL_SECTION)
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
struct tagMSG * LPMSG
#define MWMO_ALERTABLE
Definition: winuser.h:899
DWORD WINAPI WaitForMultipleObjectsEx(IN DWORD nCount, IN CONST HANDLE *lpHandles, IN BOOL bWaitAll, IN DWORD dwMilliseconds, IN BOOL bAlertable)
Definition: synch.c:169
#define BSM_NETDRIVER
Definition: dbt.h:51
static void Exit(void)
Definition: sock.c:1331
static VOID IntConvertMsgToAnsi(LPMSG lpMsg)
Definition: message.c:2065
#define CTI_INSENDMESSAGE
Definition: ntuser.h:161
BOOL(WINAPI * RealInternalGetMessageProc)(LPMSG, HWND, UINT, UINT, UINT, BOOL)
Definition: message.c:3044
#define WM_TIMER
Definition: winuser.h:1724
#define WM_WINDOWPOSCHANGING
Definition: winuser.h:1643
#define ISITHOOKED(HookId)
Definition: hook.h:6
void(CALLBACK * SENDASYNCPROC)(HWND, UINT, ULONG_PTR, LRESULT)
Definition: winuser.h:2891
DWORD WINAPI InSendMessageEx(LPVOID lpReserved)
Definition: message.c:1391
#define WINAPI
Definition: msvc.h:6
#define WM_KEYUP
Definition: winuser.h:1698
void SPY_EnterMessage(INT iFlag, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: spy.c:2593
NTSYSAPI VOID NTAPI RtlFreeAnsiString(PANSI_STRING AnsiString)
HGLOBAL FASTCALL DdeGetPair(HGLOBAL ServerMem)
Definition: message.c:231
CHAR AnsiBuffer[1024]
Definition: debug.c:15
struct _USER_MESSAGE_PUMP_ADDRESSES USER_MESSAGE_PUMP_ADDRESSES
unsigned long DWORD
Definition: ntddk_ex.h:95
GLenum GLenum GLenum GLenum mapping
Definition: glext.h:9031
static DWORD
Definition: message.c:31
#define WM_MEASUREITEM
Definition: winuser.h:1628
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
#define BSF_FLUSHDISK
Definition: dbt.h:53
HGLOBAL NTAPI GlobalFree(HGLOBAL hMem)
Definition: heapmem.c:611
#define SetLastError(x)
Definition: compat.h:500
#define FNID_SENDMESSAGECALLBACK
Definition: ntuser.h:852
ULONG_PTR * PDWORD_PTR
Definition: basetsd.h:184
BOOL NTAPI NtUserRealWaitMessageEx(DWORD dwWakeMask, UINT uTimeout)
Definition: ntstubs.c:656
WNDPROC_OWP PreDefDlgProc
Definition: undocuser.h:342
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
static BOOL FASTCALL listbox_has_strings(HWND hwnd)
Definition: message.c:115
LONG WINAPI GetMessageTime(VOID)
Definition: message.c:1361
int Window
Definition: x11stubs.h:26
GLbitfield flags
Definition: glext.h:7161
#define WAIT_TIMEOUT
Definition: dderror.h:14
#define WM_PAINT
Definition: winuser.h:1602
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
#define WM_MDIGETACTIVE
Definition: winuser.h:1803
LRESULT WINAPI DECLSPEC_HOTPATCH DispatchMessageW(CONST MSG *lpmsg)
Definition: message.c:1990
#define FNID_SENDNOTIFYMESSAGE
Definition: ntuser.h:851
static unsigned DdeNumAlloc
Definition: message.c:176
#define WM_DDE_LAST
Definition: dde.h:46
int ret
NTSYSAPI NTSTATUS NTAPI RtlUnicodeToMultiByteN(PCHAR MbString, ULONG MbSize, PULONG ResultSize, PCWCH UnicodeString, ULONG UnicodeSize)
#define EM_SETRECTNP
Definition: winuser.h:1999
Status
Definition: gdiplustypes.h:24
UINT NTAPI NtUserRegisterWindowMessage(PUNICODE_STRING MessageName)
Definition: window.c:4031
#define WM_MOVING
Definition: winuser.h:1791
BOOL WINAPI IsInsideMessagePumpHook()
Definition: message.c:3078
DWORD flags
Definition: ntuser.h:1061
HWND WINAPI GetCapture(VOID)
Definition: message.c:2880
#define LB_GETTEXT
Definition: winuser.h:2031
static const WCHAR L[]
Definition: oid.c:1250
#define WH_CALLWNDPROC
Definition: winuser.h:34
LPVOID NTAPI GlobalLock(HGLOBAL hMem)
Definition: heapmem.c:755
PWND FASTCALL ValidateHwnd(HWND hwnd)
Definition: misc.c:369
LPVOID lpCreateParams
Definition: winuser.h:2930
BOOL WINAPI SendMessageCallbackA(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, SENDASYNCPROC lpCallBack, ULONG_PTR dwData)
Definition: message.c:2521
WINE_DEFAULT_DEBUG_CHANNEL(crypt)
#define SBM_GETRANGE
Definition: winuser.h:2061
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
LPCWSTR lpszName
Definition: winuser.h:2939
#define CB_SELECTSTRING
Definition: winuser.h:1942
struct tagCOPYDATASTRUCT * PCOPYDATASTRUCT
DWORD WINAPI MsgWaitForMultipleObjectsEx(DWORD nCount, CONST HANDLE *lpHandles, DWORD dwMilliseconds, DWORD dwWakeMask, DWORD dwFlags)
Definition: message.c:3248
ULONG_PTR Result
Definition: ntuser.h:2622
#define GETPFNCLIENTA(fnid)
Definition: ntuser.h:865
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722
#define WM_DRAGLOOP
Definition: undocuser.h:56
GLdouble s
Definition: gl.h:2039
#define EM_SETTABSTOPS
Definition: winuser.h:2001
static VOID FASTCALL MsgiUMToKMCleanup(PMSG UMMsg, PMSG KMMsg)
Definition: message.c:412
static _In_ DWORD dwflags
Definition: dispmode.c:64
#define WM_MAXIMUM
Definition: undocuser.h:62
static BOOL FASTCALL MsgiKMToUMMessage(PMSG KMMsg, PMSG UMMsg)
Definition: message.c:432
UINT_PTR HKL
Definition: msctf.idl:101
static PDDEPAIR DdePairs
Definition: message.c:175
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:361
BOOL WINAPI PeekMessageWorker(PMSG pMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax, UINT wRemoveMsg)
Definition: message.c:2145
LRESULT WINAPI CallWindowProcA(WNDPROC lpPrevWndFunc, HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
Definition: message.c:1808
uint32_t DWORD_PTR
Definition: typedefs.h:65
#define BSM_VXDS
Definition: dbt.h:52
HWND hWnd
Definition: ntuser.h:272
#define LB_INSERTSTRING_UPPER
Definition: controls.h:86
LRESULT APIENTRY NtUserDispatchMessage(PMSG UnsafeMsgInfo)
Definition: message.c:2423
unsigned char BYTE
Definition: xxhash.c:193
#define WM_COPYGLOBALDATA
Definition: undocuser.h:36
#define WM_USER
Definition: winuser.h:1877
#define InterlockedExchange
Definition: armddk.h:54
NTSYSAPI DWORD WINAPI RtlUnicodeStringToAnsiSize(const UNICODE_STRING *)
DWORD FASTCALL get_input_codepage(void)
Definition: message.c:253
LRESULT CALLBACK WndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
Definition: solitaire.cpp:598
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2881
#define ERR(fmt,...)
Definition: debug.h:110
BOOL FASTCALL DdeAddPair(HGLOBAL ClientMem, HGLOBAL ServerMem)
Definition: message.c:181
#define GWL_STYLE
Definition: winuser.h:846
Definition: ntuser.h:657
EXTINLINE BOOL NtUserxReleaseCapture(VOID)
Definition: ntwrapper.h:566
void WINAPI ResetMessagePumpHook(PUSER_MESSAGE_PUMP_ADDRESSES Addresses)
Definition: message.c:3084
#define FNID_GHOST
Definition: ntuser.h:837
BOOL WINAPI PostThreadMessageA(DWORD idThread, UINT Msg, WPARAM wParam, LPARAM lParam)
Definition: message.c:2338
#define FNID_BROADCASTSYSTEMMESSAGE
Definition: ntuser.h:849
#define WM_COMPAREITEM
Definition: winuser.h:1637
#define LB_FINDSTRING
Definition: winuser.h:2016
_SEH2_END
Definition: create.c:4400
HKL hkl
Definition: msctf.idl:611
FORCEINLINE struct _TEB * NtCurrentTeb(VOID)
Definition: psfuncs.h:420
BOOL WINAPI DECLSPEC_HOTPATCH GetMessageA(LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax)
Definition: message.c:2092
LPVOID lpCreateParams
Definition: winuser.h:2915
#define EM_SETRECT
Definition: winuser.h:1998
BOOL APIENTRY NtUserValidateTimerCallback(LPARAM lParam)
Definition: timer.c:700
#define CB_DIR
Definition: winuser.h:1920
#define WM_DRAGMOVE
Definition: undocuser.h:58
#define LB_ADDSTRING_LOWER
Definition: controls.h:89
LRESULT WINAPI SendMessageW(HWND Wnd, UINT Msg, WPARAM wParam, LPARAM lParam)
Definition: message.c:2367
#define WM_SYSDEADCHAR
Definition: winuser.h:1704
#define MWMO_WAITALL
Definition: winuser.h:898
#define WM_SYSKEYUP
Definition: winuser.h:1702
#define HeapReAlloc
Definition: compat.h:482
Definition: window.h:371
#define ERROR_MESSAGE_SYNC_ONLY
Definition: winerror.h:681
signed char * PSTR
Definition: retypes.h:7
PKEYBOARD_LAYOUT GetKeyboardLayout()
Definition: utils.c:194
DWORD state
Definition: ntuser.h:665
WNDPROC_OWP PreWndProc
Definition: undocuser.h:339
LPARAM WINAPI SetMessageExtraInfo(LPARAM lParam)
Definition: message.c:1418
BOOL FASTCALL BeginIfHookedUserApiHook(VOID)
Definition: usrapihk.c:106
unsigned int UINT
Definition: ndis.h:50
NTSTATUS WINAPI User32CallWindowProcFromKernel(PVOID Arguments, ULONG ArgumentLength)
Definition: message.c:2927
BOOL NTAPI GlobalUnlock(HGLOBAL hMem)
Definition: heapmem.c:1190
#define QS_MOUSEBUTTON
Definition: winuser.h:885
BOOL NTAPI NtUserRealInternalGetMessage(LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax, UINT wRemoveMsg, BOOL bGMSG)
Definition: ntstubs.c:642
UAHOWP WndProcArray
Definition: undocuser.h:341
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
BOOL WINAPI TranslateMessage(CONST MSG *lpMsg)
Definition: message.c:2826
HWND hwnd
Definition: winuser.h:3089
struct _WND * pWnd
Definition: ntuser.h:273
DWORD gfMessagePumpHook
Definition: message.c:3076
#define WM_DEVICECHANGE
Definition: winuser.h:1793
#define LBS_OWNERDRAWVARIABLE
Definition: pedump.c:683
#define WM_MDICREATE
Definition: winuser.h:1794
LRESULT WINAPI SendMessageTimeoutA(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, UINT fuFlags, UINT uTimeout, PDWORD_PTR lpdwResult)
Definition: message.c:2606
#define WM_DRAWITEM
Definition: winuser.h:1627
#define WM_WINDOWPOSCHANGED
Definition: winuser.h:1644
EXTINLINE LPARAM NtUserxSetMessageExtraInfo(LPARAM lParam)
Definition: ntwrapper.h:601
#define msg(x)
Definition: auth_time.c:54
static BOOL(WINAPI *pCryptAcquireContextA)(HCRYPTPROV *
POINT cp
Definition: magnifier.c:59
struct tagCOPYDATASTRUCT COPYDATASTRUCT
#define BSM_ALLDESKTOPS
Definition: dbt.h:49
#define WM_CREATE
Definition: winuser.h:1590
ULONG_PTR Context
Definition: callback.h:49
#define WM_SYSKEYDOWN
Definition: winuser.h:1701
#define EM_GETRECT
Definition: winuser.h:1978
uint32_t * LPDWORD
Definition: typedefs.h:59
EXTINLINE HANDLE NtUserxMsqSetWakeMask(DWORD_PTR dwWaitMask)
Definition: ntwrapper.h:581
#define EM_GETLINE
Definition: winuser.h:1973
LPCWSTR lpszClass
Definition: winuser.h:2940
#define HIWORD(l)
Definition: typedefs.h:247
unsigned int ULONG
Definition: retypes.h:1
static CRITICAL_SECTION DdeCrst
Definition: message.c:178
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
EXTINLINE BOOL NtUserxReplyMessage(LRESULT lResult)
Definition: ntwrapper.h:656
PBSMINFO
Definition: dosdev.c:30
LONG bottom
Definition: windef.h:309
#define BSM_INSTALLABLEDRIVERS
Definition: dbt.h:50
#define IS_ATOM(x)
Definition: class.h:3
UINT WINAPI RegisterWindowMessageA(LPCSTR lpString)
Definition: message.c:2849
#define LB_GETITEMRECT
Definition: winuser.h:2025
struct tagRECT * PRECT
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:6
const char * PCSTR
Definition: typedefs.h:52
LONG WINAPI BroadcastSystemMessageExA(DWORD dwflags, LPDWORD lpdwRecipients, UINT uiMessage, WPARAM wParam, LPARAM lParam, PBSMINFO pBSMInfo)
Definition: message.c:3413
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
static BOOL FASTCALL MsgiUnicodeToAnsiReply(LPMSG AnsiMsg, LPMSG UnicodeMsg, LRESULT *Result)
Definition: message.c:1252
WCHAR * LPWSTR
Definition: xmlstorage.h:184
BOOL WINAPI DECLSPEC_HOTPATCH PeekMessageW(LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax, UINT wRemoveMsg)
Definition: message.c:2213
LONG_PTR LRESULT
Definition: windef.h:209
LRESULT WINAPI SendMessageTimeoutW(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, UINT fuFlags, UINT uTimeout, PDWORD_PTR lpdwResult)
Definition: message.c:2676
#define QS_KEY
Definition: winuser.h:883
IN BOOLEAN OUT PSTR Buffer
Definition: progress.h:34
#define CP_THREAD_ACP
Definition: winnls.h:230
BOOL WINAPI PostThreadMessageW(DWORD idThread, UINT Msg, WPARAM wParam, LPARAM lParam)
Definition: message.c:2353
VOID FASTCALL MessageCleanup(VOID)
Definition: message.c:3282
UINT message
Definition: winuser.h:3090
static __inline BOOL IsCallProcHandle(IN WNDPROC lpWndProc)
Definition: class.h:13
return STATUS_SUCCESS
Definition: btrfs.c:3014
Arabic default style
Definition: afstyles.h:93
USER_MESSAGE_PUMP_ADDRESSES gmph
Definition: message.c:3069
#define memset(x, y, z)
Definition: compat.h:39
signed int * PLONG
Definition: retypes.h:5
#define HWND_BROADCAST
Definition: winuser.h:1190
DWORD dwTIFlags
Definition: ntuser.h:292
#define WNDS_SERVERSIDEWINDOWPROC
Definition: ntuser.h:591
DWORD dwcPumpHook
Definition: ntuser.h:171
#define CB_FINDSTRING
Definition: winuser.h:1921
#define WM_DDE_EXECUTE
Definition: dde.h:45
BOOL APIENTRY NtUserPeekMessage(PMSG pMsg, HWND hWnd, UINT MsgFilterMin, UINT MsgFilterMax, UINT RemoveMsg)
Definition: message.c:2337
#define FNID_FIRST
Definition: ntuser.h:820
#define LB_INSERTSTRING
Definition: winuser.h:2035
LPARAM lParam
Definition: combotst.c:139
#define SMTO_BLOCK
Definition: winuser.h:1210
#define WM_GETMINMAXINFO
Definition: winuser.h:1622
static VOID FASTCALL MsgiKMToUMCleanup(PMSG KMMsg, PMSG UMMsg)
Definition: message.c:488
LRESULT WINAPI DECLSPEC_HOTPATCH DispatchMessageA(CONST MSG *lpmsg)
Definition: message.c:1901
#define LOWORD(l)
Definition: pedump.c:82
#define HeapFree(x, y, z)
Definition: compat.h:483
#define ERROR_INVALID_FLAGS
Definition: winerror.h:583
BOOL WINAPI IsDialogMessageW(_In_ HWND, _In_ LPMSG)
#define CONST
Definition: pedump.c:81
#define BSM_APPLICATIONS
Definition: dbt.h:48
#define FNID_SENDMESSAGEWTOOPTION
Definition: ntuser.h:847
LONG WINAPI BroadcastSystemMessageA(DWORD dwFlags, LPDWORD lpdwRecipients, UINT uiMessage, WPARAM wParam, LPARAM lParam)
Definition: message.c:3383
#define WAIT_FAILED
Definition: message.c:3052
static int is_pointer_message(UINT message, WPARAM wparam)
Definition: message.c:98
#define EM_REPLACESEL
Definition: winuser.h:1988
DWORD(WINAPI * RealGetQueueStatusProc)(UINT flags)
Definition: message.c:3042
static UINT WPARAM wparam
Definition: combo.c:716
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13
BOOL APIENTRY NtUserPostMessage(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
Definition: message.c:2225
EXTINLINE BOOL NtUserxInitMessagePump(VOID)
Definition: ntwrapper.h:571
LPCSTR lpszClass
Definition: winuser.h:2925
ULONG timeLastRead
Definition: ntuser.h:170
BOOL WINAPI ReplyMessage(LRESULT lResult)
Definition: message.c:1407
#define CB_FINDSTRINGEXACT
Definition: winuser.h:1922