From c93cbb9bf12ce115dfdc09a034ed727610bdada0 Mon Sep 17 00:00:00 2001 From: Mikhail Tyukin Date: Tue, 31 Mar 2026 10:10:35 -0400 Subject: [PATCH] [BCRYPTPRIMITIVES] Import from wine-10.0 (#8818) Import bcryptprimitives.dll from wine-10.0 for modern applications --- dll/win32/CMakeLists.txt | 1 + dll/win32/bcryptprimitives/CMakeLists.txt | 13 +++++++++ .../bcryptprimitives/bcryptprimitives.spec | 1 + dll/win32/bcryptprimitives/main.c | 27 +++++++++++++++++++ media/doc/WINESYNC.txt | 1 + 5 files changed, 43 insertions(+) create mode 100644 dll/win32/bcryptprimitives/CMakeLists.txt create mode 100644 dll/win32/bcryptprimitives/bcryptprimitives.spec create mode 100644 dll/win32/bcryptprimitives/main.c diff --git a/dll/win32/CMakeLists.txt b/dll/win32/CMakeLists.txt index 4c681a50b87..a7714b1e435 100644 --- a/dll/win32/CMakeLists.txt +++ b/dll/win32/CMakeLists.txt @@ -271,5 +271,6 @@ add_subdirectory(xolehlp) if(DLL_EXPORT_VERSION GREATER_EQUAL 0x600) add_subdirectory(avrt) + add_subdirectory(bcryptprimitives) add_subdirectory(dwmapi) endif() diff --git a/dll/win32/bcryptprimitives/CMakeLists.txt b/dll/win32/bcryptprimitives/CMakeLists.txt new file mode 100644 index 00000000000..83782c2fcd2 --- /dev/null +++ b/dll/win32/bcryptprimitives/CMakeLists.txt @@ -0,0 +1,13 @@ + +spec2def(bcryptprimitives.dll bcryptprimitives.spec ADD_IMPORTLIB) + +list(APPEND SOURCE + main.c + ${CMAKE_CURRENT_BINARY_DIR}/bcryptprimitives_stubs.c + ${CMAKE_CURRENT_BINARY_DIR}/bcryptprimitives.def) + +add_library(bcryptprimitives MODULE ${SOURCE}) +set_module_type(bcryptprimitives win32dll UNICODE) +add_importlibs(bcryptprimitives advapi32 msvcrt kernel32 ntdll) +add_cd_file(TARGET bcryptprimitives DESTINATION reactos/system32 FOR all) +set_wine_module(bcryptprimitives) diff --git a/dll/win32/bcryptprimitives/bcryptprimitives.spec b/dll/win32/bcryptprimitives/bcryptprimitives.spec new file mode 100644 index 00000000000..928cb06afcd --- /dev/null +++ b/dll/win32/bcryptprimitives/bcryptprimitives.spec @@ -0,0 +1 @@ +@ stdcall ProcessPrng(ptr long) diff --git a/dll/win32/bcryptprimitives/main.c b/dll/win32/bcryptprimitives/main.c new file mode 100644 index 00000000000..6562d672389 --- /dev/null +++ b/dll/win32/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 +#include "windef.h" +#include "winbase.h" +#include "ntsecapi.h" + +BOOL WINAPI ProcessPrng(BYTE *data, SIZE_T size) +{ + return RtlGenRandom(data, size); +} diff --git a/media/doc/WINESYNC.txt b/media/doc/WINESYNC.txt index f97a4d8c299..add6e41f3dc 100644 --- a/media/doc/WINESYNC.txt +++ b/media/doc/WINESYNC.txt @@ -58,6 +58,7 @@ dll/win32/atl100 # Synced to WineStaging-3.3 dll/win32/avifil32 # Synced to WineStaging-4.18 dll/win32/avrt # Synced to Wine-9.7 dll/win32/bcrypt # Synced to WineStaging-1.9.23 (+ winetest synced to 8d8936cbb6fea3cac862e059e814527f5361f48b, a.k.a 20161206-BJ) +dll/win32/bcryptprimitives # Synced to Wine-10.0 dll/win32/bluetoothapis # Synced to Wine-10.0 dll/win32/browseui # Out of sync dll/win32/cabinet # Synced to WineStaging-4.18