CryptoByLeo/Src/BCrypt/bcrypt.cpp
2026-09-01 14:36:04 -05:00

24 строки
Без EOL
944 Б
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
);
}