DLL导出4个COM函数但不导出COM对象?!我就是不明白!
我一直在Windows中查看DLL,我看到许多DLL具有4个COM导出函数:
DllCanUnloadNow DLL获取类对象 DLL注册服务器 DllUnregisterServer
仅举一个例子: c:\windows\system32\actxprxy.dll // <-- WINDOWS 7 !!! (我猜Vista也是如此)
B - U - T 当我寻找COM对象时(使用各种工具,包括Visual Studio,nirsoft.net的DLLEXP.exe和其他工具)我找不到任何!
而且,Visual Studio说它不是COM对象,怎么可能?! 我可以想到其中没有任何接口/类的 COM DLL,但我知道某些应用程序使用这些 DLL。
谁能解释一下这是怎么回事? :-)
谢谢!
I've been looking at DLLs in windows, and I saw many DLLs that have the 4 COM exported functions:
DllCanUnloadNow
DllGetClassObject
DllRegisterServer
DllUnregisterServer
just for an example:
c:\windows\system32\actxprxy.dll // <-- WINDOWS 7 !!! (I guess Vista as well)
B - U - T when I am looking for COM objects (using various tools, including visual studio, nirsoft.net's DLLEXP.exe and other tools) I can't find any!
Moreover, visual studio says it is not a COM object, how is it possible ?!
I can think of a COM DLL without any interfaces/classes in it, but I know for certain applications use these DLLs.
Can anyone explain what is going on here? :-)
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
COM 定义了 COM 接口方法的 vtable 和调用参数。然而,指向方法实现的指针永远不会使用 DLL 导出机制导出:这些指向方法实现的指针存储在由库创建的 COM 对象的 vtable 上。
也就是说,如果不要求 COM 库为您创建一个 COM 对象,就不可能知道 COM 库将如何“构造”COM 对象。 “构造”过程的一部分涉及将正确的方法指针放入对象的虚拟表中。
COM defines the vtables and calling parameters of the COM interface methods. However, the pointers to the method implementations are never exported using the DLL Export mechanism: these pointers to method implementations are stored on the vtable of the COM object that was created by the library.
That is, without asking the COM library to create one COM object for you, it is not possible to know how the COM library will "construct" a COM object. Part of that "construction" process involves putting the right method pointers into the object's virtual table.