Compartilhar via


NdisReinitializePacket

This function removes any chained buffers from a given packet and reinitializes it for reuse.

VOID NdisReinitializePacket(
IN OUT PNDIS_PACKET Packet );

Parameters

  • Packet
    Pointer to the packet descriptor allocated by the caller.

Remarks

This function reinitializes a packet descriptor so that the MiniportReserved and ProtocolReserved arrays contain all 0s and the head of the buffer chain is set to NULL.

A driver can call this function only with packet descriptors allocated by that driver. For example, a MiniportReturnPacket function is likely to call this function to prepare a driver-allocated packet for use in a subsequent receive indication.

Before calling this function, a driver must call the NdisFreeBuffer or the NdisUnchainBufferAtXXX functions as many times as necessary to release or to save all buffer descriptors chained to the packet. Otherwise, a call to this function causes a memory leak: all memory associated with the buffer descriptor chain cannot be used by NDIS or by the driver until the system is rebooted.

A driver can call the NdisQueryPacket function to determine how many buffer descriptors are chained to a given packet and, therefore, how many calls to NdisFreeBuffer or NdisUnchainBufferAtXXX are required. It can call the NdisGetNextBuffer function to retrieve each buffer descriptor pointer to pass to NdisFreeBuffer.

A call to this function has no effect on the NDIS_PACKET_OOB_DATA structure associated with the packet descriptor. To prepare this block for reuse, the allocating driver can reset the relevant members with the appropriate **NDIS_SET_PACKET_**XXX macro(s).

A driver that calls this function can run at any IRQL.

Requirements

Runs on Versions Defined in Include Link to
Windows CE OS 2.0 and later Ndis.h    

Note   This API is part of the complete Windows CE OS package as provided by Microsoft. The functionality of a particular platform is determined by the original equipment manufacturer (OEM) and some devices may not support this API.

See Also

NDIS_SET_PACKET_HEADER_SIZE, NDIS_SET_PACKET_MEDIA_SPECIFIC_INFO, NDIS_SET_PACKET_STATUS, NDIS_SET_PACKET_TIME_RECEIVED, NDIS_SET_PACKET_TIME_TO_SEND, NdisAllocatePacket, NdisFreeBuffer, NdisGetNextBuffer, NdisQueryPacket, NdisUnchainBufferAtBack, NdisUnchainBufferAtFront, NdisZeroMemory

 Last updated on Tuesday, July 13, 2004

© 1992-2000 Microsoft Corporation. All rights reserved.