ReactOS  0.4.14-dev-552-g2fad488
categorymgr.c File Reference
#include <stdarg.h>
#include "wine/debug.h"
#include "windef.h"
#include "winbase.h"
#include "winreg.h"
#include "winuser.h"
#include "shlwapi.h"
#include "winerror.h"
#include "objbase.h"
#include "msctf.h"
#include "msctf_internal.h"
Include dependency graph for categorymgr.c:

Go to the source code of this file.

Classes

struct  tagCategoryMgr
 

Macros

#define COBJMACROS
 

Typedefs

typedef struct tagCategoryMgr CategoryMgr
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (msctf)
 
static CategoryMgrimpl_from_ITfCategoryMgr (ITfCategoryMgr *iface)
 
static void CategoryMgr_Destructor (CategoryMgr *This)
 
static HRESULT WINAPI CategoryMgr_QueryInterface (ITfCategoryMgr *iface, REFIID iid, LPVOID *ppvOut)
 
static ULONG WINAPI CategoryMgr_AddRef (ITfCategoryMgr *iface)
 
static ULONG WINAPI CategoryMgr_Release (ITfCategoryMgr *iface)
 
static HRESULT WINAPI CategoryMgr_RegisterCategory (ITfCategoryMgr *iface, REFCLSID rclsid, REFGUID rcatid, REFGUID rguid)
 
static HRESULT WINAPI CategoryMgr_UnregisterCategory (ITfCategoryMgr *iface, REFCLSID rclsid, REFGUID rcatid, REFGUID rguid)
 
static HRESULT WINAPI CategoryMgr_EnumCategoriesInItem (ITfCategoryMgr *iface, REFGUID rguid, IEnumGUID **ppEnum)
 
static HRESULT WINAPI CategoryMgr_EnumItemsInCategory (ITfCategoryMgr *iface, REFGUID rcatid, IEnumGUID **ppEnum)
 
static HRESULT WINAPI CategoryMgr_FindClosestCategory (ITfCategoryMgr *iface, REFGUID rguid, GUID *pcatid, const GUID **ppcatidList, ULONG ulCount)
 
static HRESULT WINAPI CategoryMgr_RegisterGUIDDescription (ITfCategoryMgr *iface, REFCLSID rclsid, REFGUID rguid, const WCHAR *pchDesc, ULONG cch)
 
static HRESULT WINAPI CategoryMgr_UnregisterGUIDDescription (ITfCategoryMgr *iface, REFCLSID rclsid, REFGUID rguid)
 
static HRESULT WINAPI CategoryMgr_GetGUIDDescription (ITfCategoryMgr *iface, REFGUID rguid, BSTR *pbstrDesc)
 
static HRESULT WINAPI CategoryMgr_RegisterGUIDDWORD (ITfCategoryMgr *iface, REFCLSID rclsid, REFGUID rguid, DWORD dw)
 
static HRESULT WINAPI CategoryMgr_UnregisterGUIDDWORD (ITfCategoryMgr *iface, REFCLSID rclsid, REFGUID rguid)
 
static HRESULT WINAPI CategoryMgr_GetGUIDDWORD (ITfCategoryMgr *iface, REFGUID rguid, DWORD *pdw)
 
static HRESULT WINAPI CategoryMgr_RegisterGUID (ITfCategoryMgr *iface, REFGUID rguid, TfGuidAtom *pguidatom)
 
static HRESULT WINAPI CategoryMgr_GetGUID (ITfCategoryMgr *iface, TfGuidAtom guidatom, GUID *pguid)
 
static HRESULT WINAPI CategoryMgr_IsEqualTfGuidAtom (ITfCategoryMgr *iface, TfGuidAtom guidatom, REFGUID rguid, BOOL *pfEqual)
 
HRESULT CategoryMgr_Constructor (IUnknown *pUnkOuter, IUnknown **ppOut)
 

Variables

