NdisCopyFromPacketToPacketSafe - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
// ndis.h

VOID NdisCopyFromPacketToPacketSafe(
  [in]  IN PNDIS_PACKET     Destination,
  [in]  IN UINT             DestinationOffset,
  [in]  IN UINT             BytesToCopy,
  [in]  IN PNDIS_PACKET     Source,
  [in]  IN UINT             SourceOffset,
  [out] OUT PUINT           BytesCopied,
        IN MM_PAGE_PRIORITY Priority
);
View the official Windows Driver Kit DDI reference

NtDoc

No description available.

Windows Driver Kit DDI reference (nf-ndis-ndiscopyfrompackettopacketsafe)

NdisCopyFromPacketToPacket function

Description

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.

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.

Priority

Remarks

Return value: None

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.

See also