NDIS_SET_PACKET_HEADER_SIZE (Windows Embedded CE 6.0)

1/6/2010

This macro sets the HeaderSize member in the NDIS_OOB_DATA_FROM_PACKET structure associated with a specified packet descriptor for a subsequent receive indication.

Syntax

UINT NDIS_SET_PACKET_HEADER_SIZE(
  PNDIS_PACKET _Packet,
  UINT _HdrSize
);

Parameters

  • _Packet
    Pointer to a driver-allocated packet descriptor.
  • _HdrSize
    Specifies the medium-specific number of bytes in the net packet header.

Return Value

The return value is the _HdrSize value.

Remarks

The HeaderSize member in NDIS_PACKET_OOB_DATA associated with a packet descriptor specifies the number of bytes of medium-specific header in the buffer mapped by the initial buffer descriptor chained to the packet descriptor.

A lower-level driver sets this member with this macro in the out-of-band (OOB) data blocks for the receive packets it subsequently indicates with the NdisMIndicateReceivePacket function. Typically, a miniport sets the HeaderSizeonce for each packet descriptor that it allocates with the NdisAllocatePacket function for subsequent receive indications, depending on the medium that it selects during initialization. If such a driver clears the OOB data block with the NDIS_OOB_DATA_FROM_PACKET macro and the NdisZeroMemoryfunction when it regains ownership of its receive packet descriptors. That driver must call this macro before it reuses each packet descriptor in a subsequent indication.

When such an indication is made, bound protocols can retrieve this information with the NDIS_GET_PACKET_HEADER_SIZE macro.

The NDIS_SET_PACKET_HEADER_SIZE macro is defined as follows.

#define NDIS_SET_PACKET_HEADER_SIZE(_Packet, _HdrSize)      \
    ((PNDIS_PACKET_OOB_DATA)((PUCHAR)(_Packet) +            \
    (_Packet)->Private.NdisPacketOobOffset))->HeaderSize = (_HdrSize)

Requirements

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

See Also

Reference

Network Driver Macros
NdisAllocatePacket
NDIS_GET_PACKET_HEADER_SIZE
NdisMIndicateReceivePacket
NDIS_OOB_DATA_FROM_PACKET
NdisZeroMemory