https://git.reactos.org/?p=reactos.git;a=commitdiff;h=eba16dc9e92886e74eb73…
commit eba16dc9e92886e74eb73ca9ebb90378a62e9d5a
Author: Mark Jansen <mark.jansen(a)reactos.org>
AuthorDate: Sun Jul 25 01:08:35 2021 +0200
Commit: Mark Jansen <mark.jansen(a)reactos.org>
CommitDate: Mon Nov 15 20:02:13 2021 +0100
[MYDOCS] Simplify HIDA usage
---
dll/shellext/mydocs/CMyDocsDropHandler.cpp | 19 +++----------------
1 file changed, 3 insertions(+), 16 deletions(-)
diff --git a/dll/shellext/mydocs/CMyDocsDropHandler.cpp
b/dll/shellext/mydocs/CMyDocsDropHandler.cpp
index 477ca4b1d7f..92653e4c6d4 100644
--- a/dll/shellext/mydocs/CMyDocsDropHandler.cpp
+++ b/dll/shellext/mydocs/CMyDocsDropHandler.cpp
@@ -9,8 +9,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(mydocs);
-static CLIPFORMAT g_cfHIDA = 0;
-
CMyDocsDropHandler::CMyDocsDropHandler()
{
InterlockedIncrement(&g_ModuleRefCnt);
@@ -68,23 +66,15 @@ CMyDocsDropHandler::Drop(IDataObject *pDataObject, DWORD dwKeyState,
if (FAILED_UNEXPECTEDLY(hr))
return hr;
- // get the clipboard format
- if (g_cfHIDA == 0)
- g_cfHIDA = ::RegisterClipboardFormatW(CFSTR_SHELLIDLIST);
-
// Retrieve an HIDA (handle of IDA)
- STGMEDIUM medium;
- FORMATETC fmt = { g_cfHIDA, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL };
- hr = pDataObject->GetData(&fmt, &medium);
- if (FAILED_UNEXPECTEDLY(hr))
+ CDataObjectHIDA pida(pDataObject);
+ if (FAILED_UNEXPECTEDLY(pida.hr()))
{
*pdwEffect = 0;
DragLeave();
- return E_FAIL;
+ return pida.hr();
}
- // lock HIDA
- LPIDA pida = reinterpret_cast<LPIDA>(GlobalLock(medium.hGlobal));
UINT iItem, cItems = pida->cidl;
// get the path of "My Documents"
@@ -123,9 +113,6 @@ CMyDocsDropHandler::Drop(IDataObject *pDataObject, DWORD dwKeyState,
strSrcList += szSrc;
}
- // unlock HIDA
- GlobalUnlock(medium.hGlobal);
-
if (iItem != cItems)
{
// source not found