Skip to content

Commit

Permalink
bcryptprimitives: ProcessPrng stub.
Browse files Browse the repository at this point in the history
ProcessPrng is the only publicly documented function exported by bcryptprimitives. This stub simply forwards it to RtlGenRandom in advapi32.

(cherry picked from commit 83d4075)

CW-Bug-Id: #23012
  • Loading branch information
ChrisDenton authored and Paul Gofman committed Nov 17, 2023
1 parent 790e189 commit f000f11
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 0 deletions.
1 change: 1 addition & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2442,6 +2442,7 @@ WINE_CONFIG_MAKEFILE(dlls/avifile.dll16,enable_win16)
WINE_CONFIG_MAKEFILE(dlls/avrt)
WINE_CONFIG_MAKEFILE(dlls/bcrypt)
WINE_CONFIG_MAKEFILE(dlls/bcrypt/tests)
WINE_CONFIG_MAKEFILE(dlls/bcryptprimitives)
WINE_CONFIG_MAKEFILE(dlls/bluetoothapis)
WINE_CONFIG_MAKEFILE(dlls/browseui)
WINE_CONFIG_MAKEFILE(dlls/browseui/tests)
Expand Down
5 changes: 5 additions & 0 deletions dlls/bcryptprimitives/Makefile.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
MODULE = bcryptprimitives.dll
IMPORTS = advapi32

C_SRCS = \
main.c
1 change: 1 addition & 0 deletions dlls/bcryptprimitives/bcryptprimitives.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@ stdcall ProcessPrng(ptr long)
27 changes: 27 additions & 0 deletions dlls/bcryptprimitives/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* Copyright 2023 Christopher S. Denton
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/

#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "ntsecapi.h"

BOOL WINAPI ProcessPrng(BYTE *data, SIZE_T size)
{
return RtlGenRandom(data, size);
}

0 comments on commit f000f11

Please sign in to comment.