ReactOS  0.4.13-dev-92-gf251225
threadmgr.c
Go to the documentation of this file.
1 /*
2  * ITfThreadMgr implementation
3  *
4  * Copyright 2008 Aric Stewart, CodeWeavers
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19  */
20 
21 #include "config.h"
22 
23 #include <stdarg.h>
24 
25 #define COBJMACROS
26 
27 #include "wine/debug.h"
28 #include "windef.h"
29 #include "winbase.h"
30 #include "winreg.h"
31 #include "winuser.h"
32 #include "shlwapi.h"
33 #include "winerror.h"
34 #include "objbase.h"
35 #include "olectl.h"
36 
37 #include "wine/unicode.h"
38 
39 #include "msctf.h"
40 #include "msctf_internal.h"
41 
43 
44 typedef struct tagPreservedKey
45 {
46  struct list entry;
51 } PreservedKey;
52 
53 typedef struct tagDocumentMgrs
54 {
55  struct list entry;
58 
59 typedef struct tagAssociatedWindow
60 {
61  struct list entry;
65 
66 typedef struct tagACLMulti {
72  /* const ITfThreadMgrExVtbl *ThreadMgrExVtbl; */
73  /* const ITfConfigureSystemKeystrokeFeedVtbl *ConfigureSystemKeystrokeFeedVtbl; */
74  /* const ITfLangBarItemMgrVtbl *LangBarItemMgrVtbl; */
78 
79  /* Aggregation */
81 
83 
86 
89 
92 
94  HHOOK focusHook;
95 
96  /* kept as separate lists to reduce unnecessary iterations */
103 } ThreadMgr;
104 
105 typedef struct tagEnumTfDocumentMgr {
108 
109  struct list *index;
110  struct list *head;
112 
114 
116 {
117  return CONTAINING_RECORD(iface, ThreadMgr, ITfThreadMgrEx_iface);
118 }
119 
121 {
122  return CONTAINING_RECORD(iface, ThreadMgr, ITfSource_iface);
123 }
124 
126 {
127  return CONTAINING_RECORD(iface, ThreadMgr, ITfKeystrokeMgr_iface);
128 }
129 
131 {
132  return CONTAINING_RECORD(iface, ThreadMgr, ITfMessagePump_iface);
133 }
134 
136 {
137  return CONTAINING_RECORD(iface, ThreadMgr, ITfClientId_iface);
138 }
139 
141 {
142  return CONTAINING_RECORD(iface, ThreadMgr, ITfThreadMgrEventSink_iface);
143 }
144 
146 {
147  return CONTAINING_RECORD(iface, ThreadMgr, ITfUIElementMgr_iface);
148 }
149 
151 {
152  return CONTAINING_RECORD(iface, ThreadMgr, ITfSourceSingle_iface);
153 }
154 
156 {
157  return CONTAINING_RECORD(iface, EnumTfDocumentMgr, IEnumTfDocumentMgrs_iface);
158 }
159 
161 {
162  struct list *cursor, *cursor2;
163 
164  /* unhook right away */
165  if (This->focusHook)
166  UnhookWindowsHookEx(This->focusHook);
167 
169  TRACE("destroying %p\n", This);
170  if (This->focus)
171  ITfDocumentMgr_Release(This->focus);
172 
173  free_sinks(&This->ActiveLanguageProfileNotifySink);
174  free_sinks(&This->DisplayAttributeNotifySink);
175  free_sinks(&This->KeyTraceEventSink);
176  free_sinks(&This->PreservedKeyNotifySink);
177  free_sinks(&This->ThreadFocusSink);
178  free_sinks(&This->ThreadMgrEventSink);
179 
180  LIST_FOR_EACH_SAFE(cursor, cursor2, &This->CurrentPreservedKeys)
181  {
184  HeapFree(GetProcessHeap(),0,key->description);
186  }
187 
188  LIST_FOR_EACH_SAFE(cursor, cursor2, &This->CreatedDocumentMgrs)
189  {
192  FIXME("Left Over ITfDocumentMgr. Should we do something with it?\n");
193  HeapFree(GetProcessHeap(),0,mgr);
194  }
195 
196  LIST_FOR_EACH_SAFE(cursor, cursor2, &This->AssociatedFocusWindows)
197  {
200  HeapFree(GetProcessHeap(),0,wnd);
201  }
202 
203  CompartmentMgr_Destructor(This->CompartmentMgr);
204 
206 }
207 
209 {
211  *ppvOut = NULL;
212 
213  if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_ITfThreadMgr)
214  || IsEqualIID(iid, &IID_ITfThreadMgrEx))
215  {
216  *ppvOut = &This->ITfThreadMgrEx_iface;
217  }
218  else if (IsEqualIID(iid, &IID_ITfSource))
219  {
220  *ppvOut = &This->ITfSource_iface;
221  }
222  else if (IsEqualIID(iid, &IID_ITfKeystrokeMgr))
223  {
224  *ppvOut = &This->ITfKeystrokeMgr_iface;
225  }
226  else if (IsEqualIID(iid, &IID_ITfMessagePump))
227  {
228  *ppvOut = &This->ITfMessagePump_iface;
229  }
230  else if (IsEqualIID(iid, &IID_ITfClientId))
231  {
232  *ppvOut = &This->ITfClientId_iface;
233  }
234  else if (IsEqualIID(iid, &IID_ITfCompartmentMgr))
235  {
236  *ppvOut = This->CompartmentMgr;
237  }
238  else if (IsEqualIID(iid, &IID_ITfUIElementMgr))
239  {
240  *ppvOut = &This->ITfUIElementMgr_iface;
241  }
242  else if (IsEqualIID(iid, &IID_ITfSourceSingle))
243  {
244  *ppvOut = &This->ITfSourceSingle_iface;
245  }
246 
247  if (*ppvOut)
248  {
249  ITfThreadMgrEx_AddRef(iface);
250  return S_OK;
251  }
252 
253  WARN("unsupported interface: %s\n", debugstr_guid(iid));
254  return E_NOINTERFACE;
255 }
256 
258 {
260  return InterlockedIncrement(&This->refCount);
261 }
262 
264 {
266  ULONG ret;
267 
268  ret = InterlockedDecrement(&This->refCount);
269  if (ret == 0)
271  return ret;
272 }
273 
274 /*****************************************************
275  * ITfThreadMgr functions
276  *****************************************************/
277 
279 {
281 
282  TRACE("(%p) %p\n", This, id);
283  return ITfThreadMgrEx_ActivateEx(iface, id, 0);
284 }
285 
287 {
289  TRACE("(%p)\n",This);
290 
291  if (This->activationCount == 0)
292  return E_UNEXPECTED;
293 
294  This->activationCount --;
295 
296  if (This->activationCount == 0)
297  {
298  if (This->focus)
299  {
300  ITfThreadMgrEventSink_OnSetFocus(&This->ITfThreadMgrEventSink_iface, 0, This->focus);
301  ITfDocumentMgr_Release(This->focus);
302  This->focus = 0;
303  }
304  }
305 
307 
308  return S_OK;
309 }
310 
312 {
314  DocumentMgrEntry *mgrentry;
315  HRESULT hr;
316 
317  TRACE("(%p)\n",iface);
318  mgrentry = HeapAlloc(GetProcessHeap(),0,sizeof(DocumentMgrEntry));
319  if (mgrentry == NULL)
320  return E_OUTOFMEMORY;
321 
322  hr = DocumentMgr_Constructor(&This->ITfThreadMgrEventSink_iface, ppdim);
323 
324  if (SUCCEEDED(hr))
325  {
326  mgrentry->docmgr = *ppdim;
327  list_add_head(&This->CreatedDocumentMgrs,&mgrentry->entry);
328  }
329  else
330  HeapFree(GetProcessHeap(),0,mgrentry);
331 
332  return hr;
333 }
334 
336 {
338  TRACE("(%p) %p\n",This,ppEnum);
339 
340  if (!ppEnum)
341  return E_INVALIDARG;
342 
343  return EnumTfDocumentMgr_Constructor(&This->CreatedDocumentMgrs, ppEnum);
344 }
345 
347 {
349  TRACE("(%p)\n",This);
350 
351  if (!ppdimFocus)
352  return E_INVALIDARG;
353 
354  *ppdimFocus = This->focus;
355 
356  TRACE("->%p\n",This->focus);
357 
358  if (This->focus == NULL)
359  return S_FALSE;
360 
361  ITfDocumentMgr_AddRef(This->focus);
362 
363  return S_OK;
364 }
365 
367 {
370 
371  TRACE("(%p) %p\n",This,pdimFocus);
372 
373  if (!pdimFocus)
374  check = NULL;
375  else if (FAILED(ITfDocumentMgr_QueryInterface(pdimFocus,&IID_ITfDocumentMgr,(LPVOID*) &check)))
376  return E_INVALIDARG;
377 
378  ITfThreadMgrEventSink_OnSetFocus(&This->ITfThreadMgrEventSink_iface, check, This->focus);
379 
380  if (This->focus)
381  ITfDocumentMgr_Release(This->focus);
382 
383  This->focus = check;
384  return S_OK;
385 }
386 
388 {
389  ThreadMgr *This;
390 
392  if (!This)
393  {
394  ERR("Hook proc but no ThreadMgr for this thread. Serious Error\n");
395  return 0;
396  }
397  if (!This->focusHook)
398  {
399  ERR("Hook proc but no ThreadMgr focus Hook. Serious Error\n");
400  return 0;
401  }
402 
403  if (nCode == HCBT_SETFOCUS) /* focus change within our thread */
404  {
405  struct list *cursor;
406 
407  LIST_FOR_EACH(cursor, &This->AssociatedFocusWindows)
408  {
410  if (wnd->hwnd == (HWND)wParam)
411  {
412  TRACE("Triggering Associated window focus\n");
413  if (This->focus != wnd->docmgr)
414  ThreadMgr_SetFocus(&This->ITfThreadMgrEx_iface, wnd->docmgr);
415  break;
416  }
417  }
418  }
419 
420  return CallNextHookEx(This->focusHook, nCode, wParam, lParam);
421 }
422 
424 {
425  if (!This->focusHook)
426  {
429  if (!This->focusHook)
430  {
431  ERR("Unable to set focus hook\n");
432  return E_FAIL;
433  }
434  return S_OK;
435  }
436  return S_FALSE;
437 }
438 
440 ITfDocumentMgr *pdimNew, ITfDocumentMgr **ppdimPrev)
441 {
443  struct list *cursor, *cursor2;
444  AssociatedWindow *wnd;
445 
446  TRACE("(%p) %p %p %p\n",This,hwnd,pdimNew,ppdimPrev);
447 
448  if (!ppdimPrev)
449  return E_INVALIDARG;
450 
451  *ppdimPrev = NULL;
452 
453  LIST_FOR_EACH_SAFE(cursor, cursor2, &This->AssociatedFocusWindows)
454  {
456  if (wnd->hwnd == hwnd)
457  {
458  if (wnd->docmgr)
459  ITfDocumentMgr_AddRef(wnd->docmgr);
460  *ppdimPrev = wnd->docmgr;
461  wnd->docmgr = pdimNew;
462  if (GetFocus() == hwnd)
463  ThreadMgr_SetFocus(iface,pdimNew);
464  return S_OK;
465  }
466  }
467 
468  wnd = HeapAlloc(GetProcessHeap(),0,sizeof(AssociatedWindow));
469  wnd->hwnd = hwnd;
470  wnd->docmgr = pdimNew;
471  list_add_head(&This->AssociatedFocusWindows,&wnd->entry);
472 
473  if (GetFocus() == hwnd)
474  ThreadMgr_SetFocus(iface,pdimNew);
475 
477 
478  return S_OK;
479 }
480 
482 {
484  HWND focus;
485 
486  TRACE("(%p) %p\n",This,pfThreadFocus);
487  focus = GetFocus();
488  *pfThreadFocus = (focus == NULL);
489  return S_OK;
490 }
491 
493 ITfFunctionProvider **ppFuncProv)
494 {
496  FIXME("STUB:(%p)\n",This);
497  return E_NOTIMPL;
498 }
499 
501 IEnumTfFunctionProviders **ppEnum)
502 {
504  FIXME("STUB:(%p)\n",This);
505  return E_NOTIMPL;
506 }
507 
509 ITfCompartmentMgr **ppCompMgr)
510 {
512  HRESULT hr;
513  TRACE("(%p) %p\n",This, ppCompMgr);
514 
515  if (!ppCompMgr)
516  return E_INVALIDARG;
517 
519  {
520  hr = CompartmentMgr_Constructor(NULL,&IID_ITfCompartmentMgr,(IUnknown**)&globalCompartmentMgr);
521  if (FAILED(hr))
522  return hr;
523  }
524 
525  ITfCompartmentMgr_AddRef(globalCompartmentMgr);
526  *ppCompMgr = globalCompartmentMgr;
527  return S_OK;
528 }
529 
531 {
533 
534  TRACE("(%p) %p, %#x\n", This, id, flags);
535 
536  if (!id)
537  return E_INVALIDARG;
538 
539  if (flags)
540  FIXME("Unimplemented flags %#x\n", flags);
541 
542  if (!processId)
543  {
544  GUID guid;
545  CoCreateGuid(&guid);
546  ITfClientId_GetClientId(&This->ITfClientId_iface, &guid, &processId);
547  }
548 
549  activate_textservices(iface);
550  This->activationCount++;
551  *id = processId;
552  return S_OK;
553 }
554 
556 {
558 
559  FIXME("STUB:(%p)\n", This);
560  return E_NOTIMPL;
561 }
562 
563 static const ITfThreadMgrExVtbl ThreadMgrExVtbl =
564 {
579 
582 };
583 
585 {
587  return ITfThreadMgrEx_QueryInterface(&This->ITfThreadMgrEx_iface, iid, ppvOut);
588 }
589 
591 {
593  return ITfThreadMgrEx_AddRef(&This->ITfThreadMgrEx_iface);
594 }
595 
597 {
599  return ITfThreadMgrEx_Release(&This->ITfThreadMgrEx_iface);
600 }
601 
602 /*****************************************************
603  * ITfSource functions
604  *****************************************************/
606  REFIID riid, IUnknown *punk, DWORD *pdwCookie)
607 {
609 
610  TRACE("(%p) %s %p %p\n",This,debugstr_guid(riid),punk,pdwCookie);
611 
612  if (!riid || !punk || !pdwCookie)
613  return E_INVALIDARG;
614 
615  if (IsEqualIID(riid, &IID_ITfThreadMgrEventSink))
616  return advise_sink(&This->ThreadMgrEventSink, &IID_ITfThreadMgrEventSink, COOKIE_MAGIC_TMSINK, punk, pdwCookie);
617 
618  if (IsEqualIID(riid, &IID_ITfThreadFocusSink))
619  {
620  WARN("semi-stub for ITfThreadFocusSink: sink won't be used.\n");
621  return advise_sink(&This->ThreadFocusSink, &IID_ITfThreadFocusSink, COOKIE_MAGIC_THREADFOCUSSINK, punk, pdwCookie);
622  }
623 
624  if (IsEqualIID(riid, &IID_ITfKeyTraceEventSink))
625  {
626  WARN("semi-stub for ITfKeyTraceEventSink: sink won't be used.\n");
627  return advise_sink(&This->KeyTraceEventSink, &IID_ITfKeyTraceEventSink,
628  COOKIE_MAGIC_KEYTRACESINK, punk, pdwCookie);
629  }
630 
631  FIXME("(%p) Unhandled Sink: %s\n",This,debugstr_guid(riid));
632  return E_NOTIMPL;
633 }
634 
636 {
638  DWORD magic;
639 
640  TRACE("(%p) %x\n",This,pdwCookie);
641 
642  magic = get_Cookie_magic(pdwCookie);
645  return E_INVALIDARG;
646 
647  return unadvise_sink(pdwCookie);
648 }
649 
650 static const ITfSourceVtbl ThreadMgrSourceVtbl =
651 {
657 };
658 
659 /*****************************************************
660  * ITfKeystrokeMgr functions
661  *****************************************************/
662 
664 {
666  return ITfThreadMgrEx_QueryInterface(&This->ITfThreadMgrEx_iface, iid, ppvOut);
667 }
668 
670 {
672  return ITfThreadMgrEx_AddRef(&This->ITfThreadMgrEx_iface);
673 }
674 
676 {
678  return ITfThreadMgrEx_Release(&This->ITfThreadMgrEx_iface);
679 }
680 
682  TfClientId tid, ITfKeyEventSink *pSink, BOOL fForeground)
683 {
685  CLSID textservice;
687 
688  TRACE("(%p) %x %p %i\n",This,tid,pSink,fForeground);
689 
690  if (!tid || !pSink)
691  return E_INVALIDARG;
692 
693  textservice = get_textservice_clsid(tid);
694  if (IsEqualCLSID(&GUID_NULL,&textservice))
695  return E_INVALIDARG;
696 
697  get_textservice_sink(tid, &IID_ITfKeyEventSink, (IUnknown**)&check);
698  if (check != NULL)
699  return CONNECT_E_ADVISELIMIT;
700 
701  if (FAILED(ITfKeyEventSink_QueryInterface(pSink,&IID_ITfKeyEventSink,(LPVOID*) &check)))
702  return E_INVALIDARG;
703 
704  set_textservice_sink(tid, &IID_ITfKeyEventSink, (IUnknown*)check);
705 
706  if (fForeground)
707  {
708  if (This->foregroundKeyEventSink)
709  {
710  ITfKeyEventSink_OnSetFocus(This->foregroundKeyEventSink, FALSE);
711  ITfKeyEventSink_Release(This->foregroundKeyEventSink);
712  }
713  ITfKeyEventSink_AddRef(check);
714  ITfKeyEventSink_OnSetFocus(check, TRUE);
715  This->foregroundKeyEventSink = check;
716  This->foregroundTextService = textservice;
717  }
718  return S_OK;
719 }
720 
722  TfClientId tid)
723 {
725  CLSID textservice;
727  TRACE("(%p) %x\n",This,tid);
728 
729  if (!tid)
730  return E_INVALIDARG;
731 
732  textservice = get_textservice_clsid(tid);
733  if (IsEqualCLSID(&GUID_NULL,&textservice))
734  return E_INVALIDARG;
735 
736  get_textservice_sink(tid, &IID_ITfKeyEventSink, (IUnknown**)&check);
737 
738  if (!check)
739  return CONNECT_E_NOCONNECTION;
740 
741  set_textservice_sink(tid, &IID_ITfKeyEventSink, NULL);
742  ITfKeyEventSink_Release(check);
743 
744  if (This->foregroundKeyEventSink == check)
745  {
746  ITfKeyEventSink_Release(This->foregroundKeyEventSink);
747  This->foregroundKeyEventSink = NULL;
748  This->foregroundTextService = GUID_NULL;
749  }
750  return S_OK;
751 }
752 
754  CLSID *pclsid)
755 {
757  TRACE("(%p) %p\n",This,pclsid);
758  if (!pclsid)
759  return E_INVALIDARG;
760 
761  if (IsEqualCLSID(&This->foregroundTextService,&GUID_NULL))
762  return S_FALSE;
763 
764  *pclsid = This->foregroundTextService;
765  return S_OK;
766 }
767 
769  WPARAM wParam, LPARAM lParam, BOOL *pfEaten)
770 {
772  FIXME("STUB:(%p)\n",This);
773  *pfEaten = FALSE;
774  return S_OK;
775 }
776 
778  WPARAM wParam, LPARAM lParam, BOOL *pfEaten)
779 {
781  FIXME("STUB:(%p)\n",This);
782  *pfEaten = FALSE;
783  return S_OK;
784 }
785 
787  WPARAM wParam, LPARAM lParam, BOOL *pfEaten)
788 {
790  FIXME("STUB:(%p)\n",This);
791  return E_NOTIMPL;
792 }
793 
795  WPARAM wParam, LPARAM lParam, BOOL *pfEaten)
796 {
798  FIXME("STUB:(%p)\n",This);
799  return E_NOTIMPL;
800 }
801 
803  ITfContext *pic, const TF_PRESERVEDKEY *pprekey, GUID *pguid)
804 {
806  FIXME("STUB:(%p)\n",This);
807  return E_NOTIMPL;
808 }
809 
811  REFGUID rguid, const TF_PRESERVEDKEY *pprekey, BOOL *pfRegistered)
812 {
814  struct list *cursor;
815 
816  TRACE("(%p) %s (%x %x) %p\n",This,debugstr_guid(rguid), (pprekey)?pprekey->uVKey:0, (pprekey)?pprekey->uModifiers:0, pfRegistered);
817 
818  if (!rguid || !pprekey || !pfRegistered)
819  return E_INVALIDARG;
820 
821  LIST_FOR_EACH(cursor, &This->CurrentPreservedKeys)
822  {
824  if (IsEqualGUID(rguid,&key->guid) && pprekey->uVKey == key->prekey.uVKey && pprekey->uModifiers == key->prekey.uModifiers)
825  {
826  *pfRegistered = TRUE;
827  return S_OK;
828  }
829  }
830 
831  *pfRegistered = FALSE;
832  return S_FALSE;
833 }
834 
836  TfClientId tid, REFGUID rguid, const TF_PRESERVEDKEY *prekey,
837  const WCHAR *pchDesc, ULONG cchDesc)
838 {
840  struct list *cursor;
841  PreservedKey *newkey;
842 
843  TRACE("(%p) %x %s (%x,%x) %s\n",This,tid, debugstr_guid(rguid),(prekey)?prekey->uVKey:0,(prekey)?prekey->uModifiers:0,debugstr_wn(pchDesc,cchDesc));
844 
845  if (!tid || ! rguid || !prekey || (cchDesc && !pchDesc))
846  return E_INVALIDARG;
847 
848  LIST_FOR_EACH(cursor, &This->CurrentPreservedKeys)
849  {
851  if (IsEqualGUID(rguid,&key->guid) && prekey->uVKey == key->prekey.uVKey && prekey->uModifiers == key->prekey.uModifiers)
852  return TF_E_ALREADY_EXISTS;
853  }
854 
855  newkey = HeapAlloc(GetProcessHeap(),0,sizeof(PreservedKey));
856  if (!newkey)
857  return E_OUTOFMEMORY;
858 
859  newkey->guid = *rguid;
860  newkey->prekey = *prekey;
861  newkey->tid = tid;
862  newkey->description = NULL;
863  if (cchDesc)
864  {
865  newkey->description = HeapAlloc(GetProcessHeap(),0,cchDesc * sizeof(WCHAR));
866  if (!newkey->description)
867  {
868  HeapFree(GetProcessHeap(),0,newkey);
869  return E_OUTOFMEMORY;
870  }
871  memcpy(newkey->description, pchDesc, cchDesc*sizeof(WCHAR));
872  }
873 
874  list_add_head(&This->CurrentPreservedKeys,&newkey->entry);
875 
876  return S_OK;
877 }
878 
880  REFGUID rguid, const TF_PRESERVEDKEY *pprekey)
881 {
883  PreservedKey* key = NULL;
884  struct list *cursor;
885  TRACE("(%p) %s (%x %x)\n",This,debugstr_guid(rguid),(pprekey)?pprekey->uVKey:0, (pprekey)?pprekey->uModifiers:0);
886 
887  if (!pprekey || !rguid)
888  return E_INVALIDARG;
889 
890  LIST_FOR_EACH(cursor, &This->CurrentPreservedKeys)
891  {
893  if (IsEqualGUID(rguid,&key->guid) && pprekey->uVKey == key->prekey.uVKey && pprekey->uModifiers == key->prekey.uModifiers)
894  break;
895  key = NULL;
896  }
897 
898  if (!key)
899  return CONNECT_E_NOCONNECTION;
900 
901  list_remove(&key->entry);
902  HeapFree(GetProcessHeap(),0,key->description);
904 
905  return S_OK;
906 }
907 
909  REFGUID rguid, const WCHAR *pchDesc, ULONG cchDesc)
910 {
912  FIXME("STUB:(%p)\n",This);
913  return E_NOTIMPL;
914 }
915 
917  REFGUID rguid, BSTR *pbstrDesc)
918 {
920  FIXME("STUB:(%p)\n",This);
921  return E_NOTIMPL;
922 }
923 
925  ITfContext *pic, REFGUID rguid, BOOL *pfEaten)
926 {
928  FIXME("STUB:(%p)\n",This);
929  return E_NOTIMPL;
930 }
931 
932 static const ITfKeystrokeMgrVtbl KeystrokeMgrVtbl =
933 {
951 };
952 
953 /*****************************************************
954  * ITfMessagePump functions
955  *****************************************************/
956 
958 {
960  return ITfThreadMgrEx_QueryInterface(&This->ITfThreadMgrEx_iface, iid, ppvOut);
961 }
962 
964 {
966  return ITfThreadMgrEx_AddRef(&This->ITfThreadMgrEx_iface);
967 }
968 
970 {
972  return ITfThreadMgrEx_Release(&This->ITfThreadMgrEx_iface);
973 }
974 
976  LPMSG pMsg, HWND hwnd, UINT wMsgFilterMin, UINT wMsgFilterMax,
977  UINT wRemoveMsg, BOOL *pfResult)
978 {
979  if (!pfResult)
980  return E_INVALIDARG;
981  *pfResult = PeekMessageA(pMsg, hwnd, wMsgFilterMin, wMsgFilterMax, wRemoveMsg);
982  return S_OK;
983 }
984 
986  LPMSG pMsg, HWND hwnd, UINT wMsgFilterMin, UINT wMsgFilterMax,
987  BOOL *pfResult)
988 {
989  if (!pfResult)
990  return E_INVALIDARG;
991  *pfResult = GetMessageA(pMsg, hwnd, wMsgFilterMin, wMsgFilterMax);
992  return S_OK;
993 }
994 
996  LPMSG pMsg, HWND hwnd, UINT wMsgFilterMin, UINT wMsgFilterMax,
997  UINT wRemoveMsg, BOOL *pfResult)
998 {
999  if (!pfResult)
1000  return E_INVALIDARG;
1001  *pfResult = PeekMessageW(pMsg, hwnd, wMsgFilterMin, wMsgFilterMax, wRemoveMsg);
1002  return S_OK;
1003 }
1004 
1006  LPMSG pMsg, HWND hwnd, UINT wMsgFilterMin, UINT wMsgFilterMax,
1007  BOOL *pfResult)
1008 {
1009  if (!pfResult)
1010  return E_INVALIDARG;
1011  *pfResult = GetMessageW(pMsg, hwnd, wMsgFilterMin, wMsgFilterMax);
1012  return S_OK;
1013 }
1014 
1015 static const ITfMessagePumpVtbl MessagePumpVtbl =
1016 {
1024 };
1025 
1026 /*****************************************************
1027  * ITfClientId functions
1028  *****************************************************/
1029 
1031 {
1033  return ITfThreadMgrEx_QueryInterface(&This->ITfThreadMgrEx_iface, iid, ppvOut);
1034 }
1035 
1037 {
1039  return ITfThreadMgrEx_AddRef(&This->ITfThreadMgrEx_iface);
1040 }
1041 
1043 {
1045  return ITfThreadMgrEx_Release(&This->ITfThreadMgrEx_iface);
1046 }
1047 
1049  REFCLSID rclsid, TfClientId *ptid)
1050 
1051 {
1053  HRESULT hr;
1054  ITfCategoryMgr *catmgr;
1055 
1056  TRACE("(%p) %s\n",This,debugstr_guid(rclsid));
1057 
1059  hr = ITfCategoryMgr_RegisterGUID(catmgr,rclsid,ptid);
1060  ITfCategoryMgr_Release(catmgr);
1061 
1062  return hr;
1063 }
1064 
1065 static const ITfClientIdVtbl ClientIdVtbl =
1066 {
1071 };
1072 
1073 /*****************************************************
1074  * ITfThreadMgrEventSink functions (internal)
1075  *****************************************************/
1077 {
1079  return ITfThreadMgrEx_QueryInterface(&This->ITfThreadMgrEx_iface, iid, ppvOut);
1080 }
1081 
1083 {
1085  return ITfThreadMgrEx_AddRef(&This->ITfThreadMgrEx_iface);
1086 }
1087 
1089 {
1091  return ITfThreadMgrEx_Release(&This->ITfThreadMgrEx_iface);
1092 }
1093 
1094 
1097 {
1100  struct list *cursor;
1101 
1102  TRACE("(%p) %p\n",This,pdim);
1103 
1104  SINK_FOR_EACH(cursor, &This->ThreadMgrEventSink, ITfThreadMgrEventSink, sink)
1105  {
1106  ITfThreadMgrEventSink_OnInitDocumentMgr(sink, pdim);
1107  }
1108 
1109  return S_OK;
1110 }
1111 
1113  ITfThreadMgrEventSink *iface, ITfDocumentMgr *pdim)
1114 {
1117  struct list *cursor;
1118 
1119  TRACE("(%p) %p\n",This,pdim);
1120 
1121  SINK_FOR_EACH(cursor, &This->ThreadMgrEventSink, ITfThreadMgrEventSink, sink)
1122  {
1123  ITfThreadMgrEventSink_OnUninitDocumentMgr(sink, pdim);
1124  }
1125 
1126  return S_OK;
1127 }
1128 
1130  ITfThreadMgrEventSink *iface, ITfDocumentMgr *pdimFocus,
1131  ITfDocumentMgr *pdimPrevFocus)
1132 {
1135  struct list *cursor;
1136 
1137  TRACE("(%p) %p %p\n",This,pdimFocus, pdimPrevFocus);
1138 
1139  SINK_FOR_EACH(cursor, &This->ThreadMgrEventSink, ITfThreadMgrEventSink, sink)
1140  {
1141  ITfThreadMgrEventSink_OnSetFocus(sink, pdimFocus, pdimPrevFocus);
1142  }
1143 
1144  return S_OK;
1145 }
1146 
1148  ITfThreadMgrEventSink *iface, ITfContext *pic)
1149 {
1152  struct list *cursor;
1153 
1154  TRACE("(%p) %p\n",This,pic);
1155 
1156  SINK_FOR_EACH(cursor, &This->ThreadMgrEventSink, ITfThreadMgrEventSink, sink)
1157  {
1158  ITfThreadMgrEventSink_OnPushContext(sink, pic);
1159  }
1160 
1161  return S_OK;
1162 }
1163 
1165  ITfThreadMgrEventSink *iface, ITfContext *pic)
1166 {
1169  struct list *cursor;
1170 
1171  TRACE("(%p) %p\n",This,pic);
1172 
1173  SINK_FOR_EACH(cursor, &This->ThreadMgrEventSink, ITfThreadMgrEventSink, sink)
1174  {
1175  ITfThreadMgrEventSink_OnPopContext(sink, pic);
1176  }
1177 
1178  return S_OK;
1179 }
1180 
1181 static const ITfThreadMgrEventSinkVtbl ThreadMgrEventSinkVtbl =
1182 {
1191 };
1192 
1193 /*****************************************************
1194  * ITfUIElementMgr functions
1195  *****************************************************/
1197 {
1199 
1200  return ITfThreadMgrEx_QueryInterface(&This->ITfThreadMgrEx_iface, iid, ppvOut);
1201 }
1202 
1204 {
1206 
1207  return ITfThreadMgrEx_AddRef(&This->ITfThreadMgrEx_iface);
1208 }
1209 
1211 {
1213 
1214  return ITfThreadMgrEx_Release(&This->ITfThreadMgrEx_iface);
1215 }
1216 
1218  BOOL *show, DWORD *id)
1219 {
1221 
1222  FIXME("STUB:(%p)\n", This);
1223  return E_NOTIMPL;
1224 }
1225 
1227 {
1229 
1230  FIXME("STUB:(%p)\n", This);
1231  return E_NOTIMPL;
1232 }
1233 
1235 {
1237 
1238  FIXME("STUB:(%p)\n", This);
1239  return E_NOTIMPL;
1240 }
1241 
1244 {
1246 
1247  FIXME("STUB:(%p)\n", This);
1248  return E_NOTIMPL;
1249 }
1250 
1252  IEnumTfUIElements **enum_elements)
1253 {
1255 
1256  FIXME("STUB:(%p)\n", This);
1257  return E_NOTIMPL;
1258 }
1259 
1260 static const ITfUIElementMgrVtbl ThreadMgrUIElementMgrVtbl =
1261 {
1265 
1271 };
1272 
1273 /*****************************************************
1274  * ITfSourceSingle functions
1275  *****************************************************/
1277 {
1279  return ITfThreadMgrEx_QueryInterface(&This->ITfThreadMgrEx_iface, iid, ppvOut);
1280 }
1281 
1283 {
1285  return ITfThreadMgrEx_AddRef(&This->ITfThreadMgrEx_iface);
1286 }
1287 
1289 {
1291  return ITfThreadMgrEx_Release(&This->ITfThreadMgrEx_iface);
1292 }
1293 
1295  TfClientId tid, REFIID riid, IUnknown *punk)
1296 {
1298  FIXME("STUB:(%p) %i %s %p\n",This, tid, debugstr_guid(riid),punk);
1299  return E_NOTIMPL;
1300 }
1301 
1304 {
1306  FIXME("STUB:(%p) %i %s\n",This, tid, debugstr_guid(riid));
1307  return E_NOTIMPL;
1308 }
1309 
1310 static const ITfSourceSingleVtbl SourceSingleVtbl =
1311 {
1317 };
1318 
1320 {
1321  ThreadMgr *This;
1322  if (pUnkOuter)
1323  return CLASS_E_NOAGGREGATION;
1324 
1325  /* Only 1 ThreadMgr is created per thread */
1327  if (This)
1328  {
1329  ThreadMgr_AddRef(&This->ITfThreadMgrEx_iface);
1330  *ppOut = (IUnknown*)&This->ITfThreadMgrEx_iface;
1331  return S_OK;
1332  }
1333 
1335  if (This == NULL)
1336  return E_OUTOFMEMORY;
1337 
1338  This->ITfThreadMgrEx_iface.lpVtbl = &ThreadMgrExVtbl;
1339  This->ITfSource_iface.lpVtbl = &ThreadMgrSourceVtbl;
1340  This->ITfKeystrokeMgr_iface.lpVtbl = &KeystrokeMgrVtbl;
1341  This->ITfMessagePump_iface.lpVtbl = &MessagePumpVtbl;
1342  This->ITfClientId_iface.lpVtbl = &ClientIdVtbl;
1343  This->ITfThreadMgrEventSink_iface.lpVtbl = &ThreadMgrEventSinkVtbl;
1344  This->ITfUIElementMgr_iface.lpVtbl = &ThreadMgrUIElementMgrVtbl;
1345  This->ITfSourceSingle_iface.lpVtbl = &SourceSingleVtbl;
1346  This->refCount = 1;
1348 
1349  CompartmentMgr_Constructor((IUnknown*)&This->ITfThreadMgrEx_iface, &IID_IUnknown, (IUnknown**)&This->CompartmentMgr);
1350 
1351  list_init(&This->CurrentPreservedKeys);
1352  list_init(&This->CreatedDocumentMgrs);
1353  list_init(&This->AssociatedFocusWindows);
1354 
1355  list_init(&This->ActiveLanguageProfileNotifySink);
1356  list_init(&This->DisplayAttributeNotifySink);
1357  list_init(&This->KeyTraceEventSink);
1358  list_init(&This->PreservedKeyNotifySink);
1359  list_init(&This->ThreadFocusSink);
1360  list_init(&This->ThreadMgrEventSink);
1361 
1362  TRACE("returning %p\n", This);
1363  *ppOut = (IUnknown *)&This->ITfThreadMgrEx_iface;
1364  return S_OK;
1365 }
1366 
1367 /**************************************************
1368  * IEnumTfDocumentMgrs implementation
1369  **************************************************/
1371 {
1372  TRACE("destroying %p\n", This);
1374 }
1375 
1377 {
1379  *ppvOut = NULL;
1380 
1381  if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_IEnumTfDocumentMgrs))
1382  {
1383  *ppvOut = &This->IEnumTfDocumentMgrs_iface;
1384  }
1385 
1386  if (*ppvOut)
1387  {
1388  IEnumTfDocumentMgrs_AddRef(iface);
1389  return S_OK;
1390  }
1391 
1392  WARN("unsupported interface: %s\n", debugstr_guid(iid));
1393  return E_NOINTERFACE;
1394 }
1395 
1397 {
1399  return InterlockedIncrement(&This->refCount);
1400 }
1401 
1403 {
1405  ULONG ret;
1406 
1407  ret = InterlockedDecrement(&This->refCount);
1408  if (ret == 0)
1410  return ret;
1411 }
1412 
1414  ULONG ulCount, ITfDocumentMgr **rgDocumentMgr, ULONG *pcFetched)
1415 {
1417  ULONG fetched = 0;
1418 
1419  TRACE("(%p)\n",This);
1420 
1421  if (rgDocumentMgr == NULL) return E_POINTER;
1422 
1423  while (fetched < ulCount)
1424  {
1425  DocumentMgrEntry *mgrentry;
1426  if (This->index == NULL)
1427  break;
1428 
1429  mgrentry = LIST_ENTRY(This->index,DocumentMgrEntry,entry);
1430  if (mgrentry == NULL)
1431  break;
1432 
1433  *rgDocumentMgr = mgrentry->docmgr;
1434  ITfDocumentMgr_AddRef(*rgDocumentMgr);
1435 
1436  This->index = list_next(This->head, This->index);
1437  ++fetched;
1438  ++rgDocumentMgr;
1439  }
1440 
1441  if (pcFetched) *pcFetched = fetched;
1442  return fetched == ulCount ? S_OK : S_FALSE;
1443 }
1444 
1446 {
1448  ULONG i;
1449 
1450  TRACE("(%p)\n",This);
1451  for(i = 0; i < celt && This->index != NULL; i++)
1452  This->index = list_next(This->head, This->index);
1453  return S_OK;
1454 }
1455 
1457 {
1459  TRACE("(%p)\n",This);
1460  This->index = list_head(This->head);
1461  return S_OK;
1462 }
1463 
1465  IEnumTfDocumentMgrs **ppenum)
1466 {
1468  HRESULT res;
1469 
1470  TRACE("(%p)\n",This);
1471 
1472  if (ppenum == NULL) return E_POINTER;
1473 
1474  res = EnumTfDocumentMgr_Constructor(This->head, ppenum);
1475  if (SUCCEEDED(res))
1476  {
1477  EnumTfDocumentMgr *new_This = impl_from_IEnumTfDocumentMgrs(*ppenum);
1478  new_This->index = This->index;
1479  }
1480  return res;
1481 }
1482 
1483 static const IEnumTfDocumentMgrsVtbl EnumTfDocumentMgrsVtbl =
1484 {
1492 };
1493 
1495 {
1497 
1499  if (This == NULL)
1500  return E_OUTOFMEMORY;
1501 
1502  This->IEnumTfDocumentMgrs_iface.lpVtbl= &EnumTfDocumentMgrsVtbl;
1503  This->refCount = 1;
1504  This->head = head;
1505  This->index = list_head(This->head);
1506 
1507  TRACE("returning %p\n", &This->IEnumTfDocumentMgrs_iface);
1508  *ppOut = &This->IEnumTfDocumentMgrs_iface;
1509  return S_OK;
1510 }
1511 
1513 {
1515  struct list *cursor;
1516  LIST_FOR_EACH(cursor, &This->CreatedDocumentMgrs)
1517  {
1519  if (mgrentry->docmgr == mgr)
1520  {
1522  HeapFree(GetProcessHeap(),0,mgrentry);
1523  return;
1524  }
1525  }
1526  FIXME("ITfDocumentMgr %p not found in this thread\n",mgr);
1527 }
static HRESULT WINAPI KeystrokeMgr_GetPreservedKey(ITfKeystrokeMgr *iface, ITfContext *pic, const TF_PRESERVEDKEY *pprekey, GUID *pguid)
Definition: threadmgr.c:802
static HRESULT WINAPI ThreadMgr_IsThreadFocus(ITfThreadMgrEx *iface, BOOL *pfThreadFocus)
Definition: threadmgr.c:481
TF_PRESERVEDKEY prekey
Definition: threadmgr.c:48
ITfSource ITfSource_iface
Definition: threadmgr.c:68
static ULONG WINAPI ThreadMgr_Release(ITfThreadMgrEx *iface)
Definition: threadmgr.c:263
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
struct list DisplayAttributeNotifySink
Definition: threadmgr.c:98
#define LIST_FOR_EACH_SAFE(cursor, cursor2, list)
Definition: list.h:192
#define REFIID
Definition: guiddef.h:113
#define TRUE
Definition: types.h:120
static ULONG WINAPI MessagePump_AddRef(ITfMessagePump *iface)
Definition: threadmgr.c:963
#define E_NOINTERFACE
Definition: winerror.h:2364
static HRESULT WINAPI UIElementMgr_BeginUIElement(ITfUIElementMgr *iface, ITfUIElement *element, BOOL *show, DWORD *id)
Definition: threadmgr.c:1217
static HRESULT WINAPI ClientId_GetClientId(ITfClientId *iface, REFCLSID rclsid, TfClientId *ptid)
Definition: threadmgr.c:1048
static HRESULT WINAPI ThreadMgr_AssociateFocus(ITfThreadMgrEx *iface, HWND hwnd, ITfDocumentMgr *pdimNew, ITfDocumentMgr **ppdimPrev)
Definition: threadmgr.c:439
static HRESULT WINAPI ThreadMgr_SetFocus(ITfThreadMgrEx *iface, ITfDocumentMgr *pdimFocus)
Definition: threadmgr.c:366
static HRESULT WINAPI ThreadMgr_EnumDocumentMgrs(ITfThreadMgrEx *iface, IEnumTfDocumentMgrs **ppEnum)
Definition: threadmgr.c:335
ITfClientId ITfClientId_iface
Definition: threadmgr.c:71
static const IEnumTfDocumentMgrsVtbl EnumTfDocumentMgrsVtbl
Definition: threadmgr.c:1483
HRESULT hr
Definition: shlfolder.c:183
static ULONG WINAPI ThreadMgrSourceSingle_AddRef(ITfSourceSingle *iface)
Definition: threadmgr.c:1282
Definition: scsiwmi.h:51
struct list CreatedDocumentMgrs
Definition: threadmgr.c:91
static HRESULT WINAPI ThreadMgrEventSink_OnPopContext(ITfThreadMgrEventSink *iface, ITfContext *pic)
Definition: threadmgr.c:1164
#define CONNECT_E_ADVISELIMIT
Definition: olectl.h:252
static HRESULT WINAPI MessagePump_PeekMessageA(ITfMessagePump *iface, LPMSG pMsg, HWND hwnd, UINT wMsgFilterMin, UINT wMsgFilterMax, UINT wRemoveMsg, BOOL *pfResult)
Definition: threadmgr.c:975
struct outqueuenode * head
Definition: adnsresfilter.c:66
BOOL WINAPI TlsSetValue(IN DWORD Index, IN LPVOID Value)
Definition: thread.c:1199
TfClientId processId
Definition: msctf.c:75
REFIID riid
Definition: precomp.h:44
static HRESULT WINAPI KeystrokeMgr_IsPreservedKey(ITfKeystrokeMgr *iface, REFGUID rguid, const TF_PRESERVEDKEY *pprekey, BOOL *pfRegistered)
Definition: threadmgr.c:810
static HRESULT WINAPI ThreadMgr_Activate(ITfThreadMgrEx *iface, TfClientId *id)
Definition: threadmgr.c:278
static void EnumTfDocumentMgr_Destructor(EnumTfDocumentMgr *This)
Definition: threadmgr.c:1370
HRESULT activate_textservices(ITfThreadMgrEx *tm)
Definition: msctf.c:477
#define REFCLSID
Definition: guiddef.h:112
static const ITfKeystrokeMgrVtbl KeystrokeMgrVtbl
Definition: threadmgr.c:932
void free_sinks(struct list *sink_list)
Definition: msctf.c:326
uint8_t entry
Definition: isohybrid.c:63
#define WARN(fmt,...)
Definition: debug.h:111
#define CONNECT_E_NOCONNECTION
Definition: olectl.h:251
static ULONG WINAPI ThreadMgrEventSink_Release(ITfThreadMgrEventSink *iface)
Definition: threadmgr.c:1088
static HRESULT WINAPI ThreadMgr_GetActiveFlags(ITfThreadMgrEx *iface, DWORD *flags)
Definition: threadmgr.c:555
#define CALLBACK
Definition: compat.h:27
#define SINK_FOR_EACH(cursor, list, type, elem)
__WINE_SERVER_LIST_INLINE void list_add_head(struct list *list, struct list *elem)
Definition: list.h:96
HRESULT advise_sink(struct list *sink_list, REFIID riid, DWORD cookie_magic, IUnknown *unk, DWORD *cookie)
Definition: msctf.c:287
ITfThreadMgrEx ITfThreadMgrEx_iface
Definition: threadmgr.c:67
struct list KeyTraceEventSink
Definition: threadmgr.c:99
BOOL WINAPI GetMessageA(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT)
u32_t magic(void)
struct list CurrentPreservedKeys
Definition: threadmgr.c:90
static HRESULT WINAPI MessagePump_PeekMessageW(ITfMessagePump *iface, LPMSG pMsg, HWND hwnd, UINT wMsgFilterMin, UINT wMsgFilterMax, UINT wRemoveMsg, BOOL *pfResult)
Definition: threadmgr.c:995
static ULONG WINAPI UIElementMgr_Release(ITfUIElementMgr *iface)
Definition: threadmgr.c:1210
UINT_PTR WPARAM
Definition: windef.h:207
OLECHAR * BSTR
Definition: compat.h:1934
#define HCBT_SETFOCUS
Definition: winuser.h:64
ITfDocumentMgr * focus
Definition: threadmgr.c:84
DWORD get_Cookie_magic(DWORD id)
Definition: msctf.c:235
BOOL WINAPI PeekMessageA(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT, _In_ UINT)
static ThreadMgr * impl_from_ITfThreadMgrEventSink(ITfThreadMgrEventSink *iface)
Definition: threadmgr.c:140
#define E_FAIL
Definition: ddrawi.h:102
static HRESULT WINAPI ThreadMgrEventSink_OnInitDocumentMgr(ITfThreadMgrEventSink *iface, ITfDocumentMgr *pdim)
Definition: threadmgr.c:1095
HRESULT deactivate_textservices(void)
Definition: msctf.c:495
WPARAM wParam
Definition: combotst.c:138
GLsizei GLenum GLboolean sink
Definition: glext.h:5672
static HRESULT WINAPI ThreadMgr_ActivateEx(ITfThreadMgrEx *iface, TfClientId *id, DWORD flags)
Definition: threadmgr.c:530
static HRESULT WINAPI Source_QueryInterface(ITfSource *iface, REFIID iid, LPVOID *ppvOut)
Definition: threadmgr.c:584
static HRESULT WINAPI KeystrokeMgr_KeyDown(ITfKeystrokeMgr *iface, WPARAM wParam, LPARAM lParam, BOOL *pfEaten)
Definition: threadmgr.c:786
DWORD tlsIndex
Definition: msctf.c:74
struct tagAssociatedWindow AssociatedWindow
__WINE_SERVER_LIST_INLINE struct list * list_head(const struct list *list)
Definition: list.h:131
LPWSTR description
Definition: threadmgr.c:49
#define COOKIE_MAGIC_TMSINK
static HRESULT WINAPI UIElementMgr_EnumUIElements(ITfUIElementMgr *iface, IEnumTfUIElements **enum_elements)
Definition: threadmgr.c:1251
CLSID get_textservice_clsid(TfClientId tid)
Definition: msctf.c:509
static EnumTfDocumentMgr * impl_from_IEnumTfDocumentMgrs(IEnumTfDocumentMgrs *iface)
Definition: threadmgr.c:155
UINT uModifiers
Definition: msctf.idl:129
static ThreadMgr * impl_from_ITfSource(ITfSource *iface)
Definition: threadmgr.c:120
ITfSourceSingle ITfSourceSingle_iface
Definition: threadmgr.c:76
ITfCompartmentMgr * globalCompartmentMgr
Definition: msctf.c:76
static HRESULT WINAPI EnumTfDocumentMgr_Reset(IEnumTfDocumentMgrs *iface)
Definition: threadmgr.c:1456
static HRESULT WINAPI MessagePump_QueryInterface(ITfMessagePump *iface, REFIID iid, LPVOID *ppvOut)
Definition: threadmgr.c:957
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
const GUID * guid
static HRESULT WINAPI EnumTfDocumentMgr_Clone(IEnumTfDocumentMgrs *iface, IEnumTfDocumentMgrs **ppenum)
Definition: threadmgr.c:1464
WINE_DEFAULT_DEBUG_CHANNEL(msctf)
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
unsigned int BOOL
Definition: ntddk_ex.h:94
long LONG
Definition: pedump.c:60
static ThreadMgr * impl_from_ITfThreadMgrEx(ITfThreadMgrEx *iface)
Definition: threadmgr.c:115
HRESULT get_textservice_sink(TfClientId tid, REFCLSID iid, IUnknown **sink)
Definition: msctf.c:519
ITfCompartmentMgr * CompartmentMgr
Definition: threadmgr.c:80
static HRESULT WINAPI ThreadMgrSourceSingle_AdviseSingleSink(ITfSourceSingle *iface, TfClientId tid, REFIID riid, IUnknown *punk)
Definition: threadmgr.c:1294
static ULONG WINAPI EnumTfDocumentMgr_AddRef(IEnumTfDocumentMgrs *iface)
Definition: threadmgr.c:1396
#define FIXME(fmt,...)
Definition: debug.h:110
static ULONG WINAPI EnumTfDocumentMgr_Release(IEnumTfDocumentMgrs *iface)
Definition: threadmgr.c:1402
struct tagEnumTfDocumentMgr EnumTfDocumentMgr
#define S_FALSE
Definition: winerror.h:2357
static HRESULT WINAPI KeystrokeMgr_SimulatePreservedKey(ITfKeystrokeMgr *iface, ITfContext *pic, REFGUID rguid, BOOL *pfEaten)
Definition: threadmgr.c:924
static ULONG WINAPI ThreadMgr_AddRef(ITfThreadMgrEx *iface)
Definition: threadmgr.c:257
#define E_INVALIDARG
Definition: ddrawi.h:101
static ULONG WINAPI Source_AddRef(ITfSource *iface)
Definition: threadmgr.c:590
#define LIST_FOR_EACH(cursor, list)
Definition: list.h:188
smooth NULL
Definition: ftsmooth.c:416
HRESULT ThreadMgr_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut)
Definition: threadmgr.c:1319
static ThreadMgr * impl_from_ITfMessagePump(ITfMessagePump *iface)
Definition: threadmgr.c:130
ITfKeystrokeMgr ITfKeystrokeMgr_iface
Definition: threadmgr.c:69
static ULONG WINAPI ThreadMgrEventSink_AddRef(ITfThreadMgrEventSink *iface)
Definition: threadmgr.c:1082
LONG_PTR LPARAM
Definition: windef.h:208
static HRESULT WINAPI ThreadMgr_EnumFunctionProviders(ITfThreadMgrEx *iface, IEnumTfFunctionProviders **ppEnum)
Definition: threadmgr.c:500
#define WH_CBT
Definition: winuser.h:35
#define COOKIE_MAGIC_KEYTRACESINK
static HRESULT WINAPI MessagePump_GetMessageW(ITfMessagePump *iface, LPMSG pMsg, HWND hwnd, UINT wMsgFilterMin, UINT wMsgFilterMax, BOOL *pfResult)
Definition: threadmgr.c:1005
static HRESULT WINAPI ThreadMgr_CreateDocumentMgr(ITfThreadMgrEx *iface, ITfDocumentMgr **ppdim)
Definition: threadmgr.c:311
static ThreadMgr * impl_from_ITfSourceSingle(ITfSourceSingle *iface)
Definition: threadmgr.c:150
static LRESULT CALLBACK ThreadFocusHookProc(int nCode, WPARAM wParam, LPARAM lParam)
Definition: threadmgr.c:387
static HRESULT WINAPI ThreadMgrSource_AdviseSink(ITfSource *iface, REFIID riid, IUnknown *punk, DWORD *pdwCookie)
Definition: threadmgr.c:605
#define debugstr_guid
Definition: kernel32.h:35
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
DWORD WINAPI GetCurrentThreadId(VOID)
Definition: thread.c:421
static HRESULT WINAPI KeystrokeMgr_UnadviseKeyEventSink(ITfKeystrokeMgr *iface, TfClientId tid)
Definition: threadmgr.c:721
static ULONG WINAPI KeystrokeMgr_Release(ITfKeystrokeMgr *iface)
Definition: threadmgr.c:675
struct tagACLMulti ThreadMgr
static HRESULT WINAPI ThreadMgr_GetFunctionProvider(ITfThreadMgrEx *iface, REFCLSID clsid, ITfFunctionProvider **ppFuncProv)
Definition: threadmgr.c:492
static HRESULT WINAPI EnumTfDocumentMgr_Skip(IEnumTfDocumentMgrs *iface, ULONG celt)
Definition: threadmgr.c:1445
LONG activationCount
Definition: threadmgr.c:85
__WINE_SERVER_LIST_INLINE void list_remove(struct list *elem)
Definition: list.h:108
static HRESULT WINAPI UIElementMgr_QueryInterface(ITfUIElementMgr *iface, REFIID iid, void **ppvOut)
Definition: threadmgr.c:1196
static ULONG WINAPI MessagePump_Release(ITfMessagePump *iface)
Definition: threadmgr.c:969
HRESULT CategoryMgr_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut)
Definition: categorymgr.c:415
#define TRACE(s)
Definition: solgame.cpp:4
static HRESULT WINAPI KeystrokeMgr_UnpreserveKey(ITfKeystrokeMgr *iface, REFGUID rguid, const TF_PRESERVEDKEY *pprekey)
Definition: threadmgr.c:879
ITfThreadMgrEventSink ITfThreadMgrEventSink_iface
Definition: threadmgr.c:82
static HRESULT WINAPI ThreadMgrEventSink_OnPushContext(ITfThreadMgrEventSink *iface, ITfContext *pic)
Definition: threadmgr.c:1147
static ThreadMgr * impl_from_ITfUIElementMgr(ITfUIElementMgr *iface)
Definition: threadmgr.c:145
#define GetProcessHeap()
Definition: compat.h:395
static const ITfSourceSingleVtbl SourceSingleVtbl
Definition: threadmgr.c:1310
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
static const ITfClientIdVtbl ClientIdVtbl
Definition: threadmgr.c:1065
static ThreadMgr * impl_from_ITfClientId(ITfClientId *iface)
Definition: threadmgr.c:135
static const ITfSourceVtbl ThreadMgrSourceVtbl
Definition: threadmgr.c:650
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
struct list ThreadFocusSink
Definition: threadmgr.c:101
const GUID IID_IUnknown
static HRESULT WINAPI ThreadMgr_GetGlobalCompartment(ITfThreadMgrEx *iface, ITfCompartmentMgr **ppCompMgr)
Definition: threadmgr.c:508
ITfUIElementMgr ITfUIElementMgr_iface
Definition: threadmgr.c:75
LONG refCount
Definition: threadmgr.c:77
#define WINAPI
Definition: msvc.h:8
static HRESULT WINAPI UIElementMgr_EndUIElement(ITfUIElementMgr *iface, DWORD id)
Definition: threadmgr.c:1234
unsigned long DWORD
Definition: ntddk_ex.h:95
struct list * head
Definition: threadmgr.c:110
static ULONG WINAPI ThreadMgrSourceSingle_Release(ITfSourceSingle *iface)
Definition: threadmgr.c:1288
static const ITfThreadMgrEventSinkVtbl ThreadMgrEventSinkVtbl
Definition: threadmgr.c:1181
static HRESULT WINAPI KeystrokeMgr_SetPreservedKeyDescription(ITfKeystrokeMgr *iface, REFGUID rguid, const WCHAR *pchDesc, ULONG cchDesc)
Definition: threadmgr.c:908
static ThreadMgr * impl_from_ITfKeystrokeMgr(ITfKeystrokeMgr *iface)
Definition: threadmgr.c:125
void check(CONTEXT *pContext)
Definition: NtContinue.c:61
GLbitfield flags
Definition: glext.h:7161
HRESULT WINAPI CoCreateGuid(GUID *pguid)
Definition: compobj.c:2115
static HRESULT WINAPI MessagePump_GetMessageA(ITfMessagePump *iface, LPMSG pMsg, HWND hwnd, UINT wMsgFilterMin, UINT wMsgFilterMax, BOOL *pfResult)
Definition: threadmgr.c:985
static HRESULT WINAPI KeystrokeMgr_AdviseKeyEventSink(ITfKeystrokeMgr *iface, TfClientId tid, ITfKeyEventSink *pSink, BOOL fForeground)
Definition: threadmgr.c:681
int ret
REFCLSID clsid
Definition: msctf.c:84
struct list ActiveLanguageProfileNotifySink
Definition: threadmgr.c:97
#define InterlockedDecrement
Definition: armddk.h:52
static HRESULT WINAPI ThreadMgr_GetFocus(ITfThreadMgrEx *iface, ITfDocumentMgr **ppdimFocus)
Definition: threadmgr.c:346
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define GUID_NULL
Definition: ks.h:106
Definition: _list.h:228
#define CLASS_E_NOAGGREGATION
Definition: winerror.h:2662
#define debugstr_wn
Definition: kernel32.h:33
BOOL WINAPI UnhookWindowsHookEx(_In_ HHOOK)
HRESULT CompartmentMgr_Destructor(ITfCompartmentMgr *iface)
static void ThreadMgr_Destructor(ThreadMgr *This)
Definition: threadmgr.c:160
HHOOK focusHook
Definition: threadmgr.c:94
#define ERR(fmt,...)
Definition: debug.h:109
ITfDocumentMgr * docmgr
Definition: threadmgr.c:63
void ThreadMgr_OnDocumentMgrDestruction(ITfThreadMgr *iface, ITfDocumentMgr *mgr)
Definition: threadmgr.c:1512
#define S_OK
Definition: intsafe.h:59
static HRESULT EnumTfDocumentMgr_Constructor(struct list *head, IEnumTfDocumentMgrs **ppOut)
Definition: threadmgr.c:1494
LRESULT WINAPI CallNextHookEx(_In_opt_ HHOOK, _In_ int, _In_ WPARAM, _In_ LPARAM)
HRESULT set_textservice_sink(TfClientId tid, REFCLSID iid, IUnknown *sink)
Definition: msctf.c:536
static HRESULT WINAPI KeystrokeMgr_PreserveKey(ITfKeystrokeMgr *iface, TfClientId tid, REFGUID rguid, const TF_PRESERVEDKEY *prekey, const WCHAR *pchDesc, ULONG cchDesc)
Definition: threadmgr.c:835
#define InterlockedIncrement
Definition: armddk.h:53
const char cursor[]
Definition: icontest.c:13
#define COOKIE_MAGIC_THREADFOCUSSINK
ITfMessagePump ITfMessagePump_iface
Definition: threadmgr.c:70
static const ITfMessagePumpVtbl MessagePumpVtbl
Definition: threadmgr.c:1015
struct list * index
Definition: threadmgr.c:109
static const ITfThreadMgrExVtbl ThreadMgrExVtbl
Definition: threadmgr.c:563
static ULONG WINAPI KeystrokeMgr_AddRef(ITfKeystrokeMgr *iface)
Definition: threadmgr.c:669
#define E_NOTIMPL
Definition: ddrawi.h:99
static HRESULT WINAPI KeystrokeMgr_KeyUp(ITfKeystrokeMgr *iface, WPARAM wParam, LPARAM lParam, BOOL *pfEaten)
Definition: threadmgr.c:794
static HRESULT WINAPI ThreadMgrEventSink_OnUninitDocumentMgr(ITfThreadMgrEventSink *iface, ITfDocumentMgr *pdim)
Definition: threadmgr.c:1112
static ULONG WINAPI ClientId_Release(ITfClientId *iface)
Definition: threadmgr.c:1042
static HRESULT WINAPI ThreadMgrEventSink_OnSetFocus(ITfThreadMgrEventSink *iface, ITfDocumentMgr *pdimFocus, ITfDocumentMgr *pdimPrevFocus)
Definition: threadmgr.c:1129
static HRESULT WINAPI ThreadMgr_Deactivate(ITfThreadMgrEx *iface)
Definition: threadmgr.c:286
unsigned int UINT
Definition: ndis.h:50
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021
static HRESULT WINAPI EnumTfDocumentMgr_Next(IEnumTfDocumentMgrs *iface, ULONG ulCount, ITfDocumentMgr **rgDocumentMgr, ULONG *pcFetched)
Definition: threadmgr.c:1413
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
BOOL WINAPI GetMessageW(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT)
static HRESULT WINAPI EnumTfDocumentMgr_QueryInterface(IEnumTfDocumentMgrs *iface, REFIID iid, LPVOID *ppvOut)
Definition: threadmgr.c:1376
static HRESULT WINAPI ThreadMgrEventSink_QueryInterface(ITfThreadMgrEventSink *iface, REFIID iid, LPVOID *ppvOut)
Definition: threadmgr.c:1076
#define E_UNEXPECTED
Definition: winerror.h:2456
HRESULT DocumentMgr_Constructor(ITfThreadMgrEventSink *ThreadMgrSink, ITfDocumentMgr **ppOut)
Definition: documentmgr.c:342
LPVOID WINAPI TlsGetValue(IN DWORD Index)
Definition: thread.c:1163
static HRESULT WINAPI KeystrokeMgr_QueryInterface(ITfKeystrokeMgr *iface, REFIID iid, LPVOID *ppvOut)
Definition: threadmgr.c:663
static HRESULT SetupWindowsHook(ThreadMgr *This)
Definition: threadmgr.c:423
HRESULT unadvise_sink(DWORD cookie)
Definition: msctf.c:314
HWND WINAPI GetFocus(void)
Definition: window.c:1875
static HRESULT WINAPI KeystrokeMgr_GetPreservedKeyDescription(ITfKeystrokeMgr *iface, REFGUID rguid, BSTR *pbstrDesc)
Definition: threadmgr.c:916
HHOOK WINAPI SetWindowsHookExW(_In_ int, _In_ HOOKPROC, _In_opt_ HINSTANCE, _In_ DWORD)
struct list entry
Definition: threadmgr.c:55
GLuint res
Definition: glext.h:9613
IEnumTfDocumentMgrs IEnumTfDocumentMgrs_iface
Definition: threadmgr.c:106
struct list entry
Definition: threadmgr.c:61
__WINE_SERVER_LIST_INLINE struct list * list_next(const struct list *list, const struct list *elem)
Definition: list.h:115
__WINE_SERVER_LIST_INLINE void list_init(struct list *list)
Definition: list.h:149
static HRESULT WINAPI ThreadMgrSourceSingle_UnadviseSingleSink(ITfSourceSingle *iface, TfClientId tid, REFIID riid)
Definition: threadmgr.c:1302
static const ITfUIElementMgrVtbl ThreadMgrUIElementMgrVtbl
Definition: threadmgr.c:1260
unsigned int ULONG
Definition: retypes.h:1
static HRESULT WINAPI ThreadMgr_QueryInterface(ITfThreadMgrEx *iface, REFIID iid, LPVOID *ppvOut)
Definition: threadmgr.c:208
static ULONG WINAPI ClientId_AddRef(ITfClientId *iface)
Definition: threadmgr.c:1036
HRESULT CompartmentMgr_Constructor(IUnknown *pUnkOuter, REFIID riid, IUnknown **ppOut)
static HRESULT WINAPI KeystrokeMgr_GetForeground(ITfKeystrokeMgr *iface, CLSID *pclsid)
Definition: threadmgr.c:753
DWORD TfClientId
Definition: msctf.idl:68
static HRESULT WINAPI ThreadMgrSourceSingle_QueryInterface(ITfSourceSingle *iface, REFIID iid, LPVOID *ppvOut)
Definition: threadmgr.c:1276
static HRESULT WINAPI KeystrokeMgr_TestKeyUp(ITfKeystrokeMgr *iface, WPARAM wParam, LPARAM lParam, BOOL *pfEaten)
Definition: threadmgr.c:777
struct list AssociatedFocusWindows
Definition: threadmgr.c:93
BOOL WINAPI PeekMessageW(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT, _In_ UINT)
ITfDocumentMgr * docmgr
Definition: threadmgr.c:56
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define LIST_ENTRY(type)
Definition: queue.h:175
LONG_PTR LRESULT
Definition: windef.h:209
#define E_POINTER
Definition: winerror.h:2365
TfClientId tid
Definition: threadmgr.c:50
ITfKeyEventSink * foregroundKeyEventSink
Definition: threadmgr.c:87
static HRESULT WINAPI UIElementMgr_GetUIElement(ITfUIElementMgr *iface, DWORD id, ITfUIElement **element)
Definition: threadmgr.c:1242
struct list PreservedKeyNotifySink
Definition: threadmgr.c:100
#define IsEqualCLSID(rclsid1, rclsid2)
Definition: guiddef.h:91
static ULONG WINAPI Source_Release(ITfSource *iface)
Definition: threadmgr.c:596
static TfClientId tid
LPARAM lParam
Definition: combotst.c:139
#define HeapFree(x, y, z)
Definition: compat.h:394
struct tagDocumentMgrs DocumentMgrEntry
static ULONG WINAPI UIElementMgr_AddRef(ITfUIElementMgr *iface)
Definition: threadmgr.c:1203
CLSID foregroundTextService
Definition: threadmgr.c:88
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:90
static HRESULT WINAPI ThreadMgrSource_UnadviseSink(ITfSource *iface, DWORD pdwCookie)
Definition: threadmgr.c:635
static HRESULT WINAPI ClientId_QueryInterface(ITfClientId *iface, REFIID iid, LPVOID *ppvOut)
Definition: threadmgr.c:1030
#define SUCCEEDED(hr)
Definition: intsafe.h:57
Definition: path.c:42
struct tagPreservedKey PreservedKey
static HRESULT WINAPI KeystrokeMgr_TestKeyDown(ITfKeystrokeMgr *iface, WPARAM wParam, LPARAM lParam, BOOL *pfEaten)
Definition: threadmgr.c:768
static HRESULT WINAPI UIElementMgr_UpdateUIElement(ITfUIElementMgr *iface, DWORD id)
Definition: threadmgr.c:1226
struct list entry
Definition: threadmgr.c:46