Share via


NDIS_PACKET_STACK (Windows Embedded CE 6.0)

1/6/2010

This structure is a descriptor of the current stack in a packet.

Syntax

typedef struct _NDIS_PACKET_STACK {
  ULONG_PTR IMReserved[2];
  ULONG_PTR NdisReserved[4];
} NDIS_PACKET_STACK, *PNDIS_PACKET_STACK;

Members

  • NdisReserved
    An array of pointers that NDIS uses.

Remarks

By default, each NDIS packet contains two NDIS_PACKET_STACK structures. After calling NdisIMGetCurrentPacketStack to obtain a pointer to an NDIS_PACKET_STACK structure, an intermediate driver can store or retrieve driver-defined information at the locations referenced by the pointers in the IMReserved array. This capability allows the intermediate driver to reuse a packet — that is, pass the packet to the adjacent driver without having to allocate an additional packet into which the intermediate driver copies the original packet. Typically, an intermediate driver calls NdisIMGetCurrentPacketStack in the context of its send and receive functions.

NDIS modifies the stack pointer as the packet traverses through each intermediate driver. If all stack locations for intermediate drivers are in use in the packet, NdisIMGetCurrentPacketStack returns NULL and, in StacksRemaining, FALSE.

If NdisIMGetCurrentPacketStack returns FALSE in StacksRemaining, the intermediate driver must allocate a packet pool and a packet descriptor and copy the original packet into the newly allocated packet before passing the packet to another driver. NdisIMGetCurrentPacketStack returns FALSE in StacksRemaining if the number of intermediate drivers that the packet traverses through exceeds the number of configured stacks. Note that the number of stacks in a packet cannot be dynamically altered.

Requirements

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

See Also

Reference

NDIS Structures
NdisAllocatePacket
NdisAllocatePacketPool
NdisAllocatePacketPoolEx
NdisGetPoolFromPacket
NdisIMGetCurrentPacketStack