shell32: fix infinite loop in SHGetPathFromIDListW

Michael Jung mjung at
Sat Jun 25 06:14:27 CDT 2005


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

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 

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.

	Fix a lurking infinite loop in SHGetPathFromIDList. 

Michael Jung
mjung at
-------------- 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 :

More information about the wine-patches mailing list