ReactOS 0.4.16-dev-1946-g52006dd
precomp.h File Reference
#include <initguid.h>
#include <windef.h>
#include <winbase.h>
#include <oleauto.h>
#include <olectl.h>
#include <cguid.h>
#include <msctf.h>
#include <msctf_undoc.h>
#include <tchar.h>
#include <strsafe.h>
#include <wine/list.h>
#include <cicbase.h>
#include <cicarray.h>
#include <cicreg.h>
#include <cicutb.h>
Include dependency graph for precomp.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  Sink
 

Macros

#define COOKIE_MAGIC_TMSINK   0x0010
 
#define COOKIE_MAGIC_CONTEXTSINK   0x0020
 
#define COOKIE_MAGIC_GUIDATOM   0x0030
 
#define COOKIE_MAGIC_IPPSINK   0x0040
 
#define COOKIE_MAGIC_EDITCOOKIE   0x0050
 
#define COOKIE_MAGIC_COMPARTMENTSINK   0x0060
 
#define COOKIE_MAGIC_DMSINK   0x0070
 
#define COOKIE_MAGIC_THREADFOCUSSINK   0x0080
 
#define COOKIE_MAGIC_KEYTRACESINK   0x0090
 
#define COOKIE_MAGIC_UIELEMENTSINK   0x00a0
 
#define COOKIE_MAGIC_INPUTPROCESSORPROFILEACTIVATIONSINK   0x00b0
 
#define COOKIE_MAGIC_ACTIVELANGSINK   0x00c0
 
#define SINK_ENTRY(cursor, type)   (LIST_ENTRY(cursor,Sink,entry)->interfaces.p##type)
 
#define SINK_FOR_EACH(cursor, list, type, elem)
 
#define szwSystemTIPKey   L"SOFTWARE\\Microsoft\\CTF\\TIP"
 
#define szwSystemCTFKey   L"SOFTWARE\\Microsoft\\CTF"
 

Functions

HRESULT ThreadMgr_Constructor (IUnknown *pUnkOuter, IUnknown **ppOut)
 
HRESULT DocumentMgr_Constructor (ITfThreadMgrEventSink *, ITfDocumentMgr **ppOut)
 
HRESULT Context_Constructor (TfClientId tidOwner, IUnknown *punk, ITfDocumentMgr *mgr, ITfContext **ppOut, TfEditCookie *pecTextStore)
 
HRESULT InputProcessorProfiles_Constructor (IUnknown *pUnkOuter, IUnknown **ppOut)
 
HRESULT CategoryMgr_Constructor (IUnknown *pUnkOuter, IUnknown **ppOut)
 
HRESULT Range_Constructor (ITfContext *context, DWORD anchorStart, DWORD anchorEnd, ITfRange **ppOut)
 
HRESULT CompartmentMgr_Constructor (IUnknown *pUnkOuter, REFIID riid, IUnknown **ppOut)
 
HRESULT CompartmentMgr_Destructor (ITfCompartmentMgr *This)
 
HRESULT LangBarMgr_Constructor (IUnknown *pUnkOuter, IUnknown **ppOut)
 
HRESULT DisplayAttributeMgr_Constructor (IUnknown *pUnkOuter, IUnknown **ppOut)
 
HRESULT Context_Initialize (ITfContext *cxt, ITfDocumentMgr *manager)
 
HRESULT Context_Uninitialize (ITfContext *cxt)
 
void ThreadMgr_OnDocumentMgrDestruction (ITfThreadMgr *tm, ITfDocumentMgr *mgr)
 
HRESULT TF_SELECTION_to_TS_SELECTION_ACP (const TF_SELECTION *tf, TS_SELECTION_ACP *tsAcp)
 
DWORD generate_Cookie (DWORD magic, LPVOID data)
 
DWORD get_Cookie_magic (DWORD id)
 
LPVOID get_Cookie_data (DWORD id)
 
LPVOID remove_Cookie (DWORD id)
 
DWORD enumerate_Cookie (DWORD magic, DWORD *index)
 
HRESULT add_active_textservice (TF_LANGUAGEPROFILE *lp)
 
BOOL get_active_textservice (REFCLSID rclsid, TF_LANGUAGEPROFILE *lp)
 
HRESULT activate_textservices (ITfThreadMgrEx *tm)
 
HRESULT deactivate_textservices (void)
 
CLSID get_textservice_clsid (TfClientId tid)
 
HRESULT get_textservice_sink (TfClientId tid, REFCLSID iid, IUnknown **sink)
 
HRESULT set_textservice_sink (TfClientId tid, REFCLSID iid, IUnknown *sink)
 
HRESULT advise_sink (struct list *sink_list, REFIID riid, DWORD cookie_magic, IUnknown *unk, DWORD *cookie)
 
HRESULT unadvise_sink (DWORD cookie)
 
void free_sinks (struct list *sink_list)
 
HRESULT __wine_register_resources (HMODULE module)
 
HRESULT __wine_unregister_resources (HMODULE module)
 
