NdisBuildScatterGatherList

NdisBuildScatterGatherList function

The NdisBuildScatterGatherList function builds a scatter/gather list by using the specified parameters.

Syntax


NDIS_STATUS NdisBuildScatterGatherList(
  _In_ NDIS_HANDLE                          NdisHandle,
  _In_ PNDIS_SCATTER_GATHER_LIST_PARAMETERS SGListParameters
);

Parameters

NdisHandle [in]

An NDIS driver or instance handle that was obtained during caller initialization. For example, a miniport driver can use the NDIS handle that it obtained from the NdisMRegisterMiniportDriver or MiniportInitializeEx function. Other NDIS drivers can use the handles from the following functions:

NdisRegisterProtocolDriver

NdisOpenAdapterEx

SGListParameters [in]

A pointer to an NDIS_SCATTER_GATHER_LIST_PARAMETERS structure that specifies the parameters for allocating the scatter/gather list.

Return value

NdisBuildScatterGatherList can return the following status values:

Return codeDescription
NDIS_STATUS_SUCCESS

The operation completed successfully.

NDIS_STATUS_BUFFER_TOO_SHORT

The operation failed because the buffer length that is specified in the ScatterGatherListBufferSize member of the NDIS_SCATTER_GATHER_LIST_PARAMETERS structure was too short. In this case, NDIS provided the required buffer size in the ScatterGatherListBufferSizeNeeded member.

 

Remarks

NDIS drivers call the NdisBuildScatterGatherList function to build a scatter/gather list for a buffer. To call this function, a miniport driver specifies a miniport adapter handle or a protocol driver specifies an NDIS binding handle.

The underlying miniport adapter must have called NdisMRegisterScatterGatherDma before a driver can call NdisBuildScatterGatherList.

NDIS calls the NetProcessSGList function that is specified at the ProcessSGListHandler member of the NDIS_SCATTER_GATHER_LIST_PARAMETERS structure within the context of NdisBuildScatterGatherList.

The drivers must call the NdisFreeScatterGatherList function to free a scatter/gather list that was created with the NdisBuildScatterGatherList function.

Requirements

Target platform

Universal

Version

Supported in NDIS 6.20 and later.

Header

Ndis.h (include Ndis.h)

Library

Ndis.lib

IRQL

= DISPATCH_LEVEL

See also

FilterAttach
MiniportInitializeEx
NDIS_SCATTER_GATHER_LIST_PARAMETERS
NdisFRegisterFilterDriver
NdisMRegisterMiniportDriver
NdisMRegisterScatterGatherDma
NdisOpenAdapterEx
NdisRegisterProtocolDriver
NetProcessSGList

 

 

Send comments about this topic to Microsoft

Show:
© 2016 Microsoft