Skip to content

Commit

Permalink
Fix link issue in UWP builds without functional replacement
Browse files Browse the repository at this point in the history
  • Loading branch information
liedtkeInTUM committed Mar 30, 2023
1 parent 6832aa2 commit 6d65e9c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion contrib/unzip/crypt.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,15 @@ int cryptrand(unsigned char *buf, unsigned int len)
unsigned __int64 pentium_tsc[1];
int result = 0;


#if defined(WINAPI_FAMILY) && WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP
if (CryptAcquireContext(&provider, NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT | CRYPT_SILENT))
{
result = CryptGenRandom(provider, len, buf);
CryptReleaseContext(provider, 0);
if (result)
return len;
}
#endif

for (rlen = 0; rlen < (int)len; ++rlen)
{
Expand Down

0 comments on commit 6d65e9c

Please sign in to comment.