mirror of
https://github.com/reactos/wine.git
synced 2025-02-12 23:58:56 +00:00
msctf: Moved thread manager's UnadviseSink implementation into a more generic helper.
Signed-off-by: Jacek Caban <jacek@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
c0efd074b2
commit
0374ee290d
@ -304,6 +304,25 @@ HRESULT advise_sink(struct list *sink_list, REFIID riid, DWORD cookie_magic, IUn
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static void free_sink(Sink *sink)
|
||||
{
|
||||
list_remove(&sink->entry);
|
||||
IUnknown_Release(sink->interfaces.pIUnknown);
|
||||
HeapFree(GetProcessHeap(), 0, sink);
|
||||
}
|
||||
|
||||
HRESULT unadvise_sink(DWORD cookie)
|
||||
{
|
||||
Sink *sink;
|
||||
|
||||
sink = remove_Cookie(cookie);
|
||||
if (!sink)
|
||||
return CONNECT_E_NOCONNECTION;
|
||||
|
||||
free_sink(sink);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* Active Text Service Management
|
||||
*****************************************************************************/
|
||||
|
@ -76,6 +76,7 @@ typedef struct {
|
||||
} Sink;
|
||||
|
||||
HRESULT advise_sink(struct list *sink_list, REFIID riid, DWORD cookie_magic, IUnknown *unk, DWORD *cookie) DECLSPEC_HIDDEN;
|
||||
HRESULT unadvise_sink(DWORD cookie) DECLSPEC_HIDDEN;
|
||||
|
||||
extern const WCHAR szwSystemTIPKey[] DECLSPEC_HIDDEN;
|
||||
extern const WCHAR szwSystemCTFKey[] DECLSPEC_HIDDEN;
|
||||
|
@ -659,21 +659,13 @@ static HRESULT WINAPI ThreadMgrSource_AdviseSink(ITfSource *iface,
|
||||
static HRESULT WINAPI ThreadMgrSource_UnadviseSink(ITfSource *iface, DWORD pdwCookie)
|
||||
{
|
||||
ThreadMgr *This = impl_from_ITfSource(iface);
|
||||
Sink *sink;
|
||||
|
||||
TRACE("(%p) %x\n",This,pdwCookie);
|
||||
|
||||
if (get_Cookie_magic(pdwCookie)!=COOKIE_MAGIC_TMSINK)
|
||||
return E_INVALIDARG;
|
||||
|
||||
sink = remove_Cookie(pdwCookie);
|
||||
if (!sink)
|
||||
return CONNECT_E_NOCONNECTION;
|
||||
|
||||
list_remove(&sink->entry);
|
||||
free_sink(sink);
|
||||
|
||||
return S_OK;
|
||||
return unadvise_sink(pdwCookie);
|
||||
}
|
||||
|
||||
static const ITfSourceVtbl ThreadMgrSourceVtbl =
|
||||
|
Loading…
x
Reference in New Issue
Block a user