mirror of
https://github.com/reactos/reactos.git
synced 2025-02-24 09:25:10 +00:00
- Fix broken HalpQueryPciRegistryInfo: If it wasn't for the fact that it queried a subkey incorrectly ('ConfigurationData' instead of 'Configuration Data') it was setting up the basic structure correctly but forgot to RETURN IT TO THE CALLER.
- Fixes PCI detection detection as HalpInitializePciStubs no longer has to rely on a 'no info = PCI 1' assumption, making PCI 2 detection possible. - Add support for querying the CurrentControlSet\Control\PnP\PCI\CardList key and retrieving the card list entries (not used yet). Also add the related keys to hivesys.inf so there is something to query. svn path=/trunk/; revision=43913
This commit is contained in:
parent
f84d5a02f4
commit
602db5f2d1
2 changed files with 146 additions and 26 deletions
|
@ -782,6 +782,29 @@ HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale\Alternate Sorts","00021004",0x
|
|||
HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale\Alternate Sorts","00021404",0x00000000,""
|
||||
HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Locale\Alternate Sorts","00030404",0x00000000,""
|
||||
|
||||
HKLM,"SYSTEM\CurrentControlSet\Control\PnP\Pci\CardList","Intel 82441FX",0x00030003,\
|
||||
01,00,00,00,86,80,37,12,00,00,00,00,00,00,00,00
|
||||
HKLM,"SYSTEM\CurrentControlSet\Control\PnP\Pci\CardList","Intel 82439HX",0x00030003,\
|
||||
01,00,00,00,86,80,50,12,00,00,00,00,00,00,00,00
|
||||
HKLM,"SYSTEM\CurrentControlSet\Control\PnP\Pci\CardList","Intel 82439TX",0x00030003,\
|
||||
01,00,00,00,86,80,00,71,00,00,00,00,00,00,00,00
|
||||
HKLM,"SYSTEM\CurrentControlSet\Control\PnP\Pci\CardList","Intel 82443LX/EX",0x00030003,\
|
||||
01,00,00,00,86,80,80,71,00,00,00,00,00,00,00,00
|
||||
HKLM,"SYSTEM\CurrentControlSet\Control\PnP\Pci\CardList","Intel 82443BX1",0x00030003,\
|
||||
01,00,00,00,86,80,90,71,00,00,00,00,00,00,00,00
|
||||
HKLM,"SYSTEM\CurrentControlSet\Control\PnP\Pci\CardList","Intel 82443BX2",0x00030003,\
|
||||
01,00,00,00,86,80,92,71,00,00,00,00,00,00,00,00
|
||||
HKLM,"SYSTEM\CurrentControlSet\Control\PnP\Pci\CardList","Intel 82443GX",0x00030003,\
|
||||
01,00,00,00,86,80,a0,71,00,00,00,00,00,00,00,00
|
||||
HKLM,"SYSTEM\CurrentControlSet\Control\PnP\Pci\CardList","VIA Tech1",0x00030003,\
|
||||
01,00,00,00,06,11,01,05,00,00,00,00,00,00,00,00
|
||||
HKLM,"SYSTEM\CurrentControlSet\Control\PnP\Pci\CardList","VIA Tech2",0x00030003,\
|
||||
01,00,00,00,06,11,91,06,00,00,00,00,00,00,00,00
|
||||
HKLM,"SYSTEM\CurrentControlSet\Control\PnP\Pci\CardList","Toshiba",0x00030003,\
|
||||
01,00,00,00,79,11,01,06,00,00,00,00,00,00,00,00
|
||||
HKLM,"SYSTEM\CurrentControlSet\Control\PnP\Pci\CardList","Ali",0x00030003,\
|
||||
01,00,00,00,b9,10,21,15,00,00,00,00,00,00,00,00
|
||||
|
||||
HKLM,"SYSTEM\CurrentControlSet\Control\Print","MajorVersion",0x00010001,2
|
||||
HKLM,"SYSTEM\CurrentControlSet\Control\Print","MinorVersion",0x00010003,0
|
||||
HKLM,"SYSTEM\CurrentControlSet\Control\Print","PriorityClass",0x00010003,0
|
||||
|
|
|
@ -703,19 +703,24 @@ NTAPI
|
|||
HalpQueryPciRegistryInfo(VOID)
|
||||
{
|
||||
WCHAR NameBuffer[8];
|
||||
OBJECT_ATTRIBUTES ObjectAttributes;
|
||||
OBJECT_ATTRIBUTES ObjectAttributes;
|
||||
UNICODE_STRING KeyName, ConfigName, IdentName;
|
||||
HANDLE KeyHandle, BusKeyHandle;
|
||||
HANDLE KeyHandle, BusKeyHandle, CardListHandle;
|
||||
NTSTATUS Status;
|
||||
UCHAR KeyBuffer[sizeof(PPCI_REGISTRY_INFO) + 100];
|
||||
UCHAR KeyBuffer[sizeof(CM_FULL_RESOURCE_DESCRIPTOR) + 100];
|
||||
PKEY_VALUE_FULL_INFORMATION ValueInfo = (PVOID)KeyBuffer;
|
||||
UCHAR PartialKeyBuffer[sizeof(KEY_VALUE_PARTIAL_INFORMATION) +
|
||||
sizeof(PCI_CARD_DESCRIPTOR)];
|
||||
PKEY_VALUE_PARTIAL_INFORMATION PartialValueInfo = (PVOID)PartialKeyBuffer;
|
||||
KEY_FULL_INFORMATION KeyInformation;
|
||||
ULONG ResultLength;
|
||||
PWSTR Tag;
|
||||
ULONG i;
|
||||
ULONG i, ElementCount;
|
||||
PCM_FULL_RESOURCE_DESCRIPTOR FullDescriptor;
|
||||
PCM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptor;
|
||||
PPCI_REGISTRY_INFO PciRegInfo;
|
||||
PPCI_REGISTRY_INFO_INTERNAL PciRegistryInfo;
|
||||
PPCI_CARD_DESCRIPTOR CardDescriptor;
|
||||
|
||||
/* Setup the object attributes for the key */
|
||||
RtlInitUnicodeString(&KeyName,
|
||||
|
@ -736,7 +741,7 @@ HalpQueryPciRegistryInfo(VOID)
|
|||
KeyName.MaximumLength = sizeof(NameBuffer);
|
||||
|
||||
/* Setup the configuration and identifier key names */
|
||||
RtlInitUnicodeString(&ConfigName, L"ConfigurationData");
|
||||
RtlInitUnicodeString(&ConfigName, L"Configuration Data");
|
||||
RtlInitUnicodeString(&IdentName, L"Identifier");
|
||||
|
||||
/* Keep looping for each ID */
|
||||
|
@ -805,28 +810,120 @@ HalpQueryPciRegistryInfo(VOID)
|
|||
/* Check if this is our PCI Registry Information */
|
||||
if (PartialDescriptor->Type == CmResourceTypeDeviceSpecific)
|
||||
{
|
||||
/* Close the key */
|
||||
ZwClose(KeyHandle);
|
||||
|
||||
/* FIXME: Check PnP\PCI\CardList */
|
||||
|
||||
/* Get the PCI information */
|
||||
PciRegInfo = (PPCI_REGISTRY_INFO)(PartialDescriptor + 1);
|
||||
|
||||
/* Allocate the return structure */
|
||||
PciRegistryInfo = ExAllocatePoolWithTag(NonPagedPool,
|
||||
sizeof(PCI_REGISTRY_INFO_INTERNAL),
|
||||
' laH');
|
||||
if (!PciRegistryInfo) return NULL;
|
||||
|
||||
/* Fill it out */
|
||||
PciRegistryInfo->HardwareMechanism = PciRegInfo->HardwareMechanism;
|
||||
PciRegistryInfo->NoBuses = PciRegInfo->NoBuses;
|
||||
PciRegistryInfo->MajorRevision = PciRegInfo->MajorRevision;
|
||||
PciRegistryInfo->MinorRevision = PciRegInfo->MinorRevision;
|
||||
PciRegistryInfo->ElementCount = 0;
|
||||
/* It is, stop searching */
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Close the key */
|
||||
ZwClose(KeyHandle);
|
||||
|
||||
/* Save the PCI information for later */
|
||||
PciRegInfo = (PPCI_REGISTRY_INFO)(PartialDescriptor + 1);
|
||||
|
||||
/* Assume no Card List entries */
|
||||
ElementCount = 0;
|
||||
|
||||
/* Set up for checking the PCI Card List key */
|
||||
RtlInitUnicodeString(&KeyName,
|
||||
L"\\Registry\\Machine\\System\\CurrentControlSet\\"
|
||||
L"Control\\PnP\\PCI\\CardList");
|
||||
InitializeObjectAttributes(&ObjectAttributes,
|
||||
&KeyName,
|
||||
OBJ_CASE_INSENSITIVE,
|
||||
NULL,
|
||||
NULL);
|
||||
|
||||
/* Attempt to open it */
|
||||
Status = ZwOpenKey(&CardListHandle, KEY_READ, &ObjectAttributes);
|
||||
if (NT_SUCCESS(Status))
|
||||
{
|
||||
/* It exists, so let's query it */
|
||||
Status = ZwQueryKey(CardListHandle,
|
||||
KeyFullInformation,
|
||||
&KeyInformation,
|
||||
sizeof(KEY_FULL_INFORMATION),
|
||||
&ResultLength);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
/* Failed to query, so no info */
|
||||
PciRegistryInfo = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Allocate the full structure */
|
||||
PciRegistryInfo =
|
||||
ExAllocatePoolWithTag(NonPagedPool,
|
||||
sizeof(PCI_REGISTRY_INFO_INTERNAL) +
|
||||
(KeyInformation.Values *
|
||||
sizeof(PCI_CARD_DESCRIPTOR)),
|
||||
' laH');
|
||||
if (PciRegistryInfo)
|
||||
{
|
||||
/* Get the first card descriptor entry */
|
||||
CardDescriptor = (PPCI_CARD_DESCRIPTOR)(PciRegistryInfo + 1);
|
||||
|
||||
/* Loop all the values */
|
||||
for (i = 0; i < KeyInformation.Values; i++)
|
||||
{
|
||||
/* Attempt to get the value */
|
||||
Status = ZwEnumerateValueKey(CardListHandle,
|
||||
i,
|
||||
KeyValuePartialInformation,
|
||||
PartialValueInfo,
|
||||
sizeof(PartialKeyBuffer),
|
||||
&ResultLength);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
/* Something went wrong, stop the search */
|
||||
break;
|
||||
}
|
||||
|
||||
/* Make sure it is correctly sized */
|
||||
if (PartialValueInfo->DataLength == sizeof(PCI_CARD_DESCRIPTOR))
|
||||
{
|
||||
/* Sure is, copy it over */
|
||||
*CardDescriptor = *(PPCI_CARD_DESCRIPTOR)
|
||||
PartialValueInfo->Data;
|
||||
|
||||
/* One more Card List entry */
|
||||
ElementCount++;
|
||||
|
||||
/* Move to the next descriptor */
|
||||
CardDescriptor = (CardDescriptor + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Close the Card List key */
|
||||
ZwClose(CardListHandle);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* No key, no Card List */
|
||||
PciRegistryInfo = NULL;
|
||||
}
|
||||
|
||||
/* Check if we failed to get the full structure */
|
||||
if (!PciRegistryInfo)
|
||||
{
|
||||
/* Just allocate the basic structure then */
|
||||
PciRegistryInfo = ExAllocatePoolWithTag(NonPagedPool,
|
||||
sizeof(PCI_REGISTRY_INFO_INTERNAL),
|
||||
' laH');
|
||||
if (!PciRegistryInfo) return NULL;
|
||||
}
|
||||
|
||||
/* Save the info we got */
|
||||
PciRegistryInfo->MajorRevision = PciRegInfo->MajorRevision;
|
||||
PciRegistryInfo->MinorRevision = PciRegInfo->MinorRevision;
|
||||
PciRegistryInfo->NoBuses = PciRegInfo->NoBuses;
|
||||
PciRegistryInfo->HardwareMechanism = PciRegInfo->HardwareMechanism;
|
||||
PciRegistryInfo->ElementCount = ElementCount;
|
||||
|
||||
/* Return it */
|
||||
return PciRegistryInfo;
|
||||
}
|
||||
|
||||
VOID
|
||||
|
@ -893,7 +990,7 @@ HalpInitializePciStubs(VOID)
|
|||
default:
|
||||
|
||||
/* Invalid type */
|
||||
DbgPrint("HAL: Unnkown PCI type\n");
|
||||
DbgPrint("HAL: Unknown PCI type\n");
|
||||
}
|
||||
|
||||
/* Loop all possible buses */
|
||||
|
|
Loading…
Reference in a new issue