[ros-diffs] [cmihail] 53612: [shell32.dll] - Initialize uninitialized variables in constructors. [atl] - Initialize uninitialized variables in constructors. All spotted by Amine Khaldi.

cmihail at svn.reactos.org cmihail at svn.reactos.org
Tue Sep 6 23:52:40 UTC 2011


Author: cmihail
Date: Tue Sep  6 23:52:38 2011
New Revision: 53612

URL: http://svn.reactos.org/svn/reactos?rev=53612&view=rev
Log:
[shell32.dll]
- Initialize uninitialized variables in constructors.
[atl]
- Initialize uninitialized variables in constructors.
All spotted by Amine Khaldi.

Modified:
    branches/shell32_new-bringup/dll/win32/shell32/autocomplete.cpp
    branches/shell32_new-bringup/dll/win32/shell32/she_ocmenu.cpp
    branches/shell32_new-bringup/dll/win32/shell32/shellole.cpp
    branches/shell32_new-bringup/dll/win32/shell32/shfldr_desktop.cpp
    branches/shell32_new-bringup/dll/win32/shell32/shfldr_fonts.cpp
    branches/shell32_new-bringup/dll/win32/shell32/shfldr_mydocuments.cpp
    branches/shell32_new-bringup/dll/win32/shell32/shlfolder.cpp
    branches/shell32_new-bringup/lib/atl/atlbase.h

Modified: branches/shell32_new-bringup/dll/win32/shell32/autocomplete.cpp
URL: http://svn.reactos.org/svn/reactos/branches/shell32_new-bringup/dll/win32/shell32/autocomplete.cpp?rev=53612&r1=53611&r2=53612&view=diff
==============================================================================
--- branches/shell32_new-bringup/dll/win32/shell32/autocomplete.cpp [iso-8859-1] (original)
+++ branches/shell32_new-bringup/dll/win32/shell32/autocomplete.cpp [iso-8859-1] Tue Sep  6 23:52:38 2011
@@ -50,6 +50,7 @@
 	hwndListBox = NULL;
 	txtbackup = NULL;
 	quickComplete = NULL;
+    hwndEdit = NULL;
 }
 
 /**************************************************************************

Modified: branches/shell32_new-bringup/dll/win32/shell32/she_ocmenu.cpp
URL: http://svn.reactos.org/svn/reactos/branches/shell32_new-bringup/dll/win32/shell32/she_ocmenu.cpp?rev=53612&r1=53611&r2=53612&view=diff
==============================================================================
--- branches/shell32_new-bringup/dll/win32/shell32/she_ocmenu.cpp [iso-8859-1] (original)
+++ branches/shell32_new-bringup/dll/win32/shell32/she_ocmenu.cpp [iso-8859-1] Tue Sep  6 23:52:38 2011
@@ -67,6 +67,7 @@
 
 COpenWithMenu::COpenWithMenu()
 {
+    count = 0;
 }
 
 COpenWithMenu::~COpenWithMenu()

Modified: branches/shell32_new-bringup/dll/win32/shell32/shellole.cpp
URL: http://svn.reactos.org/svn/reactos/branches/shell32_new-bringup/dll/win32/shell32/shellole.cpp?rev=53612&r1=53611&r2=53612&view=diff
==============================================================================
--- branches/shell32_new-bringup/dll/win32/shell32/shellole.cpp [iso-8859-1] (original)
+++ branches/shell32_new-bringup/dll/win32/shell32/shellole.cpp [iso-8859-1] Tue Sep  6 23:52:38 2011
@@ -329,6 +329,7 @@
 	lpfnCI = NULL;
 	riidInst = NULL;
 	pcRefDll = NULL;
+    rclsid = NULL;
 }
 
 HRESULT IDefClFImpl::Initialize(LPFNCREATEINSTANCE lpfnCIx, PLONG pcRefDllx, const IID *riidInstx)

Modified: branches/shell32_new-bringup/dll/win32/shell32/shfldr_desktop.cpp
URL: http://svn.reactos.org/svn/reactos/branches/shell32_new-bringup/dll/win32/shell32/shfldr_desktop.cpp?rev=53612&r1=53611&r2=53612&view=diff
==============================================================================
--- branches/shell32_new-bringup/dll/win32/shell32/shfldr_desktop.cpp [iso-8859-1] (original)
+++ branches/shell32_new-bringup/dll/win32/shell32/shfldr_desktop.cpp [iso-8859-1] Tue Sep  6 23:52:38 2011
@@ -22,7 +22,7 @@
 
 #include <precomp.h>
 
-WINE_DEFAULT_DEBUG_CHANNEL (shell);
+WINE_DEFAULT_DEBUG_CHANNEL(shell);
 
 /*
 CDesktopFolder should create two file system folders internally, one representing the
@@ -140,6 +140,7 @@
     static WCHAR MyDocumentsClassString[] = L"{450D8FBA-AD25-11D0-98A8-0800361B1103}";
 
     TRACE("(%p)->(flags=0x%08x)\n", this, dwFlags);
+    DbgPrint("[shell32, CDesktopFolderEnum::Initialize] Called with flags = %d\n", dwFlags);
 
     /* enumerate the root folders */
     if (dwFlags & SHCONTF_FOLDERS)
