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


NdisAdjustMdlLength (Compact 2013)

3/26/2014

This function modifies the length of the data that is associated with an MDL.

Syntax

VOID
  NdisAdjustMdlLength (
    IN PMDL  Mdl,
    IN UINT  Length
    );

Parameters

  • Mdl
    A pointer to a memory descriptor list (MDL).
  • Length
    The number of bytes of data that the MDL describes.

Return Value

None

Remarks

The NdisAdjustMdlLength function modifies the ByteCount member of an MDL that was allocated by calling the NdisAllocateMdl function.

The caller of NdisAdjustMdlLength can pass only an MDL descriptor that the caller allocated. It cannot pass an MDL descriptor that another driver allocated.

For example, the driver of a bus-master DMA network adapter calls NdisAdjustMdlLength with MDL descriptors that it allocated to specify receive MDLs in its shared memory block. Before such a driver indicates received data, it calls NdisAdjustMdlLength to make the MDL descriptor that it will include in the receive indication match the size of the received data if it is less than the size of the network adapter's receive buffer.

The length that is passed to NdisAdjustMdlLength cannot be larger than the length that was passed to NdisAllocateMdl when the MDL descriptor was allocated.

The caller of NdisAdjustMdlLength must restore the length to its original value before it frees the MDL descriptor with NdisFreeMdl.

Callers of NdisAdjustMdlLength can run at any IRQL, but typically run at IRQL <= DISPATCH_LEVEL.

Requirements

Header

ndis.h

See Also

Reference

NDIS NET_BUFFER Functions
NdisAllocateMdl
NdisFreeMdl