Author: cmihail
Date: Wed Sep 7 20:00:32 2011
New Revision: 53629
URL:
http://svn.reactos.org/svn/reactos?rev=53629&view=rev
Log:
[shell32.dll]
- More uninitialized value fixing. Again Amine Khaldi spotting them with his magical
powers.
- I took the liberty to convert tabs I found to spaces. Normally I shouldn't mix
formatting with coding changes but I forgot. Sorry.
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/shfldr_desktop.cpp
branches/shell32_new-bringup/dll/win32/shell32/shfldr_fonts.cpp
branches/shell32_new-bringup/dll/win32/shell32/shfldr_mydocuments.cpp
Modified: branches/shell32_new-bringup/dll/win32/shell32/autocomplete.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/shell32_new-bringup/dll/win32/s…
==============================================================================
--- 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] Wed Sep
7 20:00:32 2011
@@ -51,6 +51,7 @@
txtbackup = NULL;
quickComplete = NULL;
hwndEdit = NULL;
+ wpOrigLBoxProc = 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/s…
==============================================================================
--- 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] Wed Sep 7
20:00:32 2011
@@ -68,6 +68,7 @@
COpenWithMenu::COpenWithMenu()
{
count = 0;
+ wId = 0;
}
COpenWithMenu::~COpenWithMenu()
Modified: branches/shell32_new-bringup/dll/win32/shell32/shfldr_desktop.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/shell32_new-bringup/dll/win32/s…
==============================================================================
--- 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] Wed Sep
7 20:00:32 2011
@@ -48,18 +48,18 @@
class CDesktopFolder;
class CDesktopFolderEnum :
- public IEnumIDListImpl
+ public IEnumIDListImpl
{
private:
-// CComPtr fDesktopEnumerator;
-// CComPtr fCommonDesktopEnumerator;
+// CComPtr fDesktopEnumerator;
+// CComPtr fCommonDesktopEnumerator;
public:
- CDesktopFolderEnum();
- ~CDesktopFolderEnum();
- HRESULT WINAPI Initialize(CDesktopFolder *desktopFolder, HWND hwndOwner, DWORD
dwFlags);
+ CDesktopFolderEnum();
+ ~CDesktopFolderEnum();
+ HRESULT WINAPI Initialize(CDesktopFolder *desktopFolder, HWND hwndOwner, DWORD
dwFlags);
BEGIN_COM_MAP(CDesktopFolderEnum)
- COM_INTERFACE_ENTRY_IID(IID_IEnumIDList, IEnumIDList)
+ COM_INTERFACE_ENTRY_IID(IID_IEnumIDList, IEnumIDList)
END_COM_MAP()
};
@@ -145,125 +145,126 @@
/* enumerate the root folders */
if (dwFlags & SHCONTF_FOLDERS)
{
- HKEY hkey;
- UINT i;
- DWORD dwResult;
-
- /* create the pidl for This item */
- if (IsNamespaceExtensionHidden(MyDocumentsClassString) < 1)
- {
- ret = AddToEnumList(_ILCreateMyDocuments());
- }
- ret = AddToEnumList(_ILCreateMyComputer());
-
- for (i = 0; i < 2; i++)
- {
- if (i == 0)
- dwResult = RegOpenKeyExW(HKEY_LOCAL_MACHINE, Desktop_NameSpaceW, 0, KEY_READ,
&hkey);
- else
- dwResult = RegOpenKeyExW(HKEY_CURRENT_USER, Desktop_NameSpaceW, 0, KEY_READ,
&hkey);
-
- if (dwResult == ERROR_SUCCESS)
- {
- WCHAR iid[50];
- LPITEMIDLIST pidl;
- int i=0;
-
- while (ret)
- {
- DWORD size;
- LONG r;
-
- size = sizeof (iid) / sizeof (iid[0]);
- r = RegEnumKeyExW(hkey, i, iid, &size, 0, NULL, NULL, NULL);
- if (ERROR_SUCCESS == r)
- {
- if (IsNamespaceExtensionHidden(iid) < 1)
- {
- pidl = _ILCreateGuidFromStrW(iid);
- if (pidl != NULL)
- {
- if (!HasItemWithCLSID(pidl))
- {
- ret = AddToEnumList(pidl);
- }
- else
- {
- SHFree(pidl);
- }
- }
- }
- }
- else if (ERROR_NO_MORE_ITEMS == r)
- break;
- else
- ret = FALSE;
- i++;
- }
- RegCloseKey(hkey);
- }
- }
- for (i = 0; i < 2; i++)
- {
- if (i == 0)
- dwResult = RegOpenKeyExW(HKEY_LOCAL_MACHINE, ClassicStartMenuW, 0, KEY_READ,
&hkey);
- else
- dwResult = RegOpenKeyExW(HKEY_CURRENT_USER, ClassicStartMenuW, 0, KEY_READ,
&hkey);
-
- if (dwResult == ERROR_SUCCESS)
- {
- DWORD j = 0, dwVal, Val, dwType, dwIID;
- LONG r;
- WCHAR iid[50];
-
- while(ret)
- {
- dwVal = sizeof(Val);
- dwIID = sizeof(iid) / sizeof(WCHAR);
-
- r = RegEnumValueW(hkey, j++, iid, &dwIID, NULL, &dwType, (LPBYTE)&Val,
&dwVal);
- if (r == ERROR_SUCCESS)
- {
- if (Val == 0 && dwType == REG_DWORD)
- {
- LPITEMIDLIST pidl = _ILCreateGuidFromStrW(iid);
- if (pidl != NULL)
- {
- if (!HasItemWithCLSID(pidl))
- {
- AddToEnumList(pidl);
- }
- else
- {
- SHFree(pidl);
- }
- }
- }
- }
- else if (ERROR_NO_MORE_ITEMS == r)
- break;
- else
- ret = FALSE;
- }
- RegCloseKey(hkey);
- }
-
- }
- }
-
- /* enumerate the elements in %windir%\desktop */
- ret = ret && SHGetSpecialFolderPathW(0, szPath, CSIDL_DESKTOPDIRECTORY, FALSE);
- ret = ret && CreateFolderEnumList(szPath, dwFlags);
+ HKEY hkey;
+ UINT i;
+ DWORD dwResult;
+
+ /* create the pidl for This item */
+ if (IsNamespaceExtensionHidden(MyDocumentsClassString) < 1)
+ {
+ ret = AddToEnumList(_ILCreateMyDocuments());
+ }
+ ret = AddToEnumList(_ILCreateMyComputer());
+
+ for (i = 0; i < 2; i++)
+ {
+ if (i == 0)
+ dwResult = RegOpenKeyExW(HKEY_LOCAL_MACHINE, Desktop_NameSpaceW, 0,
KEY_READ, &hkey);
+ else
+ dwResult = RegOpenKeyExW(HKEY_CURRENT_USER, Desktop_NameSpaceW, 0,
KEY_READ, &hkey);
+
+ if (dwResult == ERROR_SUCCESS)
+ {
+ WCHAR iid[50];
+ LPITEMIDLIST pidl;
+ int i=0;
+
+ while (ret)
+ {
+ DWORD size;
+ LONG r;
+
+ size = sizeof (iid) / sizeof (iid[0]);
+ r = RegEnumKeyExW(hkey, i, iid, &size, 0, NULL, NULL, NULL);
+ if (ERROR_SUCCESS == r)
+ {
+ if (IsNamespaceExtensionHidden(iid) < 1)
+ {
+ pidl = _ILCreateGuidFromStrW(iid);
+ if (pidl != NULL)
+ {
+ if (!HasItemWithCLSID(pidl))
+ {
+ ret = AddToEnumList(pidl);
+ }
+ else
+ {
+ SHFree(pidl);
+ }
+ }
+ }
+ }
+ else if (ERROR_NO_MORE_ITEMS == r)
+ break;
+ else
+ ret = FALSE;
+ i++;
+ }
+ RegCloseKey(hkey);
+ }
+ }
+ for (i = 0; i < 2; i++)
+ {
+ if (i == 0)
+ dwResult = RegOpenKeyExW(HKEY_LOCAL_MACHINE, ClassicStartMenuW, 0,
KEY_READ, &hkey);
+ else
+ dwResult = RegOpenKeyExW(HKEY_CURRENT_USER, ClassicStartMenuW, 0,
KEY_READ, &hkey);
+
+ if (dwResult == ERROR_SUCCESS)
+ {
+ DWORD j = 0, dwVal, Val, dwType, dwIID;
+ LONG r;
+ WCHAR iid[50];
+
+ while(ret)
+ {
+ dwVal = sizeof(Val);
+ dwIID = sizeof(iid) / sizeof(WCHAR);
+
+ r = RegEnumValueW(hkey, j++, iid, &dwIID, NULL, &dwType,
(LPBYTE)&Val, &dwVal);
+ if (r == ERROR_SUCCESS)
+ {
+ if (Val == 0 && dwType == REG_DWORD)
+ {
+ LPITEMIDLIST pidl = _ILCreateGuidFromStrW(iid);
+ if (pidl != NULL)
+ {
+ if (!HasItemWithCLSID(pidl))
+ {
+ AddToEnumList(pidl);
+ }
+ else
+ {
+ SHFree(pidl);
+ }
+ }
+ }
+ }
+ else if (ERROR_NO_MORE_ITEMS == r)
+ break;
+ else
+ ret = FALSE;
+ }
+ RegCloseKey(hkey);
+ }
+
+ }
+ }
+
+ /* enumerate the elements in %windir%\desktop */
+ ret = ret && SHGetSpecialFolderPathW(0, szPath, CSIDL_DESKTOPDIRECTORY,
FALSE);
+ ret = ret && CreateFolderEnumList(szPath, dwFlags);
ret = ret && SHGetSpecialFolderPathW(0, szPath,
CSIDL_COMMON_DESKTOPDIRECTORY, FALSE);
ret = ret && CreateFolderEnumList(szPath, dwFlags);
- return ret ? S_OK : E_FAIL;
+ return ret ? S_OK : E_FAIL;
}
CDesktopFolder::CDesktopFolder()
{
pidlRoot = NULL;
+ sPathTarget = NULL;
}
CDesktopFolder::~CDesktopFolder()
@@ -272,7 +273,7 @@
HRESULT WINAPI CDesktopFolder::FinalConstruct()
{
- WCHAR szMyPath[MAX_PATH];
+ WCHAR szMyPath[MAX_PATH];
if (!SHGetSpecialFolderPathW( 0, szMyPath, CSIDL_DESKTOPDIRECTORY, TRUE ))
return E_UNEXPECTED;
@@ -280,7 +281,7 @@
pidlRoot = _ILCreateDesktop(); /* my qualified pidl */
sPathTarget = (LPWSTR)SHAlloc((wcslen(szMyPath) + 1) * sizeof(WCHAR));
wcscpy(sPathTarget, szMyPath);
- return S_OK;
+ return S_OK;
}
/**************************************************************************
@@ -390,37 +391,37 @@
*/
HRESULT WINAPI CDesktopFolder::EnumObjects(HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST
*ppEnumIDList)
{
- CComObject<CDesktopFolderEnum> *theEnumerator;
- CComPtr<IEnumIDList> result;
- HRESULT hResult;
-
- TRACE ("(%p)->(HWND=%p flags=0x%08x pplist=%p)\n", this, hwndOwner,
dwFlags, ppEnumIDList);
+ CComObject<CDesktopFolderEnum> *theEnumerator;
+ CComPtr<IEnumIDList> result;
+ 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;
-
+ if (ppEnumIDList == NULL)
+ return E_POINTER;
+ *ppEnumIDList = NULL;
+
ATLTRY (theEnumerator = new CComObject<CDesktopFolderEnum>);
-
+
if (theEnumerator == NULL)
- return E_OUTOFMEMORY;
-
+ return E_OUTOFMEMORY;
+
hResult = theEnumerator->QueryInterface (IID_IEnumIDList, (void **)&result);
- if (FAILED (hResult))
- {
- delete theEnumerator;
- return hResult;
- }
-
+ if (FAILED (hResult))
+ {
+ delete theEnumerator;
+ return hResult;
+ }
+
hResult = theEnumerator->Initialize (this, hwndOwner, dwFlags);
- if (FAILED (hResult))
- return hResult;
- *ppEnumIDList = result.Detach ();
+ if (FAILED (hResult))
+ return hResult;
+ *ppEnumIDList = result.Detach ();
TRACE ("-- (%p)->(new ID List: %p)\n", this, *ppEnumIDList);
- return S_OK;
+ return S_OK;
}
/**************************************************************************
@@ -464,7 +465,7 @@
*/
HRESULT WINAPI CDesktopFolder::CreateViewObject(HWND hwndOwner, REFIID riid, LPVOID
*ppvOut)
{
- CComPtr<IShellView> pShellView;
+ CComPtr<IShellView> pShellView;
HRESULT hr = E_INVALIDARG;
TRACE ("(%p)->(hwnd=%p,%s,%p)\n",
@@ -794,7 +795,7 @@
HRESULT WINAPI CDesktopFolder::SetNameOf(HWND hwndOwner, LPCITEMIDLIST pidl, /* simple
pidl */
LPCOLESTR lpName, DWORD dwFlags, LPITEMIDLIST *pPidlOut)
{
- CComPtr<IShellFolder2> psf;
+ CComPtr<IShellFolder2> psf;
HRESULT hr;
WCHAR szSrc[MAX_PATH + 1], szDest[MAX_PATH + 1];
LPWSTR ptr;
@@ -984,7 +985,7 @@
HRESULT WINAPI CDesktopFolder::GetUniqueName(LPWSTR pwszName, UINT uLen)
{
- CComPtr<IEnumIDList> penum;
+ CComPtr<IEnumIDList> penum;
HRESULT hr;
WCHAR wszText[MAX_PATH];
WCHAR wszNewFolder[25];
@@ -1149,7 +1150,7 @@
HRESULT WINAPI CDesktopFolder::CopyItems(IShellFolder *pSFFrom, UINT cidl, LPCITEMIDLIST
*apidl)
{
- CComPtr<IPersistFolder2> ppf2;
+ CComPtr<IPersistFolder2> ppf2;
WCHAR szSrcPath[MAX_PATH];
WCHAR szTargetPath[MAX_PATH];
SHFILEOPSTRUCTW op;
Modified: branches/shell32_new-bringup/dll/win32/shell32/shfldr_fonts.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/shell32_new-bringup/dll/win32/s…
==============================================================================
--- 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] Wed Sep
7 20:00:32 2011
@@ -35,17 +35,17 @@
*/
class CDesktopFolderEnumZ :
- public IEnumIDListImpl
+ public IEnumIDListImpl
{
private:
public:
- CDesktopFolderEnumZ();
- ~CDesktopFolderEnumZ();
- HRESULT WINAPI Initialize(DWORD dwFlags);
- BOOL CreateFontsEnumList(DWORD dwFlags);
+ CDesktopFolderEnumZ();
+ ~CDesktopFolderEnumZ();
+ HRESULT WINAPI Initialize(DWORD dwFlags);
+ BOOL CreateFontsEnumList(DWORD dwFlags);
BEGIN_COM_MAP(CDesktopFolderEnumZ)
- COM_INTERFACE_ENTRY_IID(IID_IEnumIDList, IEnumIDList)
+ COM_INTERFACE_ENTRY_IID(IID_IEnumIDList, IEnumIDList)
END_COM_MAP()
};
@@ -74,47 +74,47 @@
HRESULT WINAPI CDesktopFolderEnumZ::Initialize(DWORD dwFlags)
{
if (CreateFontsEnumList(dwFlags) == FALSE)
- return E_FAIL;
- return S_OK;
+ return E_FAIL;
+ return S_OK;
}
static LPITEMIDLIST _ILCreateFontItem(LPWSTR pszFont, LPWSTR pszFile)
{
- PIDLDATA tmp;
- LPITEMIDLIST pidl;
- PIDLFontStruct * p;
- int size0 = (char*)&tmp.u.cfont.szName-(char*)&tmp.u.cfont;
- int size = size0;
-
- tmp.type = 0x00;
- tmp.u.cfont.dummy = 0xFF;
- tmp.u.cfont.offsFile = wcslen(pszFont) + 1;
-
- size += (tmp.u.cfont.offsFile + wcslen(pszFile) + 1) * sizeof(WCHAR);
-
- pidl = (LPITEMIDLIST)SHAlloc(size + 4);
- if (!pidl)
- return pidl;
-
- pidl->mkid.cb = size+2;
- memcpy(pidl->mkid.abID, &tmp, 2+size0);
-
- p = &((PIDLDATA*)pidl->mkid.abID)->u.cfont;
- wcscpy(p->szName, pszFont);
- wcscpy(p->szName + tmp.u.cfont.offsFile, pszFile);
-
- *(WORD*)((char*)pidl+(size+2)) = 0;
- return pidl;
+ PIDLDATA tmp;
+ LPITEMIDLIST pidl;
+ PIDLFontStruct * p;
+ int size0 = (char*)&tmp.u.cfont.szName-(char*)&tmp.u.cfont;
+ int size = size0;
+
+ tmp.type = 0x00;
+ tmp.u.cfont.dummy = 0xFF;
+ tmp.u.cfont.offsFile = wcslen(pszFont) + 1;
+
+ size += (tmp.u.cfont.offsFile + wcslen(pszFile) + 1) * sizeof(WCHAR);
+
+ pidl = (LPITEMIDLIST)SHAlloc(size + 4);
+ if (!pidl)
+ return pidl;
+
+ pidl->mkid.cb = size+2;
+ memcpy(pidl->mkid.abID, &tmp, 2+size0);
+
+ p = &((PIDLDATA*)pidl->mkid.abID)->u.cfont;
+ wcscpy(p->szName, pszFont);
+ wcscpy(p->szName + tmp.u.cfont.offsFile, pszFile);
+
+ *(WORD*)((char*)pidl+(size+2)) = 0;
+ return pidl;
}
static PIDLFontStruct * _ILGetFontStruct(LPCITEMIDLIST pidl)
{
- LPPIDLDATA pdata = _ILGetDataPointer(pidl);
-
- if (pdata && pdata->type==0x00)
- return (PIDLFontStruct*)&(pdata->u.cfont);
-
- return NULL;
+ LPPIDLDATA pdata = _ILGetDataPointer(pidl);
+
+ if (pdata && pdata->type==0x00)
+ return (PIDLFontStruct*)&(pdata->u.cfont);
+
+ return NULL;
}
/**************************************************************************
@@ -122,77 +122,78 @@
*/
BOOL CDesktopFolderEnumZ::CreateFontsEnumList(DWORD dwFlags)
{
- WCHAR szPath[MAX_PATH];
- WCHAR szName[LF_FACESIZE+20];
- WCHAR szFile[MAX_PATH];
- LPWSTR pszPath;
- UINT Length;
- LONG ret;
- DWORD dwType, dwName, dwFile, dwIndex;
- LPITEMIDLIST pidl;
- HKEY hKey;
-
- if (dwFlags & SHCONTF_NONFOLDERS)
- {
- if (!SHGetSpecialFolderPathW(NULL, szPath, CSIDL_FONTS, FALSE))
- return FALSE;
-
- pszPath = PathAddBackslashW(szPath);
- if (!pszPath)
- return FALSE;
- if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"Software\\Microsoft\\Windows
NT\\CurrentVersion\\Fonts", 0, KEY_READ, &hKey)!= ERROR_SUCCESS)
- return FALSE;
-
- Length = pszPath - szPath;
- dwIndex = 0;
- do
- {
- dwName = sizeof(szName)/sizeof(WCHAR);
- dwFile = sizeof(szFile)/sizeof(WCHAR);
- ret = RegEnumValueW(hKey, dwIndex++, szName, &dwName, NULL, &dwType,
(LPBYTE)szFile, &dwFile);
- if (ret == ERROR_SUCCESS)
- {
- szFile[(sizeof(szFile)/sizeof(WCHAR))-1] = L'\0';
- if (dwType == REG_SZ && wcslen(szFile) + Length + 1<
(sizeof(szPath)/sizeof(WCHAR)))
- {
- wcscpy(&szPath[Length], szFile);
- pidl = _ILCreateFontItem(szName, szPath);
- TRACE("pidl %p name %s path %s\n", pidl, debugstr_w(szName),
debugstr_w(szPath));
- if (pidl)
- {
- if (!AddToEnumList(pidl))
- SHFree(pidl);
- }
- }
- }
- }while(ret != ERROR_NO_MORE_ITEMS);
- RegCloseKey(hKey);
-
- }
- return TRUE;
+ WCHAR szPath[MAX_PATH];
+ WCHAR szName[LF_FACESIZE+20];
+ WCHAR szFile[MAX_PATH];
+ LPWSTR pszPath;
+ UINT Length;
+ LONG ret;
+ DWORD dwType, dwName, dwFile, dwIndex;
+ LPITEMIDLIST pidl;
+ HKEY hKey;
+
+ if (dwFlags & SHCONTF_NONFOLDERS)
+ {
+ if (!SHGetSpecialFolderPathW(NULL, szPath, CSIDL_FONTS, FALSE))
+ return FALSE;
+
+ pszPath = PathAddBackslashW(szPath);
+ if (!pszPath)
+ return FALSE;
+ if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"Software\\Microsoft\\Windows
NT\\CurrentVersion\\Fonts", 0, KEY_READ, &hKey)!= ERROR_SUCCESS)
+ return FALSE;
+
+ Length = pszPath - szPath;
+ dwIndex = 0;
+ do
+ {
+ dwName = sizeof(szName)/sizeof(WCHAR);
+ dwFile = sizeof(szFile)/sizeof(WCHAR);
+ ret = RegEnumValueW(hKey, dwIndex++, szName, &dwName, NULL, &dwType,
(LPBYTE)szFile, &dwFile);
+ if (ret == ERROR_SUCCESS)
+ {
+ szFile[(sizeof(szFile)/sizeof(WCHAR))-1] = L'\0';
+ if (dwType == REG_SZ && wcslen(szFile) + Length + 1<
(sizeof(szPath)/sizeof(WCHAR)))
+ {
+ wcscpy(&szPath[Length], szFile);
+ pidl = _ILCreateFontItem(szName, szPath);
+ TRACE("pidl %p name %s path %s\n", pidl,
debugstr_w(szName), debugstr_w(szPath));
+ if (pidl)
+ {
+ if (!AddToEnumList(pidl))
+ SHFree(pidl);
+ }
+ }
+ }
+ }while(ret != ERROR_NO_MORE_ITEMS);
+ RegCloseKey(hKey);
+
+ }
+ return TRUE;
}
CFontsFolder::CFontsFolder()
{
pidlRoot = NULL;
+ apidl = NULL;
}
CFontsFolder::~CFontsFolder()
{
- TRACE("-- destroying IShellFolder(%p)\n", this);
- SHFree(pidlRoot);
+ TRACE("-- destroying IShellFolder(%p)\n", this);
+ SHFree(pidlRoot);
}
HRESULT WINAPI CFontsFolder::FinalConstruct()
{
- pidlRoot = _ILCreateFont(); /* my qualified pidl */
- if (pidlRoot == NULL)
- return E_OUTOFMEMORY;
- return S_OK;
-}
-
-/**************************************************************************
-* ISF_Fonts_fnParseDisplayName
+ pidlRoot = _ILCreateFont(); /* my qualified pidl */
+ if (pidlRoot == NULL)
+ return E_OUTOFMEMORY;
+ return S_OK;
+}
+
+/**************************************************************************
+* ISF_Fonts_fnParseDisplayName
*/
HRESULT WINAPI CFontsFolder::ParseDisplayName(HWND hwndOwner, LPBC pbcReserved, LPOLESTR
lpszDisplayName,
DWORD * pchEaten, LPITEMIDLIST * ppidl, DWORD * pdwAttributes)
@@ -205,7 +206,7 @@
*ppidl = 0;
if (pchEaten)
- *pchEaten = 0; /* strange but like the original */
+ *pchEaten = 0; /* strange but like the original */
TRACE ("(%p)->(-- ret=0x%08x)\n", this, hr);
@@ -213,40 +214,40 @@
}
/**************************************************************************
-* ISF_Fonts_fnEnumObjects
+* ISF_Fonts_fnEnumObjects
*/
HRESULT WINAPI CFontsFolder::EnumObjects(HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST
*ppEnumIDList)
{
- CComObject<CDesktopFolderEnumZ> *theEnumerator;
- CComPtr<IEnumIDList> result;
- HRESULT hResult;
-
- TRACE ("(%p)->(HWND=%p flags=0x%08x pplist=%p)\n", this, hwndOwner,
dwFlags, ppEnumIDList);
-
- if (ppEnumIDList == NULL)
- return E_POINTER;
- *ppEnumIDList = NULL;
- ATLTRY (theEnumerator = new CComObject<CDesktopFolderEnumZ>);
- if (theEnumerator == NULL)
- return E_OUTOFMEMORY;
- hResult = theEnumerator->QueryInterface (IID_IEnumIDList, (void **)&result);
- if (FAILED (hResult))
- {
- delete theEnumerator;
- return hResult;
- }
- hResult = theEnumerator->Initialize (dwFlags);
- if (FAILED (hResult))
- return hResult;
- *ppEnumIDList = result.Detach ();
+ CComObject<CDesktopFolderEnumZ> *theEnumerator;
+ CComPtr<IEnumIDList> result;
+ HRESULT hResult;
+
+ TRACE ("(%p)->(HWND=%p flags=0x%08x pplist=%p)\n", this, hwndOwner,
dwFlags, ppEnumIDList);
+
+ if (ppEnumIDList == NULL)
+ return E_POINTER;
+ *ppEnumIDList = NULL;
+ ATLTRY (theEnumerator = new CComObject<CDesktopFolderEnumZ>);
+ if (theEnumerator == NULL)
+ return E_OUTOFMEMORY;
+ hResult = theEnumerator->QueryInterface (IID_IEnumIDList, (void **)&result);
+ if (FAILED (hResult))
+ {
+ delete theEnumerator;
+ return hResult;
+ }
+ hResult = theEnumerator->Initialize (dwFlags);
+ if (FAILED (hResult))
+ return hResult;
+ *ppEnumIDList = result.Detach ();
TRACE ("-- (%p)->(new ID List: %p)\n", this, *ppEnumIDList);
- return S_OK;
-}
-
-/**************************************************************************
-* ISF_Fonts_fnBindToObject
+ return S_OK;
+}
+
+/**************************************************************************
+* ISF_Fonts_fnBindToObject
*/
HRESULT WINAPI CFontsFolder::BindToObject(LPCITEMIDLIST pidl, LPBC pbcReserved, REFIID
riid, LPVOID *ppvOut)
{
@@ -257,7 +258,7 @@
}
/**************************************************************************
-* ISF_Fonts_fnBindToStorage
+* ISF_Fonts_fnBindToStorage
*/
HRESULT WINAPI CFontsFolder::BindToStorage(LPCITEMIDLIST pidl, LPBC pbcReserved, REFIID
riid, LPVOID *ppvOut)
{
@@ -269,7 +270,7 @@
}
/**************************************************************************
-* ISF_Fonts_fnCompareIDs
+* ISF_Fonts_fnCompareIDs
*/
HRESULT WINAPI CFontsFolder::CompareIDs(LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST
pidl2)
@@ -283,11 +284,11 @@
}
/**************************************************************************
-* ISF_Fonts_fnCreateViewObject
+* ISF_Fonts_fnCreateViewObject
*/
HRESULT WINAPI CFontsFolder::CreateViewObject(HWND hwndOwner, REFIID riid, LPVOID
*ppvOut)
{
- CComPtr<IShellView> pShellView;
+ CComPtr<IShellView> pShellView;
HRESULT hr = E_INVALIDARG;
TRACE ("(%p)->(hwnd=%p,%s,%p)\n", this,
@@ -296,22 +297,22 @@
if (!ppvOut)
return hr;
- *ppvOut = NULL;
-
- if (IsEqualIID (riid, IID_IDropTarget))
- {
- WARN ("IDropTarget not implemented\n");
- hr = E_NOTIMPL;
- }
+ *ppvOut = NULL;
+
+ if (IsEqualIID (riid, IID_IDropTarget))
+ {
+ WARN ("IDropTarget not implemented\n");
+ hr = E_NOTIMPL;
+ }
else if (IsEqualIID (riid, IID_IContextMenu))
{
- WARN ("IContextMenu not implemented\n");
- hr = E_NOTIMPL;
- }
+ WARN ("IContextMenu not implemented\n");
+ hr = E_NOTIMPL;
+ }
else if (IsEqualIID (riid, IID_IShellView))
{
- hr = IShellView_Constructor ((IShellFolder *)this, &pShellView);
- if (pShellView)
+ hr = IShellView_Constructor ((IShellFolder *)this, &pShellView);
+ if (pShellView)
hr = pShellView->QueryInterface(riid, ppvOut);
}
TRACE ("-- (%p)->(interface=%p)\n", this, ppvOut);
@@ -338,7 +339,7 @@
if (cidl == 0)
{
- CComPtr<IShellFolder> psfParent;
+ CComPtr<IShellFolder> psfParent;
LPCITEMIDLIST rpidl = NULL;
hr = SHBindToParent(pidlRoot, IID_IShellFolder, (LPVOID *)&psfParent,
(LPCITEMIDLIST *)&rpidl);
@@ -364,7 +365,7 @@
}
/**************************************************************************
-* ISF_Fonts_fnGetUIObjectOf
+* ISF_Fonts_fnGetUIObjectOf
*
* PARAMETERS
* hwndOwner [in] Parent window for any output
@@ -379,7 +380,7 @@
UINT * prgfInOut, LPVOID * ppvOut)
{
LPITEMIDLIST pidl;
- CComPtr<IUnknown> pObj;
+ CComPtr<IUnknown> pObj;
HRESULT hr = E_INVALIDARG;
TRACE ("(%p)->(%p,%u,apidl=%p,%s,%p,%p)\n", this,
@@ -430,7 +431,7 @@
}
/**************************************************************************
-* ISF_Fonts_fnGetDisplayNameOf
+* ISF_Fonts_fnGetDisplayNameOf
*
*/
HRESULT WINAPI CFontsFolder::GetDisplayNameOf(LPCITEMIDLIST pidl, DWORD dwFlags, LPSTRRET
strRet)
@@ -469,7 +470,7 @@
* dwFlags [in] SHGNO formatting flags
* ppidlOut [out] simple pidl returned
*/
-HRESULT WINAPI CFontsFolder::SetNameOf(HWND hwndOwner, LPCITEMIDLIST pidl, /*simple pidl
*/
+HRESULT WINAPI CFontsFolder::SetNameOf(HWND hwndOwner, LPCITEMIDLIST pidl, /*simple
pidl */
LPCOLESTR lpName, DWORD dwFlags, LPITEMIDLIST * pPidlOut)
{
FIXME ("(%p)->(%p,pidl=%p,%s,%u,%p)\n", this,
@@ -620,7 +621,7 @@
}
/************************************************************************
- * INPFldr_PersistFolder2_GetClassID
+ * INPFldr_PersistFolder2_GetClassID
*/
HRESULT WINAPI CFontsFolder::GetClassID(CLSID *lpClassId)
{
@@ -635,7 +636,7 @@
}
/************************************************************************
- * INPFldr_PersistFolder2_Initialize
+ * INPFldr_PersistFolder2_Initialize
*
* NOTES: it makes no sense to change the pidl
*/
@@ -647,7 +648,7 @@
}
/**************************************************************************
- * IPersistFolder2_fnGetCurFolder
+ * IPersistFolder2_fnGetCurFolder
*/
HRESULT WINAPI CFontsFolder::GetCurFolder (LPITEMIDLIST *pidl)
{
@@ -768,9 +769,9 @@
*/
HRESULT WINAPI CFontsFolder::GetCommandString(UINT_PTR idCommand,UINT uFlags, UINT
*lpReserved, LPSTR lpszName, UINT uMaxNameLen)
{
- TRACE("(%p)->(idcom=%lx flags=%x %p name=%p len=%x)\n",this, idCommand,
uFlags, lpReserved, lpszName, uMaxNameLen);
-
- return E_FAIL;
+ TRACE("(%p)->(idcom=%lx flags=%x %p name=%p len=%x)\n",this, idCommand,
uFlags, lpReserved, lpszName, uMaxNameLen);
+
+ return E_FAIL;
}
/**************************************************************************
Modified: branches/shell32_new-bringup/dll/win32/shell32/shfldr_mydocuments.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/shell32_new-bringup/dll/win32/s…
==============================================================================
--- 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] Wed
Sep 7 20:00:32 2011
@@ -34,16 +34,16 @@
*/
class CFileSysEnumX :
- public IEnumIDListImpl
+ public IEnumIDListImpl
{
private:
public:
- CFileSysEnumX();
- ~CFileSysEnumX();
- HRESULT WINAPI Initialize(DWORD dwFlags);
+ CFileSysEnumX();
+ ~CFileSysEnumX();
+ HRESULT WINAPI Initialize(DWORD dwFlags);
BEGIN_COM_MAP(CFileSysEnumX)
- COM_INTERFACE_ENTRY_IID(IID_IEnumIDList, IEnumIDList)
+ COM_INTERFACE_ENTRY_IID(IID_IEnumIDList, IEnumIDList)
END_COM_MAP()
};
@@ -67,16 +67,17 @@
HRESULT WINAPI CFileSysEnumX::Initialize(DWORD dwFlags)
{
- WCHAR szPath[MAX_PATH];
+ WCHAR szPath[MAX_PATH];
if (SHGetSpecialFolderPathW(0, szPath, CSIDL_PERSONAL, FALSE) == FALSE)
- return E_FAIL;
- return CreateFolderEnumList(szPath, dwFlags);
+ return E_FAIL;
+ return CreateFolderEnumList(szPath, dwFlags);
}
CMyDocsFolder::CMyDocsFolder()
{
pidlRoot = NULL;
+ sPathTarget = NULL;
}
CMyDocsFolder::~CMyDocsFolder()
@@ -88,16 +89,16 @@
HRESULT WINAPI CMyDocsFolder::FinalConstruct()
{
- WCHAR szMyPath[MAX_PATH];
-
- if (!SHGetSpecialFolderPathW(0, szMyPath, CSIDL_PERSONAL, TRUE))
- return E_UNEXPECTED;
-
- pidlRoot = _ILCreateMyDocuments(); /* my qualified pidl */
- sPathTarget = (LPWSTR)SHAlloc((wcslen(szMyPath) + 1) * sizeof(WCHAR));
- wcscpy(sPathTarget, szMyPath);
-
- return S_OK;
+ WCHAR szMyPath[MAX_PATH];
+
+ if (!SHGetSpecialFolderPathW(0, szMyPath, CSIDL_PERSONAL, TRUE))
+ return E_UNEXPECTED;
+
+ pidlRoot = _ILCreateMyDocuments(); /* my qualified pidl */
+ sPathTarget = (LPWSTR)SHAlloc((wcslen(szMyPath) + 1) * sizeof(WCHAR));
+ wcscpy(sPathTarget, szMyPath);
+
+ return S_OK;
}
HRESULT WINAPI CMyDocsFolder::ParseDisplayName (HWND hwndOwner, LPBC pbc, LPOLESTR
lpszDisplayName,
@@ -189,32 +190,32 @@
*/
HRESULT WINAPI CMyDocsFolder::EnumObjects(HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST
*ppEnumIDList)
{
- CComObject<CFileSysEnumX> *theEnumerator;
- CComPtr<IEnumIDList> result;
- HRESULT hResult;
-
- TRACE ("(%p)->(HWND=%p flags=0x%08x pplist=%p)\n", this, hwndOwner,
dwFlags, ppEnumIDList);
-
- if (ppEnumIDList == NULL)
- return E_POINTER;
- *ppEnumIDList = NULL;
- ATLTRY (theEnumerator = new CComObject<CFileSysEnumX>);
- if (theEnumerator == NULL)
- return E_OUTOFMEMORY;
- hResult = theEnumerator->QueryInterface (IID_IEnumIDList, (void **)&result);
- if (FAILED (hResult))
- {
- delete theEnumerator;
- return hResult;
- }
- hResult = theEnumerator->Initialize (dwFlags);
- if (FAILED (hResult))
- return hResult;
- *ppEnumIDList = result.Detach ();
+ CComObject<CFileSysEnumX> *theEnumerator;
+ CComPtr<IEnumIDList> result;
+ HRESULT hResult;
+
+ TRACE ("(%p)->(HWND=%p flags=0x%08x pplist=%p)\n", this, hwndOwner,
dwFlags, ppEnumIDList);
+
+ if (ppEnumIDList == NULL)
+ return E_POINTER;
+ *ppEnumIDList = NULL;
+ ATLTRY (theEnumerator = new CComObject<CFileSysEnumX>);
+ if (theEnumerator == NULL)
+ return E_OUTOFMEMORY;
+ hResult = theEnumerator->QueryInterface (IID_IEnumIDList, (void **)&result);
+ if (FAILED (hResult))
+ {
+ delete theEnumerator;
+ return hResult;
+ }
+ hResult = theEnumerator->Initialize (dwFlags);
+ if (FAILED (hResult))
+ return hResult;
+ *ppEnumIDList = result.Detach ();
TRACE ("-- (%p)->(new ID List: %p)\n", this, *ppEnumIDList);
- return S_OK;
+ return S_OK;
}
/**************************************************************************