Microsoft Windows CE 3.0  

NdisAdjustBufferLength

Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

This function modifies the length specified in a buffer descriptor allocated or copied by the caller.

VOID NdisAdjustBufferLength(
IN PNDIS_BUFFER
Buffer
,
IN UINT
Length
);

Parameters

Buffer
Pointer to the buffer descriptor previously allocated with the NdisAllocateBufferfunction.
Length
Specifies the new length, in bytes, to be set in the buffer descriptor.

Remarks

The caller of this function 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 busmaster DMA network adapter 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 this function to make the buffer descriptor that it includes 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. When a receive packet with such an adjusted buffer descriptor has been consumed and returned to the miniport, the driver again calls this function to make the buffer descriptor match the actual size of its receive buffer again.

The Lengthparameter passed to this function cannot be larger than the Lengththat was passed to the NdisAllocateBufferfunction when the buffer descriptor was allocated.

The caller of this function must restore the length to its original value before it frees the buffer descriptor with the NdisFreeBufferfunction.

The driver must release any spin lock that it is currently holding before calling this function.

Requirements

Runs on Versions Defined in Include Link to
Windows CE OS 2.0 and later Ndis.h   Ndislib.lib
Note   This API is part of the complete Windows CE OS package as provided by Microsoft. The functionality of a particular platform is determined by the original equipment manufacturer (OEM) and some devices may not support this API.

See Also

NdisAllocateBuffer, NdisFreeBuffer, NdisReleaseSpinLock