>>>>> "Rolf" == Rolf Kalbermatter <rolf.kalbermatter(a)citeng.com> writes:
+/****************************************************************************
+ * SHDefExtractIconW [SHELL32.@]
+ */
+HRESULT SHDefExtractIconW(LPCWSTR pszIconFile, int iIndex, UINT uFlags,
+ HICON* phiconLarge, HICON* phiconSmall, UINT nIconSize)
+{
+ UINT ret;
+ HICON hIcons[2];
^^^^^^^^
+ WARN("%s %d 0x%08x %p %p %d, semi-stub\n", debugstr_w(pszIconFile),\
iIndex, uFlags, phiconLarge, phiconSmall, nIconSize);
+
+ ret = PrivateExtractIconsW(pszIconFile, iIndex, nIconSize,
nIconSize, h\
Icons, NULL, 2, LR_DEFAULTCOLOR);
+ /* FIXME: deal with uFlags parameter which contains GIL_ flags */
+ if (ret == 0xFFFFFFFF)
+ return E_FAIL;
+ if (ret > 0) {
+ *phiconLarge = hIcons[0];
^^^^^^^^^^^^
Rolf,
this doesn't look right to me:
You allocate space on the function local stack, then hand out a pointer to
that memory and return from the function. No the function local stack is
undefined and the pointers are dangling. I think the heap should be used for
allocating the needed storage.
Bye
--
Uwe Bonnes bon(a)elektron.ikp.physik.tu-darmstadt.de
Institut fuer Kernphysik Schlossgartenstrasse 9 64289 Darmstadt
--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------