static const ITfCategoryMgrVtbl CategoryMgrVtbl
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 26 of file categorymgr.c.

Typedef Documentation

◆ CategoryMgr

Function Documentation

◆ CategoryMgr_AddRef()

static ULONG WINAPI CategoryMgr_AddRef ( ITfCategoryMgr iface)
static

Definition at line 79 of file categorymgr.c.

80 {
82  return InterlockedIncrement(&This->refCount);
83 }
#define InterlockedIncrement
Definition: armddk.h:53
static CategoryMgr * impl_from_ITfCategoryMgr(ITfCategoryMgr *iface)
Definition: categorymgr.c:48

◆ CategoryMgr_Constructor()

HRESULT CategoryMgr_Constructor ( IUnknown pUnkOuter,
IUnknown **  ppOut 
)

Definition at line 413 of file categorymgr.c.

414 {
415  CategoryMgr *This;
416  if (pUnkOuter)
417  return CLASS_E_NOAGGREGATION;
418 
420  if (This == NULL)
421  return E_OUTOFMEMORY;
422 
423  This->ITfCategoryMgr_iface.lpVtbl = &CategoryMgrVtbl;
424  This->refCount = 1;
425 
426  *ppOut = (IUnknown *)&This->ITfCategoryMgr_iface;
427  TRACE("returning %p\n", *ppOut);
428  return S_OK;
429 }
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define CLASS_E_NOAGGREGATION
Definition: winerror.h:2662
#define S_OK
Definition: intsafe.h:59
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
static const ITfCategoryMgrVtbl CategoryMgrVtbl
Definition: categorymgr.c:392

Referenced by add_active_textservice(), ClientId_GetClientId(), EnumTfLanguageProfiles_Constructor(), and InputProcessorProfiles_SetDefaultLanguageProfile().

◆ CategoryMgr_Destructor()

static void CategoryMgr_Destructor ( CategoryMgr This)
static

Definition at line 53 of file categorymgr.c.

54 {
55  TRACE("destroying %p\n", This);
57 }
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:403
#define HeapFree(x, y, z)
Definition: compat.h:402

Referenced by CategoryMgr_Release().

◆ CategoryMgr_EnumCategoriesInItem()

static HRESULT WINAPI CategoryMgr_EnumCategoriesInItem ( ITfCategoryMgr iface,
REFGUID  rguid,
IEnumGUID **  ppEnum 
)
static

Definition at line 183 of file categorymgr.c.

