存取組態資訊
NetAdapterCx 類別延伸模組支援一組函式,可提供用戶端驅動程式登錄參數的存取權。
一般而言,用戶端驅動程式會從其 EVT_WDF_DRIVER_DEVICE_ADD 回呼函式讀取組態資訊。
如果是 NetAdapter 物件,請從呼叫 NetAdapterOpenConfiguration 開始,以取得組態物件的控制碼。 然後,您可以查詢它:
NETCONFIGURATION configuration;
status = NetAdapterOpenConfiguration(NetAdapter,
WDF_NO_OBJECT_ATTRIBUTES,
&configuration);
if (!NT_SUCCESS(status)) {
return status;
}
status = NetConfigurationQueryUlong(configuration,
NET_CONFIGURATION_QUERY_ULONG_NO_FLAGS,
&SomeValue,
&myvalue);
NetConfigurationClose(configuration);
開啟和查詢 net 裝置的組態物件類似:
status = NetDeviceOpenConfiguration(Device,
WDF_NO_OBJECT_ATTRIBUTES,
&configuration);
if(!NT_SUCCESS(status))
{
return status;
}
WDFCOLLECTION myStrings;
DECLARE_CONST_UNICODE_STRING(myValueName, L"ExampleValueName");
status = NetConfigurationQueryMultiString(configuration,
myValueName,
WDF_NO_OBJECT_ATTRIBUTES,
myStrings);
查詢 ULONG 資料、字串、多字串 (的功能 NetConfiguration*
類似于REG_MULTI_SZ) 、二進位 Blob 和軟體可設定的網路位址:
- NetConfigurationAssignBinary
- NetConfigurationAssignMultiString
- NetConfigurationAssignUlong
- NetConfigurationAssignUnicodeString
- NetConfigurationClose
- NetConfigurationOpenSubConfiguration
- NetConfigurationQueryBinary
- NetConfigurationQueryMultiString
- NetConfigurationQueryLinkLayerAddress
- NetConfigurationQueryString
- NetConfigurationQueryUlong