NDIS_PACKET_STACK

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

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

Members

  • IMReserved
    An array of two pointers that the caller ofNdisIMGetCurrentPacketStack can use.
  • 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

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

See Also

NdisAllocatePacket | NdisAllocatePacketPool | NdisAllocatePacketPoolEx | NdisGetPoolFromPacket | NdisIMGetCurrentPacketStack

 Last updated on Tuesday, May 18, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.