WMI的DLL问题 [英] Problem with DLL of WMI

查看:130
本文介绍了WMI的DLL问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在开发一个DLL库,可以从另一个应用程序中使用它. DLL使用WMI API来发现连接到我的PC的硬件.如果我从独立应用程序中运行代码,则该程序可以运行,但是如果我使用DLL从我的自定义应用程序中运行代码,则该程序将由于API的安全性错误而失败.失败的exatc方法是 CoInitializeSecurity函数.

我的自定义APP使用调用DLL的嵌入式applet在浏览器上运行.该小程序已签名.

有人对此问题有任何想法吗?

先谢谢了.


学习

Hi,

I'm developing a DLL library ti be used from another application. The DLL uses the WMI API to discover the hardware connected to my PC. If I run the code from a standalone application, the program works, but if I run the code from my custom app using the DLL, the program fails beacause of an security error of the API. The exatc method that fails is the  CoInitializeSecurity function.

My custom APP runs over a browser using an embeded applet that calls the DLL. The applet is signed.

Anyone have an idea about this problem?

Thanks in advance.


Learning

推荐答案

失败,结果如何? RPC_E_TOO_LATE?这意味着您的.dll所执行的线程已经初始化了COM.您的.dll可能需要启动自己的线程,因此它将对COM线程模型和安全性初始化具有显式控制.
Fails with what result? RPC_E_TOO_LATE? This means the thread your .dll is executing on has already initialized COM. Your .dll may need to start its own thread so it will have explicit control over the COM threading model and security initialization.


这篇关于WMI的DLL问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