mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 08:25:03 +00:00
[shell32.dll]
- Initialize uninitialized variables in constructors. [atl] - Initialize uninitialized variables in constructors. All spotted by Amine Khaldi. svn path=/branches/shell32_new-bringup/; revision=53612
This commit is contained in:
parent
6cc65f4e4f
commit
270842aeb0
8 changed files with 47 additions and 31 deletions
|
@ -50,6 +50,7 @@ CAutoComplete::CAutoComplete()
|
||||||
hwndListBox = NULL;
|
hwndListBox = NULL;
|
||||||
txtbackup = NULL;
|
txtbackup = NULL;
|
||||||
quickComplete = NULL;
|
quickComplete = NULL;
|
||||||
|
hwndEdit = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
|
|
|
@ -67,6 +67,7 @@ void InsertOpenWithItem(POPEN_WITH_CONTEXT pContext, WCHAR * szAppName);
|
||||||
|
|
||||||
COpenWithMenu::COpenWithMenu()
|
COpenWithMenu::COpenWithMenu()
|
||||||
{
|
{
|
||||||
|
count = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
COpenWithMenu::~COpenWithMenu()
|
COpenWithMenu::~COpenWithMenu()
|
||||||
|
|
|
@ -329,6 +329,7 @@ IDefClFImpl::IDefClFImpl()
|
||||||
lpfnCI = NULL;
|
lpfnCI = NULL;
|
||||||
riidInst = NULL;
|
riidInst = NULL;
|
||||||
pcRefDll = NULL;
|
pcRefDll = NULL;
|
||||||
|
rclsid = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT IDefClFImpl::Initialize(LPFNCREATEINSTANCE lpfnCIx, PLONG pcRefDllx, const IID *riidInstx)
|
HRESULT IDefClFImpl::Initialize(LPFNCREATEINSTANCE lpfnCIx, PLONG pcRefDllx, const IID *riidInstx)
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
|
|
||||||
#include <precomp.h>
|
#include <precomp.h>
|
||||||
|
|
||||||
WINE_DEFAULT_DEBUG_CHANNEL (shell);
|
WINE_DEFAULT_DEBUG_CHANNEL(shell);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
CDesktopFolder should create two file system folders internally, one representing the
|
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}";
|
static WCHAR MyDocumentsClassString[] = L"{450D8FBA-AD25-11D0-98A8-0800361B1103}";
|
||||||
|
|
||||||
TRACE("(%p)->(flags=0x%08x)\n", this, dwFlags);
|
TRACE("(%p)->(flags=0x%08x)\n", this, dwFlags);
|
||||||
|
DbgPrint("[shell32, CDesktopFolderEnum::Initialize] Called with flags = %d\n", dwFlags);
|
||||||
|
|
||||||
/* enumerate the root folders */
|
/* enumerate the root folders */
|
||||||
if (dwFlags & SHCONTF_FOLDERS)
|
if (dwFlags & SHCONTF_FOLDERS)
|
||||||
|
@ -262,6 +263,7 @@ HRESULT WINAPI CDesktopFolderEnum::Initialize(CDesktopFolder *desktopFolder, HWN
|
||||||
|
|
||||||
CDesktopFolder::CDesktopFolder()
|
CDesktopFolder::CDesktopFolder()
|
||||||
{
|
{
|
||||||
|
pidlRoot = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
CDesktopFolder::~CDesktopFolder()
|
CDesktopFolder::~CDesktopFolder()
|
||||||
|
@ -393,20 +395,25 @@ HRESULT WINAPI CDesktopFolder::EnumObjects(HWND hwndOwner, DWORD dwFlags, LPENUM
|
||||||
HRESULT hResult;
|
HRESULT hResult;
|
||||||
|
|
||||||
TRACE ("(%p)->(HWND=%p flags=0x%08x pplist=%p)\n", this, hwndOwner, dwFlags, ppEnumIDList);
|
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)
|
if (ppEnumIDList == NULL)
|
||||||
return E_POINTER;
|
return E_POINTER;
|
||||||
*ppEnumIDList = NULL;
|
*ppEnumIDList = NULL;
|
||||||
ATLTRY (theEnumerator = new CComObject<CDesktopFolderEnum>);
|
|
||||||
if (theEnumerator == NULL)
|
ATLTRY (theEnumerator = new CComObject<CDesktopFolderEnum>);
|
||||||
|
|
||||||
|
if (theEnumerator == NULL)
|
||||||
return E_OUTOFMEMORY;
|
return E_OUTOFMEMORY;
|
||||||
hResult = theEnumerator->QueryInterface (IID_IEnumIDList, (void **)&result);
|
|
||||||
|
hResult = theEnumerator->QueryInterface (IID_IEnumIDList, (void **)&result);
|
||||||
if (FAILED (hResult))
|
if (FAILED (hResult))
|
||||||
{
|
{
|
||||||
delete theEnumerator;
|
delete theEnumerator;
|
||||||
return hResult;
|
return hResult;
|
||||||
}
|
}
|
||||||
hResult = theEnumerator->Initialize (this, hwndOwner, dwFlags);
|
|
||||||
|
hResult = theEnumerator->Initialize (this, hwndOwner, dwFlags);
|
||||||
if (FAILED (hResult))
|
if (FAILED (hResult))
|
||||||
return hResult;
|
return hResult;
|
||||||
*ppEnumIDList = result.Detach ();
|
*ppEnumIDList = result.Detach ();
|
||||||
|
|
|
@ -174,6 +174,7 @@ BOOL CDesktopFolderEnumZ::CreateFontsEnumList(DWORD dwFlags)
|
||||||
|
|
||||||
CFontsFolder::CFontsFolder()
|
CFontsFolder::CFontsFolder()
|
||||||
{
|
{
|
||||||
|
pidlRoot = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
CFontsFolder::~CFontsFolder()
|
CFontsFolder::~CFontsFolder()
|
||||||
|
|
|
@ -76,6 +76,7 @@ HRESULT WINAPI CFileSysEnumX::Initialize(DWORD dwFlags)
|
||||||
|
|
||||||
CMyDocsFolder::CMyDocsFolder()
|
CMyDocsFolder::CMyDocsFolder()
|
||||||
{
|
{
|
||||||
|
pidlRoot = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
CMyDocsFolder::~CMyDocsFolder()
|
CMyDocsFolder::~CMyDocsFolder()
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
|
|
||||||
#include <precomp.h>
|
#include <precomp.h>
|
||||||
|
|
||||||
WINE_DEFAULT_DEBUG_CHANNEL (shell);
|
WINE_DEFAULT_DEBUG_CHANNEL(shell);
|
||||||
|
|
||||||
static const WCHAR wszDotShellClassInfo[] = {
|
static const WCHAR wszDotShellClassInfo[] = {
|
||||||
'.','S','h','e','l','l','C','l','a','s','s','I','n','f','o',0};
|
'.','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);
|
hr = SHCoCreateInstance(NULL, &clsid, NULL, IID_IShellFolder, ppvOut);
|
||||||
if (SUCCEEDED (hr))
|
if (SUCCEEDED (hr))
|
||||||
{
|
{
|
||||||
LPITEMIDLIST pidlAbsolute = ILCombine (pidlRoot, pidlChild);
|
LPITEMIDLIST pidlAbsolute = ILCombine (pidlRoot, pidlChild);
|
||||||
IPersistFolder *pPF;
|
IPersistFolder *pPF;
|
||||||
IPersistFolder3 *ppf;
|
IPersistFolder3 *ppf;
|
||||||
|
|
||||||
if (_ILIsFolder(pidlChild) &&
|
if (_ILIsFolder(pidlChild) &&
|
||||||
SUCCEEDED (((IUnknown *)(*ppvOut))->QueryInterface(IID_IPersistFolder3, (LPVOID *) & ppf)))
|
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 */
|
/* fill the PERSIST_FOLDER_TARGET_INFO */
|
||||||
ppfti.dwAttributes = -1;
|
ppfti.dwAttributes = -1;
|
||||||
ppfti.csidl = -1;
|
ppfti.csidl = -1;
|
||||||
|
|
||||||
/* build path */
|
/* build path */
|
||||||
if (pathRoot) {
|
if (pathRoot)
|
||||||
lstrcpynW (ppfti.szTargetParsingName, pathRoot, MAX_PATH - 1);
|
{
|
||||||
PathAddBackslashW(ppfti.szTargetParsingName); /* FIXME: why have drives a backslash here ? */
|
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);
|
int len = wcslen(ppfti.szTargetParsingName);
|
||||||
|
|
||||||
if (!_ILSimpleGetTextW(pidlChild, ppfti.szTargetParsingName + len, MAX_PATH - len))
|
if (!_ILSimpleGetTextW(pidlChild, ppfti.szTargetParsingName + len, MAX_PATH - len))
|
||||||
hr = E_INVALIDARG;
|
hr = E_INVALIDARG;
|
||||||
}
|
}
|
||||||
|
|
||||||
ppf->InitializeEx(NULL, pidlAbsolute, &ppfti);
|
ppf->InitializeEx(NULL, pidlAbsolute, &ppfti);
|
||||||
ppf->Release();
|
ppf->Release();
|
||||||
}
|
}
|
||||||
else if (SUCCEEDED ((hr = ((IUnknown *)(*ppvOut))->QueryInterface (IID_IPersistFolder, (LPVOID *) & pPF)))) {
|
else if (SUCCEEDED ((hr = ((IUnknown *)(*ppvOut))->QueryInterface (IID_IPersistFolder, (LPVOID *) & pPF))))
|
||||||
pPF->Initialize(pidlAbsolute);
|
{
|
||||||
pPF->Release();
|
pPF->Initialize(pidlAbsolute);
|
||||||
}
|
pPF->Release();
|
||||||
ILFree (pidlAbsolute);
|
}
|
||||||
|
ILFree (pidlAbsolute);
|
||||||
}
|
}
|
||||||
TRACE ("-- (%p) ret=0x%08x\n", *ppvOut, hr);
|
TRACE ("-- (%p) ret=0x%08x\n", *ppvOut, hr);
|
||||||
return hr;
|
return hr;
|
||||||
|
|
|
@ -538,6 +538,7 @@ public:
|
||||||
{
|
{
|
||||||
ATLASSERT(_pModule == NULL);
|
ATLASSERT(_pModule == NULL);
|
||||||
_pModule = this;
|
_pModule = this;
|
||||||
|
_pModule->m_pObjMap = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
~CComModule()
|
~CComModule()
|
||||||
|
|
Loading…
Reference in a new issue