[SHELL32] Add extra information when encountering an unexpected pidl

In addition, make pdump slightly less unusable
This commit is contained in:
Mark Jansen 2022-02-22 19:43:05 +01:00
parent 6a68717c58
commit 6304059721
No known key found for this signature in database
GPG key ID: B39240EE84BEAE8B
4 changed files with 21 additions and 4 deletions

View file

@ -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; LPCITEMIDLIST pidltemp = pidl;
if (!TRACE_ON(pidl)) return;
if (! pidltemp) 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 ) static void dump_pidl_hex( LPCITEMIDLIST pidl )
{ {
const unsigned char *p = (const unsigned char *)pidl; const unsigned char *p = (const unsigned char *)pidl;

View file

@ -22,6 +22,7 @@
#define __WINE_SHELL32_DEBUGHLP_H #define __WINE_SHELL32_DEBUGHLP_H
extern void pdump (LPCITEMIDLIST pidl); extern void pdump (LPCITEMIDLIST pidl);
extern void pdump_always (LPCITEMIDLIST pidl);
extern BOOL pcheck (LPCITEMIDLIST pidl); extern BOOL pcheck (LPCITEMIDLIST pidl);
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C"

View file

@ -40,7 +40,8 @@ static WCHAR* BuildPathsList(LPCWSTR wszBasePath, int cidl, LPCITEMIDLIST *pidls
FileStructW* pDataW = _ILGetFileStructW(pidls[i]); FileStructW* pDataW = _ILGetFileStructW(pidls[i]);
if (!pDataW) if (!pDataW)
{ {
ERR("Got garbage pidl\n"); ERR("Mistreating a pidl:\n");
pdump_always(pidls[i]);
continue; continue;
} }

View file

@ -1410,7 +1410,8 @@ HRESULT WINAPI CFSFolder::SetNameOf(
FileStructW* pDataW = _ILGetFileStructW(pidl); FileStructW* pDataW = _ILGetFileStructW(pidl);
if (!pDataW) if (!pDataW)
{ {
ERR("Got garbage pidl\n"); ERR("Got garbage pidl:\n");
pdump_always(pidl);
return E_INVALIDARG; return E_INVALIDARG;
} }
@ -1778,6 +1779,7 @@ HRESULT CFSFolder::_CreateShellExtInstance(const CLSID *pclsid, LPCITEMIDLIST pi
if (!pDataW) if (!pDataW)
{ {
ERR("Got garbage pidl\n"); ERR("Got garbage pidl\n");
pdump_always(pidl);
return E_INVALIDARG; return E_INVALIDARG;
} }