mirror of
https://gitlab.com/Mr_Goldberg/goldberg_emulator.git
synced 2025-12-06 04:04:53 +01:00
Tweaks and fixes
1. Dynamically load RtlGenRandom() from advapi32.dll 2. Fix no return value warning in steam_overlay.h 3. Fix command-line too long issue in batch files by using setlocal/endlocal
This commit is contained in:
parent
802d8bcc8f
commit
856c0e7d26
13 changed files with 47 additions and 35 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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue