[SHELL32]
authorMark Jansen <mark.jansen@reactos.org>
Sun, 10 Apr 2016 12:05:06 +0000 (12:05 +0000)
committerMark Jansen <mark.jansen@reactos.org>
Sun, 10 Apr 2016 12:05:06 +0000 (12:05 +0000)
- Stub IShellFolderViewDual2
ROSTESTS-209 #comment CDefViewDual.patch committed.

svn path=/trunk/; revision=71138

reactos/dll/win32/shell32/CDefView.cpp
reactos/dll/win32/shell32/CDefViewDual.cpp [new file with mode: 0644]
reactos/dll/win32/shell32/CMakeLists.txt
reactos/dll/win32/shell32/shell32.cpp
reactos/dll/win32/shell32/wine/shell32_main.h

index 7a92457..9780c11 100644 (file)
@@ -80,6 +80,7 @@ class CDefView :
         CComPtr<IShellFolder2>    m_pSF2Parent;
         CComPtr<IShellBrowser>    m_pShellBrowser;
         CComPtr<ICommDlgBrowser>  m_pCommDlgBrowser;
+        CComPtr<IShellFolderViewDual> m_pShellFolderViewDual;
         CListView                 m_ListView;
         HWND                      m_hWndParent;
         FOLDERSETTINGS            m_FolderSettings;
@@ -2302,6 +2303,12 @@ HRESULT WINAPI CDefView::GetItemObject(UINT uItem, REFIID riid, LPVOID *ppvOut)
                     return hr;
                 *ppvOut = pcm;
             }
+            else if (IsEqualIID(riid, IID_IDispatch))
+            {
+                if (m_pShellFolderViewDual == NULL)
+                    hr = CDefViewDual_Constructor(riid, (LPVOID*)&m_pShellFolderViewDual);
+                hr = m_pShellFolderViewDual->QueryInterface(riid, ppvOut);
+            }
             break;
 
         case SVGIO_SELECTION:
diff --git a/reactos/dll/win32/shell32/CDefViewDual.cpp b/reactos/dll/win32/shell32/CDefViewDual.cpp
new file mode 100644 (file)
index 0000000..03de2c3
--- /dev/null
@@ -0,0 +1,143 @@
+/*
+ *    ShellFolderViewDual
+ *
+ *    Copyright 2016         Mark Jansen
+ *
+ * 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
+ *
+ */
+
+#include "precomp.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(shell);
+
+class CDefViewDual :
+    public CComObjectRootEx<CComMultiThreadModelNoCS>,
+    public IDispatchImpl<IShellFolderViewDual2, &IID_IShellFolderViewDual2>
+{
+    public:
+        CDefViewDual()
+        {
+        }
+
+        ~CDefViewDual()
+        {
+        }
+
+        HRESULT STDMETHODCALLTYPE Initialize()
+        {
+            // Nothing to do for now..
+            return S_OK;
+        }
+
+        // *** IShellFolderViewDual methods ***
+        virtual HRESULT STDMETHODCALLTYPE get_Application(IDispatch **app) override
+        {
+            if (!app) return E_INVALIDARG;
+            *app = NULL;
+            FIXME("CDefViewDual::get_Application is UNIMPLEMENTED (%p, %p)\n", this, app);
+            return E_NOTIMPL;
+        }
+
+        virtual HRESULT STDMETHODCALLTYPE get_Parent(IDispatch **parent) override
+        {
+            if (!parent) return E_INVALIDARG;
+            *parent = NULL;
+            FIXME("CDefViewDual::get_Parent is UNIMPLEMENTED (%p, %p)\n", this, parent);
+            return E_NOTIMPL;
+        }
+
+        virtual HRESULT STDMETHODCALLTYPE get_Folder(Folder **folder) override
+        {
+            if (!folder) return E_INVALIDARG;
+            *folder = NULL;
+            FIXME("CDefViewDual::get_Folder is UNIMPLEMENTED (%p, %p)\n", this, folder);
+            return E_NOTIMPL;
+        }
+
+        virtual HRESULT STDMETHODCALLTYPE SelectedItems(FolderItems **items) override
+        {
+            if (!items) return E_INVALIDARG;
+            *items = NULL;
+            FIXME("CDefViewDual::SelectedItems is UNIMPLEMENTED (%p, %p)\n", this, items);
+            return E_NOTIMPL;
+        }
+
+        virtual  HRESULT STDMETHODCALLTYPE get_FocusedItem(FolderItem **item) override
+        {
+            if (!item) return E_INVALIDARG;
+            *item = NULL;
+            FIXME("CDefViewDual::get_FocusedItem is UNIMPLEMENTED (%p, %p)\n", this, item);
+            return E_NOTIMPL;
+        }
+
+        virtual HRESULT STDMETHODCALLTYPE SelectItem(VARIANT *item, int flags) override
+        {
+            FIXME("CDefViewDual::SelectItem is UNIMPLEMENTED (%p, %p, %i)\n", this, item, flags);
+            return E_NOTIMPL;
+        }
+
+        virtual HRESULT STDMETHODCALLTYPE PopupItemMenu(FolderItem *item, VARIANT vx, VARIANT vy, BSTR *command) override
+        {
+            FIXME("CDefViewDual::PopupItemMenu is UNIMPLEMENTED (%p, %p, %s, %s, %p)\n", this, item, wine_dbgstr_variant(&vx), wine_dbgstr_variant(&vy), command);
+            return E_NOTIMPL;
+        }
+
+        virtual HRESULT STDMETHODCALLTYPE get_Script(IDispatch **script) override
+        {
+            FIXME("CDefViewDual::get_Script is UNIMPLEMENTED (%p, %p)\n", this, script);
+            return E_NOTIMPL;
+        }
+
+        virtual HRESULT STDMETHODCALLTYPE get_ViewOptions(long *options) override
+        {
+            FIXME("CDefViewDual::get_ViewOptions is UNIMPLEMENTED (%p, %p)\n", this, options);
+            return E_NOTIMPL;
+        }
+
+        // *** IShellFolderViewDual2 methods ***
+        virtual HRESULT STDMETHODCALLTYPE get_CurrentViewMode(UINT *mode) override
+        {
+            FIXME("CDefViewDual::get_CurrentViewMode is UNIMPLEMENTED (%p, %p)\n", this, mode);
+            return E_NOTIMPL;
+        }
+
+        virtual HRESULT STDMETHODCALLTYPE put_CurrentViewMode(UINT mode) override
+        {
+            FIXME("CDefViewDual::put_CurrentViewMode is UNIMPLEMENTED (%p, %u)\n", this, mode);
+            return E_NOTIMPL;
+        }
+
+        virtual HRESULT STDMETHODCALLTYPE SelectItemRelative(int relative) override
+        {
+            FIXME("CDefViewDual::SelectItemRelative is UNIMPLEMENTED (%p, %i)\n", this, relative);
+            return E_NOTIMPL;
+        }
+
+    BEGIN_COM_MAP(CDefViewDual)
+        COM_INTERFACE_ENTRY_IID(IID_IDispatch, IDispatch)
+        COM_INTERFACE_ENTRY_IID(IID_IShellFolderViewDual, IShellFolderViewDual)
+        COM_INTERFACE_ENTRY_IID(IID_IShellFolderViewDual2, IShellFolderViewDual2)
+    END_COM_MAP()
+};
+
+/**********************************************************
+ *    CDefViewDual_Constructor
+ */
+
+HRESULT WINAPI CDefViewDual_Constructor(REFIID riid, LPVOID * ppvOut)
+{
+    return ShellObjectCreatorInit<CDefViewDual>(riid, ppvOut);
+}
index 3c2ab5a..2a4f68e 100644 (file)
@@ -6,6 +6,11 @@ add_subdirectory(shellmenu)
 set_cpp(WITH_RUNTIME)
 spec2def(shell32.dll shell32.spec ADD_IMPORTLIB)
 
