Bewerken

Delen via


NdisQueryAdapterInstanceName function (ndis.h)

The NdisQueryAdapterInstanceName function retrieves the friendly name of a physical NIC or a virtual adapter that the calling protocol driver is bound to.

Syntax

NDIS_STATUS NdisQueryAdapterInstanceName(
       PNDIS_STRING pAdapterInstanceName,
  [in] NDIS_HANDLE  NdisBindingHandle
);

Parameters

pAdapterInstanceName

A pointer to a caller-supplied NDIS_STRING type that receives a counted Unicode string. This string specifies the friendly name of the interface to which the binding refers. This interface is either a physical NIC or a virtual adapter. For Windows 2000 and later, NDIS defines the NDIS_STRING type as a UNICODE_STRING type.

[in] NdisBindingHandle

A handle that identifies the binding to the target physical NIC or virtual adapter of the next-lower driver to which the caller is bound. Typically, NdisBindingHandle was returned by the NdisOpenAdapterEx function.

Return value

NdisQueryAdapterInstanceName returns NDIS_STATUS_SUCCESS if memory for the string at AdapterInstanceName was successfully allocated; otherwise, it returns NDIS_STATUS_RESOURCES.

Remarks

A protocol driver uses NdisQueryAdapterInstanceName to retrieve the friendly name of a physical NIC or a virtual adapter to which the protocol driver is bound. The protocol driver specifies the handle to such a NIC or virtual adapter in NdisBindingHandle . The protocol driver calls the NdisOpenAdapterEx function to retrieve this handle.

NdisQueryAdapterInstanceName allocates memory for the string that specifies the friendly name. After the caller finishes using this memory, the caller must call the NdisFreeMemory function to release the memory.

Friendly names are intended to help the user quickly and accurately identify a physical NIC or virtual adapter--for example, "PCI Ethernet Adapter" and "Virtual Private Networking Adapter" are considered friendly names.

Requirements

Requirement Value
Minimum supported client Supported for NDIS 6.0 and NDIS 5.1 drivers (see NdisQueryAdapterInstanceName (NDIS 5.1)) in Windows Vista. Supported for NDIS 5.1 drivers (see NdisQueryAdapterInstanceName (NDIS 5.1)) in Windows XP.
Target Platform Desktop
Header ndis.h (include Ndis.h)
Library Ndis.lib
IRQL <= DISPATCH_LEVEL
DDI compliance rules Irql_Miscellaneous_Function(ndis)

See also

NdisFreeMemory

NdisOpenAdapterEx

UNICODE_STRING