Microsoft Windows CE 3.0  

NdisQueryPacket

Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

This function returns information about a specified packet.

VOID NdisQueryPacket(
IN PNDIS_PACKET
Packet
,
OUT PUINT
PhysicalBufferCount
OPTIONAL,
OUT PUINT
BufferCount
OPTIONAL,
OUT PNDIS_BUFFER *
FirstBuffer
OPTIONAL,
OUT PUINT
TotalPacketLength
OPTIONAL);

Parameters

Packet
Pointer to a packet descriptor.
PhysicalBufferCount
Pointer to a caller-supplied variable in which this function returns the maximum number of physical breaks mapped by the buffer descriptors chained to the given packet. This parameter can be NULL.
BufferCount
Pointer to a caller-supplied variable in which this function returns the number of buffer descriptors chained to the specified packet. This parameter can be NULL.
FirstBuffer
Pointer to a caller-supplied variable in which this function returns a pointer to the initial buffer descriptor chained to the specified packet. This parameter can be NULL.
TotalPacketLength
Pointer to a caller-supplied variable in which this function returns the number of bytes of packet data mapped by all chained buffer descriptors. This parameter can be NULL.

Remarks

This function returns caller-selected information about a specified packet. The caller must specify at least one of the PhysicalBufferCount, BufferCount, FirstBuffer, and TotalPacketLengthpointers, along with the Packet parameter. A caller can specify explicit pointers for all parameters.

Specifying an explicit PhysicalBufferCountpointer is equivalent to summing calls to the NdisGetBufferPhysicalArraySizefunction for each buffer descriptor in the packet descriptor. A driver can call the NdisGetNextBufferfunction as many times as necessary to retrieve pointers to any subsequent buffer descriptors in the chain, unless the call returns 0, indicating that the packet descriptor has no data.

If the caller supplies an explicit BufferCountpointer, this function returns the number of buffer descriptors in the packet chain. The return value can be used as a loop counter to retrieve buffer descriptors in the chain with either of the NdisUnchainBuffer XXXfunctions.

If the caller supplies an explicit FirstBufferpointer but the packet's buffer chain is empty, this function returns NULL at FirstBuffer. Otherwise, the caller can use NdisQueryBuffersubsequently to get details about the initial buffer descriptor for the packet. As a faster alternative, drivers can call NdisGetFirstBufferFromPacketto get a pointer to the initial buffer descriptor.

If the caller supplies an explicit TotalPacketLengthpointer, this function returns the total number of bytes specified by every buffer descriptor chained to the specified packet.

A driver that calls this function can run at any IRQL.

Requirements

Runs on Versions Defined in Include Link to
Windows CE OS 2.0 and later Ndis.h    
Note   This API is part of the complete Windows CE OS package as provided by Microsoft. The functionality of a particular platform is determined by the original equipment manufacturer (OEM) and some devices may not support this API.

See Also

NdisGetFirstBufferFromPacket, NdisGetNextBuffer, NdisQueryBuffer, NdisUnchainBufferAtBack, NdisUnchainBufferAtFront



 Last updated on Tuesday, July 13, 2004

© 2004 Microsoft Corporation. All rights reserved.