From 27c1e20f13022682223640a7e4c196474acff2d8 Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Sun, 19 Feb 2017 15:13:49 +0000 Subject: [PATCH] [ACPI] Generate a proper device id string for processor devices. svn path=/trunk/; revision=73846 --- reactos/drivers/bus/acpi/buspdo.c | 14 +++++++++++--- reactos/drivers/bus/acpi/include/acpisys.h | 1 + reactos/drivers/bus/acpi/main.c | 10 ++++++++++ 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/reactos/drivers/bus/acpi/buspdo.c b/reactos/drivers/bus/acpi/buspdo.c index a012b28e4ca..ea6b7dd8e45 100644 --- a/reactos/drivers/bus/acpi/buspdo.c +++ b/reactos/drivers/bus/acpi/buspdo.c @@ -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 { diff --git a/reactos/drivers/bus/acpi/include/acpisys.h b/reactos/drivers/bus/acpi/include/acpisys.h index 71646859e3d..d7553cbd546 100644 --- a/reactos/drivers/bus/acpi/include/acpisys.h +++ b/reactos/drivers/bus/acpi/include/acpisys.h @@ -5,6 +5,7 @@ */ extern UNICODE_STRING ProcessorHardwareIds; +extern LPWSTR ProcessorIdString; extern LPWSTR ProcessorNameString; typedef enum _DEVICE_PNP_STATE { diff --git a/reactos/drivers/bus/acpi/main.c b/reactos/drivers/bus/acpi/main.c index bcea6de4a22..afdce0e1667 100644 --- a/reactos/drivers/bus/acpi/main.c +++ b/reactos/drivers/bus/acpi/main.c @@ -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);