user2120666 user2120666 - 1 year ago 166
C Question

Why is SHGetPathFromIDList function exported three times

Good day.

Until now, I thinks that standard Shell32.dll in my Win XP exported two types of function - ANSI and UNICODE. (For sake of simplicity I am talking only about functions that contains CHAR*/WCHAR* argument.)


ANSI version:



UNICODE version:

ShellMessageBox is in header defined as macro:

#ifdef UNICODE
#define ShellMessageBox ShellMessageBoxW
#define ShellMessageBox ShellMessageBoxA
#endif // !UNICODE

not exists as function, so that is not exported from Shell32.dll.

But now I discovered that SHGetPathFromIDList is exported three times:

  • ORDINAL 312 - SHGetPathFromIDList

  • ORDINAL 313 - SHGetPathFromIDListA

  • ORDINAL 314 - SHGetPathFromIDListW

Question: What is purpose of this?

Answer Source

SHGetPathFromIDList is for legacy programs that originally targeted older versions of Windows that did not have the A and W exports because it did not support Unicode. This export is the ANSI version.

SHGetPathFromIDListA and SHGetPathFromIDListW are the ANSI and Unicode versions.

If you inspect the entry points with dumpbin or Dependency Walker you will see that the entry point for SHGetPathFromIDList is identical to that for SHGetPathFromIDListA.

Modern SDKs will link to either SHGetPathFromIDListA or SHGetPathFromIDListW, but never to SHGetPathFromIDList.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download