Author: akhaldi
Date: Fri Nov 7 11:30:38 2014
New Revision: 65306
URL:
http://svn.reactos.org/svn/reactos?rev=65306&view=rev
Log:
[SHELL32]
* Another partial sync of pidl.c with Wine 1.7.27.
* Move some functions where they are used, and remove some unused ones.
* Mark some of our changes with history revisions.
CORE-8540
Modified:
branches/shell-experiments/dll/win32/shell32/folders/CDrivesFolder.cpp
branches/shell-experiments/dll/win32/shell32/folders/CFontsFolder.cpp
branches/shell-experiments/dll/win32/shell32/folders/CNetFolder.cpp
branches/shell-experiments/dll/win32/shell32/wine/pidl.c
branches/shell-experiments/dll/win32/shell32/wine/pidl.h
Modified: branches/shell-experiments/dll/win32/shell32/folders/CDrivesFolder.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
==============================================================================
--- branches/shell-experiments/dll/win32/shell32/folders/CDrivesFolder.cpp [iso-8859-1]
(original)
+++ branches/shell-experiments/dll/win32/shell32/folders/CDrivesFolder.cpp [iso-8859-1]
Fri Nov 7 11:30:38 2014
@@ -328,6 +328,17 @@
}
TRACE ("-- (%p)->(interface=%p)\n", this, ppvOut);
return hr;
+}
+
+static BOOL _ILIsControlPanel(LPCITEMIDLIST pidl)
+{
+ IID *iid = _ILGetGUIDPointer(pidl);
+
+ TRACE("(%p)\n", pidl);
+
+ if (iid)
+ return IsEqualIID(iid, CLSID_ControlPanel);
+ return FALSE;
}
/**************************************************************************
Modified: branches/shell-experiments/dll/win32/shell32/folders/CFontsFolder.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
==============================================================================
--- branches/shell-experiments/dll/win32/shell32/folders/CFontsFolder.cpp [iso-8859-1]
(original)
+++ branches/shell-experiments/dll/win32/shell32/folders/CFontsFolder.cpp [iso-8859-1] Fri
Nov 7 11:30:38 2014
@@ -49,6 +49,11 @@
SHFree(pidlRoot);
}
+static LPITEMIDLIST _ILCreateFont(void)
+{
+ return _ILCreateGuid(PT_GUID, CLSID_FontsFolderShortcut);
+}
+
HRESULT WINAPI CFontsFolder::FinalConstruct()
{
HRESULT hr;
@@ -72,7 +77,6 @@
return hr;
}
-
HRESULT WINAPI CFontsFolder::ParseDisplayName(HWND hwndOwner, LPBC pbc, LPOLESTR
lpszDisplayName,
ULONG *pchEaten, PIDLIST_RELATIVE *ppidl, ULONG *pdwAttributes)
Modified: branches/shell-experiments/dll/win32/shell32/folders/CNetFolder.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
==============================================================================
--- branches/shell-experiments/dll/win32/shell32/folders/CNetFolder.cpp [iso-8859-1]
(original)
+++ branches/shell-experiments/dll/win32/shell32/folders/CNetFolder.cpp [iso-8859-1] Fri
Nov 7 11:30:38 2014
@@ -56,7 +56,7 @@
HRESULT WINAPI CNetFolder::FinalConstruct()
{
- pidlRoot = _ILCreateNetHood(); /* my qualified pidl */
+ pidlRoot = _ILCreateGuid(PT_GUID, CLSID_NetworkPlaces); /* my qualified pidl */
if (pidlRoot == NULL)
return E_OUTOFMEMORY;
return S_OK;
Modified: branches/shell-experiments/dll/win32/shell32/wine/pidl.c
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
==============================================================================
--- branches/shell-experiments/dll/win32/shell32/wine/pidl.c [iso-8859-1] (original)
+++ branches/shell-experiments/dll/win32/shell32/wine/pidl.c [iso-8859-1] Fri Nov 7
11:30:38 2014
@@ -107,47 +107,44 @@
return FALSE;
}
- if (type <= 2)
- {
- switch (type)
+ switch (type)
+ {
+ case ILGDN_FORPARSING:
+ flag = SHGDN_FORPARSING | SHGDN_FORADDRESSBAR;
+ break;
+ case ILGDN_NORMAL:
+ flag = SHGDN_NORMAL;
+ break;
+ case ILGDN_INFOLDER:
+ flag = SHGDN_INFOLDER;
+ break;
+ default:
+ FIXME("Unknown type parameter = %x\n", type);
+ flag = SHGDN_FORPARSING | SHGDN_FORADDRESSBAR;
+ break;
+ }
+
+ if (!*(const WORD*)pidl || type == ILGDN_FORPARSING)
+ {
+ ret = IShellFolder_GetDisplayNameOf(lsf, pidl, flag, &strret);
+ if (SUCCEEDED(ret))
{
- case ILGDN_FORPARSING:
- flag = SHGDN_FORPARSING | SHGDN_FORADDRESSBAR;
- break;
- case ILGDN_NORMAL:
- flag = SHGDN_NORMAL;
- break;
- case ILGDN_INFOLDER:
- flag = SHGDN_INFOLDER;
- break;
- default:
- FIXME("Unknown type parameter = %x\n", type);
- flag = SHGDN_FORPARSING | SHGDN_FORADDRESSBAR;
- break;
+ if(!StrRetToStrNW(path, MAX_PATH, &strret, pidl))
+ ret = E_FAIL;
}
-
- if (!*(const WORD*)pidl || type == ILGDN_FORPARSING)
+ }
+ else
+ {
+ ret = SHBindToParent(pidl, &IID_IShellFolder, (LPVOID*)&psfParent,
&pidllast);
+ if (SUCCEEDED(ret))
{
- ret = IShellFolder_GetDisplayNameOf(lsf, pidl, flag, &strret);
+ ret = IShellFolder_GetDisplayNameOf(psfParent, pidllast, flag, &strret);
if (SUCCEEDED(ret))
{
- if(!StrRetToStrNW(path, MAX_PATH, &strret, pidl))
+ if(!StrRetToStrNW(path, MAX_PATH, &strret, pidllast))
ret = E_FAIL;
}
- }
- else
- {
- ret = SHBindToParent(pidl, &IID_IShellFolder, (LPVOID*)&psfParent,
&pidllast);
- if (SUCCEEDED(ret))
- {
- ret = IShellFolder_GetDisplayNameOf(psfParent, pidllast, flag,
&strret);
- if (SUCCEEDED(ret))
- {
- if(!StrRetToStrNW(path, MAX_PATH, &strret, pidllast))
- ret = E_FAIL;
- }
- IShellFolder_Release(psfParent);
- }
+ IShellFolder_Release(psfParent);
}
}
@@ -1849,17 +1846,6 @@
return FALSE;
}
-BOOL _ILIsControlPanel(LPCITEMIDLIST pidl)
-{
- IID *iid = _ILGetGUIDPointer(pidl);
-
- TRACE("(%p)\n", pidl);
-
- if (iid)
- return IsEqualIID(iid, &CLSID_ControlPanel);
- return FALSE;
-}
-
BOOL _ILIsNetHood(LPCITEMIDLIST pidl)
{
IID *iid = _ILGetGUIDPointer(pidl);
@@ -1871,17 +1857,6 @@
return FALSE;
}
-
-LPITEMIDLIST _ILCreateNetHood(void)
-{
- return _ILCreateGuid(PT_GUID, &CLSID_NetworkPlaces);
-}
-
-LPITEMIDLIST _ILCreateFont(void)
-{
- return _ILCreateGuid(PT_GUID, &CLSID_FontsFolderShortcut);
-}
-
BOOL _ILIsMyComputer(LPCITEMIDLIST pidl)
{
REFIID iid = _ILGetGUIDPointer(pidl);
@@ -1893,17 +1868,6 @@
return FALSE;
}
-BOOL _ILIsPrinter(LPCITEMIDLIST pidl)
-{
- IID *iid = _ILGetGUIDPointer(pidl);
-
- TRACE("(%p)\n", pidl);
-
- if (iid)
- return IsEqualIID(iid, &CLSID_Printers);
- return FALSE;
-}
-
BOOL _ILIsBitBucket(LPCITEMIDLIST pidl)
{
IID *iid = _ILGetGUIDPointer(pidl);
@@ -1913,18 +1877,6 @@
if (iid)
return IsEqualIID(iid, &CLSID_RecycleBin);
return FALSE;
-}
-
-BOOL _ILIsAdminTools(LPCITEMIDLIST pidl)
-{
- IID *iid = _ILGetGUIDPointer(pidl);
-
- TRACE("(%p)\n", pidl);
-
- if (iid)
- return IsEqualIID(iid, &CLSID_AdminFolderShortcut);
- else
- return FALSE;
}
BOOL _ILIsSpecialFolder (LPCITEMIDLIST pidl)
@@ -2258,8 +2210,10 @@
case PT_SHARE:
return pdata->u.network.szNames;
+#ifdef __REACTOS__ /* r54423 */
case PT_CPLAPPLET:
return pdata->u.cpanel.szName;
+#endif
}
return NULL;
}
@@ -2506,7 +2460,9 @@
*/
void _ILGetFileType(LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize)
{
+#ifdef __REACTOS__ /* r32966 */
char sType[64];
+#endif
if(_ILIsValue(pidl))
{
@@ -2514,6 +2470,7 @@
if(uOutSize > 0)
pOut[0] = 0;
+#ifdef __REACTOS__ /* r32966 */
if (_ILGetExtension (pidl, sType, 64))
{
if (HCR_MapTypeToValueA(sType, sTemp, 64, TRUE))
@@ -2534,14 +2491,29 @@
strcat(pOut, sTemp);
}
}
+#else
+ if (_ILGetExtension (pidl, sTemp, 64))
+ {
+ if (!( HCR_MapTypeToValueA(sTemp, sTemp, 64, TRUE)
+ && HCR_MapTypeToValueA(sTemp, pOut, uOutSize, FALSE )))
+ {
+ lstrcpynA (pOut, sTemp, uOutSize - 6);
+ strcat (pOut, "-file");
+ }
+ }
+#endif
}
else
+#ifdef __REACTOS__ /* r32966 */
{
pOut[0] = '\0';
LoadStringA(shell32_hInstance, IDS_DIRECTORY, pOut, uOutSize);
/* make sure its null terminated */
pOut[uOutSize-1] = '\0';
}
+#else
+ lstrcpynA(pOut, "Folder", uOutSize);
+#endif
}
/*************************************************************************
Modified: branches/shell-experiments/dll/win32/shell32/wine/pidl.h
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
==============================================================================
--- branches/shell-experiments/dll/win32/shell32/wine/pidl.h [iso-8859-1] (original)
+++ branches/shell-experiments/dll/win32/shell32/wine/pidl.h [iso-8859-1] Fri Nov 7
11:30:38 2014
@@ -236,11 +236,8 @@
BOOL _ILIsDesktop (LPCITEMIDLIST pidl) DECLSPEC_HIDDEN;
BOOL _ILIsMyComputer (LPCITEMIDLIST pidl) DECLSPEC_HIDDEN;
#ifdef __REACTOS__
-BOOL _ILIsPrinter (LPCITEMIDLIST pidl);
BOOL _ILIsMyDocuments (LPCITEMIDLIST pidl);
-BOOL _ILIsControlPanel (LPCITEMIDLIST pidl);
BOOL _ILIsBitBucket (LPCITEMIDLIST pidl);
-BOOL _ILIsAdminTools (LPCITEMIDLIST pidl);
BOOL _ILIsNetHood (LPCITEMIDLIST pidl);
#endif
BOOL _ILIsDrive (LPCITEMIDLIST pidl) DECLSPEC_HIDDEN;
@@ -286,7 +283,6 @@
LPITEMIDLIST _ILCreateNetHood (void) DECLSPEC_HIDDEN;
#ifdef __REACTOS__
LPITEMIDLIST _ILCreateAdminTools (void);
-LPITEMIDLIST _ILCreateFont (void);
#endif
LPITEMIDLIST _ILCreateBitBucket (void) DECLSPEC_HIDDEN;
LPITEMIDLIST _ILCreateDrive (LPCWSTR) DECLSPEC_HIDDEN;