On 05.07.2016 8:47, Alex Henrie wrote:
Cc: Christian Costa titan.costa@gmail.com Cc: Sebastian Lackner sebastian@fds-team.de
Wine Staging has included a similar patch since 1.7.51, however this patch is not based on theirs.
FolderItems2 worked in Windows 2000, but it was removed when FolderItems3 was introduced in Windows XP. However, it doesn't hurt us to provide this interface anyway for any old applications that might want it.
Signed-off-by: Alex Henrie alexhenrie24@gmail.com
dlls/shell32/shell32_main.h | 1 + dlls/shell32/shelldispatch.c | 207 ++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 206 insertions(+), 2 deletions(-)
diff --git a/dlls/shell32/shell32_main.h b/dlls/shell32/shell32_main.h index 492f79f..64a26bb 100644 --- a/dlls/shell32/shell32_main.h +++ b/dlls/shell32/shell32_main.h @@ -234,6 +234,7 @@ enum tid_t { IShellDispatch6_tid, IShellFolderViewDual3_tid, Folder3_tid,
- FolderItems3_tid, FolderItem2_tid, FolderItemVerb_tid, FolderItemVerbs_tid,
That's not going to work, you have to update tid_ids[] too. Also please keep it sorted.
diff --git a/dlls/shell32/shelldispatch.c b/dlls/shell32/shelldispatch.c index 6dece6d..3661430 100644 --- a/dlls/shell32/shelldispatch.c +++ b/dlls/shell32/shelldispatch.c @@ -65,6 +65,11 @@ typedef struct { } FolderImpl;
typedef struct {
- FolderItems3 FolderItems3_iface;
- LONG ref;
+} FolderItemsImpl;
+typedef struct { FolderItem2 FolderItem2_iface; LONG ref; VARIANT dir; @@ -97,6 +102,11 @@ static inline FolderImpl *impl_from_Folder(Folder3 *iface) return CONTAINING_RECORD(iface, FolderImpl, Folder3_iface); }
+static inline FolderItemsImpl *impl_from_FolderItems(FolderItems3 *iface) +{
- return CONTAINING_RECORD(iface, FolderItemsImpl, FolderItems3_iface);
+}
static inline FolderItemImpl *impl_from_FolderItem(FolderItem2 *iface) { return CONTAINING_RECORD(iface, FolderItemImpl, FolderItem2_iface); @@ -939,6 +949,200 @@ static HRESULT FolderItem_Constructor(VARIANT *dir, FolderItem **ppfi) return ret; }
+static HRESULT WINAPI FolderItemsImpl_QueryInterface(FolderItems3 *iface,
REFIID riid, LPVOID *ppv)
+{
- FolderItemsImpl *This = impl_from_FolderItems(iface);
- TRACE("(%p,%p,%p)\n", iface, riid, ppv);
Usually we trace riid.
- if (!ppv) return E_INVALIDARG;
This is unusual, do we have a test for that?