From: jacob Date: Fri, 22 Apr 2005 15:47:28 +0000 (+0000) Subject: Stir in process ID at start. X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/commitdiff_plain/a5c2148bf102ae6cc9d32041f736d54377ad1b3d Stir in process ID at start. git-svn-id: svn://svn.tartarus.org/sgt/putty@5655 cda61777-01e9-0310-a592-d414129be87e --- diff --git a/windows/winnoise.c b/windows/winnoise.c index 1b1d1f5e..affb1a52 100644 --- a/windows/winnoise.c +++ b/windows/winnoise.c @@ -19,6 +19,7 @@ void noise_get_heavy(void (*func) (void *, int)) { HANDLE srch; WIN32_FIND_DATA finddata; + DWORD pid; char winpath[MAX_PATH + 3]; GetWindowsDirectory(winpath, sizeof(winpath)); @@ -31,6 +32,9 @@ void noise_get_heavy(void (*func) (void *, int)) FindClose(srch); } + pid = GetCurrentProcessId(); + func(&pid, sizeof(pid)); + read_random_seed(func); /* Update the seed immediately, in case another instance uses it. */ random_save_seed(); @@ -51,7 +55,7 @@ void random_save_seed(void) /* * This function is called every time the random pool needs * stirring, and will acquire the system time in all available - * forms and the battery status. + * forms. */ void noise_get_light(void (*func) (void *, int)) {