Instance Provider

Posted: 08-24-2004, 08:55 PM
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

Responses to "Instance Provider"

Mateus Baur
Guest
Posts: n/a
 
Re: Instance Provider
Posted: 08-24-2004, 09:10 PM
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
 
LinkBack Thread Tools Display Modes
Reply


Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
smart card credential provider sunny2vaz Windows Vista Security 2 08-08-2006 02:41 PM
Instance Rully Kusuma Windows XP WMI 3 08-26-2004 07:42 PM


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90