BOOL ProcessAttach (HINSTANCE hinstDLL)
 @unimplemented
 
VOID ProcessDetach (HINSTANCE hinstDLL)
 @unimplemented
 

Variables

DWORD g_dwTLSIndex
 
TfClientId g_processId
 
ITfCompartmentMgrg_globalCompartmentMgr
 

Macro Definition Documentation

◆ COOKIE_MAGIC_ACTIVELANGSINK

#define COOKIE_MAGIC_ACTIVELANGSINK   0x00c0

Definition at line 44 of file precomp.h.

◆ COOKIE_MAGIC_COMPARTMENTSINK

#define COOKIE_MAGIC_COMPARTMENTSINK   0x0060

Definition at line 38 of file precomp.h.

◆ COOKIE_MAGIC_CONTEXTSINK

#define COOKIE_MAGIC_CONTEXTSINK   0x0020

Definition at line 34 of file precomp.h.

◆ COOKIE_MAGIC_DMSINK

#define COOKIE_MAGIC_DMSINK   0x0070

Definition at line 39 of file precomp.h.

◆ COOKIE_MAGIC_EDITCOOKIE

#define COOKIE_MAGIC_EDITCOOKIE   0x0050

Definition at line 37 of file precomp.h.

◆ COOKIE_MAGIC_GUIDATOM

#define COOKIE_MAGIC_GUIDATOM   0x0030

Definition at line 35 of file precomp.h.

◆ COOKIE_MAGIC_INPUTPROCESSORPROFILEACTIVATIONSINK

#define COOKIE_MAGIC_INPUTPROCESSORPROFILEACTIVATIONSINK   0x00b0

Definition at line 43 of file precomp.h.

◆ COOKIE_MAGIC_IPPSINK

#define COOKIE_MAGIC_IPPSINK   0x0040

Definition at line 36 of file precomp.h.

◆ COOKIE_MAGIC_KEYTRACESINK

#define COOKIE_MAGIC_KEYTRACESINK   0x0090

Definition at line 41 of file precomp.h.

◆ COOKIE_MAGIC_THREADFOCUSSINK

#define COOKIE_MAGIC_THREADFOCUSSINK   0x0080

Definition at line 40 of file precomp.h.

◆ COOKIE_MAGIC_TMSINK

#define COOKIE_MAGIC_TMSINK   0x0010

Definition at line 33 of file precomp.h.

◆ COOKIE_MAGIC_UIELEMENTSINK

#define COOKIE_MAGIC_UIELEMENTSINK   0x00a0

Definition at line 42 of file precomp.h.

◆ SINK_ENTRY

