about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/os/my_cpuid_wine.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/os/my_cpuid_wine.c b/src/os/my_cpuid_wine.c
index c2d24b1c..16aab3f1 100644
--- a/src/os/my_cpuid_wine.c
+++ b/src/os/my_cpuid_wine.c
@@ -2,6 +2,9 @@
 
 #include "my_cpuid.h"
 
+NTSYSAPI ULONG WINAPI NtGetTickCount(VOID);
+NTSYSAPI ULONG NTAPI RtlRandom(ULONG *seed);
+
 const char* getBoxCpuName()
 {
     return NULL;
@@ -18,12 +21,13 @@ uint32_t helper_getcpu(x64emu_t* emu) {
 
 uint32_t get_random32(void)
 {
-    // FIXME
-    return 0;
+    ULONG seed = NtGetTickCount();
+    return RtlRandom(&seed);
 }
 
 uint64_t get_random64(void)
 {
-    // FIXME
-    return 0;
-}
\ No newline at end of file
+    ULONG seed = NtGetTickCount();
+    uint64_t tmp = RtlRandom(&seed);
+    return RtlRandom(&seed) | (tmp << 32);
+}