2016-04-08 08:30:09 +00:00
|
|
|
/*
|
|
|
|
* IShellDispatch 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);
|
|
|
|
|
|
|
|
|
2016-05-31 17:40:44 +00:00
|
|
|
CShellDispatch::CShellDispatch()
|
2016-04-08 08:30:09 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2016-05-31 17:40:44 +00:00
|
|
|
CShellDispatch::~CShellDispatch()
|
2016-04-08 08:30:09 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2016-05-31 17:40:44 +00:00
|
|
|
HRESULT CShellDispatch::Initialize()
|
2016-04-08 08:30:09 +00:00
|
|
|
{
|
2016-04-11 18:28:31 +00:00
|
|
|
return S_OK;
|
2016-04-08 08:30:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// *** IShellDispatch methods ***
|
2016-05-31 17:40:44 +00:00
|
|
|
HRESULT STDMETHODCALLTYPE CShellDispatch::get_Application(IDispatch **ppid)
|
2016-04-08 08:30:09 +00:00
|
|
|
{
|
|
|
|
TRACE("(%p, %p)\n", this, ppid);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2016-05-31 17:40:44 +00:00
|
|
|
HRESULT STDMETHODCALLTYPE CShellDispatch::get_Parent(IDispatch **ppid)
|
2016-04-08 08:30:09 +00:00
|
|
|
{
|
|
|
|
TRACE("(%p, %p)\n", this, ppid);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
HRESULT VariantToIdlist(VARIANT* var, LPITEMIDLIST* idlist)
|
|
|
|
{
|
|
|
|
HRESULT hr = S_FALSE;
|
|
|
|
if(V_VT(var) == VT_I4)
|
|
|
|
{
|
|
|
|
hr = SHGetSpecialFolderLocation(NULL, V_I4(var), idlist);
|
|
|
|
}
|
|
|
|
else if(V_VT(var) == VT_BSTR)
|
|
|
|
{
|
|
|
|
hr = SHILCreateFromPathW(V_BSTR(var), idlist, NULL);
|
|
|
|
}
|
|
|
|
return hr;
|
|
|
|
}
|
|
|
|
|
2016-05-31 17:40:44 +00:00
|
|
|
HRESULT STDMETHODCALLTYPE CShellDispatch::NameSpace(VARIANT vDir, Folder **ppsdf)
|
2016-04-08 08:30:09 +00:00
|
|
|
{
|
|
|
|
TRACE("(%p, %s, %p)\n", this, debugstr_variant(&vDir), ppsdf);
|
|
|
|
if (!ppsdf)
|
|
|
|
return E_POINTER;
|
|
|
|
*ppsdf = NULL;
|
|
|
|
LPITEMIDLIST idlist = NULL;
|
|
|
|
HRESULT hr = VariantToIdlist(&vDir, &idlist);
|
|
|
|
if (!SUCCEEDED(hr) || !idlist)
|
|
|
|
return S_FALSE;
|
|
|
|
CFolder* fld = new CComObject<CFolder>();
|
|
|
|
fld->Init(idlist);
|
|
|
|
*ppsdf = fld;
|
|
|
|
fld->AddRef();
|
|
|
|
return hr;
|
|
|
|
}
|
|
|
|
|
2016-05-31 17:40:44 +00:00
|
|
|
HRESULT STDMETHODCALLTYPE CShellDispatch::BrowseForFolder(LONG Hwnd, BSTR Title, LONG Options, VARIANT RootFolder, Folder **ppsdf)
|
2016-04-08 08:30:09 +00:00
|
|
|
{
|
|
|
|
TRACE("(%p, %lu, %ls, %lu, %s, %p)\n", this, Hwnd, Title, Options, debugstr_variant(&RootFolder), ppsdf);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2016-05-31 17:40:44 +00:00
|
|
|
HRESULT STDMETHODCALLTYPE CShellDispatch::Windows(IDispatch **ppid)
|
2016-04-08 08:30:09 +00:00
|
|
|
{
|
|
|
|
TRACE("(%p, %p)\n", this, ppid);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2016-05-31 17:40:44 +00:00
|
|
|
HRESULT STDMETHODCALLTYPE CShellDispatch::Open(VARIANT vDir)
|
2016-04-08 08:30:09 +00:00
|
|
|
{
|
|
|
|
TRACE("(%p, %s)\n", this, debugstr_variant(&vDir));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2016-05-31 17:40:44 +00:00
|
|
|
HRESULT STDMETHODCALLTYPE CShellDispatch::Explore(VARIANT vDir)
|
2016-04-08 08:30:09 +00:00
|
|
|
{
|
|
|
|
TRACE("(%p, %s)\n", this, debugstr_variant(&vDir));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2016-05-31 17:40:44 +00:00
|
|
|
HRESULT STDMETHODCALLTYPE CShellDispatch::MinimizeAll()
|
2016-04-08 08:30:09 +00:00
|
|
|
{
|
|
|
|
TRACE("(%p)\n", this);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2016-05-31 17:40:44 +00:00
|
|
|
HRESULT STDMETHODCALLTYPE CShellDispatch::UndoMinimizeALL()
|
2016-04-08 08:30:09 +00:00
|
|
|
{
|
|
|
|
TRACE("(%p)\n", this);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2016-05-31 17:40:44 +00:00
|
|
|
HRESULT STDMETHODCALLTYPE CShellDispatch::FileRun()
|
2016-04-08 08:30:09 +00:00
|
|
|
{
|
|
|
|
TRACE("(%p)\n", this);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2016-05-31 17:40:44 +00:00
|
|
|
HRESULT STDMETHODCALLTYPE CShellDispatch::CascadeWindows()
|
2016-04-08 08:30:09 +00:00
|
|
|
{
|
|
|
|
TRACE("(%p)\n", this);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2016-05-31 17:40:44 +00:00
|
|
|
HRESULT STDMETHODCALLTYPE CShellDispatch::TileVertically()
|
2016-04-08 08:30:09 +00:00
|
|
|
{
|
|
|
|
TRACE("(%p)\n", this);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2016-05-31 17:40:44 +00:00
|
|
|
HRESULT STDMETHODCALLTYPE CShellDispatch::TileHorizontally()
|
2016-04-08 08:30:09 +00:00
|
|
|
{
|
|
|
|
TRACE("(%p)\n", this);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2016-05-31 17:40:44 +00:00
|
|
|
HRESULT STDMETHODCALLTYPE CShellDispatch::ShutdownWindows()
|
2016-04-08 08:30:09 +00:00
|
|
|
{
|
2017-04-02 14:45:10 +00:00
|
|
|
ExitWindowsDialog(NULL);
|
|
|
|
return S_OK;
|
2016-04-08 08:30:09 +00:00
|
|
|
}
|
|
|
|
|
2016-05-31 17:40:44 +00:00
|
|
|
HRESULT STDMETHODCALLTYPE CShellDispatch::Suspend()
|
2016-04-08 08:30:09 +00:00
|
|
|
{
|
|
|
|
TRACE("(%p)\n", this);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2016-05-31 17:40:44 +00:00
|
|
|
HRESULT STDMETHODCALLTYPE CShellDispatch::EjectPC()
|
2016-04-08 08:30:09 +00:00
|
|
|
{
|
|
|
|
TRACE("(%p)\n", this);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2016-05-31 17:40:44 +00:00
|
|
|
HRESULT STDMETHODCALLTYPE CShellDispatch::SetTime()
|
2016-04-08 08:30:09 +00:00
|
|
|
{
|
|
|
|
TRACE("(%p)\n", this);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2016-05-31 17:40:44 +00:00
|
|
|
HRESULT STDMETHODCALLTYPE CShellDispatch::TrayProperties()
|
2016-04-08 08:30:09 +00:00
|
|
|
{
|
|
|
|
TRACE("(%p)\n", this);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2016-05-31 17:40:44 +00:00
|
|
|
HRESULT STDMETHODCALLTYPE CShellDispatch::Help()
|
2016-04-08 08:30:09 +00:00
|
|
|
{
|
|
|
|
TRACE("(%p)\n", this);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2016-05-31 17:40:44 +00:00
|
|
|
HRESULT STDMETHODCALLTYPE CShellDispatch::FindFiles()
|
2016-04-08 08:30:09 +00:00
|
|
|
{
|
|
|
|
TRACE("(%p)\n", this);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2016-05-31 17:40:44 +00:00
|
|
|
HRESULT STDMETHODCALLTYPE CShellDispatch::FindComputer()
|
2016-04-08 08:30:09 +00:00
|
|
|
{
|
|
|
|
TRACE("(%p)\n", this);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2016-05-31 17:40:44 +00:00
|
|
|
HRESULT STDMETHODCALLTYPE CShellDispatch::RefreshMenu()
|
2016-04-08 08:30:09 +00:00
|
|
|
{
|
|
|
|
TRACE("(%p)\n", this);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2016-05-31 17:40:44 +00:00
|
|
|
HRESULT STDMETHODCALLTYPE CShellDispatch::ControlPanelItem(BSTR szDir)
|
2016-04-08 08:30:09 +00:00
|
|
|
{
|
|
|
|
TRACE("(%p, %ls)\n", this, szDir);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// *** IShellDispatch2 methods ***
|
2016-05-31 17:40:44 +00:00
|
|
|
HRESULT STDMETHODCALLTYPE CShellDispatch::IsRestricted(BSTR group, BSTR restriction, LONG *value)
|
2016-04-08 08:30:09 +00:00
|
|
|
{
|
|
|
|
TRACE("(%p, %ls, %ls, %p)\n", this, group, restriction, value);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2016-05-31 17:40:44 +00:00
|
|
|
HRESULT STDMETHODCALLTYPE CShellDispatch::ShellExecute(BSTR file, VARIANT args, VARIANT dir, VARIANT op, VARIANT show)
|
2016-04-08 08:30:09 +00:00
|
|
|
{
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2016-05-31 17:40:44 +00:00
|
|
|
HRESULT STDMETHODCALLTYPE CShellDispatch::FindPrinter(BSTR name, BSTR location, BSTR model)
|
2016-04-08 08:30:09 +00:00
|
|
|
{
|
|
|
|
TRACE("(%p, %ls, %ls, %ls)\n", this, name, location, model);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2016-05-31 17:40:44 +00:00
|
|
|
HRESULT STDMETHODCALLTYPE CShellDispatch::GetSystemInformation(BSTR name, VARIANT *ret)
|
2016-04-08 08:30:09 +00:00
|
|
|
{
|
|
|
|
TRACE("(%p, %ls, %p)\n", this, name, ret);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2016-05-31 17:40:44 +00:00
|
|
|
HRESULT STDMETHODCALLTYPE CShellDispatch::ServiceStart(BSTR service, VARIANT persistent, VARIANT *ret)
|
2016-04-08 08:30:09 +00:00
|
|
|
{
|
|
|
|
TRACE("(%p, %ls, %s, %p)\n", this, service, wine_dbgstr_variant(&persistent), ret);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2016-05-31 17:40:44 +00:00
|
|
|
HRESULT STDMETHODCALLTYPE CShellDispatch::ServiceStop(BSTR service, VARIANT persistent, VARIANT *ret)
|
2016-04-08 08:30:09 +00:00
|
|
|
{
|
|
|
|
TRACE("(%p, %ls, %s, %p)\n", this, service, wine_dbgstr_variant(&persistent), ret);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2016-05-31 17:40:44 +00:00
|
|
|
HRESULT STDMETHODCALLTYPE CShellDispatch::IsServiceRunning(BSTR service, VARIANT *running)
|
2016-04-08 08:30:09 +00:00
|
|
|
{
|
|
|
|
TRACE("(%p, %ls, %p)\n", this, service, running);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2016-05-31 17:40:44 +00:00
|
|
|
HRESULT STDMETHODCALLTYPE CShellDispatch::CanStartStopService(BSTR service, VARIANT *ret)
|
2016-04-08 08:30:09 +00:00
|
|
|
{
|
|
|
|
TRACE("(%p, %ls, %p)\n", this, service, ret);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2016-05-31 17:40:44 +00:00
|
|
|
HRESULT STDMETHODCALLTYPE CShellDispatch::ShowBrowserBar(BSTR clsid, VARIANT show, VARIANT *ret)
|
2016-04-08 08:30:09 +00:00
|
|
|
{
|
|
|
|
TRACE("(%p, %ls, %s, %p)\n", this, clsid, wine_dbgstr_variant(&show), ret);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// *** IShellDispatch3 methods ***
|
2016-05-31 17:40:44 +00:00
|
|
|
HRESULT STDMETHODCALLTYPE CShellDispatch::AddToRecent(VARIANT file, BSTR category)
|
2016-04-08 08:30:09 +00:00
|
|
|
{
|
|
|
|
TRACE("(%p, %s, %ls)\n", this, wine_dbgstr_variant(&file), category);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// *** IShellDispatch4 methods ***
|
2016-05-31 17:40:44 +00:00
|
|
|
HRESULT STDMETHODCALLTYPE CShellDispatch::WindowsSecurity()
|
2016-04-08 08:30:09 +00:00
|
|
|
{
|
|
|
|
TRACE("(%p)\n", this);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2016-05-31 17:40:44 +00:00
|
|
|
HRESULT STDMETHODCALLTYPE CShellDispatch::ToggleDesktop()
|
2016-04-08 08:30:09 +00:00
|
|
|
{
|
|
|
|
TRACE("(%p)\n", this);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2016-05-31 17:40:44 +00:00
|
|
|
HRESULT STDMETHODCALLTYPE CShellDispatch::ExplorerPolicy(BSTR policy, VARIANT *value)
|
2016-04-08 08:30:09 +00:00
|
|
|
{
|
|
|
|
TRACE("(%p, %ls, %p)\n", this, policy, value);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2016-05-31 17:40:44 +00:00
|
|
|
HRESULT STDMETHODCALLTYPE CShellDispatch::GetSetting(LONG setting, VARIANT_BOOL *result)
|
2016-04-08 08:30:09 +00:00
|
|
|
{
|
|
|
|
TRACE("(%p, %lu, %p)\n", this, setting, result);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// *** IObjectSafety methods ***
|
2016-05-31 17:40:44 +00:00
|
|
|
HRESULT STDMETHODCALLTYPE CShellDispatch::GetInterfaceSafetyOptions(REFIID riid, DWORD *pdwSupportedOptions, DWORD *pdwEnabledOptions)
|
2016-04-08 08:30:09 +00:00
|
|
|
{
|
|
|
|
TRACE("(%p, %s, %p, %p)\n", this, wine_dbgstr_guid(&riid), pdwSupportedOptions, pdwEnabledOptions);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2016-05-31 17:40:44 +00:00
|
|
|
HRESULT STDMETHODCALLTYPE CShellDispatch::SetInterfaceSafetyOptions(REFIID riid, DWORD dwOptionSetMask, DWORD dwEnabledOptions)
|
2016-04-08 08:30:09 +00:00
|
|
|
{
|
|
|
|
TRACE("(%p, %s, %lu, %lu)\n", this, wine_dbgstr_guid(&riid), dwOptionSetMask, dwEnabledOptions);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// *** IObjectWithSite methods ***
|
2016-05-31 17:40:44 +00:00
|
|
|
HRESULT STDMETHODCALLTYPE CShellDispatch::SetSite(IUnknown *pUnkSite)
|
2016-04-08 08:30:09 +00:00
|
|
|
{
|
|
|
|
TRACE("(%p, %p)\n", this, pUnkSite);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2016-05-31 17:40:44 +00:00
|
|
|
HRESULT STDMETHODCALLTYPE CShellDispatch::GetSite(REFIID riid, PVOID *ppvSite)
|
2016-04-08 08:30:09 +00:00
|
|
|
{
|
|
|
|
TRACE("(%p, %s, %p)\n", this, wine_dbgstr_guid(&riid), ppvSite);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2016-05-31 17:40:44 +00:00
|
|
|
HRESULT WINAPI CShellDispatch_Constructor(REFIID riid, LPVOID * ppvOut)
|
2016-04-11 18:28:31 +00:00
|
|
|
{
|
2016-05-31 17:40:44 +00:00
|
|
|
return ShellObjectCreatorInit<CShellDispatch>(riid, ppvOut);
|
2016-04-11 18:28:31 +00:00
|
|
|
}
|
2016-04-08 08:30:09 +00:00
|
|
|
|