https://git.reactos.org/?p=reactos.git;a=commitdiff;h=a9f20984cd0ea327bfd5f…
commit a9f20984cd0ea327bfd5f509e6afc6c4a5b2ff1d
Author: Stanislav Motylkov <x86corez(a)gmail.com>
AuthorDate: Sun Apr 15 01:56:32 2018 +0300
Commit: Mark Jansen <mark.jansen(a)reactos.org>
CommitDate: Thu Aug 2 21:15:28 2018 +0200
[I8042PRT] Dump SMBIOS tables into registry for usermode access
Reference:
https://social.msdn.microsoft.com/Forums/en-US/0bb0840e-85f4-4cdb-9710-7581…
CORE-12105 CORE-14867
---
drivers/input/i8042prt/hwhacks.c | 70 ++++++++++++++++++++++++++++++++++++++++
1 file changed, 70 insertions(+)
diff --git a/drivers/input/i8042prt/hwhacks.c b/drivers/input/i8042prt/hwhacks.c
index c7915e16fd..885f0a25a5 100644
--- a/drivers/input/i8042prt/hwhacks.c
+++ b/drivers/input/i8042prt/hwhacks.c
@@ -226,6 +226,70 @@ i8042ParseSMBiosTables(
}
}
+static
+VOID
+i8042StoreSMBiosTables(
+ _In_reads_bytes_(TableSize) PVOID SMBiosTables,
+ _In_ ULONG TableSize)
+{
+ static UNICODE_STRING mssmbiosKeyName =
RTL_CONSTANT_STRING(L"\\Registry\\Machine\\SYSTEM\\CurrentControlSet\\Services\\mssmbios");
+ static UNICODE_STRING DataName = RTL_CONSTANT_STRING(L"Data");
+ static UNICODE_STRING ValueName = RTL_CONSTANT_STRING(L"SMBiosData");
+ OBJECT_ATTRIBUTES ObjectAttributes;
+ HANDLE KeyHandle = NULL, SubKeyHandle = NULL;
+ NTSTATUS Status;
+
+ /* Create registry key */
+ InitializeObjectAttributes(&ObjectAttributes,
+ &mssmbiosKeyName,
+ OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE,
+ NULL,
+ NULL);
+ Status = ZwCreateKey(&KeyHandle,
+ KEY_WRITE,
+ &ObjectAttributes,
+ 0,
+ NULL,
+ REG_OPTION_VOLATILE,
+ NULL);
+
+ if (!NT_SUCCESS(Status))
+ {
+ return;
+ }
+
+ /* Create sub key */
+ InitializeObjectAttributes(&ObjectAttributes,
+ &DataName,
+ OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE,
+ KeyHandle,
+ NULL);
+ Status = ZwCreateKey(&SubKeyHandle,
+ KEY_WRITE,
+ &ObjectAttributes,
+ 0,
+ NULL,
+ REG_OPTION_VOLATILE,
+ NULL);
+
+ if (!NT_SUCCESS(Status))
+ {
+ ZwClose(KeyHandle);
+ return;
+ }
+
+ /* Write value */
+ ZwSetValueKey(SubKeyHandle,
+ &ValueName,
+ 0,
+ REG_BINARY,
+ SMBiosTables,
+ TableSize);
+
+ ZwClose(SubKeyHandle);
+ ZwClose(KeyHandle);
+}
+
VOID
NTAPI
i8042InitializeHwHacks(
@@ -271,6 +335,12 @@ i8042InitializeHwHacks(
return;
}
+ /* FIXME: This function should be removed once the mssmbios driver is implemented */
+ /* Store SMBios data in registry */
+ i8042StoreSMBiosTables(AllData + 1,
+ AllData->FixedInstanceSize);
+ DPRINT1("SMBiosTables HACK, see CORE-14867\n");
+
/* Parse the table */
i8042ParseSMBiosTables(AllData + 1,
AllData->WnodeHeader.BufferSize);