mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
[MSUTB][SDK] Use QISearch for QueryInterface (#6631)
Simplify code and reduce binary size. JIRA issue: CORE-19363 - Use shlwapi!QISearch for QueryInterface implementation. - Add delay link to shlwapi. - Define QITABENT macro in <shlwapi.h>.
This commit is contained in:
parent
1fbf09f531
commit
1af0dbe36e
3 changed files with 28 additions and 45 deletions
|
@ -15,5 +15,5 @@ set_module_type(msutb win32dll UNICODE)
|
||||||
add_dependencies(msutb msctf psdk)
|
add_dependencies(msutb msctf psdk)
|
||||||
target_link_libraries(msutb wine uuid atl_classes cicero)
|
target_link_libraries(msutb wine uuid atl_classes cicero)
|
||||||
add_importlibs(msutb user32 gdi32 advapi32 msvcrt kernel32 ntdll)
|
add_importlibs(msutb user32 gdi32 advapi32 msvcrt kernel32 ntdll)
|
||||||
add_delay_importlibs(msutb uxtheme imm32 comctl32 msctf ole32 oleacc oleaut32 shell32)
|
add_delay_importlibs(msutb uxtheme imm32 shlwapi comctl32 msctf ole32 oleacc oleaut32 shell32)
|
||||||
add_cd_file(TARGET msutb DESTINATION reactos/system32 FOR all)
|
add_cd_file(TARGET msutb DESTINATION reactos/system32 FOR all)
|
||||||
|
|
|
@ -1887,13 +1887,12 @@ CCicLibMenu::~CCicLibMenu()
|
||||||
|
|
||||||
STDMETHODIMP CCicLibMenu::QueryInterface(REFIID riid, LPVOID *ppvObj)
|
STDMETHODIMP CCicLibMenu::QueryInterface(REFIID riid, LPVOID *ppvObj)
|
||||||
{
|
{
|
||||||
if (IsEqualIID(riid, IID_IUnknown) || IsEqualIID(riid, IID_ITfMenu))
|
static const QITAB c_tab[] =
|
||||||
{
|
{
|
||||||
*ppvObj = this;
|
QITABENT(CCicLibMenu, ITfMenu),
|
||||||
AddRef();
|
{ NULL }
|
||||||
return S_OK;
|
};
|
||||||
}
|
return ::QISearch(this, c_tab, riid, ppvObj);
|
||||||
return E_NOINTERFACE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
STDMETHODIMP_(ULONG) CCicLibMenu::AddRef()
|
STDMETHODIMP_(ULONG) CCicLibMenu::AddRef()
|
||||||
|
@ -2191,15 +2190,13 @@ STDMETHODIMP CTipbarAccessible::QueryInterface(
|
||||||
REFIID riid,
|
REFIID riid,
|
||||||
void **ppvObject)
|
void **ppvObject)
|
||||||
{
|
{
|
||||||
if (IsEqualIID(riid, IID_IUnknown) ||
|
static const QITAB c_tab[] =
|
||||||
IsEqualIID(riid, IID_IDispatch) ||
|
|
||||||
IsEqualIID(riid, IID_IAccessible))
|
|
||||||
{
|
{
|
||||||
*ppvObject = this;
|
QITABENT(CTipbarAccessible, IDispatch),
|
||||||
AddRef();
|
QITABENT(CTipbarAccessible, IAccessible),
|
||||||
return S_OK;
|
{ NULL }
|
||||||
}
|
};
|
||||||
return E_NOINTERFACE;
|
return ::QISearch(this, c_tab, riid, ppvObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
STDMETHODIMP_(ULONG) CTipbarAccessible::AddRef()
|
STDMETHODIMP_(ULONG) CTipbarAccessible::AddRef()
|
||||||
|
@ -3667,25 +3664,14 @@ CLBarItemButtonBase::~CLBarItemButtonBase()
|
||||||
|
|
||||||
STDMETHODIMP CLBarItemButtonBase::QueryInterface(REFIID riid, void **ppvObject)
|
STDMETHODIMP CLBarItemButtonBase::QueryInterface(REFIID riid, void **ppvObject)
|
||||||
{
|
{
|
||||||
if (IsEqualIID(riid, IID_IUnknown) || IsEqualIID(riid, IID_ITfLangBarItem))
|
static const QITAB c_tab[] =
|
||||||
{
|
{
|
||||||
*ppvObject = static_cast<ITfLangBarItem*>(this);
|
QITABENT(CLBarItemButtonBase, ITfLangBarItem),
|
||||||
AddRef();
|
QITABENT(CLBarItemButtonBase, ITfLangBarItemButton),
|
||||||
return S_OK;
|
QITABENT(CLBarItemButtonBase, ITfSource),
|
||||||
}
|
{ NULL }
|
||||||
if (IsEqualIID(riid, IID_ITfLangBarItemButton))
|
};
|
||||||
{
|
return ::QISearch(this, c_tab, riid, ppvObject);
|
||||||
*ppvObject = static_cast<ITfLangBarItemButton*>(this);
|
|
||||||
AddRef();
|
|
||||||
return S_OK;
|
|
||||||
}
|
|
||||||
if (IsEqualIID(riid, IID_ITfSource))
|
|
||||||
{
|
|
||||||
*ppvObject = static_cast<ITfSource*>(this);
|
|
||||||
AddRef();
|
|
||||||
return S_OK;
|
|
||||||
}
|
|
||||||
return E_NOINTERFACE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
STDMETHODIMP_(ULONG) CLBarItemButtonBase::AddRef()
|
STDMETHODIMP_(ULONG) CLBarItemButtonBase::AddRef()
|
||||||
|
@ -5148,19 +5134,13 @@ void CTipbarWnd::TerminateAllThreads(BOOL bFlag)
|
||||||
|
|
||||||
STDMETHODIMP CTipbarWnd::QueryInterface(REFIID riid, void **ppvObj)
|
STDMETHODIMP CTipbarWnd::QueryInterface(REFIID riid, void **ppvObj)
|
||||||
{
|
{
|
||||||
if (IsEqualIID(riid, IID_IUnknown) || IsEqualIID(riid, IID_ITfLangBarEventSink))
|
static const QITAB c_tab[] =
|
||||||
{
|
{
|
||||||
*ppvObj = this;
|
QITABENT(CTipbarWnd, ITfLangBarEventSink),
|
||||||
AddRef();
|
QITABENT(CTipbarWnd, ITfLangBarEventSink_P),
|
||||||
return S_OK;
|
{ NULL }
|
||||||
}
|
};
|
||||||
if (IsEqualIID(riid, IID_ITfLangBarEventSink_P))
|
return ::QISearch(this, c_tab, riid, ppvObj);
|
||||||
{
|
|
||||||
*ppvObj = static_cast<ITfLangBarEventSink_P*>(this);
|
|
||||||
AddRef();
|
|
||||||
return S_OK;
|
|
||||||
}
|
|
||||||
return E_NOINTERFACE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
STDMETHODIMP_(ULONG) CTipbarWnd::AddRef()
|
STDMETHODIMP_(ULONG) CTipbarWnd::AddRef()
|
||||||
|
|
|
@ -2090,6 +2090,9 @@ QISearch(
|
||||||
#define OFFSETOFCLASS(base, derived) \
|
#define OFFSETOFCLASS(base, derived) \
|
||||||
((DWORD)(DWORD_PTR)(static_cast<base*>((derived*)8))-8)
|
((DWORD)(DWORD_PTR)(static_cast<base*>((derived*)8))-8)
|
||||||
|
|
||||||
|
#define QITABENTMULTI(Cthis, Ifoo, Iimpl) { &IID_##Ifoo, OFFSETOFCLASS(Iimpl, Cthis) }
|
||||||
|
#define QITABENT(Cthis, Ifoo) QITABENTMULTI(Cthis, Ifoo, Ifoo)
|
||||||
|
|
||||||
#include <poppack.h>
|
#include <poppack.h>
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
Loading…
Reference in a new issue