Développer Réduire

NdisCopyFromPacketToPacket 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.

NdisCopyFromPacketToPacket copies a specified range of data from one packet to another.

Syntax


VOID NdisCopyFromPacketToPacket(
  _In_   PNDIS_PACKET Destination,
  _In_   UINT DestinationOffset,
  _In_   UINT BytesToCopy,
  _In_   PNDIS_PACKET Source,
  _In_   UINT SourceOffset,
  _Out_  PUINT BytesCopied
);

Parameters

Destination [in]

Pointer to the destination packet descriptor.

DestinationOffset [in]

Specifies the byte offset within the destination packet at which to begin writing the copied data.

BytesToCopy [in]

Specifies the number of bytes to copy.

Source [in]

Pointer to the source packet descriptor.

SourceOffset [in]

Specifies the byte offset within the source packet at which to begin copying the data.

BytesCopied [out]

Pointer to the caller-supplied variable in which this function returns the number of bytes actually copied. This number can be less than the value of BytesToCopy if the source packet runs out of data or the destination packet runs out of space.

Return value

None

Remarks

Drivers should call NdisCopyFromPacketToPacketSafe instead of NdisCopyFromPacketToPacket. NDIS 5.1 miniport drivers must call NdisCopyFromPacketToPacketSafe instead of NdisCopyFromPacketToPacket. Unlike NdisCopyFromPacketToPacket, NdisCopyFromPacketToPacketSafe does not cause a bug check if system resources are low or exhausted.

The caller of NdisCopyFromPacketToPacket allocates the destination packet, if not the source packet as well. The packet descriptor of the destination packet should have enough chained buffer descriptors to receive the data.

If the source packet runs out of data or the destination packet out of space before the specified number of bytes has been copied, the copy operation stops. In either case, NdisCopyFromPacketToPacket returns the number of bytes successfully copied from the source to the destination packet.

NdisCopyFromPacketToPacket does not copy any out-of-band information associated with the given Source to the Destination. To copy this information, the driver can use pointers returned by NDIS_OOB_DATA_FROM_PACKET and then call NdisMoveMemory.

The driver must release any spin lock it is holding before calling NdisCopyFromPacketToPacket.

Requirements

Version

Not supported for NDIS 6.0 drivers in Windows Vista. Use NdisCopyFromNetBufferToNetBufferinstead. Supported for NDIS 5.1 drivers in Windows Vista and Windows XP, but use NdisCopyFromPacketToPacketSafe instead.

Header

Ndis.h (include Ndis.h)

IRQL

<= DISPATCH_LEVEL.

See also

NdisAllocateBuffer
NdisAllocatePacket
NdisCopyFromPacketToPacketSafe
NdisMoveMemory
NDIS_OOB_DATA_FROM_PACKET
NDIS_PACKET_OOB_DATA

 

 

Send comments about this topic to Microsoft

Afficher:
© 2014 Microsoft