From: Chris Denton chris@chrisdenton.dev
ProcessPrng is the only publicly documented function exported by bcryptprimitives. This stub simply forwards it to RtlGenRandom in advapi32.
Note that there is no documented header file or import lib.
Documentation: https://learn.microsoft.com/en-us/windows/win32/seccng/processprng --- configure.ac | 1 + dlls/bcryptprimitives/Makefile.in | 5 ++++ dlls/bcryptprimitives/bcryptprimitives.spec | 1 + dlls/bcryptprimitives/main.c | 27 +++++++++++++++++++++ 4 files changed, 34 insertions(+) create mode 100644 dlls/bcryptprimitives/Makefile.in create mode 100644 dlls/bcryptprimitives/bcryptprimitives.spec create mode 100644 dlls/bcryptprimitives/main.c
diff --git a/configure.ac b/configure.ac index 3ab6d787d61..4cac45e6e42 100644 --- a/configure.ac +++ b/configure.ac @@ -2392,6 +2392,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) diff --git a/dlls/bcryptprimitives/Makefile.in b/dlls/bcryptprimitives/Makefile.in new file mode 100644 index 00000000000..537383ba530 --- /dev/null +++ b/dlls/bcryptprimitives/Makefile.in @@ -0,0 +1,5 @@ +MODULE = bcryptprimitives.dll +IMPORTS = advapi32 + +C_SRCS = \ + main.c diff --git a/dlls/bcryptprimitives/bcryptprimitives.spec b/dlls/bcryptprimitives/bcryptprimitives.spec new file mode 100644 index 00000000000..928cb06afcd --- /dev/null +++ b/dlls/bcryptprimitives/bcryptprimitives.spec @@ -0,0 +1 @@ +@ stdcall ProcessPrng(ptr long) diff --git a/dlls/bcryptprimitives/main.c b/dlls/bcryptprimitives/main.c new file mode 100644 index 00000000000..6562d672389 --- /dev/null +++ b/dlls/bcryptprimitives/main.c @@ -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); +}