次の方法で共有


NDIS_GET_PACKET_HEADER_SIZE (Windows Embedded CE 6.0)

1/6/2010

This macro returns the HeaderSize value from the out-of-band data block associated with a given packet descriptor.

Syntax

UINT NDIS_GET_PACKET_HEADER_SIZE(
  PNDIS_PACKET _Packet
);

Parameters

  • _Packet
    Points to a packet descriptor.

Return Value

The return value is the value set in the HeaderSize member of the NDIS_PACKET_OOB_DATA block associated with the given packet descriptor.

Remarks

The HeaderSize specifies the number of bytes of medium-specific header mapped by the initial buffer descriptor chained to the packet descriptor. A NIC driver sets this value with NDIS_SET_PACKET_HEADER_SIZE in the out-of-band data block for the receive packets it will indicate with NdisMIndicateReceivePacket. Typically, a NIC miniport sets the HeaderSize once in each packet descriptor it allocates with NdisAllocatePacket for subsequent receive indications, and the value it sets depends on the medium it selected during initialization.

An NDIS intermediate driver that translates indicated packets to another medium for still higher level protocols would use NDIS_SET_PACKET_HEADER to set the header size to a value appropriate to its own medium as it translates incoming receives.

The NDIS_GET_PACKET_HEADER_SIZE macro is defined as follows.

#define NDIS_GET_PACKET_HEADER_SIZE(_Packet) \
((PNDIS_PACKET_OOB_DATA)((PUCHAR)(_Packet) + \
(_Packet)->Private.NdisPacketOobOffset))->HeaderSize

Requirements

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

See Also

Reference

Network Driver Macros
NDIS_PACKET_OOB_DATA
NDIS_SET_PACKET_HEADER_SIZE
NdisAllocatePacket
NdisMIndicateReceivePacket
NdisSend
NdisSendPackets