Freigeben über


NdisReadConfiguration (Compact 2013)

3/26/2014

This function returns the value of a named entry of the specified type from the registry, as long as it has the handle to an open registry key.

Syntax

VOID NdisReadConfiguration(
  PNDIS_STATUS Status,
  PNDIS_CONFIGURATION_PARAMETER* ParameterValue,
  NDIS_HANDLE ConfigurationHandle,
  PNDIS_STRING Keyword,
  NDIS_PARAMETER_TYPE ParameterType
);

Parameters

  • Status
    [out] Pointer to a caller-supplied variable in which this function returns the status of the call.
  • ParameterValue
    [out] Pointer to a caller-supplied variable in which a successful call to this function returns a pointer to an NDIS_CONFIGURATION_PARAMETER structure.
  • ConfigurationHandle
    [in] Handle returned by NdisOpenConfiguration to an network adapter driver's XXX\DriverName\Parms registry key or by NdisOpenProtocolConfiguration to a protocol's XXX\NICDriverInstance\Parms\ProtocolName key in the protocol section of the registry.
  • Keyword
    [in] Pointer to a caller-supplied counted string, in the system-default character set, specifying the name of the entry under the open registry key for which to return the value. This parameter can also point to one of the following predefined global keywords for all NDIS drivers:

    • Environment
    • Processor Type
  • ParameterType
    [in] Specifies the type of the value entry as one of the following.

    Value

    Description

    NdisParameterInteger

    Specifies an integer in decimal notation.

    NdisParameterHexInteger

    Specifies an integer in hexadecimal notation.

    NdisParameterString

    Specifies a string of type NDIS_STRING.

    NdisParameterMultiString

    Specifies a multistring parameter of the Microsoft® Windows NT®-defined REG_MULTI_SZ type.

Return Value

The following table shows the return values for this function.

Value

Description

NDIS_STATUS_SUCCESS

The buffer specified at ParameterValue contains the returned configuration information.

NDIS_STATUS_RESOURCES

NDIS could not allocate resources, usually sufficient memory, to return the requested information.

NDIS_STATUS_FAILURE

The requested information could not be found under the opened registry key designated by the ConfigurationHandle.

Remarks

Every NDIS driver can set up configuration information in the registry for itself under the driver's Parameters key, by using an installation script. For example, a protocol driver might store its own name as an entry with a preformatted string value that can be passed in calls to the NdisRegisterProtocol function.

Each network adapter driver also has associated value entries under the driver's Parameters registry key. The value entries for any particular network adapter driver can be device-dependent. For example, an Ethernet network adapter driver might have keywords such as InterruptNumber, SharedMemoryAddress, and MulticastListSize. The value associated with such an NDIS keyword can be either an integer (ULONG-type) or a string (NDIS_STRING-type). For example, the set of possible values for the InterruptNumber entry mentioned might be NdisParameterInteger values 2, 3, 4, or 5, or the equivalents in hexadecimal as NdisParameterHexInteger values.

This function buffers and copies the caller-supplied string at Keyword and releases the storage that it allocates for this copy before it returns control to the caller. The memory that it allocates for the NDIS_CONFIGURATION_PARAMETER structure is freed when the driver releases the ConfigurationHandle with the NdisCloseConfiguration function. The caller of this function is responsible for releasing the buffered string at Keyword.

Requirements

Header

ndis.h

See Also

Reference

NDIS Configuration Interface
NdisAnsiStringToUnicodeString
NdisCloseConfiguration
NdisFreeString
NdisInitAnsiString
NdisInitializeString
NdisInitUnicodeString
NdisOpenConfiguration
NdisOpenProtocolConfiguration
NdisReadNetworkAddress
NdisUnicodeStringToAnsiString
NdisWriteConfiguration
NDIS_CONFIGURATION_PARAMETER
NdisRegisterProtocol