From 52aca431e4acb099ae66d5689616793b11314ef9 Mon Sep 17 00:00:00 2001 From: Bruno Jesus <00cpxxx@gmail.com> Date: Mon, 3 Feb 2014 16:24:21 -0200 Subject: [PATCH] bcrypt: Add BCryptGenRandom stub. --- dlls/bcrypt/bcrypt.spec | 2 +- dlls/bcrypt/bcrypt_main.c | 17 ++++++++++++++--- include/bcrypt.h | 5 +++++ 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/dlls/bcrypt/bcrypt.spec b/dlls/bcrypt/bcrypt.spec index e1ffb8a96d2..87623f8a480 100644 --- a/dlls/bcrypt/bcrypt.spec +++ b/dlls/bcrypt/bcrypt.spec @@ -24,7 +24,7 @@ @ stub BCryptFinalizeKeyPair @ stub BCryptFinishHash @ stub BCryptFreeBuffer -@ stub BCryptGenRandom +@ stdcall BCryptGenRandom(ptr ptr long long) @ stub BCryptGenerateKeyPair @ stub BCryptGenerateSymmetricKey @ stub BCryptGetFipsAlgorithmMode diff --git a/dlls/bcrypt/bcrypt_main.c b/dlls/bcrypt/bcrypt_main.c index 441b3efa0e5..02d0a7d1a76 100644 --- a/dlls/bcrypt/bcrypt_main.c +++ b/dlls/bcrypt/bcrypt_main.c @@ -18,11 +18,15 @@ */ #include "config.h" -#include "wine/port.h" -#include "wine/debug.h" +#include + +#include "ntstatus.h" +#define WIN32_NO_STATUS +#include "windef.h" #include "winbase.h" #include "bcrypt.h" +#include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(bcrypt); @@ -48,5 +52,12 @@ NTSTATUS WINAPI BCryptEnumAlgorithms(ULONG dwAlgOperations, ULONG *pAlgCount, *ppAlgList=NULL; *pAlgCount=0; - return ERROR_CALL_NOT_IMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +NTSTATUS WINAPI BCryptGenRandom(BCRYPT_ALG_HANDLE algorithm, UCHAR *buffer, ULONG count, ULONG flags) +{ + FIXME("%p, %p, %u, %08x - stub\n", algorithm, buffer, count, flags); + + return STATUS_NOT_IMPLEMENTED; } diff --git a/include/bcrypt.h b/include/bcrypt.h index 43d1f94096c..e7e7a597af4 100644 --- a/include/bcrypt.h +++ b/include/bcrypt.h @@ -47,4 +47,9 @@ typedef struct _BCRYPT_ALGORITHM_IDENTIFIER ULONG dwFlags; } BCRYPT_ALGORITHM_IDENTIFIER; +typedef PVOID BCRYPT_ALG_HANDLE; + +#define BCRYPT_RNG_USE_ENTROPY_IN_BUFFER 0x00000001 +#define BCRYPT_USE_SYSTEM_PREFERRED_RNG 0x00000002 + #endif /* __WINE_BCRYPT_H */