gpt4 book ai didi

c - SHGetPathFromIDList函数为什么导出了3次

转载 作者:行者123 更新时间:2023-12-04 12:27:45 28 4
gpt4 key购买 nike

我知道 shell32.dll 导出两种类型的函数——ANSI 和 UNICODE。 (为了简单起见,我只讨论采用 CHAR*/WCHAR* 参数的函数。)

例如,ShellMessageBoxA是ANSI版本,而ShellMessageBoxW是Unicode版本。 ShellMessageBox 是头文件中定义的宏:

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

因此 ShellMessageBox 不作为从 Shell32.dll 导出的函数存在。

但是现在发现SHGetPathFromIDList导出了3次:

  • 序数 312 - SHGetPathFromIDList
  • 序号 313 - SHGetPathFromIDListA
  • 序数 314 - SHGetPathFromIDListW

这样做的目的是什么?

最佳答案

SHGetPathFromIDList 适用于最初针对旧版本 Windows 的遗留程序,这些旧版本没有 AW 导出,因为它不支持统一码。此导出是 ANSI 版本。

SHGetPathFromIDListASHGetPathFromIDListW 是 ANSI 和 Unicode 版本。

如果您使用 dumpbin 或 Dependency Walker 检查入口点,您将看到 SHGetPathFromIDList 的入口点与 SHGetPathFromIDListA 的入口点相同.

现代 SDK 将链接到 SHGetPathFromIDListASHGetPathFromIDListW,但永远不会链接到 SHGetPathFromIDList

关于c - SHGetPathFromIDList函数为什么导出了3次,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39335233/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com