#define SINK_ENTRY (   cursor,
  type 
)    (LIST_ENTRY(cursor,Sink,entry)->interfaces.p##type)

Definition at line 95 of file precomp.h.

◆ SINK_FOR_EACH

#define SINK_FOR_EACH (   cursor,
  list,
  type,
  elem 
)
Value:
for ((cursor) = (list)->next, elem = SINK_ENTRY(cursor,type); \
(cursor) != (list); \
#define SINK_ENTRY(cursor, type)
Definition: precomp.h:95
Definition: list.h:37
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
const char cursor[]
Definition: icontest.c:13
static size_t elem
Definition: string.c:71
static unsigned __int64 next
Definition: rand_nt.c:6
struct define * next
Definition: compiler.c:65

Definition at line 96 of file precomp.h.

◆ szwSystemCTFKey

#define szwSystemCTFKey   L"SOFTWARE\\Microsoft\\CTF"

Definition at line 106 of file precomp.h.

◆ szwSystemTIPKey

#define szwSystemTIPKey   L"SOFTWARE\\Microsoft\\CTF\\TIP"

Definition at line 105 of file precomp.h.

Function Documentation

◆ __wine_register_resources()

HRESULT __wine_register_resources ( HMODULE  module)

Definition at line 112 of file register.c.

113{
114 struct reg_info info;
115
116 info.registrar = NULL;
117 info.do_register = TRUE;
118 info.result = S_OK;
120 if (info.registrar) IRegistrar_Release( info.registrar );
121 return info.result;
122}
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
BOOL WINAPI EnumResourceNamesW(HMODULE hmod, LPCWSTR type, ENUMRESNAMEPROCW lpfun, LONG_PTR lparam)
Definition: res.c:358
#define S_OK
Definition: intsafe.h:52
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
static BOOL CALLBACK register_resource(HMODULE module, LPCWSTR type, LPWSTR name, LONG_PTR arg)
Definition: register.c:84
static const WCHAR regtypeW[]
Definition: register.c:45

Referenced by DllRegisterServer(), and RegisterTypeLibraries().

◆ __wine_unregister_resources()

HRESULT __wine_unregister_resources ( HMODULE  module)

Definition at line 124 of file register.c.

125{
126 struct reg_info info;
127
128 info.registrar = NULL;
129 info.do_register = FALSE;
130 info.result = S_OK;
132 if (info.registrar) IRegistrar_Release( info.registrar );
133 return info.result;
134}
#define FALSE
Definition: types.h:117

Referenced by DllUnregisterServer().

◆ activate_textservices()

HRESULT activate_textservices ( ITfThreadMgrEx tm)

Definition at line 449 of file msctf.cpp.

450{
451 HRESULT hr = S_OK;
452 AtsEntry *ats;
453
454 activated ++;
455 if (activated > 1)
456 return S_OK;
457
459 {
460 hr = activate_given_ts(ats->ats, tm);
461 if (FAILED(hr))
462 FIXME("Failed to activate text service\n");
463 }
464 return hr;
465}
#define FIXME(fmt,...)
Definition: precomp.h:53
#define FAILED(hr)
Definition: intsafe.h:51
uint32_t entry
Definition: isohybrid.c:63
static UINT activated
Definition: msctf.cpp:42
static struct list AtsList
Definition: msctf.cpp:41
static HRESULT activate_given_ts(ActivatedTextService *actsvr, ITfThreadMgrEx *tm)
Definition: msctf.cpp:309
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
HRESULT hr
Definition: shlfolder.c:183
ActivatedTextService * ats
Definition: msctf.cpp:34
Definition: time.h:68

Referenced by CThreadMgr::ActivateEx().

◆ add_active_textservice()

HRESULT add_active_textservice ( TF_LANGUAGEPROFILE lp)

Definition at line 369 of file msctf.cpp.

370{
371 ActivatedTextService *actsvr;
372 ITfCategoryMgr *catmgr;
375 ITfClientId *clientid;
376
377 if (!tm)
378 return E_UNEXPECTED;
379
381 if (!actsvr)
382 return E_OUTOFMEMORY;
383
384 tm->QueryInterface(IID_ITfClientId, (void **)&clientid);
385 clientid->GetClientId(lp->clsid, &actsvr->tid);
386 clientid->Release();
387
388 if (!actsvr->tid)
389 {
390 cicMemFree(actsvr);
391 return E_OUTOFMEMORY;
392 }
393
395 actsvr->LanguageProfile = *lp;
396 actsvr->pITfKeyEventSink = NULL;
397
398 /* get TIP category */
400 {
402
403 catmgr->FindClosestCategory(actsvr->LanguageProfile.clsid, &actsvr->LanguageProfile.catid, list, 3);
404 catmgr->Release();
405 }
406 else
407 {
408 ERR("CategoryMgr construction failed\n");
410 }
411
412 if (actsvr->LanguageProfile.catid != GUID_NULL)
414
415 if (activated > 0)
416 activate_given_ts(actsvr, tm);
417
418 entry = (AtsEntry *)cicMemAlloc(sizeof(AtsEntry));
419 if (!entry)
420 {
421 cicMemFree(actsvr);
422 return E_OUTOFMEMORY;
423 }
424
425 entry->ats = actsvr;
426 list_add_head(&AtsList, &entry->entry);
427
428 return S_OK;
429}
DWORD g_dwTLSIndex
Definition: utils.cpp:33
static void list_add_head(struct list_entry *head, struct list_entry *entry)
Definition: list.h:76
#define ERR(fmt,...)
Definition: precomp.h:57
EXTERN_C HRESULT CategoryMgr_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut)
static LPVOID cicMemAlloc(SIZE_T size)
Definition: cicbase.h:10
static void cicMemFree(LPVOID ptr)
Definition: cicbase.h:20
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
LPVOID WINAPI TlsGetValue(IN DWORD Index)
Definition: thread.c:1240
HRESULT GetClientId([in] REFCLSID rclsid, [out] TfClientId *ptid)
ULONG Release()
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define GUID_NULL
Definition: ks.h:106
static void deactivate_remove_conflicting_ts(REFCLSID catid)
Definition: msctf.cpp:350
EXTERN_C const GUID GUID_TFCAT_TIP_KEYBOARD
Definition: msctf.idl:81
EXTERN_C const GUID GUID_TFCAT_TIP_SPEECH
Definition: msctf.idl:82
EXTERN_C const GUID GUID_TFCAT_TIP_HANDWRITING
Definition: msctf.idl:83
TF_LANGUAGEPROFILE LanguageProfile
Definition: msctf.cpp:24
ITfTextInputProcessor * pITfTextInputProcessor
Definition: msctf.cpp:25
ITfKeyEventSink * pITfKeyEventSink
Definition: msctf.cpp:27
TfClientId tid
Definition: msctf.cpp:28
#define E_UNEXPECTED
Definition: winerror.h:3528

Referenced by CInputProcessorProfiles::ActivateLanguageProfile().

◆ advise_sink()

HRESULT advise_sink ( struct list sink_list,
REFIID  riid,
DWORD  cookie_magic,
IUnknown unk,
DWORD cookie 
)

Definition at line 259 of file msctf.cpp.

