WMI help!

Hi,
I am not sure if I can post such a question here but I have a problem with
WMI.
When an array of 8 bytes integer is read from buffer, always the last value
from the array contain some garbage. With integers that are only 4 bytes or
1 byte everything is fine. Also when it is only one 8 bytes value (not
array) the result is correct.
It is neccesary to read 8bytes integers and not to read only one byte and to
reconstruct the 8bytes value.
Could someone tell me what could be wrong with this array?

Thanks in advance,
Ionut.

Ionut Deaconeasa wrote:

When an array of 8 bytes integer is read from buffer, always the last value
from the array contain some garbage. With integers that are only 4 bytes or
1 byte everything is fine. Also when it is only one 8 bytes value (not
array) the result is correct.
It is neccesary to read 8bytes integers and not to read only one byte and to
reconstruct the 8bytes value.
Could someone tell me what could be wrong with this array?

First off, is this problem occurring with a WMI class that a driver
implements, or something else? Can you show us the relevant MOF syntax
as well?


Walter Oney, Consulting and Training
Basic and Advanced Driver Programming Seminars
Now teaming with John Hyde for USB Device Engineering Seminars
Check out our schedule at http://www.oneysoft.com

This is how my mof code for one class look:

[WMI,
dynamic: ToInstance,
provider(“WMIProv”),
guid(“{20B8E03B-1F4D-4418-912A-0CD3556C3048}”),
locale(“MS\0x409”),
WmiExpense(1),
Description(“NDIS Sensor”)]

class SKNdis_SensorErrTime : SKNdis
{
[read] boolean Active;
[key, read] string InstanceName;
[read,
Description(“Number of array elements.”),
WmiDataId(1)] uint32 NumberElements;
[read,
Description(“Stores an array of timestamps.”),
WmiDataId(2),
WmiSizeIs(“NumberElements”)] uint64 SKNdisSensorErrTime;
};

The base class is :
[abstract]
class SKNdis
{
};

Now I will explain in more details what is happening. I have a network
driver that is working perfect and I must to map the GUID to OID. When I am
sending the request for the above class the driver return the right value
for each element of the array (this was verified with windbg). In my
application that show the results last value is afected by strange numbers.
I examined also with WMI CIM studio these returned values and the same
“noise” is in the last value.
If I read byte by byte the buffer than the error does not occur.

Greetings,
Ionut

----- Original Message -----
From: “Walter Oney”
Newsgroups: ntdev
To: “NT Developers Interest List”
Sent: Monday, January 27, 2003 4:51 PM
Subject: [ntdev] Re: WMI help!

> Ionut Deaconeasa wrote:
> > When an array of 8 bytes integer is read from buffer, always the last
value
> > from the array contain some garbage. With integers that are only 4 bytes
or
> > 1 byte everything is fine. Also when it is only one 8 bytes value (not
> > array) the result is correct.
> > It is neccesary to read 8bytes integers and not to read only one byte
and to
> > reconstruct the 8bytes value.
> > Could someone tell me what could be wrong with this array?
>
> First off, is this problem occurring with a WMI class that a driver
> implements, or something else? Can you show us the relevant MOF syntax
> as well?
>
> –
> Walter Oney, Consulting and Training
> Basic and Advanced Driver Programming Seminars
> Now teaming with John Hyde for USB Device Engineering Seminars
> Check out our schedule at http://www.oneysoft.com
>
> —
> You are currently subscribed to ntdev as: xxxxx@syskonnect.de
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>

Ionut Deaconeasa wrote:

Now I will explain in more details what is happening. I have a network
driver that is working perfect and I must to map the GUID to OID. When I am
sending the request for the above class the driver return the right value
for each element of the array (this was verified with windbg). In my
application that show the results last value is afected by strange numbers.
I examined also with WMI CIM studio these returned values and the same
“noise” is in the last value.
If I read byte by byte the buffer than the error does not occur.

Well, it sounds like you’ve tripped on a bug, and it’s hard to say where
it is (but it doesn’t sound like it’s in your code). Maybe you could
just add an extra dummy element that you ignore.


Walter Oney, Consulting and Training
Basic and Advanced Driver Programming Seminars
Now teaming with John Hyde for USB Device Engineering Seminars
Check out our schedule at http://www.oneysoft.com

Walt, thanks for your idea.

Regards,
Ionut.

----- Original Message -----
From: “Walter Oney”
Newsgroups: ntdev
To: “NT Developers Interest List”
Sent: Monday, January 27, 2003 7:01 PM
Subject: [ntdev] Re: WMI help!

> Ionut Deaconeasa wrote:
> > Now I will explain in more details what is happening. I have a network
> > driver that is working perfect and I must to map the GUID to OID. When
I am
> > sending the request for the above class the driver return the right
value
> > for each element of the array (this was verified with windbg). In my
> > application that show the results last value is afected by strange
numbers.
> > I examined also with WMI CIM studio these returned values and the same
> > “noise” is in the last value.
> > If I read byte by byte the buffer than the error does not occur.
>
> Well, it sounds like you’ve tripped on a bug, and it’s hard to say where
> it is (but it doesn’t sound like it’s in your code). Maybe you could
> just add an extra dummy element that you ignore.
>
> –
> Walter Oney, Consulting and Training
> Basic and Advanced Driver Programming Seminars
> Now teaming with John Hyde for USB Device Engineering Seminars
> Check out our schedule at http://www.oneysoft.com
>
> —
> You are currently subscribed to ntdev as: xxxxx@syskonnect.de
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>