Compartir a través de


NdisQueryPacket (Windows CE 5.0)

Send Feedback

This function returns information about a specified packet.

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

Parameters

  • Packet
    [in] Pointer to a packet descriptor.
  • PhysicalBufferCount
    [out] Optional. Pointer to a caller-supplied variable that contains the maximum number of physical breaks mapped by the buffer descriptors. This parameter can be NULL.
  • BufferCount
    [out] Optional. 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
    [out] Optional. 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
    [out] Optional. 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.

Return Values

Returns the maximum number of physical breaks mapped by the buffer descriptors chained to the given packet.

Remarks

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.

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.

Requirements

OS Versions: Windows CE .NET 4.0 and later.
Header: Ndis.h.

See Also

NdisGetFirstBufferFromPacket | NdisGetNextBuffer | NdisQueryBuffer | NdisUnchainBufferAtBack | NdisUnchainBufferAtFront

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.