Note NDIS 5. x has been deprecated and is superseded by NDIS 6. x. For new NDIS driver development, see Network Drivers Starting with Windows Vista. For information about porting NDIS 5. x drivers to NDIS 6. x, see Porting NDIS 5.x Drivers to NDIS 6.0.
NDIS_PACKET_VALID_COUNTS is a macro that returns the value of the ValidCounts member of a packet descriptor. When a driver supplies an optional = FALSE after the macro, the macro sets the ValidCounts member of a packet descriptor to FALSE.
Pointer to a packet descriptor.
NDIS_PACKET_VALID_COUNTS returns the Boolean value of the ValidCounts member for a specified packet descriptor.
An NDIS driver calls the NDIS_PACKET_VALID_COUNTS macro to obtain the value of the ValidCounts member in the NDIS_PRIVATE_PACKET portion of a packet descriptor. A value of TRUE indicates that the data-related descriptions in the NDIS_PRIVATE_PACKET portion are valid. A value of FALSE indicates that these data-related descriptions are invalid. To obtain such data-related descriptions for a packet descriptor, a driver should call NdisQueryPacket or NdisQueryPacketLength.
After modifying the contents of a buffer, a driver must call NDIS_PACKET_VALID_COUNTS( Packet) = FALSE to set the ValidCounts member of the packet descriptor to FALSE. If a driver does not set the ValidCounts member to FALSE after altering the contents of a buffer or after modifying the NDIS buffer chain, NDIS will not update the data-related descriptions of the packet descriptor when NdisQueryPacket or NdisQueryPacketLength is called, which could cause data-handling problems. For example, if an intermediate driver inserts data into a buffer or modifies the NDIS buffer chain and does not set the ValidCounts member of the packet descriptor to FALSE, an underlying miniport driver that obtains the packet data length by calling the NdisQueryPacket or NdisQueryPacketLength function gets the original, unaltered packet data length rather than the actual packet data length.