From 63ca8c414e13bfb9ace89b48133996d352df7e00 Mon Sep 17 00:00:00 2001 From: Oleg Dubinskiy Date: Sun, 29 Jun 2025 15:00:41 +0200 Subject: [PATCH] [NTOS:EX] Implement NtSetSystemInformation().SystemLoadGdiDriverInSystemSpaceInformation (#8180) Implement SystemLoadGdiDriverInSystemSpaceInformation case of NtSetSystemInformation() function. According to https://www.geoffchappell.com/studies/windows/km/ntoskrnl/api/ex/sysinfo/gdi_driver.htm, it does the similar thing to SystemLoadGdiDriverInformation (these two cases even have the same shared SYSTEM_GDI_DRIVER_INFORMATION structure). The only difference is, SystemLoadGdiDriverInSystemSpaceInformation uses the global system space (without passing an additional flag to MmLoadSystemImage()), while SystemLoadGdiDriverInformation uses the session space instead. Since the session space is not supported yet, for now simply redirect SystemLoadGdiDriverInSystemSpaceInformation to SystemLoadGdiDriverInformation case, which we have already implemented. However, this code needs to be updated appropriately (an additional flag should be passed to MmLoadSystemImage() call for SystemGdiDriverInformation as well) once a support for session space is implemented. This fixes VM starting failure for VirtualBox 3.1.0 - 4.0.24 and 4.3.0 - 4.3.12 versions. Newer versions of VirtualBox still don't work because of another blocking bugs. CORE-20257 --- ntoskrnl/ex/sysinfo.c | 5 ++--- sdk/include/ndk/extypes.h | 1 + 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ntoskrnl/ex/sysinfo.c b/ntoskrnl/ex/sysinfo.c index 6c6547bf3b8..3acbcb95ffc 100644 --- a/ntoskrnl/ex/sysinfo.c +++ b/ntoskrnl/ex/sysinfo.c @@ -2363,9 +2363,8 @@ QSI_DEF(SystemSessionProcessesInformation) /* Class 54 - Load & map in system space */ SSI_DEF(SystemLoadGdiDriverInSystemSpaceInformation) { - /* FIXME */ - DPRINT1("NtSetSystemInformation - SystemLoadGdiDriverInSystemSpaceInformation not implemented\n"); - return STATUS_NOT_IMPLEMENTED; + /* Similar to SystemLoadGdiDriverInformation */ + return SSI_USE(SystemLoadGdiDriverInformation)(Buffer, Size); } /* Class 55 - NUMA processor information */ diff --git a/sdk/include/ndk/extypes.h b/sdk/include/ndk/extypes.h index f6a491517ac..07bf7ae468f 100644 --- a/sdk/include/ndk/extypes.h +++ b/sdk/include/ndk/extypes.h @@ -1197,6 +1197,7 @@ typedef struct _SYSTEM_MEMORY_INFORMATION } SYSTEM_MEMORY_INFORMATION, *PSYSTEM_MEMORY_INFORMATION; // Class 26 +// See https://www.geoffchappell.com/studies/windows/km/ntoskrnl/api/ex/sysinfo/gdi_driver.htm. typedef struct _SYSTEM_GDI_DRIVER_INFORMATION { UNICODE_STRING DriverName;