diff --git a/dll/ime/msctfime/CMakeLists.txt b/dll/ime/msctfime/CMakeLists.txt index 717e879e119..88c174912fd 100644 --- a/dll/ime/msctfime/CMakeLists.txt +++ b/dll/ime/msctfime/CMakeLists.txt @@ -22,5 +22,5 @@ set_module_type(msctfime win32dll UNICODE) set_target_properties(msctfime PROPERTIES SUFFIX ".ime") target_link_libraries(msctfime wine uuid cicero) add_importlibs(msctfime user32 gdi32 advapi32 msvcrt kernel32 ntdll) -add_delay_importlibs(msctfime uxtheme comctl32 msctf oleaut32 imm32) +add_delay_importlibs(msctfime uxtheme shlwapi comctl32 msctf oleaut32 imm32) add_cd_file(TARGET msctfime DESTINATION reactos/system32 FOR all) diff --git a/dll/ime/msctfime/bridge.cpp b/dll/ime/msctfime/bridge.cpp index a61a66cfa69..90c52fbfaba 100644 --- a/dll/ime/msctfime/bridge.cpp +++ b/dll/ime/msctfime/bridge.cpp @@ -26,15 +26,12 @@ CicBridge::CicBridge() /// @implemented STDMETHODIMP CicBridge::QueryInterface(REFIID riid, LPVOID* ppvObj) { - *ppvObj = NULL; - - if (!IsEqualIID(riid, IID_ITfSysHookSink)) - return E_NOINTERFACE; - - *ppvObj = this; - AddRef(); - - return S_OK; + static const QITAB c_tab[] = + { + QITABENT(CicBridge, ITfSysHookSink), + { NULL } + }; + return ::QISearch(this, c_tab, riid, ppvObj); } /// @implemented diff --git a/dll/ime/msctfime/inputcontext.cpp b/dll/ime/msctfime/inputcontext.cpp index 7c7a3c91d20..d97f4da91cb 100644 --- a/dll/ime/msctfime/inputcontext.cpp +++ b/dll/ime/msctfime/inputcontext.cpp @@ -80,23 +80,13 @@ HRESULT CInputContextOwner::_Unadvise() /// @implemented STDMETHODIMP CInputContextOwner::QueryInterface(REFIID riid, LPVOID* ppvObj) { - *ppvObj = NULL; - - if (IsEqualIID(riid, IID_IUnknown) || IsEqualIID(riid, IID_ITfContextOwner)) + static const QITAB c_tab[] = { - *ppvObj = this; - AddRef(); - return S_OK; - } - - if (IsEqualIID(riid, IID_ITfMouseTrackerACP)) - { - *ppvObj = static_cast(this); - AddRef(); - return S_OK; - } - - return E_NOINTERFACE; + QITABENT(CInputContextOwner, ITfContextOwner), + QITABENT(CInputContextOwner, ITfMouseTrackerACP), + { NULL } + }; + return ::QISearch(this, c_tab, riid, ppvObj); } /// @implemented @@ -202,22 +192,13 @@ CicInputContext::CicInputContext( /// @implemented STDMETHODIMP CicInputContext::QueryInterface(REFIID riid, LPVOID* ppvObj) { - *ppvObj = NULL; - - if (IsEqualIID(riid, IID_ITfContextOwnerCompositionSink)) + static const QITAB c_tab[] = { - *ppvObj = static_cast(this); - AddRef(); - return S_OK; - } - if (IsEqualIID(riid, IID_IUnknown) || IsEqualIID(riid, IID_ITfCleanupContextSink)) - { - *ppvObj = this; - AddRef(); - return S_OK; - } - - return E_NOINTERFACE; + QITABENT(CicInputContext, ITfCleanupContextSink), + QITABENT(CicInputContext, ITfContextOwnerCompositionSink), + { NULL } + }; + return ::QISearch(this, c_tab, riid, ppvObj); } /// @implemented diff --git a/dll/ime/msctfime/misc.cpp b/dll/ime/msctfime/misc.cpp index 5e8ae5003f6..18feac65b6a 100644 --- a/dll/ime/msctfime/misc.cpp +++ b/dll/ime/msctfime/misc.cpp @@ -452,13 +452,12 @@ CFunctionProviderBase::QueryInterface( _In_ REFIID riid, _Out_ LPVOID* ppvObj) { - if (IsEqualIID(riid, IID_IUnknown) || IsEqualIID(riid, IID_ITfFunctionProvider)) + static const QITAB c_tab[] = { - *ppvObj = this; - AddRef(); - return S_OK; - } - return E_NOINTERFACE; + QITABENT(CFunctionProviderBase, ITfFunctionProvider), + { NULL } + }; + return ::QISearch(this, c_tab, riid, ppvObj); } /// @implemented @@ -534,13 +533,12 @@ CFnDocFeed::~CFnDocFeed() /// @implemented STDMETHODIMP CFnDocFeed::QueryInterface(_In_ REFIID riid, _Out_ LPVOID* ppvObj) { - if (IsEqualIID(riid, IID_IUnknown) || IsEqualIID(riid, IID_IAImmFnDocFeed)) + static const QITAB c_tab[] = { - *ppvObj = this; - AddRef(); - return S_OK; - } - return E_NOINTERFACE; + QITABENT(CFnDocFeed, IAImmFnDocFeed), + { NULL } + }; + return ::QISearch(this, c_tab, riid, ppvObj); } /// @implemented diff --git a/dll/ime/msctfime/sinks.cpp b/dll/ime/msctfime/sinks.cpp index 235079c4d94..5e179123546 100644 --- a/dll/ime/msctfime/sinks.cpp +++ b/dll/ime/msctfime/sinks.cpp @@ -26,15 +26,12 @@ CCompartmentEventSink::~CCompartmentEventSink() /// @implemented STDMETHODIMP CCompartmentEventSink::QueryInterface(REFIID riid, LPVOID* ppvObj) { - if (IsEqualIID(riid, IID_IUnknown) || IsEqualIID(riid, IID_ITfCompartmentEventSink)) + static const QITAB c_tab[] = { - *ppvObj = this; - AddRef(); - return S_OK; - } - - *ppvObj = NULL; - return E_NOINTERFACE; + QITABENT(CCompartmentEventSink, ITfCompartmentEventSink), + { NULL } + }; + return ::QISearch(this, c_tab, riid, ppvObj); } /// @implemented @@ -152,19 +149,13 @@ CTextEventSink::~CTextEventSink() /// @implemented STDMETHODIMP CTextEventSink::QueryInterface(REFIID riid, LPVOID* ppvObj) { - if (IsEqualIID(riid, IID_IUnknown) || IsEqualIID(riid, IID_ITfTextEditSink)) + static const QITAB c_tab[] = { - *ppvObj = this; - AddRef(); - return S_OK; - } - if (IsEqualIID(riid, IID_ITfTextLayoutSink)) - { - *ppvObj = static_cast(this); - AddRef(); - return S_OK; - } - return E_NOINTERFACE; + QITABENT(CTextEventSink, ITfTextEditSink), + QITABENT(CTextEventSink, ITfTextLayoutSink), + { NULL } + }; + return ::QISearch(this, c_tab, riid, ppvObj); } /// @implemented @@ -294,14 +285,12 @@ CThreadMgrEventSink::CThreadMgrEventSink( /// @implemented STDMETHODIMP CThreadMgrEventSink::QueryInterface(REFIID riid, LPVOID* ppvObj) { - if (IsEqualIID(riid, IID_IUnknown) || IsEqualIID(riid, IID_ITfThreadMgrEventSink)) + static const QITAB c_tab[] = { - *ppvObj = this; - AddRef(); - return S_OK; - } - *ppvObj = NULL; - return E_NOINTERFACE; + QITABENT(CThreadMgrEventSink, ITfThreadMgrEventSink), + { NULL } + }; + return ::QISearch(this, c_tab, riid, ppvObj); } /// @implemented @@ -440,14 +429,12 @@ CActiveLanguageProfileNotifySink::~CActiveLanguageProfileNotifySink() /// @implemented STDMETHODIMP CActiveLanguageProfileNotifySink::QueryInterface(REFIID riid, LPVOID* ppvObj) { - if (IsEqualIID(riid, IID_IUnknown) || IsEqualIID(riid, IID_ITfActiveLanguageProfileNotifySink)) + static const QITAB c_tab[] = { - *ppvObj = this; - AddRef(); - return S_OK; - } - *ppvObj = NULL; - return E_NOINTERFACE; + QITABENT(CActiveLanguageProfileNotifySink, ITfActiveLanguageProfileNotifySink), + { NULL } + }; + return ::QISearch(this, c_tab, riid, ppvObj); } /// @implemented