https://git.reactos.org/?p=reactos.git;a=commitdiff;h=8f129932dd5fdaa2c6eeb…
commit 8f129932dd5fdaa2c6eebac96f2f2f95bd3d2b1b
Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
AuthorDate: Fri Nov 15 18:02:06 2019 +0900
Commit: GitHub <noreply(a)github.com>
CommitDate: Fri Nov 15 18:02:06 2019 +0900
[SHELL32] Simply return S_OK if *pdwEffect is none (#2039)
IDropTarget::DragEnter must simply return S_OK if *pdwEffect == DROPEFFECT_NONE.
CORE-11238
---
dll/win32/shell32/CDefView.cpp | 3 +++
dll/win32/shell32/CShellLink.cpp | 4 ++++
dll/win32/shell32/droptargets/CFSDropTarget.cpp | 4 ++++
dll/win32/shell32/droptargets/CexeDropHandler.cpp | 3 +++
4 files changed, 14 insertions(+)
diff --git a/dll/win32/shell32/CDefView.cpp b/dll/win32/shell32/CDefView.cpp
index 51bd3dadcaf..66a77b608db 100644
--- a/dll/win32/shell32/CDefView.cpp
+++ b/dll/win32/shell32/CDefView.cpp
@@ -3186,6 +3186,9 @@ HRESULT CDefView::drag_notify_subitem(DWORD grfKeyState, POINTL pt,
DWORD *pdwEf
HRESULT WINAPI CDefView::DragEnter(IDataObject *pDataObject, DWORD grfKeyState, POINTL
pt, DWORD *pdwEffect)
{
+ if (*pdwEffect == DROPEFFECT_NONE)
+ return S_OK;
+
/* Get a hold on the data object for later calls to DragEnter on the sub-folders */
m_pCurDataObject = pDataObject;
diff --git a/dll/win32/shell32/CShellLink.cpp b/dll/win32/shell32/CShellLink.cpp
index 8883e801c69..90f2140a9c5 100644
--- a/dll/win32/shell32/CShellLink.cpp
+++ b/dll/win32/shell32/CShellLink.cpp
@@ -3107,6 +3107,10 @@ HRESULT STDMETHODCALLTYPE CShellLink::DragEnter(IDataObject
*pDataObject,
DWORD dwKeyState, POINTL pt, DWORD *pdwEffect)
{
TRACE("(%p)->(DataObject=%p)\n", this, pDataObject);
+
+ if (*pdwEffect == DROPEFFECT_NONE)
+ return S_OK;
+
LPCITEMIDLIST pidlLast;
CComPtr<IShellFolder> psf;
diff --git a/dll/win32/shell32/droptargets/CFSDropTarget.cpp
b/dll/win32/shell32/droptargets/CFSDropTarget.cpp
index 641770b37ae..bdf65e1fcc5 100644
--- a/dll/win32/shell32/droptargets/CFSDropTarget.cpp
+++ b/dll/win32/shell32/droptargets/CFSDropTarget.cpp
@@ -283,6 +283,10 @@ HRESULT WINAPI CFSDropTarget::DragEnter(IDataObject *pDataObject,
DWORD dwKeyState, POINTL pt, DWORD *pdwEffect)
{
TRACE("(%p)->(DataObject=%p)\n", this, pDataObject);
+
+ if (*pdwEffect == DROPEFFECT_NONE)
+ return S_OK;
+
FORMATETC fmt;
FORMATETC fmt2;
m_fAcceptFmt = FALSE;
diff --git a/dll/win32/shell32/droptargets/CexeDropHandler.cpp
b/dll/win32/shell32/droptargets/CexeDropHandler.cpp
index 83f9723e631..0d0d86ea8a0 100644
--- a/dll/win32/shell32/droptargets/CexeDropHandler.cpp
+++ b/dll/win32/shell32/droptargets/CexeDropHandler.cpp
@@ -36,6 +36,9 @@ CExeDropHandler::~CExeDropHandler()
HRESULT WINAPI CExeDropHandler::DragEnter(IDataObject *pDataObject, DWORD dwKeyState,
POINTL pt, DWORD *pdwEffect)
{
TRACE ("(%p)\n", this);
+ if (*pdwEffect == DROPEFFECT_NONE)
+ return S_OK;
+
*pdwEffect = DROPEFFECT_COPY;
return S_OK;
}