55 lines
2.2 KiB
MQL5
55 lines
2.2 KiB
MQL5
//+------------------------------------------------------------------+
|
|
//| Main.mqh |
|
|
//| Copyright 2026, Niquel Mendoza |
|
|
//| https://www.mql5.com |
|
|
//+------------------------------------------------------------------+
|
|
#property copyright "Copyright 2026, Niquel Mendoza"
|
|
#property link "https://www.mql5.com"
|
|
#property strict
|
|
|
|
#ifndef CRYPTOBYLEO_SRC_BCRYPT_MAIN_MQH
|
|
#define CRYPTOBYLEO_SRC_BCRYPT_MAIN_MQH
|
|
|
|
//+------------------------------------------------------------------+
|
|
//| |
|
|
//+------------------------------------------------------------------+
|
|
// Codigos generales para NSTATUS
|
|
// Nota que no es neceario esto puedes obetnerlo en:
|
|
// https://learn.microsoft.com/es-es/windows/win32/api/bcrypt/nf-bcrypt-bcryptgenrandom
|
|
// En mic aso como quiero manteer todo en orden ya tengo mi lib para cosas de DLL asi que la incluyo noma
|
|
#include <TSN\\ExtraCodes\\ZwNtCodes.mqh>
|
|
|
|
//+------------------------------------------------------------------+
|
|
//| BCrypt |
|
|
//+------------------------------------------------------------------+
|
|
//--- Defines
|
|
#define BCRYPT_RNG_USE_ENTROPY_IN_BUFFER (0x00000001)
|
|
#define BCRYPT_USE_SYSTEM_PREFERRED_RNG (0x00000002)
|
|
#define BCRYPT_INVALID_PARAMS (-1)
|
|
|
|
// int __stdcall BCryptRandomWOffset(PUCHAR buffer, int offset, int length)
|
|
|
|
//+------------------------------------------------------------------+
|
|
//| |
|
|
//+------------------------------------------------------------------+
|
|
// offset es en BYTES no en la unidad de pbuffer asi que tener cuidado con eso...
|
|
// Lo recomandble es usar la version uchar.. la version ulong solo wrrapeada.. para evitar bug sutiles
|
|
//--- ulong
|
|
#import "BCryptWrraper.dll"
|
|
int BCryptRandomWOffset(
|
|
ulong &pbBuffer[],
|
|
int offset,
|
|
int length
|
|
);
|
|
|
|
//--- uchar
|
|
int BCryptRandomWOffset(
|
|
uchar &pbBuffer[],
|
|
int offset,
|
|
int length
|
|
);
|
|
|
|
#import
|
|
|
|
|
|
#endif // CRYPTOBYLEO_SRC_BCRYPT_MAIN_MQH
|