From b138a8620db07b00ec17d9fa88de91b6da784f69 Mon Sep 17 00:00:00 2001 From: David Quintana Date: Mon, 20 Oct 2014 21:23:32 +0000 Subject: [PATCH] [EXPLORER-NEW] * Initialize struct contents to zero. CID 1102492 [BROWSEUI] * Fix build. svn path=/branches/shell-experiments/; revision=64857 --- base/shell/explorer-new/trayntfy.c | 2 +- include/reactos/undocshell.h | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) 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) {