File indexing completed on 2025-01-18 09:53:44
0001
0002
0003
0004
0005
0006
0007
0008 #ifndef BOOST_WINAPI_BCRYPT_HPP_INCLUDED_
0009 #define BOOST_WINAPI_BCRYPT_HPP_INCLUDED_
0010
0011 #include <boost/winapi/basic_types.hpp>
0012
0013 #ifdef BOOST_HAS_PRAGMA_ONCE
0014 #pragma once
0015 #endif
0016
0017 #if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
0018
0019 #if BOOST_WINAPI_PARTITION_APP_SYSTEM
0020
0021 #if defined(BOOST_USE_WINDOWS_H)
0022 #include <bcrypt.h>
0023 #endif
0024
0025 #include <boost/winapi/detail/header.hpp>
0026
0027 #if defined(BOOST_USE_WINDOWS_H)
0028
0029 namespace boost { namespace winapi {
0030 typedef ::BCRYPT_ALG_HANDLE BCRYPT_ALG_HANDLE_;
0031 }}
0032
0033 #else
0034
0035 namespace boost { namespace winapi {
0036 typedef PVOID_ BCRYPT_ALG_HANDLE_;
0037 }}
0038
0039 extern "C" {
0040
0041 boost::winapi::NTSTATUS_ BOOST_WINAPI_WINAPI_CC
0042 BCryptCloseAlgorithmProvider(
0043 boost::winapi::BCRYPT_ALG_HANDLE_ hAlgorithm,
0044 boost::winapi::ULONG_ dwFlags
0045 );
0046
0047 boost::winapi::NTSTATUS_ BOOST_WINAPI_WINAPI_CC
0048 BCryptGenRandom(
0049 boost::winapi::BCRYPT_ALG_HANDLE_ hAlgorithm,
0050 boost::winapi::PUCHAR_ pbBuffer,
0051 boost::winapi::ULONG_ cbBuffer,
0052 boost::winapi::ULONG_ dwFlags
0053 );
0054
0055 boost::winapi::NTSTATUS_ BOOST_WINAPI_WINAPI_CC
0056 BCryptOpenAlgorithmProvider(
0057 boost::winapi::BCRYPT_ALG_HANDLE_ *phAlgorithm,
0058 boost::winapi::LPCWSTR_ pszAlgId,
0059 boost::winapi::LPCWSTR_ pszImplementation,
0060 boost::winapi::DWORD_ dwFlags
0061 );
0062
0063 }
0064
0065 #endif
0066
0067 namespace boost {
0068 namespace winapi {
0069
0070 #if defined(BOOST_USE_WINDOWS_H)
0071 const WCHAR_ BCRYPT_RNG_ALGORITHM_[] = BCRYPT_RNG_ALGORITHM;
0072 #else
0073 const WCHAR_ BCRYPT_RNG_ALGORITHM_[] = L"RNG";
0074 #endif
0075
0076 using ::BCryptCloseAlgorithmProvider;
0077 using ::BCryptGenRandom;
0078 using ::BCryptOpenAlgorithmProvider;
0079
0080 }
0081 }
0082
0083 #include <boost/winapi/detail/footer.hpp>
0084
0085 #endif
0086
0087 #endif
0088
0089 #endif