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.
NdisAdjustBufferLength modifies the length specified in a buffer descriptor allocated or copied by the caller.
- Buffer [in]
- Length [in]
Specifies the new length in bytes to be set in the buffer descriptor.
The caller of NdisAdjustBufferLength can pass only a buffer descriptor that was allocated by the caller. It cannot pass a buffer descriptor that was allocated by another driver.
For example, the driver of a bus-master DMA NIC calls this function with buffer descriptors that it allocated to specify receive buffers in its shared memory block. Before such a driver indicates received data, it calls NdisAdjustBufferLength to make the buffer 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 NIC's receive buffer. When a receive packet with such an adjusted buffer descriptor has been consumed and returned to the miniport driver, the driver again calls NdisAdjustBufferLength to make the buffer descriptor match the actual size of its receive buffer again.
The caller of NdisAdjustBufferLength must restore the length to its original value before it frees the buffer descriptor with NdisFreeBuffer.
The driver must release any spin lock it is currently holding before calling NdisAdjustBufferLength.
|Not supported for NDIS 6.0 drivers in Windows Vista. Supported for NDIS 5.1 drivers in Windows Vista and Windows XP.|
|Any level (but typically run at IRQL <= DISPATCH_LEVEL)|