Skip to content

Commit 43bc040

Browse files
committed
[FREELDR] Store docking station info in the registry
1 parent 42e5fa0 commit 43bc040

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed

boot/freeldr/freeldr/arch/i386/pc/machpc.c

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,14 @@ DBG_DEFAULT_CHANNEL(HWDETECT);
9191
/* Timeout in ms for sending to keyboard controller. */
9292
#define CONTROLLER_TIMEOUT 250
9393

94+
#include <pshpack1.h>
95+
typedef struct _PNP_DOCK_INFO
96+
{
97+
ULONG DockLocationID;
98+
ULONG SerialNumber;
99+
USHORT Capabilities;
100+
} PNP_DOCK_INFO, *PPNP_DOCK_INFO;
101+
#include <poppack.h>
94102

95103
VOID
96104
PcGetExtendedBIOSData(PULONG ExtendedBIOSDataArea, PULONG ExtendedBIOSDataSize)
@@ -186,6 +194,7 @@ DetectDockingStation(
186194
PCM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptor;
187195
PCONFIGURATION_COMPONENT_DATA PeripheralKey;
188196
PDOCKING_STATE_INFORMATION DockingState;
197+
PPNP_DOCK_INFO DockInfo;
189198
ULONG Size, Result;
190199

191200
Result = PnpBiosGetDockStationInformation(DiskReadBuffer);
@@ -217,8 +226,14 @@ DetectDockingStation(
217226
DockingState->ReturnCode = Result;
218227
if (Result == 0)
219228
{
220-
/* FIXME: Add more device specific data */
221-
ERR("FIXME: System docked\n");
229+
DockInfo = (PPNP_DOCK_INFO)DiskReadBuffer;
230+
DockingState->DockLocationID = DockInfo->DockLocationID;
231+
DockingState->SerialNumber = DockInfo->SerialNumber;
232+
DockingState->Capabilities = DockInfo->Capabilities;
233+
TRACE("System docked\n");
234+
TRACE("Location: 0x%08lx\n", DockInfo->DockLocationID);
235+
TRACE("Serial: 0x%08lx\n", DockInfo->SerialNumber);
236+
TRACE("Capabilities: 0x%04hx\n", DockInfo->Capabilities);
222237
}
223238

224239
/* Create controller key */

boot/freeldr/freeldr/include/arch/pc/pcbios.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,9 @@ typedef struct _ACPI_BIOS_DATA
8181

8282
typedef struct _DOCKING_STATE_INFORMATION
8383
{
84-
USHORT Unused[5];
84+
ULONG DockLocationID;
85+
ULONG SerialNumber;
86+
USHORT Capabilities;
8587
USHORT ReturnCode;
8688
} DOCKING_STATE_INFORMATION, *PDOCKING_STATE_INFORMATION;
8789

0 commit comments

Comments
 (0)