次の方法で共有


NdisReadNetworkAddress (Compact 2013)

3/26/2014

This function returns the software-configurable network address that was stored in the registry for an network adapter when it was installed in the device.

Syntax

VOID NdisReadNetworkAddress(
  PNDIS_STATUS Status,
  PVOID* NetworkAddress,
  PUINT NetworkAddressLength,
  NDIS_HANDLE ConfigurationHandle
);

Parameters

  • Status
    [out] Pointer to a caller-supplied variable in which this function returns the status of the call.
  • NetworkAddress
    [out] Pointer to a caller-supplied variable in which this function returns a pointer to the buffered network address, stored as a sequence of byte integers, if the call is successful.
  • NetworkAddressLength
    [out] Pointer to a caller-supplied variable in which this function returns the number of bytes returned at NetworkAddress.

Return Value

The following table shows the return values for this function.

Value

Description

NDIS_STATUS_SUCCESS

The caller can use the address returned at NetworkAddress for its network adapter.

NDIS_STATUS_FAILURE

There was no network adapter address information available in the caller's registry Parms key, or the value that was stored was not a string.

Remarks

This function searches the registry Parameters key designated by the specified ConfigurationHandle for the keyword NetworkAddress, converts the value of this string-type entry into a sequence of byte integers, and stores the requested information internally. The storage that NDIS allocates for such an address remains valid until the network adapter driver calls NdisCloseConfiguration, which frees the memory.

The caller cannot use the variable at NetworkAddress as a pointer unless this function returns NDIS_STATUS_SUCCESS at Status.

The installation program for an network adapter that supports software-configurable network addressing stores a value entry named with the NetworkAddress keyword in the appropriate XXX\DriverName\Parms key of the registry.

An network adapter installer usually stores the value of a NetworkAddress entry in the registry as a string of hexadecimal digits. Optionally, an installer can store such an address as a string of paired digits, with each pair separated from the next by a hyphen. This function discards hyphens and converts each such pair into a single byte.

In either form, this function converts the address specified as a string, one character at a time, into the equivalent integer until the string is exhausted.

Requirements

Header

ndis.h

See Also

Reference

NDIS Configuration Interface
NdisCloseConfiguration
NdisOpenConfiguration