From 0cb2647baa3ea72babb05e24d2f1fa23cdedb0a1 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Thu, 7 Jan 2016 06:01:01 +0100
Subject: [PATCH] ntdll: Return buffer filled with random values from
 SystemInterruptInformation.

---
 dlls/ntdll/unix/system.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/dlls/ntdll/unix/system.c b/dlls/ntdll/unix/system.c
index 68de16b7e5b..5ba9fb41156 100644
--- a/dlls/ntdll/unix/system.c
+++ b/dlls/ntdll/unix/system.c
@@ -2003,8 +2003,20 @@ NTSTATUS WINAPI NtQuerySystemInformation( SYSTEM_INFORMATION_CLASS class,
     case SystemInterruptInformation:
     {
         SYSTEM_INTERRUPT_INFORMATION sii = {{ 0 }};
+        int dev_random;
 
         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 (size >= len)
         {
             if (!info) ret = STATUS_ACCESS_VIOLATION;
-- 
2.27.0