185 {
187  FIXME("STUB:(%p)\n",This);
188  return E_NOTIMPL;
189 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99
static CategoryMgr * impl_from_ITfCategoryMgr(ITfCategoryMgr *iface)
Definition: categorymgr.c:48

◆ CategoryMgr_EnumItemsInCategory()

static HRESULT WINAPI CategoryMgr_EnumItemsInCategory ( ITfCategoryMgr iface,
REFGUID  rcatid,
IEnumGUID **  ppEnum 
)
static

Definition at line 191 of file categorymgr.c.

193 {
195  FIXME("STUB:(%p)\n",This);
196  return E_NOTIMPL;
197 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99
static CategoryMgr * impl_from_ITfCategoryMgr(ITfCategoryMgr *iface)
Definition: categorymgr.c:48

◆ CategoryMgr_FindClosestCategory()

static HRESULT WINAPI CategoryMgr_FindClosestCategory ( ITfCategoryMgr iface,
REFGUID  rguid,
GUID pcatid,
const GUID **  ppcatidList,
ULONG  ulCount 
)
static

Definition at line 199 of file categorymgr.c.

201 {
202  static const WCHAR fmt[] = { '%','s','\\','%','s','\\','C','a','t','e','g','o','r','y','\\','I','t','e','m','\\','%','s',0};
203 
204  WCHAR fullkey[120];
205  WCHAR buf[39];
206  HKEY key;
207  HRESULT hr = S_FALSE;
208  INT index = 0;
210 
211  TRACE("(%p)\n",This);
212 
213  if (!pcatid || (ulCount && ppcatidList == NULL))
214  return E_INVALIDARG;
215 
216  StringFromGUID2(rguid, buf, 39);
218  *pcatid = GUID_NULL;
219 
220  if (RegOpenKeyExW(HKEY_LOCAL_MACHINE,fullkey, 0, KEY_READ, &key ) !=
222  return S_FALSE;
223 
224  while (1)
225  {
226  HRESULT hr2;
227  ULONG res;
228  GUID guid;
229  WCHAR catid[39];
230  DWORD cName;
231 
232  cName = 39;
233  res = RegEnumKeyExW(key, index, catid, &cName, NULL, NULL, NULL, NULL);
234  if (res != ERROR_SUCCESS && res != ERROR_MORE_DATA) break;
235  index ++;
236 
237  hr2 = CLSIDFromString(catid, &guid);
238  if (FAILED(hr2)) continue;
239 
240  if (ulCount)
241  {
242  ULONG j;
243  BOOL found = FALSE;
244  for (j = 0; j < ulCount; j++)
245  if (IsEqualGUID(&guid, ppcatidList[j]))
246  {
247  found = TRUE;
248  *pcatid = guid;
249  hr = S_OK;
250  break;
251  }
252  if (found) break;
253  }
254  else
255  {
256  *pcatid = guid;
257  hr = S_OK;
258  break;
259  }
260  }
261 
262  return hr;
263 }
const WCHAR szwSystemTIPKey[]
Definition: msctf.c:76
#define TRUE
Definition: types.h:120
#define ERROR_SUCCESS
Definition: deptool.c:10
HRESULT hr
Definition: shlfolder.c:183
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define KEY_READ
Definition: nt_native.h:1023
int32_t INT
Definition: typedefs.h:56
const GUID * guid
unsigned int BOOL
Definition: ntddk_ex.h:94
#define S_FALSE
Definition: winerror.h:2357
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
GUID catid
Definition: msctf.idl:608
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 GLint GLint j
Definition: glfuncs.h:250
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
#define swprintf(buf, format,...)
Definition: sprintf.c:56
INT WINAPI StringFromGUID2(REFGUID id, LPOLESTR str, INT cmax)
Definition: compobj.c:2434
unsigned long DWORD
Definition: ntddk_ex.h:95
HKEY key
Definition: reg.c:42
#define GUID_NULL
Definition: ks.h:106
#define ERROR_MORE_DATA
Definition: dderror.h:13
#define S_OK
Definition: intsafe.h:59
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
static CategoryMgr * impl_from_ITfCategoryMgr(ITfCategoryMgr *iface)
Definition: categorymgr.c:48
GLuint res
Definition: glext.h:9613
HRESULT WINAPI CLSIDFromString(LPCOLESTR idstr, LPCLSID id)
Definition: compobj.c:2338
unsigned int ULONG
Definition: retypes.h:1
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3366
LONG WINAPI RegEnumKeyExW(_In_ HKEY hKey, _In_ DWORD dwIndex, _Out_ LPWSTR lpName, _Inout_ LPDWORD lpcbName, _Reserved_ LPDWORD lpReserved, _Out_opt_ LPWSTR lpClass, _Inout_opt_ LPDWORD lpcbClass, _Out_opt_ PFILETIME lpftLastWriteTime)
Definition: reg.c:2527
Definition: dsound.c:943
Definition: path.c:42
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12

◆ CategoryMgr_GetGUID()

static HRESULT WINAPI CategoryMgr_GetGUID ( ITfCategoryMgr iface,
TfGuidAtom  guidatom,
GUID pguid 
)
static

Definition at line 353 of file categorymgr.c.

355 {
357 
358  TRACE("(%p) %i\n",This,guidatom);
359 
360  if (!pguid)
361  return E_INVALIDARG;
362 
363  *pguid = GUID_NULL;
364 
365  if (get_Cookie_magic(guidatom) == COOKIE_MAGIC_GUIDATOM)
366  *pguid = *((REFGUID)get_Cookie_data(guidatom));
367 
368  return S_OK;
369 }
#define REFGUID
Definition: guiddef.h:116
LPVOID get_Cookie_data(DWORD id)
Definition: msctf.c:246
DWORD get_Cookie_magic(DWORD id)
Definition: msctf.c:233
#define COOKIE_MAGIC_GUIDATOM
#define E_INVALIDARG
Definition: ddrawi.h:101
#define TRACE(s)
Definition: solgame.cpp:4
#define GUID_NULL
Definition: ks.h:106
#define S_OK
Definition: intsafe.h:59
static CategoryMgr * impl_from_ITfCategoryMgr(ITfCategoryMgr *iface)
Definition: categorymgr.c:48

◆ CategoryMgr_GetGUIDDescription()

static HRESULT WINAPI CategoryMgr_GetGUIDDescription ( ITfCategoryMgr iface,
REFGUID  rguid,
BSTR pbstrDesc 
)
static

Definition at line 282 of file categorymgr.c.

284 {
286  FIXME("STUB:(%p)\n",This);
287  return E_NOTIMPL;
288 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99
static CategoryMgr * impl_from_ITfCategoryMgr(ITfCategoryMgr *iface)
Definition: categorymgr.c:48

◆ CategoryMgr_GetGUIDDWORD()

static HRESULT WINAPI CategoryMgr_GetGUIDDWORD ( ITfCategoryMgr iface,
REFGUID  rguid,
DWORD pdw 
)
static

Definition at line 306 of file categorymgr.c.

308 {
310  FIXME("STUB:(%p)\n",This);
311  return E_NOTIMPL;
312 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99
static CategoryMgr * impl_from_ITfCategoryMgr(ITfCategoryMgr *iface)
Definition: categorymgr.c:48

◆ CategoryMgr_IsEqualTfGuidAtom()

static HRESULT WINAPI CategoryMgr_IsEqualTfGuidAtom ( ITfCategoryMgr iface,
TfGuidAtom  guidatom,
REFGUID  rguid,
BOOL pfEqual 
)
static

Definition at line 371 of file categorymgr.c.

373 {
375 
376  TRACE("(%p) %i %s %p\n",This,guidatom,debugstr_guid(rguid),pfEqual);
377 
378  if (!pfEqual)
379  return E_INVALIDARG;
380 
381  *pfEqual = FALSE;
382  if (get_Cookie_magic(guidatom) == COOKIE_MAGIC_GUIDATOM)
383  {
384  if (IsEqualGUID(rguid,get_Cookie_data(guidatom)))
385  *pfEqual = TRUE;
386  }
387 
388  return S_OK;
389 }
LPVOID get_Cookie_data(DWORD id)
Definition: msctf.c:246
#define TRUE
Definition: types.h:120
DWORD get_Cookie_magic(DWORD id)
Definition: msctf.c:233
#define COOKIE_MAGIC_GUIDATOM
#define E_INVALIDARG
Definition: ddrawi.h:101
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:59
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
static CategoryMgr * impl_from_ITfCategoryMgr(ITfCategoryMgr *iface)
Definition: categorymgr.c:48

◆ CategoryMgr_QueryInterface()

static HRESULT WINAPI CategoryMgr_QueryInterface ( ITfCategoryMgr iface,
REFIID  iid,
LPVOID ppvOut 
)
static

Definition at line 59 of file categorymgr.c.

60 {
62  *ppvOut = NULL;
63 
64  if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_ITfCategoryMgr))
65  {
66  *ppvOut = &This->ITfCategoryMgr_iface;
67  }
68 
69  if (*ppvOut)
70  {
71  ITfCategoryMgr_AddRef(iface);
72  return S_OK;
73  }
74 
75  WARN("unsupported interface: %s\n", debugstr_guid(iid));
76  return E_NOINTERFACE;
77 }
#define E_NOINTERFACE
Definition: winerror.h:2364
#define WARN(fmt,...)
Definition: debug.h:111
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_guid
Definition: kernel32.h:35
const GUID IID_IUnknown
#define S_OK
Definition: intsafe.h:59
static CategoryMgr * impl_from_ITfCategoryMgr(ITfCategoryMgr *iface)
Definition: categorymgr.c:48
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95

◆ CategoryMgr_RegisterCategory()

static HRESULT WINAPI CategoryMgr_RegisterCategory ( ITfCategoryMgr iface,
REFCLSID  rclsid,
REFGUID  rcatid,
REFGUID  rguid 
)
static

Definition at line 100 of file categorymgr.c.

102 {
103  WCHAR fullkey[110];
104  WCHAR buf[39];
105  WCHAR buf2[39];
106  ULONG res;
107  HKEY tipkey,catkey,itmkey;
109 
110  static const WCHAR ctg[] = {'C','a','t','e','g','o','r','y',0};
111  static const WCHAR itm[] = {'I','t','e','m',0};
112  static const WCHAR fmt[] = {'%','s','\\','%','s',0};
113  static const WCHAR fmt2[] = {'%','s','\\','%','s','\\','%','s','\\','%','s',0};
114 
115  TRACE("(%p) %s %s %s\n",This,debugstr_guid(rclsid), debugstr_guid(rcatid), debugstr_guid(rguid));
116 
117  StringFromGUID2(rclsid, buf, 39);
118  swprintf(fullkey,fmt,szwSystemTIPKey,buf);
119 
121  &tipkey ) != ERROR_SUCCESS)
122  return E_FAIL;
123 
124  StringFromGUID2(rcatid, buf, 39);
125  StringFromGUID2(rguid, buf2, 39);
126  swprintf(fullkey,fmt2,ctg,ctg,buf,buf2);
127 
128  res = RegCreateKeyExW(tipkey, fullkey, 0, NULL, 0, KEY_READ | KEY_WRITE,
129  NULL, &catkey, NULL);
130  RegCloseKey(catkey);
131 
132  if (!res)
133  {
134  swprintf(fullkey,fmt2,ctg,itm,buf2,buf);
135  res = RegCreateKeyExW(tipkey, fullkey, 0, NULL, 0, KEY_READ | KEY_WRITE,
136  NULL, &itmkey, NULL);
137 
138  RegCloseKey(itmkey);
139  }
140 
141  RegCloseKey(tipkey);
142 
143  if (!res)
144  return S_OK;
145  else
146  return E_FAIL;
147 }
const WCHAR szwSystemTIPKey[]
Definition: msctf.c:76
#define ERROR_SUCCESS
Definition: deptool.c:10
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define KEY_READ
Definition: nt_native.h:1023
#define E_FAIL
Definition: ddrawi.h:102
LONG WINAPI RegCreateKeyExW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey, _In_ DWORD Reserved, _In_opt_ LPWSTR lpClass, _In_ DWORD dwOptions, _In_ REGSAM samDesired, _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, _Out_ PHKEY phkResult, _Out_opt_ LPDWORD lpdwDisposition)
Definition: reg.c:1091
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_guid
Definition: kernel32.h:35
#define KEY_WRITE
Definition: nt_native.h:1031
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define swprintf(buf, format,...)
Definition: sprintf.c:56
INT WINAPI StringFromGUID2(REFGUID id, LPOLESTR str, INT cmax)
Definition: compobj.c:2434
#define S_OK
Definition: intsafe.h:59
static CategoryMgr * impl_from_ITfCategoryMgr(ITfCategoryMgr *iface)
Definition: categorymgr.c:48
GLuint res
Definition: glext.h:9613
unsigned int ULONG
Definition: retypes.h:1
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3366
Definition: dsound.c:943
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12

