https://git.reactos.org/?p=reactos.git;a=commitdiff;h=cc0e2a3672653da009dc6…
commit cc0e2a3672653da009dc6757c233c0395e32ba66
Author: Doug Lyons <douglyons(a)douglyons.com>
AuthorDate: Thu May 5 10:30:06 2022 -0500
Commit: GitHub <noreply(a)github.com>
CommitDate: Thu May 5 17:30:06 2022 +0200
[SHELL32] Fix Shift-Delete to Permanently Delete Files and Folders (#4004)
CORE-17802
---
dll/win32/shell32/CDefaultContextMenu.cpp | 3 ++-
dll/win32/shell32/droptargets/CRecyclerDropTarget.cpp | 6 ++----
2 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/dll/win32/shell32/CDefaultContextMenu.cpp
b/dll/win32/shell32/CDefaultContextMenu.cpp
index 62740118a6c..6bddfafcb35 100644
--- a/dll/win32/shell32/CDefaultContextMenu.cpp
+++ b/dll/win32/shell32/CDefaultContextMenu.cpp
@@ -779,7 +779,8 @@ HRESULT CDefaultContextMenu::DoDelete(LPCMINVOKECOMMANDINFO lpcmi)
if (FAILED_UNEXPECTEDLY(hr))
return hr;
- SHSimulateDrop(pDT, m_pDataObj, 0, NULL, NULL);
+ DWORD grfKeyState = (lpcmi->fMask & CMIC_MASK_SHIFT_DOWN) ? MK_SHIFT : 0;
+ SHSimulateDrop(pDT, m_pDataObj, grfKeyState, NULL, NULL);
return S_OK;
}
diff --git a/dll/win32/shell32/droptargets/CRecyclerDropTarget.cpp
b/dll/win32/shell32/droptargets/CRecyclerDropTarget.cpp
index efd446d5cfa..a29ec1e1c88 100644
--- a/dll/win32/shell32/droptargets/CRecyclerDropTarget.cpp
+++ b/dll/win32/shell32/droptargets/CRecyclerDropTarget.cpp
@@ -140,12 +140,10 @@ class CRecyclerDropTarget :
}
HRESULT WINAPI Drop(IDataObject *pDataObject,
- DWORD dwKeyState, POINTL pt, DWORD *pdwEffect)
+ DWORD grfKeyState, POINTL pt, DWORD *pdwEffect)
{
TRACE("(%p) object dropped on recycle bin, effect %u\n", this,
*pdwEffect);
- /* TODO: pdwEffect should be read and make the drop object be permanently
deleted in the move case (shift held) */
-
FORMATETC fmt;
TRACE("(%p)->(DataObject=%p)\n", this, pDataObject);
InitFormatEtc (fmt, cfShellIDList, TYMED_HGLOBAL);
@@ -155,7 +153,7 @@ class CRecyclerDropTarget :
{
DWORD fMask = 0;
- if ((dwKeyState & MK_SHIFT) == MK_SHIFT)
+ if ((grfKeyState & MK_SHIFT) == MK_SHIFT)
fMask |= CMIC_MASK_SHIFT_DOWN;
_DoDeleteAsync(pDataObject, fMask);