From b5e7601012ec0be4ca4817e17d596aaf5b2fa3b6 Mon Sep 17 00:00:00 2001 From: mingkuang Date: Sun, 14 Jul 2024 21:15:32 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A9=BA=E5=A3=B3BCryptImportKeyPair?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Thunks/bcrypt.hpp | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/src/Thunks/bcrypt.hpp b/src/Thunks/bcrypt.hpp index 9927d68..cfe9cb2 100644 --- a/src/Thunks/bcrypt.hpp +++ b/src/Thunks/bcrypt.hpp @@ -3029,4 +3029,34 @@ namespace YY::Thunks return S_OK; } #endif + + +#if (YY_Thunks_Target < __WindowsNT6) + + // 最低受支持的客户端 Windows Vista [桌面应用 | UWP 应用] + // 最低受支持的服务器 Windows Server 2008[桌面应用 | UWP 应用] + __DEFINE_THUNK( + bcrypt, + 8, + NTSTATUS, + WINAPI, + BCryptImportKeyPair, + _In_ BCRYPT_ALG_HANDLE _hAlgorithm, + _In_opt_ BCRYPT_KEY_HANDLE _hImportKey, + _In_z_ LPCWSTR _szBlobType, + _Out_ BCRYPT_KEY_HANDLE* _phKey, + _In_reads_bytes_(_cbInput) PUCHAR _pInput, + _In_ ULONG _cbInput, + _In_ ULONG _fFlags + ) + { + if (const auto _pfnBCryptImportKeyPair = try_get_BCryptImportKeyPair()) + { + return _pfnBCryptImportKeyPair(_hAlgorithm, _hImportKey, _szBlobType, _phKey, _pInput, _cbInput, _fFlags); + } + + __WarningMessage__("尚未完成!"); + return S_OK; + } +#endif }