mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 18:15:11 +00:00
- Fix incompatibility: In Windows IoGetDeviceProperty(DevicePropertyAddress) returns information as 0xDDDDFFFF (D=Device, F=Function) and not as a PCI_SLOT_NUMBER structure. This is confirmed by tests in Windows XP and 2003, and also found via Google.
- Fix incorrect usage of DevicePropertyAddress in videoprt and ndis (thus ndis.sys+pcnet.sys load [again] in Windows XP). svn path=/trunk/; revision=27290
This commit is contained in:
parent
2beeeef110
commit
57e548bec4
3 changed files with 25 additions and 2 deletions
|
@ -157,6 +157,7 @@ PdoQueryCapabilities(
|
|||
{
|
||||
PPDO_DEVICE_EXTENSION DeviceExtension;
|
||||
PDEVICE_CAPABILITIES DeviceCapabilities;
|
||||
ULONG DeviceNumber, FunctionNumber;
|
||||
|
||||
DPRINT("Called\n");
|
||||
|
||||
|
@ -166,8 +167,11 @@ PdoQueryCapabilities(
|
|||
if (DeviceCapabilities->Version != 1)
|
||||
return STATUS_UNSUCCESSFUL;
|
||||
|
||||
DeviceNumber = DeviceExtension->PciDevice->SlotNumber.u.bits.DeviceNumber;
|
||||
FunctionNumber = DeviceExtension->PciDevice->SlotNumber.u.bits.FunctionNumber;
|
||||
|
||||
DeviceCapabilities->UniqueID = FALSE;
|
||||
DeviceCapabilities->Address = DeviceExtension->PciDevice->SlotNumber.u.AsULONG;
|
||||
DeviceCapabilities->Address = ((DeviceNumber << 16) & 0xFFFF0000) + (FunctionNumber & 0xFFFF);
|
||||
DeviceCapabilities->UINumber = (ULONG)-1; /* FIXME */
|
||||
|
||||
return STATUS_SUCCESS;
|
||||
|
|
|
@ -1404,7 +1404,18 @@ NdisIPnPStartDevice(
|
|||
else
|
||||
Adapter->NdisMiniportBlock.SlotNumber = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Convert slotnumber to PCI_SLOT_NUMBER */
|
||||
ULONG PciSlotNumber = Adapter->NdisMiniportBlock.SlotNumber;
|
||||
PCI_SLOT_NUMBER SlotNumber;
|
||||
|
||||
SlotNumber.u.AsULONG = 0;
|
||||
SlotNumber.u.bits.DeviceNumber = (PciSlotNumber >> 16) & 0xFFFF;
|
||||
SlotNumber.u.bits.FunctionNumber = PciSlotNumber & 0xFFFF;
|
||||
|
||||
Adapter->NdisMiniportBlock.SlotNumber = SlotNumber.u.AsULONG;
|
||||
}
|
||||
NdisCloseConfiguration(ConfigHandle);
|
||||
|
||||
/*
|
||||
|
|
|
@ -227,6 +227,8 @@ IntVideoPortCreateAdapterDeviceObject(
|
|||
{
|
||||
PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension;
|
||||
ULONG DeviceNumber;
|
||||
ULONG PciSlotNumber;
|
||||
PCI_SLOT_NUMBER SlotNumber;
|
||||
ULONG Size;
|
||||
NTSTATUS Status;
|
||||
WCHAR DeviceBuffer[20];
|
||||
|
@ -345,8 +347,14 @@ IntVideoPortCreateAdapterDeviceObject(
|
|||
PhysicalDeviceObject,
|
||||
DevicePropertyAddress,
|
||||
Size,
|
||||
&DeviceExtension->SystemIoSlotNumber,
|
||||
&PciSlotNumber,
|
||||
&Size);
|
||||
|
||||
/* Convert slotnumber to PCI_SLOT_NUMBER */
|
||||
SlotNumber.u.AsULONG = 0;
|
||||
SlotNumber.u.bits.DeviceNumber = (PciSlotNumber >> 16) & 0xFFFF;
|
||||
SlotNumber.u.bits.FunctionNumber = PciSlotNumber & 0xFFFF;
|
||||
DeviceExtension->SystemIoSlotNumber = SlotNumber.u.AsULONG;
|
||||
}
|
||||
|
||||
InitializeListHead(&DeviceExtension->AddressMappingListHead);
|
||||
|
|
Loading…
Reference in a new issue