0

A project I'm working on at the moment involves a lot of messing around with hardware. Thus, I'm using a lot of WMI related code. I noticed on several MSDN pages, such as the Win32_Fan, that there are some CIM methods which are not implemented and therefore cannot be used. For example, I want to use the CIM_Fan method SetSpeed. The MSDN page of this method says the following:

This method is currently not implemented by WMI. To use this method, you must implement it in your own provider.

This documentation is derived from the CIM class descriptions published by the DMTF. Microsoft may have made changes to correct minor errors, conform to Microsoft SDK documentation standards, or provide more information.

I have a number of questions regarding this information:

  • First of all, I do not think I quite understand what do they mean by saying that I must implement the method in my own provider. Do I need to actually modify the scripts which get my PC to run?

  • Secondly, I don't understand how to use a CIM method, syntax wise.

If anyone has any idea about the answer to either of the It'll be highly appreciated.

Community
  • 1
  • 1

1 Answers1

0

You can use: Open Hardware Monitor that exposes all the classes you need for sure. It also offers a lot more information not available out of the box.

For WMI work you can also use ORMi library. Extremely simple to use, this for example brings information about processors:

var processors = helper.Query("SELECT * FROM Win32_Processor");

Or with typed objects:

[WMIClass("Win32_Processor")]
public class Processor
{
    [WMIIgnore]
    public string NonRequiredProp { get; set; }

    public string Name { get; set; }

    [WMIProperty("NumberOfCores")]
    public int Cores { get; set; }

    public string Description { get; set; }
}

And then query:

List<Processor> procesors = helper.Query<Processor>().ToList();
NicoRiff
  • 4,803
  • 3
  • 25
  • 54
  • I know of open hardware monitor. I didn't know about the ORMI library though, I'll give it a look. However, I must say that it didn't really answer my question... I would like to use the CIM methods because they allow me to affect my computer's performance. – Itai Bieber Jun 21 '18 at 17:56
  • @ItaiBieber The next version I´m gonna launch these days is gonna include method support. But it´s not yet supported on productive version – NicoRiff Jun 21 '18 at 23:14