+if(NOT MSVC)
+    # HACK: this should be enabled globally!
+    add_compile_flags_language("-std=c++11" "CXX")
+endif()
+
 remove_definitions(-D_WIN32_WINNT=0x502)
 add_definitions(-D_WIN32_WINNT=0x600)
 
@@ -53,6 +58,7 @@ list(APPEND SOURCE
     shlfolder.cpp
     CFileSysBindData.cpp
     CDefView.cpp
+    CDefViewDual.cpp
     stubs.cpp
     systray.cpp
     CDefaultContextMenu.cpp
index ff802f9..76c6e33 100644 (file)
@@ -292,7 +292,7 @@ STDAPI_(BOOL) DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID fImpLoad)
     if (dwReason == DLL_PROCESS_ATTACH)
     {
         shell32_hInstance = hInstance;
-        gModule.Init(ObjectMap, hInstance, NULL);
+        gModule.Init(ObjectMap, hInstance, &LIBID_Shell32);
 
         DisableThreadLibraryCalls (hInstance);
 
index c3c0c06..58c949c 100644 (file)
@@ -71,6 +71,7 @@ IContextMenu2 * ISvStaticItemCm_Constructor(LPSHELLFOLDER pSFParent, LPCITEMIDLI
 IContextMenu2 *        ISvBgCm_Constructor(LPSHELLFOLDER pSFParent, BOOL bDesktop);
 HRESULT WINAPI IShellView_Constructor(IShellFolder *pFolder, IShellView **newView);
 HRESULT WINAPI CDefView_Constructor(IShellFolder *pFolder, REFIID riid, LPVOID * ppvOut);
+HRESULT WINAPI CDefViewDual_Constructor(REFIID riid, LPVOID * ppvOut);
 
 HRESULT WINAPI IShellLink_ConstructFromFile(IUnknown * pUnkOuter, REFIID riid, LPCITEMIDLIST pidl, LPVOID * ppv);
 HRESULT WINAPI IFileSystemBindData_Constructor(const WIN32_FIND_DATAW *pfd, LPBC *ppV);