@@ -223,11 +223,16 @@ index 2d2b8909..eef6dc27 100644
223223 /*-- rndjent.c --*/
224224 size_t _gcry_rndjent_poll (void (*add)(const void*,
225225diff --git a/random/random-csprng.c b/random/random-csprng.c
226- index 85d11789..6da11933 100644
226+ index 85d11789..12cf6409 100644
227227--- a/random/random-csprng.c
228228+++ b/random/random-csprng.c
229- @@ -40,7 +40,9 @@
229+ @@ -37,10 +37,14 @@
230+ #include <stdlib.h>
231+ #include <errno.h>
232+ #include <string.h>
233+ + #ifdef HAVE_SYS_TIME_H
230234 #include <sys/time.h>
235+ + #endif
231236 #include <sys/types.h>
232237 #include <sys/stat.h>
233238- #include <unistd.h>
@@ -237,7 +242,7 @@ index 85d11789..6da11933 100644
237242 #include <fcntl.h>
238243 #include <time.h>
239244 #ifdef HAVE_GETHRTIME
240- @@ -52,8 +54 ,21 @@
245+ @@ -52,8 +56 ,21 @@
241246 #ifdef HAVE_GETRUSAGE
242247 #include <sys/resource.h>
243248 #endif
@@ -260,7 +265,7 @@ index 85d11789..6da11933 100644
260265 #endif
261266 #ifdef HAVE_W32_SYSTEM
262267 #include <windows.h>
263- @@ -1175,7 +1190 ,11 @@ getfnc_gather_random (void))(void (*)(const void*, size_t,
268+ @@ -1175,7 +1192 ,11 @@ getfnc_gather_random (void))(void (*)(const void*, size_t,
264269 #endif
265270
266271 #if USE_RNDW32
@@ -272,7 +277,7 @@ index 85d11789..6da11933 100644
272277 return fnc;
273278 #endif
274279
275- @@ -1197,7 +1216 ,11 @@ getfnc_fast_random_poll (void))( void (*)(const void*, size_t,
280+ @@ -1197,7 +1218 ,11 @@ getfnc_fast_random_poll (void))( void (*)(const void*, size_t,
276281 enum random_origins)
277282 {
278283 #if USE_RNDW32
@@ -285,7 +290,7 @@ index 85d11789..6da11933 100644
285290 #if USE_RNDW32CE
286291 return _gcry_rndw32ce_gather_random_fast;
287292diff --git a/random/random-drbg.c b/random/random-drbg.c
288- index a42b9ce8..29390047 100644
293+ index a42b9ce8..005534ce 100644
289294--- a/random/random-drbg.c
290295+++ b/random/random-drbg.c
291296@@ -149,7 +149,9 @@
@@ -298,21 +303,22 @@ index a42b9ce8..29390047 100644
298303 #include <stdint.h>
299304
300305 #include "g10lib.h"
301- @@ -157,6 +159,13 @@
306+ @@ -157,6 +159,14 @@
302307 #include "rand-internal.h"
303308 #include "../cipher/bufhelp.h"
304309
305310+ #ifdef HAVE_W32_SYSTEM
306311+ # include <process.h>
307312+ # if defined(WINAPI_FAMILY) && (WINAPI_FAMILY==WINAPI_FAMILY_PC_APP || WINAPI_FAMILY==WINAPI_FAMILY_PHONE_APP)
313+ + # include <windows.h>
308314+ # define getpid() GetCurrentProcessId()
309315+ # endif
310316+ #endif
311317+
312318
313319
314320 /******************************************************************
315- @@ -628,12 +637 ,16 @@ drbg_get_entropy (drbg_state_t drbg, unsigned char *buffer,
321+ @@ -628,12 +638 ,16 @@ drbg_get_entropy (drbg_state_t drbg, unsigned char *buffer,
316322 rc = _gcry_rndunix_gather_random (drbg_read_cb, 0, len,
317323 GCRY_VERY_STRONG_RANDOM);
318324 #elif USE_RNDW32
@@ -360,7 +366,7 @@ index a1d17ad0..330a89a6 100644
360366 rc = -1;
361367 #endif
362368diff --git a/random/random.c b/random/random.c
363- index c0435d7b..d83483b1 100644
369+ index c0435d7b..cc8b6e26 100644
364370--- a/random/random.c
365371+++ b/random/random.c
366372@@ -28,7 +28,9 @@
@@ -373,13 +379,14 @@ index c0435d7b..d83483b1 100644
373379 #ifdef HAVE_SYSLOG
374380 # include <syslog.h>
375381 #endif /*HAVE_SYSLOG*/
376- @@ -42,6 +44,12 @@
382+ @@ -42,6 +44,13 @@
377383 /* The name of a file used to globally configure the RNG. */
378384 #define RANDOM_CONF_FILE "/etc/gcrypt/random.conf"
379385
380386+ #ifdef HAVE_W32_SYSTEM
381387+ # include <process.h>
382388+ # if defined(WINAPI_FAMILY) && (WINAPI_FAMILY==WINAPI_FAMILY_PC_APP || WINAPI_FAMILY==WINAPI_FAMILY_PHONE_APP)
389+ + # include <windows.h>
383390+ # define getpid() GetCurrentProcessId()
384391+ # endif
385392+ #endif
@@ -513,10 +520,10 @@ index b3f63d20..9407306b 100644
513520 break; /* No more drives. */
514521diff --git a/random/rndw32uwp.cpp b/random/rndw32uwp.cpp
515522new file mode 100644
516- index 00000000..b7bd6b8d
523+ index 00000000..4741a13f
517524--- /dev/null
518525+++ b/random/rndw32uwp.cpp
519- @@ -0,0 +1,56 @@
526+ @@ -0,0 +1,57 @@
520527+ /* rndw32uwp - W32 entropy gatherer (UWP)
521528+ *
522529+ * This file is part of Libgcrypt.
@@ -538,6 +545,7 @@ index 00000000..b7bd6b8d
538545+ #include "config.h"
539546+ #include "types.h"
540547+ #include "g10lib.h"
548+ + #include "windows.h"
541549+
542550+ using namespace Platform;
543551+ using namespace Windows::Security::Cryptography;
@@ -590,7 +598,7 @@ index da9948a6..257578d0 100644
590598 #include "g10lib.h"
591599 #include "mpi.h"
592600diff --git a/src/fips.c b/src/fips.c
593- index 391b94f1..2647a594 100644
601+ index 89f8204b..a537ea42 100644
594602--- a/src/fips.c
595603+++ b/src/fips.c
596604@@ -21,7 +21,9 @@
@@ -604,7 +612,7 @@ index 391b94f1..2647a594 100644
604612 #include <string.h>
605613 #ifdef ENABLE_HMAC_BINARY_CHECK
606614 # include <dlfcn.h>
607- @@ -30 ,6 +32 ,12 @@
615+ @@ -32 ,6 +34 ,12 @@
608616 #ifdef HAVE_SYSLOG
609617 # include <syslog.h>
610618 #endif /*HAVE_SYSLOG*/
@@ -618,14 +626,15 @@ index 391b94f1..2647a594 100644
618626 /* The name of the file used to force libgcrypt into fips mode. */
619627 #define FIPS_FORCE_FILE "/etc/gcrypt/fips_enabled"
620628diff --git a/src/gcrypt.h.in b/src/gcrypt.h.in
621- index b1364123..cb454607 100644
629+ index b1364123..9fb4107c 100644
622630--- a/src/gcrypt.h.in
623631+++ b/src/gcrypt.h.in
624- @@ -34,7 +34,7 @@
632+ @@ -34,7 +34,8 @@
625633
626634 #if defined _WIN32 || defined __WIN32__
627635 # ifndef __GNUC__
628636- typedef long ssize_t;
637+ + # include <basetsd.h>
629638+ typedef SSIZE_T ssize_t;
630639 typedef int pid_t;
631640 # endif /*!__GNUC__*/
0 commit comments