* Sync with Wine 1.7.17.
CORE-8080

svn path=/trunk/; revision=62915
This commit is contained in:
Amine Khaldi 2014-04-23 14:32:35 +00:00
parent 369724daea
commit c786664e29
13 changed files with 464 additions and 435 deletions

View file

@ -43,7 +43,7 @@ static HRESULT WINAPI CategoryMgr_QueryInterface(ITfCategoryMgr *iface, REFIID i
if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_ITfCategoryMgr)) if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_ITfCategoryMgr))
{ {
*ppvOut = This; *ppvOut = &This->ITfCategoryMgr_iface;
} }
if (*ppvOut) if (*ppvOut)
@ -371,12 +371,11 @@ static HRESULT WINAPI CategoryMgr_IsEqualTfGuidAtom ( ITfCategoryMgr *iface,
} }
static const ITfCategoryMgrVtbl CategoryMgr_CategoryMgrVtbl = static const ITfCategoryMgrVtbl CategoryMgrVtbl =
{ {
CategoryMgr_QueryInterface, CategoryMgr_QueryInterface,
CategoryMgr_AddRef, CategoryMgr_AddRef,
CategoryMgr_Release, CategoryMgr_Release,
CategoryMgr_RegisterCategory, CategoryMgr_RegisterCategory,
CategoryMgr_UnregisterCategory, CategoryMgr_UnregisterCategory,
CategoryMgr_EnumCategoriesInItem, CategoryMgr_EnumCategoriesInItem,
@ -403,10 +402,10 @@ HRESULT CategoryMgr_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut)
if (This == NULL) if (This == NULL)
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
This->ITfCategoryMgr_iface.lpVtbl = &CategoryMgr_CategoryMgrVtbl; This->ITfCategoryMgr_iface.lpVtbl = &CategoryMgrVtbl;
This->refCount = 1; This->refCount = 1;
TRACE("returning %p\n", This); *ppOut = (IUnknown *)&This->ITfCategoryMgr_iface;
*ppOut = (IUnknown *)This; TRACE("returning %p\n", *ppOut);
return S_OK; return S_OK;
} }

View file

