0

我有一个导出 3 个函数的 dll:

.h 文件

extern "C"
{
__declspec(dllexport) BOOLEAN __stdcall InitializeChangeNotify(void);
__declspec(dllexport) BOOLEAN __stdcall PasswordFilter(LPCWSTR AccountName,LPCWSTR FullName,LPCWSTR Password,BOOLEAN SetOperation);
__declspec(dllexport) NTSTATUS __stdcall PasswordChangeNotify(LPCWSTR UserName,ULONG RelativeId,LPCWSTR NewPassword);
}

.c 文件

extern "C"
{
    __declspec(dllexport) BOOLEAN __stdcall InitializeChangeNotify(void)
{
    writeToLog("InitializeChangeNotify()");
    return TRUE;
}

__declspec(dllexport) BOOLEAN __stdcall PasswordFilter(LPCWSTR AccountName,LPCWSTR FullName,LPCWSTR Password,BOOLEAN SetOperation)
{
    writeToLog("PasswordFilter()");
    return TRUE;
}

__declspec(dllexport) NTSTATUS __stdcall PasswordChangeNotify(LPCWSTR UserName,ULONG RelativeId,LPCWSTR NewPassword)
{
    writeToLog("PasswordChangeNotify()");
    return 0;
}
}

我在 VS 2010 中编译。

我看到函数名称取决于:_InitializeChangeNotify@0, _PasswordChangeNotify@12. 如何解开这些功能?

4

3 回答 3

5

Looks like undname.exe on windows is the 'c++filt' equivalent.

I've it under "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\undname.exe" in my PC.

From the page,

You can use the undname.exe to convert a decorated name to its undecorated form. For example,

C:\>undname ?func1@a@@AAEXH@Z
Microsoft (R) C++ Name Undecorator
Copyright (C) Microsoft Corporation 1981-2000. All rights reserved.Undecoration
of :- "?func1@a@@AAEXH@Z"
is :- "private: void __thiscall a::func1(int)"
于 2012-05-04T22:39:12.317 回答
1

_xxx@x 表示这是 __stdcall 调用约定。@ 之后的数字表示参数的摘要大小(以字节为单位)。

于 2012-05-04T21:53:10.310 回答
0

我也遇到了这个,通过指定def文件来解决。例如:

a.定义:

出口

初始化更改通知

在项目设置中,将 Link>> Input>>Module 定义文件设置为 a.def 并重新生成。高温高压

于 2014-12-06T15:55:18.727 回答