From: Zebediah Figura Subject: [PATCH] ntdll: Return buffer filled with random values from SystemInterruptInformation. Message-Id: <20190928001404.28345-1-z.figura12@gmail.com> Date: Fri, 27 Sep 2019 19:14:04 -0500 From: Sebastian Lackner Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=39123 Signed-off-by: Zebediah Figura --- dlls/ntdll/nt.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/dlls/ntdll/nt.c b/dlls/ntdll/nt.c index 5afdf77986a..7b618269703 100644 --- a/dlls/ntdll/nt.c +++ b/dlls/ntdll/nt.c @@ -2799,10 +2799,21 @@ NTSTATUS WINAPI NtQuerySystemInformation( case SystemInterruptInformation: { SYSTEM_INTERRUPT_INFORMATION sii; + int dev_random; memset(&sii, 0, sizeof(sii)); len = sizeof(sii); + /* Some applications use the returned buffer for random number + * generation. Its unlikely that an app depends on the exact + * layout, so just fill with values from /dev/urandom. */ + dev_random = open( "/dev/urandom", O_RDONLY ); + if (dev_random != -1) + { + read( dev_random, &sii, sizeof(sii) ); + close( dev_random ); + } + if ( Length >= len) { if (!SystemInformation) ret = STATUS_ACCESS_VIOLATION; -- 2.23.0