3

I know that shell32.dll exports two types of functions—ANSI and UNICODE. (For the sake of simplicity, I am talking only about functions that take CHAR*/WCHAR* arguments.)

For example, ShellMessageBoxA is the ANSI version, while ShellMessageBoxW is the Unicode version. ShellMessageBox is a macro defined in the header file:

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

So ShellMessageBox does not exist as a function that is exported from Shell32.dll.

But now I discovered that SHGetPathFromIDList is exported three times:

  • ORDINAL 312 - SHGetPathFromIDList
  • ORDINAL 313 - SHGetPathFromIDListA
  • ORDINAL 314 - SHGetPathFromIDListW

What is purpose of this?

Cody Gray - on strike
  • 239,200
  • 50
  • 490
  • 574
user2120666
  • 579
  • 1
  • 4
  • 16
  • You could have looked at the header files to see how they declare `SHGetPathFromIDList`. My guess is, the declarations in the headers look exactly the same as for `ShellMessageBox`. The `SHGetPathFromIDList` is just a legacy holdover, exported but not intended to be used. – Cody Gray - on strike Sep 07 '16 at 10:28

1 Answers1

4

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.

David Heffernan
  • 601,492
  • 42
  • 1,072
  • 1,490