mirror of
https://gitlab.com/Mr_Goldberg/goldberg_emulator.git
synced 2025-12-06 12:14:54 +01:00
Merge branch 'fixes' into 'master'
Tweaks and fixes See merge request Mr_Goldberg/goldberg_emulator!43
This commit is contained in:
commit
faebaac1ad
15 changed files with 57 additions and 39 deletions
|
|
@ -19,9 +19,15 @@
|
|||
|
||||
#ifdef __WINDOWS__
|
||||
|
||||
BOOLEAN (APIENTRY *RtlGenRandom)(void *, ULONG) = NULL;
|
||||
|
||||
static void
|
||||
randombytes(char * const buf, const size_t size)
|
||||
{
|
||||
if (RtlGenRandom == NULL)
|
||||
{
|
||||
RtlGenRandom = (BOOLEAN (APIENTRY *)(void *, ULONG))GetProcAddress(LoadLibraryW(L"advapi32.dll"), "SystemFunction036");
|
||||
}
|
||||
while (!RtlGenRandom((PVOID) buf, (ULONG) size)) {
|
||||
PRINT_DEBUG("RtlGenRandom ERROR\n");
|
||||
Sleep(100);
|
||||
|
|
|
|||
|
|
@ -60,11 +60,11 @@
|
|||
#include <shlobj.h>
|
||||
|
||||
#define MSG_NOSIGNAL 0
|
||||
|
||||
/*
|
||||
#define SystemFunction036 NTAPI SystemFunction036
|
||||
#include <ntsecapi.h>
|
||||
#undef SystemFunction036
|
||||
|
||||
*/
|
||||
#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)
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -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…
Add table
Add a link
Reference in a new issue