260{
261 Sink *sink = (Sink *)cicMemAlloc(sizeof(*sink));
262 if (!sink)
263 return E_OUTOFMEMORY;
264
265 HRESULT hr = unk->QueryInterface(riid, (void **)&sink->interfaces.pIUnknown);
266 if (FAILED(hr))
267 {
270 }
271
272 list_add_head(sink_list, &sink->entry);
273 *cookie = generate_Cookie(cookie_magic, sink);
274 TRACE("cookie %x\n", *cookie);
275 return S_OK;
276}
GLsizei GLenum GLboolean sink
Definition: glext.h:5672
REFIID riid
Definition: atlbase.h:39
HRESULT QueryInterface([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
EXTERN_C DWORD generate_Cookie(DWORD magic, LPVOID data)
Definition: msctf.cpp:157
#define CONNECT_E_CANNOTCONNECT
Definition: olectl.h:253
#define TRACE(s)
Definition: solgame.cpp:4
Definition: precomp.h:83
Definition: cookie.c:34

Referenced by CCompartment::AdviseSink(), CContext::AdviseSink(), CInputProcessorProfiles::AdviseSink(), CThreadMgr::AdviseSink(), and CDocumentMgr::AdviseSink().

◆ CategoryMgr_Constructor()

HRESULT CategoryMgr_Constructor ( IUnknown pUnkOuter,
IUnknown **  ppOut 
)

Definition at line 416 of file categorymgr.cpp.

417{
418 if (pUnkOuter)
420
422 if (!This)
423 return E_OUTOFMEMORY;
424
425 *ppOut = static_cast<ITfCategoryMgr *>(This);
426 TRACE("returning %p\n", *ppOut);
427 return S_OK;
428}
#define cicNoThrow
Definition: cicbase.h:46
#define CLASS_E_NOAGGREGATION
Definition: winerror.h:3771

Referenced by add_active_textservice(), CEnumTfLanguageProfiles::CreateInstance(), CThreadMgr::GetClientId(), CInputProcessorProfiles::SetDefaultLanguageProfile(), and TF_CreateCategoryMgr().

◆ CompartmentMgr_Constructor()

HRESULT CompartmentMgr_Constructor ( IUnknown pUnkOuter,
REFIID  riid,
IUnknown **  ppOut 
)

Definition at line 553 of file compartmentmgr.cpp.

554{
555 return CCompartmentMgr::CreateInstance(pUnkOuter, riid, ppOut);
556}
static HRESULT CreateInstance(IUnknown *pUnkOuter, REFIID riid, IUnknown **ppOut)

Referenced by CDocumentMgr::CDocumentMgr(), CThreadMgr::CreateInstance(), CContext::CreateInstance(), and CThreadMgr::GetGlobalCompartment().

◆ CompartmentMgr_Destructor()

HRESULT CompartmentMgr_Destructor ( ITfCompartmentMgr This)

Definition at line 559 of file compartmentmgr.cpp.

560{
561 iface->Release();
562 return S_OK;
563}

◆ Context_Constructor()

HRESULT Context_Constructor ( TfClientId  tidOwner,
IUnknown punk,
ITfDocumentMgr mgr,
ITfContext **  ppOut,
TfEditCookie pecTextStore 
)

Definition at line 967 of file context.cpp.

973{
974 return CContext::CreateInstance(tidOwner, punk, mgr, ppOut, pecTextStore);
975}
static HRESULT CreateInstance(TfClientId tidOwner, IUnknown *punk, ITfDocumentMgr *mgr, ITfContext **ppOut, TfEditCookie *pecTextStore)
Definition: context.cpp:889
_In_opt_ IUnknown * punk
Definition: shlwapi.h:158

Referenced by CDocumentMgr::CDocumentMgr(), and CDocumentMgr::CreateContext().

◆ Context_Initialize()

HRESULT Context_Initialize ( ITfContext cxt,
ITfDocumentMgr manager 
)

Definition at line 978 of file context.cpp.

979{
980 CContext *This = static_cast<CContext *>(iface);
981 return This->Initialize(manager);
982}

Referenced by CDocumentMgr::Push().

◆ Context_Uninitialize()

HRESULT Context_Uninitialize ( ITfContext cxt)

Definition at line 985 of file context.cpp.

986{
987 CContext *This = static_cast<CContext *>(iface);
988 return This->Uninitialize();
989}

Referenced by CDocumentMgr::Pop().

◆ deactivate_textservices()

HRESULT deactivate_textservices ( void  )

Definition at line 468 of file msctf.cpp.

469{
470 AtsEntry *ats;
471
472 if (activated > 0)
473 activated --;
474
475 if (activated == 0)
476 {
479 }
480 return S_OK;
481}
static HRESULT deactivate_given_ts(ActivatedTextService *actsvr)
Definition: msctf.cpp:334

Referenced by CThreadMgr::Deactivate().

◆ DisplayAttributeMgr_Constructor()

HRESULT DisplayAttributeMgr_Constructor ( IUnknown pUnkOuter,
IUnknown **  ppOut 
)

Definition at line 122 of file displayattributemgr.cpp.

123{
124 if (pUnkOuter)
126
128 if (!This)
129 return E_OUTOFMEMORY;
130
131 HRESULT hr = This->QueryInterface(IID_ITfDisplayAttributeMgr, (void **)ppOut);
132 This->Release();
133 return hr;
134}

Referenced by TF_CreateDisplayAttributeMgr().

◆ DocumentMgr_Constructor()

HRESULT DocumentMgr_Constructor ( ITfThreadMgrEventSink pThreadMgrSink,
ITfDocumentMgr **  ppOut 
)

Definition at line 451 of file documentmgr.cpp.

452{
453 return CDocumentMgr::CreateInstance(pThreadMgrSink, ppOut);
454}
static HRESULT CreateInstance(_In_ ITfThreadMgrEventSink *pThreadMgrSink, _Out_ ITfDocumentMgr **ppOut)
Definition: documentmgr.cpp:64

Referenced by CThreadMgr::CreateDocumentMgr().

◆ enumerate_Cookie()

DWORD enumerate_Cookie ( DWORD  magic,
DWORD index 
)

Definition at line 246 of file msctf.cpp.

247{
248 unsigned int i;
249 for (i = *index; i < id_last; i++)
250 if (cookies[i].id != 0 && cookies[i].magic == magic)
251 {
252 *index = (i+1);
253 return cookies[i].id;
254 }
255 return 0x0;
256}
GLuint index
Definition: glext.h:6031
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
static UINT id_last
Definition: msctf.cpp:38
static CookieInternal * cookies
Definition: msctf.cpp:37
DWORD id
Definition: msctf.cpp:18

Referenced by CCategoryMgr::RegisterGUID().

◆ free_sinks()

void free_sinks ( struct list sink_list)

Definition at line 297 of file msctf.cpp.

298{
299 while(!list_empty(sink_list))
300 {
301 Sink* sink = LIST_ENTRY(sink_list->next, Sink, entry);
303 }
304}
static int list_empty(struct list_entry *head)
Definition: list.h:58
struct list * next
Definition: list.h:38
static void free_sink(Sink *sink)
Definition: msctf.cpp:278
#define LIST_ENTRY(type)
Definition: queue.h:175

Referenced by CCompartment::~CCompartment(), CContext::~CContext(), CDocumentMgr::~CDocumentMgr(), CInputProcessorProfiles::~CInputProcessorProfiles(), and CThreadMgr::~CThreadMgr().

◆ generate_Cookie()

DWORD generate_Cookie ( DWORD  magic,
LPVOID  data 
)

Definition at line 157 of file msctf.cpp.

158{
159 UINT i;
160
161 /* try to reuse IDs if possible */
162 for (i = 0; i < id_last; i++)
163 if (cookies[i].id == 0) break;
164
165 if (i == array_size)
166 {
167 if (!array_size)
168 {
170 if (!cookies)
171 {
172 ERR("Out of memory, Unable to alloc cookies array\n");
173 return 0;
174 }
175 array_size = 10;
176 }
177 else
178 {
179 ERR("cookies: %p, array_size: %d\n", cookies, array_size);
180 CookieInternal *new_cookies = (CookieInternal *)
182 if (!new_cookies)
183 {
184 ERR("Out of memory, Unable to realloc cookies array\n");
185 return 0;
186 }
187 cookies = new_cookies;
188 array_size *= 2;
189 }
190 }
191
192 cookies[i].id = i + 1; /* a return of 0 is used for failure */
193 cookies[i].magic = magic;
194 cookies[i].data = data;
195
196 if (i == id_last)
197 id_last++;
198
199 return cookies[i].id;
200}
LPVOID cicMemReCalloc(LPVOID mem, SIZE_T num, SIZE_T size) noexcept
Definition: cicbase.cpp:41
static LPVOID cicMemAllocClear(SIZE_T size)
Definition: cicbase.h:15
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
static UINT array_size
Definition: msctf.cpp:39
unsigned int UINT
Definition: ndis.h:50
LPVOID data
Definition: msctf.cpp:20
DWORD magic
Definition: msctf.cpp:19

Referenced by advise_sink(), CContext::CreateInstance(), CContext::OnLockGranted(), and CCategoryMgr::RegisterGUID().

◆ get_active_textservice()

BOOL get_active_textservice ( REFCLSID  rclsid,
TF_LANGUAGEPROFILE lp 
)

Definition at line 432 of file msctf.cpp.

433{
434 AtsEntry *ats;
435
437 {
438 if (rclsid == ats->ats->LanguageProfile.clsid)
439 {
440 if (profile)
441 *profile = ats->ats->LanguageProfile;
442 return TRUE;
443 }
444 }
445 return FALSE;
446}
#define profile
Definition: kernel32.h:12

Referenced by CInputProcessorProfiles::ActivateLanguageProfile(), CInputProcessorProfiles::GetActiveLanguageProfile(), and CEnumTfLanguageProfiles::next_LanguageProfile().

◆ get_Cookie_data()

LPVOID get_Cookie_data ( DWORD  id)

Definition at line 217 of file msctf.cpp.

218{
219 UINT index = id - 1;
220
221 if (index >= id_last)
222 return NULL;
223
224 if (cookies[index].id == 0)
225 return NULL;
226
227 return cookies[index].data;
228}
#define index(s, c)
Definition: various.h:29

Referenced by CCategoryMgr::GetGUID(), CContext::InsertTextAtSelection(), CCategoryMgr::IsEqualTfGuidAtom(), and CCategoryMgr::RegisterGUID().

◆ get_Cookie_magic()

◆ get_textservice_clsid()

CLSID get_textservice_clsid ( TfClientId  tid)

Definition at line 484 of file msctf.cpp.

485{
486 AtsEntry *ats;
487
489 {
490 if (ats->ats->tid == tid)
491 return ats->ats->LanguageProfile.clsid;
492 }
493 return GUID_NULL;
494}
static TfClientId tid

Referenced by CThreadMgr::AdviseKeyEventSink(), and CThreadMgr::UnadviseKeyEventSink().

◆ get_textservice_sink()

HRESULT get_textservice_sink ( TfClientId  tid,
REFCLSID  iid,
IUnknown **  sink 
)

Definition at line 497 of file msctf.cpp.

498{
499 AtsEntry *ats;
500
501 if (iid != IID_ITfKeyEventSink)
502 return E_NOINTERFACE;
503
505 {
506 if (ats->ats->tid == tid)
507 {
509 return S_OK;
510 }
511 }
512
513 return E_FAIL;
514}
#define E_FAIL
Definition: ddrawi.h:102
#define E_NOINTERFACE
Definition: winerror.h:3479

Referenced by CThreadMgr::AdviseKeyEventSink(), and CThreadMgr::UnadviseKeyEventSink().

◆ InputProcessorProfiles_Constructor()

HRESULT InputProcessorProfiles_Constructor ( IUnknown pUnkOuter,
IUnknown **  ppOut 
)

Definition at line 1332 of file inputprocessor.cpp.

1333{
1335}
static HRESULT CreateInstance(IUnknown *pUnkOuter, CInputProcessorProfiles **ppOut)

Referenced by TF_CreateInputProcessorProfiles().

◆ LangBarMgr_Constructor()

HRESULT LangBarMgr_Constructor ( IUnknown pUnkOuter,
IUnknown **  ppOut 
)

Definition at line 248 of file langbarmgr.cpp.

249{
250 if (pUnkOuter)
252
253 CLangBarMgr *pLangBarMgr = new(cicNoThrow) CLangBarMgr();
254 if (!pLangBarMgr)
255 return E_OUTOFMEMORY;
256
257 HRESULT hr = pLangBarMgr->QueryInterface(IID_ITfLangBarMgr, (PVOID *)ppOut);
258 TRACE("returning %p\n", *ppOut);
259 pLangBarMgr->Release();
260 return hr;
261}
STDMETHODIMP QueryInterface(_In_ REFIID riid, _Out_ PVOID *ppvObj) override
Definition: langbarmgr.cpp:109

Referenced by TF_CreateLangBarMgr().

◆ ProcessAttach()

BOOL ProcessAttach ( HINSTANCE  hinstDLL)

@unimplemented

@unimplemented

Definition at line 766 of file utils.cpp.

767{
769
773
775 g_hInst = hinstDLL;
778 if (g_dwTLSIndex == (DWORD)-1)
779 return FALSE;
780
781 g_msgPrivate = ::RegisterWindowMessageA("MSUIM.Msg.Private");
782 g_msgSetFocus = ::RegisterWindowMessageA("MSUIM.Msg.SetFocus");
783 g_msgThreadTerminate = ::RegisterWindowMessageA("MSUIM.Msg.ThreadTerminate");
784 g_msgThreadItemChange = ::RegisterWindowMessageA("MSUIM.Msg.ThreadItemChange");
785 g_msgLBarModal = ::RegisterWindowMessageA("MSUIM.Msg.LangBarModal");
786 g_msgRpcSendReceive = ::RegisterWindowMessageA("MSUIM.Msg.RpcSendReceive");
787 g_msgThreadMarshal = ::RegisterWindowMessageA("MSUIM.Msg.ThreadMarshal");
788 g_msgCheckThreadInputIdel = ::RegisterWindowMessageA("MSUIM.Msg.CheckThreadInputIdel");
789 g_msgStubCleanUp = ::RegisterWindowMessageA("MSUIM.Msg.StubCleanUp");
790 g_msgShowFloating = ::RegisterWindowMessageA("MSUIM.Msg.ShowFloating");
791 g_msgLBUpdate = ::RegisterWindowMessageA("MSUIM.Msg.LBUpdate");
792 g_msgNuiMgrDirtyUpdate = ::RegisterWindowMessageA("MSUIM.Msg.MuiMgrDirtyUpdate");
793 if (!g_msgPrivate ||
794 !g_msgSetFocus ||
803 !g_msgLBUpdate ||
805 {
806 return FALSE;
807 }
808
810 TRACE("cicGetOSInfo: %u, 0x%lX\n", g_uACP, g_dwOSInfo);
811
813
814 //FIXME
815
817
818 //FIXME
819
820 InitCUASFlag();
821
822 //FIXME
823
827
828 //FIXME
829
831
832 //FIXME
833
835
836 return TRUE;
837}
UINT g_msgPrivate
Definition: utils.cpp:42
DWORD g_dwOSInfo
Definition: utils.cpp:31
VOID InitCUASFlag(VOID)
Definition: utils.cpp:726
VOID CheckAnchorStores(VOID)
Definition: utils.cpp:710
HKL g_hklDefault
Definition: utils.cpp:32
UINT g_msgLBUpdate
Definition: utils.cpp:52
UINT g_msgCheckThreadInputIdel
Definition: utils.cpp:49
BOOL g_bOnWow64
Definition: utils.cpp:29
UINT g_msgThreadMarshal
Definition: utils.cpp:48
BOOL gfSharedMemory
Definition: utils.cpp:34
CRITICAL_SECTION g_csDelayLoad
Definition: utils.cpp:27
CRITICAL_SECTION g_cs
Definition: utils.cpp:25
UINT g_msgStubCleanUp
Definition: utils.cpp:50
UINT g_msgShowFloating
Definition: utils.cpp:51
UINT g_msgNuiMgrDirtyUpdate
Definition: utils.cpp:53
UINT g_msgRpcSendReceive
Definition: utils.cpp:47
void GetDesktopUniqueName(_In_ LPCTSTR pszName, _Out_ LPTSTR pszBuff, _In_ UINT cchBuff)
Definition: utils.cpp:164
UINT g_uACP
Definition: utils.cpp:30
UINT g_msgThreadTerminate
Definition: utils.cpp:44
BOOL InitLangChangeHotKey(VOID)
Definition: utils.cpp:587
UINT g_msgSetFocus
Definition: utils.cpp:43
TCHAR g_szAsmListCache[MAX_PATH]
Definition: utils.cpp:59
BOOL InitUniqueString(void)
Definition: utils.cpp:144
TCHAR g_szTimListCache[MAX_PATH]
Definition: utils.cpp:60
UINT g_msgThreadItemChange
Definition: utils.cpp:45
BOOL gf_CRT_INIT
Definition: utils.cpp:23
CRITICAL_SECTION g_csInDllMain
Definition: utils.cpp:26
DWORD g_dwTLSIndex
Definition: utils.cpp:33
UINT g_msgLBarModal
Definition: utils.cpp:46
HINSTANCE g_hInst
Definition: utils.cpp:28
TCHAR g_szLayoutsCache[MAX_PATH]
Definition: utils.cpp:61
EXTERN_C BOOL cicIsWow64(VOID)
Definition: cicbase.cpp:77
EXTERN_C void cicGetOSInfo(LPUINT puACP, LPDWORD pdwOSInfo)
Definition: cicbase.cpp:101
DWORD WINAPI DECLSPEC_HOTPATCH TlsAlloc(void)
Definition: thread.c:657
unsigned long DWORD
Definition: ntddk_ex.h:95
#define TEXT(s)
Definition: k32.h:28
#define _countof(array)
Definition: sndvol32.h:70
BOOL WINAPI InitializeCriticalSectionAndSpinCount(OUT LPCRITICAL_SECTION lpCriticalSection, IN DWORD dwSpinCount)
Definition: synch.c:765
HKL WINAPI GetKeyboardLayout(_In_ DWORD)
UINT WINAPI RegisterWindowMessageA(_In_ LPCSTR)

Referenced by DllMain().

◆ ProcessDetach()

VOID ProcessDetach ( HINSTANCE  hinstDLL)

@unimplemented

@unimplemented

Definition at line 840 of file utils.cpp.

841{
842 if (!gf_CRT_INIT)
843 {
845 return;
846 }
847
848 if (gfSharedMemory)
849 {
850 if (g_cRefDll != -1 )
851 TFUninitLib();
852 //FIXME
853 }
854
855 UninitINAT();
856
857 //FIXME
858
859 //TF_UninitThreadSystem();
860
861 //FIXME
862
863 if (g_dwTLSIndex != (DWORD)-1)
864 {
866 g_dwTLSIndex = (DWORD)-1;
867 }
868
869 //FIXME
870
871 if (gfSharedMemory)
872 {
876 //FIXME
879 //FIXME
881 }
882
884
888
890}
CicMutex g_mutexLBES
Definition: utils.cpp:64
EXTERN_C VOID TFUninitLib(VOID)
Definition: utils.cpp:760
CicMutex g_mutexLayouts
Definition: utils.cpp:67
CicMutex g_mutexAsm
Definition: utils.cpp:66
LONG g_cRefDll
Definition: utils.cpp:35
CicMutex g_mutexTMD
Definition: utils.cpp:68
CicMutex g_mutexCompart
Definition: utils.cpp:65
CicFileMappingStatic g_SharedMemory
Definition: utils.cpp:71
BOOL g_fDllProcessDetached
Definition: utils.cpp:24
void Uninit()
Definition: cicmutex.h:31
BOOL WINAPI TlsFree(IN DWORD Index)
Definition: thread.c:1166
VOID UninitINAT(VOID)
@implemented
Definition: mlng.cpp:348
#define DWORD
Definition: nt_native.h:44
void WINAPI DeleteCriticalSection(PCRITICAL_SECTION)

Referenced by DllMain().

◆ Range_Constructor()

HRESULT Range_Constructor ( ITfContext context,
DWORD  anchorStart,
DWORD  anchorEnd,
ITfRange **  ppOut 
)

Definition at line 372 of file range.cpp.

373{
374 CRange *This = new(cicNoThrow) CRange(context, (TfAnchor)anchorStart, (TfAnchor)anchorEnd);
375 if (!This)
376 return E_OUTOFMEMORY;
377
378 *ppOut = static_cast<ITfRangeACP *>(This);
379 return S_OK;
380}
Definition: range.h:9
TfAnchor
Definition: msctf.idl:153
Definition: http.c:7252

Referenced by CContext::GetEnd(), CContext::GetSelection(), CContext::GetStart(), and CContext::InsertTextAtSelection().

◆ remove_Cookie()

LPVOID remove_Cookie ( DWORD  id)

Definition at line 231 of file msctf.cpp.

232{
233 UINT index = id - 1;
234
235 if (index >= id_last)
236 return NULL;
237
238 if (cookies[index].id == 0)
239 return NULL;
240
241 cookies[index].id = 0;
242 return cookies[index].data;
243}

Referenced by CContext::OnLockGranted(), unadvise_sink(), and CContext::~CContext().

◆ set_textservice_sink()

HRESULT set_textservice_sink ( TfClientId  tid,
REFCLSID  iid,
IUnknown sink 
)

Definition at line 517 of file msctf.cpp.

518{
519 AtsEntry *ats;
520
521 if (iid != IID_ITfKeyEventSink)
522 return E_NOINTERFACE;
523
525 {
526 if (ats->ats->tid == tid)
527 {
529 return S_OK;
530 }
531 }
532
533 return E_FAIL;
534}

Referenced by CThreadMgr::AdviseKeyEventSink(), and CThreadMgr::UnadviseKeyEventSink().

◆ TF_SELECTION_to_TS_SELECTION_ACP()

HRESULT TF_SELECTION_to_TS_SELECTION_ACP ( const TF_SELECTION *  tf,
TS_SELECTION_ACP tsAcp 
)

Definition at line 385 of file range.cpp.

386{
388}
static HRESULT TF_SELECTION_to_TS_SELECTION_ACP(const TF_SELECTION *tf, TS_SELECTION_ACP *tsAcp)
Definition: range.cpp:61
HFONT tf
Definition: icontest.c:17

Referenced by CContext::SetSelection().

◆ ThreadMgr_Constructor()

HRESULT ThreadMgr_Constructor ( IUnknown pUnkOuter,
IUnknown **  ppOut 
)

Definition at line 1388 of file threadmgr.cpp.

1389{
1390 return CThreadMgr::CreateInstance(pUnkOuter, (CThreadMgr **)ppOut);
1391}
static HRESULT CreateInstance(IUnknown *pUnkOuter, CThreadMgr **ppOut)
Definition: threadmgr.cpp:1212

Referenced by TF_CreateThreadMgr().

◆ ThreadMgr_OnDocumentMgrDestruction()

void ThreadMgr_OnDocumentMgrDestruction ( ITfThreadMgr tm,
ITfDocumentMgr mgr 
)

Definition at line 1394 of file threadmgr.cpp.

1395{
1396 CThreadMgr *This = static_cast<CThreadMgr *>(iface);
1397 This->OnDocumentMgrDestruction(mgr);
1398}

Referenced by CDocumentMgr::~CDocumentMgr().

◆ unadvise_sink()

HRESULT unadvise_sink ( DWORD  cookie)

Definition at line 286 of file msctf.cpp.

287{
289 if (!sink)
291
293 return S_OK;
294}
EXTERN_C LPVOID remove_Cookie(DWORD id)
Definition: msctf.cpp:231
#define CONNECT_E_NOCONNECTION
Definition: olectl.h:251

Referenced by CCompartment::UnadviseSink(), CContext::UnadviseSink(), CInputProcessorProfiles::UnadviseSink(), CThreadMgr::UnadviseSink(), and CDocumentMgr::UnadviseSink().

Variable Documentation

◆ g_dwTLSIndex

◆ g_globalCompartmentMgr

ITfCompartmentMgr* g_globalCompartmentMgr
extern

Definition at line 45 of file msctf.cpp.

Referenced by CThreadMgr::GetGlobalCompartment().

◆ g_processId

TfClientId g_processId
extern

Definition at line 44 of file msctf.cpp.

Referenced by CThreadMgr::ActivateEx(), and CDocumentMgr::CDocumentMgr().