NDIS 6 MIB_UNICASTIPADDRESS_TABLE padding

The docs say that the MIB_UNICASTIPADDRESS_TABLE structure

"might contain padding for alignment between the NumEntries member and the first MIB_UNICASTIPADDRESS_ROW array entry in the Table member. Padding for alignment might also be present between the MIB_UNICASTIPADDRESS_ROW array entries in the Table member. Any access to a MIB_UNICASTIPADDRESS_ROW array entry should assume padding might exist. "

How does one determine if the padding is there or not?

Larry C

This structure has the same padding as any other structure declared in Windows headers; there’s nothing special about it. Just index into the array with normal C code.

PMIB_UNICASTIPADDRESS_TABLE Table = /* blah */;
for ( i = 0; i < Table->NumEntries; i++)
{
PMIB_UNICASTIPADDRESS_ROW Row = &Table->Table[i];
DoSomething(Row);
}

I don’t know why that message is in the documentation. Of course it’s a true statement, but it’s also true for 1000’s of other structures as well.

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@honeywell.com
Sent: Wednesday, February 10, 2010 1:06 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] NDIS 6 MIB_UNICASTIPADDRESS_TABLE padding

The docs say that the MIB_UNICASTIPADDRESS_TABLE structure

"might contain padding for alignment between the NumEntries member and the first MIB_UNICASTIPADDRESS_ROW array entry in the Table member. Padding for alignment might also be present between the MIB_UNICASTIPADDRESS_ROW array entries in the Table member. Any access to a MIB_UNICASTIPADDRESS_ROW array entry should assume padding might exist. "

How does one determine if the padding is there or not?

Larry C


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

That’s what I thought and had it coded that way. I had to add some features and was testing on a new platform when it stopped working. In my zeal to make better maintainable code the Netioapi.h include statement got accidently moved into a group of include files with different packing, throwing off the offests. So much for trying to make working code look pretty… i.e. if it’s working don’t touch it!

Thanks.

Larry C