shell32: fix infinite loop in SHGetPathFromIDListW

Michael Jung mjung at iss.tu-darmstadt.de
Sat Jun 25 06:14:27 CDT 2005


Hi,

With a seemingly unrelated change in his local tree Vigaliy Margolen triggered 
an infinite loop in SHGetPathFromIDList (which was introduced by one of my 
patches):

SHGetPathFromIDList (pidl.c:1256) calls SHBindToParent, which calls 
Desktop->BindToObject (pidl.c:1315), which calls SHELL32_BindToChild 
(shfldr_desktop.c:348), which binds to MyComputer (shlfolder.c:289) and then 
calls MyComputer->BindToObject (shlfolder.c:314), which calls 
SHELL32_BindToChild (shfldr_mycomp.c:346), which calls 
SHELL32_GetCustomFolderAttribute (shlfolder.c:299), which calls 
SHGetPathFromIDList (shlfolder.c:91). Phew.

Since the path is already known in SHELL32_BindToChild, we can break the loop 
easily.

I don't understand, why we don't see a stack overflow with wine cvs, but the 
size of a +shell log shrinks 90% with this patch applied compared to cvs. So 
we do have the loop, but it is terminated somehow before the stack overflows.

Changelog:
	Fix a lurking infinite loop in SHGetPathFromIDList. 

Bye,
-- 
Michael Jung
mjung at iss.tu-darmstadt.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dlls_shell32_shlfolder_c.diff
Type: text/x-diff
Size: 5372 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20050625/1d5618d5/dlls_shell32_shlfolder_c.bin


More information about the wine-patches mailing list