简体   繁体   English

如何使用 LoadLibrary 获取 fileapi.h 中定义的 function 的地址?

[英]How can I use LoadLibrary to get the address of a function defined in fileapi.h?

I want to know the name of the DLL/LIB in which functions declared in fileapi.h are kept.我想知道保存在fileapi.h中声明的函数的 DLL/LIB 的名称。

So that I can use LoadLibrary(dllname) (if it is inside DLL).这样我就可以使用LoadLibrary(dllname) (如果它在 DLL 中)。

The fileapi.h header documentation lists the functions, and their individual documentations all say the same thing - the functions are implemented in kernel32.dll . fileapi.h header文档列出了这些函数,它们各自的文档都说了同样的话——这些函数在kernel32.dll中实现。 Which you don't need to use LoadLibrary() for, you can use GetModuleHandle() instead, since kernel32.dll is loaded by default in all processes.您不需要使用LoadLibrary() ,您可以使用GetModuleHandle()代替,因为kernel32.dll在所有进程中默认加载。

To get the address of a function in a loaded DLL module, you need to use GetProcAddress() , giving it an HMODULE from LoadLibrary/Ex() or GetModuleHandle() .要在加载的 DLL 模块中获取 function 的地址,您需要使用GetProcAddress() ,并从LoadLibrary/Ex()GetModuleHandle()为其提供HMODULE

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM