X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/32874aeac8dacbca26663777b39a79efc5d8dc4b..1d009ae71b849a95c86c3117d1b8f063fda8aae5:/noise.c diff --git a/noise.c b/noise.c index 856974bc..a9dfa892 100644 --- a/noise.c +++ b/noise.c @@ -40,6 +40,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"); @@ -53,8 +55,11 @@ void random_save_seed(void) int len; void *data; - random_get_savedata(&data, &len); - write_random_seed(data, len); + if (random_active) { + random_get_savedata(&data, &len); + write_random_seed(data, len); + sfree(data); + } } /* @@ -127,7 +132,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;