mirror of
https://github.com/Detanup01/gbe_fork.git
synced 2024-12-02 23:35:37 +08:00
remove RtlGenRandom and use the newer BCryptGenRandom
This commit is contained in:
parent
a841f43f4b
commit
3afde6e996
1
.gitignore
vendored
1
.gitignore
vendored
@ -11,7 +11,6 @@ release/*
|
|||||||
/dll/net.pb.h
|
/dll/net.pb.h
|
||||||
base.exp
|
base.exp
|
||||||
base.lib
|
base.lib
|
||||||
rtlgenrandom*
|
|
||||||
steamclient.exp
|
steamclient.exp
|
||||||
steamclient.lib
|
steamclient.lib
|
||||||
out/*
|
out/*
|
||||||
|
@ -22,8 +22,9 @@
|
|||||||
static void
|
static void
|
||||||
randombytes(char * const buf, const size_t size)
|
randombytes(char * const buf, const size_t size)
|
||||||
{
|
{
|
||||||
while (!RtlGenRandom((PVOID) buf, (ULONG) size)) {
|
// NT_SUCCESS is: return value >= 0, including Ntdef.h causes so many errors
|
||||||
PRINT_DEBUG("RtlGenRandom ERROR\n");
|
while (BCryptGenRandom(NULL, (PUCHAR) buf, (ULONG) size, BCRYPT_USE_SYSTEM_PREFERRED_RNG) < 0) {
|
||||||
|
PRINT_DEBUG("BCryptGenRandom ERROR\n");
|
||||||
Sleep(100);
|
Sleep(100);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -61,9 +61,7 @@
|
|||||||
|
|
||||||
#define MSG_NOSIGNAL 0
|
#define MSG_NOSIGNAL 0
|
||||||
|
|
||||||
#define SystemFunction036 NTAPI SystemFunction036
|
#include <bcrypt.h>
|
||||||
#include <ntsecapi.h>
|
|
||||||
#undef SystemFunction036
|
|
||||||
|
|
||||||
#ifndef EMU_RELEASE_BUILD
|
#ifndef EMU_RELEASE_BUILD
|
||||||
#define PRINT_DEBUG(a, ...) do {FILE *t = fopen("STEAM_LOG.txt", "a"); fprintf(t, "%u " a, GetCurrentThreadId(), __VA_ARGS__); fclose(t); WSASetLastError(0);} while (0)
|
#define PRINT_DEBUG(a, ...) do {FILE *t = fopen("STEAM_LOG.txt", "a"); fprintf(t, "%u " a, GetCurrentThreadId(), __VA_ARGS__); fclose(t); WSASetLastError(0);} while (0)
|
||||||
|
@ -1,4 +0,0 @@
|
|||||||
#include <windows.h>
|
|
||||||
#define RtlGenRandom SystemFunction036
|
|
||||||
#define DLLEXPORT __declspec(dllexport)
|
|
||||||
DLLEXPORT BOOLEAN WINAPI RtlGenRandom(PVOID in, ULONG len) {}
|
|
@ -1,3 +0,0 @@
|
|||||||
LIBRARY advapi32.dll
|
|
||||||
EXPORTS
|
|
||||||
SystemFunction036
|
|
Loading…
Reference in New Issue
Block a user