Funzione NdisReadConfiguration (ndis.h)

The NdisReadConfiguration function returns the value of a named entry of the specified type from the registry, given the handle to an open registry key. This function must be invoked serially with respect to itself and the NdisWriteConfiguration function.

Syntax

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

Parameters

[out] Status

Puntatore a una variabile fornita dal chiamante in cui questa funzione restituisce lo stato della chiamata come uno dei valori seguenti.

Value Meaning
NDIS_STATUS_SUCCESS
The buffer at ParameterValue contains the returned configuration information.
NDIS_STATUS_RESOURCES
NDIS non è riuscito ad allocare risorse, in genere memoria sufficiente, per restituire le informazioni richieste.
NDIS_STATUS_FAILURE
The requested information could not be found under the opened registry key designated by the ConfigurationHandle.

[out] ParameterValue

Puntatore a una posizione di memoria in cui NDIS fornisce un puntatore a un NDIS_CONFIGURATION_PARAMETER structure if the call to NdisReadConfiguration is successful. NDIS alloca memoria per l'oggetto NDIS_CONFIGURATION_PARAMETER structure.

[in] ConfigurationHandle

The handle to a registry key that was returned by the NdisOpenConfigurationEx, NdisOpenConfigurationKeyByIndex, or NdisOpenConfigurationKeyByName function.

[in] Keyword

Puntatore a un chiamante fornito NDIS_STRING tipo che descrive una stringa con conteggiata, nel set di caratteri predefinito del sistema, specificando il nome della voce sotto la chiave del Registro di sistema aperta per cui restituire il valore.

In alternativa, puntatore a un chiamante fornito NDIS_STRING_CONSTANT specificando uno dei nomi di voce predefiniti seguenti insieme ai valori restituiti predefiniti:

Nome voce predefinito Valori restituiti predefiniti
ProcessorType
  • NdisProcessorX86
  • NdisProcessorAmd64
  • NdisProcessorIA64
  • NdisProcessorAlpha
Di seguito è possibile solo se un driver precedente (pre-NDIS 6.0):
  • NdisProcessorMips
  • NdisProcessorPpc
NdisVersion 0xMMMMmmmm, where MMMM is the major version and mmmm is the minor version number. Ad esempio, 0x00050000 indica che la versione NDIS più elevata supportata dal sistema è la versione principale 5, secondaria 0.

[in] ParameterType

The type of the value entry that is specified as one of the NDIS_PARAMETER_TYPE enumeration values. Questo parametro viene ignorato in Windows NT e versioni successive.

Return value

None

Remarks

In the configuration registry of Windows 2000 and later versions, an NDIS keyword is a synonym for a value entry name. Such a name is a counted sequence of Unicode characters, terminated with a NULL.

Every NDIS driver can set up configuration information in the registry for itself using the AddReg directive in its INF file. Ad esempio, un driver di protocollo potrebbe archiviare il proprio nome come voce con un valore stringa preformattato che può essere passato nelle chiamate a NdisRegisterProtocolDriver function. Per altre informazioni, vedere add-registry-sections in a Network INF File.

Ogni driver miniport include anche voci di valore associate nel Registro di sistema. Le voci di valore per qualsiasi particolare driver miniport possono dipendere dalla natura del dispositivo. Ad esempio, un driver miniport potrebbe avere parole chiave come *FlowControl, *SpeedDuplex e *InterruptModeration. Il valore associato a tale parola chiave NDIS può essere un numero intero (tipo ULONG) o una stringa (NDIS_STRING-type). For example, the set of possible values for the already mentioned *FlowControl entry might be NdisParameterInteger values 0, 1, 2, or 3, or the equivalents in hexadecimal as NdisParameterHexInteger values.

NdisReadConfiguration buffers and copies the caller-supplied string at Keyword and releases the storage it allocates for this copy before it returns control to the caller. Memoria allocata per l'oggetto NDIS_CONFIGURATION_PARAMETER structure is freed when the driver releases the ConfigurationHandle with the NdisCloseConfiguration function. The caller of NdisReadConfiguration is responsible for releasing the buffered string at Keyword.

Si noti che NDIS non convalida i valori letti da un driver dal Registro di sistema. The caller of NdisReadConfiguration must therefore not make any assumptions about such values and must validate each value read from the registry. Se il chiamante determina che un valore non è compreso nei limiti, deve usare invece un valore predefinito.

Per altre informazioni sui file di installazione e installazione, vedere Panoramica dell'installazione dei dispositivi .

Requirements

Requirement Value
client minimo supportato Supportato per i driver NDIS 6.0 e NDIS 5.1 (vedere NdisReadConfiguration (NDIS 5.1) in Windows Vista. Supportato per i driver NDIS 5.1 (vedere NdisReadConfiguration (NDIS 5.1)) in Windows XP.
Target Platform Universal
Header ndis.h (include Ndis.h)
Library Ndis.lib
IRQL PASSIVE_LEVEL
regole di conformità DDI Irql_Miscellaneous_Function(ndis)

See also

ANSI_STRING

NDIS_CONFIGURATION_PARAMETER

NDIS_PARAMETER_TYPE

NdisAnsiStringToUnicodeString

NdisCloseConfiguration

NdisFreeString

NdisInitAnsiString

NdisInitUnicodeString

NdisInitializeString

NdisOpenConfigurationEx

NdisOpenConfigurationKeyByIndex NdisOpenConfigurationKeyByName

NdisReadNetworkAddress

NdisUnicodeStringToAnsiString

NdisWriteConfiguration

UNICODE_STRING