PC Review Forums Newsgroups Windows XP Windows XP WMI Instance Provider

Reply

Instance Provider

 
Thread Tools Rate Thread
Old 24-08-2004, 07:55 PM   #1
Mateus Baur
Guest
 
Posts: n/a
Default Instance Provider


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






  Reply With Quote
Old 24-08-2004, 08:10 PM   #2
Mateus Baur
Guest
 
Posts: n/a
Default Re: Instance Provider

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

Thanks,
Mateus

"Mateus Baur" <ask@me.com> escreveu na mensagem
news:esfqARhiEHA.2524@TK2MSFTNGP11.phx.gbl...
> 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
>
>
>
>
>
>



  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off