NDIS_SET_PACKET_HEADER_SIZE

Windows CE .NET

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.

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 Values

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 HeaderSize once 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 NdisZeroMemory function 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

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

See Also

NdisAllocatePacket | NDIS_GET_PACKET_HEADER_SIZE | NdisMIndicateReceivePacket | NDIS_OOB_DATA_FROM_PACKET | NdisZeroMemory


 Last updated on Tuesday, May 18, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.

Show: