PMINIPORT_CONFIGURATION_CONTEXT ConfigurationContext = (PMINIPORT_CONFIGURATION_CONTEXT)ConfigurationHandle;
PVOID Buffer;
- *ParameterValue = NULL;
+ //*ParameterValue = NULL;
*Status = NDIS_STATUS_FAILURE;
NDIS_DbgPrint(MAX_TRACE,("requested read of %wZ\n", Keyword));
return;
}
- if(
- !wcsncmp(Keyword->Buffer, L"Environment", Keyword->Length/sizeof(WCHAR)) &&
- wcslen(L"Environment") == Keyword->Length/sizeof(WCHAR)
- )
+ if(!wcsncmp(Keyword->Buffer, L"Environment", Keyword->Length/sizeof(WCHAR)) &&
+ wcslen(L"Environment") == Keyword->Length/sizeof(WCHAR))
{
*ParameterValue = ExAllocatePool(PagedPool, sizeof(NDIS_CONFIGURATION_PARAMETER));
if(!*ParameterValue)
return;
}
- if(
- !wcsncmp(Keyword->Buffer, L"ProcessorType", Keyword->Length/sizeof(WCHAR)) &&
- wcslen(L"ProcessorType") == Keyword->Length/sizeof(WCHAR)
- )
+ if(!wcsncmp(Keyword->Buffer, L"ProcessorType", Keyword->Length/sizeof(WCHAR)) &&
+ wcslen(L"ProcessorType") == Keyword->Length/sizeof(WCHAR))
{
*ParameterValue = ExAllocatePool(PagedPool, sizeof(NDIS_CONFIGURATION_PARAMETER));
if(!*ParameterValue)
return;
}
- if(
- !wcsncmp(Keyword->Buffer, L"NdisVersion", Keyword->Length/sizeof(WCHAR)) &&
- wcslen(L"NdisVersion") == Keyword->Length/sizeof(WCHAR)
- )
+ if(!wcsncmp(Keyword->Buffer, L"NdisVersion", Keyword->Length/sizeof(WCHAR)) &&
+ wcslen(L"NdisVersion") == Keyword->Length/sizeof(WCHAR))
{
*ParameterValue = ExAllocatePool(PagedPool, sizeof(NDIS_CONFIGURATION_PARAMETER));
if(!*ParameterValue)
(*ParameterValue)->ParameterType = NdisParameterBinary;
- Buffer = ExAllocatePool(NonPagedPool, KeyInformation->DataLength);
+ Buffer = ExAllocatePool(PagedPool, KeyInformation->DataLength);
if (!Buffer)
{
NDIS_DbgPrint(MIN_TRACE, ("Insufficient resources.\n"));
(*ParameterValue)->ParameterType = NdisParameterMultiString;
- Buffer = ExAllocatePool(NonPagedPool, KeyInformation->DataLength);
+ Buffer = ExAllocatePool(PagedPool, KeyInformation->DataLength);
if (!Buffer)
{
NDIS_DbgPrint(MIN_TRACE, ("Insufficient resources.\n"));
str.Length = str.MaximumLength = (USHORT)KeyInformation->DataLength;
str.Buffer = (PWCHAR)KeyInformation->Data;
- if (Base != 0 && IsValidNumericString(&str, Base) &&
- ((*Status = RtlUnicodeStringToInteger(&str, Base,
- &(*ParameterValue)->ParameterData.IntegerData)) == STATUS_SUCCESS))
+ if (Base != 0 && IsValidNumericString(&str, Base))
{
+ *Status = RtlUnicodeStringToInteger(&str, Base, &(*ParameterValue)->ParameterData.IntegerData);
+ ASSERT(*Status == STATUS_SUCCESS);
+
NDIS_DbgPrint(MAX_TRACE, ("NdisParameter(Hex)Integer\n"));
- (*ParameterValue)->ParameterType = ParameterType;
+ /* MSDN documents that this is returned for all integers, regardless of the ParameterType passed in */
+ (*ParameterValue)->ParameterType = NdisParameterInteger;
}
else
{
(*ParameterValue)->ParameterType = NdisParameterString;
- Buffer = ExAllocatePool(NonPagedPool, KeyInformation->DataLength);
+ Buffer = ExAllocatePool(PagedPool, KeyInformation->DataLength);
if (!Buffer)
{
NDIS_DbgPrint(MIN_TRACE, ("Insufficient resources.\n"));
ExFreePool(KeyInformation);
return;
}
-
- if ((*ParameterValue)->ParameterType != ParameterType)
+
+ if (((*ParameterValue)->ParameterType != ParameterType) &&
+ !((ParameterType == NdisParameterHexInteger) && ((*ParameterValue)->ParameterType == NdisParameterInteger)))
{
NDIS_DbgPrint(MIN_TRACE, ("Parameter type mismatch! (Requested: %d | Received: %d)\n",
ParameterType, (*ParameterValue)->ParameterType));