[libav-devel] [PATCH] use bcrypt instead of the old wincrypt API

Diego Biurrun diego at biurrun.de
Fri Mar 30 10:46:35 CEST 2018


On Fri, Mar 30, 2018 at 09:36:05AM +0200, Steve Lhomme wrote:
> --- a/configure
> +++ b/configure
> @@ -1708,6 +1708,7 @@ SYSTEM_LIBRARIES="
>      vaapi_x11
>      vdpau_x11
> +    bcrypt
>      wincrypt
>  "

This should be ordered.

> @@ -2611,7 +2612,7 @@ avdevice_extralibs="libm_extralibs"
>  avfilter_extralibs="pthreads_extralibs libm_extralibs"
>  avresample_extralibs="libm_extralibs"
> -avutil_extralibs="clock_gettime_extralibs cuda_extralibs cuvid_extralibs d3d11va_extralibs libm_extralibs libmfx_extralibs nanosleep_extralibs pthreads_extralibs user32_extralibs vaapi_extralibs vaapi_drm_extralibs vaapi_x11_extralibs vdpau_x11_extralibs wincrypt_extralibs"
> +avutil_extralibs="clock_gettime_extralibs cuda_extralibs cuvid_extralibs d3d11va_extralibs libm_extralibs libmfx_extralibs nanosleep_extralibs pthreads_extralibs user32_extralibs vaapi_extralibs vaapi_drm_extralibs vaapi_x11_extralibs vdpau_x11_extralibs bcrypt_extralibs wincrypt_extralibs"

same

> @@ -4581,6 +4582,7 @@ check_lib ole32    "windows.h"            CoTaskMemFree        -lole32
>  check_lib shell32  "windows.h shellapi.h" CommandLineToArgvW   -lshell32
>  check_lib wincrypt "windows.h wincrypt.h" CryptGenRandom       -ladvapi32
>  check_lib psapi    "windows.h psapi.h"    GetProcessMemoryInfo -lpsapi
> +check_cpp_condition Vista+ windows.h "_WIN32_WINNT >= 0x0600" && check_lib bcrypt "windows.h bcrypt.h" BCryptGenRandom  -lbcrypt

Do you really need to check the Vista condition? What about using bcrypt
unconditionally if available? The variable name with an uppercase letter
and a '+' is slightly odd. I'm not sure if it can cause problems but I
cannot rule it out offhand either.

Diego


More information about the libav-devel mailing list