Generate a proper device id string for processor devices.

svn path=/trunk/; revision=73846
This commit is contained in:
Eric Kohl 2017-02-19 15:13:49 +00:00
parent 7fb841c839
commit 27c1e20f13
3 changed files with 22 additions and 3 deletions

View file

@ -454,9 +454,17 @@ Bus_PDO_QueryDeviceId(
{
acpi_bus_get_device(DeviceData->AcpiHandle, &Device);
length = swprintf(temp,
L"ACPI\\%hs",
Device->pnp.hardware_id);
if (strcmp(Device->pnp.hardware_id, "Processor") == 0)
{
length = wcslen(ProcessorIdString);
wcscpy(temp, ProcessorIdString);
}
else
{
length = swprintf(temp,
L"ACPI\\%hs",
Device->pnp.hardware_id);
}
}
else
{

View file

@ -5,6 +5,7 @@
*/
extern UNICODE_STRING ProcessorHardwareIds;
extern LPWSTR ProcessorIdString;
extern LPWSTR ProcessorNameString;
typedef enum _DEVICE_PNP_STATE {

View file

@ -22,6 +22,7 @@ extern struct acpi_device *sleep_button;
extern struct acpi_device *power_button;
UNICODE_STRING ProcessorHardwareIds = {0, 0, NULL};
LPWSTR ProcessorIdString = NULL;
LPWSTR ProcessorNameString = NULL;
@ -650,6 +651,15 @@ GetProcessorInformation(VOID)
ProcessorHardwareIds.MaximumLength = ProcessorHardwareIds.Length;
ProcessorHardwareIds.Buffer = HardwareIdsBuffer;
Length = (5 + VendorIdentifierLength + 3 + Level1Length + 1) * sizeof(WCHAR);
ProcessorIdString = ExAllocatePoolWithTag(PagedPool, Length, 'IpcA');
if (ProcessorIdString != NULL)
{
Length = swprintf(ProcessorIdString, L"ACPI\\%s_-_%.*s", ProcessorVendorIdentifier, Level1Length, ProcessorIdentifier);
ProcessorIdString[Length++] = UNICODE_NULL;
DPRINT("ProcessorIdString: %S\n", ProcessorIdString);
}
done:
if (ProcessorHandle != NULL)
ZwClose(ProcessorHandle);