[shell32.dll]
authorClaudiu Mihail <claudiu.bogdan.mihail@gmail.com>
Tue, 6 Sep 2011 23:52:38 +0000 (23:52 +0000)
committerClaudiu Mihail <claudiu.bogdan.mihail@gmail.com>
Tue, 6 Sep 2011 23:52:38 +0000 (23:52 +0000)
- Initialize uninitialized variables in constructors.
[atl]
- Initialize uninitialized variables in constructors.
All spotted by Amine Khaldi.

svn path=/branches/shell32_new-bringup/; revision=53612

dll/win32/shell32/autocomplete.cpp
dll/win32/shell32/she_ocmenu.cpp
dll/win32/shell32/shellole.cpp
dll/win32/shell32/shfldr_desktop.cpp
dll/win32/shell32/shfldr_fonts.cpp
dll/win32/shell32/shfldr_mydocuments.cpp
dll/win32/shell32/shlfolder.cpp
lib/atl/atlbase.h

index d6bb69d..86b4ab2 100644 (file)
@@ -50,6 +50,7 @@ CAutoComplete::CAutoComplete()
        hwndListBox = NULL;
        txtbackup = NULL;
        quickComplete = NULL;
+    hwndEdit = NULL;
 }
 
 /**************************************************************************
index c595b5b..e86a127 100644 (file)
@@ -67,6 +67,7 @@ void InsertOpenWithItem(POPEN_WITH_CONTEXT pContext, WCHAR * szAppName);
 
 COpenWithMenu::COpenWithMenu()
 {
+    count = 0;
 }
 
 COpenWithMenu::~COpenWithMenu()
index 2ab7561..88d7bc2 100644 (file)
@@ -329,6 +329,7 @@ IDefClFImpl::IDefClFImpl()
        lpfnCI = NULL;
        riidInst = NULL;
        pcRefDll = NULL;
+    rclsid = NULL;
 }
 
 HRESULT IDefClFImpl::Initialize(LPFNCREATEINSTANCE lpfnCIx, PLONG pcRefDllx, const IID *riidInstx)
index 6b87052..7a6f839 100644 (file)
@@ -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 @@ HRESULT WINAPI CDesktopFolderEnum::Initialize(CDesktopFolder *desktopFolder, HWN
     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 @@ HRESULT WINAPI CDesktopFolderEnum::Initialize(CDesktopFolder *desktopFolder, HWN
 
 CDesktopFolder::CDesktopFolder()
 {
+    pidlRoot = NULL;
 }
 
 CDesktopFolder::~CDesktopFolder()
@@ -393,20 +395,25 @@ HRESULT WINAPI CDesktopFolder::EnumObjects(HWND hwndOwner, DWORD dwFlags, LPENUM
        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 ();
index 37f9ad7..518b4ef 100644 (file)
@@ -174,6 +174,7 @@ BOOL CDesktopFolderEnumZ::CreateFontsEnumList(DWORD dwFlags)
 
 CFontsFolder::CFontsFolder()
 {
+    pidlRoot = NULL;
 }
 
 CFontsFolder::~CFontsFolder()
index 525a082..f229eca 100644 (file)
@@ -76,6 +76,7 @@ HRESULT WINAPI CFileSysEnumX::Initialize(DWORD dwFlags)
 
 CMyDocsFolder::CMyDocsFolder()
 {
+    pidlRoot = NULL;
 }
 
 CMyDocsFolder::~CMyDocsFolder()
index cb6fce5..9e62002 100644 (file)
@@ -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 @@ static HRESULT SHELL32_CoCreateInitSF (LPCITEMIDLIST pidlRoot, LPCWSTR pathRoot,
     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;
+               PERSIST_FOLDER_TARGET_INFO ppfti;
 
-           ZeroMemory (&ppfti, sizeof (ppfti));
+               ZeroMemory (&ppfti, sizeof (ppfti));
 
-           /* fill the PERSIST_FOLDER_TARGET_INFO */
-           ppfti.dwAttributes = -1;
-           ppfti.csidl = -1;
+               /* 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 ? */
-           }
+               /* build path */
+               if (pathRoot)
+            {
+                       lstrcpynW (ppfti.szTargetParsingName, pathRoot, MAX_PATH - 1);
+                       PathAddBackslashW(ppfti.szTargetParsingName); /* FIXME: why have drives a backslash here ? */
+               }
 
-           if (pidlChild) {
+               if (pidlChild)
+            {
                 int len = wcslen(ppfti.szTargetParsingName);
 
-               if (!_ILSimpleGetTextW(pidlChild, ppfti.szTargetParsingName + len, MAX_PATH - len))
-                       hr = E_INVALIDARG;
-           }
+                       if (!_ILSimpleGetTextW(pidlChild, ppfti.szTargetParsingName + len, MAX_PATH - len))
+                               hr = E_INVALIDARG;
+               }
 
-           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);
+               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);
     }
     TRACE ("-- (%p) ret=0x%08x\n", *ppvOut, hr);
     return hr;
index 137acf1..0c238ee 100644 (file)
@@ -538,6 +538,7 @@ public:
        {
                ATLASSERT(_pModule == NULL);
                _pModule = this;
+               _pModule->m_pObjMap = NULL;
        }
 
        ~CComModule()