mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 18:15:11 +00:00
[ACPI]
Generate a proper device id string for processor devices. svn path=/trunk/; revision=73846
This commit is contained in:
parent
7fb841c839
commit
27c1e20f13
3 changed files with 22 additions and 3 deletions
|
@ -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
|
||||
{
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
*/
|
||||
|
||||
extern UNICODE_STRING ProcessorHardwareIds;
|
||||
extern LPWSTR ProcessorIdString;
|
||||
extern LPWSTR ProcessorNameString;
|
||||
|
||||
typedef enum _DEVICE_PNP_STATE {
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue