Поделиться через


NdisReinitializePacket function

Note   NDIS 5. x has been deprecated and is superseded by NDIS 6. x. For new NDIS driver development, see Network Drivers Starting with Windows Vista. For information about porting NDIS 5. x drivers to NDIS 6. x, see Porting NDIS 5.x Drivers to NDIS 6.0.

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

Syntax

VOID NdisReinitializePacket(
  _Inout_ PNDIS_PACKET Packet
);

Parameters

  • Packet [in, out]
    Pointer to the packet descriptor, allocated by the caller.

Return value

None

Remarks

NdisReinitializePacket reinitializes a packet descriptor so that the head of the buffer chain is set to NULL. NdisReinitializePacket does not reinitialize the MiniportReserved, MiniportReservedEx, Reserved, or ProtocolReserved arrays in NDIS_PACKET. If a driver allocated the packet, it can use an internal, driver-specific function to reinitialize one or more of these arrays, as appropriate. For example, a miniport driver, if deserialized, can reinitialize the MiniportReservedEx array, or, if serialized, the MiniportReserved array. A protocol driver can reinitialize the ProtocolReserved array. An intermediate driver can reinitialize the MiniportReserved array and the ProtocolReserved array.

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

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

A call to NdisReinitializePacket has no effect on the NDIS_PACKET_OOB_DATA block associated with the packet descriptor. To prepare this block for reuse, the allocating driver can either call NdisZeroMemory with the pointer returned by NDIS_OOB_DATA_FROM_PACKET or it can reset the relevant members with the appropriate NDIS_SET_PACKET_XXX macro(s).

Requirements

Target platform

Desktop

Version

Not supported for NDIS 6.0 drivers in Windows Vista. Supported for NDIS 5.1 drivers in Windows Vista and Windows XP.

Header

Ndis.h (include Ndis.h)

IRQL

Any level

See also

MiniportReturnPacket

NdisAllocatePacket

NdisDprAllocatePacket

NdisFreeBuffer

NdisGetNextBuffer

NDIS_OOB_DATA_FROM_PACKET

NDIS_PACKET

NDIS_PACKET_OOB_DATA

NdisQueryPacket

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

NdisUnchainBufferAtBack

NdisUnchainBufferAtFront

NdisZeroMemory

 

 

Send comments about this topic to Microsoft