简体   繁体   English

WMI与Windows服务之间的通信

[英]Communication between WMI and Windows services

I have created a WMI application(in C++) which query what type of OS is there in the remote system. 我创建了一个WMI应用程序(使用C ++),该应用程序查询远程系统中存在哪种类型的OS。 I used the following reference : http://msdn.microsoft.com/en-us/library/aa390422%28v=vs.85%29.aspx 我使用了以下参考: http : //msdn.microsoft.com/zh-cn/library/aa390422%28v=vs.85%29.aspx

I have created a Windows Service(in C++) on the remote PC. 我已经在远程PC上创建了Windows服务(C ++)。 Now I wont to connect my WMI application to the Windows services. 现在,我不会将WMI应用程序连接到Windows服务。 I have read about the WMI Provides but I am not actually understanding how to use them to create my WMI classes :(. 我已经阅读了有关WMI提供的信息,但实际上我并不了解如何使用它们来创建我的WMI类:(。

Can anyone provide me any information on how to proceed ? 任何人都可以向我提供有关如何进行的任何信息吗?

Thanks in advance, Sid 预先感谢,西德

I got how to proceed with this. 我知道如何进行此操作。 I need to create a WMI provider ( dll + MOF file). 我需要创建一个WMI提供程序(dll + MOF文件)。

I need to create a MOF(managed Object File) which consist of CIM classes and Events. 我需要创建一个包含CIM类和事件的MOF(托管对象文件)。 In this MOF file I need to create a WMI namespace ( eg, #pragma namespace("\\\\.\\Root") ). 在此MOF文件中,我需要创建一个WMI名称空间(例如#pragma名称空间(“ \\\\。\\ 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. 此后,我需要使用“ mofcomp.exe”来编译MOF文件文件,以便MOF文件中的CIM类进入WMI存储库。

Now inside the dll file I need to use the ConnectServer() function to connect to this new WMI namespace ("\\\\.\\Root"). 现在在dll文件中,我需要使用ConnectServer()函数连接到此新的WMI名称空间(“ \\\\。\\ Root”)。

I referred this link 我提到了此链接
http://www.codeproject.com/Articles/27914/WMI-MOF-Basics http://www.codeproject.com/Articles/27914/WMI-MOF-Basics

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

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