https://git.reactos.org/?p=reactos.git;a=commitdiff;h=630405972140642e054eb…
commit 630405972140642e054eb3cb16fc8be64ab777d9
Author: Mark Jansen <mark.jansen(a)reactos.org>
AuthorDate: Tue Feb 22 19:43:05 2022 +0100
Commit: Mark Jansen <mark.jansen(a)reactos.org>
CommitDate: Tue Feb 22 19:43:05 2022 +0100
[SHELL32] Add extra information when encountering an unexpected pidl
In addition, make pdump slightly less unusable
---
dll/win32/shell32/debughlp.cpp | 17 +++++++++++++++--
dll/win32/shell32/debughlp.h | 1 +
dll/win32/shell32/droptargets/CFSDropTarget.cpp | 3 ++-
dll/win32/shell32/folders/CFSFolder.cpp | 4 +++-
4 files changed, 21 insertions(+), 4 deletions(-)
diff --git a/dll/win32/shell32/debughlp.cpp b/dll/win32/shell32/debughlp.cpp
index 47cc2cea525..6778418c7a8 100644
--- a/dll/win32/shell32/debughlp.cpp
+++ b/dll/win32/shell32/debughlp.cpp
@@ -245,11 +245,10 @@ void _dbg_ILSimpleGetText (LPCITEMIDLIST pidl, LPSTR szOut, UINT
uOutSize)
-void pdump (LPCITEMIDLIST pidl)
+static void pdump_impl (LPCITEMIDLIST pidl)
{
LPCITEMIDLIST pidltemp = pidl;
- if (!TRACE_ON(pidl)) return;
if (! pidltemp)
{
@@ -309,6 +308,20 @@ void pdump (LPCITEMIDLIST pidl)
}
}
+void pdump(LPCITEMIDLIST pidl)
+{
+ if (!TRACE_ON(pidl)) return;
+
+ return pdump_impl(pidl);
+}
+
+
+void pdump_always(LPCITEMIDLIST pidl)
+{
+ pdump_impl(pidl);
+}
+
+
static void dump_pidl_hex( LPCITEMIDLIST pidl )
{
const unsigned char *p = (const unsigned char *)pidl;
diff --git a/dll/win32/shell32/debughlp.h b/dll/win32/shell32/debughlp.h
index 547bf4985db..170650c946c 100644
--- a/dll/win32/shell32/debughlp.h
+++ b/dll/win32/shell32/debughlp.h
@@ -22,6 +22,7 @@
#define __WINE_SHELL32_DEBUGHLP_H
extern void pdump (LPCITEMIDLIST pidl);
+extern void pdump_always (LPCITEMIDLIST pidl);
extern BOOL pcheck (LPCITEMIDLIST pidl);
#ifdef __cplusplus
extern "C"
diff --git a/dll/win32/shell32/droptargets/CFSDropTarget.cpp
b/dll/win32/shell32/droptargets/CFSDropTarget.cpp
index 14d1d20a67d..19438fa51dd 100644
--- a/dll/win32/shell32/droptargets/CFSDropTarget.cpp
+++ b/dll/win32/shell32/droptargets/CFSDropTarget.cpp
@@ -40,7 +40,8 @@ static WCHAR* BuildPathsList(LPCWSTR wszBasePath, int cidl,
LPCITEMIDLIST *pidls
FileStructW* pDataW = _ILGetFileStructW(pidls[i]);
if (!pDataW)
{
- ERR("Got garbage pidl\n");
+ ERR("Mistreating a pidl:\n");
+ pdump_always(pidls[i]);
continue;
}
diff --git a/dll/win32/shell32/folders/CFSFolder.cpp
b/dll/win32/shell32/folders/CFSFolder.cpp
index c332d812d3a..f6aaa4efce2 100644
--- a/dll/win32/shell32/folders/CFSFolder.cpp
+++ b/dll/win32/shell32/folders/CFSFolder.cpp
@@ -1410,7 +1410,8 @@ HRESULT WINAPI CFSFolder::SetNameOf(
FileStructW* pDataW = _ILGetFileStructW(pidl);
if (!pDataW)
{
- ERR("Got garbage pidl\n");
+ ERR("Got garbage pidl:\n");
+ pdump_always(pidl);
return E_INVALIDARG;
}
@@ -1778,6 +1779,7 @@ HRESULT CFSFolder::_CreateShellExtInstance(const CLSID *pclsid,
LPCITEMIDLIST pi
if (!pDataW)
{
ERR("Got garbage pidl\n");
+ pdump_always(pidl);
return E_INVALIDARG;
}