- The slot number passed directly to NdisImmediateReadPciSlotInformation/NdisImmediateWritePciSlotInformation is ignored according to MSDN so store a valid slot number in the wrapper context to use instead

svn path=/trunk/; revision=41024
This commit is contained in:
Cameron Gutman 2009-05-21 00:54:10 +00:00
parent c0e9d6e37d
commit 000423fd64
3 changed files with 7 additions and 2 deletions

View file

@ -80,6 +80,7 @@ typedef struct _NDIS_WRAPPER_CONTEXT {
HANDLE RegistryHandle;
PDEVICE_OBJECT DeviceObject;
ULONG BusNumber;
ULONG SlotNumber;
} NDIS_WRAPPER_CONTEXT, *PNDIS_WRAPPER_CONTEXT;
#define GET_MINIPORT_DRIVER(Handle)((PNDIS_M_DRIVER_BLOCK)Handle)

View file

@ -28,8 +28,9 @@ NdisImmediateReadPciSlotInformation(
IN ULONG Length)
{
PNDIS_WRAPPER_CONTEXT WrapperContext = (PNDIS_WRAPPER_CONTEXT)WrapperConfigurationContext;
/* Slot number is ignored. */
return HalGetBusDataByOffset(PCIConfiguration, WrapperContext->BusNumber,
SlotNumber, Buffer, Offset, Length);
WrapperContext->SlotNumber, Buffer, Offset, Length);
}
@ -46,8 +47,9 @@ NdisImmediateWritePciSlotInformation(
IN ULONG Length)
{
PNDIS_WRAPPER_CONTEXT WrapperContext = (PNDIS_WRAPPER_CONTEXT)WrapperConfigurationContext;
/* Slot number is ignored. */
return HalSetBusDataByOffset(PCIConfiguration, WrapperContext->BusNumber,
SlotNumber, Buffer, Offset, Length);
WrapperContext->SlotNumber, Buffer, Offset, Length);
}

View file

@ -1817,6 +1817,8 @@ NdisIPnPStartDevice(
Adapter->NdisMiniportBlock.SlotNumber = SlotNumber.u.AsULONG;
}
WrapperContext.SlotNumber = Adapter->NdisMiniportBlock.SlotNumber;
NdisCloseConfiguration(ConfigHandle);
/* Set handlers (some NDIS macros require these) */