Author: janderwald
Date: Sun Nov 25 20:46:11 2007
New Revision: 30747
URL:
http://svn.reactos.org/svn/reactos?rev=30747&view=rev
Log:
- retrieve folder names for personal and bit bucket folder
- fix a few bugs in mydocuments shell folder code
- add a hack to get the path working
Modified:
trunk/reactos/dll/win32/shell32/classes.c
trunk/reactos/dll/win32/shell32/recyclebin.c
trunk/reactos/dll/win32/shell32/shlfldr_mydocuments.c
Modified: trunk/reactos/dll/win32/shell32/classes.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/classes.…
==============================================================================
--- trunk/reactos/dll/win32/shell32/classes.c (original)
+++ trunk/reactos/dll/win32/shell32/classes.c Sun Nov 25 20:46:11 2007
@@ -365,6 +365,16 @@
if(LoadStringW(shell32_hInstance, IDS_MYCOMPUTER, szDest, buflen))
ret = TRUE;
}
+ else if (IsEqualIID(riid, &CLSID_MyDocuments))
+ {
+ if(LoadStringW(shell32_hInstance, IDS_PERSONAL, szDest, buflen))
+ ret = TRUE;
+ }
+ else if (IsEqualIID(riid, &CLSID_RecycleBin))
+ {
+ if(LoadStringW(shell32_hInstance, IDS_RECYCLEBIN_FOLDER_NAME, szDest, buflen))
+ ret = TRUE;
+ }
}
TRACE("-- %s\n", debugstr_w(szDest));
return ret;
Modified: trunk/reactos/dll/win32/shell32/recyclebin.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/recycleb…
==============================================================================
--- trunk/reactos/dll/win32/shell32/recyclebin.c (original)
+++ trunk/reactos/dll/win32/shell32/recyclebin.c Sun Nov 25 20:46:11 2007
@@ -388,6 +388,17 @@
PDELETED_FILE_DETAILS_W pFileDetails;
TRACE("(%p, %p, %x, %p)\n", This, pidl, (unsigned int)uFlags, pName);
+
+ if (_ILIsBitBucket (pidl))
+ {
+ WCHAR pszPath[100];
+
+ HCR_GetClassNameW(&CLSID_RecycleBin, pszPath, MAX_PATH);
+ pName->uType = STRRET_WSTR;
+ pName->u.pOleStr = StrDupW(pszPath);
+ return S_OK;
+ }
+
pFileDetails = UnpackDetailsFromPidl(pidl);
pName->uType = STRRET_WSTR;
pName->u.pOleStr = StrDupW(&pFileDetails->FileName[0]);
Modified: trunk/reactos/dll/win32/shell32/shlfldr_mydocuments.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shlfldr_…
==============================================================================
--- trunk/reactos/dll/win32/shell32/shlfldr_mydocuments.c (original)
+++ trunk/reactos/dll/win32/shell32/shlfldr_mydocuments.c Sun Nov 25 20:46:11 2007
@@ -207,7 +207,7 @@
}
}
else
- pidlTemp = _ILCreateMyComputer();
+ pidlTemp = _ILCreateMyDocuments();
szNext = NULL;
}
@@ -367,12 +367,9 @@
{
IGenericSFImpl *This = (IGenericSFImpl *)iface;
HRESULT hr = S_OK;
- static const DWORD dwDesktopAttributes =
+ static const DWORD dwMyDocumentsAttributes =
SFGAO_STORAGE | SFGAO_HASPROPSHEET | SFGAO_STORAGEANCESTOR |
SFGAO_FILESYSANCESTOR | SFGAO_FOLDER | SFGAO_FILESYSTEM | SFGAO_HASSUBFOLDER;
- static const DWORD dwMyComputerAttributes =
- SFGAO_CANRENAME | SFGAO_CANDELETE | SFGAO_HASPROPSHEET |
- SFGAO_DROPTARGET | SFGAO_FILESYSANCESTOR | SFGAO_FOLDER | SFGAO_HASSUBFOLDER;
TRACE ("(%p)->(cidl=%d apidl=%p mask=%p (0x%08x))\n",
This, cidl, apidl, rgfInOut, rgfInOut ? *rgfInOut : 0);
@@ -386,14 +383,12 @@
*rgfInOut = ~0;
if(cidl == 0) {
- *rgfInOut &= dwDesktopAttributes;
+ *rgfInOut &= dwMyDocumentsAttributes;
} else {
while (cidl > 0 && *apidl) {
pdump (*apidl);
- if (_ILIsDesktop(*apidl)) {
- *rgfInOut &= dwDesktopAttributes;
- } else if (_ILIsMyComputer(*apidl)) {
- *rgfInOut &= dwMyComputerAttributes;
+ if (_ILIsMyDocuments(*apidl)) {
+ *rgfInOut &= dwMyDocumentsAttributes;
} else {
SHELL32_GetItemAttributes (_IShellFolder_ (This), *apidl, rgfInOut);
}
@@ -509,13 +504,13 @@
if (!pszPath)
return E_OUTOFMEMORY;
- if (_ILIsMyDocuments (pidl))
+ if (_ILIsMyDocuments (pidl) || _ILIsDesktop(pidl))
{
if ((GET_SHGDN_RELATION (dwFlags) == SHGDN_NORMAL) &&
(GET_SHGDN_FOR (dwFlags) & SHGDN_FORPARSING))
strcpyW(pszPath, This->sPathTarget);
else
- HCR_GetClassNameW(&CLSID_ShellDesktop, pszPath, MAX_PATH);
+ HCR_GetClassNameW(&CLSID_MyDocuments, pszPath, MAX_PATH);
}
else if (_ILIsPidlSimple (pidl))
{
@@ -534,7 +529,7 @@
* Exception: The MyComputer folder doesn't have this key,
* but any other filesystem backed folder it needs it.
*/
- if (IsEqualIID (clsid, &CLSID_MyComputer))
+ if (IsEqualIID (clsid, &CLSID_MyDocuments))
{
bWantsForParsing = TRUE;
}
@@ -903,7 +898,7 @@
{
IGenericSFImpl *sf;
- if (!SHGetSpecialFolderPathW( 0, szMyPath, CSIDL_DESKTOPDIRECTORY, TRUE ))
+ if (!SHGetSpecialFolderPathW( 0, szMyPath, CSIDL_PERSONAL, TRUE ))
return E_UNEXPECTED;
sf = LocalAlloc( LMEM_ZEROINIT, sizeof (IGenericSFImpl) );