@ -30,7 +30,7 @@ typedef struct tagCompartmentValue {
} CompartmentValue; } CompartmentValue;
typedef struct tagCompartmentMgr { typedef struct tagCompartmentMgr {
const ITfCompartmentMgrVtbl *CompartmentMgrVtbl; ITfCompartmentMgr ITfCompartmentMgr_iface;
LONG refCount; LONG refCount;
IUnknown *pUnkOuter; IUnknown *pUnkOuter;
@ -39,7 +39,7 @@ typedef struct tagCompartmentMgr {
} CompartmentMgr; } CompartmentMgr;
typedef struct tagCompartmentEnumGuid { typedef struct tagCompartmentEnumGuid {
const IEnumGUIDVtbl *Vtbl; IEnumGUID IEnumGUID_iface;
LONG refCount; LONG refCount;
struct list *values; struct list *values;
@ -56,8 +56,8 @@ typedef struct tagCompartmentSink {
} CompartmentSink; } CompartmentSink;
typedef struct tagCompartment { typedef struct tagCompartment {
const ITfCompartmentVtbl *Vtbl; ITfCompartment ITfCompartment_iface;
const ITfSourceVtbl *SourceVtbl; ITfSource ITfSource_iface;
LONG refCount; LONG refCount;
/* Only VT_I4, VT_UNKNOWN and VT_BSTR data types are allowed */ /* Only VT_I4, VT_UNKNOWN and VT_BSTR data types are allowed */
@ -69,14 +69,29 @@ typedef struct tagCompartment {
static HRESULT CompartmentEnumGuid_Constructor(struct list* values, IEnumGUID **ppOut); static HRESULT CompartmentEnumGuid_Constructor(struct list* values, IEnumGUID **ppOut);
static HRESULT Compartment_Constructor(CompartmentValue *value, ITfCompartment **ppOut); static HRESULT Compartment_Constructor(CompartmentValue *value, ITfCompartment **ppOut);
static inline Compartment *impl_from_ITfSourceVtbl(ITfSource *iface) static inline CompartmentMgr *impl_from_ITfCompartmentMgr(ITfCompartmentMgr *iface)
{ {
return (Compartment *)((char *)iface - FIELD_OFFSET(Compartment,SourceVtbl)); return CONTAINING_RECORD(iface, CompartmentMgr, ITfCompartmentMgr_iface);
}
static inline Compartment *impl_from_ITfCompartment(ITfCompartment *iface)
{
return CONTAINING_RECORD(iface, Compartment, ITfCompartment_iface);
}
static inline Compartment *impl_from_ITfSource(ITfSource *iface)
{
return CONTAINING_RECORD(iface, Compartment, ITfSource_iface);
}
static inline CompartmentEnumGuid *impl_from_IEnumGUID(IEnumGUID *iface)
{
return CONTAINING_RECORD(iface, CompartmentEnumGuid, IEnumGUID_iface);
} }
HRESULT CompartmentMgr_Destructor(ITfCompartmentMgr *iface) HRESULT CompartmentMgr_Destructor(ITfCompartmentMgr *iface)
{ {
CompartmentMgr *This = (CompartmentMgr *)iface; CompartmentMgr *This = impl_from_ITfCompartmentMgr(iface);
struct list *cursor, *cursor2; struct list *cursor, *cursor2;
LIST_FOR_EACH_SAFE(cursor, cursor2, &This->values) LIST_FOR_EACH_SAFE(cursor, cursor2, &This->values)
@ -96,16 +111,16 @@ HRESULT CompartmentMgr_Destructor(ITfCompartmentMgr *iface)
*****************************************************/ *****************************************************/
static HRESULT WINAPI CompartmentMgr_QueryInterface(ITfCompartmentMgr *iface, REFIID iid, LPVOID *ppvOut) static HRESULT WINAPI CompartmentMgr_QueryInterface(ITfCompartmentMgr *iface, REFIID iid, LPVOID *ppvOut)
{ {
CompartmentMgr *This = (CompartmentMgr *)iface; CompartmentMgr *This = impl_from_ITfCompartmentMgr(iface);
if (This->pUnkOuter) if (This->pUnkOuter)
return IUnknown_QueryInterface(This->pUnkOuter, iid, *ppvOut); return IUnknown_QueryInterface(This->pUnkOuter, iid, ppvOut);
else else
{ {
*ppvOut = NULL; *ppvOut = NULL;
if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_ITfCompartmentMgr)) if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_ITfCompartmentMgr))
{ {
*ppvOut = This; *ppvOut = &This->ITfCompartmentMgr_iface;
} }
if (*ppvOut) if (*ppvOut)
@ -121,7 +136,7 @@ static HRESULT WINAPI CompartmentMgr_QueryInterface(ITfCompartmentMgr *iface, RE
static ULONG WINAPI CompartmentMgr_AddRef(ITfCompartmentMgr *iface) static ULONG WINAPI CompartmentMgr_AddRef(ITfCompartmentMgr *iface)
{ {
CompartmentMgr *This = (CompartmentMgr *)iface; CompartmentMgr *This = impl_from_ITfCompartmentMgr(iface);
if (This->pUnkOuter) if (This->pUnkOuter)
return IUnknown_AddRef(This->pUnkOuter); return IUnknown_AddRef(This->pUnkOuter);
else else
@ -130,7 +145,7 @@ static ULONG WINAPI CompartmentMgr_AddRef(ITfCompartmentMgr *iface)
static ULONG WINAPI CompartmentMgr_Release(ITfCompartmentMgr *iface) static ULONG WINAPI CompartmentMgr_Release(ITfCompartmentMgr *iface)
{ {
CompartmentMgr *This = (CompartmentMgr *)iface; CompartmentMgr *This = impl_from_ITfCompartmentMgr(iface);
if (This->pUnkOuter) if (This->pUnkOuter)
return IUnknown_Release(This->pUnkOuter); return IUnknown_Release(This->pUnkOuter);
else else
@ -147,7 +162,7 @@ static ULONG WINAPI CompartmentMgr_Release(ITfCompartmentMgr *iface)
static HRESULT WINAPI CompartmentMgr_GetCompartment(ITfCompartmentMgr *iface, static HRESULT WINAPI CompartmentMgr_GetCompartment(ITfCompartmentMgr *iface,
REFGUID rguid, ITfCompartment **ppcomp) REFGUID rguid, ITfCompartment **ppcomp)
{ {
CompartmentMgr *This = (CompartmentMgr *)iface; CompartmentMgr *This = impl_from_ITfCompartmentMgr(iface);
CompartmentValue* value; CompartmentValue* value;
struct list *cursor; struct list *cursor;
HRESULT hr; HRESULT hr;
@ -186,8 +201,9 @@ static HRESULT WINAPI CompartmentMgr_GetCompartment(ITfCompartmentMgr *iface,
static HRESULT WINAPI CompartmentMgr_ClearCompartment(ITfCompartmentMgr *iface, static HRESULT WINAPI CompartmentMgr_ClearCompartment(ITfCompartmentMgr *iface,
TfClientId tid, REFGUID rguid) TfClientId tid, REFGUID rguid)
{ {
CompartmentMgr *This = impl_from_ITfCompartmentMgr(iface);
struct list *cursor; struct list *cursor;
CompartmentMgr *This = (CompartmentMgr *)iface;
TRACE("(%p) %i %s\n",This,tid,debugstr_guid(rguid)); TRACE("(%p) %i %s\n",This,tid,debugstr_guid(rguid));
LIST_FOR_EACH(cursor, &This->values) LIST_FOR_EACH(cursor, &This->values)
@ -210,19 +226,19 @@ static HRESULT WINAPI CompartmentMgr_ClearCompartment(ITfCompartmentMgr *iface,
static HRESULT WINAPI CompartmentMgr_EnumCompartments(ITfCompartmentMgr *iface, static HRESULT WINAPI CompartmentMgr_EnumCompartments(ITfCompartmentMgr *iface,
IEnumGUID **ppEnum) IEnumGUID **ppEnum)
{ {
CompartmentMgr *This = (CompartmentMgr *)iface; CompartmentMgr *This = impl_from_ITfCompartmentMgr(iface);
TRACE("(%p) %p\n",This,ppEnum); TRACE("(%p) %p\n",This,ppEnum);
if (!ppEnum) if (!ppEnum)
return E_INVALIDARG; return E_INVALIDARG;
return CompartmentEnumGuid_Constructor(&This->values, ppEnum); return CompartmentEnumGuid_Constructor(&This->values, ppEnum);
} }
static const ITfCompartmentMgrVtbl CompartmentMgr_CompartmentMgrVtbl = static const ITfCompartmentMgrVtbl CompartmentMgrVtbl =
{ {
CompartmentMgr_QueryInterface, CompartmentMgr_QueryInterface,
CompartmentMgr_AddRef, CompartmentMgr_AddRef,
CompartmentMgr_Release, CompartmentMgr_Release,
CompartmentMgr_GetCompartment, CompartmentMgr_GetCompartment,
CompartmentMgr_ClearCompartment, CompartmentMgr_ClearCompartment,
CompartmentMgr_EnumCompartments CompartmentMgr_EnumCompartments
@ -242,20 +258,20 @@ HRESULT CompartmentMgr_Constructor(IUnknown *pUnkOuter, REFIID riid, IUnknown **
if (This == NULL) if (This == NULL)
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
This->CompartmentMgrVtbl = &CompartmentMgr_CompartmentMgrVtbl; This->ITfCompartmentMgr_iface.lpVtbl = &CompartmentMgrVtbl;
This->pUnkOuter = pUnkOuter; This->pUnkOuter = pUnkOuter;
list_init(&This->values); list_init(&This->values);
if (pUnkOuter) if (pUnkOuter)
{ {
TRACE("returning %p\n", This); *ppOut = (IUnknown*)&This->ITfCompartmentMgr_iface;
*ppOut = (IUnknown*)This; TRACE("returning %p\n", *ppOut);
return S_OK; return S_OK;
} }
else else
{ {
HRESULT hr; HRESULT hr;
hr = IUnknown_QueryInterface((IUnknown*)This, riid, (LPVOID*)ppOut); hr = ITfCompartmentMgr_QueryInterface(&This->ITfCompartmentMgr_iface, riid, (void**)ppOut);
if (FAILED(hr)) if (FAILED(hr))
HeapFree(GetProcessHeap(),0,This); HeapFree(GetProcessHeap(),0,This);
return hr; return hr;
@ -273,12 +289,12 @@ static void CompartmentEnumGuid_Destructor(CompartmentEnumGuid *This)
static HRESULT WINAPI CompartmentEnumGuid_QueryInterface(IEnumGUID *iface, REFIID iid, LPVOID *ppvOut) static HRESULT WINAPI CompartmentEnumGuid_QueryInterface(IEnumGUID *iface, REFIID iid, LPVOID *ppvOut)
{ {
CompartmentEnumGuid *This = (CompartmentEnumGuid *)iface; CompartmentEnumGuid *This = impl_from_IEnumGUID(iface);
*ppvOut = NULL; *ppvOut = NULL;
if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_IEnumGUID)) if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_IEnumGUID))
{ {
*ppvOut = This; *ppvOut = &This->IEnumGUID_iface;
} }
if (*ppvOut) if (*ppvOut)
@ -293,13 +309,13 @@ static HRESULT WINAPI CompartmentEnumGuid_QueryInterface(IEnumGUID *iface, REFII
static ULONG WINAPI CompartmentEnumGuid_AddRef(IEnumGUID *iface) static ULONG WINAPI CompartmentEnumGuid_AddRef(IEnumGUID *iface)
{ {
CompartmentEnumGuid *This = (CompartmentEnumGuid*)iface; CompartmentEnumGuid *This = impl_from_IEnumGUID(iface);
return InterlockedIncrement(&This->refCount); return InterlockedIncrement(&This->refCount);
} }
static ULONG WINAPI CompartmentEnumGuid_Release(IEnumGUID *iface) static ULONG WINAPI CompartmentEnumGuid_Release(IEnumGUID *iface)
{ {
CompartmentEnumGuid *This = (CompartmentEnumGuid *)iface; CompartmentEnumGuid *This = impl_from_IEnumGUID(iface);
ULONG ret; ULONG ret;
ret = InterlockedDecrement(&This->refCount); ret = InterlockedDecrement(&This->refCount);
@ -311,10 +327,10 @@ static ULONG WINAPI CompartmentEnumGuid_Release(IEnumGUID *iface)
/***************************************************** /*****************************************************
* IEnumGuid functions * IEnumGuid functions
*****************************************************/ *****************************************************/
static HRESULT WINAPI CompartmentEnumGuid_Next( LPENUMGUID iface, static HRESULT WINAPI CompartmentEnumGuid_Next(IEnumGUID *iface,
ULONG celt, GUID *rgelt, ULONG *pceltFetched) ULONG celt, GUID *rgelt, ULONG *pceltFetched)
{ {
CompartmentEnumGuid *This = (CompartmentEnumGuid *)iface; CompartmentEnumGuid *This = impl_from_IEnumGUID(iface);
ULONG fetched = 0; ULONG fetched = 0;
TRACE("(%p)\n",This); TRACE("(%p)\n",This);
@ -338,27 +354,27 @@ static HRESULT WINAPI CompartmentEnumGuid_Next( LPENUMGUID iface,
return fetched == celt ? S_OK : S_FALSE; return fetched == celt ? S_OK : S_FALSE;
} }
static HRESULT WINAPI CompartmentEnumGuid_Skip( LPENUMGUID iface, ULONG celt) static HRESULT WINAPI CompartmentEnumGuid_Skip(IEnumGUID *iface, ULONG celt)
{ {
CompartmentEnumGuid *This = (CompartmentEnumGuid *)iface; CompartmentEnumGuid *This = impl_from_IEnumGUID(iface);
TRACE("(%p)\n",This); TRACE("(%p)\n",This);
This->cursor = list_next(This->values,This->cursor); This->cursor = list_next(This->values,This->cursor);
return S_OK; return S_OK;
} }
static HRESULT WINAPI CompartmentEnumGuid_Reset( LPENUMGUID iface) static HRESULT WINAPI CompartmentEnumGuid_Reset(IEnumGUID *iface)
{ {
CompartmentEnumGuid *This = (CompartmentEnumGuid *)iface; CompartmentEnumGuid *This = impl_from_IEnumGUID(iface);
TRACE("(%p)\n",This); TRACE("(%p)\n",This);
This->cursor = list_head(This->values); This->cursor = list_head(This->values);
return S_OK; return S_OK;
} }
static HRESULT WINAPI CompartmentEnumGuid_Clone( LPENUMGUID iface, static HRESULT WINAPI CompartmentEnumGuid_Clone(IEnumGUID *iface,
IEnumGUID **ppenum) IEnumGUID **ppenum)
{ {
CompartmentEnumGuid *This = (CompartmentEnumGuid *)iface; CompartmentEnumGuid *This = impl_from_IEnumGUID(iface);
HRESULT res; HRESULT res;
TRACE("(%p)\n",This); TRACE("(%p)\n",This);
@ -368,17 +384,17 @@ static HRESULT WINAPI CompartmentEnumGuid_Clone( LPENUMGUID iface,
res = CompartmentEnumGuid_Constructor(This->values, ppenum); res = CompartmentEnumGuid_Constructor(This->values, ppenum);
if (SUCCEEDED(res)) if (SUCCEEDED(res))
{ {
CompartmentEnumGuid *new_This = (CompartmentEnumGuid *)*ppenum; CompartmentEnumGuid *new_This = impl_from_IEnumGUID(*ppenum);
new_This->cursor = This->cursor; new_This->cursor = This->cursor;
} }
return res; return res;
} }
static const IEnumGUIDVtbl IEnumGUID_Vtbl ={ static const IEnumGUIDVtbl EnumGUIDVtbl =
{
CompartmentEnumGuid_QueryInterface, CompartmentEnumGuid_QueryInterface,
CompartmentEnumGuid_AddRef, CompartmentEnumGuid_AddRef,
CompartmentEnumGuid_Release, CompartmentEnumGuid_Release,
CompartmentEnumGuid_Next, CompartmentEnumGuid_Next,
CompartmentEnumGuid_Skip, CompartmentEnumGuid_Skip,
CompartmentEnumGuid_Reset, CompartmentEnumGuid_Reset,
@ -393,14 +409,14 @@ static HRESULT CompartmentEnumGuid_Constructor(struct list *values, IEnumGUID **
if (This == NULL) if (This == NULL)
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
This->Vtbl= &IEnumGUID_Vtbl; This->IEnumGUID_iface.lpVtbl= &EnumGUIDVtbl;
This->refCount = 1; This->refCount = 1;
This->values = values; This->values = values;
This->cursor = list_head(values); This->cursor = list_head(values);
TRACE("returning %p\n", This); *ppOut = &This->IEnumGUID_iface;
*ppOut = (IEnumGUID*)This; TRACE("returning %p\n", *ppOut);
return S_OK; return S_OK;
} }
@ -429,16 +445,17 @@ static void Compartment_Destructor(Compartment *This)
static HRESULT WINAPI Compartment_QueryInterface(ITfCompartment *iface, REFIID iid, LPVOID *ppvOut) static HRESULT WINAPI Compartment_QueryInterface(ITfCompartment *iface, REFIID iid, LPVOID *ppvOut)
{ {
Compartment *This = (Compartment *)iface; Compartment *This = impl_from_ITfCompartment(iface);
*ppvOut = NULL; *ppvOut = NULL;
if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_ITfCompartment)) if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_ITfCompartment))
{ {
*ppvOut = This; *ppvOut = &This->ITfCompartment_iface;
} }
else if (IsEqualIID(iid, &IID_ITfSource)) else if (IsEqualIID(iid, &IID_ITfSource))
{ {
*ppvOut = &This->SourceVtbl; *ppvOut = &This->ITfSource_iface;
} }
if (*ppvOut) if (*ppvOut)
@ -453,13 +470,13 @@ static HRESULT WINAPI Compartment_QueryInterface(ITfCompartment *iface, REFIID i
static ULONG WINAPI Compartment_AddRef(ITfCompartment *iface) static ULONG WINAPI Compartment_AddRef(ITfCompartment *iface)
{ {
Compartment *This = (Compartment*)iface; Compartment *This = impl_from_ITfCompartment(iface);
return InterlockedIncrement(&This->refCount); return InterlockedIncrement(&This->refCount);
} }
static ULONG WINAPI Compartment_Release(ITfCompartment *iface) static ULONG WINAPI Compartment_Release(ITfCompartment *iface)
{ {
Compartment *This = (Compartment *)iface; Compartment *This = impl_from_ITfCompartment(iface);
ULONG ret; ULONG ret;
ret = InterlockedDecrement(&This->refCount); ret = InterlockedDecrement(&This->refCount);
@ -471,7 +488,7 @@ static ULONG WINAPI Compartment_Release(ITfCompartment *iface)
static HRESULT WINAPI Compartment_SetValue(ITfCompartment *iface, static HRESULT WINAPI Compartment_SetValue(ITfCompartment *iface,
TfClientId tid, const VARIANT *pvarValue) TfClientId tid, const VARIANT *pvarValue)
{ {
Compartment *This = (Compartment *)iface; Compartment *This = impl_from_ITfCompartment(iface);
struct list *cursor; struct list *cursor;
TRACE("(%p) %i %p\n",This,tid,pvarValue); TRACE("(%p) %i %p\n",This,tid,pvarValue);
@ -509,7 +526,7 @@ static HRESULT WINAPI Compartment_SetValue(ITfCompartment *iface,
static HRESULT WINAPI Compartment_GetValue(ITfCompartment *iface, static HRESULT WINAPI Compartment_GetValue(ITfCompartment *iface,
VARIANT *pvarValue) VARIANT *pvarValue)
{ {
Compartment *This = (Compartment *)iface; Compartment *This = impl_from_ITfCompartment(iface);
TRACE("(%p) %p\n",This, pvarValue); TRACE("(%p) %p\n",This, pvarValue);
if (!pvarValue) if (!pvarValue)
@ -520,11 +537,11 @@ static HRESULT WINAPI Compartment_GetValue(ITfCompartment *iface,
return VariantCopy(pvarValue,&This->variant); return VariantCopy(pvarValue,&This->variant);
} }
static const ITfCompartmentVtbl ITfCompartment_Vtbl ={ static const ITfCompartmentVtbl CompartmentVtbl =
{
Compartment_QueryInterface, Compartment_QueryInterface,
Compartment_AddRef, Compartment_AddRef,
Compartment_Release, Compartment_Release,
Compartment_SetValue, Compartment_SetValue,
Compartment_GetValue Compartment_GetValue
}; };
@ -533,29 +550,29 @@ static const ITfCompartmentVtbl ITfCompartment_Vtbl ={
* ITfSource functions * ITfSource functions
*****************************************************/ *****************************************************/
static HRESULT WINAPI Source_QueryInterface(ITfSource *iface, REFIID iid, LPVOID *ppvOut) static HRESULT WINAPI CompartmentSource_QueryInterface(ITfSource *iface, REFIID iid, LPVOID *ppvOut)
{ {
Compartment *This = impl_from_ITfSourceVtbl(iface); Compartment *This = impl_from_ITfSource(iface);
return Compartment_QueryInterface((ITfCompartment *)This, iid, *ppvOut); return ITfCompartment_QueryInterface(&This->ITfCompartment_iface, iid, ppvOut);
} }
static ULONG WINAPI Source_AddRef(ITfSource *iface) static ULONG WINAPI CompartmentSource_AddRef(ITfSource *iface)
{ {
Compartment *This = impl_from_ITfSourceVtbl(iface); Compartment *This = impl_from_ITfSource(iface);
return Compartment_AddRef((ITfCompartment*)This); return ITfCompartment_AddRef(&This->ITfCompartment_iface);
} }
static ULONG WINAPI Source_Release(ITfSource *iface) static ULONG WINAPI CompartmentSource_Release(ITfSource *iface)
{ {
Compartment *This = impl_from_ITfSourceVtbl(iface); Compartment *This = impl_from_ITfSource(iface);
return Compartment_Release((ITfCompartment *)This); return ITfCompartment_Release(&This->ITfCompartment_iface);
} }
static HRESULT WINAPI CompartmentSource_AdviseSink(ITfSource *iface, static HRESULT WINAPI CompartmentSource_AdviseSink(ITfSource *iface,
REFIID riid, IUnknown *punk, DWORD *pdwCookie) REFIID riid, IUnknown *punk, DWORD *pdwCookie)
{ {
Compartment *This = impl_from_ITfSource(iface);
CompartmentSink *cs; CompartmentSink *cs;
Compartment *This = impl_from_ITfSourceVtbl(iface);
TRACE("(%p) %s %p %p\n",This,debugstr_guid(riid),punk,pdwCookie); TRACE("(%p) %s %p %p\n",This,debugstr_guid(riid),punk,pdwCookie);
@ -588,8 +605,8 @@ static HRESULT WINAPI CompartmentSource_AdviseSink(ITfSource *iface,
static HRESULT WINAPI CompartmentSource_UnadviseSink(ITfSource *iface, DWORD pdwCookie) static HRESULT WINAPI CompartmentSource_UnadviseSink(ITfSource *iface, DWORD pdwCookie)
{ {
Compartment *This = impl_from_ITfSource(iface);
CompartmentSink *sink; CompartmentSink *sink;
Compartment *This = impl_from_ITfSourceVtbl(iface);
TRACE("(%p) %x\n",This,pdwCookie); TRACE("(%p) %x\n",This,pdwCookie);
@ -606,12 +623,11 @@ static HRESULT WINAPI CompartmentSource_UnadviseSink(ITfSource *iface, DWORD pdw
return S_OK; return S_OK;
} }
static const ITfSourceVtbl Compartment_SourceVtbl = static const ITfSourceVtbl CompartmentSourceVtbl =
{ {
Source_QueryInterface, CompartmentSource_QueryInterface,
Source_AddRef, CompartmentSource_AddRef,
Source_Release, CompartmentSource_Release,
CompartmentSource_AdviseSink, CompartmentSource_AdviseSink,
CompartmentSource_UnadviseSink, CompartmentSource_UnadviseSink,
}; };
@ -624,8 +640,8 @@ static HRESULT Compartment_Constructor(CompartmentValue *valueData, ITfCompartme
if (This == NULL) if (This == NULL)
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
This->Vtbl= &ITfCompartment_Vtbl; This->ITfCompartment_iface.lpVtbl= &CompartmentVtbl;
This->SourceVtbl = &Compartment_SourceVtbl; This->ITfSource_iface.lpVtbl = &CompartmentSourceVtbl;
This->refCount = 1; This->refCount = 1;
This->valueData = valueData; This->valueData = valueData;
@ -633,7 +649,7 @@ static HRESULT Compartment_Constructor(CompartmentValue *valueData, ITfCompartme
list_init(&This->CompartmentEventSink); list_init(&This->CompartmentEventSink);
TRACE("returning %p\n", This); *ppOut = &This->ITfCompartment_iface;
*ppOut = (ITfCompartment*)This; TRACE("returning %p\n", *ppOut);
return S_OK; return S_OK;
} }

View file

@ -34,15 +34,15 @@ typedef struct tagContextSink {
} ContextSink; } ContextSink;
typedef struct tagContext { typedef struct tagContext {
const ITfContextVtbl *ContextVtbl; ITfContext ITfContext_iface;
const ITfSourceVtbl *SourceVtbl; ITfSource ITfSource_iface;
/* const ITfContextCompositionVtbl *ContextCompositionVtbl; */ /* const ITfContextCompositionVtbl *ContextCompositionVtbl; */
/* const ITfContextOwnerCompositionServicesVtbl *ContextOwnerCompositionServicesVtbl; */ /* const ITfContextOwnerCompositionServicesVtbl *ContextOwnerCompositionServicesVtbl; */
/* const ITfContextOwnerServicesVtbl *ContextOwnerServicesVtbl; */ /* const ITfContextOwnerServicesVtbl *ContextOwnerServicesVtbl; */
const ITfInsertAtSelectionVtbl *InsertAtSelectionVtbl; ITfInsertAtSelection ITfInsertAtSelection_iface;
/* const ITfMouseTrackerVtbl *MouseTrackerVtbl; */ /* const ITfMouseTrackerVtbl *MouseTrackerVtbl; */
/* const ITfQueryEmbeddedVtbl *QueryEmbeddedVtbl; */ /* const ITfQueryEmbeddedVtbl *QueryEmbeddedVtbl; */
const ITfSourceSingleVtbl *SourceSingleVtbl; ITfSourceSingle ITfSourceSingle_iface;
LONG refCount; LONG refCount;
BOOL connected; BOOL connected;
@ -75,7 +75,7 @@ typedef struct tagEditCookie {
} EditCookie; } EditCookie;
typedef struct tagTextStoreACPSink { typedef struct tagTextStoreACPSink {
const ITextStoreACPSinkVtbl *TextStoreACPSinkVtbl; ITextStoreACPSink ITextStoreACPSink_iface;
/* const ITextStoreACPServicesVtbl *TextStoreACPServicesVtbl; */ /* const ITextStoreACPServicesVtbl *TextStoreACPServicesVtbl; */
LONG refCount; LONG refCount;
@ -85,19 +85,29 @@ typedef struct tagTextStoreACPSink {
static HRESULT TextStoreACPSink_Constructor(ITextStoreACPSink **ppOut, Context *pContext); static HRESULT TextStoreACPSink_Constructor(ITextStoreACPSink **ppOut, Context *pContext);
static inline Context *impl_from_ITfSourceVtbl(ITfSource *iface) static inline Context *impl_from_ITfContext(ITfContext *iface)
{ {
return (Context *)((char *)iface - FIELD_OFFSET(Context,SourceVtbl)); return CONTAINING_RECORD(iface, Context, ITfContext_iface);
} }
static inline Context *impl_from_ITfInsertAtSelectionVtbl(ITfInsertAtSelection*iface) static inline Context *impl_from_ITfSource(ITfSource *iface)
{ {
return (Context *)((char *)iface - FIELD_OFFSET(Context,InsertAtSelectionVtbl)); return CONTAINING_RECORD(iface, Context, ITfSource_iface);
} }
static inline Context *impl_from_ITfSourceSingleVtbl(ITfSourceSingle* iface) static inline Context *impl_from_ITfInsertAtSelection(ITfInsertAtSelection *iface)
{ {
return (Context *)((char *)iface - FIELD_OFFSET(Context,SourceSingleVtbl)); return CONTAINING_RECORD(iface, Context, ITfInsertAtSelection_iface);
}
static inline Context *impl_from_ITfSourceSingle(ITfSourceSingle* iface)
{
return CONTAINING_RECORD(iface, Context, ITfSourceSingle_iface);
}
static inline TextStoreACPSink *impl_from_ITextStoreACPSink(ITextStoreACPSink *iface)
{
return CONTAINING_RECORD(iface, TextStoreACPSink, ITextStoreACPSink_iface);
} }
static void free_sink(ContextSink *sink) static void free_sink(ContextSink *sink)
@ -168,20 +178,20 @@ static void Context_Destructor(Context *This)
static HRESULT WINAPI Context_QueryInterface(ITfContext *iface, REFIID iid, LPVOID *ppvOut) static HRESULT WINAPI Context_QueryInterface(ITfContext *iface, REFIID iid, LPVOID *ppvOut)
{ {
Context *This = (Context *)iface; Context *This = impl_from_ITfContext(iface);
*ppvOut = NULL; *ppvOut = NULL;
if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_ITfContext)) if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_ITfContext))
{ {
*ppvOut = This; *ppvOut = &This->ITfContext_iface;
} }
else if (IsEqualIID(iid, &IID_ITfSource)) else if (IsEqualIID(iid, &IID_ITfSource))
{ {
*ppvOut = &This->SourceVtbl; *ppvOut = &This->ITfSource_iface;
} }
else if (IsEqualIID(iid, &IID_ITfInsertAtSelection)) else if (IsEqualIID(iid, &IID_ITfInsertAtSelection))
{ {
*ppvOut = &This->InsertAtSelectionVtbl; *ppvOut = &This->ITfInsertAtSelection_iface;
} }
else if (IsEqualIID(iid, &IID_ITfCompartmentMgr)) else if (IsEqualIID(iid, &IID_ITfCompartmentMgr))
{ {
@ -189,7 +199,7 @@ static HRESULT WINAPI Context_QueryInterface(ITfContext *iface, REFIID iid, LPVO
} }
else if (IsEqualIID(iid, &IID_ITfSourceSingle)) else if (IsEqualIID(iid, &IID_ITfSourceSingle))
{ {
*ppvOut = &This->SourceSingleVtbl; *ppvOut = &This->ITfSourceSingle_iface;
} }
if (*ppvOut) if (*ppvOut)
@ -204,13 +214,13 @@ static HRESULT WINAPI Context_QueryInterface(ITfContext *iface, REFIID iid, LPVO
static ULONG WINAPI Context_AddRef(ITfContext *iface) static ULONG WINAPI Context_AddRef(ITfContext *iface)
{ {
Context *This = (Context *)iface; Context *This = impl_from_ITfContext(iface);
return InterlockedIncrement(&This->refCount); return InterlockedIncrement(&This->refCount);
} }
static ULONG WINAPI Context_Release(ITfContext *iface) static ULONG WINAPI Context_Release(ITfContext *iface)
{ {
Context *This = (Context *)iface; Context *This = impl_from_ITfContext(iface);
ULONG ret; ULONG ret;
ret = InterlockedDecrement(&This->refCount); ret = InterlockedDecrement(&This->refCount);
@ -226,8 +236,8 @@ static HRESULT WINAPI Context_RequestEditSession (ITfContext *iface,
TfClientId tid, ITfEditSession *pes, DWORD dwFlags, TfClientId tid, ITfEditSession *pes, DWORD dwFlags,
HRESULT *phrSession) HRESULT *phrSession)
{ {
Context *This = impl_from_ITfContext(iface);
HRESULT hr; HRESULT hr;
Context *This = (Context *)iface;
DWORD dwLockFlags = 0x0; DWORD dwLockFlags = 0x0;
TRACE("(%p) %i %p %x %p\n",This, tid, pes, dwFlags, phrSession); TRACE("(%p) %i %p %x %p\n",This, tid, pes, dwFlags, phrSession);
@ -277,7 +287,7 @@ static HRESULT WINAPI Context_InWriteSession (ITfContext *iface,
TfClientId tid, TfClientId tid,
BOOL *pfWriteSession) BOOL *pfWriteSession)
{ {
Context *This = (Context *)iface; Context *This = impl_from_ITfContext(iface);
FIXME("STUB:(%p)\n",This); FIXME("STUB:(%p)\n",This);
return E_NOTIMPL; return E_NOTIMPL;
} }
@ -286,7 +296,7 @@ static HRESULT WINAPI Context_GetSelection (ITfContext *iface,
TfEditCookie ec, ULONG ulIndex, ULONG ulCount, TfEditCookie ec, ULONG ulIndex, ULONG ulCount,
TF_SELECTION *pSelection, ULONG *pcFetched) TF_SELECTION *pSelection, ULONG *pcFetched)
{ {
Context *This = (Context *)iface; Context *This = impl_from_ITfContext(iface);
EditCookie *cookie; EditCookie *cookie;
ULONG count, i; ULONG count, i;
ULONG totalFetched = 0; ULONG totalFetched = 0;
@ -345,8 +355,8 @@ static HRESULT WINAPI Context_GetSelection (ITfContext *iface,
static HRESULT WINAPI Context_SetSelection (ITfContext *iface, static HRESULT WINAPI Context_SetSelection (ITfContext *iface,
TfEditCookie ec, ULONG ulCount, const TF_SELECTION *pSelection) TfEditCookie ec, ULONG ulCount, const TF_SELECTION *pSelection)
{ {
Context *This = impl_from_ITfContext(iface);
TS_SELECTION_ACP *acp; TS_SELECTION_ACP *acp;
Context *This = (Context *)iface;
ULONG i; ULONG i;
HRESULT hr; HRESULT hr;
@ -383,7 +393,7 @@ static HRESULT WINAPI Context_SetSelection (ITfContext *iface,
static HRESULT WINAPI Context_GetStart (ITfContext *iface, static HRESULT WINAPI Context_GetStart (ITfContext *iface,
TfEditCookie ec, ITfRange **ppStart) TfEditCookie ec, ITfRange **ppStart)
{ {
Context *This = (Context *)iface; Context *This = impl_from_ITfContext(iface);
EditCookie *cookie; EditCookie *cookie;
TRACE("(%p) %i %p\n",This,ec,ppStart); TRACE("(%p) %i %p\n",This,ec,ppStart);
@ -405,7 +415,7 @@ static HRESULT WINAPI Context_GetStart (ITfContext *iface,
static HRESULT WINAPI Context_GetEnd (ITfContext *iface, static HRESULT WINAPI Context_GetEnd (ITfContext *iface,
TfEditCookie ec, ITfRange **ppEnd) TfEditCookie ec, ITfRange **ppEnd)
{ {
Context *This = (Context *)iface; Context *This = impl_from_ITfContext(iface);
EditCookie *cookie; EditCookie *cookie;
LONG end; LONG end;
TRACE("(%p) %i %p\n",This,ec,ppEnd); TRACE("(%p) %i %p\n",This,ec,ppEnd);
@ -436,7 +446,7 @@ static HRESULT WINAPI Context_GetEnd (ITfContext *iface,
static HRESULT WINAPI Context_GetActiveView (ITfContext *iface, static HRESULT WINAPI Context_GetActiveView (ITfContext *iface,
ITfContextView **ppView) ITfContextView **ppView)
{ {
Context *This = (Context *)iface; Context *This = impl_from_ITfContext(iface);
FIXME("STUB:(%p)\n",This); FIXME("STUB:(%p)\n",This);
return E_NOTIMPL; return E_NOTIMPL;
} }
@ -444,7 +454,7 @@ static HRESULT WINAPI Context_GetActiveView (ITfContext *iface,
static HRESULT WINAPI Context_EnumViews (ITfContext *iface, static HRESULT WINAPI Context_EnumViews (ITfContext *iface,
IEnumTfContextViews **ppEnum) IEnumTfContextViews **ppEnum)
{ {
Context *This = (Context *)iface; Context *This = impl_from_ITfContext(iface);
FIXME("STUB:(%p)\n",This); FIXME("STUB:(%p)\n",This);
return E_NOTIMPL; return E_NOTIMPL;
} }
@ -452,7 +462,7 @@ static HRESULT WINAPI Context_EnumViews (ITfContext *iface,
static HRESULT WINAPI Context_GetStatus (ITfContext *iface, static HRESULT WINAPI Context_GetStatus (ITfContext *iface,
TF_STATUS *pdcs) TF_STATUS *pdcs)
{ {
Context *This = (Context *)iface; Context *This = impl_from_ITfContext(iface);
TRACE("(%p) %p\n",This,pdcs); TRACE("(%p) %p\n",This,pdcs);
if (!This->connected) if (!This->connected)
@ -477,7 +487,7 @@ static HRESULT WINAPI Context_GetStatus (ITfContext *iface,
static HRESULT WINAPI Context_GetProperty (ITfContext *iface, static HRESULT WINAPI Context_GetProperty (ITfContext *iface,
REFGUID guidProp, ITfProperty **ppProp) REFGUID guidProp, ITfProperty **ppProp)
{ {
Context *This = (Context *)iface; Context *This = impl_from_ITfContext(iface);
FIXME("STUB:(%p)\n",This); FIXME("STUB:(%p)\n",This);
return E_NOTIMPL; return E_NOTIMPL;
} }
@ -485,7 +495,7 @@ static HRESULT WINAPI Context_GetProperty (ITfContext *iface,
static HRESULT WINAPI Context_GetAppProperty (ITfContext *iface, static HRESULT WINAPI Context_GetAppProperty (ITfContext *iface,
REFGUID guidProp, ITfReadOnlyProperty **ppProp) REFGUID guidProp, ITfReadOnlyProperty **ppProp)
{ {
Context *This = (Context *)iface; Context *This = impl_from_ITfContext(iface);
FIXME("STUB:(%p)\n",This); FIXME("STUB:(%p)\n",This);
return E_NOTIMPL; return E_NOTIMPL;
} }
@ -494,7 +504,7 @@ static HRESULT WINAPI Context_TrackProperties (ITfContext *iface,
const GUID **prgProp, ULONG cProp, const GUID **prgAppProp, const GUID **prgProp, ULONG cProp, const GUID **prgAppProp,
ULONG cAppProp, ITfReadOnlyProperty **ppProperty) ULONG cAppProp, ITfReadOnlyProperty **ppProperty)
{ {
Context *This = (Context *)iface; Context *This = impl_from_ITfContext(iface);
FIXME("STUB:(%p)\n",This); FIXME("STUB:(%p)\n",This);
return E_NOTIMPL; return E_NOTIMPL;
} }
@ -502,7 +512,7 @@ static HRESULT WINAPI Context_TrackProperties (ITfContext *iface,
static HRESULT WINAPI Context_EnumProperties (ITfContext *iface, static HRESULT WINAPI Context_EnumProperties (ITfContext *iface,
IEnumTfProperties **ppEnum) IEnumTfProperties **ppEnum)
{ {
Context *This = (Context *)iface; Context *This = impl_from_ITfContext(iface);
FIXME("STUB:(%p)\n",This); FIXME("STUB:(%p)\n",This);
return E_NOTIMPL; return E_NOTIMPL;
} }
@ -510,7 +520,7 @@ static HRESULT WINAPI Context_EnumProperties (ITfContext *iface,
static HRESULT WINAPI Context_GetDocumentMgr (ITfContext *iface, static HRESULT WINAPI Context_GetDocumentMgr (ITfContext *iface,
ITfDocumentMgr **ppDm) ITfDocumentMgr **ppDm)
{ {
Context *This = (Context *)iface; Context *This = impl_from_ITfContext(iface);
TRACE("(%p) %p\n",This,ppDm); TRACE("(%p) %p\n",This,ppDm);
if (!ppDm) if (!ppDm)
@ -528,17 +538,16 @@ static HRESULT WINAPI Context_GetDocumentMgr (ITfContext *iface,
static HRESULT WINAPI Context_CreateRangeBackup (ITfContext *iface, static HRESULT WINAPI Context_CreateRangeBackup (ITfContext *iface,
TfEditCookie ec, ITfRange *pRange, ITfRangeBackup **ppBackup) TfEditCookie ec, ITfRange *pRange, ITfRangeBackup **ppBackup)
{ {
Context *This = (Context *)iface; Context *This = impl_from_ITfContext(iface);
FIXME("STUB:(%p)\n",This); FIXME("STUB:(%p)\n",This);
return E_NOTIMPL; return E_NOTIMPL;
} }
static const ITfContextVtbl Context_ContextVtbl = static const ITfContextVtbl ContextVtbl =
{ {
Context_QueryInterface, Context_QueryInterface,
Context_AddRef, Context_AddRef,
Context_Release, Context_Release,
Context_RequestEditSession, Context_RequestEditSession,
Context_InWriteSession, Context_InWriteSession,
Context_GetSelection, Context_GetSelection,
@ -556,22 +565,22 @@ static const ITfContextVtbl Context_ContextVtbl =
Context_CreateRangeBackup Context_CreateRangeBackup
}; };
static HRESULT WINAPI Source_QueryInterface(ITfSource *iface, REFIID iid, LPVOID *ppvOut) static HRESULT WINAPI ContextSource_QueryInterface(ITfSource *iface, REFIID iid, LPVOID *ppvOut)
{ {
Context *This = impl_from_ITfSourceVtbl(iface); Context *This = impl_from_ITfSource(iface);
return Context_QueryInterface((ITfContext *)This, iid, *ppvOut); return ITfContext_QueryInterface(&This->ITfContext_iface, iid, ppvOut);
} }
static ULONG WINAPI Source_AddRef(ITfSource *iface) static ULONG WINAPI ContextSource_AddRef(ITfSource *iface)
{ {
Context *This = impl_from_ITfSourceVtbl(iface); Context *This = impl_from_ITfSource(iface);
return Context_AddRef((ITfContext *)This); return ITfContext_AddRef(&This->ITfContext_iface);
} }
static ULONG WINAPI Source_Release(ITfSource *iface) static ULONG WINAPI ContextSource_Release(ITfSource *iface)
{ {
Context *This = impl_from_ITfSourceVtbl(iface); Context *This = impl_from_ITfSource(iface);
return Context_Release((ITfContext *)This); return ITfContext_Release(&This->ITfContext_iface);
} }
/***************************************************** /*****************************************************
@ -580,8 +589,8 @@ static ULONG WINAPI Source_Release(ITfSource *iface)
static HRESULT WINAPI ContextSource_AdviseSink(ITfSource *iface, static HRESULT WINAPI ContextSource_AdviseSink(ITfSource *iface,
REFIID riid, IUnknown *punk, DWORD *pdwCookie) REFIID riid, IUnknown *punk, DWORD *pdwCookie)
{ {
Context *This = impl_from_ITfSource(iface);
ContextSink *es; ContextSink *es;
Context *This = impl_from_ITfSourceVtbl(iface);
TRACE("(%p) %s %p %p\n",This,debugstr_guid(riid),punk,pdwCookie); TRACE("(%p) %s %p %p\n",This,debugstr_guid(riid),punk,pdwCookie);
if (!riid || !punk || !pdwCookie) if (!riid || !punk || !pdwCookie)
@ -612,8 +621,8 @@ static HRESULT WINAPI ContextSource_AdviseSink(ITfSource *iface,
static HRESULT WINAPI ContextSource_UnadviseSink(ITfSource *iface, DWORD pdwCookie) static HRESULT WINAPI ContextSource_UnadviseSink(ITfSource *iface, DWORD pdwCookie)
{ {
Context *This = impl_from_ITfSource(iface);
ContextSink *sink; ContextSink *sink;
Context *This = impl_from_ITfSourceVtbl(iface);
TRACE("(%p) %x\n",This,pdwCookie); TRACE("(%p) %x\n",This,pdwCookie);
@ -630,14 +639,13 @@ static HRESULT WINAPI ContextSource_UnadviseSink(ITfSource *iface, DWORD pdwCook
return S_OK; return S_OK;
} }
static const ITfSourceVtbl Context_SourceVtbl = static const ITfSourceVtbl ContextSourceVtbl =
{ {
Source_QueryInterface, ContextSource_QueryInterface,
Source_AddRef, ContextSource_AddRef,
Source_Release, ContextSource_Release,
ContextSource_AdviseSink, ContextSource_AdviseSink,
ContextSource_UnadviseSink, ContextSource_UnadviseSink
}; };
/***************************************************** /*****************************************************
@ -645,27 +653,27 @@ static const ITfSourceVtbl Context_SourceVtbl =
*****************************************************/ *****************************************************/
static HRESULT WINAPI InsertAtSelection_QueryInterface(ITfInsertAtSelection *iface, REFIID iid, LPVOID *ppvOut) static HRESULT WINAPI InsertAtSelection_QueryInterface(ITfInsertAtSelection *iface, REFIID iid, LPVOID *ppvOut)
{ {
Context *This = impl_from_ITfInsertAtSelectionVtbl(iface); Context *This = impl_from_ITfInsertAtSelection(iface);
return Context_QueryInterface((ITfContext *)This, iid, *ppvOut); return ITfContext_QueryInterface(&This->ITfContext_iface, iid, ppvOut);
} }
static ULONG WINAPI InsertAtSelection_AddRef(ITfInsertAtSelection *iface) static ULONG WINAPI InsertAtSelection_AddRef(ITfInsertAtSelection *iface)
{ {
Context *This = impl_from_ITfInsertAtSelectionVtbl(iface); Context *This = impl_from_ITfInsertAtSelection(iface);
return Context_AddRef((ITfContext *)This); return ITfContext_AddRef(&This->ITfContext_iface);
} }
static ULONG WINAPI InsertAtSelection_Release(ITfInsertAtSelection *iface) static ULONG WINAPI InsertAtSelection_Release(ITfInsertAtSelection *iface)
{ {
Context *This = impl_from_ITfInsertAtSelectionVtbl(iface); Context *This = impl_from_ITfInsertAtSelection(iface);
return Context_Release((ITfContext *)This); return ITfContext_Release(&This->ITfContext_iface);
} }
static HRESULT WINAPI InsertAtSelection_InsertTextAtSelection( static HRESULT WINAPI InsertAtSelection_InsertTextAtSelection(
ITfInsertAtSelection *iface, TfEditCookie ec, DWORD dwFlags, ITfInsertAtSelection *iface, TfEditCookie ec, DWORD dwFlags,
const WCHAR *pchText, LONG cch, ITfRange **ppRange) const WCHAR *pchText, LONG cch, ITfRange **ppRange)
{ {
Context *This = impl_from_ITfInsertAtSelectionVtbl(iface); Context *This = impl_from_ITfInsertAtSelection(iface);
EditCookie *cookie; EditCookie *cookie;
LONG acpStart, acpEnd; LONG acpStart, acpEnd;
TS_TEXTCHANGE change; TS_TEXTCHANGE change;
@ -692,7 +700,7 @@ static HRESULT WINAPI InsertAtSelection_InsertTextAtSelection(
hr = ITextStoreACP_InsertTextAtSelection(This->pITextStoreACP, dwFlags, pchText, cch, &acpStart, &acpEnd, &change); hr = ITextStoreACP_InsertTextAtSelection(This->pITextStoreACP, dwFlags, pchText, cch, &acpStart, &acpEnd, &change);
if (SUCCEEDED(hr)) if (SUCCEEDED(hr))
Range_Constructor((ITfContext*)This, This->pITextStoreACP, cookie->lockType, change.acpStart, change.acpNewEnd, ppRange); Range_Constructor(&This->ITfContext_iface, This->pITextStoreACP, cookie->lockType, change.acpStart, change.acpNewEnd, ppRange);
return hr; return hr;
} }
@ -701,17 +709,16 @@ static HRESULT WINAPI InsertAtSelection_InsertEmbeddedAtSelection(
ITfInsertAtSelection *iface, TfEditCookie ec, DWORD dwFlags, ITfInsertAtSelection *iface, TfEditCookie ec, DWORD dwFlags,
IDataObject *pDataObject, ITfRange **ppRange) IDataObject *pDataObject, ITfRange **ppRange)
{ {
Context *This = impl_from_ITfInsertAtSelectionVtbl(iface); Context *This = impl_from_ITfInsertAtSelection(iface);
FIXME("STUB:(%p)\n",This); FIXME("STUB:(%p)\n",This);
return E_NOTIMPL; return E_NOTIMPL;
} }
static const ITfInsertAtSelectionVtbl Context_InsertAtSelectionVtbl = static const ITfInsertAtSelectionVtbl InsertAtSelectionVtbl =
{ {
InsertAtSelection_QueryInterface, InsertAtSelection_QueryInterface,
InsertAtSelection_AddRef, InsertAtSelection_AddRef,
InsertAtSelection_Release, InsertAtSelection_Release,
InsertAtSelection_InsertTextAtSelection, InsertAtSelection_InsertTextAtSelection,
InsertAtSelection_InsertEmbeddedAtSelection, InsertAtSelection_InsertEmbeddedAtSelection,
}; };
@ -721,26 +728,26 @@ static const ITfInsertAtSelectionVtbl Context_InsertAtSelectionVtbl =
*****************************************************/ *****************************************************/
static HRESULT WINAPI SourceSingle_QueryInterface(ITfSourceSingle *iface, REFIID iid, LPVOID *ppvOut) static HRESULT WINAPI SourceSingle_QueryInterface(ITfSourceSingle *iface, REFIID iid, LPVOID *ppvOut)
{ {
Context *This = impl_from_ITfSourceSingleVtbl(iface); Context *This = impl_from_ITfSourceSingle(iface);
return Context_QueryInterface((ITfContext *)This, iid, *ppvOut); return ITfContext_QueryInterface(&This->ITfContext_iface, iid, ppvOut);
} }
static ULONG WINAPI SourceSingle_AddRef(ITfSourceSingle *iface) static ULONG WINAPI SourceSingle_AddRef(ITfSourceSingle *iface)
{ {
Context *This = impl_from_ITfSourceSingleVtbl(iface); Context *This = impl_from_ITfSourceSingle(iface);
return Context_AddRef((ITfContext *)This); return ITfContext_AddRef(&This->ITfContext_iface);
} }
static ULONG WINAPI SourceSingle_Release(ITfSourceSingle *iface) static ULONG WINAPI SourceSingle_Release(ITfSourceSingle *iface)
{ {
Context *This = impl_from_ITfSourceSingleVtbl(iface); Context *This = impl_from_ITfSourceSingle(iface);
return Context_Release((ITfContext *)This); return ITfContext_Release(&This->ITfContext_iface);
} }
static HRESULT WINAPI SourceSingle_AdviseSingleSink( ITfSourceSingle *iface, static HRESULT WINAPI SourceSingle_AdviseSingleSink( ITfSourceSingle *iface,
TfClientId tid, REFIID riid, IUnknown *punk) TfClientId tid, REFIID riid, IUnknown *punk)
{ {
Context *This = impl_from_ITfSourceSingleVtbl(iface); Context *This = impl_from_ITfSourceSingle(iface);
FIXME("STUB:(%p) %i %s %p\n",This, tid, debugstr_guid(riid),punk); FIXME("STUB:(%p) %i %s %p\n",This, tid, debugstr_guid(riid),punk);
return E_NOTIMPL; return E_NOTIMPL;
} }
@ -748,17 +755,16 @@ static HRESULT WINAPI SourceSingle_AdviseSingleSink( ITfSourceSingle *iface,
static HRESULT WINAPI SourceSingle_UnadviseSingleSink( ITfSourceSingle *iface, static HRESULT WINAPI SourceSingle_UnadviseSingleSink( ITfSourceSingle *iface,
TfClientId tid, REFIID riid) TfClientId tid, REFIID riid)
{ {
Context *This = impl_from_ITfSourceSingleVtbl(iface); Context *This = impl_from_ITfSourceSingle(iface);
FIXME("STUB:(%p) %i %s\n",This, tid, debugstr_guid(riid)); FIXME("STUB:(%p) %i %s\n",This, tid, debugstr_guid(riid));
return E_NOTIMPL; return E_NOTIMPL;
} }
static const ITfSourceSingleVtbl Context_SourceSingleVtbl = static const ITfSourceSingleVtbl ContextSourceSingleVtbl =
{ {
SourceSingle_QueryInterface, SourceSingle_QueryInterface,
SourceSingle_AddRef, SourceSingle_AddRef,
SourceSingle_Release, SourceSingle_Release,
SourceSingle_AdviseSingleSink, SourceSingle_AdviseSingleSink,
SourceSingle_UnadviseSingleSink, SourceSingle_UnadviseSingleSink,
}; };
@ -781,16 +787,16 @@ HRESULT Context_Constructor(TfClientId tidOwner, IUnknown *punk, ITfDocumentMgr
TRACE("(%p) %x %p %p %p\n",This, tidOwner, punk, ppOut, pecTextStore); TRACE("(%p) %x %p %p %p\n",This, tidOwner, punk, ppOut, pecTextStore);
This->ContextVtbl= &Context_ContextVtbl; This->ITfContext_iface.lpVtbl= &ContextVtbl;
This->SourceVtbl = &Context_SourceVtbl; This->ITfSource_iface.lpVtbl = &ContextSourceVtbl;
This->InsertAtSelectionVtbl = &Context_InsertAtSelectionVtbl; This->ITfInsertAtSelection_iface.lpVtbl = &InsertAtSelectionVtbl;
This->SourceSingleVtbl = &Context_SourceSingleVtbl; This->ITfSourceSingle_iface.lpVtbl = &ContextSourceSingleVtbl;
This->refCount = 1; This->refCount = 1;
This->tidOwner = tidOwner; This->tidOwner = tidOwner;
This->connected = FALSE; This->connected = FALSE;
This->manager = mgr; This->manager = mgr;
CompartmentMgr_Constructor((IUnknown*)This, &IID_IUnknown, (IUnknown**)&This->CompartmentMgr); CompartmentMgr_Constructor((IUnknown*)&This->ITfContext_iface, &IID_IUnknown, (IUnknown**)&This->CompartmentMgr);
cookie->lockType = TF_ES_READ; cookie->lockType = TF_ES_READ;
cookie->pOwningContext = This; cookie->pOwningContext = This;
@ -816,15 +822,15 @@ HRESULT Context_Constructor(TfClientId tidOwner, IUnknown *punk, ITfDocumentMgr
list_init(&This->pTextEditSink); list_init(&This->pTextEditSink);
list_init(&This->pTextLayoutSink); list_init(&This->pTextLayoutSink);
*ppOut = (ITfContext*)This; *ppOut = &This->ITfContext_iface;
TRACE("returning %p\n", This); TRACE("returning %p\n", *ppOut);
return S_OK; return S_OK;
} }
HRESULT Context_Initialize(ITfContext *iface, ITfDocumentMgr *manager) HRESULT Context_Initialize(ITfContext *iface, ITfDocumentMgr *manager)
{ {
Context *This = (Context *)iface; Context *This = impl_from_ITfContext(iface);
if (This->pITextStoreACP) if (This->pITextStoreACP)
{ {
@ -839,7 +845,7 @@ HRESULT Context_Initialize(ITfContext *iface, ITfDocumentMgr *manager)
HRESULT Context_Uninitialize(ITfContext *iface) HRESULT Context_Uninitialize(ITfContext *iface)
{ {
Context *This = (Context *)iface; Context *This = impl_from_ITfContext(iface);
if (This->pITextStoreACPSink) if (This->pITextStoreACPSink)
{ {
@ -864,12 +870,12 @@ static void TextStoreACPSink_Destructor(TextStoreACPSink *This)
static HRESULT WINAPI TextStoreACPSink_QueryInterface(ITextStoreACPSink *iface, REFIID iid, LPVOID *ppvOut) static HRESULT WINAPI TextStoreACPSink_QueryInterface(ITextStoreACPSink *iface, REFIID iid, LPVOID *ppvOut)
{ {
TextStoreACPSink *This = (TextStoreACPSink *)iface; TextStoreACPSink *This = impl_from_ITextStoreACPSink(iface);
*ppvOut = NULL; *ppvOut = NULL;
if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_ITextStoreACPSink)) if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_ITextStoreACPSink))
{ {
*ppvOut = This; *ppvOut = &This->ITextStoreACPSink_iface;
} }
if (*ppvOut) if (*ppvOut)
@ -884,13 +890,13 @@ static HRESULT WINAPI TextStoreACPSink_QueryInterface(ITextStoreACPSink *iface,
static ULONG WINAPI TextStoreACPSink_AddRef(ITextStoreACPSink *iface) static ULONG WINAPI TextStoreACPSink_AddRef(ITextStoreACPSink *iface)
{ {
TextStoreACPSink *This = (TextStoreACPSink *)iface; TextStoreACPSink *This = impl_from_ITextStoreACPSink(iface);
return InterlockedIncrement(&This->refCount); return InterlockedIncrement(&This->refCount);
} }
static ULONG WINAPI TextStoreACPSink_Release(ITextStoreACPSink *iface) static ULONG WINAPI TextStoreACPSink_Release(ITextStoreACPSink *iface)
{ {
TextStoreACPSink *This = (TextStoreACPSink *)iface; TextStoreACPSink *This = impl_from_ITextStoreACPSink(iface);
ULONG ret; ULONG ret;
ret = InterlockedDecrement(&This->refCount); ret = InterlockedDecrement(&This->refCount);
@ -906,14 +912,14 @@ static ULONG WINAPI TextStoreACPSink_Release(ITextStoreACPSink *iface)
static HRESULT WINAPI TextStoreACPSink_OnTextChange(ITextStoreACPSink *iface, static HRESULT WINAPI TextStoreACPSink_OnTextChange(ITextStoreACPSink *iface,
DWORD dwFlags, const TS_TEXTCHANGE *pChange) DWORD dwFlags, const TS_TEXTCHANGE *pChange)
{ {
TextStoreACPSink *This = (TextStoreACPSink *)iface; TextStoreACPSink *This = impl_from_ITextStoreACPSink(iface);
FIXME("STUB:(%p)\n",This); FIXME("STUB:(%p)\n",This);
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT WINAPI TextStoreACPSink_OnSelectionChange(ITextStoreACPSink *iface) static HRESULT WINAPI TextStoreACPSink_OnSelectionChange(ITextStoreACPSink *iface)
{ {
TextStoreACPSink *This = (TextStoreACPSink *)iface; TextStoreACPSink *This = impl_from_ITextStoreACPSink(iface);
FIXME("STUB:(%p)\n",This); FIXME("STUB:(%p)\n",This);
return E_NOTIMPL; return E_NOTIMPL;
} }
@ -921,7 +927,7 @@ static HRESULT WINAPI TextStoreACPSink_OnSelectionChange(ITextStoreACPSink *ifac
static HRESULT WINAPI TextStoreACPSink_OnLayoutChange(ITextStoreACPSink *iface, static HRESULT WINAPI TextStoreACPSink_OnLayoutChange(ITextStoreACPSink *iface,
TsLayoutCode lcode, TsViewCookie vcView) TsLayoutCode lcode, TsViewCookie vcView)
{ {
TextStoreACPSink *This = (TextStoreACPSink *)iface; TextStoreACPSink *This = impl_from_ITextStoreACPSink(iface);
FIXME("STUB:(%p)\n",This); FIXME("STUB:(%p)\n",This);
return E_NOTIMPL; return E_NOTIMPL;
} }
@ -929,7 +935,7 @@ static HRESULT WINAPI TextStoreACPSink_OnLayoutChange(ITextStoreACPSink *iface,
static HRESULT WINAPI TextStoreACPSink_OnStatusChange(ITextStoreACPSink *iface, static HRESULT WINAPI TextStoreACPSink_OnStatusChange(ITextStoreACPSink *iface,
DWORD dwFlags) DWORD dwFlags)
{ {
TextStoreACPSink *This = (TextStoreACPSink *)iface; TextStoreACPSink *This = impl_from_ITextStoreACPSink(iface);
HRESULT hr, hrSession; HRESULT hr, hrSession;
TRACE("(%p) %x\n",This, dwFlags); TRACE("(%p) %x\n",This, dwFlags);
@ -957,7 +963,7 @@ static HRESULT WINAPI TextStoreACPSink_OnStatusChange(ITextStoreACPSink *iface,
static HRESULT WINAPI TextStoreACPSink_OnAttrsChange(ITextStoreACPSink *iface, static HRESULT WINAPI TextStoreACPSink_OnAttrsChange(ITextStoreACPSink *iface,
LONG acpStart, LONG acpEnd, ULONG cAttrs, const TS_ATTRID *paAttrs) LONG acpStart, LONG acpEnd, ULONG cAttrs, const TS_ATTRID *paAttrs)
{ {
TextStoreACPSink *This = (TextStoreACPSink *)iface; TextStoreACPSink *This = impl_from_ITextStoreACPSink(iface);
FIXME("STUB:(%p)\n",This); FIXME("STUB:(%p)\n",This);
return E_NOTIMPL; return E_NOTIMPL;
} }
@ -965,7 +971,7 @@ static HRESULT WINAPI TextStoreACPSink_OnAttrsChange(ITextStoreACPSink *iface,
static HRESULT WINAPI TextStoreACPSink_OnLockGranted(ITextStoreACPSink *iface, static HRESULT WINAPI TextStoreACPSink_OnLockGranted(ITextStoreACPSink *iface,
DWORD dwLockFlags) DWORD dwLockFlags)
{ {
TextStoreACPSink *This = (TextStoreACPSink *)iface; TextStoreACPSink *This = impl_from_ITextStoreACPSink(iface);
HRESULT hr; HRESULT hr;
EditCookie *cookie,*sinkcookie; EditCookie *cookie,*sinkcookie;
TfEditCookie ec; TfEditCookie ec;
@ -1033,24 +1039,23 @@ static HRESULT WINAPI TextStoreACPSink_OnLockGranted(ITextStoreACPSink *iface,
static HRESULT WINAPI TextStoreACPSink_OnStartEditTransaction(ITextStoreACPSink *iface) static HRESULT WINAPI TextStoreACPSink_OnStartEditTransaction(ITextStoreACPSink *iface)
{ {
TextStoreACPSink *This = (TextStoreACPSink *)iface; TextStoreACPSink *This = impl_from_ITextStoreACPSink(iface);
FIXME("STUB:(%p)\n",This); FIXME("STUB:(%p)\n",This);
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT WINAPI TextStoreACPSink_OnEndEditTransaction(ITextStoreACPSink *iface) static HRESULT WINAPI TextStoreACPSink_OnEndEditTransaction(ITextStoreACPSink *iface)
{ {
TextStoreACPSink *This = (TextStoreACPSink *)iface; TextStoreACPSink *This = impl_from_ITextStoreACPSink(iface);
FIXME("STUB:(%p)\n",This); FIXME("STUB:(%p)\n",This);
return E_NOTIMPL; return E_NOTIMPL;
} }
static const ITextStoreACPSinkVtbl TextStoreACPSink_TextStoreACPSinkVtbl = static const ITextStoreACPSinkVtbl TextStoreACPSinkVtbl =
{ {
TextStoreACPSink_QueryInterface, TextStoreACPSink_QueryInterface,
TextStoreACPSink_AddRef, TextStoreACPSink_AddRef,
TextStoreACPSink_Release, TextStoreACPSink_Release,
TextStoreACPSink_OnTextChange, TextStoreACPSink_OnTextChange,
TextStoreACPSink_OnSelectionChange, TextStoreACPSink_OnSelectionChange,
TextStoreACPSink_OnLayoutChange, TextStoreACPSink_OnLayoutChange,
@ -1069,12 +1074,12 @@ static HRESULT TextStoreACPSink_Constructor(ITextStoreACPSink **ppOut, Context *
if (This == NULL) if (This == NULL)
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
This->TextStoreACPSinkVtbl= &TextStoreACPSink_TextStoreACPSinkVtbl; This->ITextStoreACPSink_iface.lpVtbl= &TextStoreACPSinkVtbl;
This->refCount = 1; This->refCount = 1;
This->pContext = pContext; This->pContext = pContext;
TRACE("returning %p\n", This); *ppOut = &This->ITextStoreACPSink_iface;
*ppOut = (ITextStoreACPSink*)This; TRACE("returning %p\n", *ppOut);
return S_OK; return S_OK;
} }

View file

@ -46,7 +46,7 @@ static HRESULT WINAPI DisplayAttributeMgr_QueryInterface(ITfDisplayAttributeMgr
if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_ITfDisplayAttributeMgr)) if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_ITfDisplayAttributeMgr))
{ {
*ppvOut = This; *ppvOut = &This->ITfDisplayAttributeMgr_iface;
} }
if (*ppvOut) if (*ppvOut)
@ -104,12 +104,11 @@ static HRESULT WINAPI DisplayAttributeMgr_GetDisplayAttributeInfo(ITfDisplayAttr
return E_NOTIMPL; return E_NOTIMPL;
} }
static const ITfDisplayAttributeMgrVtbl DisplayAttributeMgr_DisplayAttributeMgrVtbl = static const ITfDisplayAttributeMgrVtbl DisplayAttributeMgrVtbl =
{ {
DisplayAttributeMgr_QueryInterface, DisplayAttributeMgr_QueryInterface,
DisplayAttributeMgr_AddRef, DisplayAttributeMgr_AddRef,
DisplayAttributeMgr_Release, DisplayAttributeMgr_Release,
DisplayAttributeMgr_OnUpdateInfo, DisplayAttributeMgr_OnUpdateInfo,
DisplayAttributeMgr_EnumDisplayAttributeInfo, DisplayAttributeMgr_EnumDisplayAttributeInfo,
DisplayAttributeMgr_GetDisplayAttributeInfo DisplayAttributeMgr_GetDisplayAttributeInfo
@ -125,10 +124,10 @@ HRESULT DisplayAttributeMgr_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut)
if (This == NULL) if (This == NULL)
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
This->ITfDisplayAttributeMgr_iface.lpVtbl = &DisplayAttributeMgr_DisplayAttributeMgrVtbl; This->ITfDisplayAttributeMgr_iface.lpVtbl = &DisplayAttributeMgrVtbl;
This->refCount = 1; This->refCount = 1;
TRACE("returning %p\n", This); *ppOut = (IUnknown *)&This->ITfDisplayAttributeMgr_iface;
*ppOut = (IUnknown *)This; TRACE("returning %p\n", *ppOut);
return S_OK; return S_OK;
} }

View file

@ -80,7 +80,7 @@ static HRESULT WINAPI DocumentMgr_QueryInterface(ITfDocumentMgr *iface, REFIID i
if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_ITfDocumentMgr)) if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_ITfDocumentMgr))
{ {
*ppvOut = This; *ppvOut = &This->ITfDocumentMgr_iface;
} }
else if (IsEqualIID(iid, &IID_ITfSource)) else if (IsEqualIID(iid, &IID_ITfSource))
{ {
@ -163,19 +163,17 @@ static HRESULT WINAPI DocumentMgr_Pop(ITfDocumentMgr *iface, DWORD dwFlags)
if (dwFlags == TF_POPF_ALL) if (dwFlags == TF_POPF_ALL)
{ {
if (This->contextStack[0]) int i;
{
ITfThreadMgrEventSink_OnPopContext(This->ThreadMgrSink,This->contextStack[0]); for (i = 0; i < sizeof(This->contextStack)/sizeof(This->contextStack[0]); i++)
Context_Uninitialize(This->contextStack[0]); if (This->contextStack[i])
ITfContext_Release(This->contextStack[0]); {
} ITfThreadMgrEventSink_OnPopContext(This->ThreadMgrSink, This->contextStack[i]);
if (This->contextStack[1]) Context_Uninitialize(This->contextStack[i]);
{ ITfContext_Release(This->contextStack[i]);
ITfThreadMgrEventSink_OnPopContext(This->ThreadMgrSink,This->contextStack[1]); This->contextStack[i] = NULL;
Context_Uninitialize(This->contextStack[1]); }
ITfContext_Release(This->contextStack[1]);
}
This->contextStack[0] = This->contextStack[1] = NULL;
ITfThreadMgrEventSink_OnUninitDocumentMgr(This->ThreadMgrSink, iface); ITfThreadMgrEventSink_OnUninitDocumentMgr(This->ThreadMgrSink, iface);
return S_OK; return S_OK;
} }
@ -242,12 +240,11 @@ static HRESULT WINAPI DocumentMgr_EnumContexts(ITfDocumentMgr *iface, IEnumTfCon
return EnumTfContext_Constructor(This, ppEnum); return EnumTfContext_Constructor(This, ppEnum);
} }
static const ITfDocumentMgrVtbl DocumentMgr_DocumentMgrVtbl = static const ITfDocumentMgrVtbl DocumentMgrVtbl =
{ {
DocumentMgr_QueryInterface, DocumentMgr_QueryInterface,
DocumentMgr_AddRef, DocumentMgr_AddRef,
DocumentMgr_Release, DocumentMgr_Release,
DocumentMgr_CreateContext, DocumentMgr_CreateContext,
DocumentMgr_Push, DocumentMgr_Push,
DocumentMgr_Pop, DocumentMgr_Pop,
@ -256,23 +253,22 @@ static const ITfDocumentMgrVtbl DocumentMgr_DocumentMgrVtbl =
DocumentMgr_EnumContexts DocumentMgr_EnumContexts
}; };
static HRESULT WINAPI DocumentMgrSource_QueryInterface(ITfSource *iface, REFIID iid, LPVOID *ppvOut)
static HRESULT WINAPI Source_QueryInterface(ITfSource *iface, REFIID iid, LPVOID *ppvOut)
{ {
DocumentMgr *This = impl_from_ITfSource(iface); DocumentMgr *This = impl_from_ITfSource(iface);
return DocumentMgr_QueryInterface(&This->ITfDocumentMgr_iface, iid, *ppvOut); return ITfDocumentMgr_QueryInterface(&This->ITfDocumentMgr_iface, iid, ppvOut);
} }
static ULONG WINAPI Source_AddRef(ITfSource *iface) static ULONG WINAPI DocumentMgrSource_AddRef(ITfSource *iface)
{ {
DocumentMgr *This = impl_from_ITfSource(iface); DocumentMgr *This = impl_from_ITfSource(iface);
return DocumentMgr_AddRef(&This->ITfDocumentMgr_iface); return ITfDocumentMgr_AddRef(&This->ITfDocumentMgr_iface);
} }
static ULONG WINAPI Source_Release(ITfSource *iface) static ULONG WINAPI DocumentMgrSource_Release(ITfSource *iface)
{ {
DocumentMgr *This = impl_from_ITfSource(iface); DocumentMgr *This = impl_from_ITfSource(iface);
return DocumentMgr_Release(&This->ITfDocumentMgr_iface); return ITfDocumentMgr_Release(&This->ITfDocumentMgr_iface);
} }
/***************************************************** /*****************************************************
@ -293,12 +289,11 @@ static HRESULT WINAPI DocumentMgrSource_UnadviseSink(ITfSource *iface, DWORD pdw
return E_NOTIMPL; return E_NOTIMPL;
} }
static const ITfSourceVtbl DocumentMgr_SourceVtbl = static const ITfSourceVtbl DocumentMgrSourceVtbl =
{ {
Source_QueryInterface, DocumentMgrSource_QueryInterface,
Source_AddRef, DocumentMgrSource_AddRef,
Source_Release, DocumentMgrSource_Release,
DocumentMgrSource_AdviseSink, DocumentMgrSource_AdviseSink,
DocumentMgrSource_UnadviseSink, DocumentMgrSource_UnadviseSink,
}; };
@ -311,15 +306,15 @@ HRESULT DocumentMgr_Constructor(ITfThreadMgrEventSink *ThreadMgrSink, ITfDocumen
if (This == NULL) if (This == NULL)
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
This->ITfDocumentMgr_iface.lpVtbl = &DocumentMgr_DocumentMgrVtbl; This->ITfDocumentMgr_iface.lpVtbl = &DocumentMgrVtbl;
This->ITfSource_iface.lpVtbl = &DocumentMgr_SourceVtbl; This->ITfSource_iface.lpVtbl = &DocumentMgrSourceVtbl;
This->refCount = 1; This->refCount = 1;
This->ThreadMgrSink = ThreadMgrSink; This->ThreadMgrSink = ThreadMgrSink;
CompartmentMgr_Constructor((IUnknown*)This, &IID_IUnknown, (IUnknown**)&This->CompartmentMgr); CompartmentMgr_Constructor((IUnknown*)&This->ITfDocumentMgr_iface, &IID_IUnknown, (IUnknown**)&This->CompartmentMgr);
TRACE("returning %p\n", This);
*ppOut = &This->ITfDocumentMgr_iface; *ppOut = &This->ITfDocumentMgr_iface;
TRACE("returning %p\n", *ppOut);
return S_OK; return S_OK;
} }
@ -339,7 +334,7 @@ static HRESULT WINAPI EnumTfContext_QueryInterface(IEnumTfContexts *iface, REFII
if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_IEnumTfContexts)) if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_IEnumTfContexts))
{ {
*ppvOut = This; *ppvOut = &This->IEnumTfContexts_iface;
} }
if (*ppvOut) if (*ppvOut)
@ -457,7 +452,7 @@ static HRESULT EnumTfContext_Constructor(DocumentMgr *mgr, IEnumTfContexts **ppO
This->refCount = 1; This->refCount = 1;
This->docmgr = mgr; This->docmgr = mgr;
TRACE("returning %p\n", This);
*ppOut = &This->IEnumTfContexts_iface; *ppOut = &This->IEnumTfContexts_iface;
TRACE("returning %p\n", *ppOut);
return S_OK; return S_OK;
} }

View file

@ -40,8 +40,8 @@ typedef struct tagInputProcessorProfilesSink {
} InputProcessorProfilesSink; } InputProcessorProfilesSink;
typedef struct tagInputProcessorProfiles { typedef struct tagInputProcessorProfiles {
const ITfInputProcessorProfilesVtbl *InputProcessorProfilesVtbl; ITfInputProcessorProfiles ITfInputProcessorProfiles_iface;
const ITfSourceVtbl *SourceVtbl; ITfSource ITfSource_iface;
/* const ITfInputProcessorProfileMgrVtbl *InputProcessorProfileMgrVtbl; */ /* const ITfInputProcessorProfileMgrVtbl *InputProcessorProfileMgrVtbl; */
/* const ITfInputProcessorProfilesExVtbl *InputProcessorProfilesExVtbl; */ /* const ITfInputProcessorProfilesExVtbl *InputProcessorProfilesExVtbl; */
/* const ITfInputProcessorProfileSubstituteLayoutVtbl *InputProcessorProfileSubstituteLayoutVtbl; */ /* const ITfInputProcessorProfileSubstituteLayoutVtbl *InputProcessorProfileSubstituteLayoutVtbl; */
@ -53,7 +53,7 @@ typedef struct tagInputProcessorProfiles {
} InputProcessorProfiles; } InputProcessorProfiles;
typedef struct tagProfilesEnumGuid { typedef struct tagProfilesEnumGuid {
const IEnumGUIDVtbl *Vtbl; IEnumGUID IEnumGUID_iface;
LONG refCount; LONG refCount;
HKEY key; HKEY key;
@ -61,7 +61,7 @@ typedef struct tagProfilesEnumGuid {
} ProfilesEnumGuid; } ProfilesEnumGuid;
typedef struct tagEnumTfLanguageProfiles { typedef struct tagEnumTfLanguageProfiles {
const IEnumTfLanguageProfilesVtbl *Vtbl; IEnumTfLanguageProfiles IEnumTfLanguageProfiles_iface;
LONG refCount; LONG refCount;
HKEY tipkey; HKEY tipkey;
@ -78,9 +78,24 @@ typedef struct tagEnumTfLanguageProfiles {
static HRESULT ProfilesEnumGuid_Constructor(IEnumGUID **ppOut); static HRESULT ProfilesEnumGuid_Constructor(IEnumGUID **ppOut);
static HRESULT EnumTfLanguageProfiles_Constructor(LANGID langid, IEnumTfLanguageProfiles **ppOut); static HRESULT EnumTfLanguageProfiles_Constructor(LANGID langid, IEnumTfLanguageProfiles **ppOut);
static inline InputProcessorProfiles *impl_from_ITfSourceVtbl(ITfSource *iface) static inline InputProcessorProfiles *impl_from_ITfInputProcessorProfiles(ITfInputProcessorProfiles *iface)
{ {
return (InputProcessorProfiles *)((char *)iface - FIELD_OFFSET(InputProcessorProfiles,SourceVtbl)); return CONTAINING_RECORD(iface, InputProcessorProfiles, ITfInputProcessorProfiles_iface);
}
static inline InputProcessorProfiles *impl_from_ITfSource(ITfSource *iface)
{
return CONTAINING_RECORD(iface, InputProcessorProfiles, ITfSource_iface);
}
static inline ProfilesEnumGuid *impl_from_IEnumGUID(IEnumGUID *iface)
{
return CONTAINING_RECORD(iface, ProfilesEnumGuid, IEnumGUID_iface);
}
static inline EnumTfLanguageProfiles *impl_from_IEnumTfLanguageProfiles(IEnumTfLanguageProfiles *iface)
{
return CONTAINING_RECORD(iface, EnumTfLanguageProfiles, IEnumTfLanguageProfiles_iface);
} }
static void free_sink(InputProcessorProfilesSink *sink) static void free_sink(InputProcessorProfilesSink *sink)
@ -136,16 +151,16 @@ static void add_userkey( REFCLSID rclsid, LANGID langid,
static HRESULT WINAPI InputProcessorProfiles_QueryInterface(ITfInputProcessorProfiles *iface, REFIID iid, LPVOID *ppvOut) static HRESULT WINAPI InputProcessorProfiles_QueryInterface(ITfInputProcessorProfiles *iface, REFIID iid, LPVOID *ppvOut)
{ {
InputProcessorProfiles *This = (InputProcessorProfiles *)iface; InputProcessorProfiles *This = impl_from_ITfInputProcessorProfiles(iface);
*ppvOut = NULL; *ppvOut = NULL;
if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_ITfInputProcessorProfiles)) if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_ITfInputProcessorProfiles))
{ {
*ppvOut = This; *ppvOut = &This->ITfInputProcessorProfiles_iface;
} }
else if (IsEqualIID(iid, &IID_ITfSource)) else if (IsEqualIID(iid, &IID_ITfSource))
{ {
*ppvOut = &This->SourceVtbl; *ppvOut = &This->ITfSource_iface;
} }
if (*ppvOut) if (*ppvOut)
@ -160,13 +175,13 @@ static HRESULT WINAPI InputProcessorProfiles_QueryInterface(ITfInputProcessorPro
static ULONG WINAPI InputProcessorProfiles_AddRef(ITfInputProcessorProfiles *iface) static ULONG WINAPI InputProcessorProfiles_AddRef(ITfInputProcessorProfiles *iface)
{ {
InputProcessorProfiles *This = (InputProcessorProfiles *)iface; InputProcessorProfiles *This = impl_from_ITfInputProcessorProfiles(iface);
return InterlockedIncrement(&This->refCount); return InterlockedIncrement(&This->refCount);
} }
static ULONG WINAPI InputProcessorProfiles_Release(ITfInputProcessorProfiles *iface) static ULONG WINAPI InputProcessorProfiles_Release(ITfInputProcessorProfiles *iface)
{ {
InputProcessorProfiles *This = (InputProcessorProfiles *)iface; InputProcessorProfiles *This = impl_from_ITfInputProcessorProfiles(iface);
ULONG ret; ULONG ret;
ret = InterlockedDecrement(&This->refCount); ret = InterlockedDecrement(&This->refCount);
@ -181,7 +196,7 @@ static ULONG WINAPI InputProcessorProfiles_Release(ITfInputProcessorProfiles *if
static HRESULT WINAPI InputProcessorProfiles_Register( static HRESULT WINAPI InputProcessorProfiles_Register(
ITfInputProcessorProfiles *iface, REFCLSID rclsid) ITfInputProcessorProfiles *iface, REFCLSID rclsid)
{ {
InputProcessorProfiles *This = (InputProcessorProfiles*)iface; InputProcessorProfiles *This = impl_from_ITfInputProcessorProfiles(iface);
HKEY tipkey; HKEY tipkey;
WCHAR buf[39]; WCHAR buf[39];
WCHAR fullkey[68]; WCHAR fullkey[68];
@ -203,9 +218,9 @@ static HRESULT WINAPI InputProcessorProfiles_Register(
static HRESULT WINAPI InputProcessorProfiles_Unregister( static HRESULT WINAPI InputProcessorProfiles_Unregister(
ITfInputProcessorProfiles *iface, REFCLSID rclsid) ITfInputProcessorProfiles *iface, REFCLSID rclsid)
{ {
InputProcessorProfiles *This = impl_from_ITfInputProcessorProfiles(iface);
WCHAR buf[39]; WCHAR buf[39];
WCHAR fullkey[68]; WCHAR fullkey[68];
InputProcessorProfiles *This = (InputProcessorProfiles*)iface;
TRACE("(%p) %s\n",This,debugstr_guid(rclsid)); TRACE("(%p) %s\n",This,debugstr_guid(rclsid));
@ -224,6 +239,7 @@ static HRESULT WINAPI InputProcessorProfiles_AddLanguageProfile(
ULONG cchDesc, const WCHAR *pchIconFile, ULONG cchFile, ULONG cchDesc, const WCHAR *pchIconFile, ULONG cchFile,
ULONG uIconIndex) ULONG uIconIndex)
{ {
InputProcessorProfiles *This = impl_from_ITfInputProcessorProfiles(iface);
HKEY tipkey,fmtkey; HKEY tipkey,fmtkey;
WCHAR buf[39]; WCHAR buf[39];
WCHAR fullkey[100]; WCHAR fullkey[100];
@ -235,8 +251,6 @@ static HRESULT WINAPI InputProcessorProfiles_AddLanguageProfile(
static const WCHAR icnf[] = {'I','c','o','n','F','i','l','e',0}; static const WCHAR icnf[] = {'I','c','o','n','F','i','l','e',0};
static const WCHAR icni[] = {'I','c','o','n','I','n','d','e','x',0}; static const WCHAR icni[] = {'I','c','o','n','I','n','d','e','x',0};
InputProcessorProfiles *This = (InputProcessorProfiles*)iface;
TRACE("(%p) %s %x %s %s %s %i\n",This,debugstr_guid(rclsid), langid, TRACE("(%p) %s %x %s %s %s %i\n",This,debugstr_guid(rclsid), langid,
debugstr_guid(guidProfile), debugstr_wn(pchDesc,cchDesc), debugstr_guid(guidProfile), debugstr_wn(pchDesc,cchDesc),
debugstr_wn(pchIconFile,cchFile),uIconIndex); debugstr_wn(pchIconFile,cchFile),uIconIndex);
@ -278,7 +292,7 @@ static HRESULT WINAPI InputProcessorProfiles_RemoveLanguageProfile(
ITfInputProcessorProfiles *iface, REFCLSID rclsid, LANGID langid, ITfInputProcessorProfiles *iface, REFCLSID rclsid, LANGID langid,
REFGUID guidProfile) REFGUID guidProfile)
{ {
InputProcessorProfiles *This = (InputProcessorProfiles*)iface; InputProcessorProfiles *This = impl_from_ITfInputProcessorProfiles(iface);
FIXME("STUB:(%p)\n",This); FIXME("STUB:(%p)\n",This);
return E_NOTIMPL; return E_NOTIMPL;
} }
@ -286,7 +300,7 @@ static HRESULT WINAPI InputProcessorProfiles_RemoveLanguageProfile(
static HRESULT WINAPI InputProcessorProfiles_EnumInputProcessorInfo( static HRESULT WINAPI InputProcessorProfiles_EnumInputProcessorInfo(
ITfInputProcessorProfiles *iface, IEnumGUID **ppEnum) ITfInputProcessorProfiles *iface, IEnumGUID **ppEnum)
{ {
InputProcessorProfiles *This = (InputProcessorProfiles*)iface; InputProcessorProfiles *This = impl_from_ITfInputProcessorProfiles(iface);
TRACE("(%p) %p\n",This,ppEnum); TRACE("(%p) %p\n",This,ppEnum);
return ProfilesEnumGuid_Constructor(ppEnum); return ProfilesEnumGuid_Constructor(ppEnum);
} }
@ -295,12 +309,12 @@ static HRESULT WINAPI InputProcessorProfiles_GetDefaultLanguageProfile(
ITfInputProcessorProfiles *iface, LANGID langid, REFGUID catid, ITfInputProcessorProfiles *iface, LANGID langid, REFGUID catid,
CLSID *pclsid, GUID *pguidProfile) CLSID *pclsid, GUID *pguidProfile)
{ {
InputProcessorProfiles *This = impl_from_ITfInputProcessorProfiles(iface);
WCHAR fullkey[168]; WCHAR fullkey[168];
WCHAR buf[39]; WCHAR buf[39];
HKEY hkey; HKEY hkey;
DWORD count; DWORD count;
ULONG res; ULONG res;
InputProcessorProfiles *This = (InputProcessorProfiles*)iface;
TRACE("%p) %x %s %p %p\n",This, langid, debugstr_guid(catid),pclsid,pguidProfile); TRACE("%p) %x %s %p %p\n",This, langid, debugstr_guid(catid),pclsid,pguidProfile);
@ -336,13 +350,13 @@ static HRESULT WINAPI InputProcessorProfiles_SetDefaultLanguageProfile(
ITfInputProcessorProfiles *iface, LANGID langid, REFCLSID rclsid, ITfInputProcessorProfiles *iface, LANGID langid, REFCLSID rclsid,
REFGUID guidProfiles) REFGUID guidProfiles)
{ {
InputProcessorProfiles *This = impl_from_ITfInputProcessorProfiles(iface);
WCHAR fullkey[168]; WCHAR fullkey[168];
WCHAR buf[39]; WCHAR buf[39];
HKEY hkey; HKEY hkey;
GUID catid; GUID catid;
HRESULT hr; HRESULT hr;
ITfCategoryMgr *catmgr; ITfCategoryMgr *catmgr;
InputProcessorProfiles *This = (InputProcessorProfiles*)iface;
static const GUID * tipcats[3] = { &GUID_TFCAT_TIP_KEYBOARD, static const GUID * tipcats[3] = { &GUID_TFCAT_TIP_KEYBOARD,
&GUID_TFCAT_TIP_SPEECH, &GUID_TFCAT_TIP_SPEECH,
&GUID_TFCAT_TIP_HANDWRITING }; &GUID_TFCAT_TIP_HANDWRITING };
@ -386,10 +400,10 @@ static HRESULT WINAPI InputProcessorProfiles_ActivateLanguageProfile(
ITfInputProcessorProfiles *iface, REFCLSID rclsid, LANGID langid, ITfInputProcessorProfiles *iface, REFCLSID rclsid, LANGID langid,
REFGUID guidProfiles) REFGUID guidProfiles)
{ {
InputProcessorProfiles *This = impl_from_ITfInputProcessorProfiles(iface);
HRESULT hr; HRESULT hr;
BOOL enabled; BOOL enabled;
TF_LANGUAGEPROFILE LanguageProfile; TF_LANGUAGEPROFILE LanguageProfile;
InputProcessorProfiles *This = (InputProcessorProfiles*)iface;
TRACE("(%p) %s %x %s\n",This,debugstr_guid(rclsid),langid,debugstr_guid(guidProfiles)); TRACE("(%p) %s %x %s\n",This,debugstr_guid(rclsid),langid,debugstr_guid(guidProfiles));
@ -422,8 +436,8 @@ static HRESULT WINAPI InputProcessorProfiles_GetActiveLanguageProfile(
ITfInputProcessorProfiles *iface, REFCLSID rclsid, LANGID *plangid, ITfInputProcessorProfiles *iface, REFCLSID rclsid, LANGID *plangid,
GUID *pguidProfile) GUID *pguidProfile)
{ {
InputProcessorProfiles *This = impl_from_ITfInputProcessorProfiles(iface);
TF_LANGUAGEPROFILE profile; TF_LANGUAGEPROFILE profile;
InputProcessorProfiles *This = (InputProcessorProfiles*)iface;
TRACE("(%p) %s %p %p\n",This,debugstr_guid(rclsid),plangid,pguidProfile); TRACE("(%p) %s %p %p\n",This,debugstr_guid(rclsid),plangid,pguidProfile);
@ -447,7 +461,7 @@ static HRESULT WINAPI InputProcessorProfiles_GetLanguageProfileDescription(
ITfInputProcessorProfiles *iface, REFCLSID rclsid, LANGID langid, ITfInputProcessorProfiles *iface, REFCLSID rclsid, LANGID langid,
REFGUID guidProfile, BSTR *pbstrProfile) REFGUID guidProfile, BSTR *pbstrProfile)
{ {
InputProcessorProfiles *This = (InputProcessorProfiles*)iface; InputProcessorProfiles *This = impl_from_ITfInputProcessorProfiles(iface);
FIXME("STUB:(%p)\n",This); FIXME("STUB:(%p)\n",This);
return E_NOTIMPL; return E_NOTIMPL;
} }
@ -455,7 +469,7 @@ static HRESULT WINAPI InputProcessorProfiles_GetLanguageProfileDescription(
static HRESULT WINAPI InputProcessorProfiles_GetCurrentLanguage( static HRESULT WINAPI InputProcessorProfiles_GetCurrentLanguage(
ITfInputProcessorProfiles *iface, LANGID *plangid) ITfInputProcessorProfiles *iface, LANGID *plangid)
{ {
InputProcessorProfiles *This = (InputProcessorProfiles*)iface; InputProcessorProfiles *This = impl_from_ITfInputProcessorProfiles(iface);
TRACE("(%p) 0x%x\n",This,This->currentLanguage); TRACE("(%p) 0x%x\n",This,This->currentLanguage);
if (!plangid) if (!plangid)
@ -469,8 +483,8 @@ static HRESULT WINAPI InputProcessorProfiles_GetCurrentLanguage(
static HRESULT WINAPI InputProcessorProfiles_ChangeCurrentLanguage( static HRESULT WINAPI InputProcessorProfiles_ChangeCurrentLanguage(
ITfInputProcessorProfiles *iface, LANGID langid) ITfInputProcessorProfiles *iface, LANGID langid)
{ {
InputProcessorProfiles *This = impl_from_ITfInputProcessorProfiles(iface);
struct list *cursor; struct list *cursor;
InputProcessorProfiles *This = (InputProcessorProfiles*)iface;
BOOL accept; BOOL accept;
FIXME("STUB:(%p)\n",This); FIXME("STUB:(%p)\n",This);
@ -491,7 +505,7 @@ static HRESULT WINAPI InputProcessorProfiles_ChangeCurrentLanguage(
static HRESULT WINAPI InputProcessorProfiles_GetLanguageList( static HRESULT WINAPI InputProcessorProfiles_GetLanguageList(
ITfInputProcessorProfiles *iface, LANGID **ppLangId, ULONG *pulCount) ITfInputProcessorProfiles *iface, LANGID **ppLangId, ULONG *pulCount)
{ {
InputProcessorProfiles *This = (InputProcessorProfiles*)iface; InputProcessorProfiles *This = impl_from_ITfInputProcessorProfiles(iface);
FIXME("Semi-STUB:(%p)\n",This); FIXME("Semi-STUB:(%p)\n",This);
*ppLangId = CoTaskMemAlloc(sizeof(LANGID)); *ppLangId = CoTaskMemAlloc(sizeof(LANGID));
**ppLangId = This->currentLanguage; **ppLangId = This->currentLanguage;
@ -503,7 +517,7 @@ static HRESULT WINAPI InputProcessorProfiles_EnumLanguageProfiles(
ITfInputProcessorProfiles *iface, LANGID langid, ITfInputProcessorProfiles *iface, LANGID langid,
IEnumTfLanguageProfiles **ppEnum) IEnumTfLanguageProfiles **ppEnum)
{ {
InputProcessorProfiles *This = (InputProcessorProfiles*)iface; InputProcessorProfiles *This = impl_from_ITfInputProcessorProfiles(iface);
TRACE("(%p) %x %p\n",This,langid,ppEnum); TRACE("(%p) %x %p\n",This,langid,ppEnum);
return EnumTfLanguageProfiles_Constructor(langid, ppEnum); return EnumTfLanguageProfiles_Constructor(langid, ppEnum);
} }
@ -512,13 +526,13 @@ static HRESULT WINAPI InputProcessorProfiles_EnableLanguageProfile(
ITfInputProcessorProfiles *iface, REFCLSID rclsid, LANGID langid, ITfInputProcessorProfiles *iface, REFCLSID rclsid, LANGID langid,
REFGUID guidProfile, BOOL fEnable) REFGUID guidProfile, BOOL fEnable)
{ {
InputProcessorProfiles *This = impl_from_ITfInputProcessorProfiles(iface);
HKEY key; HKEY key;
WCHAR buf[39]; WCHAR buf[39];
WCHAR buf2[39]; WCHAR buf2[39];
WCHAR fullkey[168]; WCHAR fullkey[168];
ULONG res; ULONG res;
InputProcessorProfiles *This = (InputProcessorProfiles*)iface;
TRACE("(%p) %s %x %s %i\n",This, debugstr_guid(rclsid), langid, debugstr_guid(guidProfile), fEnable); TRACE("(%p) %s %x %s %i\n",This, debugstr_guid(rclsid), langid, debugstr_guid(guidProfile), fEnable);
StringFromGUID2(rclsid, buf, 39); StringFromGUID2(rclsid, buf, 39);
@ -542,13 +556,13 @@ static HRESULT WINAPI InputProcessorProfiles_IsEnabledLanguageProfile(
ITfInputProcessorProfiles *iface, REFCLSID rclsid, LANGID langid, ITfInputProcessorProfiles *iface, REFCLSID rclsid, LANGID langid,
REFGUID guidProfile, BOOL *pfEnable) REFGUID guidProfile, BOOL *pfEnable)
{ {
InputProcessorProfiles *This = impl_from_ITfInputProcessorProfiles(iface);
HKEY key; HKEY key;
WCHAR buf[39]; WCHAR buf[39];
WCHAR buf2[39]; WCHAR buf2[39];
WCHAR fullkey[168]; WCHAR fullkey[168];
ULONG res; ULONG res;
InputProcessorProfiles *This = (InputProcessorProfiles*)iface;
TRACE("(%p) %s, %i, %s, %p\n",This,debugstr_guid(rclsid),langid,debugstr_guid(guidProfile),pfEnable); TRACE("(%p) %s, %i, %s, %p\n",This,debugstr_guid(rclsid),langid,debugstr_guid(guidProfile),pfEnable);
if (!pfEnable) if (!pfEnable)
@ -589,13 +603,13 @@ static HRESULT WINAPI InputProcessorProfiles_EnableLanguageProfileByDefault(
ITfInputProcessorProfiles *iface, REFCLSID rclsid, LANGID langid, ITfInputProcessorProfiles *iface, REFCLSID rclsid, LANGID langid,
REFGUID guidProfile, BOOL fEnable) REFGUID guidProfile, BOOL fEnable)
{ {
InputProcessorProfiles *This = impl_from_ITfInputProcessorProfiles(iface);
HKEY key; HKEY key;
WCHAR buf[39]; WCHAR buf[39];
WCHAR buf2[39]; WCHAR buf2[39];
WCHAR fullkey[168]; WCHAR fullkey[168];
ULONG res; ULONG res;
InputProcessorProfiles *This = (InputProcessorProfiles*)iface;
TRACE("(%p) %s %x %s %i\n",This,debugstr_guid(rclsid),langid,debugstr_guid(guidProfile),fEnable); TRACE("(%p) %s %x %s %i\n",This,debugstr_guid(rclsid),langid,debugstr_guid(guidProfile),fEnable);
StringFromGUID2(rclsid, buf, 39); StringFromGUID2(rclsid, buf, 39);
@ -619,18 +633,16 @@ static HRESULT WINAPI InputProcessorProfiles_SubstituteKeyboardLayout(
ITfInputProcessorProfiles *iface, REFCLSID rclsid, LANGID langid, ITfInputProcessorProfiles *iface, REFCLSID rclsid, LANGID langid,
REFGUID guidProfile, HKL hKL) REFGUID guidProfile, HKL hKL)
{ {
InputProcessorProfiles *This = (InputProcessorProfiles*)iface; InputProcessorProfiles *This = impl_from_ITfInputProcessorProfiles(iface);
FIXME("STUB:(%p)\n",This); FIXME("STUB:(%p)\n",This);
return E_NOTIMPL; return E_NOTIMPL;
} }
static const ITfInputProcessorProfilesVtbl InputProcessorProfilesVtbl =
static const ITfInputProcessorProfilesVtbl InputProcessorProfiles_InputProcessorProfilesVtbl =
{ {
InputProcessorProfiles_QueryInterface, InputProcessorProfiles_QueryInterface,
InputProcessorProfiles_AddRef, InputProcessorProfiles_AddRef,
InputProcessorProfiles_Release, InputProcessorProfiles_Release,
InputProcessorProfiles_Register, InputProcessorProfiles_Register,
InputProcessorProfiles_Unregister, InputProcessorProfiles_Unregister,
InputProcessorProfiles_AddLanguageProfile, InputProcessorProfiles_AddLanguageProfile,
@ -656,27 +668,27 @@ static const ITfInputProcessorProfilesVtbl InputProcessorProfiles_InputProcessor
*****************************************************/ *****************************************************/
static HRESULT WINAPI IPPSource_QueryInterface(ITfSource *iface, REFIID iid, LPVOID *ppvOut) static HRESULT WINAPI IPPSource_QueryInterface(ITfSource *iface, REFIID iid, LPVOID *ppvOut)
{ {
InputProcessorProfiles *This = impl_from_ITfSourceVtbl(iface); InputProcessorProfiles *This = impl_from_ITfSource(iface);
return InputProcessorProfiles_QueryInterface((ITfInputProcessorProfiles *)This, iid, *ppvOut); return ITfInputProcessorProfiles_QueryInterface(&This->ITfInputProcessorProfiles_iface, iid, ppvOut);
} }
static ULONG WINAPI IPPSource_AddRef(ITfSource *iface) static ULONG WINAPI IPPSource_AddRef(ITfSource *iface)
{ {
InputProcessorProfiles *This = impl_from_ITfSourceVtbl(iface); InputProcessorProfiles *This = impl_from_ITfSource(iface);
return InputProcessorProfiles_AddRef((ITfInputProcessorProfiles*)This); return ITfInputProcessorProfiles_AddRef(&This->ITfInputProcessorProfiles_iface);
} }
static ULONG WINAPI IPPSource_Release(ITfSource *iface) static ULONG WINAPI IPPSource_Release(ITfSource *iface)
{ {
InputProcessorProfiles *This = impl_from_ITfSourceVtbl(iface); InputProcessorProfiles *This = impl_from_ITfSource(iface);
return InputProcessorProfiles_Release((ITfInputProcessorProfiles *)This); return ITfInputProcessorProfiles_Release(&This->ITfInputProcessorProfiles_iface);
} }
static HRESULT WINAPI IPPSource_AdviseSink(ITfSource *iface, static HRESULT WINAPI IPPSource_AdviseSink(ITfSource *iface,
REFIID riid, IUnknown *punk, DWORD *pdwCookie) REFIID riid, IUnknown *punk, DWORD *pdwCookie)
{ {
InputProcessorProfiles *This = impl_from_ITfSource(iface);
InputProcessorProfilesSink *ipps; InputProcessorProfilesSink *ipps;
InputProcessorProfiles *This = impl_from_ITfSourceVtbl(iface);
TRACE("(%p) %s %p %p\n",This,debugstr_guid(riid),punk,pdwCookie); TRACE("(%p) %s %p %p\n",This,debugstr_guid(riid),punk,pdwCookie);
@ -709,8 +721,8 @@ static HRESULT WINAPI IPPSource_AdviseSink(ITfSource *iface,
static HRESULT WINAPI IPPSource_UnadviseSink(ITfSource *iface, DWORD pdwCookie) static HRESULT WINAPI IPPSource_UnadviseSink(ITfSource *iface, DWORD pdwCookie)
{ {
InputProcessorProfiles *This = impl_from_ITfSource(iface);
InputProcessorProfilesSink *sink; InputProcessorProfilesSink *sink;
InputProcessorProfiles *This = impl_from_ITfSourceVtbl(iface);
TRACE("(%p) %x\n",This,pdwCookie); TRACE("(%p) %x\n",This,pdwCookie);
@ -727,12 +739,11 @@ static HRESULT WINAPI IPPSource_UnadviseSink(ITfSource *iface, DWORD pdwCookie)
return S_OK; return S_OK;
} }
static const ITfSourceVtbl InputProcessorProfiles_SourceVtbl = static const ITfSourceVtbl InputProcessorProfilesSourceVtbl =
{ {
IPPSource_QueryInterface, IPPSource_QueryInterface,
IPPSource_AddRef, IPPSource_AddRef,
IPPSource_Release, IPPSource_Release,
IPPSource_AdviseSink, IPPSource_AdviseSink,
IPPSource_UnadviseSink, IPPSource_UnadviseSink,
}; };
@ -747,15 +758,15 @@ HRESULT InputProcessorProfiles_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut
if (This == NULL) if (This == NULL)
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
This->InputProcessorProfilesVtbl= &InputProcessorProfiles_InputProcessorProfilesVtbl; This->ITfInputProcessorProfiles_iface.lpVtbl= &InputProcessorProfilesVtbl;
This->SourceVtbl = &InputProcessorProfiles_SourceVtbl; This->ITfSource_iface.lpVtbl = &InputProcessorProfilesSourceVtbl;
This->refCount = 1; This->refCount = 1;
This->currentLanguage = GetUserDefaultLCID(); This->currentLanguage = GetUserDefaultLCID();
list_init(&This->LanguageProfileNotifySink); list_init(&This->LanguageProfileNotifySink);
TRACE("returning %p\n", This); *ppOut = (IUnknown *)&This->ITfInputProcessorProfiles_iface;
*ppOut = (IUnknown *)This; TRACE("returning %p\n", *ppOut);
return S_OK; return S_OK;
} }
@ -771,12 +782,12 @@ static void ProfilesEnumGuid_Destructor(ProfilesEnumGuid *This)
static HRESULT WINAPI ProfilesEnumGuid_QueryInterface(IEnumGUID *iface, REFIID iid, LPVOID *ppvOut) static HRESULT WINAPI ProfilesEnumGuid_QueryInterface(IEnumGUID *iface, REFIID iid, LPVOID *ppvOut)
{ {
ProfilesEnumGuid *This = (ProfilesEnumGuid *)iface; ProfilesEnumGuid *This = impl_from_IEnumGUID(iface);
*ppvOut = NULL; *ppvOut = NULL;
if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_IEnumGUID)) if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_IEnumGUID))
{ {
*ppvOut = This; *ppvOut = &This->IEnumGUID_iface;
} }
if (*ppvOut) if (*ppvOut)
@ -791,13 +802,13 @@ static HRESULT WINAPI ProfilesEnumGuid_QueryInterface(IEnumGUID *iface, REFIID i
static ULONG WINAPI ProfilesEnumGuid_AddRef(IEnumGUID *iface) static ULONG WINAPI ProfilesEnumGuid_AddRef(IEnumGUID *iface)
{ {
ProfilesEnumGuid *This = (ProfilesEnumGuid*)iface; ProfilesEnumGuid *This = impl_from_IEnumGUID(iface);
return InterlockedIncrement(&This->refCount); return InterlockedIncrement(&This->refCount);
} }
static ULONG WINAPI ProfilesEnumGuid_Release(IEnumGUID *iface) static ULONG WINAPI ProfilesEnumGuid_Release(IEnumGUID *iface)
{ {
ProfilesEnumGuid *This = (ProfilesEnumGuid *)iface; ProfilesEnumGuid *This = impl_from_IEnumGUID(iface);
ULONG ret; ULONG ret;
ret = InterlockedDecrement(&This->refCount); ret = InterlockedDecrement(&This->refCount);
@ -812,7 +823,7 @@ static ULONG WINAPI ProfilesEnumGuid_Release(IEnumGUID *iface)
static HRESULT WINAPI ProfilesEnumGuid_Next( LPENUMGUID iface, static HRESULT WINAPI ProfilesEnumGuid_Next( LPENUMGUID iface,
ULONG celt, GUID *rgelt, ULONG *pceltFetched) ULONG celt, GUID *rgelt, ULONG *pceltFetched)
{ {
ProfilesEnumGuid *This = (ProfilesEnumGuid *)iface; ProfilesEnumGuid *This = impl_from_IEnumGUID(iface);
ULONG fetched = 0; ULONG fetched = 0;
TRACE("(%p)\n",This); TRACE("(%p)\n",This);
@ -844,7 +855,7 @@ static HRESULT WINAPI ProfilesEnumGuid_Next( LPENUMGUID iface,
static HRESULT WINAPI ProfilesEnumGuid_Skip( LPENUMGUID iface, ULONG celt) static HRESULT WINAPI ProfilesEnumGuid_Skip( LPENUMGUID iface, ULONG celt)
{ {
ProfilesEnumGuid *This = (ProfilesEnumGuid *)iface; ProfilesEnumGuid *This = impl_from_IEnumGUID(iface);
TRACE("(%p)\n",This); TRACE("(%p)\n",This);
This->next_index += celt; This->next_index += celt;
@ -853,7 +864,7 @@ static HRESULT WINAPI ProfilesEnumGuid_Skip( LPENUMGUID iface, ULONG celt)
static HRESULT WINAPI ProfilesEnumGuid_Reset( LPENUMGUID iface) static HRESULT WINAPI ProfilesEnumGuid_Reset( LPENUMGUID iface)
{ {
ProfilesEnumGuid *This = (ProfilesEnumGuid *)iface; ProfilesEnumGuid *This = impl_from_IEnumGUID(iface);
TRACE("(%p)\n",This); TRACE("(%p)\n",This);
This->next_index = 0; This->next_index = 0;
return S_OK; return S_OK;
@ -862,7 +873,7 @@ static HRESULT WINAPI ProfilesEnumGuid_Reset( LPENUMGUID iface)
static HRESULT WINAPI ProfilesEnumGuid_Clone( LPENUMGUID iface, static HRESULT WINAPI ProfilesEnumGuid_Clone( LPENUMGUID iface,
IEnumGUID **ppenum) IEnumGUID **ppenum)
{ {
ProfilesEnumGuid *This = (ProfilesEnumGuid *)iface; ProfilesEnumGuid *This = impl_from_IEnumGUID(iface);
HRESULT res; HRESULT res;
TRACE("(%p)\n",This); TRACE("(%p)\n",This);
@ -872,17 +883,17 @@ static HRESULT WINAPI ProfilesEnumGuid_Clone( LPENUMGUID iface,
res = ProfilesEnumGuid_Constructor(ppenum); res = ProfilesEnumGuid_Constructor(ppenum);
if (SUCCEEDED(res)) if (SUCCEEDED(res))
{ {
ProfilesEnumGuid *new_This = (ProfilesEnumGuid *)*ppenum; ProfilesEnumGuid *new_This = impl_from_IEnumGUID(*ppenum);
new_This->next_index = This->next_index; new_This->next_index = This->next_index;
} }
return res; return res;
} }
static const IEnumGUIDVtbl IEnumGUID_Vtbl ={ static const IEnumGUIDVtbl EnumGUIDVtbl =
{
ProfilesEnumGuid_QueryInterface, ProfilesEnumGuid_QueryInterface,
ProfilesEnumGuid_AddRef, ProfilesEnumGuid_AddRef,
ProfilesEnumGuid_Release, ProfilesEnumGuid_Release,
ProfilesEnumGuid_Next, ProfilesEnumGuid_Next,
ProfilesEnumGuid_Skip, ProfilesEnumGuid_Skip,
ProfilesEnumGuid_Reset, ProfilesEnumGuid_Reset,
@ -897,7 +908,7 @@ static HRESULT ProfilesEnumGuid_Constructor(IEnumGUID **ppOut)
if (This == NULL) if (This == NULL)
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
This->Vtbl= &IEnumGUID_Vtbl; This->IEnumGUID_iface.lpVtbl= &EnumGUIDVtbl;
This->refCount = 1; This->refCount = 1;
if (RegCreateKeyExW(HKEY_LOCAL_MACHINE, szwSystemTIPKey, 0, NULL, 0, if (RegCreateKeyExW(HKEY_LOCAL_MACHINE, szwSystemTIPKey, 0, NULL, 0,
@ -907,8 +918,8 @@ static HRESULT ProfilesEnumGuid_Constructor(IEnumGUID **ppOut)
return E_FAIL; return E_FAIL;
} }
TRACE("returning %p\n", This); *ppOut = &This->IEnumGUID_iface;
*ppOut = (IEnumGUID*)This; TRACE("returning %p\n", *ppOut);
return S_OK; return S_OK;
} }
@ -927,12 +938,13 @@ static void EnumTfLanguageProfiles_Destructor(EnumTfLanguageProfiles *This)
static HRESULT WINAPI EnumTfLanguageProfiles_QueryInterface(IEnumTfLanguageProfiles *iface, REFIID iid, LPVOID *ppvOut) static HRESULT WINAPI EnumTfLanguageProfiles_QueryInterface(IEnumTfLanguageProfiles *iface, REFIID iid, LPVOID *ppvOut)
{ {
EnumTfLanguageProfiles *This = (EnumTfLanguageProfiles *)iface; EnumTfLanguageProfiles *This = impl_from_IEnumTfLanguageProfiles(iface);
*ppvOut = NULL; *ppvOut = NULL;
if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_IEnumTfLanguageProfiles)) if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_IEnumTfLanguageProfiles))
{ {
*ppvOut = This; *ppvOut = &This->IEnumTfLanguageProfiles_iface;
} }
if (*ppvOut) if (*ppvOut)
@ -947,13 +959,13 @@ static HRESULT WINAPI EnumTfLanguageProfiles_QueryInterface(IEnumTfLanguageProfi
static ULONG WINAPI EnumTfLanguageProfiles_AddRef(IEnumTfLanguageProfiles *iface) static ULONG WINAPI EnumTfLanguageProfiles_AddRef(IEnumTfLanguageProfiles *iface)
{ {
EnumTfLanguageProfiles *This = (EnumTfLanguageProfiles*)iface; EnumTfLanguageProfiles *This = impl_from_IEnumTfLanguageProfiles(iface);
return InterlockedIncrement(&This->refCount); return InterlockedIncrement(&This->refCount);
} }
static ULONG WINAPI EnumTfLanguageProfiles_Release(IEnumTfLanguageProfiles *iface) static ULONG WINAPI EnumTfLanguageProfiles_Release(IEnumTfLanguageProfiles *iface)
{ {
EnumTfLanguageProfiles *This = (EnumTfLanguageProfiles *)iface; EnumTfLanguageProfiles *This = impl_from_IEnumTfLanguageProfiles(iface);
ULONG ret; ULONG ret;
ret = InterlockedDecrement(&This->refCount); ret = InterlockedDecrement(&This->refCount);
@ -1020,7 +1032,7 @@ static INT next_LanguageProfile(EnumTfLanguageProfiles *This, CLSID clsid, TF_LA
static HRESULT WINAPI EnumTfLanguageProfiles_Next(IEnumTfLanguageProfiles *iface, static HRESULT WINAPI EnumTfLanguageProfiles_Next(IEnumTfLanguageProfiles *iface,
ULONG ulCount, TF_LANGUAGEPROFILE *pProfile, ULONG *pcFetch) ULONG ulCount, TF_LANGUAGEPROFILE *pProfile, ULONG *pcFetch)
{ {
EnumTfLanguageProfiles *This = (EnumTfLanguageProfiles *)iface; EnumTfLanguageProfiles *This = impl_from_IEnumTfLanguageProfiles(iface);
ULONG fetched = 0; ULONG fetched = 0;
TRACE("(%p)\n",This); TRACE("(%p)\n",This);
@ -1062,14 +1074,14 @@ static HRESULT WINAPI EnumTfLanguageProfiles_Next(IEnumTfLanguageProfiles *iface
static HRESULT WINAPI EnumTfLanguageProfiles_Skip( IEnumTfLanguageProfiles* iface, ULONG celt) static HRESULT WINAPI EnumTfLanguageProfiles_Skip( IEnumTfLanguageProfiles* iface, ULONG celt)
{ {
EnumTfLanguageProfiles *This = (EnumTfLanguageProfiles *)iface; EnumTfLanguageProfiles *This = impl_from_IEnumTfLanguageProfiles(iface);
FIXME("STUB (%p)\n",This); FIXME("STUB (%p)\n",This);
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT WINAPI EnumTfLanguageProfiles_Reset( IEnumTfLanguageProfiles* iface) static HRESULT WINAPI EnumTfLanguageProfiles_Reset( IEnumTfLanguageProfiles* iface)
{ {
EnumTfLanguageProfiles *This = (EnumTfLanguageProfiles *)iface; EnumTfLanguageProfiles *This = impl_from_IEnumTfLanguageProfiles(iface);
TRACE("(%p)\n",This); TRACE("(%p)\n",This);
This->tip_index = 0; This->tip_index = 0;
if (This->langkey) if (This->langkey)
@ -1082,7 +1094,7 @@ static HRESULT WINAPI EnumTfLanguageProfiles_Reset( IEnumTfLanguageProfiles* ifa
static HRESULT WINAPI EnumTfLanguageProfiles_Clone( IEnumTfLanguageProfiles *iface, static HRESULT WINAPI EnumTfLanguageProfiles_Clone( IEnumTfLanguageProfiles *iface,
IEnumTfLanguageProfiles **ppenum) IEnumTfLanguageProfiles **ppenum)
{ {
EnumTfLanguageProfiles *This = (EnumTfLanguageProfiles *)iface; EnumTfLanguageProfiles *This = impl_from_IEnumTfLanguageProfiles(iface);
HRESULT res; HRESULT res;
TRACE("(%p)\n",This); TRACE("(%p)\n",This);
@ -1109,11 +1121,11 @@ static HRESULT WINAPI EnumTfLanguageProfiles_Clone( IEnumTfLanguageProfiles *ifa
return res; return res;
} }
static const IEnumTfLanguageProfilesVtbl IEnumTfLanguageProfiles_Vtbl ={ static const IEnumTfLanguageProfilesVtbl EnumTfLanguageProfilesVtbl =
{
EnumTfLanguageProfiles_QueryInterface, EnumTfLanguageProfiles_QueryInterface,
EnumTfLanguageProfiles_AddRef, EnumTfLanguageProfiles_AddRef,
EnumTfLanguageProfiles_Release, EnumTfLanguageProfiles_Release,
EnumTfLanguageProfiles_Clone, EnumTfLanguageProfiles_Clone,
EnumTfLanguageProfiles_Next, EnumTfLanguageProfiles_Next,
EnumTfLanguageProfiles_Reset, EnumTfLanguageProfiles_Reset,
@ -1129,7 +1141,7 @@ static HRESULT EnumTfLanguageProfiles_Constructor(LANGID langid, IEnumTfLanguage
if (This == NULL) if (This == NULL)
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
This->Vtbl= &IEnumTfLanguageProfiles_Vtbl; This->IEnumTfLanguageProfiles_iface.lpVtbl= &EnumTfLanguageProfilesVtbl;
This->refCount = 1; This->refCount = 1;
This->langid = langid; This->langid = langid;
@ -1147,7 +1159,7 @@ static HRESULT EnumTfLanguageProfiles_Constructor(LANGID langid, IEnumTfLanguage
return E_FAIL; return E_FAIL;
} }
TRACE("returning %p\n", This); *ppOut = &This->IEnumTfLanguageProfiles_iface;
*ppOut = (IEnumTfLanguageProfiles*)This; TRACE("returning %p\n", *ppOut);
return S_OK; return S_OK;
} }

View file

@ -46,7 +46,7 @@ static HRESULT WINAPI LangBarMgr_QueryInterface(ITfLangBarMgr *iface, REFIID iid
if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_ITfLangBarMgr)) if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_ITfLangBarMgr))
{ {
*ppvOut = This; *ppvOut = &This->ITfLangBarMgr_iface;
} }
if (*ppvOut) if (*ppvOut)
@ -182,7 +182,7 @@ HRESULT LangBarMgr_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut)
This->ITfLangBarMgr_iface.lpVtbl = &LangBarMgr_LangBarMgrVtbl; This->ITfLangBarMgr_iface.lpVtbl = &LangBarMgr_LangBarMgrVtbl;
This->refCount = 1; This->refCount = 1;
TRACE("returning %p\n", This); *ppOut = (IUnknown *)&This->ITfLangBarMgr_iface;
*ppOut = (IUnknown *)This; TRACE("returning %p\n", *ppOut);
return S_OK; return S_OK;
} }

View file

@ -18,6 +18,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#pragma makedep register
[ [
threading(apartment), threading(apartment),
uuid(529a9e6b-6587-4f23-ab9e-9c7d683e3c50) uuid(529a9e6b-6587-4f23-ab9e-9c7d683e3c50)

View file

@ -52,7 +52,7 @@ static HRESULT WINAPI Range_QueryInterface(ITfRange *iface, REFIID iid, LPVOID *
if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_ITfRange)) if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_ITfRange))
{ {
*ppvOut = This; *ppvOut = &This->ITfRange_iface;
} }
if (*ppvOut) if (*ppvOut)
@ -325,7 +325,7 @@ HRESULT Range_Constructor(ITfContext *context, ITextStoreACP *textstore, DWORD l
This->anchorEnd = anchorEnd; This->anchorEnd = anchorEnd;
*ppOut = &This->ITfRange_iface; *ppOut = &This->ITfRange_iface;
TRACE("returning %p\n", This); TRACE("returning %p\n", *ppOut);
return S_OK; return S_OK;
} }
@ -339,7 +339,7 @@ HRESULT TF_SELECTION_to_TS_SELECTION_ACP(const TF_SELECTION *tf, TS_SELECTION_AC
if (!tf || !tsAcp || !tf->range) if (!tf || !tsAcp || !tf->range)
return E_INVALIDARG; return E_INVALIDARG;
This = (Range *)tf->range; This = impl_from_ITfRange(tf->range);
tsAcp->acpStart = This->anchorStart; tsAcp->acpStart = This->anchorStart;
tsAcp->acpEnd = This->anchorEnd; tsAcp->acpEnd = This->anchorEnd;

View file

@ -57,22 +57,22 @@ typedef struct tagAssociatedWindow
} AssociatedWindow; } AssociatedWindow;
typedef struct tagACLMulti { typedef struct tagACLMulti {
const ITfThreadMgrVtbl *ThreadMgrVtbl; ITfThreadMgr ITfThreadMgr_iface;
const ITfSourceVtbl *SourceVtbl; ITfSource ITfSource_iface;
const ITfKeystrokeMgrVtbl *KeystrokeMgrVtbl; ITfKeystrokeMgr ITfKeystrokeMgr_iface;
const ITfMessagePumpVtbl *MessagePumpVtbl; ITfMessagePump ITfMessagePump_iface;
const ITfClientIdVtbl *ClientIdVtbl; ITfClientId ITfClientId_iface;
/* const ITfThreadMgrExVtbl *ThreadMgrExVtbl; */ /* const ITfThreadMgrExVtbl *ThreadMgrExVtbl; */
/* const ITfConfigureSystemKeystrokeFeedVtbl *ConfigureSystemKeystrokeFeedVtbl; */ /* const ITfConfigureSystemKeystrokeFeedVtbl *ConfigureSystemKeystrokeFeedVtbl; */
/* const ITfLangBarItemMgrVtbl *LangBarItemMgrVtbl; */ /* const ITfLangBarItemMgrVtbl *LangBarItemMgrVtbl; */
/* const ITfUIElementMgrVtbl *UIElementMgrVtbl; */ /* const ITfUIElementMgrVtbl *UIElementMgrVtbl; */
const ITfSourceSingleVtbl *SourceSingleVtbl; ITfSourceSingle ITfSourceSingle_iface;
LONG refCount; LONG refCount;
/* Aggregation */ /* Aggregation */
ITfCompartmentMgr *CompartmentMgr; ITfCompartmentMgr *CompartmentMgr;
const ITfThreadMgrEventSinkVtbl *ThreadMgrEventSinkVtbl; /* internal */ ITfThreadMgrEventSink ITfThreadMgrEventSink_iface; /* internal */
ITfDocumentMgr *focus; ITfDocumentMgr *focus;
LONG activationCount; LONG activationCount;
@ -96,7 +96,7 @@ typedef struct tagACLMulti {
} ThreadMgr; } ThreadMgr;
typedef struct tagEnumTfDocumentMgr { typedef struct tagEnumTfDocumentMgr {
const IEnumTfDocumentMgrsVtbl *Vtbl; IEnumTfDocumentMgrs IEnumTfDocumentMgrs_iface;
LONG refCount; LONG refCount;
struct list *index; struct list *index;
@ -105,35 +105,44 @@ typedef struct tagEnumTfDocumentMgr {
static HRESULT EnumTfDocumentMgr_Constructor(struct list* head, IEnumTfDocumentMgrs **ppOut); static HRESULT EnumTfDocumentMgr_Constructor(struct list* head, IEnumTfDocumentMgrs **ppOut);
static inline ThreadMgr *impl_from_ITfSourceVtbl(ITfSource *iface) static inline ThreadMgr *impl_from_ITfThreadMgr(ITfThreadMgr *iface)
{ {
return (ThreadMgr *)((char *)iface - FIELD_OFFSET(ThreadMgr,SourceVtbl)); return CONTAINING_RECORD(iface, ThreadMgr, ITfThreadMgr_iface);
} }
static inline ThreadMgr *impl_from_ITfKeystrokeMgrVtbl(ITfKeystrokeMgr *iface) static inline ThreadMgr *impl_from_ITfSource(ITfSource *iface)
{ {
return (ThreadMgr *)((char *)iface - FIELD_OFFSET(ThreadMgr,KeystrokeMgrVtbl)); return CONTAINING_RECORD(iface, ThreadMgr, ITfSource_iface);
} }
static inline ThreadMgr *impl_from_ITfMessagePumpVtbl(ITfMessagePump *iface) static inline ThreadMgr *impl_from_ITfKeystrokeMgr(ITfKeystrokeMgr *iface)
{ {
return (ThreadMgr *)((char *)iface - FIELD_OFFSET(ThreadMgr,MessagePumpVtbl)); return CONTAINING_RECORD(iface, ThreadMgr, ITfKeystrokeMgr_iface);
} }
static inline ThreadMgr *impl_from_ITfClientIdVtbl(ITfClientId *iface) static inline ThreadMgr *impl_from_ITfMessagePump(ITfMessagePump *iface)
{ {
return (ThreadMgr *)((char *)iface - FIELD_OFFSET(ThreadMgr,ClientIdVtbl)); return CONTAINING_RECORD(iface, ThreadMgr, ITfMessagePump_iface);
}
static inline ThreadMgr *impl_from_ITfClientId(ITfClientId *iface)
{
return CONTAINING_RECORD(iface, ThreadMgr, ITfClientId_iface);
} }
static inline ThreadMgr *impl_from_ITfThreadMgrEventSink(ITfThreadMgrEventSink *iface) static inline ThreadMgr *impl_from_ITfThreadMgrEventSink(ITfThreadMgrEventSink *iface)
{ {
return (ThreadMgr *)((char *)iface - FIELD_OFFSET(ThreadMgr,ThreadMgrEventSinkVtbl)); return CONTAINING_RECORD(iface, ThreadMgr, ITfThreadMgrEventSink_iface);
} }
static inline ThreadMgr *impl_from_ITfSourceSingleVtbl(ITfSourceSingle* iface) static inline ThreadMgr *impl_from_ITfSourceSingle(ITfSourceSingle *iface)
{ {
return (ThreadMgr *)((char *)iface - FIELD_OFFSET(ThreadMgr,SourceSingleVtbl)); return CONTAINING_RECORD(iface, ThreadMgr, ITfSourceSingle_iface);
}
static inline EnumTfDocumentMgr *impl_from_IEnumTfDocumentMgrs(IEnumTfDocumentMgrs *iface)
{
return CONTAINING_RECORD(iface, EnumTfDocumentMgr, IEnumTfDocumentMgrs_iface);
} }
static void free_sink(ThreadMgrSink *sink) static void free_sink(ThreadMgrSink *sink)
@ -223,28 +232,28 @@ static void ThreadMgr_Destructor(ThreadMgr *This)
static HRESULT WINAPI ThreadMgr_QueryInterface(ITfThreadMgr *iface, REFIID iid, LPVOID *ppvOut) static HRESULT WINAPI ThreadMgr_QueryInterface(ITfThreadMgr *iface, REFIID iid, LPVOID *ppvOut)
{ {
ThreadMgr *This = (ThreadMgr *)iface; ThreadMgr *This = impl_from_ITfThreadMgr(iface);
*ppvOut = NULL; *ppvOut = NULL;
if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_ITfThreadMgr)) if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_ITfThreadMgr))
{ {
*ppvOut = This; *ppvOut = &This->ITfThreadMgr_iface;
} }
else if (IsEqualIID(iid, &IID_ITfSource)) else if (IsEqualIID(iid, &IID_ITfSource))
{ {
*ppvOut = &This->SourceVtbl; *ppvOut = &This->ITfSource_iface;
} }
else if (IsEqualIID(iid, &IID_ITfKeystrokeMgr)) else if (IsEqualIID(iid, &IID_ITfKeystrokeMgr))
{ {
*ppvOut = &This->KeystrokeMgrVtbl; *ppvOut = &This->ITfKeystrokeMgr_iface;
} }
else if (IsEqualIID(iid, &IID_ITfMessagePump)) else if (IsEqualIID(iid, &IID_ITfMessagePump))
{ {
*ppvOut = &This->MessagePumpVtbl; *ppvOut = &This->ITfMessagePump_iface;
} }
else if (IsEqualIID(iid, &IID_ITfClientId)) else if (IsEqualIID(iid, &IID_ITfClientId))
{ {
*ppvOut = &This->ClientIdVtbl; *ppvOut = &This->ITfClientId_iface;
} }
else if (IsEqualIID(iid, &IID_ITfCompartmentMgr)) else if (IsEqualIID(iid, &IID_ITfCompartmentMgr))
{ {
@ -252,7 +261,7 @@ static HRESULT WINAPI ThreadMgr_QueryInterface(ITfThreadMgr *iface, REFIID iid,
} }
else if (IsEqualIID(iid, &IID_ITfSourceSingle)) else if (IsEqualIID(iid, &IID_ITfSourceSingle))
{ {
*ppvOut = &This->SourceSingleVtbl; *ppvOut = &This->ITfSourceSingle_iface;
} }
if (*ppvOut) if (*ppvOut)
@ -267,13 +276,13 @@ static HRESULT WINAPI ThreadMgr_QueryInterface(ITfThreadMgr *iface, REFIID iid,
static ULONG WINAPI ThreadMgr_AddRef(ITfThreadMgr *iface) static ULONG WINAPI ThreadMgr_AddRef(ITfThreadMgr *iface)
{ {
ThreadMgr *This = (ThreadMgr *)iface; ThreadMgr *This = impl_from_ITfThreadMgr(iface);
return InterlockedIncrement(&This->refCount); return InterlockedIncrement(&This->refCount);
} }
static ULONG WINAPI ThreadMgr_Release(ITfThreadMgr *iface) static ULONG WINAPI ThreadMgr_Release(ITfThreadMgr *iface)
{ {
ThreadMgr *This = (ThreadMgr *)iface; ThreadMgr *This = impl_from_ITfThreadMgr(iface);
ULONG ret; ULONG ret;
ret = InterlockedDecrement(&This->refCount); ret = InterlockedDecrement(&This->refCount);
@ -288,7 +297,7 @@ static ULONG WINAPI ThreadMgr_Release(ITfThreadMgr *iface)
static HRESULT WINAPI ThreadMgr_fnActivate( ITfThreadMgr* iface, TfClientId *ptid) static HRESULT WINAPI ThreadMgr_fnActivate( ITfThreadMgr* iface, TfClientId *ptid)
{ {
ThreadMgr *This = (ThreadMgr *)iface; ThreadMgr *This = impl_from_ITfThreadMgr(iface);
TRACE("(%p) %p\n",This, ptid); TRACE("(%p) %p\n",This, ptid);
@ -299,7 +308,7 @@ static HRESULT WINAPI ThreadMgr_fnActivate( ITfThreadMgr* iface, TfClientId *pti
{ {
GUID guid; GUID guid;
CoCreateGuid(&guid); CoCreateGuid(&guid);
ITfClientId_GetClientId((ITfClientId*)&This->ClientIdVtbl,&guid,&processId); ITfClientId_GetClientId(&This->ITfClientId_iface, &guid, &processId);
} }
activate_textservices(iface); activate_textservices(iface);
@ -310,7 +319,7 @@ static HRESULT WINAPI ThreadMgr_fnActivate( ITfThreadMgr* iface, TfClientId *pti
static HRESULT WINAPI ThreadMgr_fnDeactivate( ITfThreadMgr* iface) static HRESULT WINAPI ThreadMgr_fnDeactivate( ITfThreadMgr* iface)
{ {
ThreadMgr *This = (ThreadMgr *)iface; ThreadMgr *This = impl_from_ITfThreadMgr(iface);
TRACE("(%p)\n",This); TRACE("(%p)\n",This);
if (This->activationCount == 0) if (This->activationCount == 0)
@ -322,7 +331,7 @@ static HRESULT WINAPI ThreadMgr_fnDeactivate( ITfThreadMgr* iface)
{ {
if (This->focus) if (This->focus)
{ {
ITfThreadMgrEventSink_OnSetFocus((ITfThreadMgrEventSink*)&This->ThreadMgrEventSinkVtbl, 0, This->focus); ITfThreadMgrEventSink_OnSetFocus(&This->ITfThreadMgrEventSink_iface, 0, This->focus);
ITfDocumentMgr_Release(This->focus); ITfDocumentMgr_Release(This->focus);
This->focus = 0; This->focus = 0;
} }
@ -333,10 +342,9 @@ static HRESULT WINAPI ThreadMgr_fnDeactivate( ITfThreadMgr* iface)
return S_OK; return S_OK;
} }
static HRESULT WINAPI ThreadMgr_CreateDocumentMgr( ITfThreadMgr* iface, ITfDocumentMgr static HRESULT WINAPI ThreadMgr_CreateDocumentMgr(ITfThreadMgr* iface, ITfDocumentMgr **ppdim)
**ppdim)
{ {
ThreadMgr *This = (ThreadMgr *)iface; ThreadMgr *This = impl_from_ITfThreadMgr(iface);
DocumentMgrEntry *mgrentry; DocumentMgrEntry *mgrentry;
HRESULT hr; HRESULT hr;
@ -345,7 +353,7 @@ static HRESULT WINAPI ThreadMgr_CreateDocumentMgr( ITfThreadMgr* iface, ITfDocum
if (mgrentry == NULL) if (mgrentry == NULL)
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
hr = DocumentMgr_Constructor((ITfThreadMgrEventSink*)&This->ThreadMgrEventSinkVtbl, ppdim); hr = DocumentMgr_Constructor(&This->ITfThreadMgrEventSink_iface, ppdim);
if (SUCCEEDED(hr)) if (SUCCEEDED(hr))
{ {
@ -358,10 +366,9 @@ static HRESULT WINAPI ThreadMgr_CreateDocumentMgr( ITfThreadMgr* iface, ITfDocum
return hr; return hr;
} }
static HRESULT WINAPI ThreadMgr_EnumDocumentMgrs( ITfThreadMgr* iface, IEnumTfDocumentMgrs static HRESULT WINAPI ThreadMgr_EnumDocumentMgrs( ITfThreadMgr* iface, IEnumTfDocumentMgrs **ppEnum)
**ppEnum)
{ {
ThreadMgr *This = (ThreadMgr *)iface; ThreadMgr *This = impl_from_ITfThreadMgr(iface);
TRACE("(%p) %p\n",This,ppEnum); TRACE("(%p) %p\n",This,ppEnum);
if (!ppEnum) if (!ppEnum)
@ -373,7 +380,7 @@ static HRESULT WINAPI ThreadMgr_EnumDocumentMgrs( ITfThreadMgr* iface, IEnumTfDo
static HRESULT WINAPI ThreadMgr_GetFocus( ITfThreadMgr* iface, ITfDocumentMgr static HRESULT WINAPI ThreadMgr_GetFocus( ITfThreadMgr* iface, ITfDocumentMgr
**ppdimFocus) **ppdimFocus)
{ {
ThreadMgr *This = (ThreadMgr *)iface; ThreadMgr *This = impl_from_ITfThreadMgr(iface);
TRACE("(%p)\n",This); TRACE("(%p)\n",This);
if (!ppdimFocus) if (!ppdimFocus)
@ -393,8 +400,8 @@ static HRESULT WINAPI ThreadMgr_GetFocus( ITfThreadMgr* iface, ITfDocumentMgr
static HRESULT WINAPI ThreadMgr_SetFocus( ITfThreadMgr* iface, ITfDocumentMgr *pdimFocus) static HRESULT WINAPI ThreadMgr_SetFocus( ITfThreadMgr* iface, ITfDocumentMgr *pdimFocus)
{ {
ThreadMgr *This = impl_from_ITfThreadMgr(iface);
ITfDocumentMgr *check; ITfDocumentMgr *check;
ThreadMgr *This = (ThreadMgr *)iface;
TRACE("(%p) %p\n",This,pdimFocus); TRACE("(%p) %p\n",This,pdimFocus);
@ -403,7 +410,7 @@ static HRESULT WINAPI ThreadMgr_SetFocus( ITfThreadMgr* iface, ITfDocumentMgr *p
else if (FAILED(ITfDocumentMgr_QueryInterface(pdimFocus,&IID_ITfDocumentMgr,(LPVOID*) &check))) else if (FAILED(ITfDocumentMgr_QueryInterface(pdimFocus,&IID_ITfDocumentMgr,(LPVOID*) &check)))
return E_INVALIDARG; return E_INVALIDARG;
ITfThreadMgrEventSink_OnSetFocus((ITfThreadMgrEventSink*)&This->ThreadMgrEventSinkVtbl, check, This->focus); ITfThreadMgrEventSink_OnSetFocus(&This->ITfThreadMgrEventSink_iface, check, This->focus);
if (This->focus) if (This->focus)
ITfDocumentMgr_Release(This->focus); ITfDocumentMgr_Release(This->focus);
@ -467,8 +474,8 @@ static HRESULT SetupWindowsHook(ThreadMgr *This)
static HRESULT WINAPI ThreadMgr_AssociateFocus( ITfThreadMgr* iface, HWND hwnd, static HRESULT WINAPI ThreadMgr_AssociateFocus( ITfThreadMgr* iface, HWND hwnd,
ITfDocumentMgr *pdimNew, ITfDocumentMgr **ppdimPrev) ITfDocumentMgr *pdimNew, ITfDocumentMgr **ppdimPrev)
{ {
ThreadMgr *This = impl_from_ITfThreadMgr(iface);
struct list *cursor, *cursor2; struct list *cursor, *cursor2;
ThreadMgr *This = (ThreadMgr *)iface;
AssociatedWindow *wnd; AssociatedWindow *wnd;
TRACE("(%p) %p %p %p\n",This,hwnd,pdimNew,ppdimPrev); TRACE("(%p) %p %p %p\n",This,hwnd,pdimNew,ppdimPrev);
@ -508,8 +515,9 @@ ITfDocumentMgr *pdimNew, ITfDocumentMgr **ppdimPrev)
static HRESULT WINAPI ThreadMgr_IsThreadFocus( ITfThreadMgr* iface, BOOL *pfThreadFocus) static HRESULT WINAPI ThreadMgr_IsThreadFocus( ITfThreadMgr* iface, BOOL *pfThreadFocus)
{ {
ThreadMgr *This = impl_from_ITfThreadMgr(iface);
HWND focus; HWND focus;
ThreadMgr *This = (ThreadMgr *)iface;
TRACE("(%p) %p\n",This,pfThreadFocus); TRACE("(%p) %p\n",This,pfThreadFocus);
focus = GetFocus(); focus = GetFocus();
*pfThreadFocus = (focus == NULL); *pfThreadFocus = (focus == NULL);
@ -519,7 +527,7 @@ static HRESULT WINAPI ThreadMgr_IsThreadFocus( ITfThreadMgr* iface, BOOL *pfThre
static HRESULT WINAPI ThreadMgr_GetFunctionProvider( ITfThreadMgr* iface, REFCLSID clsid, static HRESULT WINAPI ThreadMgr_GetFunctionProvider( ITfThreadMgr* iface, REFCLSID clsid,
ITfFunctionProvider **ppFuncProv) ITfFunctionProvider **ppFuncProv)
{ {
ThreadMgr *This = (ThreadMgr *)iface; ThreadMgr *This = impl_from_ITfThreadMgr(iface);
FIXME("STUB:(%p)\n",This); FIXME("STUB:(%p)\n",This);
return E_NOTIMPL; return E_NOTIMPL;
} }
@ -527,7 +535,7 @@ ITfFunctionProvider **ppFuncProv)
static HRESULT WINAPI ThreadMgr_EnumFunctionProviders( ITfThreadMgr* iface, static HRESULT WINAPI ThreadMgr_EnumFunctionProviders( ITfThreadMgr* iface,
IEnumTfFunctionProviders **ppEnum) IEnumTfFunctionProviders **ppEnum)
{ {
ThreadMgr *This = (ThreadMgr *)iface; ThreadMgr *This = impl_from_ITfThreadMgr(iface);
FIXME("STUB:(%p)\n",This); FIXME("STUB:(%p)\n",This);
return E_NOTIMPL; return E_NOTIMPL;
} }
@ -535,7 +543,7 @@ IEnumTfFunctionProviders **ppEnum)
static HRESULT WINAPI ThreadMgr_GetGlobalCompartment( ITfThreadMgr* iface, static HRESULT WINAPI ThreadMgr_GetGlobalCompartment( ITfThreadMgr* iface,
ITfCompartmentMgr **ppCompMgr) ITfCompartmentMgr **ppCompMgr)
{ {
ThreadMgr *This = (ThreadMgr *)iface; ThreadMgr *This = impl_from_ITfThreadMgr(iface);
HRESULT hr; HRESULT hr;
TRACE("(%p) %p\n",This, ppCompMgr); TRACE("(%p) %p\n",This, ppCompMgr);
@ -554,12 +562,11 @@ ITfCompartmentMgr **ppCompMgr)
return S_OK; return S_OK;
} }
static const ITfThreadMgrVtbl ThreadMgr_ThreadMgrVtbl = static const ITfThreadMgrVtbl ThreadMgrVtbl =
{ {
ThreadMgr_QueryInterface, ThreadMgr_QueryInterface,
ThreadMgr_AddRef, ThreadMgr_AddRef,
ThreadMgr_Release, ThreadMgr_Release,
ThreadMgr_fnActivate, ThreadMgr_fnActivate,
ThreadMgr_fnDeactivate, ThreadMgr_fnDeactivate,
ThreadMgr_CreateDocumentMgr, ThreadMgr_CreateDocumentMgr,
@ -573,23 +580,22 @@ static const ITfThreadMgrVtbl ThreadMgr_ThreadMgrVtbl =
ThreadMgr_GetGlobalCompartment ThreadMgr_GetGlobalCompartment
}; };
static HRESULT WINAPI Source_QueryInterface(ITfSource *iface, REFIID iid, LPVOID *ppvOut) static HRESULT WINAPI Source_QueryInterface(ITfSource *iface, REFIID iid, LPVOID *ppvOut)
{ {
ThreadMgr *This = impl_from_ITfSourceVtbl(iface); ThreadMgr *This = impl_from_ITfSource(iface);
return ThreadMgr_QueryInterface((ITfThreadMgr *)This, iid, *ppvOut); return ITfThreadMgr_QueryInterface(&This->ITfThreadMgr_iface, iid, ppvOut);
} }
static ULONG WINAPI Source_AddRef(ITfSource *iface) static ULONG WINAPI Source_AddRef(ITfSource *iface)
{ {
ThreadMgr *This = impl_from_ITfSourceVtbl(iface); ThreadMgr *This = impl_from_ITfSource(iface);
return ThreadMgr_AddRef((ITfThreadMgr*)This); return ITfThreadMgr_AddRef(&This->ITfThreadMgr_iface);
} }
static ULONG WINAPI Source_Release(ITfSource *iface) static ULONG WINAPI Source_Release(ITfSource *iface)
{ {
ThreadMgr *This = impl_from_ITfSourceVtbl(iface); ThreadMgr *This = impl_from_ITfSource(iface);
return ThreadMgr_Release((ITfThreadMgr *)This); return ITfThreadMgr_Release(&This->ITfThreadMgr_iface);
} }
/***************************************************** /*****************************************************
@ -598,8 +604,8 @@ static ULONG WINAPI Source_Release(ITfSource *iface)
static HRESULT WINAPI ThreadMgrSource_AdviseSink(ITfSource *iface, static HRESULT WINAPI ThreadMgrSource_AdviseSink(ITfSource *iface,
REFIID riid, IUnknown *punk, DWORD *pdwCookie) REFIID riid, IUnknown *punk, DWORD *pdwCookie)
{ {
ThreadMgr *This = impl_from_ITfSource(iface);
ThreadMgrSink *tms; ThreadMgrSink *tms;
ThreadMgr *This = impl_from_ITfSourceVtbl(iface);
TRACE("(%p) %s %p %p\n",This,debugstr_guid(riid),punk,pdwCookie); TRACE("(%p) %s %p %p\n",This,debugstr_guid(riid),punk,pdwCookie);
@ -632,8 +638,8 @@ static HRESULT WINAPI ThreadMgrSource_AdviseSink(ITfSource *iface,
static HRESULT WINAPI ThreadMgrSource_UnadviseSink(ITfSource *iface, DWORD pdwCookie) static HRESULT WINAPI ThreadMgrSource_UnadviseSink(ITfSource *iface, DWORD pdwCookie)
{ {
ThreadMgr *This = impl_from_ITfSource(iface);
ThreadMgrSink *sink; ThreadMgrSink *sink;
ThreadMgr *This = impl_from_ITfSourceVtbl(iface);
TRACE("(%p) %x\n",This,pdwCookie); TRACE("(%p) %x\n",This,pdwCookie);
@ -650,12 +656,11 @@ static HRESULT WINAPI ThreadMgrSource_UnadviseSink(ITfSource *iface, DWORD pdwCo
return S_OK; return S_OK;
} }
static const ITfSourceVtbl ThreadMgr_SourceVtbl = static const ITfSourceVtbl ThreadMgrSourceVtbl =
{ {
Source_QueryInterface, Source_QueryInterface,
Source_AddRef, Source_AddRef,
Source_Release, Source_Release,
ThreadMgrSource_AdviseSink, ThreadMgrSource_AdviseSink,
ThreadMgrSource_UnadviseSink, ThreadMgrSource_UnadviseSink,
}; };
@ -666,26 +671,26 @@ static const ITfSourceVtbl ThreadMgr_SourceVtbl =
static HRESULT WINAPI KeystrokeMgr_QueryInterface(ITfKeystrokeMgr *iface, REFIID iid, LPVOID *ppvOut) static HRESULT WINAPI KeystrokeMgr_QueryInterface(ITfKeystrokeMgr *iface, REFIID iid, LPVOID *ppvOut)
{ {
ThreadMgr *This = impl_from_ITfKeystrokeMgrVtbl(iface); ThreadMgr *This = impl_from_ITfKeystrokeMgr(iface);
return ThreadMgr_QueryInterface((ITfThreadMgr *)This, iid, *ppvOut); return ITfThreadMgr_QueryInterface(&This->ITfThreadMgr_iface, iid, ppvOut);
} }
static ULONG WINAPI KeystrokeMgr_AddRef(ITfKeystrokeMgr *iface) static ULONG WINAPI KeystrokeMgr_AddRef(ITfKeystrokeMgr *iface)
{ {
ThreadMgr *This = impl_from_ITfKeystrokeMgrVtbl(iface); ThreadMgr *This = impl_from_ITfKeystrokeMgr(iface);
return ThreadMgr_AddRef((ITfThreadMgr*)This); return ITfThreadMgr_AddRef(&This->ITfThreadMgr_iface);
} }
static ULONG WINAPI KeystrokeMgr_Release(ITfKeystrokeMgr *iface) static ULONG WINAPI KeystrokeMgr_Release(ITfKeystrokeMgr *iface)
{ {
ThreadMgr *This = impl_from_ITfKeystrokeMgrVtbl(iface); ThreadMgr *This = impl_from_ITfKeystrokeMgr(iface);
return ThreadMgr_Release((ITfThreadMgr *)This); return ITfThreadMgr_Release(&This->ITfThreadMgr_iface);
} }
static HRESULT WINAPI KeystrokeMgr_AdviseKeyEventSink(ITfKeystrokeMgr *iface, static HRESULT WINAPI KeystrokeMgr_AdviseKeyEventSink(ITfKeystrokeMgr *iface,
TfClientId tid, ITfKeyEventSink *pSink, BOOL fForeground) TfClientId tid, ITfKeyEventSink *pSink, BOOL fForeground)
{ {
ThreadMgr *This = impl_from_ITfKeystrokeMgrVtbl(iface); ThreadMgr *This = impl_from_ITfKeystrokeMgr(iface);
CLSID textservice; CLSID textservice;
ITfKeyEventSink *check = NULL; ITfKeyEventSink *check = NULL;
@ -725,7 +730,7 @@ static HRESULT WINAPI KeystrokeMgr_AdviseKeyEventSink(ITfKeystrokeMgr *iface,
static HRESULT WINAPI KeystrokeMgr_UnadviseKeyEventSink(ITfKeystrokeMgr *iface, static HRESULT WINAPI KeystrokeMgr_UnadviseKeyEventSink(ITfKeystrokeMgr *iface,
TfClientId tid) TfClientId tid)
{ {
ThreadMgr *This = impl_from_ITfKeystrokeMgrVtbl(iface); ThreadMgr *This = impl_from_ITfKeystrokeMgr(iface);
CLSID textservice; CLSID textservice;
ITfKeyEventSink *check = NULL; ITfKeyEventSink *check = NULL;
TRACE("(%p) %x\n",This,tid); TRACE("(%p) %x\n",This,tid);
@ -757,7 +762,7 @@ static HRESULT WINAPI KeystrokeMgr_UnadviseKeyEventSink(ITfKeystrokeMgr *iface,
static HRESULT WINAPI KeystrokeMgr_GetForeground(ITfKeystrokeMgr *iface, static HRESULT WINAPI KeystrokeMgr_GetForeground(ITfKeystrokeMgr *iface,
CLSID *pclsid) CLSID *pclsid)
{ {
ThreadMgr *This = impl_from_ITfKeystrokeMgrVtbl(iface); ThreadMgr *This = impl_from_ITfKeystrokeMgr(iface);
TRACE("(%p) %p\n",This,pclsid); TRACE("(%p) %p\n",This,pclsid);
if (!pclsid) if (!pclsid)
return E_INVALIDARG; return E_INVALIDARG;
@ -772,7 +777,7 @@ static HRESULT WINAPI KeystrokeMgr_GetForeground(ITfKeystrokeMgr *iface,
static HRESULT WINAPI KeystrokeMgr_TestKeyDown(ITfKeystrokeMgr *iface, static HRESULT WINAPI KeystrokeMgr_TestKeyDown(ITfKeystrokeMgr *iface,
WPARAM wParam, LPARAM lParam, BOOL *pfEaten) WPARAM wParam, LPARAM lParam, BOOL *pfEaten)
{ {
ThreadMgr *This = impl_from_ITfKeystrokeMgrVtbl(iface); ThreadMgr *This = impl_from_ITfKeystrokeMgr(iface);
FIXME("STUB:(%p)\n",This); FIXME("STUB:(%p)\n",This);
return E_NOTIMPL; return E_NOTIMPL;
} }
@ -780,7 +785,7 @@ static HRESULT WINAPI KeystrokeMgr_TestKeyDown(ITfKeystrokeMgr *iface,
static HRESULT WINAPI KeystrokeMgr_TestKeyUp(ITfKeystrokeMgr *iface, static HRESULT WINAPI KeystrokeMgr_TestKeyUp(ITfKeystrokeMgr *iface,
WPARAM wParam, LPARAM lParam, BOOL *pfEaten) WPARAM wParam, LPARAM lParam, BOOL *pfEaten)
{ {
ThreadMgr *This = impl_from_ITfKeystrokeMgrVtbl(iface); ThreadMgr *This = impl_from_ITfKeystrokeMgr(iface);
FIXME("STUB:(%p)\n",This); FIXME("STUB:(%p)\n",This);
return E_NOTIMPL; return E_NOTIMPL;
} }
@ -788,7 +793,7 @@ static HRESULT WINAPI KeystrokeMgr_TestKeyUp(ITfKeystrokeMgr *iface,
static HRESULT WINAPI KeystrokeMgr_KeyDown(ITfKeystrokeMgr *iface, static HRESULT WINAPI KeystrokeMgr_KeyDown(ITfKeystrokeMgr *iface,
WPARAM wParam, LPARAM lParam, BOOL *pfEaten) WPARAM wParam, LPARAM lParam, BOOL *pfEaten)
{ {
ThreadMgr *This = impl_from_ITfKeystrokeMgrVtbl(iface); ThreadMgr *This = impl_from_ITfKeystrokeMgr(iface);
FIXME("STUB:(%p)\n",This); FIXME("STUB:(%p)\n",This);
return E_NOTIMPL; return E_NOTIMPL;
} }
@ -796,7 +801,7 @@ static HRESULT WINAPI KeystrokeMgr_KeyDown(ITfKeystrokeMgr *iface,
static HRESULT WINAPI KeystrokeMgr_KeyUp(ITfKeystrokeMgr *iface, static HRESULT WINAPI KeystrokeMgr_KeyUp(ITfKeystrokeMgr *iface,
WPARAM wParam, LPARAM lParam, BOOL *pfEaten) WPARAM wParam, LPARAM lParam, BOOL *pfEaten)
{ {
ThreadMgr *This = impl_from_ITfKeystrokeMgrVtbl(iface); ThreadMgr *This = impl_from_ITfKeystrokeMgr(iface);
FIXME("STUB:(%p)\n",This); FIXME("STUB:(%p)\n",This);
return E_NOTIMPL; return E_NOTIMPL;
} }
@ -804,7 +809,7 @@ static HRESULT WINAPI KeystrokeMgr_KeyUp(ITfKeystrokeMgr *iface,
static HRESULT WINAPI KeystrokeMgr_GetPreservedKey(ITfKeystrokeMgr *iface, static HRESULT WINAPI KeystrokeMgr_GetPreservedKey(ITfKeystrokeMgr *iface,
ITfContext *pic, const TF_PRESERVEDKEY *pprekey, GUID *pguid) ITfContext *pic, const TF_PRESERVEDKEY *pprekey, GUID *pguid)
{ {
ThreadMgr *This = impl_from_ITfKeystrokeMgrVtbl(iface); ThreadMgr *This = impl_from_ITfKeystrokeMgr(iface);
FIXME("STUB:(%p)\n",This); FIXME("STUB:(%p)\n",This);
return E_NOTIMPL; return E_NOTIMPL;
} }
@ -812,7 +817,7 @@ static HRESULT WINAPI KeystrokeMgr_GetPreservedKey(ITfKeystrokeMgr *iface,
static HRESULT WINAPI KeystrokeMgr_IsPreservedKey(ITfKeystrokeMgr *iface, static HRESULT WINAPI KeystrokeMgr_IsPreservedKey(ITfKeystrokeMgr *iface,
REFGUID rguid, const TF_PRESERVEDKEY *pprekey, BOOL *pfRegistered) REFGUID rguid, const TF_PRESERVEDKEY *pprekey, BOOL *pfRegistered)
{ {
ThreadMgr *This = impl_from_ITfKeystrokeMgrVtbl(iface); ThreadMgr *This = impl_from_ITfKeystrokeMgr(iface);
struct list *cursor; struct list *cursor;
TRACE("(%p) %s (%x %x) %p\n",This,debugstr_guid(rguid), (pprekey)?pprekey->uVKey:0, (pprekey)?pprekey->uModifiers:0, pfRegistered); TRACE("(%p) %s (%x %x) %p\n",This,debugstr_guid(rguid), (pprekey)?pprekey->uVKey:0, (pprekey)?pprekey->uModifiers:0, pfRegistered);
@ -838,7 +843,7 @@ static HRESULT WINAPI KeystrokeMgr_PreserveKey(ITfKeystrokeMgr *iface,
TfClientId tid, REFGUID rguid, const TF_PRESERVEDKEY *prekey, TfClientId tid, REFGUID rguid, const TF_PRESERVEDKEY *prekey,
const WCHAR *pchDesc, ULONG cchDesc) const WCHAR *pchDesc, ULONG cchDesc)
{ {
ThreadMgr *This = impl_from_ITfKeystrokeMgrVtbl(iface); ThreadMgr *This = impl_from_ITfKeystrokeMgr(iface);
struct list *cursor; struct list *cursor;
PreservedKey *newkey; PreservedKey *newkey;
@ -881,7 +886,7 @@ static HRESULT WINAPI KeystrokeMgr_PreserveKey(ITfKeystrokeMgr *iface,
static HRESULT WINAPI KeystrokeMgr_UnpreserveKey(ITfKeystrokeMgr *iface, static HRESULT WINAPI KeystrokeMgr_UnpreserveKey(ITfKeystrokeMgr *iface,
REFGUID rguid, const TF_PRESERVEDKEY *pprekey) REFGUID rguid, const TF_PRESERVEDKEY *pprekey)
{ {
ThreadMgr *This = impl_from_ITfKeystrokeMgrVtbl(iface); ThreadMgr *This = impl_from_ITfKeystrokeMgr(iface);
PreservedKey* key = NULL; PreservedKey* key = NULL;
struct list *cursor; struct list *cursor;
TRACE("(%p) %s (%x %x)\n",This,debugstr_guid(rguid),(pprekey)?pprekey->uVKey:0, (pprekey)?pprekey->uModifiers:0); TRACE("(%p) %s (%x %x)\n",This,debugstr_guid(rguid),(pprekey)?pprekey->uVKey:0, (pprekey)?pprekey->uModifiers:0);
@ -910,7 +915,7 @@ static HRESULT WINAPI KeystrokeMgr_UnpreserveKey(ITfKeystrokeMgr *iface,
static HRESULT WINAPI KeystrokeMgr_SetPreservedKeyDescription(ITfKeystrokeMgr *iface, static HRESULT WINAPI KeystrokeMgr_SetPreservedKeyDescription(ITfKeystrokeMgr *iface,
REFGUID rguid, const WCHAR *pchDesc, ULONG cchDesc) REFGUID rguid, const WCHAR *pchDesc, ULONG cchDesc)
{ {
ThreadMgr *This = impl_from_ITfKeystrokeMgrVtbl(iface); ThreadMgr *This = impl_from_ITfKeystrokeMgr(iface);
FIXME("STUB:(%p)\n",This); FIXME("STUB:(%p)\n",This);
return E_NOTIMPL; return E_NOTIMPL;
} }
@ -918,7 +923,7 @@ static HRESULT WINAPI KeystrokeMgr_SetPreservedKeyDescription(ITfKeystrokeMgr *i
static HRESULT WINAPI KeystrokeMgr_GetPreservedKeyDescription(ITfKeystrokeMgr *iface, static HRESULT WINAPI KeystrokeMgr_GetPreservedKeyDescription(ITfKeystrokeMgr *iface,
REFGUID rguid, BSTR *pbstrDesc) REFGUID rguid, BSTR *pbstrDesc)
{ {
ThreadMgr *This = impl_from_ITfKeystrokeMgrVtbl(iface); ThreadMgr *This = impl_from_ITfKeystrokeMgr(iface);
FIXME("STUB:(%p)\n",This); FIXME("STUB:(%p)\n",This);
return E_NOTIMPL; return E_NOTIMPL;
} }
@ -926,17 +931,16 @@ static HRESULT WINAPI KeystrokeMgr_GetPreservedKeyDescription(ITfKeystrokeMgr *i
static HRESULT WINAPI KeystrokeMgr_SimulatePreservedKey(ITfKeystrokeMgr *iface, static HRESULT WINAPI KeystrokeMgr_SimulatePreservedKey(ITfKeystrokeMgr *iface,
ITfContext *pic, REFGUID rguid, BOOL *pfEaten) ITfContext *pic, REFGUID rguid, BOOL *pfEaten)
{ {
ThreadMgr *This = impl_from_ITfKeystrokeMgrVtbl(iface); ThreadMgr *This = impl_from_ITfKeystrokeMgr(iface);
FIXME("STUB:(%p)\n",This); FIXME("STUB:(%p)\n",This);
return E_NOTIMPL; return E_NOTIMPL;
} }
static const ITfKeystrokeMgrVtbl ThreadMgr_KeystrokeMgrVtbl = static const ITfKeystrokeMgrVtbl KeystrokeMgrVtbl =
{ {
KeystrokeMgr_QueryInterface, KeystrokeMgr_QueryInterface,
KeystrokeMgr_AddRef, KeystrokeMgr_AddRef,
KeystrokeMgr_Release, KeystrokeMgr_Release,
KeystrokeMgr_AdviseKeyEventSink, KeystrokeMgr_AdviseKeyEventSink,
KeystrokeMgr_UnadviseKeyEventSink, KeystrokeMgr_UnadviseKeyEventSink,
KeystrokeMgr_GetForeground, KeystrokeMgr_GetForeground,
@ -959,20 +963,20 @@ static const ITfKeystrokeMgrVtbl ThreadMgr_KeystrokeMgrVtbl =
static HRESULT WINAPI MessagePump_QueryInterface(ITfMessagePump *iface, REFIID iid, LPVOID *ppvOut) static HRESULT WINAPI MessagePump_QueryInterface(ITfMessagePump *iface, REFIID iid, LPVOID *ppvOut)
{ {
ThreadMgr *This = impl_from_ITfMessagePumpVtbl(iface); ThreadMgr *This = impl_from_ITfMessagePump(iface);
return ThreadMgr_QueryInterface((ITfThreadMgr *)This, iid, *ppvOut); return ITfThreadMgr_QueryInterface(&This->ITfThreadMgr_iface, iid, ppvOut);
} }
static ULONG WINAPI MessagePump_AddRef(ITfMessagePump *iface) static ULONG WINAPI MessagePump_AddRef(ITfMessagePump *iface)
{ {
ThreadMgr *This = impl_from_ITfMessagePumpVtbl(iface); ThreadMgr *This = impl_from_ITfMessagePump(iface);
return ThreadMgr_AddRef((ITfThreadMgr*)This); return ITfThreadMgr_AddRef(&This->ITfThreadMgr_iface);
} }
static ULONG WINAPI MessagePump_Release(ITfMessagePump *iface) static ULONG WINAPI MessagePump_Release(ITfMessagePump *iface)
{ {
ThreadMgr *This = impl_from_ITfMessagePumpVtbl(iface); ThreadMgr *This = impl_from_ITfMessagePump(iface);
return ThreadMgr_Release((ITfThreadMgr *)This); return ITfThreadMgr_Release(&This->ITfThreadMgr_iface);
} }
static HRESULT WINAPI MessagePump_PeekMessageA(ITfMessagePump *iface, static HRESULT WINAPI MessagePump_PeekMessageA(ITfMessagePump *iface,
@ -1015,12 +1019,11 @@ static HRESULT WINAPI MessagePump_GetMessageW(ITfMessagePump *iface,
return S_OK; return S_OK;
} }
static const ITfMessagePumpVtbl ThreadMgr_MessagePumpVtbl = static const ITfMessagePumpVtbl MessagePumpVtbl =
{ {
MessagePump_QueryInterface, MessagePump_QueryInterface,
MessagePump_AddRef, MessagePump_AddRef,
MessagePump_Release, MessagePump_Release,
MessagePump_PeekMessageA, MessagePump_PeekMessageA,
MessagePump_GetMessageA, MessagePump_GetMessageA,
MessagePump_PeekMessageW, MessagePump_PeekMessageW,
@ -1033,29 +1036,29 @@ static const ITfMessagePumpVtbl ThreadMgr_MessagePumpVtbl =
static HRESULT WINAPI ClientId_QueryInterface(ITfClientId *iface, REFIID iid, LPVOID *ppvOut) static HRESULT WINAPI ClientId_QueryInterface(ITfClientId *iface, REFIID iid, LPVOID *ppvOut)
{ {
ThreadMgr *This = impl_from_ITfClientIdVtbl(iface); ThreadMgr *This = impl_from_ITfClientId(iface);
return ThreadMgr_QueryInterface((ITfThreadMgr *)This, iid, *ppvOut); return ITfThreadMgr_QueryInterface(&This->ITfThreadMgr_iface, iid, ppvOut);
} }
static ULONG WINAPI ClientId_AddRef(ITfClientId *iface) static ULONG WINAPI ClientId_AddRef(ITfClientId *iface)
{ {
ThreadMgr *This = impl_from_ITfClientIdVtbl(iface); ThreadMgr *This = impl_from_ITfClientId(iface);
return ThreadMgr_AddRef((ITfThreadMgr*)This); return ITfThreadMgr_AddRef(&This->ITfThreadMgr_iface);
} }
static ULONG WINAPI ClientId_Release(ITfClientId *iface) static ULONG WINAPI ClientId_Release(ITfClientId *iface)
{ {
ThreadMgr *This = impl_from_ITfClientIdVtbl(iface); ThreadMgr *This = impl_from_ITfClientId(iface);
return ThreadMgr_Release((ITfThreadMgr *)This); return ITfThreadMgr_Release(&This->ITfThreadMgr_iface);
} }
static HRESULT WINAPI ClientId_GetClientId(ITfClientId *iface, static HRESULT WINAPI ClientId_GetClientId(ITfClientId *iface,
REFCLSID rclsid, TfClientId *ptid) REFCLSID rclsid, TfClientId *ptid)
{ {
ThreadMgr *This = impl_from_ITfClientId(iface);
HRESULT hr; HRESULT hr;
ITfCategoryMgr *catmgr; ITfCategoryMgr *catmgr;
ThreadMgr *This = impl_from_ITfClientIdVtbl(iface);
TRACE("(%p) %s\n",This,debugstr_guid(rclsid)); TRACE("(%p) %s\n",This,debugstr_guid(rclsid));
@ -1066,12 +1069,11 @@ static HRESULT WINAPI ClientId_GetClientId(ITfClientId *iface,
return hr; return hr;
} }
static const ITfClientIdVtbl ThreadMgr_ClientIdVtbl = static const ITfClientIdVtbl ClientIdVtbl =
{ {
ClientId_QueryInterface, ClientId_QueryInterface,
ClientId_AddRef, ClientId_AddRef,
ClientId_Release, ClientId_Release,
ClientId_GetClientId ClientId_GetClientId
}; };
@ -1081,19 +1083,19 @@ static const ITfClientIdVtbl ThreadMgr_ClientIdVtbl =
static HRESULT WINAPI ThreadMgrEventSink_QueryInterface(ITfThreadMgrEventSink *iface, REFIID iid, LPVOID *ppvOut) static HRESULT WINAPI ThreadMgrEventSink_QueryInterface(ITfThreadMgrEventSink *iface, REFIID iid, LPVOID *ppvOut)
{ {
ThreadMgr *This = impl_from_ITfThreadMgrEventSink(iface); ThreadMgr *This = impl_from_ITfThreadMgrEventSink(iface);
return ThreadMgr_QueryInterface((ITfThreadMgr *)This, iid, *ppvOut); return ITfThreadMgr_QueryInterface(&This->ITfThreadMgr_iface, iid, ppvOut);
} }
static ULONG WINAPI ThreadMgrEventSink_AddRef(ITfThreadMgrEventSink *iface) static ULONG WINAPI ThreadMgrEventSink_AddRef(ITfThreadMgrEventSink *iface)
{ {
ThreadMgr *This = impl_from_ITfThreadMgrEventSink(iface); ThreadMgr *This = impl_from_ITfThreadMgrEventSink(iface);
return ThreadMgr_AddRef((ITfThreadMgr*)This); return ITfThreadMgr_AddRef(&This->ITfThreadMgr_iface);
} }
static ULONG WINAPI ThreadMgrEventSink_Release(ITfThreadMgrEventSink *iface) static ULONG WINAPI ThreadMgrEventSink_Release(ITfThreadMgrEventSink *iface)
{ {
ThreadMgr *This = impl_from_ITfThreadMgrEventSink(iface); ThreadMgr *This = impl_from_ITfThreadMgrEventSink(iface);
return ThreadMgr_Release((ITfThreadMgr *)This); return ITfThreadMgr_Release(&This->ITfThreadMgr_iface);
} }
@ -1183,12 +1185,11 @@ static HRESULT WINAPI ThreadMgrEventSink_OnPopContext(
return S_OK; return S_OK;
} }
static const ITfThreadMgrEventSinkVtbl ThreadMgr_ThreadMgrEventSinkVtbl = static const ITfThreadMgrEventSinkVtbl ThreadMgrEventSinkVtbl =
{ {
ThreadMgrEventSink_QueryInterface, ThreadMgrEventSink_QueryInterface,
ThreadMgrEventSink_AddRef, ThreadMgrEventSink_AddRef,
ThreadMgrEventSink_Release, ThreadMgrEventSink_Release,
ThreadMgrEventSink_OnInitDocumentMgr, ThreadMgrEventSink_OnInitDocumentMgr,
ThreadMgrEventSink_OnUninitDocumentMgr, ThreadMgrEventSink_OnUninitDocumentMgr,
ThreadMgrEventSink_OnSetFocus, ThreadMgrEventSink_OnSetFocus,
@ -1201,26 +1202,26 @@ static const ITfThreadMgrEventSinkVtbl ThreadMgr_ThreadMgrEventSinkVtbl =
*****************************************************/ *****************************************************/
static HRESULT WINAPI ThreadMgrSourceSingle_QueryInterface(ITfSourceSingle *iface, REFIID iid, LPVOID *ppvOut) static HRESULT WINAPI ThreadMgrSourceSingle_QueryInterface(ITfSourceSingle *iface, REFIID iid, LPVOID *ppvOut)
{ {
ThreadMgr *This = impl_from_ITfSourceSingleVtbl(iface); ThreadMgr *This = impl_from_ITfSourceSingle(iface);
return ThreadMgr_QueryInterface((ITfThreadMgr *)This, iid, *ppvOut); return ITfThreadMgr_QueryInterface(&This->ITfThreadMgr_iface, iid, ppvOut);
} }
static ULONG WINAPI ThreadMgrSourceSingle_AddRef(ITfSourceSingle *iface) static ULONG WINAPI ThreadMgrSourceSingle_AddRef(ITfSourceSingle *iface)
{ {
ThreadMgr *This = impl_from_ITfSourceSingleVtbl(iface); ThreadMgr *This = impl_from_ITfSourceSingle(iface);
return ThreadMgr_AddRef((ITfThreadMgr *)This); return ITfThreadMgr_AddRef(&This->ITfThreadMgr_iface);
} }
static ULONG WINAPI ThreadMgrSourceSingle_Release(ITfSourceSingle *iface) static ULONG WINAPI ThreadMgrSourceSingle_Release(ITfSourceSingle *iface)
{ {
ThreadMgr *This = impl_from_ITfSourceSingleVtbl(iface); ThreadMgr *This = impl_from_ITfSourceSingle(iface);
return ThreadMgr_Release((ITfThreadMgr *)This); return ITfThreadMgr_Release(&This->ITfThreadMgr_iface);
} }
static HRESULT WINAPI ThreadMgrSourceSingle_AdviseSingleSink( ITfSourceSingle *iface, static HRESULT WINAPI ThreadMgrSourceSingle_AdviseSingleSink( ITfSourceSingle *iface,
TfClientId tid, REFIID riid, IUnknown *punk) TfClientId tid, REFIID riid, IUnknown *punk)
{ {
ThreadMgr *This = impl_from_ITfSourceSingleVtbl(iface); ThreadMgr *This = impl_from_ITfSourceSingle(iface);
FIXME("STUB:(%p) %i %s %p\n",This, tid, debugstr_guid(riid),punk); FIXME("STUB:(%p) %i %s %p\n",This, tid, debugstr_guid(riid),punk);
return E_NOTIMPL; return E_NOTIMPL;
} }
@ -1228,19 +1229,18 @@ static HRESULT WINAPI ThreadMgrSourceSingle_AdviseSingleSink( ITfSourceSingle *i
static HRESULT WINAPI ThreadMgrSourceSingle_UnadviseSingleSink( ITfSourceSingle *iface, static HRESULT WINAPI ThreadMgrSourceSingle_UnadviseSingleSink( ITfSourceSingle *iface,
TfClientId tid, REFIID riid) TfClientId tid, REFIID riid)
{ {
ThreadMgr *This = impl_from_ITfSourceSingleVtbl(iface); ThreadMgr *This = impl_from_ITfSourceSingle(iface);
FIXME("STUB:(%p) %i %s\n",This, tid, debugstr_guid(riid)); FIXME("STUB:(%p) %i %s\n",This, tid, debugstr_guid(riid));
return E_NOTIMPL; return E_NOTIMPL;
} }
static const ITfSourceSingleVtbl ThreadMgr_SourceSingleVtbl = static const ITfSourceSingleVtbl SourceSingleVtbl =
{ {
ThreadMgrSourceSingle_QueryInterface, ThreadMgrSourceSingle_QueryInterface,
ThreadMgrSourceSingle_AddRef, ThreadMgrSourceSingle_AddRef,
ThreadMgrSourceSingle_Release, ThreadMgrSourceSingle_Release,
ThreadMgrSourceSingle_AdviseSingleSink, ThreadMgrSourceSingle_AdviseSingleSink,
ThreadMgrSourceSingle_UnadviseSingleSink, ThreadMgrSourceSingle_UnadviseSingleSink
}; };
HRESULT ThreadMgr_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut) HRESULT ThreadMgr_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut)
@ -1253,8 +1253,8 @@ HRESULT ThreadMgr_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut)
This = TlsGetValue(tlsIndex); This = TlsGetValue(tlsIndex);
if (This) if (This)
{ {
ThreadMgr_AddRef((ITfThreadMgr*)This); ThreadMgr_AddRef(&This->ITfThreadMgr_iface);
*ppOut = (IUnknown*)This; *ppOut = (IUnknown*)&This->ITfThreadMgr_iface;
return S_OK; return S_OK;
} }
@ -1262,13 +1262,13 @@ HRESULT ThreadMgr_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut)
if (This == NULL) if (This == NULL)
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
This->ThreadMgrVtbl= &ThreadMgr_ThreadMgrVtbl; This->ITfThreadMgr_iface.lpVtbl= &ThreadMgrVtbl;
This->SourceVtbl = &ThreadMgr_SourceVtbl; This->ITfSource_iface.lpVtbl = &ThreadMgrSourceVtbl;
This->KeystrokeMgrVtbl= &ThreadMgr_KeystrokeMgrVtbl; This->ITfKeystrokeMgr_iface.lpVtbl= &KeystrokeMgrVtbl;
This->MessagePumpVtbl= &ThreadMgr_MessagePumpVtbl; This->ITfMessagePump_iface.lpVtbl = &MessagePumpVtbl;
This->ClientIdVtbl = &ThreadMgr_ClientIdVtbl; This->ITfClientId_iface.lpVtbl = &ClientIdVtbl;
This->ThreadMgrEventSinkVtbl = &ThreadMgr_ThreadMgrEventSinkVtbl; This->ITfThreadMgrEventSink_iface.lpVtbl = &ThreadMgrEventSinkVtbl;
This->SourceSingleVtbl = &ThreadMgr_SourceSingleVtbl; This->ITfSourceSingle_iface.lpVtbl = &SourceSingleVtbl;
This->refCount = 1; This->refCount = 1;
TlsSetValue(tlsIndex,This); TlsSetValue(tlsIndex,This);
@ -1286,7 +1286,7 @@ HRESULT ThreadMgr_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut)
list_init(&This->ThreadMgrEventSink); list_init(&This->ThreadMgrEventSink);
TRACE("returning %p\n", This); TRACE("returning %p\n", This);
*ppOut = (IUnknown *)This; *ppOut = (IUnknown *)&This->ITfThreadMgr_iface;
return S_OK; return S_OK;
} }
@ -1301,12 +1301,12 @@ static void EnumTfDocumentMgr_Destructor(EnumTfDocumentMgr *This)
static HRESULT WINAPI EnumTfDocumentMgr_QueryInterface(IEnumTfDocumentMgrs *iface, REFIID iid, LPVOID *ppvOut) static HRESULT WINAPI EnumTfDocumentMgr_QueryInterface(IEnumTfDocumentMgrs *iface, REFIID iid, LPVOID *ppvOut)
{ {
EnumTfDocumentMgr *This = (EnumTfDocumentMgr *)iface; EnumTfDocumentMgr *This = impl_from_IEnumTfDocumentMgrs(iface);
*ppvOut = NULL; *ppvOut = NULL;
if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_IEnumTfDocumentMgrs)) if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_IEnumTfDocumentMgrs))
{ {
*ppvOut = This; *ppvOut = &This->IEnumTfDocumentMgrs_iface;
} }
if (*ppvOut) if (*ppvOut)
@ -1321,13 +1321,13 @@ static HRESULT WINAPI EnumTfDocumentMgr_QueryInterface(IEnumTfDocumentMgrs *ifac
static ULONG WINAPI EnumTfDocumentMgr_AddRef(IEnumTfDocumentMgrs *iface) static ULONG WINAPI EnumTfDocumentMgr_AddRef(IEnumTfDocumentMgrs *iface)
{ {
EnumTfDocumentMgr *This = (EnumTfDocumentMgr*)iface; EnumTfDocumentMgr *This = impl_from_IEnumTfDocumentMgrs(iface);
return InterlockedIncrement(&This->refCount); return InterlockedIncrement(&This->refCount);
} }
static ULONG WINAPI EnumTfDocumentMgr_Release(IEnumTfDocumentMgrs *iface) static ULONG WINAPI EnumTfDocumentMgr_Release(IEnumTfDocumentMgrs *iface)
{ {
EnumTfDocumentMgr *This = (EnumTfDocumentMgr *)iface; EnumTfDocumentMgr *This = impl_from_IEnumTfDocumentMgrs(iface);
ULONG ret; ULONG ret;
ret = InterlockedDecrement(&This->refCount); ret = InterlockedDecrement(&This->refCount);
@ -1339,7 +1339,7 @@ static ULONG WINAPI EnumTfDocumentMgr_Release(IEnumTfDocumentMgrs *iface)
static HRESULT WINAPI EnumTfDocumentMgr_Next(IEnumTfDocumentMgrs *iface, static HRESULT WINAPI EnumTfDocumentMgr_Next(IEnumTfDocumentMgrs *iface,
ULONG ulCount, ITfDocumentMgr **rgDocumentMgr, ULONG *pcFetched) ULONG ulCount, ITfDocumentMgr **rgDocumentMgr, ULONG *pcFetched)
{ {
EnumTfDocumentMgr *This = (EnumTfDocumentMgr *)iface; EnumTfDocumentMgr *This = impl_from_IEnumTfDocumentMgrs(iface);
ULONG fetched = 0; ULONG fetched = 0;
TRACE("(%p)\n",This); TRACE("(%p)\n",This);
@ -1370,8 +1370,9 @@ static HRESULT WINAPI EnumTfDocumentMgr_Next(IEnumTfDocumentMgrs *iface,
static HRESULT WINAPI EnumTfDocumentMgr_Skip( IEnumTfDocumentMgrs* iface, ULONG celt) static HRESULT WINAPI EnumTfDocumentMgr_Skip( IEnumTfDocumentMgrs* iface, ULONG celt)
{ {
EnumTfDocumentMgr *This = impl_from_IEnumTfDocumentMgrs(iface);
ULONG i; ULONG i;
EnumTfDocumentMgr *This = (EnumTfDocumentMgr *)iface;
TRACE("(%p)\n",This); TRACE("(%p)\n",This);
for(i = 0; i < celt && This->index != NULL; i++) for(i = 0; i < celt && This->index != NULL; i++)
This->index = list_next(This->head, This->index); This->index = list_next(This->head, This->index);
@ -1380,7 +1381,7 @@ static HRESULT WINAPI EnumTfDocumentMgr_Skip( IEnumTfDocumentMgrs* iface, ULONG
static HRESULT WINAPI EnumTfDocumentMgr_Reset( IEnumTfDocumentMgrs* iface) static HRESULT WINAPI EnumTfDocumentMgr_Reset( IEnumTfDocumentMgrs* iface)
{ {
EnumTfDocumentMgr *This = (EnumTfDocumentMgr *)iface; EnumTfDocumentMgr *This = impl_from_IEnumTfDocumentMgrs(iface);
TRACE("(%p)\n",This); TRACE("(%p)\n",This);
This->index = list_head(This->head); This->index = list_head(This->head);
return S_OK; return S_OK;
@ -1389,7 +1390,7 @@ static HRESULT WINAPI EnumTfDocumentMgr_Reset( IEnumTfDocumentMgrs* iface)
static HRESULT WINAPI EnumTfDocumentMgr_Clone( IEnumTfDocumentMgrs *iface, static HRESULT WINAPI EnumTfDocumentMgr_Clone( IEnumTfDocumentMgrs *iface,
IEnumTfDocumentMgrs **ppenum) IEnumTfDocumentMgrs **ppenum)
{ {
EnumTfDocumentMgr *This = (EnumTfDocumentMgr *)iface; EnumTfDocumentMgr *This = impl_from_IEnumTfDocumentMgrs(iface);
HRESULT res; HRESULT res;
TRACE("(%p)\n",This); TRACE("(%p)\n",This);
@ -1399,17 +1400,17 @@ static HRESULT WINAPI EnumTfDocumentMgr_Clone( IEnumTfDocumentMgrs *iface,
res = EnumTfDocumentMgr_Constructor(This->head, ppenum); res = EnumTfDocumentMgr_Constructor(This->head, ppenum);
if (SUCCEEDED(res)) if (SUCCEEDED(res))
{ {
EnumTfDocumentMgr *new_This = (EnumTfDocumentMgr *)*ppenum; EnumTfDocumentMgr *new_This = impl_from_IEnumTfDocumentMgrs(*ppenum);
new_This->index = This->index; new_This->index = This->index;
} }
return res; return res;
} }
static const IEnumTfDocumentMgrsVtbl IEnumTfDocumentMgrs_Vtbl ={ static const IEnumTfDocumentMgrsVtbl EnumTfDocumentMgrsVtbl =
{
EnumTfDocumentMgr_QueryInterface, EnumTfDocumentMgr_QueryInterface,
EnumTfDocumentMgr_AddRef, EnumTfDocumentMgr_AddRef,
EnumTfDocumentMgr_Release, EnumTfDocumentMgr_Release,
EnumTfDocumentMgr_Clone, EnumTfDocumentMgr_Clone,
EnumTfDocumentMgr_Next, EnumTfDocumentMgr_Next,
EnumTfDocumentMgr_Reset, EnumTfDocumentMgr_Reset,
@ -1424,7 +1425,7 @@ static HRESULT EnumTfDocumentMgr_Constructor(struct list* head, IEnumTfDocumentM
if (This == NULL) if (This == NULL)
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
This->Vtbl= &IEnumTfDocumentMgrs_Vtbl; This->IEnumTfDocumentMgrs_iface.lpVtbl= &EnumTfDocumentMgrsVtbl;
This->refCount = 1; This->refCount = 1;
This->head = head; This->head = head;
This->index = list_head(This->head); This->index = list_head(This->head);
@ -1434,9 +1435,9 @@ static HRESULT EnumTfDocumentMgr_Constructor(struct list* head, IEnumTfDocumentM
return S_OK; return S_OK;
} }
void ThreadMgr_OnDocumentMgrDestruction(ITfThreadMgr *tm, ITfDocumentMgr *mgr) void ThreadMgr_OnDocumentMgrDestruction(ITfThreadMgr *iface, ITfDocumentMgr *mgr)
{ {
ThreadMgr *This = (ThreadMgr *)tm; ThreadMgr *This = impl_from_ITfThreadMgr(iface);
struct list *cursor; struct list *cursor;
LIST_FOR_EACH(cursor, &This->CreatedDocumentMgrs) LIST_FOR_EACH(cursor, &This->CreatedDocumentMgrs)
{ {

View file

@ -16,7 +16,7 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
1 WINE_REGISTRY "msctf.rgs" 1 WINE_REGISTRY msctf_classes.rgs
#define WINE_FILEDESCRIPTION_STR "Wine Msctf" #define WINE_FILEDESCRIPTION_STR "Wine Msctf"
#define WINE_FILENAME_STR "msctf.dll" #define WINE_FILENAME_STR "msctf.dll"

View file

@ -113,7 +113,7 @@ reactos/dll/win32/msadp32.acm # Synced to Wine-1.7.17
reactos/dll/win32/mscat32 # Synced to Wine-1.7.1 reactos/dll/win32/mscat32 # Synced to Wine-1.7.1
reactos/dll/win32/mscms # Synced to Wine-1.7.17 reactos/dll/win32/mscms # Synced to Wine-1.7.17
reactos/dll/win32/mscoree # Synced to Wine-1.5.4 reactos/dll/win32/mscoree # Synced to Wine-1.5.4
reactos/dll/win32/msctf # Synced to Wine-1.7.1 reactos/dll/win32/msctf # Synced to Wine-1.7.17
reactos/dll/win32/msftedit # Synced to Wine-1.7.1 reactos/dll/win32/msftedit # Synced to Wine-1.7.1
reactos/dll/win32/msg711.acm # Synced to Wine-1.7.1 reactos/dll/win32/msg711.acm # Synced to Wine-1.7.1
reactos/dll/win32/msgsm32.acm # Synced to Wine-1.7.1 reactos/dll/win32/msgsm32.acm # Synced to Wine-1.7.1