Doron Holan wrote:
There is a bug where if the instance count goes back down to zero (e.g.
you remove all the current instances) the provider is no longer
registered and disappears from the wmi namespace (assuming there are no
other devices which have instances, otherwise it remains). This is
fixed in v1.7.
OK. This is likely to be an issue for us.
I have not seen an issue where you create a provider
with no instances though, what type of errors are you seeing in the
applications?
OK, using CIM studio, and Powershell, I have seen two basic issues which
occur when there are two providers registered, and only one has
instances. One I call “half working”, and the other I call “not working”.
- In the “half working” situation, Powershell tends to list those that
are exist, but then throws an error message. Graphical clients (CIM
studio) just tend to show a dialog box indicating that there are no
instances whatsoever.
I suspect this may be a client problem enumerating things off multiple
providers, and not handling the error cases right. This situation seems
to occur where the provider with no instances created is the “second”
that’s enumerated internally, some exception gets thrown and clients
that aren’t so smart throw away all the data.
Unfortunately neither of the clients give me a nice COM / WMI error code.
However, I’ve turned on WMI verbose logging. Here’s what I get:
WBEMCORE.LOG
(Thu Aug 09 12:04:08 2007.789109) : CALL ConnectionLogin::NTLMLogin
wszNetworkResource = \localhost\root\wmi
pPreferredLocale =
lFlags = 0x0
(Thu Aug 09 12:04:08 2007.789109) : DCOM connection from SWTEST\mch at
authentiction level Privacy, AuthnSvc = 10, AuthzSvc = 0, Capabilities = 0
(Thu Aug 09 12:04:08 2007.789109) : GetUserDefaultLCID failed,
restorting to system verion(Thu Aug 09 12:04:08 2007.789109) : CALL
CWbemNamespace::ExecQuery
BSTR QueryFormat = WQL
BSTR Query = select * from EFX_Root
IEnumWbemClassObject **pEnum = 0xDB820
(Thu Aug 09 12:04:08 2007.789109) : CALL CWbemNamespace::ExecQueryAsync
BSTR QueryFormat = WQL
BSTR Query = select * from EFX_Root
IWbemObjectSink* pHandler = 0x0
(Thu Aug 09 12:04:08 2007.789125) : STARTING a main queue thread 2760
for a total of 1
(Thu Aug 09 12:04:08 2007.789125) : CALL CWbemNamespace::GetObject
BSTR ObjectPath = EFX_Root
long lFlags = 0
IWbemClassObject ** pObj = 0x175FBC4
(Thu Aug 09 12:04:08 2007.789125) : CALL CWbemNamespace::GetObjectAsync
BSTR ObjectPath = EFX_Root
long lFlags = 0
IWbemObjectSink* pHandler = 0x0
(Thu Aug 09 12:04:08 2007.789125) : STARTING a main queue thread 2764
for a total of 2
(Thu Aug 09 12:04:08 2007.789125) : Query Engine request: querying dyn
provider with
(Thu Aug 09 12:04:08 2007.789125) : Query Engine actual: querying dyn
provider with
(Thu Aug 09 12:04:08 2007.789125) : CALL CWbemNamespace::GetObject
BSTR ObjectPath = EFX_Root
long lFlags = 0
IWbemClassObject pObj = 0x118F938
(Thu Aug 09 12:04:08 2007.789125) : CALL CWbemNamespace::GetObject
BSTR ObjectPath = __ExtendedStatus
long lFlags = 0
IWbemClassObject pObj = 0x118F938
(Thu Aug 09 12:04:08 2007.789125) : Error 8004100f occured executing
request for EFX_Root
WMIPROV.LOG
(Thu Aug 09 12:04:08 2007.789125) :
(Thu Aug 09 12:04:08 2007.789125) : Invalid Name Block
(Thu Aug 09 12:04:08 2007.789125) :
(Thu Aug 09 12:04:08 2007.789125) :
(Thu Aug 09 12:04:08 2007.789125) : Enable verbose logging for more
information
(Thu Aug 09 12:04:08 2007.789125) :
(Thu Aug 09 12:04:08 2007.789125) : WNODE_HEADER 0x34b00
(Thu Aug 09 12:04:08 2007.789125) : BufferSize…0x43
(Thu Aug 09 12:04:08 2007.789125) : ProviderId…0x8a230cc0
(Thu Aug 09 12:04:08 2007.789125) : Version…0x0
(Thu Aug 09 12:04:08 2007.789125) : TimeStamp:LowPart.0x225e97a
(Thu Aug 09 12:04:08 2007.789125) : TimeStamp:HiPart…0x1c7da75
(Thu Aug 09 12:04:08 2007.789125) : Guid…(Thu Aug 09
12:04:08 2007.789125) : {4CA65E60-3AC8-4A45-E445-AAC984F5F8EE}(Thu Aug
09 12:04:08 2007.789125) :
(Thu Aug 09 12:04:08 2007.789125) :
(Thu Aug 09 12:04:08 2007.789125) : Flags…0x10081
(Thu Aug 09 12:04:08 2007.789125) : ***********************************
(Thu Aug 09 12:04:08 2007.789125) : WNODE_ALL_DATA 0x34b00
(Thu Aug 09 12:04:08 2007.789125) : DataBlockOffset…40
(Thu Aug 09 12:04:08 2007.789125) : InstanceCount…0
(Thu Aug 09 12:04:08 2007.789125) : OffsetInstanceNameOffsets…40
(Thu Aug 09 12:04:08 2007.789125) : OffsetInstanceData…0
(Thu Aug 09 12:04:08 2007.789125) : LengthInstanceData…0
(Thu Aug 09 12:04:08 2007.789125) : Writing out buffer, total size to
write: 67
(Thu Aug 09 12:04:08 2007.789125) : 43 00 00 00 c0 0c 23 8a 00 00
(Thu Aug 09 12:04:08 2007.789125) : 00 00 00 00 00 00 7a e9 25 02
(Thu Aug 09 12:04:08 2007.789125) : 75 da c7 01 60 5e a6 4c c8 3a
(Thu Aug 09 12:04:08 2007.789125) : 45 4a e4 45 aa c9 84 f5 f8 ee
(Thu Aug 09 12:04:08 2007.789125) : 00 00 00 00 81 00 01 00 40 00
(Thu Aug 09 12:04:08 2007.789125) : 00 00 00 00 00 00 40 00 00 00
(Thu Aug 09 12:04:08 2007.789125) : 00 00 00 00 00 00 00 00 00 00
(Thu Aug 09 12:04:08 2007.789125) : WDM specific return code: 0
(Thu Aug 09 12:04:08 2007.789125) :
2. In the “not working” situation, the client seems to enumerate the
provider that has no instances whatsoever first. In this case,
Powershell shows up no errors, but lists nothing, and CIM studio again
shows a dialog box indicating that no instances exist. In this case,
removing the provider with no instances then “exposes” the other
provider so that you can see its instances.
WBEMCORE.LOG
(Thu Aug 09 12:05:53 2007.893890) : CALL ConnectionLogin::NTLMLogin
wszNetworkResource = \localhost\root\wmi
pPreferredLocale =
lFlags = 0x0
(Thu Aug 09 12:05:53 2007.893890) : DCOM connection from SWTEST\mch at
authentiction level Privacy, AuthnSvc = 10, AuthzSvc = 0, Capabilities = 0
(Thu Aug 09 12:05:53 2007.893890) : GetUserDefaultLCID failed,
restorting to system verion(Thu Aug 09 12:05:53 2007.893906) : CALL
CWbemNamespace::ExecQuery
BSTR QueryFormat = WQL
BSTR Query = select * from EFX_PortGroup
IEnumWbemClassObjectpEnum = 0xFF098
(Thu Aug 09 12:05:53 2007.893906) : CALL CWbemNamespace::ExecQueryAsync
BSTR QueryFormat = WQL
BSTR Query = select * from EFX_PortGroup
IWbemObjectSink pHandler = 0x0
(Thu Aug 09 12:05:53 2007.893906) : STARTING a main queue thread 2912
for a total of 1
(Thu Aug 09 12:05:53 2007.893906) : CALL CWbemNamespace::GetObject
BSTR ObjectPath = EFX_PortGroup
long lFlags = 0
IWbemClassObject pObj = 0x171FBC4
(Thu Aug 09 12:05:53 2007.893906) : CALL CWbemNamespace::GetObjectAsync
BSTR ObjectPath = EFX_PortGroup
long lFlags = 0
IWbemObjectSink pHandler = 0x0
(Thu Aug 09 12:05:53 2007.893906) : STARTING a main queue thread 2916
for a total of 2
(Thu Aug 09 12:05:53 2007.893906) : Query Engine request: querying dyn
provider with
(Thu Aug 09 12:05:53 2007.893906) : Query Engine actual: querying dyn
provider with
(Thu Aug 09 12:05:53 2007.893906) : CALL CWbemNamespace::GetObject
BSTR ObjectPath = EFX_PortGroup
long lFlags = 0
IWbemClassObject pObj = 0x118F938
(Thu Aug 09 12:05:53 2007.893906) : CALL CWbemNamespace::GetObject
BSTR ObjectPath =__ExtendedStatus
long lFlags = 0
IWbemClassObject ** pObj = 0x118F938
WMIPROV.LOG
(Thu Aug 09 12:05:53 2007.893906) : WDM specific return code: 0
(Thu Aug 09 12:05:53 2007.893906) :