Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/eclipse/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C 为什么SHGetPathFromIDList函数导出三次_C_Winapi_Dllexport_Shell32 - Fatal编程技术网

C 为什么SHGetPathFromIDList函数导出三次

C 为什么SHGetPathFromIDList函数导出三次,c,winapi,dllexport,shell32,C,Winapi,Dllexport,Shell32,我知道shell32.dll导出两种类型的函数ANSI和UNICODE。(为了简单起见,我只讨论采用CHAR*/WCHAR*参数的函数。) 例如,ShellMessageBoxA是ANSI版本,而ShellMessageBoxW是Unicode版本ShellMessageBox是头文件中定义的宏: #ifdef UNICODE #define ShellMessageBox ShellMessageBoxW #else #define ShellMessageBox ShellMessage

我知道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
被导出三次:

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

这样做的目的是什么?

shGetPathFromIdleist
用于旧版程序,这些程序最初针对的是旧版Windows,因为不支持Unicode而没有导出
A
W
。此导出是ANSI版本

SHGetPathFromIDListA
SHGetPathFromIDListW
是ANSI和Unicode版本

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


现代SDK将链接到
SHGetPathFromIDListA
SHGetPathFromIDListW
,但决不会链接到
SHGetPathFromIDList

,因此可以安全地假设此Shell32.dll伪代码为真#定义SHGetPathFromIDList SHGetPathFromIDList?不。如果定义了
UNICODE
,则
SHGetPathFromIDList
将扩展到
SHGetPathFromIDListW
。您可以查看头文件以了解它们如何声明
SHGetPathFromIDList
。我的猜测是,标题中的声明看起来与
ShellMessageBox
的声明完全相同。
SHGetPathFromIDList
只是一个遗留保留,已导出但不打算使用。