X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/93b581bd031b2270deb7f45440e61a1044fe94da..7440fd4419acfc9c784f142fb9dee3e64c9a18c2:/noise.c diff --git a/noise.c b/noise.c index a094d25e..00719bbd 100644 --- a/noise.c +++ b/noise.c @@ -3,7 +3,6 @@ * generator. */ -#include #include #include "putty.h" @@ -40,6 +39,8 @@ void noise_get_heavy(void (*func) (void *, int)) } read_random_seed(func); + /* Update the seed immediately, in case another instance uses it. */ + random_save_seed(); gsps = NULL; mod = GetModuleHandle("KERNEL32"); @@ -56,6 +57,7 @@ void random_save_seed(void) if (random_active) { random_get_savedata(&data, &len); write_random_seed(data, len); + sfree(data); } } @@ -129,7 +131,7 @@ void noise_regular(void) * counter to the noise pool. It gets the scan code or mouse * position passed in. */ -void noise_ultralight(DWORD data) +void noise_ultralight(unsigned long data) { DWORD wintime; LARGE_INTEGER perftime;