* Whenever a read operation is performed, the NDIS library allocates space and returns
* it. A linked list is kept associated with every handle of the memory allocated to
* it. When the handle is closed, the resources are systematically released.
- * - The NDIS_HANDLE Configuraiton context is no longer a registry handle. An opaque struct
+ * - The NDIS_HANDLE Configuration context is no longer a registry handle. An opaque struct
* had to be created to allow for resource tracking. This means that Miniports cannot just
* pass this NDIS_HANDLE to things like ZwQueryValueKey(). I don't thknk they do (they
* certainly should not), but it should be kept in mind.
PMINIPORT_CONFIGURATION_CONTEXT ConfigurationContext;
PNDIS_WRAPPER_CONTEXT WrapperContext = (PNDIS_WRAPPER_CONTEXT)WrapperConfigurationContext;
HANDLE RootKeyHandle = WrapperContext->RegistryHandle;
+ OBJECT_ATTRIBUTES ObjectAttributes;
+ UNICODE_STRING NoName = RTL_CONSTANT_STRING(L"");
NDIS_DbgPrint(MAX_TRACE, ("Called\n"));
*ConfigurationHandle = NULL;
- *Status = ZwDuplicateObject(NtCurrentProcess(), RootKeyHandle,
- NtCurrentProcess(), &KeyHandle, 0, 0,
- DUPLICATE_SAME_ACCESS);
+ InitializeObjectAttributes(&ObjectAttributes,
+ &NoName,
+ OBJ_KERNEL_HANDLE,
+ RootKeyHandle,
+ NULL);
+ *Status = ZwOpenKey(&KeyHandle, KEY_ALL_ACCESS, &ObjectAttributes);
if(!NT_SUCCESS(*Status))
{
NDIS_DbgPrint(MIN_TRACE, ("Failed to open registry configuration for this miniport\n"));
RtlCopyUnicodeString(&KeyNameU, ProtocolSection);
RtlAppendUnicodeToString(&KeyNameU, PARAMETERS_KEY);
- InitializeObjectAttributes(&KeyAttributes, &KeyNameU, OBJ_CASE_INSENSITIVE, NULL, NULL);
+ InitializeObjectAttributes(&KeyAttributes, &KeyNameU, OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE, NULL, NULL);
*Status = ZwOpenKey(&KeyHandle, KEY_ALL_ACCESS, &KeyAttributes);
(*ParameterValue)->ParameterData.StringData.Buffer = Buffer;
(*ParameterValue)->ParameterData.StringData.Length = KeyInformation->DataLength;
}
+ else if (KeyInformation->Type == REG_DWORD)
+ {
+ ASSERT(KeyInformation->DataLength == sizeof(ULONG));
+ NDIS_DbgPrint(MAX_TRACE, ("NdisParameterInteger\n"));
+ (*ParameterValue)->ParameterType = NdisParameterInteger;
+ (*ParameterValue)->ParameterData.IntegerData = * (ULONG *) &KeyInformation->Data[0];
+ }
else if (KeyInformation->Type == REG_SZ)
{
UNICODE_STRING str;
NDIS_STRING Keyword;
UINT *IntArray = 0;
UINT i,j = 0;
+ WCHAR Buff[11];
NDIS_STRING str;
NdisInitUnicodeString(&Keyword, L"NetworkAddress");
if (ParameterValue->ParameterType == NdisParameterInteger)
{
- WCHAR Buff[11];
-
NDIS_DbgPrint(MAX_TRACE, ("Read integer data %lx\n",
ParameterValue->ParameterData.IntegerData));
wcsncpy(KeyName->Buffer, KeyInformation->Name, KeyName->MaximumLength/sizeof(WCHAR));
KeyName->Length = (USHORT)min(KeyInformation->NameLength, KeyName->MaximumLength);
- InitializeObjectAttributes(&KeyAttributes, KeyName, OBJ_CASE_INSENSITIVE, ConfigurationHandle, NULL);
+ InitializeObjectAttributes(&KeyAttributes, KeyName, OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE, ConfigurationHandle, NULL);
*Status = ZwOpenKey(&RegKeyHandle, KEY_ALL_ACCESS, &KeyAttributes);
*KeyHandle = NULL;
- InitializeObjectAttributes(&KeyAttributes, KeyName, OBJ_CASE_INSENSITIVE, ConfigurationHandle, 0);
+ InitializeObjectAttributes(&KeyAttributes, KeyName, OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE, ConfigurationHandle, 0);
*Status = ZwOpenKey(&RegKeyHandle, KEY_ALL_ACCESS, &KeyAttributes);
if(*Status != STATUS_SUCCESS)