NdisGetFirstBufferFromPacket function

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.

NdisGetFirstBufferFromPacket returns pointers to the buffer descriptor and base virtual address for the first buffer chained to a given packet descriptor, along with the size of the first buffer and the total number of bytes mapped by all buffer descriptors chained to the packet descriptor.

Syntax

VOID NdisGetFirstBufferFromPacket(
  _In_  PNDIS_PACKET Packet,
  _Out_ PNDIS_BUFFER *FirstBuffer,
  _Out_ PVOID        *FirstBufferVA,
  _Out_ PUINT        FirstBufferLength,
  _Out_ PUINT        TotalBufferLength
);

Parameters

  • Packet [in]
    Pointer to the packet descriptor from which this macro extracts information about the initial buffer.

  • FirstBuffer [out]
    Pointer to a caller-supplied variable in which this macro returns the address of the initial buffer descriptor chained to the given packet descriptor.

  • FirstBufferVA [out]
    Pointer to a caller-supplied variable in which this macro returns the base virtual address of the initial buffer associated with the packet.

  • FirstBufferLength [out]
    Pointer to a caller-supplied variable in which this macro returns the number of bytes mapped by the initial buffer descriptor chained to the packet descriptor.

  • TotalBufferLength [out]
    Pointer to a caller-supplied variable in which this macro returns the total number of bytes mapped by all buffer descriptors chained to the packet descriptor.

Return value

None

Remarks

Drivers should call NdisGetFirstBufferFromPacketSafe instead of NdisGetFirstBufferFromPacket. NDIS 5.1 miniport drivers must call NdisGetFirstBufferFromPacketSafe instead of NdisGetFirstBufferFromPacket. Unlike NdisGetFirstBufferFromPacket, NdisGetFirstBufferFromPacketSafe does not cause a bug check if system resources are low or exhausted.

Drivers call NdisGetFirstBufferFromPacketSafe to get information about the initial buffer and amount of data associated with a given packet faster than they can by making calls to NdisQueryPacket and, then, NdisQueryBuffer or NdisQueryBufferSafe.

Requirements

Target platform

Universal

Version

Not supported for NDIS 6.0 drivers in Windows Vista. Use NdisGetFirstBufferFromPacketSafeinstead. Supported for NDIS 5.1 drivers in Windows Vista and Windows XP.

Header

Ndis.h (include Ndis.h)

Library

Ndis.lib

IRQL

<= DISPATCH_LEVEL

See also

MiniportSend

MiniportSendPackets

NdisGetFirstBufferFromPacketSafe

NdisGetNextBuffer

NDIS_PACKET

NdisQueryBuffer

NdisQueryBufferSafe

NdisQueryPacket

ProtocolReceivePacket

 

 

Send comments about this topic to Microsoft