@@ -262,6 +263,7 @@
 
 CDesktopFolder::CDesktopFolder()
 {
+    pidlRoot = NULL;
 }
 
 CDesktopFolder::~CDesktopFolder()
@@ -393,20 +395,25 @@
 	HRESULT									hResult;
 
 	TRACE ("(%p)->(HWND=%p flags=0x%08x pplist=%p)\n", this, hwndOwner, dwFlags, ppEnumIDList);
+    DbgPrint("[shell32, CDesktopFolder::EnumObjects] Called with flags = %d\n", dwFlags);
 
 	if (ppEnumIDList == NULL)
 		return E_POINTER;
 	*ppEnumIDList = NULL;
-	ATLTRY (theEnumerator = new CComObject<CDesktopFolderEnum>);
-	if (theEnumerator == NULL)
+	
+    ATLTRY (theEnumerator = new CComObject<CDesktopFolderEnum>);
+	
+    if (theEnumerator == NULL)
 		return E_OUTOFMEMORY;
-	hResult = theEnumerator->QueryInterface (IID_IEnumIDList, (void **)&result);
+	
+    hResult = theEnumerator->QueryInterface (IID_IEnumIDList, (void **)&result);
 	if (FAILED (hResult))
 	{
 		delete theEnumerator;
 		return hResult;
 	}
-	hResult = theEnumerator->Initialize (this, hwndOwner, dwFlags);
+	
+    hResult = theEnumerator->Initialize (this, hwndOwner, dwFlags);
 	if (FAILED (hResult))
 		return hResult;
 	*ppEnumIDList = result.Detach ();

Modified: branches/shell32_new-bringup/dll/win32/shell32/shfldr_fonts.cpp
URL: http://svn.reactos.org/svn/reactos/branches/shell32_new-bringup/dll/win32/shell32/shfldr_fonts.cpp?rev=53612&r1=53611&r2=53612&view=diff
==============================================================================
--- branches/shell32_new-bringup/dll/win32/shell32/shfldr_fonts.cpp [iso-8859-1] (original)
+++ branches/shell32_new-bringup/dll/win32/shell32/shfldr_fonts.cpp [iso-8859-1] Tue Sep  6 23:52:38 2011
@@ -174,6 +174,7 @@
 
 CFontsFolder::CFontsFolder()
 {
+    pidlRoot = NULL;
 }
 
 CFontsFolder::~CFontsFolder()

Modified: branches/shell32_new-bringup/dll/win32/shell32/shfldr_mydocuments.cpp
URL: http://svn.reactos.org/svn/reactos/branches/shell32_new-bringup/dll/win32/shell32/shfldr_mydocuments.cpp?rev=53612&r1=53611&r2=53612&view=diff
==============================================================================
--- branches/shell32_new-bringup/dll/win32/shell32/shfldr_mydocuments.cpp [iso-8859-1] (original)
+++ branches/shell32_new-bringup/dll/win32/shell32/shfldr_mydocuments.cpp [iso-8859-1] Tue Sep  6 23:52:38 2011
@@ -76,6 +76,7 @@
 
 CMyDocsFolder::CMyDocsFolder()
 {
+    pidlRoot = NULL;
 }
 
 CMyDocsFolder::~CMyDocsFolder()

Modified: branches/shell32_new-bringup/dll/win32/shell32/shlfolder.cpp
URL: http://svn.reactos.org/svn/reactos/branches/shell32_new-bringup/dll/win32/shell32/shlfolder.cpp?rev=53612&r1=53611&r2=53612&view=diff
==============================================================================
--- branches/shell32_new-bringup/dll/win32/shell32/shlfolder.cpp [iso-8859-1] (original)
+++ branches/shell32_new-bringup/dll/win32/shell32/shlfolder.cpp [iso-8859-1] Tue Sep  6 23:52:38 2011
@@ -23,7 +23,7 @@
 
 #include <precomp.h>
 
