Communication between WMI and Windows services

旧巷老猫 提交于 2019-12-08 11:59:53

问题


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

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 ?

Thanks in advance, Sid


回答1:


I got how to proceed with this. I need to create a WMI provider ( dll + MOF file).

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.

Now inside the dll file I need to use the ConnectServer() function to connect to this new WMI namespace ("\\.\Root").

I referred this link
http://www.codeproject.com/Articles/27914/WMI-MOF-Basics



来源:https://stackoverflow.com/questions/27374588/communication-between-wmi-and-windows-services

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!