Commit e69c663c authored by Vincent Povirk's avatar Vincent Povirk Committed by Alexandre Julliard

shell32: Add stub implementation of IShellItem.

parent 66258ccc
...@@ -29,6 +29,7 @@ C_SRCS = \ ...@@ -29,6 +29,7 @@ C_SRCS = \
recyclebin.c \ recyclebin.c \
regsvr.c \ regsvr.c \
shell32_main.c \ shell32_main.c \
shellitem.c \
shelllink.c \ shelllink.c \
shellole.c \ shellole.c \
shellord.c \ shellord.c \
......
...@@ -85,6 +85,7 @@ IContextMenu2 * ISvBgCm_Constructor(LPSHELLFOLDER pSFParent, BOOL bDesktop); ...@@ -85,6 +85,7 @@ IContextMenu2 * ISvBgCm_Constructor(LPSHELLFOLDER pSFParent, BOOL bDesktop);
LPSHELLVIEW IShellView_Constructor(LPSHELLFOLDER); LPSHELLVIEW IShellView_Constructor(LPSHELLFOLDER);
HRESULT WINAPI IFSFolder_Constructor(IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv); HRESULT WINAPI IFSFolder_Constructor(IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv);
HRESULT WINAPI IShellItem_Constructor(IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv);
HRESULT WINAPI IShellLink_Constructor(IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv); HRESULT WINAPI IShellLink_Constructor(IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv);
HRESULT WINAPI IShellLink_ConstructFromFile(IUnknown * pUnkOuter, REFIID riid, LPCITEMIDLIST pidl, LPVOID * ppv); HRESULT WINAPI IShellLink_ConstructFromFile(IUnknown * pUnkOuter, REFIID riid, LPCITEMIDLIST pidl, LPVOID * ppv);
HRESULT WINAPI ISF_Desktop_Constructor(IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv); HRESULT WINAPI ISF_Desktop_Constructor(IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv);
......
/*
* IShellItem implementation
*
* Copyright 2008 Vincent Povirk for CodeWeavers
*
* 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 "config.h"
#include "wine/port.h"
#include <stdio.h>
#include <stdarg.h>
#define COBJMACROS
#define NONAMELESSUNION
#define NONAMELESSSTRUCT
#include "windef.h"
#include "winbase.h"
#include "wine/debug.h"
#include "pidl.h"
#include "shell32_main.h"
#include "debughlp.h"
WINE_DEFAULT_DEBUG_CHANNEL(shell);
typedef struct _ShellItem {
const IShellItemVtbl *lpIShellItemVtbl;
LONG ref;
LPITEMIDLIST pidl;
} ShellItem;
static HRESULT WINAPI ShellItem_QueryInterface(IShellItem *iface, REFIID riid,
void **ppv)
{
ShellItem *This = (ShellItem*)iface;
TRACE("(%p,%p,%p)\n", iface, riid, ppv);
if (!ppv) return E_INVALIDARG;
if (IsEqualIID(&IID_IUnknown, riid) || IsEqualIID(&IID_IShellItem, riid))
{
*ppv = This;
}
else {
FIXME("not implemented for %s\n", shdebugstr_guid(riid));
*ppv = NULL;
return E_NOINTERFACE;
}
IUnknown_AddRef((IUnknown*)*ppv);
return S_OK;
}
static ULONG WINAPI ShellItem_AddRef(IShellItem *iface)
{
ShellItem *This = (ShellItem*)iface;
ULONG ref = InterlockedIncrement(&This->ref);
TRACE("(%p), new refcount=%i\n", iface, ref);
return ref;
}
static ULONG WINAPI ShellItem_Release(IShellItem *iface)
{
ShellItem *This = (ShellItem*)iface;
ULONG ref = InterlockedDecrement(&This->ref);
TRACE("(%p), new refcount=%i\n", iface, ref);
if (ref == 0)
{
ILFree(This->pidl);
HeapFree(GetProcessHeap(), 0, This);
}
return ref;
}
static HRESULT WINAPI ShellItem_BindToHandler(IShellItem *iface, IBindCtx *pbc,
REFGUID rbhid, REFIID riid, void **ppvOut)
{
FIXME("(%p,%p,%s,%p,%p)\n", iface, pbc, shdebugstr_guid(rbhid), riid, ppvOut);
*ppvOut = NULL;
return E_NOTIMPL;
}
static HRESULT WINAPI ShellItem_GetParent(IShellItem *iface, IShellItem **ppsi)
{
FIXME("(%p,%p)\n", iface, ppsi);
*ppsi = NULL;
return E_NOTIMPL;
}
static HRESULT WINAPI ShellItem_GetDisplayName(IShellItem *iface, SIGDN sigdnName,
LPWSTR *ppszName)
{
FIXME("(%p,%x,%p)\n", iface, sigdnName, ppszName);
*ppszName = NULL;
return E_NOTIMPL;
}
static HRESULT WINAPI ShellItem_GetAttributes(IShellItem *iface, SFGAOF sfgaoMask,
SFGAOF *psfgaoAttribs)
{
FIXME("(%p,%x,%p)\n", iface, sfgaoMask, psfgaoAttribs);
*psfgaoAttribs = 0;
return E_NOTIMPL;
}
static HRESULT WINAPI ShellItem_Compare(IShellItem *iface, IShellItem *oth,
SICHINTF hint, int *piOrder)
{
FIXME("(%p,%p,%x,%p)\n", iface, oth, hint, piOrder);
return E_NOTIMPL;
}
static const IShellItemVtbl ShellItem_Vtbl = {
ShellItem_QueryInterface,
ShellItem_AddRef,
ShellItem_Release,
ShellItem_BindToHandler,
ShellItem_GetParent,
ShellItem_GetDisplayName,
ShellItem_GetAttributes,
ShellItem_Compare
};
HRESULT WINAPI IShellItem_Constructor(IUnknown *pUnkOuter, REFIID riid, void **ppv)
{
ShellItem *This;
HRESULT ret;
TRACE("(%p,%s)\n",pUnkOuter, debugstr_guid(riid));
*ppv = NULL;
if (pUnkOuter) return CLASS_E_NOAGGREGATION;
This = HeapAlloc(GetProcessHeap(), 0, sizeof(ShellItem));
This->lpIShellItemVtbl = &ShellItem_Vtbl;
This->ref = 1;
This->pidl = NULL;
ret = ShellItem_QueryInterface((IShellItem*)This, riid, ppv);
ShellItem_Release((IShellItem*)This);
return ret;
}
...@@ -64,6 +64,7 @@ static const struct { ...@@ -64,6 +64,7 @@ static const struct {
{&CLSID_MyComputer, ISF_MyComputer_Constructor}, {&CLSID_MyComputer, ISF_MyComputer_Constructor},
{&CLSID_NetworkPlaces, ISF_NetworkPlaces_Constructor}, {&CLSID_NetworkPlaces, ISF_NetworkPlaces_Constructor},
{&CLSID_ShellDesktop, ISF_Desktop_Constructor}, {&CLSID_ShellDesktop, ISF_Desktop_Constructor},
{&CLSID_ShellItem, IShellItem_Constructor},
{&CLSID_ShellLink, IShellLink_Constructor}, {&CLSID_ShellLink, IShellLink_Constructor},
{&CLSID_DragDropHelper, IDropTargetHelper_Constructor}, {&CLSID_DragDropHelper, IDropTargetHelper_Constructor},
{&CLSID_ControlPanel, IControlPanel_Constructor}, {&CLSID_ControlPanel, IControlPanel_Constructor},
......
...@@ -131,6 +131,8 @@ DEFINE_GUID(CLSID_ACListISF, 0x03c036f1, 0xa186, 0x11d0, 0x82, 0x4a, 0x00, ...@@ -131,6 +131,8 @@ DEFINE_GUID(CLSID_ACListISF, 0x03c036f1, 0xa186, 0x11d0, 0x82, 0x4a, 0x00,
DEFINE_GUID(CLSID_ProgressDialog, 0xf8383852, 0xfcd3, 0x11d1, 0xa6, 0xb9, 0x0, 0x60, 0x97, 0xdf, 0x5b, 0xd4); DEFINE_GUID(CLSID_ProgressDialog, 0xf8383852, 0xfcd3, 0x11d1, 0xa6, 0xb9, 0x0, 0x60, 0x97, 0xdf, 0x5b, 0xd4);
DEFINE_GUID(CLSID_ShellItem, 0x2fe352ea, 0xfd1f, 0x11d2, 0xb1, 0xf4, 0x00, 0xc0, 0x4f, 0x8e, 0xeb, 0x3e);
#define PSGUID_SHELLDETAILS {0x28636aa6, 0x953d, 0x11d2, 0xb5, 0xd6, 0x0, 0xc0, 0x4f, 0xd9, 0x18, 0xd0} #define PSGUID_SHELLDETAILS {0x28636aa6, 0x953d, 0x11d2, 0xb5, 0xd6, 0x0, 0xc0, 0x4f, 0xd9, 0x18, 0xd0}
DEFINE_GUID(FMTID_ShellDetails, 0x28636aa6, 0x953d, 0x11d2, 0xb5, 0xd6, 0x0, 0xc0, 0x4f, 0xd9, 0x18, 0xd0); DEFINE_GUID(FMTID_ShellDetails, 0x28636aa6, 0x953d, 0x11d2, 0xb5, 0xd6, 0x0, 0xc0, 0x4f, 0xd9, 0x18, 0xd0);
#define PID_FINDDATA 0 #define PID_FINDDATA 0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment