diff options
| author | André Zwing <nerv@dawncrow.de> | 2025-05-25 17:45:51 +0200 |
|---|---|---|
| committer | André Zwing <nerv@dawncrow.de> | 2025-05-25 18:27:42 +0200 |
| commit | b6429edf0975f54c533a4a46a7fe332396a3a781 (patch) | |
| tree | 3670301a50f68c7c5432b0c9a826e9b7c1cb8f86 /src | |
| parent | 1e2bae923734c61c16f7e2ca6e8dbc193a7a6ce2 (diff) | |
| download | box64-b6429edf0975f54c533a4a46a7fe332396a3a781.tar.gz box64-b6429edf0975f54c533a4a46a7fe332396a3a781.zip | |
[WOW64] Implement get_random32 and get_random64
Diffstat (limited to 'src')
| -rw-r--r-- | src/os/my_cpuid_wine.c | 14 |
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); +} |