Rebase against 83476e3d4ab0a0c7b1eca392e363591ba550440c.

This commit is contained in:
Zebediah Figura 2024-03-06 17:53:08 -06:00
parent 0b083c6f73
commit 64f5451ac7
3 changed files with 2 additions and 151 deletions

View File

@ -1,150 +0,0 @@
From 81651a2975b37adfbdc393753804fd9d84f43442 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Sat, 2 Apr 2016 04:15:02 +0200
Subject: [PATCH] shell32: Add support for setting/getting PREFERREDDROPEFFECT
in IDataObject.
---
dlls/shell32/clipboard.c | 38 +++++++++++++++++++++++++++++++++++++
dlls/shell32/dataobject.c | 24 ++++++++++++++++++++---
dlls/shell32/shell32_main.h | 2 ++
3 files changed, 61 insertions(+), 3 deletions(-)
diff --git a/dlls/shell32/clipboard.c b/dlls/shell32/clipboard.c
index 487fd0dcf8c..68b671414a6 100644
--- a/dlls/shell32/clipboard.c
+++ b/dlls/shell32/clipboard.c
@@ -212,3 +212,41 @@ HGLOBAL RenderFILENAMEW (LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl)
return hGlobal;
}
+
+HGLOBAL RenderPREFERREDDROPEFFECT (DWORD value)
+{
+ DWORD *pEffect;
+ HGLOBAL hGlobal;
+
+ TRACE("(%ld)\n", value);
+
+ hGlobal = GlobalAlloc(GHND|GMEM_SHARE, sizeof(DWORD));
+ if(!hGlobal) return hGlobal;
+
+ pEffect = GlobalLock(hGlobal);
+ if (pEffect)
+ {
+ *pEffect = value;
+ GlobalUnlock(hGlobal);
+ }
+
+ return hGlobal;
+}
+
+HRESULT GetPREFERREDDROPEFFECT (STGMEDIUM *pmedium, DWORD *value)
+{
+ DWORD *pEffect;
+ BOOL result = E_OUTOFMEMORY;
+
+ TRACE("(%p, %p)\n", pmedium, value);
+
+ pEffect = GlobalLock(pmedium->hGlobal);
+ if (pEffect)
+ {
+ *value = *pEffect;
+ result = S_OK;
+ GlobalUnlock(pmedium->hGlobal);
+ }
+
+ return result;
+}
diff --git a/dlls/shell32/dataobject.c b/dlls/shell32/dataobject.c
index 3cd86845c42..202cd2dc0d1 100644
--- a/dlls/shell32/dataobject.c
+++ b/dlls/shell32/dataobject.c
@@ -193,7 +193,7 @@ LPENUMFORMATETC IEnumFORMATETC_Constructor(UINT cfmt, const FORMATETC afmt[])
*/
/* number of supported formats */
-#define MAX_FORMATS 4
+#define MAX_FORMATS 5
typedef struct
{
@@ -205,12 +205,13 @@ typedef struct
LPITEMIDLIST pidl;
LPITEMIDLIST * apidl;
UINT cidl;
+ DWORD dropEffect;
FORMATETC pFormatEtc[MAX_FORMATS];
UINT cfShellIDList;
UINT cfFileNameA;
UINT cfFileNameW;
-
+ UINT cfDropEffect;
} IDataObjectImpl;
static inline IDataObjectImpl *impl_from_IDataObject(IDataObject *iface)
@@ -310,6 +311,10 @@ static HRESULT WINAPI IDataObject_fnGetData(IDataObject *iface, LPFORMATETC pfor
if (This->cidl < 1) return(E_UNEXPECTED);
pmedium->hGlobal = RenderFILENAMEW(This->pidl, This->apidl, This->cidl);
}
+ else if (pformatetcIn->cfFormat == This->cfDropEffect)
+ {
+ pmedium->hGlobal = RenderPREFERREDDROPEFFECT(This->dropEffect);
+ }
else
{
FIXME("-- expected clipformat not implemented\n");
@@ -364,7 +369,17 @@ static HRESULT WINAPI IDataObject_fnGetCanonicalFormatEtc(IDataObject *iface, LP
static HRESULT WINAPI IDataObject_fnSetData(IDataObject *iface, LPFORMATETC pformatetc, STGMEDIUM *pmedium, BOOL fRelease)
{
IDataObjectImpl *This = impl_from_IDataObject(iface);
- FIXME("(%p)->()\n", This);
+
+ FIXME("(%p)->(%p, %p, %u): semi-stub\n", This, pformatetc, pmedium, fRelease);
+
+ if (pformatetc->cfFormat == This->cfDropEffect)
+ {
+ if (pmedium->tymed == TYMED_HGLOBAL)
+ return GetPREFERREDDROPEFFECT(pmedium, &This->dropEffect);
+ else
+ return DV_E_TYMED;
+ }
+
return E_NOTIMPL;
}
@@ -437,14 +452,17 @@ IDataObject* IDataObject_Constructor(HWND hwndOwner,
dto->pidl = ILClone(pMyPidl);
dto->apidl = _ILCopyaPidl(apidl, cidl);
dto->cidl = cidl;
+ dto->dropEffect = 0;
dto->cfShellIDList = RegisterClipboardFormatW(CFSTR_SHELLIDLISTW);
dto->cfFileNameA = RegisterClipboardFormatA(CFSTR_FILENAMEA);
dto->cfFileNameW = RegisterClipboardFormatW(CFSTR_FILENAMEW);
+ dto->cfDropEffect = RegisterClipboardFormatW(CFSTR_PREFERREDDROPEFFECTW);
InitFormatEtc(dto->pFormatEtc[0], dto->cfShellIDList, TYMED_HGLOBAL);
InitFormatEtc(dto->pFormatEtc[1], CF_HDROP, TYMED_HGLOBAL);
InitFormatEtc(dto->pFormatEtc[2], dto->cfFileNameA, TYMED_HGLOBAL);
InitFormatEtc(dto->pFormatEtc[3], dto->cfFileNameW, TYMED_HGLOBAL);
+ InitFormatEtc(dto->pFormatEtc[4], dto->cfDropEffect, TYMED_HGLOBAL);
}
TRACE("(%p)->(apidl=%p cidl=%u)\n",dto, apidl, cidl);
diff --git a/dlls/shell32/shell32_main.h b/dlls/shell32/shell32_main.h
index 5571da9f632..de6e8dfa9e6 100644
--- a/dlls/shell32/shell32_main.h
+++ b/dlls/shell32/shell32_main.h
@@ -141,6 +141,8 @@ HGLOBAL RenderHDROP(LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl);
HGLOBAL RenderSHELLIDLIST (LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl);
HGLOBAL RenderFILENAMEA (LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl);
HGLOBAL RenderFILENAMEW (LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl);
+HGLOBAL RenderPREFERREDDROPEFFECT (DWORD value);
+HRESULT GetPREFERREDDROPEFFECT (STGMEDIUM *pmedium, DWORD *value);
/* Change Notification */
void InitChangeNotifications(void);
--
2.40.1

View File

@ -5,3 +5,4 @@
# Games used for testing
# Stranded Alien Dawn - Requires dxvk
# DOOM Eternal
Disabled: true

View File

@ -1 +1 @@
c1b8db0c28ac5b7a14567bfb6df2c0af364de6a2
83476e3d4ab0a0c7b1eca392e363591ba550440c