This function returns information about a specified packet.
Header file: | Ndis.h |
Windows CE versions: | 2.0 and later |
VOID NdisQueryPacket( IN PNDIS_PACKET Packet,
OUT PUINT PhysicalBufferCount OPTIONAL,
OUT PUINT BufferCount OPTIONAL,
OUT PNDIS_BUFFER *FirstBuffer OPTIONAL,
OUT PUINT TotalPacketLength OPTIONAL );
This function returns caller-selected information about a specified packet. The caller must specify at least one of the PhysicalBufferCount, BufferCount, FirstBuffer, and TotalPacketLength pointers, along with the Packet parameter. A caller can specify explicit pointers for all parameters.
Specifying an explicit PhysicalBufferCount pointer is equivalent to summing calls to the NdisGetBufferPhysicalArraySize function for each buffer descriptor in the packet descriptor. A driver can call the NdisGetNextBuffer function 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 BufferCount pointer, 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 NdisUnchainBufferXXX functions.
If the caller supplies an explicit FirstBuffer pointer but the packet’s buffer chain is empty, this function returns NULL at FirstBuffer. Otherwise, the caller can use NdisQueryBuffer subsequently to get details about the initial buffer descriptor for the packet. As a faster alternative, drivers can call NdisGetFirstBufferFromPacket to get a pointer to the initial buffer descriptor.
If the caller supplies an explicit TotalPacketLength pointer, 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.
NdisGetFirstBufferFromPacket, NdisGetNextBuffer, NdisQueryBuffer, NdisUnchainBufferAtBack, NdisUnchainBufferAtFront