Index: dll/win32/shell32/CMakeLists.txt =================================================================== --- dll/win32/shell32/CMakeLists.txt (revision 70316) +++ dll/win32/shell32/CMakeLists.txt (working copy) @@ -58,6 +58,7 @@ CDefaultContextMenu.cpp COpenWithMenu.cpp CNewMenu.cpp + CShell.cpp precomp.h) add_library(shell32 SHARED Index: dll/win32/shell32/CShell.cpp =================================================================== --- dll/win32/shell32/CShell.cpp (revision 0) +++ dll/win32/shell32/CShell.cpp (working copy) @@ -0,0 +1,319 @@ +/* + * IShellItem implementation + * + * Copyright 2015 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); + + +CShell::CShell() +{ +} + +CShell::~CShell() +{ +} + + +// *** IDispatch methods *** +HRESULT STDMETHODCALLTYPE CShell::GetTypeInfoCount(UINT *pctinfo) +{ + TRACE("(%p, %p)\n", this, pctinfo); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CShell::GetTypeInfo(UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo) +{ + TRACE("(%p, %lu, %lu, %p)\n", this, iTInfo, lcid, ppTInfo); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CShell::GetIDsOfNames(REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId) +{ + TRACE("(%p, %s, %p, %lu, %lu, %p)\n", this, wine_dbgstr_guid(&riid), rgszNames, cNames, lcid, rgDispId); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CShell::Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) +{ + TRACE("(%p, %lu, %s, %lu, %lu, %p, %p, %p, %p)\n", this, dispIdMember, wine_dbgstr_guid(&riid), lcid, (DWORD)wFlags, + pDispParams, pVarResult, pExcepInfo, puArgErr); + return E_NOTIMPL; +} + + +// *** IShellDispatch methods *** +HRESULT STDMETHODCALLTYPE CShell::get_Application(IDispatch **ppid) +{ + TRACE("(%p, %p)\n", this, ppid); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CShell::get_Parent(IDispatch **ppid) +{ + TRACE("(%p, %p)\n", this, ppid); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CShell::NameSpace(VARIANT vDir, Folder **ppsdf) +{ + TRACE("(%p, %s, %p)\n", this, debugstr_variant(&vDir), ppsdf); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CShell::BrowseForFolder(LONG Hwnd, BSTR Title, LONG Options, VARIANT RootFolder, Folder **ppsdf) +{ + TRACE("(%p, %lu, %ls, %lu, %s, %p)\n", this, Hwnd, Title, Options, debugstr_variant(&RootFolder), ppsdf); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CShell::Windows(IDispatch **ppid) +{ + TRACE("(%p, %p)\n", this, ppid); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CShell::Open(VARIANT vDir) +{ + TRACE("(%p, %s)\n", this, debugstr_variant(&vDir)); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CShell::Explore(VARIANT vDir) +{ + TRACE("(%p, %s)\n", this, debugstr_variant(&vDir)); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CShell::MinimizeAll() +{ + TRACE("(%p)\n", this); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CShell::UndoMinimizeALL() +{ + TRACE("(%p)\n", this); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CShell::FileRun() +{ + TRACE("(%p)\n", this); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CShell::CascadeWindows() +{ + TRACE("(%p)\n", this); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CShell::TileVertically() +{ + TRACE("(%p)\n", this); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CShell::TileHorizontally() +{ + TRACE("(%p)\n", this); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CShell::ShutdownWindows() +{ + TRACE("(%p)\n", this); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CShell::Suspend() +{ + TRACE("(%p)\n", this); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CShell::EjectPC() +{ + TRACE("(%p)\n", this); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CShell::SetTime() +{ + TRACE("(%p)\n", this); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CShell::TrayProperties() +{ + TRACE("(%p)\n", this); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CShell::Help() +{ + TRACE("(%p)\n", this); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CShell::FindFiles() +{ + TRACE("(%p)\n", this); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CShell::FindComputer() +{ + TRACE("(%p)\n", this); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CShell::RefreshMenu() +{ + TRACE("(%p)\n", this); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CShell::ControlPanelItem(BSTR szDir) +{ + TRACE("(%p, %ls)\n", this, szDir); + return E_NOTIMPL; +} + + +// *** IShellDispatch2 methods *** +HRESULT STDMETHODCALLTYPE CShell::IsRestricted(BSTR group, BSTR restriction, LONG *value) +{ + TRACE("(%p, %ls, %ls, %p)\n", this, group, restriction, value); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CShell::ShellExecute(BSTR file, VARIANT args, VARIANT dir, VARIANT op, VARIANT show) +{ + TRACE("(%p, %ls, %s, %s, %s, %s)\n", this, file, debugstr_variant(&args), debugstr_variant(&dir), debugstr_variant(&op), debugstr_variant(&show)); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CShell::FindPrinter(BSTR name, BSTR location, BSTR model) +{ + TRACE("(%p, %ls, %ls, %ls)\n", this, name, location, model); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CShell::GetSystemInformation(BSTR name, VARIANT *ret) +{ + TRACE("(%p, %ls, %p)\n", this, name, ret); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CShell::ServiceStart(BSTR service, VARIANT persistent, VARIANT *ret) +{ + TRACE("(%p, %ls, %s, %p)\n", this, service, wine_dbgstr_variant(&persistent), ret); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CShell::ServiceStop(BSTR service, VARIANT persistent, VARIANT *ret) +{ + TRACE("(%p, %ls, %s, %p)\n", this, service, wine_dbgstr_variant(&persistent), ret); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CShell::IsServiceRunning(BSTR service, VARIANT *running) +{ + TRACE("(%p, %ls, %p)\n", this, service, running); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CShell::CanStartStopService(BSTR service, VARIANT *ret) +{ + TRACE("(%p, %ls, %p)\n", this, service, ret); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CShell::ShowBrowserBar(BSTR clsid, VARIANT show, VARIANT *ret) +{ + TRACE("(%p, %ls, %s, %p)\n", this, clsid, wine_dbgstr_variant(&show), ret); + return E_NOTIMPL; +} + + +// *** IShellDispatch3 methods *** +HRESULT STDMETHODCALLTYPE CShell::AddToRecent(VARIANT file, BSTR category) +{ + TRACE("(%p, %s, %ls)\n", this, wine_dbgstr_variant(&file), category); + return E_NOTIMPL; +} + + +// *** IShellDispatch4 methods *** +HRESULT STDMETHODCALLTYPE CShell::WindowsSecurity() +{ + TRACE("(%p)\n", this); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CShell::ToggleDesktop() +{ + TRACE("(%p)\n", this); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CShell::ExplorerPolicy(BSTR policy, VARIANT *value) +{ + TRACE("(%p, %ls, %p)\n", this, policy, value); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CShell::GetSetting(LONG setting, VARIANT_BOOL *result) +{ + TRACE("(%p, %lu, %p)\n", this, setting, result); + return E_NOTIMPL; +} + + +// *** IObjectSafety methods *** +HRESULT STDMETHODCALLTYPE CShell::GetInterfaceSafetyOptions(REFIID riid, DWORD *pdwSupportedOptions, DWORD *pdwEnabledOptions) +{ + TRACE("(%p, %s, %p, %p)\n", this, wine_dbgstr_guid(&riid), pdwSupportedOptions, pdwEnabledOptions); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CShell::SetInterfaceSafetyOptions(REFIID riid, DWORD dwOptionSetMask, DWORD dwEnabledOptions) +{ + TRACE("(%p, %s, %lu, %lu)\n", this, wine_dbgstr_guid(&riid), dwOptionSetMask, dwEnabledOptions); + return E_NOTIMPL; +} + + +// *** IObjectWithSite methods *** +HRESULT STDMETHODCALLTYPE CShell::SetSite(IUnknown *pUnkSite) +{ + TRACE("(%p, %p)\n", this, pUnkSite); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CShell::GetSite(REFIID riid, PVOID *ppvSite) +{ + TRACE("(%p, %s, %p)\n", this, wine_dbgstr_guid(&riid), ppvSite); + return E_NOTIMPL; +} + + Index: dll/win32/shell32/CShell.h =================================================================== --- dll/win32/shell32/CShell.h (revision 0) +++ dll/win32/shell32/CShell.h (working copy) @@ -0,0 +1,115 @@ +/* + * IShell implementation + * + * Copyright 2015 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 + */ + +#ifndef _SHELL_H_ +#define _SHELL_H_ + +#undef ShellExecute + +class CShell: + public CComCoClass, + public CComObjectRootEx, + public IShellDispatch4, + public IObjectSafety, + public IObjectWithSite +{ +private: + +public: + CShell(); + ~CShell(); + + // *** IDispatch methods *** + virtual HRESULT STDMETHODCALLTYPE GetTypeInfoCount(UINT *pctinfo); + virtual HRESULT STDMETHODCALLTYPE GetTypeInfo(UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo); + virtual HRESULT STDMETHODCALLTYPE GetIDsOfNames(REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId); + virtual HRESULT STDMETHODCALLTYPE Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr); + + // *** IShellDispatch methods *** + virtual HRESULT STDMETHODCALLTYPE get_Application(IDispatch **ppid); + virtual HRESULT STDMETHODCALLTYPE get_Parent(IDispatch **ppid); + virtual HRESULT STDMETHODCALLTYPE NameSpace(VARIANT vDir, Folder **ppsdf); + virtual HRESULT STDMETHODCALLTYPE BrowseForFolder(LONG Hwnd, BSTR Title, LONG Options, VARIANT RootFolder, Folder **ppsdf); + virtual HRESULT STDMETHODCALLTYPE Windows(IDispatch **ppid); + virtual HRESULT STDMETHODCALLTYPE Open(VARIANT vDir); + virtual HRESULT STDMETHODCALLTYPE Explore(VARIANT vDir); + virtual HRESULT STDMETHODCALLTYPE MinimizeAll(); + virtual HRESULT STDMETHODCALLTYPE UndoMinimizeALL(); + virtual HRESULT STDMETHODCALLTYPE FileRun(); + virtual HRESULT STDMETHODCALLTYPE CascadeWindows(); + virtual HRESULT STDMETHODCALLTYPE TileVertically(); + virtual HRESULT STDMETHODCALLTYPE TileHorizontally(); + virtual HRESULT STDMETHODCALLTYPE ShutdownWindows(); + virtual HRESULT STDMETHODCALLTYPE Suspend(); + virtual HRESULT STDMETHODCALLTYPE EjectPC(); + virtual HRESULT STDMETHODCALLTYPE SetTime(); + virtual HRESULT STDMETHODCALLTYPE TrayProperties(); + virtual HRESULT STDMETHODCALLTYPE Help(); + virtual HRESULT STDMETHODCALLTYPE FindFiles(); + virtual HRESULT STDMETHODCALLTYPE FindComputer(); + virtual HRESULT STDMETHODCALLTYPE RefreshMenu(); + virtual HRESULT STDMETHODCALLTYPE ControlPanelItem(BSTR szDir); + + // *** IShellDispatch2 methods *** + virtual HRESULT STDMETHODCALLTYPE IsRestricted(BSTR group, BSTR restriction, LONG *value); + virtual HRESULT STDMETHODCALLTYPE ShellExecute(BSTR file, VARIANT args, VARIANT dir, VARIANT op, VARIANT show); + virtual HRESULT STDMETHODCALLTYPE FindPrinter(BSTR name, BSTR location, BSTR model); + virtual HRESULT STDMETHODCALLTYPE GetSystemInformation(BSTR name, VARIANT *ret); + virtual HRESULT STDMETHODCALLTYPE ServiceStart(BSTR service, VARIANT persistent, VARIANT *ret); + virtual HRESULT STDMETHODCALLTYPE ServiceStop(BSTR service, VARIANT persistent, VARIANT *ret); + virtual HRESULT STDMETHODCALLTYPE IsServiceRunning(BSTR service, VARIANT *running); + virtual HRESULT STDMETHODCALLTYPE CanStartStopService(BSTR service, VARIANT *ret); + virtual HRESULT STDMETHODCALLTYPE ShowBrowserBar(BSTR clsid, VARIANT show, VARIANT *ret); + + // *** IShellDispatch3 methods *** + virtual HRESULT STDMETHODCALLTYPE AddToRecent(VARIANT file, BSTR category); + + // *** IShellDispatch4 methods *** + virtual HRESULT STDMETHODCALLTYPE WindowsSecurity(); + virtual HRESULT STDMETHODCALLTYPE ToggleDesktop(); + virtual HRESULT STDMETHODCALLTYPE ExplorerPolicy(BSTR policy, VARIANT *value); + virtual HRESULT STDMETHODCALLTYPE GetSetting(LONG setting, VARIANT_BOOL *result); + + // *** IObjectSafety methods *** + virtual HRESULT STDMETHODCALLTYPE GetInterfaceSafetyOptions(REFIID riid, DWORD *pdwSupportedOptions, DWORD *pdwEnabledOptions); + virtual HRESULT STDMETHODCALLTYPE SetInterfaceSafetyOptions(REFIID riid, DWORD dwOptionSetMask, DWORD dwEnabledOptions); + + // *** IObjectWithSite methods *** + virtual HRESULT STDMETHODCALLTYPE SetSite(IUnknown *pUnkSite); + virtual HRESULT STDMETHODCALLTYPE GetSite(REFIID riid, PVOID *ppvSite); + + +DECLARE_REGISTRY_RESOURCEID(IDR_SHELL) +DECLARE_NOT_AGGREGATABLE(CShell) + +DECLARE_PROTECT_FINAL_CONSTRUCT() + +BEGIN_COM_MAP(CShell) + COM_INTERFACE_ENTRY_IID(IID_IShellDispatch4, IShellDispatch4) + COM_INTERFACE_ENTRY_IID(IID_IShellDispatch3, IShellDispatch3) + COM_INTERFACE_ENTRY_IID(IID_IShellDispatch2, IShellDispatch2) + COM_INTERFACE_ENTRY_IID(IID_IShellDispatch, IShellDispatch) + COM_INTERFACE_ENTRY_IID(IID_IDispatch, IDispatch) + COM_INTERFACE_ENTRY_IID(IID_IObjectSafety, IObjectSafety) + COM_INTERFACE_ENTRY_IID(IID_IObjectWithSite, IObjectWithSite) +END_COM_MAP() +}; + +#endif /* _SHELL_H_ */ Index: dll/win32/shell32/droptargets/CexeDropHandler.cpp =================================================================== --- dll/win32/shell32/droptargets/CexeDropHandler.cpp (revision 70316) +++ dll/win32/shell32/droptargets/CexeDropHandler.cpp (working copy) @@ -83,7 +83,7 @@ } } - ShellExecute(NULL, L"open", sPathTarget, wszBuf, NULL,SW_SHOWNORMAL); + ShellExecuteW(NULL, L"open", sPathTarget, wszBuf, NULL,SW_SHOWNORMAL); return S_OK; } Index: dll/win32/shell32/precomp.h =================================================================== --- dll/win32/shell32/precomp.h (revision 70316) +++ dll/win32/shell32/precomp.h (working copy) @@ -29,6 +29,7 @@ #include #include #include +#include #include #include @@ -48,6 +49,7 @@ #include "shfldr.h" #include "CShellItem.h" #include "CShellLink.h" +#include "CShell.h" #include "CDropTargetHelper.h" #include "folders/CFSFolder.h" #include "folders/CDrivesFolder.h" Index: dll/win32/shell32/res/rgs/shell.rgs =================================================================== --- dll/win32/shell32/res/rgs/shell.rgs (revision 0) +++ dll/win32/shell32/res/rgs/shell.rgs (working copy) @@ -0,0 +1,13 @@ +HKCR +{ + NoRemove CLSID + { + ForceRemove {13709620-c279-11ce-a49e-444553540000} = s 'Shell Automation Service' + { + InprocServer32 = s '%MODULE%' + { + val ThreadingModel = s 'Apartment' + } + } + } +} Index: dll/win32/shell32/rgs_res.rc =================================================================== --- dll/win32/shell32/rgs_res.rc (revision 70316) +++ dll/win32/shell32/rgs_res.rc (working copy) @@ -26,3 +26,4 @@ IDR_EXEDROPHANDLER REGISTRY "res/rgs/exedrophandler.rgs" IDR_MERGEDFOLDER REGISTRY "res/rgs/mergedfolder.rgs" IDR_REBARBANDSITE REGISTRY "res/rgs/rebarbandsite.rgs" +IDR_SHELL REGISTRY "res/rgs/shell.rgs" Index: dll/win32/shell32/shell32.cpp =================================================================== --- dll/win32/shell32/shell32.cpp (revision 70316) +++ dll/win32/shell32/shell32.cpp (working copy) @@ -196,6 +196,7 @@ OBJECT_ENTRY(CLSID_ShellDesktop, CDesktopFolder) OBJECT_ENTRY(CLSID_ShellItem, CShellItem) OBJECT_ENTRY(CLSID_ShellLink, CShellLink) + OBJECT_ENTRY(CLSID_Shell, CShell) OBJECT_ENTRY(CLSID_DragDropHelper, CDropTargetHelper) OBJECT_ENTRY(CLSID_ControlPanel, CControlPanelFolder) OBJECT_ENTRY(CLSID_MyDocuments, CMyDocsFolder) Index: dll/win32/shell32/shresdef.h =================================================================== --- dll/win32/shell32/shresdef.h (revision 70316) +++ dll/win32/shell32/shresdef.h (working copy) @@ -647,3 +647,4 @@ #define IDR_QUERYASSOCIATIONS 152 #define IDR_MERGEDFOLDER 153 #define IDR_REBARBANDSITE 154 +#define IDR_SHELL 155