◆ CategoryMgr_RegisterGUID()

static HRESULT WINAPI CategoryMgr_RegisterGUID ( ITfCategoryMgr iface,
REFGUID  rguid,
TfGuidAtom pguidatom 
)
static

Definition at line 314 of file categorymgr.c.

317 {
318  DWORD index;
319  GUID *checkguid;
320  DWORD id;
322 
323  TRACE("(%p) %s %p\n",This,debugstr_guid(rguid),pguidatom);
324 
325  if (!pguidatom)
326  return E_INVALIDARG;
327 
328  index = 0;
329  do {
331  if (id && IsEqualGUID(rguid,get_Cookie_data(id)))
332  {
333  *pguidatom = id;
334  return S_OK;
335  }
336  } while(id);
337 
338  checkguid = HeapAlloc(GetProcessHeap(),0,sizeof(GUID));
339  *checkguid = *rguid;
340  id = generate_Cookie(COOKIE_MAGIC_GUIDATOM,checkguid);
341 
342  if (!id)
343  {
344  HeapFree(GetProcessHeap(),0,checkguid);
345  return E_FAIL;
346  }
347 
348  *pguidatom = id;
349 
350  return S_OK;
351 }
LPVOID get_Cookie_data(DWORD id)
Definition: msctf.c:246
DWORD enumerate_Cookie(DWORD magic, DWORD *index)
Definition: msctf.c:273
#define E_FAIL
Definition: ddrawi.h:102
#define COOKIE_MAGIC_GUIDATOM
#define E_INVALIDARG
Definition: ddrawi.h:101
GLuint index
Definition: glext.h:6031
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
unsigned long DWORD
Definition: ntddk_ex.h:95
#define index(s, c)
Definition: various.h:29
#define S_OK
Definition: intsafe.h:59
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
static CategoryMgr * impl_from_ITfCategoryMgr(ITfCategoryMgr *iface)
Definition: categorymgr.c:48
GLenum GLuint id
Definition: glext.h:5579
#define HeapFree(x, y, z)
Definition: compat.h:402
DWORD generate_Cookie(DWORD magic, LPVOID data)
Definition: msctf.c:189

