Author: hpoussin Date: Thu Oct 25 14:28:19 2007 New Revision: 29872
URL: http://svn.reactos.org/svn/reactos?rev=29872&view=rev Log: Add traces Do not crash in IExtractIconW::GetIconLocation if out pointers are NULL
Modified: trunk/reactos/dll/win32/shell32/extracticon.c
Modified: trunk/reactos/dll/win32/shell32/extracticon.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/extractic... ============================================================================== --- trunk/reactos/dll/win32/shell32/extracticon.c (original) +++ trunk/reactos/dll/win32/shell32/extracticon.c Thu Oct 25 14:28:19 2007 @@ -12,6 +12,8 @@ #include <shlobj.h> #include <debug.h>
+WINE_DEFAULT_DEBUG_CHANNEL(shell); + struct IconLocation { LPWSTR file; @@ -57,6 +59,8 @@ void **ppvObject) { struct IconExtraction *s = CONTAINING_RECORD(This, struct IconExtraction, defaultExtractIconInitImpl); + + TRACE("(%p, %s, %p)\n", This, debugstr_guid(riid), ppvObject);
if (!ppvObject) return E_POINTER; @@ -89,6 +93,7 @@ { struct IconExtraction *s = CONTAINING_RECORD(This, struct IconExtraction, defaultExtractIconInitImpl); ULONG refCount = InterlockedIncrement((PLONG)&s->ref); + TRACE("(%p)\n", This); return refCount; }
@@ -98,9 +103,8 @@ { struct IconExtraction *s = CONTAINING_RECORD(This, struct IconExtraction, defaultExtractIconInitImpl); ULONG refCount; - - if (!This) - return E_POINTER; + + TRACE("(%p)\n", This);
refCount = InterlockedDecrement((PLONG)&s->ref); if (refCount == 0) @@ -122,6 +126,9 @@ int iIcon) { struct IconExtraction *s = CONTAINING_RECORD(This, struct IconExtraction, defaultExtractIconInitImpl); + + TRACE("(%p, %s, %d)\n", This, debugstr_w(pszFile), iIcon); + DuplicateString(pszFile, &s->defaultIcon.file); if (!s->defaultIcon.file) return E_OUTOFMEMORY; @@ -135,6 +142,9 @@ UINT uFlags) { struct IconExtraction *s = CONTAINING_RECORD(This, struct IconExtraction, defaultExtractIconInitImpl); + + TRACE("(%p, 0x%x)\n", This, uFlags); + s->flags = uFlags; return S_OK; } @@ -144,6 +154,7 @@ IDefaultExtractIconInit *This, HKEY hkey) { + FIXME("(%p, %p)\n", This, hkey); UNIMPLEMENTED; return E_NOTIMPL; } @@ -155,6 +166,9 @@ int iIcon) { struct IconExtraction *s = CONTAINING_RECORD(This, struct IconExtraction, defaultExtractIconInitImpl); + + TRACE("(%p, %s, %d)\n", This, debugstr_w(pszFile), iIcon); + DuplicateString(pszFile, &s->normalIcon.file); if (!s->normalIcon.file) return E_OUTOFMEMORY; @@ -169,6 +183,9 @@ int iIcon) { struct IconExtraction *s = CONTAINING_RECORD(This, struct IconExtraction, defaultExtractIconInitImpl); + + TRACE("(%p, %s, %d)\n", This, debugstr_w(pszFile), iIcon); + DuplicateString(pszFile, &s->openIcon.file); if (!s->openIcon.file) return E_OUTOFMEMORY; @@ -183,6 +200,9 @@ int iIcon) { struct IconExtraction *s = CONTAINING_RECORD(This, struct IconExtraction, defaultExtractIconInitImpl); + + TRACE("(%p, %s, %d)\n", This, debugstr_w(pszFile), iIcon); + DuplicateString(pszFile, &s->shortcutIcon.file); if (!s->shortcutIcon.file) return E_OUTOFMEMORY; @@ -228,6 +248,11 @@ struct IconExtraction *s = CONTAINING_RECORD(This, struct IconExtraction, extractIconWImpl); const struct IconLocation *icon = NULL; SIZE_T cb; + + TRACE("(%p, 0x%x, %s, 0x%x, %p, %p)\n", This, uFlags, debugstr_w(szIconFile), cchMax, piIndex, pwFlags); + + if (!piIndex || !pwFlags) + return E_POINTER;
if (uFlags & GIL_DEFAULTICON) icon = s->defaultIcon.file ? &s->defaultIcon : &s->normalIcon; @@ -259,6 +284,9 @@ HICON *phiconSmall, UINT nIconSize) { + TRACE("(%p, %s, %u, %p, %p, %u)\n", This, debugstr_w(pszFile), + nIconIndex, phiconLarge, phiconSmall, nIconSize); + /* Nothing to do, ExtractIconW::GetIconLocation should be enough */ return S_FALSE; } @@ -308,7 +336,7 @@ if (!szIconFileW) return E_OUTOFMEMORY; } - + hr = IconExtraction_ExtractIconW_GetIconLocation( &s->extractIconWImpl, uFlags, szIconFileW, cchMax, piIndex, pwFlags); if (SUCCEEDED(hr) && cchMax > 0) @@ -388,6 +416,8 @@ IPersistFile *This, CLSID *pClassID) { + TRACE("(%p, %p)\n", This, pClassID); + if (!pClassID) return E_POINTER;
@@ -399,6 +429,7 @@ IconExtraction_PersistFile_IsDirty( IPersistFile *This) { + FIXME("(%p)\n", This); UNIMPLEMENTED; return E_NOTIMPL; } @@ -409,6 +440,7 @@ LPCOLESTR pszFileName, DWORD dwMode) { + FIXME("(%p, %s, %u)\n", This, debugstr_w(pszFileName), dwMode); UNIMPLEMENTED; return E_NOTIMPL; } @@ -419,6 +451,7 @@ LPCOLESTR pszFileName, BOOL fRemember) { + FIXME("(%p, %s, %d)\n", This, debugstr_w(pszFileName), fRemember); UNIMPLEMENTED; return E_NOTIMPL; } @@ -428,6 +461,7 @@ IPersistFile *This, LPCOLESTR pszFileName) { + FIXME("(%p, %s)\n", This, debugstr_w(pszFileName)); UNIMPLEMENTED; return E_NOTIMPL; } @@ -437,6 +471,7 @@ IPersistFile *This, LPOLESTR *ppszFileName) { + FIXME("(%p, %p)\n", This, ppszFileName); UNIMPLEMENTED; return E_NOTIMPL; }