-WINE_DEFAULT_DEBUG_CHANNEL (shell);
+WINE_DEFAULT_DEBUG_CHANNEL(shell);
 
 static const WCHAR wszDotShellClassInfo[] = {
     '.','S','h','e','l','l','C','l','a','s','s','I','n','f','o',0};
@@ -177,42 +177,45 @@
     hr = SHCoCreateInstance(NULL, &clsid, NULL, IID_IShellFolder, ppvOut);
     if (SUCCEEDED (hr))
     {
-	LPITEMIDLIST pidlAbsolute = ILCombine (pidlRoot, pidlChild);
-	IPersistFolder *pPF;
-	IPersistFolder3 *ppf;
+	    LPITEMIDLIST pidlAbsolute = ILCombine (pidlRoot, pidlChild);
+	    IPersistFolder *pPF;
+	    IPersistFolder3 *ppf;
 
         if (_ILIsFolder(pidlChild) &&
             SUCCEEDED (((IUnknown *)(*ppvOut))->QueryInterface(IID_IPersistFolder3, (LPVOID *) & ppf)))
         {
-	    PERSIST_FOLDER_TARGET_INFO ppfti;
-
-	    ZeroMemory (&ppfti, sizeof (ppfti));
-
-	    /* fill the PERSIST_FOLDER_TARGET_INFO */
-	    ppfti.dwAttributes = -1;
-	    ppfti.csidl = -1;
-
-	    /* build path */
-	    if (pathRoot) {
-		lstrcpynW (ppfti.szTargetParsingName, pathRoot, MAX_PATH - 1);
-		PathAddBackslashW(ppfti.szTargetParsingName); /* FIXME: why have drives a backslash here ? */
+	        PERSIST_FOLDER_TARGET_INFO ppfti;
+
+	        ZeroMemory (&ppfti, sizeof (ppfti));
+
+	        /* fill the PERSIST_FOLDER_TARGET_INFO */
+	        ppfti.dwAttributes = -1;
+	        ppfti.csidl = -1;
+
+	        /* build path */
+	        if (pathRoot)
+            {
+		        lstrcpynW (ppfti.szTargetParsingName, pathRoot, MAX_PATH - 1);
+		        PathAddBackslashW(ppfti.szTargetParsingName); /* FIXME: why have drives a backslash here ? */
+	        }
+
+	        if (pidlChild)
+            {
+                int len = wcslen(ppfti.szTargetParsingName);
+
+		        if (!_ILSimpleGetTextW(pidlChild, ppfti.szTargetParsingName + len, MAX_PATH - len))
+			        hr = E_INVALIDARG;
+	        }
+
+	        ppf->InitializeEx(NULL, pidlAbsolute, &ppfti);
+	        ppf->Release();
 	    }
-
-	    if (pidlChild) {
-                int len = wcslen(ppfti.szTargetParsingName);
-
-		if (!_ILSimpleGetTextW(pidlChild, ppfti.szTargetParsingName + len, MAX_PATH - len))
-			hr = E_INVALIDARG;
+	    else if (SUCCEEDED ((hr = ((IUnknown *)(*ppvOut))->QueryInterface (IID_IPersistFolder, (LPVOID *) & pPF))))
+        {
+	        pPF->Initialize(pidlAbsolute);
+	        pPF->Release();
 	    }
-
-	    ppf->InitializeEx(NULL, pidlAbsolute, &ppfti);
-	    ppf->Release();
-	}
-	else if (SUCCEEDED ((hr = ((IUnknown *)(*ppvOut))->QueryInterface (IID_IPersistFolder, (LPVOID *) & pPF)))) {
-	    pPF->Initialize(pidlAbsolute);
-	    pPF->Release();
-	}
-	ILFree (pidlAbsolute);
+	    ILFree (pidlAbsolute);
     }
     TRACE ("-- (%p) ret=0x%08x\n", *ppvOut, hr);
     return hr;

Modified: branches/shell32_new-bringup/lib/atl/atlbase.h
URL: http://svn.reactos.org/svn/reactos/branches/shell32_new-bringup/lib/atl/atlbase.h?rev=53612&r1=53611&r2=53612&view=diff
==============================================================================
--- branches/shell32_new-bringup/lib/atl/atlbase.h [iso-8859-1] (original)
+++ branches/shell32_new-bringup/lib/atl/atlbase.h [iso-8859-1] Tue Sep  6 23:52:38 2011
@@ -538,6 +538,7 @@
 	{
 		ATLASSERT(_pModule == NULL);
 		_pModule = this;
+		_pModule->m_pObjMap = NULL;
 	}
 
 	~CComModule()




More information about the Ros-diffs mailing list