我正在使用JNA与Windows API进行交互。
我想使用WinBase.h
标头中的LogonUserW
函数。为了使用JNA的Native.load
加载它,我需要知道动态链接库的名称。
例如,CredReadW
在WinCred.h
标头中,我通过示例发现该函数是由advapi32.dll
提供的,因此我能够加载带有的函数
// WinCrypt is my own interface. I'm not sure why it's WinCrypt instead of WinCred,
// but that's what I saw in other examples.
Native.load("Advapi32", WinCrypt.class);
这是一个基于的例子
我真的需要使用DUMPBIN来检查Windows中的每个dll才能找到它吗?我本希望微软能提供一种更好的方法来找到这些。
Agh-nvm页面本身有一个表,显示库。只需搜索字符串";Advapi32〃;
https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-logonuserw