Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Add stubs for the shell dispatch object, CShell, and its relatives. Patch by Mark Jansen. [SHELL32_WINETEST] - We no longer need to skip test_ParseName and test_Verbs thanks to Mark's work. CORE-6892 ROSTESTS-209 svn path=/trunk/; revision=71116
- Loading branch information
Showing
15 changed files
with
1,393 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,186 @@ | ||
/* | ||
* Folder 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); | ||
|
||
|
||
CFolder::CFolder() | ||
{ | ||
} | ||
|
||
CFolder::~CFolder() | ||
{ | ||
} | ||
|
||
void CFolder::Init(LPITEMIDLIST idlist) | ||
{ | ||
m_idlist.Attach(idlist); | ||
} | ||
|
||
// *** IDispatch methods *** | ||
HRESULT STDMETHODCALLTYPE CFolder::GetTypeInfoCount(UINT *pctinfo) | ||
{ | ||
TRACE("(%p, %p)\n", this, pctinfo); | ||
return E_NOTIMPL; | ||
} | ||
|
||
HRESULT STDMETHODCALLTYPE CFolder::GetTypeInfo(UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo) | ||
{ | ||
TRACE("(%p, %lu, %lu, %p)\n", this, iTInfo, lcid, ppTInfo); | ||
return E_NOTIMPL; | ||
} | ||
|
||
HRESULT STDMETHODCALLTYPE CFolder::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 CFolder::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; | ||
} | ||
|
||
|
||
// *** Folder methods *** | ||
HRESULT STDMETHODCALLTYPE CFolder::get_Title(BSTR *pbs) | ||
{ | ||
TRACE("(%p, %p)\n", this, pbs); | ||
return E_NOTIMPL; | ||
} | ||
|
||
HRESULT STDMETHODCALLTYPE CFolder::get_Application(IDispatch **ppid) | ||
{ | ||
TRACE("(%p, %p)\n", this, ppid); | ||
return E_NOTIMPL; | ||
} | ||
|
||
HRESULT STDMETHODCALLTYPE CFolder::get_Parent(IDispatch **ppid) | ||
{ | ||
TRACE("(%p %p)\n", this, ppid); | ||
return E_NOTIMPL; | ||
} | ||
|
||
HRESULT STDMETHODCALLTYPE CFolder::get_ParentFolder(Folder **ppsf) | ||
{ | ||
TRACE("(%p, %p)\n", this); | ||
return E_NOTIMPL; | ||
} | ||
|
||
HRESULT STDMETHODCALLTYPE CFolder::Items(FolderItems **ppid) | ||
{ | ||
TRACE("(%p, %p)\n", this, ppid); | ||
return E_NOTIMPL; | ||
} | ||
|
||
HRESULT STDMETHODCALLTYPE CFolder::ParseName(BSTR bName, FolderItem **ppid) | ||
{ | ||
TRACE("(%p, %s, %p)\n", this, wine_dbgstr_w(bName), ppid); | ||
|
||
CComPtr<IShellFolder> psfDesktop; | ||
|
||
HRESULT hr = SHGetDesktopFolder(&psfDesktop); | ||
if (FAILED_UNEXPECTEDLY(hr)) | ||
return hr; | ||
|
||
CComPtr<IShellFolder> psfCurrent; | ||
hr = psfDesktop->BindToObject(m_idlist, NULL, IID_PPV_ARG(IShellFolder, &psfCurrent)); | ||
if (FAILED_UNEXPECTEDLY(hr)) | ||
return hr; | ||
|
||
CComHeapPtr<ITEMIDLIST_RELATIVE> relativePidl; | ||
hr = psfCurrent->ParseDisplayName(NULL, NULL, bName, NULL, &relativePidl, NULL); | ||
if (!SUCCEEDED(hr)) | ||
return S_FALSE; | ||
|
||
CFolderItem* item = new CComObject<CFolderItem>(); | ||
item->AddRef(); | ||
item->Init(ILCombine(m_idlist, relativePidl)); | ||
*ppid = item; | ||
return S_OK; | ||
} | ||
|
||
HRESULT STDMETHODCALLTYPE CFolder::NewFolder(BSTR bName, VARIANT vOptions) | ||
{ | ||
TRACE("(%p, %s, %s)\n", this, wine_dbgstr_w(bName), wine_dbgstr_variant(&vOptions)); | ||
return E_NOTIMPL; | ||
} | ||
|
||
HRESULT STDMETHODCALLTYPE CFolder::MoveHere(VARIANT vItem, VARIANT vOptions) | ||
{ | ||
TRACE("(%p, %s, %s)\n", this, wine_dbgstr_variant(&vItem), wine_dbgstr_variant(&vOptions)); | ||
return E_NOTIMPL; | ||
} | ||
|
||
HRESULT STDMETHODCALLTYPE CFolder::CopyHere(VARIANT vItem, VARIANT vOptions) | ||
{ | ||
TRACE("(%p, %s, %s)\n", this, wine_dbgstr_variant(&vItem), wine_dbgstr_variant(&vOptions)); | ||
return E_NOTIMPL; | ||
} | ||
|
||
HRESULT STDMETHODCALLTYPE CFolder::GetDetailsOf(VARIANT vItem, int iColumn, BSTR *pbs) | ||
{ | ||
TRACE("(%p, %s, %i, %p)\n", this, wine_dbgstr_variant(&vItem), iColumn, pbs); | ||
return E_NOTIMPL; | ||
} | ||
|
||
|
||
// *** Folder2 methods *** | ||
HRESULT STDMETHODCALLTYPE CFolder::get_Self(FolderItem **ppfi) | ||
{ | ||
TRACE("(%p, %p)\n", this, ppfi); | ||
if (!ppfi) | ||
return E_POINTER; | ||
CFolderItem* item = new CComObject<CFolderItem>(); | ||
item->AddRef(); | ||
item->Init(ILClone(m_idlist)); | ||
*ppfi = item; | ||
return S_OK; | ||
} | ||
|
||
HRESULT STDMETHODCALLTYPE CFolder::get_OfflineStatus(LONG *pul) | ||
{ | ||
TRACE("(%p, %p)\n", this, pul); | ||
return E_NOTIMPL; | ||
} | ||
|
||
HRESULT STDMETHODCALLTYPE CFolder::Synchronize() | ||
{ | ||
TRACE("(%p)\n", this); | ||
return E_NOTIMPL; | ||
} | ||
|
||
HRESULT STDMETHODCALLTYPE CFolder::get_HaveToShowWebViewBarricade(VARIANT_BOOL *pbHaveToShowWebViewBarricade) | ||
{ | ||
TRACE("(%p, %p)\n", this, pbHaveToShowWebViewBarricade); | ||
return E_NOTIMPL; | ||
} | ||
|
||
HRESULT STDMETHODCALLTYPE CFolder::DismissedWebViewBarricade() | ||
{ | ||
TRACE("(%p)\n", this); | ||
return E_NOTIMPL; | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
/* | ||
* Folder 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 _FOLDER_H_ | ||
#define _FOLDER_H_ | ||
|
||
|
||
class CFolder: | ||
public CComCoClass<CFolder>, | ||
public CComObjectRootEx<CComMultiThreadModelNoCS>, | ||
public Folder2 | ||
{ | ||
private: | ||
CComHeapPtr<ITEMIDLIST> m_idlist; | ||
|
||
public: | ||
CFolder(); | ||
~CFolder(); | ||
|
||
void Init(LPITEMIDLIST idlist); | ||
|
||
// *** 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); | ||
|
||
|
||
// *** Folder methods *** | ||
virtual HRESULT STDMETHODCALLTYPE get_Title(BSTR *pbs); | ||
virtual HRESULT STDMETHODCALLTYPE get_Application(IDispatch **ppid); | ||
virtual HRESULT STDMETHODCALLTYPE get_Parent(IDispatch **ppid); | ||
virtual HRESULT STDMETHODCALLTYPE get_ParentFolder(Folder **ppsf); | ||
virtual HRESULT STDMETHODCALLTYPE Items(FolderItems **ppid); | ||
virtual HRESULT STDMETHODCALLTYPE ParseName(BSTR bName, FolderItem **ppid); | ||
virtual HRESULT STDMETHODCALLTYPE NewFolder(BSTR bName, VARIANT vOptions); | ||
virtual HRESULT STDMETHODCALLTYPE MoveHere(VARIANT vItem, VARIANT vOptions); | ||
virtual HRESULT STDMETHODCALLTYPE CopyHere(VARIANT vItem, VARIANT vOptions); | ||
virtual HRESULT STDMETHODCALLTYPE GetDetailsOf(VARIANT vItem, int iColumn, BSTR *pbs); | ||
|
||
// *** Folder2 methods *** | ||
virtual HRESULT STDMETHODCALLTYPE get_Self(FolderItem **ppfi); | ||
virtual HRESULT STDMETHODCALLTYPE get_OfflineStatus(LONG *pul); | ||
virtual HRESULT STDMETHODCALLTYPE Synchronize(); | ||
virtual HRESULT STDMETHODCALLTYPE get_HaveToShowWebViewBarricade(VARIANT_BOOL *pbHaveToShowWebViewBarricade); | ||
virtual HRESULT STDMETHODCALLTYPE DismissedWebViewBarricade(); | ||
|
||
DECLARE_NOT_AGGREGATABLE(CFolder) | ||
DECLARE_PROTECT_FINAL_CONSTRUCT() | ||
|
||
BEGIN_COM_MAP(CFolder) | ||
COM_INTERFACE_ENTRY_IID(IID_Folder2, Folder2) | ||
COM_INTERFACE_ENTRY_IID(IID_Folder, Folder) | ||
COM_INTERFACE_ENTRY_IID(IID_IDispatch, IDispatch) | ||
END_COM_MAP() | ||
|
||
}; | ||
|
||
|
||
#endif |
Oops, something went wrong.