Creating a Provider Class

[This is preliminary documentation and subject to change.]

    To create the class for which you want to return data
  1. Create a directory to contain all of the provider files.
  2. Open Internet Explorer and make sure its security level allows the installation of ActiveX™ tools. Under View/Options…/Security/Safety Level…, choose Medium or None. If you choose None, be careful if you use the same Internet Explorer elsewhere.
  3. Open WBEM CIM Studio. Click Start, select Programs, then select WBEM SDK. Then select WBEM CIM Studio.

    If you set the security level to Medium, you must allow all the .cab and ActiveX controls to be installed. In other words, you must answer Yes to All when asked if it is OK to install the controls.

  4. Log in to CIMOM. If you have made no changes to security since installing WBEM, you can click OK here.
  5. Click the Add Class button to the right of the Classes in box.
  6. Clear the Parent field, enter MyClass in the New Class field, and click OK. At this point, the new class appears in the left frame. (You can also create a derived class. In this case, select the parent class first, then click the Add Class button and enter the new class name without clearing the Parent field.)
  7. Add a property to the new class. In the right frame, click the Name field in the blank line at the bottom. Type MyName in this field. Leave the type as string and the value blank.
  8. Add two qualifiers to the MyName property. Double-click MyName to display the Qualifiers window.
  9. For the first qualifier, enter Key as the name, BOOL as the type, and true as the value. Leave the other default settings as is.
  10. For the second qualifier, enter Read as the name, BOOL as the type, and true as the value. Leave the other default settings as is.
  11. Click OK to close the Qualifiers window.
  12. Add another new property named Age. It should be of type sint32 (32-bit integer). Leave the value as 0.
  13. Add a qualifier to the Age property. Double-click the Age field. The Qualifiers window appears.
  14. Enter Read as the name, BOOL as the type, and true as the value. Leave the other default settings as is.
  15. Click OK to close the Qualifiers window.
  16. Add two qualifiers to the MyClass class. Right-click the Age property and select Object qualifiers.
  17. For the first qualifier, enter Dynamic as the name, BOOL as the type, and true as the value. Leave the other default settings as is.
  18. For the second qualifier, enter Provider as the name, BSTR as the type, and MyProv as the value. Leave the other default settings as is.
  19. Click OK to close the Qualifiers window.
  20. Click the Save button.
  21. In the left frame, click the check box to the left of the MyClass class.
  22. Double-click the MOF Generator button to run the MOF Generator Wizard and generate a MOF file for the new class definition.
  23. Click the Next button on the first and second screens that appear. (Click OK to dismiss the "Cannot get instance enumeration…" warning message.) On the third screen, enter MyClass in the MOF File Name field and <drive>:\Prov in the Directory for the MOF file field. (You can also use the Browse button to select the directory.)
  24. Click the Finish button. The MOF file is generated and a confirmation message appears. Click OK to dismiss the message.