diff --git a/base/shell/explorer-new/trayntfy.c b/base/shell/explorer-new/trayntfy.c index fd6f83f4aee..853a7eddb4e 100644 --- a/base/shell/explorer-new/trayntfy.c +++ b/base/shell/explorer-new/trayntfy.c @@ -117,7 +117,7 @@ static VOID SysPagerWnd_UpdateButton(IN OUT PSYS_PAGER_WND_DATA This, IN CONST NOTIFYICONDATA *iconData) { - TBBUTTONINFO tbbi; + TBBUTTONINFO tbbi = {0}; PNOTIFY_ITEM notifyItem; PPNOTIFY_ITEM NotifyPointer; diff --git a/include/reactos/undocshell.h b/include/reactos/undocshell.h index e220433b7fc..4fc7ec43017 100644 --- a/include/reactos/undocshell.h +++ b/include/reactos/undocshell.h @@ -735,6 +735,32 @@ HRESULT inline ShellObjectCreatorInit(REFIID riid, R ** ppv) return S_OK; } +template +HRESULT inline ShellObjectCreatorInit(REFIID riid, void ** ppv) +{ + CComPtr obj; + CComPtr result; + HRESULT hResult; + + if (ppv == NULL) + return E_POINTER; + *ppv = NULL; + ATLTRY(obj = new CComObject); + if (obj.p == NULL) + return E_OUTOFMEMORY; + hResult = obj->QueryInterface(riid, reinterpret_cast(&result)); + if (FAILED(hResult)) + return hResult; + + hResult = obj->Initialize(); + if (FAILED(hResult)) + return hResult; + + *ppv = result.Detach(); + + return S_OK; +} + template HRESULT inline ShellObjectCreatorInit(T1 initArg1, REFIID riid, R ** ppv) {