[vlc-devel] [PATCH] contrib: gcrypt: do not use the API via LoadLibrary on winstore builds
Steve Lhomme
robux4 at gmail.com
Tue May 24 16:09:35 CEST 2016
On Tue, May 24, 2016 at 3:06 PM, Jean-Baptiste Kempf <jb at videolan.org> wrote:
> On 24 May, Steve Lhomme wrote :
>> ++#include <winapifamily.h>
>> ++#if (WINAPI_FAMILY == WINAPI_FAMILY_PC_APP || WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP)
>> ++#include <wincrypt.h>
>> ++#else
>> + /* We don't include wincrypt.h so define it here. */
>> + #define HCRYPTPROV HANDLE
>> ++#endif
>
> Why not make that if WINNT > 0x501 ?
Because on winstore builds you can't load system DLLs. You just link
with the system libraries. For the rest the original code is
untouched.
>> ++#if (WINAPI_FAMILY == WINAPI_FAMILY_PC_APP || WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP)
>> ++ pCryptAcquireContext = CryptAcquireContext;
>> ++ pCryptGenRandom = CryptGenRandom;
>> ++ pCryptReleaseContext = CryptReleaseContext;
>> ++ pRtlGenRandom = CryptGenRandom;
>> ++#else
>> + hAdvAPI32 = GetModuleHandle ("AdvAPI32.dll");
>> + if (!hAdvAPI32)
>> + return;
>> +@@ -274,6 +287,7 @@ init_system_rng (void)
>> + This isn't exported by name, so we have to get it by ordinal. */
>> + pRtlGenRandom = (RTLGENRANDOM)
>> + GetProcAddress (hAdvAPI32, "SystemFunction036");
>> ++#endif
>
> OK, maybe you cannot with pRtlGenRandom
In my patch it's just assigned a value to pass a NULL test but it's not used.
> With my kindest regards,
>
> --
> Jean-Baptiste Kempf
> http://www.jbkempf.com/ - +33 672 704 734
> Sent from my Electronic Device
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
More information about the vlc-devel
mailing list