PC Review
Forums
Newsgroups
Windows XP
Windows XP WMI
Instance Provider
Forums
Newsgroups
Windows XP
Windows XP WMI
Instance Provider
![]() |
Instance Provider |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
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 |
|
|
|
#2 |
|
Guest
Posts: n/a
|
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 > > > > > > |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

