Author: dquintana
Date: Mon Oct 20 21:23:32 2014
New Revision: 64857

URL: http://svn.reactos.org/svn/reactos?rev=64857&view=rev
Log:
[EXPLORER-NEW]
* Initialize struct contents to zero. CID 1102492

[BROWSEUI]
* Fix build.

Modified:
    branches/shell-experiments/base/shell/explorer-new/trayntfy.c
    branches/shell-experiments/include/reactos/undocshell.h

Modified: branches/shell-experiments/base/shell/explorer-new/trayntfy.c
URL: 
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/explorer-new/trayntfy.c?rev=64857&r1=64856&r2=64857&view=diff
==============================================================================
--- branches/shell-experiments/base/shell/explorer-new/trayntfy.c       
[iso-8859-1] (original)
+++ branches/shell-experiments/base/shell/explorer-new/trayntfy.c       
[iso-8859-1] Mon Oct 20 21:23:32 2014
@@ -117,7 +117,7 @@
 SysPagerWnd_UpdateButton(IN OUT PSYS_PAGER_WND_DATA This,
                          IN CONST NOTIFYICONDATA *iconData)
 {
-    TBBUTTONINFO tbbi;
+    TBBUTTONINFO tbbi = {0};
     PNOTIFY_ITEM notifyItem;
     PPNOTIFY_ITEM NotifyPointer;
 

Modified: branches/shell-experiments/include/reactos/undocshell.h
URL: 
http://svn.reactos.org/svn/reactos/branches/shell-experiments/include/reactos/undocshell.h?rev=64857&r1=64856&r2=64857&view=diff
==============================================================================
--- branches/shell-experiments/include/reactos/undocshell.h     [iso-8859-1] 
(original)
+++ branches/shell-experiments/include/reactos/undocshell.h     [iso-8859-1] 
Mon Oct 20 21:23:32 2014
@@ -735,11 +735,11 @@
     return S_OK;
 }
 
-template<class T, class T1, class R>
-HRESULT inline ShellObjectCreatorInit(T1 initArg1, REFIID riid, R ** ppv)
+template<class T>
+HRESULT inline ShellObjectCreatorInit(REFIID riid, void ** ppv)
 {
     CComPtr<T>  obj;
-    CComPtr<R>  result;
+    CComPtr<IUnknown>  result;
     HRESULT     hResult;
 
     if (ppv == NULL)
@@ -752,7 +752,7 @@
     if (FAILED(hResult))
         return hResult;
 
-    hResult = obj->Initialize(initArg1);
+    hResult = obj->Initialize();
     if (FAILED(hResult))
         return hResult;
 
@@ -761,8 +761,8 @@
     return S_OK;
 }
 
-template<class T, class T1, class T2, class R>
-HRESULT inline ShellObjectCreatorInit(T1 initArg1, T2 initArg2, REFIID riid, R 
** ppv)
+template<class T, class T1, class R>
+HRESULT inline ShellObjectCreatorInit(T1 initArg1, REFIID riid, R ** ppv)
 {
     CComPtr<T>  obj;
     CComPtr<R>  result;
@@ -778,7 +778,7 @@
     if (FAILED(hResult))
         return hResult;
 
-    hResult = obj->Initialize(initArg1, initArg2);
+    hResult = obj->Initialize(initArg1);
     if (FAILED(hResult))
         return hResult;
 
@@ -787,8 +787,8 @@
     return S_OK;
 }
 
-template<class T, class T1, class T2, class T3, class R>
-HRESULT inline ShellObjectCreatorInit(T1 initArg1, T2 initArg2, T3 initArg3, 
REFIID riid, R ** ppv)
+template<class T, class T1, class T2, class R>
+HRESULT inline ShellObjectCreatorInit(T1 initArg1, T2 initArg2, REFIID riid, R 
** ppv)
 {
     CComPtr<T>  obj;
     CComPtr<R>  result;
@@ -804,7 +804,7 @@
     if (FAILED(hResult))
         return hResult;
 
-    hResult = obj->Initialize(initArg1, initArg2, initArg3);
+    hResult = obj->Initialize(initArg1, initArg2);
     if (FAILED(hResult))
         return hResult;
 
@@ -813,8 +813,8 @@
     return S_OK;
 }
 
-template<class T, class T1, class T2, class T3, class T4, class R>
-HRESULT inline ShellObjectCreatorInit(T1 initArg1, T2 initArg2, T3 initArg3, 
T4 initArg4, REFIID riid, R ** ppv)
+template<class T, class T1, class T2, class T3, class R>
+HRESULT inline ShellObjectCreatorInit(T1 initArg1, T2 initArg2, T3 initArg3, 
REFIID riid, R ** ppv)
 {
     CComPtr<T>  obj;
     CComPtr<R>  result;
@@ -830,6 +830,32 @@
     if (FAILED(hResult))
         return hResult;
 
+    hResult = obj->Initialize(initArg1, initArg2, initArg3);
+    if (FAILED(hResult))
+        return hResult;
+
+    *ppv = result.Detach();
+
+    return S_OK;
+}
+
+template<class T, class T1, class T2, class T3, class T4, class R>
+HRESULT inline ShellObjectCreatorInit(T1 initArg1, T2 initArg2, T3 initArg3, 
T4 initArg4, REFIID riid, R ** ppv)
+{
+    CComPtr<T>  obj;
+    CComPtr<R>  result;
+    HRESULT     hResult;
+
+    if (ppv == NULL)
+        return E_POINTER;
+    *ppv = NULL;
+    ATLTRY(obj = new CComObject<T>);
+    if (obj.p == NULL)
+        return E_OUTOFMEMORY;
+    hResult = obj->QueryInterface(riid, reinterpret_cast<void **>(&result));
+    if (FAILED(hResult))
+        return hResult;
+
     hResult = obj->Initialize(initArg1, initArg2, initArg3, initArg4);
     if (FAILED(hResult))
         return hResult;


Reply via email to