◆ CategoryMgr_RegisterGUIDDescription()

static HRESULT WINAPI CategoryMgr_RegisterGUIDDescription ( ITfCategoryMgr iface,
REFCLSID  rclsid,
REFGUID  rguid,
const WCHAR pchDesc,
ULONG  cch 
)
static

Definition at line 265 of file categorymgr.c.

268 {
270  FIXME("STUB:(%p)\n",This);
271  return E_NOTIMPL;
272 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99
static CategoryMgr * impl_from_ITfCategoryMgr(ITfCategoryMgr *iface)
Definition: categorymgr.c:48

◆ CategoryMgr_RegisterGUIDDWORD()

static HRESULT WINAPI CategoryMgr_RegisterGUIDDWORD ( ITfCategoryMgr iface,
REFCLSID  rclsid,
REFGUID  rguid,
DWORD  dw 
)
static

Definition at line 290 of file categorymgr.c.

292 {
294  FIXME("STUB:(%p)\n",This);
295  return E_NOTIMPL;
296 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99
static CategoryMgr * impl_from_ITfCategoryMgr(ITfCategoryMgr *iface)
Definition: categorymgr.c:48

◆ CategoryMgr_Release()

static ULONG WINAPI CategoryMgr_Release ( ITfCategoryMgr iface)
static

Definition at line 85 of file categorymgr.c.

86 {
88  ULONG ret;
89 
90  ret = InterlockedDecrement(&This->refCount);
91  if (ret == 0)
93  return ret;
94 }
static void CategoryMgr_Destructor(CategoryMgr *This)
Definition: categorymgr.c:53
int ret
#define InterlockedDecrement
Definition: armddk.h:52
static CategoryMgr * impl_from_ITfCategoryMgr(ITfCategoryMgr *iface)
Definition: categorymgr.c:48
unsigned int ULONG
Definition: retypes.h:1

◆ CategoryMgr_UnregisterCategory()

static HRESULT WINAPI CategoryMgr_UnregisterCategory ( ITfCategoryMgr iface,
REFCLSID  rclsid,
REFGUID  rcatid,
REFGUID  rguid 
)
static

Definition at line 149 of file categorymgr.c.

151 {
152  WCHAR fullkey[110];
153  WCHAR buf[39];
154  WCHAR buf2[39];
155  HKEY tipkey;
157 
158  static const WCHAR ctg[] = {'C','a','t','e','g','o','r','y',0};
159  static const WCHAR itm[] = {'I','t','e','m',0};
160  static const WCHAR fmt[] = {'%','s','\\','%','s',0};
161  static const WCHAR fmt2[] = {'%','s','\\','%','s','\\','%','s','\\','%','s',0};
162 
163  TRACE("(%p) %s %s %s\n",This,debugstr_guid(rclsid), debugstr_guid(rcatid), debugstr_guid(rguid));
164 
165  StringFromGUID2(rclsid, buf, 39);
166  swprintf(fullkey,fmt,szwSystemTIPKey,buf);
167 
169  &tipkey ) != ERROR_SUCCESS)
170  return E_FAIL;
171 
172  StringFromGUID2(rcatid, buf, 39);
173  StringFromGUID2(rguid, buf2, 39);
174  swprintf(fullkey,fmt2,ctg,ctg,buf,buf2);
175  RegDeleteTreeW(tipkey, fullkey);
176  swprintf(fullkey,fmt2,ctg,itm,buf2,buf);
177  RegDeleteTreeW(tipkey, fullkey);
178 
179  RegCloseKey(tipkey);
180  return S_OK;
181 }
const WCHAR szwSystemTIPKey[]
Definition: msctf.c:76
#define ERROR_SUCCESS
Definition: deptool.c:10
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define KEY_READ
Definition: nt_native.h:1023
#define E_FAIL
Definition: ddrawi.h:102
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
#define debugstr_guid
Definition: kernel32.h:35
#define KEY_WRITE
Definition: nt_native.h:1031
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define swprintf(buf, format,...)
Definition: sprintf.c:56
INT WINAPI StringFromGUID2(REFGUID id, LPOLESTR str, INT cmax)
Definition: compobj.c:2434
LSTATUS WINAPI RegDeleteTreeW(HKEY hKey, LPCWSTR lpszSubKey)
Definition: reg.c:1746
#define S_OK
Definition: intsafe.h:59
static CategoryMgr * impl_from_ITfCategoryMgr(ITfCategoryMgr *iface)
Definition: categorymgr.c:48
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3366
Definition: dsound.c:943
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12

