简体   繁体   中英

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. 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

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 ( eg, #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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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