[PATCH] ntdll: Return buffer filled with random values from SystemInterruptInformation.
From: Sebastian Lackner <sebastian(a)fds-team.de> Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=39123 Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> --- 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
participants (1)
-
Zebediah Figura