Share via


NdisMQueryAdapterResources 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.

NdisMQueryAdapterResources returns a list of hardware resources for a NIC.

Syntax

VOID NdisMQueryAdapterResources(
  _Out_   PNDIS_STATUS        Status,
  _In_    NDIS_HANDLE         WrapperConfigurationContext,
  _Out_   PNDIS_RESOURCE_LIST ResourceList,
  _Inout_ PUINT               BufferSize
);

Parameters

  • Status [out]
    Pointer to a caller-supplied variable in which this function returns the status of the call.

  • WrapperConfigurationContext [in]
    Specifies the handle input to MiniportInitialize.

  • ResourceList [out]
    Pointer to a caller-supplied variable in which NdisMQueryAdapterResources returns a pointer to a list of the hardware resources that the NIC can use.

  • BufferSize [in, out]
    Pointer to a variable that specifies the size in bytes of the caller-allocated buffer on input and the number of bytes of information returned by this call.

Return value

None

Remarks

To get bus-configuration hardware configuration parameters for their NICs, drivers can call NdisMQueryAdapterResources from their MiniportInitialize functions.

The buffer specified at AssignedResources is formatted as an NDIS_RESOURCE_LIST, which is equivalent to the CM_PARTIAL_RESOURCE_LIST on Windows 2000 and later operating systems.

The bus-relative configuration parameters returned in this buffer can be used in the MiniportInitialize function's subsequent calls to NdisXxx functions such as NdisMRegisterInterrupt, NdisMMapIoSpace, and NdisMRegisterIoPortRange.

To determine the required BufferSize, a driver first calls NdisMQueryAdapterResources with BufferSize set to zero. In response, NDIS returns the required buffer size at BufferSize. The driver then allocates that many bytes for the buffer and calls NdisMQueryAdapterResources again with BufferSize set to the buffer size supplied by NDIS.

Requirements

Target platform

Universal

Version

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

Header

Ndis.h (include Ndis.h)

Library

Ndis.lib

IRQL

PASSIVE_LEVEL

See also

MiniportInitialize

NdisMMapIoSpace

NdisMRegisterInterrupt

NdisMRegisterIoPortRange

 

 

Send comments about this topic to Microsoft