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


NdisGetBufferPhysicalArraySize function

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.

NdisGetBufferPhysicalArraySize returns the number of discontiguous physical blocks backing a buffer, given the buffer descriptor.

Syntax

VOID NdisGetBufferPhysicalArraySize(
  _In_  PNDIS_BUFFER Buffer,
  _Out_ PUINT        ArraySize
);

Parameters

  • Buffer [in]
    Pointer to the buffer descriptor.

  • ArraySize [out]
    Pointer to a caller-supplied variable in which this function returns the number of discrete physical ranges backing the buffer.

Return value

None

Remarks

The driver of a bus-master DMA NIC might call NdisGetBufferPhysicalArraySize to determine how many NDIS_PHYSICAL_ADDRESS structures to allocate and fill in before calling NdisMStartBufferPhysicalMapping.

A protocol driver might call NdisGetBufferPhysicalArraySize to build a scatter/gather list for an underlying NIC driver. However, a protocol driver with such NIC-specific functionality is unlikely to be bindable to any other NIC driver.

The maximum number of physical blocks in the buffer can be one more than the number this function writes, depending on the arrangement of the buffer in paged memory. NdisGetBufferPhysicalArraySize returns the number of pages required to back a buffer of the given length, so if the buffer descriptor actually maps a buffer that begins at an offset within a page, the value returned by this call is one less than the number of page breaks.

A driver must release any spin lock it is holding before calling NdisGetBufferPhysicalArraySize.

Requirements

Target platform

Universal

Version

Not supported for NDIS 6.0 drivers in Windows Vista. Use NdisGetMdlPhysicalArraySizeinstead. Supported for NDIS 5.1 drivers in Windows Vista and Windows XP.

Header

Ndis.h (include Ndis.h)

Library

Ndis.lib

IRQL

<= DISPATCH_LEVEL

See also

NDIS_PHYSICAL_ADDRESS

NdisMStartBufferPhysicalMapping

 

 

Send comments about this topic to Microsoft