Help needed on an SHGetFileInfoW() crash

Francois Gouget fgouget at
Mon Dec 4 12:20:08 CST 2006

A friend pointed me to a railway signalling simulation game:

However, the installer crashes in SHGetFileInfoW():

000d:Call shell32.SHGetFileInfoA(0045eae8,00000010,0034fcec,00000160,00001010) ret=0045e9f6
000d:trace:seh:raise_exception code=c0000005 flags=0 addr=0x7e8871b2
000d:trace:seh:raise_exception  info[0]=00000000
000d:trace:seh:raise_exception  info[1]=00000000

More precisely the crash happens on this line:
    hr = IShellFolder_GetUIObjectOf(psfParent, 0, 1,
        (LPCITEMIDLIST*)&pidlLast, &IID_IExtractIconW,
        &uDummy, (LPVOID*)&pei);

And the reason is that psfParent is NULL. psfParent is initialized a bit 
above, but only if SHGetFileInfoW() was given a PIDL and 
SHGFI_USEFILEATTRIBUTES was not used. This means that whenever a 'real 
path' or SHGFI_USEFILEATTRIBUTES is used in combination with 
then SHGetFileInfoW() will crash.

However we cannot just create a pidl since the 'real path' will usually 
refer to a nonexistent file or directory (in our case it is 
'c:\directory' so it's clear the installer just wants to know what's 
the icon for a standard directory).

Any idea?

Francois Gouget <fgouget at>    
            "Lotto: A tax on people who are bad at math." -- unknown
          "Windows: Microsoft's tax on computer illiterates." -- WE7U

More information about the wine-devel mailing list