[ACPI] Report a docking device to the system

This commit is contained in:
Eric Kohl
2025-06-08 16:47:26 +02:00
parent 076f08cb3e
commit bec50f65f4
3 changed files with 18 additions and 0 deletions

View File

@@ -419,6 +419,10 @@ Bus_PDO_QueryDeviceCaps(
deviceCapabilities->Address = device->pnp.bus_address;
}
if (DeviceData->DockDevice)
deviceCapabilities->DockDevice = TRUE;
DPRINT("DockDevice: %u\n", deviceCapabilities->DockDevice);
if (!device ||
(device->flags.hardware_id &&
(strstr(device->pnp.hardware_id, ACPI_BUTTON_HID_LID) ||

View File

@@ -42,6 +42,7 @@ typedef struct _PDO_DEVICE_DATA
// An array of (zero terminated wide character strings).
// The array itself also null terminated
PWCHAR HardwareIDs;
BOOLEAN DockDevice;
// Link point to hold all the PDOs for a single bus together
LIST_ENTRY Link;
ULONG InterfaceRefCount;

View File

@@ -422,6 +422,8 @@ Bus_InitializePdo (
PPDO_DEVICE_DATA pdoData;
int acpistate;
DEVICE_POWER_STATE ntState;
ACPI_HANDLE handle = 0;
ACPI_STATUS status = 0;
PAGED_CODE ();
@@ -468,6 +470,17 @@ Bus_InitializePdo (
pdoData->Common.DevicePowerState = ntState;
pdoData->Common.SystemPowerState = FdoData->Common.SystemPowerState;
/* Identify the dock device */
if (pdoData->AcpiHandle)
{
status = AcpiGetHandle(pdoData->AcpiHandle, "_DCK", &handle);
if (ACPI_SUCCESS(status))
{
DPRINT("Found _DCK method!");
pdoData->DockDevice = TRUE;
}
}
ExAcquireFastMutex (&FdoData->Mutex);
InsertTailList(&FdoData->ListOfPDOs, &pdoData->Link);
FdoData->NumPDOs++;