[SHELL32] - Remove Reactos only ISFHelper interface that is no longer used.
authorGiannis Adamopoulos <gadamopoulos@reactos.org>
Wed, 2 Sep 2015 18:20:40 +0000 (18:20 +0000)
committerGiannis Adamopoulos <gadamopoulos@reactos.org>
Wed, 2 Sep 2015 18:20:40 +0000 (18:20 +0000)
svn path=/trunk/; revision=68916

reactos/dll/win32/shell32/folders/CDesktopFolder.cpp
reactos/dll/win32/shell32/folders/CDesktopFolder.h
reactos/dll/win32/shell32/folders/CFSFolder.cpp
reactos/dll/win32/shell32/folders/CFSFolder.h
reactos/dll/win32/shell32/precomp.h
reactos/dll/win32/shell32/shellfolder.h [deleted file]
reactos/dll/win32/shell32/wine/brsfolder.c

index 570f77c..0134814 100644 (file)
@@ -957,41 +957,6 @@ HRESULT WINAPI CDesktopFolder::GetCurFolder(LPITEMIDLIST * pidl)
     return S_OK;
 }
 
-HRESULT WINAPI CDesktopFolder::GetUniqueName(LPWSTR pwszName, UINT uLen)
-{
-    CComPtr<ISFHelper> psfHelper;
-    HRESULT hr = m_DesktopFSFolder->QueryInterface(IID_PPV_ARG(ISFHelper, &psfHelper));
-    if (FAILED(hr))
-        return hr;
-
-    return psfHelper->GetUniqueName(pwszName, uLen);
-}
-
-HRESULT WINAPI CDesktopFolder::AddFolder(HWND hwnd, LPCWSTR pwszName, LPITEMIDLIST *ppidlOut)
-{
-    CComPtr<ISFHelper> psfHelper;
-    HRESULT hr = m_DesktopFSFolder->QueryInterface(IID_PPV_ARG(ISFHelper, &psfHelper));
-    if (FAILED(hr))
-        return hr;
-
-    return psfHelper->AddFolder(hwnd, pwszName, ppidlOut);
-}
-
-HRESULT WINAPI CDesktopFolder::DeleteItems(UINT cidl, LPCITEMIDLIST *apidl)
-{
-    return E_NOTIMPL;
-}
-
-HRESULT WINAPI CDesktopFolder::CopyItems(IShellFolder *pSFFrom, UINT cidl, LPCITEMIDLIST *apidl, BOOL bCopy)
-{
-    CComPtr<ISFHelper> psfHelper;
-    HRESULT hr = m_DesktopFSFolder->QueryInterface(IID_PPV_ARG(ISFHelper, &psfHelper));
-    if (FAILED(hr))
-        return hr;
-
-    return psfHelper->CopyItems(pSFFrom, cidl, apidl, bCopy);
-}
-
 HRESULT WINAPI CDesktopFolder::_GetDropTarget(LPCITEMIDLIST pidl, LPVOID *ppvOut) {
     HRESULT hr;
 
index a72b45c..6c98cb3 100644 (file)
@@ -27,8 +27,7 @@ class CDesktopFolder :
     public CComCoClass<CDesktopFolder, &CLSID_ShellDesktop>,
     public CComObjectRootEx<CComMultiThreadModelNoCS>,
     public IShellFolder2,
-    public IPersistFolder2,
-    public ISFHelper
+    public IPersistFolder2
 {
     private:
         /* both paths are parsible from the desktop */
@@ -75,12 +74,6 @@ class CDesktopFolder :
         // *** IPersistFolder2 methods ***
         virtual HRESULT WINAPI GetCurFolder(LPITEMIDLIST * pidl);
 
-        // *** ISFHelper methods ***
-        virtual HRESULT WINAPI GetUniqueName(LPWSTR pwszName, UINT uLen);
-        virtual HRESULT WINAPI AddFolder(HWND hwnd, LPCWSTR pwszName, LPITEMIDLIST *ppidlOut);
-        virtual HRESULT WINAPI DeleteItems(UINT cidl, LPCITEMIDLIST *apidl);
-        virtual HRESULT WINAPI CopyItems(IShellFolder *pSFFrom, UINT cidl, LPCITEMIDLIST *apidl, BOOL bCopy);
-
         DECLARE_REGISTRY_RESOURCEID(IDR_SHELLDESKTOP)
         DECLARE_CENTRAL_INSTANCE_NOT_AGGREGATABLE(CDesktopFolder)
 
@@ -92,7 +85,6 @@ class CDesktopFolder :
         COM_INTERFACE_ENTRY_IID(IID_IPersistFolder, IPersistFolder)
         COM_INTERFACE_ENTRY_IID(IID_IPersistFolder2, IPersistFolder2)
         COM_INTERFACE_ENTRY_IID(IID_IPersist, IPersist)
-        COM_INTERFACE_ENTRY_IID(IID_ISFHelper, ISFHelper)
         END_COM_MAP()
 };
 
index aaf7206..3b2157d 100644 (file)
@@ -820,108 +820,6 @@ HRESULT WINAPI CFSFolder::MapColumnToSCID (UINT column,
     return E_NOTIMPL;
 }
 
-/****************************************************************************
- * ISFHelper for IShellFolder implementation
- */
-
-/****************************************************************************
- * CFSFolder::GetUniqueName
- *
- * creates a unique folder name
- */
-
-HRESULT WINAPI CFSFolder::GetUniqueName(LPWSTR pwszName, UINT uLen)
-{
-    CComPtr<IEnumIDList> penum;
-    HRESULT hr;
-    WCHAR wszText[MAX_PATH];
-    WCHAR wszNewFolder[25];
-    const WCHAR wszFormat[] = L"%s %d";
-
-    LoadStringW(shell32_hInstance, IDS_NEWFOLDER, wszNewFolder, _countof(wszNewFolder));
-
-    TRACE ("(%p)(%p %u)\n", this, pwszName, uLen);
-
-    if (uLen < _countof(wszNewFolder) + 3)
-        return E_POINTER;
-
-    lstrcpynW (pwszName, wszNewFolder, uLen);
-
-    hr = EnumObjects(0, SHCONTF_FOLDERS | SHCONTF_NONFOLDERS | SHCONTF_INCLUDEHIDDEN, &penum);
-    if (penum)
-    {
-        LPITEMIDLIST pidl;
-        DWORD dwFetched;
-        int i = 1;
-
-next:
-        penum->Reset ();
-        while (S_OK == penum->Next(1, &pidl, &dwFetched) && dwFetched)
-        {
-            _ILSimpleGetTextW(pidl, wszText, MAX_PATH);
-            if (0 == lstrcmpiW(wszText, pwszName))
-            {
-                _snwprintf(pwszName, uLen, wszFormat, wszNewFolder, i++);
-                if (i > 99)
-                {
-                    hr = E_FAIL;
-                    break;
-                }
-                goto next;
-            }
-        }
-    }
-    return hr;
-}
-
-/****************************************************************************
- * CFSFolder::AddFolder
- *
- * adds a new folder.
- */
-
-HRESULT WINAPI CFSFolder::AddFolder(HWND hwnd, LPCWSTR pwszName,
-                                    LPITEMIDLIST * ppidlOut)
-{
-    WCHAR wszNewDir[MAX_PATH];
-    DWORD bRes;
-    HRESULT hres = E_FAIL;
-
-    TRACE ("(%p)(%s %p)\n", this, debugstr_w(pwszName), ppidlOut);
-
-    wszNewDir[0] = 0;
-    if (sPathTarget)
-        lstrcpynW(wszNewDir, sPathTarget, MAX_PATH);
-    PathAppendW(wszNewDir, pwszName);
-
-    bRes = CreateDirectoryW(wszNewDir, NULL);
-    if (bRes)
-    {
-        SHChangeNotify(SHCNE_MKDIR, SHCNF_PATHW, wszNewDir, NULL);
-
-        hres = S_OK;
-
-        if (ppidlOut)
-            hres = _ILCreateFromPathW(wszNewDir, ppidlOut);
-    }
-    else
-    {
-        WCHAR wszText[128 + MAX_PATH];
-        WCHAR wszTempText[128];
-        WCHAR wszCaption[256];
-
-        /* Cannot Create folder because of permissions */
-        LoadStringW(shell32_hInstance, IDS_CREATEFOLDER_DENIED, wszTempText,
-                    _countof(wszTempText));
-        LoadStringW(shell32_hInstance, IDS_CREATEFOLDER_CAPTION, wszCaption,
-                    _countof(wszCaption));
-        swprintf(wszText, wszTempText, wszNewDir);
-        MessageBoxW(hwnd, wszText, wszCaption, MB_OK | MB_ICONEXCLAMATION);
-    }
-
-    return hres;
-}
-
 /****************************************************************************
  * BuildPathsList
  *
@@ -954,70 +852,6 @@ BuildPathsList(LPCWSTR wszBasePath, int cidl, LPCITEMIDLIST *pidls)
     return pwszPathsList;
 }
 
-/****************************************************************************
- * CFSFolder::DeleteItems
- *
- * deletes items in folder
- */
-HRESULT WINAPI CFSFolder::DeleteItems(UINT cidl, LPCITEMIDLIST *apidl)
-{
-    UINT i;
-    SHFILEOPSTRUCTW op;
-    WCHAR wszPath[MAX_PATH];
-    WCHAR *wszPathsList;
-    HRESULT ret;
-    WCHAR *wszCurrentPath;
-
-    TRACE ("(%p)(%u %p)\n", this, cidl, apidl);
-    if (cidl == 0) return S_OK;
-
-    if (sPathTarget)
-        lstrcpynW(wszPath, sPathTarget, MAX_PATH);
-    else
-        wszPath[0] = '\0';
-    PathAddBackslashW(wszPath);
-    wszPathsList = BuildPathsList(wszPath, cidl, apidl);
-
-    ZeroMemory(&op, sizeof(op));
-    op.hwnd = GetActiveWindow();
-    op.wFunc = FO_DELETE;
-    op.pFrom = wszPathsList;
-    op.fFlags = FOF_ALLOWUNDO;
-    if (SHFileOperationW(&op))
-    {
-        WARN("SHFileOperation failed\n");
-        ret = E_FAIL;
-    }
-    else
-        ret = S_OK;
-
-    /* we currently need to manually send the notifies */
-    wszCurrentPath = wszPathsList;
-    for (i = 0; i < cidl; i++)
-    {
-        LONG wEventId;
-
-        if (_ILIsFolder(apidl[i]))
-            wEventId = SHCNE_RMDIR;
-        else if (_ILIsValue(apidl[i]))
-            wEventId = SHCNE_DELETE;
-        else
-            continue;
-
-        /* check if file exists */
-        if (GetFileAttributesW(wszCurrentPath) == INVALID_FILE_ATTRIBUTES)
-        {
-            LPITEMIDLIST pidl = ILCombine(pidlRoot, apidl[i]);
-            SHChangeNotify(wEventId, SHCNF_IDLIST, pidl, NULL);
-            SHFree(pidl);
-        }
-
-        wszCurrentPath += wcslen(wszCurrentPath) + 1;
-    }
-    HeapFree(GetProcessHeap(), 0, wszPathsList);
-    return ret;
-}
-
 /****************************************************************************
  * CFSFolder::CopyItems
  *
index de3570a..995efde 100644 (file)
@@ -30,8 +30,7 @@ class CFSFolder :
     public CComObjectRootEx<CComMultiThreadModelNoCS>,
     public IShellFolder2,
     public IPersistFolder3,
-    public IDropTarget,
-    public ISFHelper
+    public IDropTarget
 {
     private:
         CLSID *pclsid;
@@ -52,6 +51,7 @@ class CFSFolder :
         virtual HRESULT WINAPI _GetDropTarget(LPCITEMIDLIST pidl, LPVOID *ppvOut);
         virtual HRESULT WINAPI _LoadDynamicDropTargetHandlerForKey(HKEY hRootKey, LPCWSTR pwcsname, LPVOID *ppvOut);
         virtual HRESULT WINAPI _LoadDynamicDropTargetHandler(const CLSID *pclsid, LPCWSTR pwcsname, LPVOID *ppvOut);
+        virtual HRESULT WINAPI CopyItems(IShellFolder *pSFFrom, UINT cidl, LPCITEMIDLIST *apidl, BOOL bCopy);
 
     public:
         CFSFolder();
@@ -98,12 +98,6 @@ class CFSFolder :
         virtual HRESULT WINAPI DragLeave();
         virtual HRESULT WINAPI Drop(IDataObject *pDataObject, DWORD dwKeyState, POINTL pt, DWORD *pdwEffect);
 
-        // ISFHelper
-        virtual HRESULT WINAPI GetUniqueName(LPWSTR pwszName, UINT uLen);
-        virtual HRESULT WINAPI AddFolder(HWND hwnd, LPCWSTR pwszName, LPITEMIDLIST *ppidlOut);
-        virtual HRESULT WINAPI DeleteItems(UINT cidl, LPCITEMIDLIST *apidl);
-        virtual HRESULT WINAPI CopyItems(IShellFolder *pSFFrom, UINT cidl, LPCITEMIDLIST *apidl, BOOL bCopy);
-
         DECLARE_REGISTRY_RESOURCEID(IDR_SHELLFSFOLDER)
         DECLARE_NOT_AGGREGATABLE(CFSFolder)
 
@@ -117,7 +111,6 @@ class CFSFolder :
         COM_INTERFACE_ENTRY_IID(IID_IPersistFolder3, IPersistFolder3)
         COM_INTERFACE_ENTRY_IID(IID_IPersist, IPersist)
         COM_INTERFACE_ENTRY_IID(IID_IDropTarget, IDropTarget)
-        COM_INTERFACE_ENTRY_IID(IID_ISFHelper, ISFHelper)
         END_COM_MAP()
 };
 
index 86ff1c9..849f53a 100644 (file)
@@ -45,7 +45,6 @@
 #include "wine/cpanel.h"
 #include "CEnumIDListBase.h"
 #include "shfldr.h"
-#include "shellfolder.h"
 #include "CShellItem.h"
 #include "CShellLink.h"
 #include "CDropTargetHelper.h"
diff --git a/reactos/dll/win32/shell32/shellfolder.h b/reactos/dll/win32/shell32/shellfolder.h
deleted file mode 100644 (file)
index 9ef77e5..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Defines helper functions to manipulate the contents of an IShellFolder
- *
- * Copyright 2000 Juergen Schmied
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
- */
-
-#ifndef __WINE_SHELLFOLDER_HELP_H
-#define __WINE_SHELLFOLDER_HELP_H
-
-/*****************************************************************************
- * Predeclare the interfaces
- */
-DEFINE_GUID(IID_ISFHelper, 0x1fe68efbL, 0x1874, 0x9812, 0x56, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
-
-/*****************************************************************************
- * ISFHelper interface
- */
-#undef INTERFACE
-
-#define INTERFACE ISFHelper
-DECLARE_INTERFACE_(ISFHelper,IUnknown)
-{
-    /*** IUnknown methods ***/
-    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
-    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
-    STDMETHOD_(ULONG,Release)(THIS) PURE;
-    /*** ISFHelper methods ***/
-    STDMETHOD(GetUniqueName)(THIS_ LPWSTR  lpName, UINT  uLen) PURE;
-    STDMETHOD(AddFolder)(THIS_ HWND  hwnd, LPCWSTR  lpName, LPITEMIDLIST * ppidlOut) PURE;
-    STDMETHOD(DeleteItems)(THIS_ UINT  cidl, LPCITEMIDLIST * apidl) PURE;
-    STDMETHOD(CopyItems)(THIS_ IShellFolder * pSFFrom, UINT  cidl, LPCITEMIDLIST * apidl, BOOL bCopy) PURE;
-};
-#undef INTERFACE
-
-#ifdef COBJMACROS
-/*** IUnknown methods ***/
-#define ISFHelper_QueryInterface(p,a,b)         (p)->lpVtbl->QueryInterface(p,a,b)
-#define ISFHelper_AddRef(p)                     (p)->lpVtbl->AddRef(p)
-#define ISFHelper_Release(p)                    (p)->lpVtbl->Release(p)
-/*** ISFHelper methods ***/
-#define ISFHelper_GetUniqueName(p,a,b)          (p)->lpVtbl->GetUniqueName(p,a,b)
-#define ISFHelper_AddFolder(p,a,b,c)            (p)->lpVtbl->AddFolder(p,a,b,c)
-#define ISFHelper_DeleteItems(p,a,b)            (p)->lpVtbl->DeleteItems(p,a,b)
-#define ISFHelper_CopyItems(p,a,b,c)            (p)->lpVtbl->CopyItems(p,a,b,c)
-#endif
-
-#endif /* __WINE_SHELLFOLDER_HELP_H */
index 96636a3..71d6df5 100644 (file)
@@ -38,7 +38,6 @@
 #include "pidl.h"
 #include "shell32_main.h"
 #include "shresdef.h"
-#include "shellfolder.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(shell);