◆ CategoryMgr_UnregisterGUIDDescription()

static HRESULT WINAPI CategoryMgr_UnregisterGUIDDescription ( ITfCategoryMgr iface,
REFCLSID  rclsid,
REFGUID  rguid 
)
static

Definition at line 274 of file categorymgr.c.

276 {
278  FIXME("STUB:(%p)\n",This);
279  return E_NOTIMPL;
280 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99
static CategoryMgr * impl_from_ITfCategoryMgr(ITfCategoryMgr *iface)
Definition: categorymgr.c:48

◆ CategoryMgr_UnregisterGUIDDWORD()

static HRESULT WINAPI CategoryMgr_UnregisterGUIDDWORD ( ITfCategoryMgr iface,
REFCLSID  rclsid,
REFGUID  rguid 
)
static

Definition at line 298 of file categorymgr.c.

300 {
302  FIXME("STUB:(%p)\n",This);
303  return E_NOTIMPL;
304 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99
static CategoryMgr * impl_from_ITfCategoryMgr(ITfCategoryMgr *iface)
Definition: categorymgr.c:48

◆ impl_from_ITfCategoryMgr()

static CategoryMgr* impl_from_ITfCategoryMgr ( ITfCategoryMgr iface)
inlinestatic

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( msctf  )

Variable Documentation

◆ CategoryMgrVtbl

const ITfCategoryMgrVtbl CategoryMgrVtbl
static
Initial value:
=
{
}
static HRESULT WINAPI CategoryMgr_GetGUIDDescription(ITfCategoryMgr *iface, REFGUID rguid, BSTR *pbstrDesc)
Definition: categorymgr.c:282
static HRESULT WINAPI CategoryMgr_EnumItemsInCategory(ITfCategoryMgr *iface, REFGUID rcatid, IEnumGUID **ppEnum)
Definition: categorymgr.c:191
static HRESULT WINAPI CategoryMgr_GetGUIDDWORD(ITfCategoryMgr *iface, REFGUID rguid, DWORD *pdw)
Definition: categorymgr.c:306
static HRESULT WINAPI CategoryMgr_IsEqualTfGuidAtom(ITfCategoryMgr *iface, TfGuidAtom guidatom, REFGUID rguid, BOOL *pfEqual)
Definition: categorymgr.c:371
static HRESULT WINAPI CategoryMgr_QueryInterface(ITfCategoryMgr *iface, REFIID iid, LPVOID *ppvOut)
Definition: categorymgr.c:59
static HRESULT WINAPI CategoryMgr_RegisterGUIDDescription(ITfCategoryMgr *iface, REFCLSID rclsid, REFGUID rguid, const WCHAR *pchDesc, ULONG cch)
Definition: categorymgr.c:265
static HRESULT WINAPI CategoryMgr_GetGUID(ITfCategoryMgr *iface, TfGuidAtom guidatom, GUID *pguid)
Definition: categorymgr.c:353
static HRESULT WINAPI CategoryMgr_UnregisterGUIDDescription(ITfCategoryMgr *iface, REFCLSID rclsid, REFGUID rguid)
Definition: categorymgr.c:274
static ULONG WINAPI CategoryMgr_Release(ITfCategoryMgr *iface)
Definition: categorymgr.c:85
static HRESULT WINAPI CategoryMgr_FindClosestCategory(ITfCategoryMgr *iface, REFGUID rguid, GUID *pcatid, const GUID **ppcatidList, ULONG ulCount)
Definition: categorymgr.c:199
static HRESULT WINAPI CategoryMgr_RegisterCategory(ITfCategoryMgr *iface, REFCLSID rclsid, REFGUID rcatid, REFGUID rguid)
Definition: categorymgr.c:100
static HRESULT WINAPI CategoryMgr_RegisterGUID(ITfCategoryMgr *iface, REFGUID rguid, TfGuidAtom *pguidatom)
Definition: categorymgr.c:314
static HRESULT WINAPI CategoryMgr_UnregisterGUIDDWORD(ITfCategoryMgr *iface, REFCLSID rclsid, REFGUID rguid)
Definition: categorymgr.c:298
static HRESULT WINAPI CategoryMgr_EnumCategoriesInItem(ITfCategoryMgr *iface, REFGUID rguid, IEnumGUID **ppEnum)
Definition: categorymgr.c:183
static HRESULT WINAPI CategoryMgr_RegisterGUIDDWORD(ITfCategoryMgr *iface, REFCLSID rclsid, REFGUID rguid, DWORD dw)
Definition: categorymgr.c:290
static ULONG WINAPI CategoryMgr_AddRef(ITfCategoryMgr *iface)
Definition: categorymgr.c:79
static HRESULT WINAPI CategoryMgr_UnregisterCategory(ITfCategoryMgr *iface, REFCLSID rclsid, REFGUID rcatid, REFGUID rguid)
Definition: categorymgr.c:149

Definition at line 392 of file categorymgr.c.

Referenced by CategoryMgr_Constructor().