/* reset parameter type to standard reg types */
switch(ParameterType)
{
- /* HexInteger is stored as a string on 9x (as are other dwords), but we don't have to worry about that */
+ /* TODO: figure out what do do with these; are they different? */
case NdisParameterHexInteger:
case NdisParameterInteger:
- ParameterType = REG_DWORD;
+ ParameterType = REG_SZ;
Data = &ParameterValue->ParameterData.IntegerData;
DataSize = sizeof(ULONG);
break;
return;
}
- wcsncpy(KeyName, ProtocolSection->Buffer, ProtocolSection->Length);
+ wcsncpy(KeyName, ProtocolSection->Buffer, ProtocolSection->Length/sizeof(WCHAR));
wcscpy(KeyName + ProtocolSection->Length, PARAMETERS_KEY);
RtlInitUnicodeString(&KeyNameU, KeyName);
InitializeObjectAttributes(&KeyAttributes, &KeyNameU, OBJ_CASE_INSENSITIVE, NULL, NULL);
*Status = ZwQueryValueKey(ConfigurationContext->Handle, Keyword, KeyValuePartialInformation, NULL, 0, &KeyDataLength);
if(*Status != STATUS_BUFFER_OVERFLOW && *Status != STATUS_BUFFER_TOO_SMALL && *Status != STATUS_SUCCESS)
{
- NDIS_DbgPrint(MID_TRACE,("ZwQueryValueKey #1 failed, status 0x%x\n", *Status));
+ NDIS_DbgPrint(MID_TRACE,("ZwQueryValueKey #1 failed for %wZ, status 0x%x\n", Keyword, *Status));
*Status = NDIS_STATUS_FAILURE;
return;
}
if(*Status != STATUS_SUCCESS)
{
ExFreePool(KeyInformation);
- NDIS_DbgPrint(MID_TRACE,("ZwQueryValueKey #2 failed, status 0x%x\n", *Status));
+ NDIS_DbgPrint(MID_TRACE,("ZwQueryValueKey #2 failed for %wZ, status 0x%x\n", Keyword, *Status));
*Status = NDIS_STATUS_FAILURE;
return;
}
case NdisParameterInteger:
case NdisParameterHexInteger:
{
- if(KeyInformation->Type != REG_DWORD)
- {
- NDIS_DbgPrint(MIN_TRACE,("requested type does not match actual value type\n"));
- ExFreePool(KeyInformation);
- *ParameterValue = NULL;
- *Status = NDIS_STATUS_FAILURE;
- return;
- }
+ UNICODE_STRING str;
*ParameterValue = ExAllocatePool(PagedPool, sizeof(NDIS_CONFIGURATION_PARAMETER));
if(!*ParameterValue)
return;
}
+ str.Length = str.MaximumLength = KeyInformation->DataLength;
+ str.Buffer = (PWCHAR)KeyInformation->Data;
+
(*ParameterValue)->ParameterType = ParameterType;
- (*ParameterValue)->ParameterData.IntegerData = *((ULONG *)KeyInformation->Data);
+ *Status = RtlUnicodeStringToInteger(&str, 16, &(*ParameterValue)->ParameterData.IntegerData);
ExFreePool(KeyInformation);
- *Status = NDIS_STATUS_SUCCESS;
+ if(*Status != STATUS_SUCCESS)
+ *Status = NDIS_STATUS_FAILURE;
+ else
+ *Status = NDIS_STATUS_SUCCESS;
return;
}
UINT *IntArray = 0;
int i;
+ /* FIXME - We don't quite support this yet due to buggy code below */
+ {
+ *Status = NDIS_STATUS_FAILURE;
+ return;
+ }
+
*NetworkAddress = NULL;
*NetworkAddressLength = 6;/* XXX magic constant */
}
/* should i fail instead if the passed-in string isn't long enough? */
- wcsncpy(KeyName->Buffer, KeyInformation->Name, KeyName->MaximumLength);
+ wcsncpy(KeyName->Buffer, KeyInformation->Name, KeyName->MaximumLength/sizeof(WCHAR));
KeyName->Length = KeyInformation->NameLength;
InitializeObjectAttributes(&KeyAttributes, KeyName, OBJ_CASE_INSENSITIVE, ConfigurationHandle, NULL);
* FILE: ndis/hardware.c
* PURPOSE: Hardware related routines
* PROGRAMMERS: Casper S. Hornstrup (chorns@users.sourceforge.net)
+ * Vizzini (vizzini@plasmic.com)
* REVISIONS:
* CSH 01/08-2000 Created
+ * 8/25/2003 Vizzini - NDIS4/5 and PnP additions
*/
#include <ndissys.h>
+#include <miniport.h>
/*
IN NDIS_HANDLE MiniportHandle,
IN ULONG SlotNumber,
OUT PNDIS_RESOURCE_LIST *AssignedResources)
+/*
+ * NOTES:
+ * - I think this is fundamentally broken
+ */
{
PCM_RESOURCE_LIST ResourceList;
NTSTATUS Status;
+ PLOGICAL_ADAPTER Adapter = (PLOGICAL_ADAPTER)MiniportHandle;
ResourceList = NULL;
- Status = HalAssignSlotResources (NULL, /* FIXME: RegistryPath */
- NULL,
- NULL, /* FIXME: DriverObject */
- NULL, /* FIXME: DeviceObject */
- PCIConfiguration, /* FIXME: BusType */
- 0, /* FIXME: BusNumber */
+ Status = HalAssignSlotResources (Adapter->Miniport->RegistryPath,
+ 0,
+ Adapter->Miniport->DriverObject,
+ 0,
+ PCIBus,
+ Adapter->BusNumber,
SlotNumber,
&ResourceList);
if (!NT_SUCCESS (Status))
/*
- * @unimplemented
+ * @implemented
*/
NDIS_STATUS
EXPORT
NdisQueryMapRegisterCount(
IN NDIS_INTERFACE_TYPE BusType,
OUT PUINT MapRegisterCount)
+/*
+ * On X86 (and all other current hardware), map registers aren't real hardware,
+ * and there is no real limit to the number that can be allocated.
+ * As such, we do what microsoft does on the x86 hals and return as follows
+ */
{
- UNIMPLEMENTED
-
- return NDIS_STATUS_FAILURE;
+ return NDIS_STATUS_NOT_SUPPORTED;
}