Author: akhaldi
Date: Tue May 3 19:00:54 2016
New Revision: 71247
URL:
http://svn.reactos.org/svn/reactos?rev=71247&view=rev
Log:
[0.4.1] Merge the shell fixes by Giannis in r71217 as they addressed "My network
places" missing icon. CORE-10943
Modified:
branches/ros-branch-0_4_1/ (props changed)
branches/ros-branch-0_4_1/reactos/ (props changed)
branches/ros-branch-0_4_1/reactos/dll/win32/shell32/folders/CNetFolder.cpp
branches/ros-branch-0_4_1/reactos/dll/win32/shell32/folders/CPrinterFolder.cpp
branches/ros-branch-0_4_1/reactos/dll/win32/shell32/folders/CRecycleBin.cpp
branches/ros-branch-0_4_1/rosapps/applications/cmdutils/cat/ (props changed)
branches/ros-branch-0_4_1/rosapps/applications/imagesoft/lang/no-NO.rc (props
changed)
branches/ros-branch-0_4_1/rosapps/applications/net/roshttpd/ (props changed)
branches/ros-branch-0_4_1/rosapps/applications/sysutils/gettype/ (props changed)
branches/ros-branch-0_4_1/rosapps/applications/sysutils/logevent/ (props changed)
branches/ros-branch-0_4_1/rosapps/applications/sysutils/screenshot/ (props changed)
branches/ros-branch-0_4_1/rosapps/templates/old_wordpad/lang/no-NO.rc (props
changed)
Propchange: branches/ros-branch-0_4_1/
------------------------------------------------------------------------------
svn:mergeinfo = /trunk:71217
Propchange: branches/ros-branch-0_4_1/reactos/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue May 3 19:00:54 2016
@@ -20,4 +20,4 @@
/branches/usb-bringup:51335,51337,51341-51343,51348,51350,51353,51355,51365-51369,51372,51384-54388,54396-54398,54736-54737,54752-54754,54756-54760,54762,54764-54765,54767-54768,54772,54774-54777,54781,54787,54790-54792,54797-54798,54806,54808,54834-54838,54843,54850,54852,54856,54858-54859
/branches/usb-bringup-trunk:55019-55543,55548-55554,55556-55567
/branches/wlan-bringup:54809-54998
-/trunk/reactos:71232
+/trunk/reactos:71217,71232
Modified: branches/ros-branch-0_4_1/reactos/dll/win32/shell32/folders/CNetFolder.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/ros-branch-0_4_1/reactos/dll/wi…
==============================================================================
---
branches/ros-branch-0_4_1/reactos/dll/win32/shell32/folders/CNetFolder.cpp [iso-8859-1]
(original)
+++
branches/ros-branch-0_4_1/reactos/dll/win32/shell32/folders/CNetFolder.cpp [iso-8859-1]
Tue May 3 19:00:54 2016
@@ -47,6 +47,18 @@
* IShellFolder implementation
*/
+HRESULT CNetFolderExtractIcon_CreateInstance(LPCITEMIDLIST pidl, REFIID riid, LPVOID *
ppvOut)
+{
+ CComPtr<IDefaultExtractIconInit> initIcon;
+ HRESULT hr = SHCreateDefaultExtractIcon(IID_PPV_ARG(IDefaultExtractIconInit,
&initIcon));
+ if (FAILED(hr))
+ return NULL;
+
+ initIcon->SetNormalIcon(swShell32Name, -IDI_SHELL_NETWORK_FOLDER);
+
+ return initIcon->QueryInterface(riid, ppvOut);
+}
+
class CNetFolderEnum :
public CEnumIDListBase
{
@@ -403,8 +415,7 @@
HRESULT WINAPI CNetFolder::GetUIObjectOf(HWND hwndOwner, UINT cidl, PCUITEMID_CHILD_ARRAY
apidl, REFIID riid,
UINT * prgfInOut, LPVOID * ppvOut)
{
- LPITEMIDLIST pidl;
- IUnknown *pObj = NULL;
+ LPVOID pObj = NULL;
HRESULT hr = E_INVALIDARG;
TRACE("(%p)->(%p,%u,apidl=%p,%s,%p,%p)\n", this,
@@ -427,19 +438,9 @@
hr = IDataObject_Constructor (hwndOwner, pidlRoot, apidl, cidl, &pDo);
pObj = pDo;
}
- else if (IsEqualIID(riid, IID_IExtractIconA) && (cidl == 1))
- {
- pidl = ILCombine (pidlRoot, apidl[0]);
- pObj = IExtractIconA_Constructor (pidl);
- SHFree (pidl);
- hr = S_OK;
- }
- else if (IsEqualIID(riid, IID_IExtractIconW) && (cidl == 1))
- {
- pidl = ILCombine (pidlRoot, apidl[0]);
- pObj = IExtractIconW_Constructor (pidl);
- SHFree (pidl);
- hr = S_OK;
+ else if ((IsEqualIID(riid, IID_IExtractIconA) || IsEqualIID(riid, IID_IExtractIconW))
&& (cidl == 1))
+ {
+ hr = CNetFolderExtractIcon_CreateInstance(apidl[0], riid, &pObj);
}
else if (IsEqualIID(riid, IID_IDropTarget) && (cidl >= 1))
{
Modified: branches/ros-branch-0_4_1/reactos/dll/win32/shell32/folders/CPrinterFolder.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/ros-branch-0_4_1/reactos/dll/wi…
==============================================================================
---
branches/ros-branch-0_4_1/reactos/dll/win32/shell32/folders/CPrinterFolder.cpp [iso-8859-1]
(original)
+++
branches/ros-branch-0_4_1/reactos/dll/win32/shell32/folders/CPrinterFolder.cpp [iso-8859-1]
Tue May 3 19:00:54 2016
@@ -26,35 +26,6 @@
#include <winspool.h>
WINE_DEFAULT_DEBUG_CHANNEL (shell);
-
-/***********************************************************************
- * Printers_IExtractIconW implementation
- */
-class CPrintersExtractIconW :
- public CComObjectRootEx<CComMultiThreadModelNoCS>,
- public IExtractIconW,
- public IExtractIconA
-{
- private:
- LPITEMIDLIST pidl;
- public:
- CPrintersExtractIconW();
- ~CPrintersExtractIconW();
- HRESULT WINAPI Initialize(LPCITEMIDLIST pidl);
-
- // IExtractIconW
- virtual HRESULT STDMETHODCALLTYPE GetIconLocation(UINT uFlags, LPWSTR szIconFile,
UINT cchMax, int *piIndex, UINT *pwFlags);
- virtual HRESULT STDMETHODCALLTYPE Extract(LPCWSTR pszFile, UINT nIconIndex, HICON
*phiconLarge, HICON *phiconSmall, UINT nIconSize);
-
- // IExtractIconA
- virtual HRESULT STDMETHODCALLTYPE GetIconLocation(UINT uFlags, LPSTR szIconFile,
UINT cchMax, int *piIndex, UINT *pwFlags);
- virtual HRESULT STDMETHODCALLTYPE Extract(LPCSTR pszFile, UINT nIconIndex, HICON
*phiconLarge, HICON *phiconSmall, UINT nIconSize);
-
- BEGIN_COM_MAP(CPrintersExtractIconW)
- COM_INTERFACE_ENTRY_IID(IID_IExtractIconW, IExtractIconW)
- COM_INTERFACE_ENTRY_IID(IID_IExtractIconA, IExtractIconA)
- END_COM_MAP()
-};
static shvheader PrinterSFHeader[] = {
{IDS_SHV_COLUMN8, SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT, LVCFMT_LEFT, 15},
@@ -72,123 +43,24 @@
#define COLUMN_LOCATION 4
#define COLUMN_MODEL 5
-
#define PrinterSHELLVIEWCOLUMNS (6)
-CPrintersExtractIconW::CPrintersExtractIconW()
-{
- pidl = NULL;
-}
-
-CPrintersExtractIconW::~CPrintersExtractIconW()
-{
- TRACE(" destroying IExtractIcon(%p)\n", this);
- SHFree(pidl);
-}
-
-HRESULT WINAPI CPrintersExtractIconW::Initialize(LPCITEMIDLIST pidl)
-{
- pidl = ILClone(pidl);
-
- pdump(pidl);
- return S_OK;
-}
-
-/**************************************************************************
- * CPrintersExtractIconW::GetIconLocation
- *
- * mapping filetype to icon
- */
-HRESULT WINAPI CPrintersExtractIconW::GetIconLocation(UINT uFlags, /* GIL_ flags
*/
- LPWSTR szIconFile,
- UINT cchMax,
- int *piIndex,
- UINT *pwFlags) /* returned GIL_ flags */
-{
- TRACE("(%p) (flags=%u %p %u %p %p)\n", this, uFlags, szIconFile, cchMax,
piIndex, pwFlags);
-
- if (pwFlags)
- *pwFlags = 0;
-
- lstrcpynW(szIconFile, swShell32Name, cchMax);
- *piIndex = -IDI_SHELL_PRINTERS_FOLDER; /* FIXME: other icons for default, network,
print to file */
-
- TRACE("-- %s %x\n", debugstr_w(szIconFile), *piIndex);
- return S_OK;
-}
-
-/**************************************************************************
- * CPrintersExtractIconW::Extract
- */
-HRESULT WINAPI CPrintersExtractIconW::Extract(LPCWSTR pszFile,
- UINT nIconIndex, HICON *phiconLarge,
- HICON *phiconSmall, UINT nIconSize)
-{
- int index;
- HIMAGELIST big_icons, small_icons;
-
- FIXME("(%p) (file=%p index=%d %p %p size=%x) semi-stub\n", this,
debugstr_w(pszFile),
- (signed)nIconIndex, phiconLarge, phiconSmall, nIconSize);
-
- index = SIC_GetIconIndex(pszFile, nIconIndex, 0);
-
- Shell_GetImageLists(&big_icons, &small_icons);
-
- if (phiconLarge)
- *phiconLarge = ImageList_GetIcon(big_icons, index, ILD_TRANSPARENT);
-
- if (phiconSmall)
- *phiconSmall = ImageList_GetIcon(small_icons, index, ILD_TRANSPARENT);
-
- return S_OK;
-}
-
-/**************************************************************************
- * CPrintersExtractIconW::GetIconLocation
- */
-HRESULT WINAPI CPrintersExtractIconW::GetIconLocation(UINT uFlags,
- LPSTR szIconFile,
- UINT cchMax,
- int * piIndex,
- UINT * pwFlags)
-{
- HRESULT ret;
- LPWSTR lpwstrFile = (LPWSTR)HeapAlloc(GetProcessHeap(), 0, cchMax * sizeof(WCHAR));
-
- TRACE("(%p) (flags=%u %p %u %p %p)\n", this, uFlags, szIconFile, cchMax,
piIndex, pwFlags);
-
- ret = GetIconLocation(uFlags, lpwstrFile, cchMax, piIndex, pwFlags);
- WideCharToMultiByte(CP_ACP, 0, lpwstrFile, -1, szIconFile, cchMax, NULL, NULL);
- HeapFree(GetProcessHeap(), 0, lpwstrFile);
-
- TRACE("-- %s %x\n", szIconFile, *piIndex);
- return ret;
-}
-/**************************************************************************
- * CPrintersExtractIconW::Extract
- */
-HRESULT WINAPI CPrintersExtractIconW::Extract(LPCSTR pszFile,
- UINT nIconIndex, HICON *phiconLarge,
- HICON *phiconSmall, UINT nIconSize)
-{
- HRESULT ret;
- INT len = MultiByteToWideChar(CP_ACP, 0, pszFile, -1, NULL, 0);
- LPWSTR lpwstrFile = (LPWSTR)HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
-
- TRACE("(%p) (file=%p index=%u %p %p size=%u)\n", this, pszFile, nIconIndex,
phiconLarge, phiconSmall, nIconSize);
-
- MultiByteToWideChar(CP_ACP, 0, pszFile, -1, lpwstrFile, len);
- ret = Extract(lpwstrFile, nIconIndex, phiconLarge, phiconSmall, nIconSize);
- HeapFree(GetProcessHeap(), 0, lpwstrFile);
- return ret;
-}
-
-/**************************************************************************
- * IExtractIcon_Constructor
- */
-static HRESULT WINAPI IEI_Printers_Constructor(LPCITEMIDLIST pidl, REFIID riid, IUnknown
**ppv)
-{
- return ShellObjectCreatorInit<CPrintersExtractIconW>(pidl, riid, ppv);
+/**************************************************************************
+ * CPrintersExtractIconW_CreateInstane
+ *
+ * There is no CPrintersExtractIconW. We just initialize CExtractIcon properly to do our
job.
+ */
+HRESULT WINAPI CPrintersExtractIconW_CreateInstane(LPCITEMIDLIST pidl, REFIID riid,
LPVOID *ppv)
+{
+ CComPtr<IDefaultExtractIconInit> initIcon;
+ HRESULT hr =
SHCreateDefaultExtractIcon(IID_PPV_ARG(IDefaultExtractIconInit,&initIcon));
+ if (FAILED(hr))
+ return NULL;
+
+ /* FIXME: other icons for default, network, print to file */
+ initIcon->SetNormalIcon(swShell32Name, -IDI_SHELL_PRINTERS_FOLDER);
+
+ return initIcon->QueryInterface(riid,ppv);
}
/***********************************************************************
@@ -462,7 +334,7 @@
HRESULT WINAPI CPrinterFolder::GetUIObjectOf(HWND hwndOwner, UINT cidl,
PCUITEMID_CHILD_ARRAY apidl,
REFIID riid, UINT * prgfInOut, LPVOID * ppvOut)
{
- IUnknown *pObj = NULL;
+ LPVOID pObj = NULL;
HRESULT hr = E_INVALIDARG;
TRACE ("(%p)->(%p,%u,apidl=%p,%s,%p,%p)\n",
@@ -474,7 +346,7 @@
*ppvOut = NULL;
if ((IsEqualIID (riid, IID_IExtractIconA) || IsEqualIID(riid, IID_IExtractIconW))
&& cidl == 1)
- hr = IEI_Printers_Constructor(apidl[0], riid, &pObj);
+ hr = CPrintersExtractIconW_CreateInstane(apidl[0], riid, &pObj);
else
hr = E_NOINTERFACE;
Modified: branches/ros-branch-0_4_1/reactos/dll/win32/shell32/folders/CRecycleBin.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/ros-branch-0_4_1/reactos/dll/wi…
==============================================================================
---
branches/ros-branch-0_4_1/reactos/dll/win32/shell32/folders/CRecycleBin.cpp [iso-8859-1]
(original)
+++
branches/ros-branch-0_4_1/reactos/dll/win32/shell32/folders/CRecycleBin.cpp [iso-8859-1]
Tue May 3 19:00:54 2016
@@ -62,6 +62,19 @@
/*
* Recycle Bin folder
*/
+
+HRESULT CRecyclerExtractIcon_CreateInstance(LPCITEMIDLIST pidl, REFIID riid, LPVOID *
ppvOut)
+{
+ CComPtr<IDefaultExtractIconInit> initIcon;
+ HRESULT hr = SHCreateDefaultExtractIcon(IID_PPV_ARG(IDefaultExtractIconInit,
&initIcon));
+ if (FAILED(hr))
+ return NULL;
+
+ /* FIXME: This is completely unimplemented */
+ initIcon->SetNormalIcon(swShell32Name, 0);
+
+ return initIcon->QueryInterface(riid, ppvOut);
+}
class CRecycleBinEnum :
public CEnumIDListBase
@@ -571,7 +584,7 @@
HRESULT WINAPI CRecycleBin::GetUIObjectOf(HWND hwndOwner, UINT cidl,
PCUITEMID_CHILD_ARRAY apidl,
REFIID riid, UINT *prgfInOut, void **ppv)
{
- IUnknown *pObj = NULL;
+ LPVOID pObj = NULL;
HRESULT hr = E_INVALIDARG;
TRACE ("(%p)->(%p,%u,apidl=%p, %p %p)\n", this,
@@ -592,21 +605,9 @@
hr = QueryInterface(IID_PPV_ARG(IDropTarget, &pDt));
pObj = pDt;
}
- else if(IsEqualIID(riid, IID_IExtractIconA) && (cidl == 1))
- {
- // FIXME: This is not correct, it does not show the right icons
- LPITEMIDLIST pidlItem = ILCombine(pidl, apidl[0]);
- pObj = IExtractIconA_Constructor(pidlItem);
- SHFree(pidlItem);
- hr = S_OK;
- }
- else if (IsEqualIID(riid, IID_IExtractIconW) && (cidl == 1))
- {
- // FIXME: This is not correct, it does not show the right icons
- LPITEMIDLIST pidlItem = ILCombine(pidl, apidl[0]);
- pObj = IExtractIconW_Constructor(pidlItem);
- SHFree(pidlItem);
- hr = S_OK;
+ else if((IsEqualIID(riid, IID_IExtractIconA) || IsEqualIID(riid, IID_IExtractIconW))
&& (cidl == 1))
+ {
+ hr = CRecyclerExtractIcon_CreateInstance(apidl[0], riid, &pObj);
}
else
hr = E_NOINTERFACE;
@@ -686,8 +687,10 @@
HRESULT WINAPI CRecycleBin::GetDefaultColumn(DWORD dwReserved, ULONG *pSort, ULONG
*pDisplay)
{
TRACE("(%p, %x, %p, %p)\n", this, (unsigned int)dwReserved, pSort,
pDisplay);
- *pSort = 0;
- *pDisplay = 0;
+ if (pSort)
+ *pSort = 0;
+ if (pDisplay)
+ *pDisplay = 0;
return S_OK;
}
Propchange: branches/ros-branch-0_4_1/rosapps/applications/cmdutils/cat/
------------------------------------------------------------------------------
(empty)
Propchange: branches/ros-branch-0_4_1/rosapps/applications/imagesoft/lang/no-NO.rc
------------------------------------------------------------------------------
(empty)
Propchange: branches/ros-branch-0_4_1/rosapps/applications/net/roshttpd/
------------------------------------------------------------------------------
(empty)
Propchange: branches/ros-branch-0_4_1/rosapps/applications/sysutils/gettype/
------------------------------------------------------------------------------
(empty)
Propchange: branches/ros-branch-0_4_1/rosapps/applications/sysutils/logevent/
------------------------------------------------------------------------------
(empty)
Propchange: branches/ros-branch-0_4_1/rosapps/applications/sysutils/screenshot/
------------------------------------------------------------------------------
(empty)
Propchange: branches/ros-branch-0_4_1/rosapps/templates/old_wordpad/lang/no-NO.rc
------------------------------------------------------------------------------
(empty)