WMI和Windows服务之间的通信 [英] Communication between WMI and Windows services
问题描述
我创建了一个WMI应用程序(在C ++中),它查询远程系统中存在哪种类型的操作系统。
我使用以下引用:
http://msdn.microsoft.com/en-us/library/aa390422%28v=vs.85%29.aspx
I have created a WMI application(in C++) which query what type of OS is there in the remote system. I used the following reference : http://msdn.microsoft.com/en-us/library/aa390422%28v=vs.85%29.aspx
我在远程PC上创建了Windows服务(C ++)。现在我不想连接我的WMI应用程序到Windows服务。我已经阅读了有关WMI提供,但我不是真正了解如何使用它们来创建我的WMI类:(
I have created a Windows Service(in C++) on the remote PC. Now I wont to connect my WMI application to the Windows services. I have read about the WMI Provides but I am not actually understanding how to use them to create my WMI classes :(.
任何人都可以提供任何有关如何继续的信息?
Can anyone provide me any information on how to proceed ?
提前感谢
Sid
Thanks in advance, Sid
推荐答案
我需要创建一个WMI提供程序(dll + MOF文件)。
I got how to proceed with this. I need to create a WMI provider ( dll + MOF file).
我需要创建一个MOF在这个MOF文件中,我需要创建一个WMI命名空间(例如,#pragma命名空间(\\.\Root))。
之后,我需要编译MOF文件文件使用mofcomp.exe,以便MOIM文件中的CIM类转到WMI存储库。
I need to create a MOF(managed Object File) which consist of CIM classes and Events. In this MOF file I need to create a WMI namespace ( e.g., #pragma namespace("\\.\Root") ).
After this I need to compile the MOF file file using "mofcomp.exe"so that the CIM classes in the MOF file goes to the WMI repository.
现在在dll文件中,我需要使用ConnectServer()函数连接到此新的WMI命名空间(\\.\Root)。
Now inside the dll file I need to use the ConnectServer() function to connect to this new WMI namespace ("\\.\Root").
我引用此链接
http://www.codeproject.com/Articles/27914/WMI-MOF-Basics
这篇关于WMI和Windows服务之间的通信的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!