kern
kern

Reputation: 2535

How to check whether a function in dll/lib is extern "C" in windows?

For example ObReferenceObjectByName is defined in c, so in c++ should use extern "C"

But how can I check this directly in the dll/lib instead of reading docs?

Upvotes: 1

Views: 916

Answers (2)

T.E.D.
T.E.D.

Reputation: 44804

Just look at the symbol name in the lib file. If the name has been mangled like C++ does with its names, it should be obvious.

Upvotes: 4

SLaks
SLaks

Reputation: 887385

You can look at the export in Dependency Walker.

Open the DLL, find the function in the middle right pane, and look at the icon. It will be C, C++, or O# (exported by ordinal only)
For more information, see Export Function List View in the help file.

Upvotes: 2

Related Questions