bcrypt: Added BCryptGenRandom stub (try2)

Jascha Knack jascha.knack at smail.inf.h-brs.de
Sun Jan 5 07:20:56 CST 2014


>From cf97fb986929358369df5f9f5904bb73f4ca2a3f Mon Sep 17 00:00:00 2001
From: Jascha Knack <jascha.knack at smail.inf.h-brs.de>
Date: Sun, 5 Jan 2014 14:01:05 +0100
Subject: bcrypt: Added BCryptGenRandom stub

---
 dlls/bcrypt/bcrypt.spec   |  2 +-
 dlls/bcrypt/bcrypt_main.c | 13 ++++++++++++-
 include/bcrypt.h          |  4 ++++
 3 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/dlls/bcrypt/bcrypt.spec b/dlls/bcrypt/bcrypt.spec
index e1ffb8a..87623f8 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 441b3ef..25ba576 100644
--- a/dlls/bcrypt/bcrypt_main.c
+++ b/dlls/bcrypt/bcrypt_main.c
@@ -18,6 +18,9 @@
  */
 
 #include "config.h"
+
+#include "ntstatus.h"
+
 #include "wine/port.h"
 #include "wine/debug.h"
 
@@ -48,5 +51,13 @@ 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 hAlgorithm, PUCHAR pbBuffer,
+                                ULONG cbBuffer, ULONG dwFlags)
+{
+    FIXME("%p, %p, %08x, %08x - stub\n", hAlgorithm, pbBuffer, cbBuffer, dwFlags);
+
+    return STATUS_NOT_IMPLEMENTED;
 }
diff --git a/include/bcrypt.h b/include/bcrypt.h
index 43d1f94..d93bc44 100644
--- a/include/bcrypt.h
+++ b/include/bcrypt.h
@@ -47,4 +47,8 @@ typedef struct _BCRYPT_ALGORITHM_IDENTIFIER
     ULONG  dwFlags;
 } BCRYPT_ALGORITHM_IDENTIFIER;
 
+typedef PVOID BCRYPT_ALG_HANDLE;
+
+NTSTATUS WINAPI BCryptGenRandom(BCRYPT_ALG_HANDLE, PUCHAR, ULONG, ULONG);
+
 #endif  /* __WINE_BCRYPT_H */
-- 
1.8.4.2



More information about the wine-patches mailing list