24 satır
944 Bayt
C++
24 satır
944 Bayt
C++
| |||
//+------------------------------------------------------------------+
| |||
//| bcrypt.cpp |
| |||
//| Copyright 2026, Niquel Mendoza |
| |||
//| https://www.mql5.com |
| |||
//+------------------------------------------------------------------+
| |||
#include <windows.h>
| |||
#include <bcrypt.h>
| |||
| |||
//+------------------------------------------------------------------+
| |||
// Main |
| |||
//+------------------------------------------------------------------+
| |||
extern "C" __declspec(dllexport)
| |||
int __stdcall BCryptRandomWOffset(PUCHAR buffer, int offset, int length)
| |||
{
| |||
if (buffer == nullptr || offset < 0 || length < 0)
| |||
return -1;
| |||
return BCryptGenRandom(
| |||
NULL,
| |||
buffer + offset,
| |||
static_cast<ULONG>(length),
| |||
BCRYPT_USE_SYSTEM_PREFERRED_RNG
| |||
);
| |||
}
|