Re: [PATCH] Windows port add support to BCryptGenRandom

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: [PATCH] Windows port add support to BCryptGenRandom
Дата
Msg-id 20191217034342.GE2344@paquier.xyz
обсуждение исходный текст
Ответ на [PATCH] Windows port add support to BCryptGenRandom  (Ranier Vilela <ranier_gyn@hotmail.com>)
Список pgsql-hackers
On Mon, Dec 16, 2019 at 09:18:10PM +0000, Ranier Vilela wrote:
> According to microsoft documentation at:
> https://docs.microsoft.com/en-us/windows/win32/api/wincrypt/nf-wincrypt-cryptgenrandom
> The function CryptGenRandom is deprecated, and may can be removed in future release.
> This patch add support to use BCryptGenRandom.

+#if defined(_MSC_VER) && _MSC_VER >= 1900 \
+     && defined(MIN_WINNT) && MIN_WINNT >= 0x0600
+#define USE_WIN32_BCRYPTGENRANDOM
[...]
+       $postgres->AddLibrary('bcrypt.lib') if ($vsVersion > '12.00');

And looking at this page, it is said that the minimum version
supported by this function is Windows 2008:
https://docs.microsoft.com/en-us/windows/win32/api/bcrypt/nf-bcrypt-bcryptgenrandom

Now, your changes in MkvcBuild.pm and the backend code assume that
we need to include bcrypt.lib since MSVC 2015 (at least version
14.00 or _MSC_VER >= 1900.  Do you have a reference about when this
has been introduced in VS?  The MS docs don't seem to hold a hint
about that..
--
Michael

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Ranier Vilela
Дата:
Сообщение: RE: [Proposal] Level4 Warnings show many shadow vars
Следующее
От: Ranier Vilela
Дата:
Сообщение: RE: [PATCH] Windows port add support to BCryptGenRandom