I've taken some C code and compiled it inside a C++ WinRT Component for Universal Apps. I then wrote a C++ wrapper class to expose the functionality of C code to my C# Universal Store Project as per the manuals: 1, 2.
Works fine for Windows 8.1 part of the project, but fails to load the component on Windows Phone 8.1 saying just "The specified module could not be found"
. I've found out that the problem is that the C code uses the following random generator function:
# define RtlGenRandom SystemFunction036
BOOLEAN NTAPI RtlGenRandom(PVOID RandomBuffer, ULONG RandomBufferLength);
# pragma comment(lib, "advapi32.lib")
Which seems to be unavailable on WP8.1.
This MSDN page suggests that we should use CryptGenRandom
instead, but the latter resides in Wincrypt.h
, which is not available on WP8.1.
So, what random generator can we use from C code?
Aucun commentaire:
Enregistrer un commentaire