다음을 통해 공유


NdisQueryPacket (Windows Embedded CE 6.0)

1/6/2010

This function returns information about a specified packet.

Syntax

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 Value

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

Header ndis.h
Windows Embedded CE Windows CE .NET 4.0 and later

See Also

Reference

NDIS Library Functions
NdisGetFirstBufferFromPacket
NdisGetNextBuffer
NdisQueryBuffer
NdisUnchainBufferAtBack
NdisUnchainBufferAtFront