Instance Provider

M

Mateus Baur

Hi All,



I wrote an instance provider, which would work in a proprietary namespace.
This instance provider is the responsible for a CIM_Service subclass.



However, the leading changed the requirements and this provider should now
work on the "root/cimv2" namespace. It is causing a problem to me.



I was redefining some properties as key in my MOF file:



..............

[Dynamic,Provider("MyProvider") : ToInstance]
class MySubclass : CIM_Service
{
[Override("Name"), read : ToSubclass ToInstance, Key : ToSubclass
ToInstance]
string Name;



[Override("CreationClassName"), read : ToSubclass ToInstance, Key :
ToSubclass ToInstance]
string CreationClassName;



[Override("SystemName"), read : ToSubclass ToInstance, Key : ToSubclass
ToInstance]
string SystemName;



[Override("SystemCreationClassName"), read : ToSubclass ToInstance, Key :
ToSubclass ToInstance]
string SystemCreationClassName;



[Implemented]
uint32 StartService();



[Implemented]
uint32 StopService();

};

..........



An error occurs when a try to compile the MOF. This error says that the Name
property cannot be a key.

So, I tried to perform two alternatives. However, the both didn't work.
These alternatives were the following:



1) I removed the key qualifiers from my class. Then, no instances were
returned when I tried to enumerate instances of MySubclass.



2) I removed the key qualifiers from the CIM_Service class. In addition, I
redefined the keys on MySubclass again. Then, instances of MySubclass were
showed, but the instances of all Win32 classes, which derive from
CIM_Service, were not showed.



Could anyone help me?

I don't know what I can do to solve this problem.



Thanks in advance,

Mateus
 
M

Mateus Baur

I forgot one more information. I used the MS WMI provider framework
(framedyn.dll) to write the instance provider.

Thanks,
Mateus
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top