From 62cd4f18545da62cb506fa6ecf0e9bfb69914aa9 Mon Sep 17 00:00:00 2001 From: ben Date: Thu, 30 Jan 2003 23:11:07 +0000 Subject: [PATCH] Small amount of extra noise gathering -- slurp the process list in noise_get_heavy(). git-svn-id: svn://svn.tartarus.org/sgt/putty@2755 cda61777-01e9-0310-a592-d414129be87e --- mac/macnoise.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/mac/macnoise.c b/mac/macnoise.c index 8fe70ad0..3a7e8d0a 100644 --- a/mac/macnoise.c +++ b/mac/macnoise.c @@ -3,6 +3,7 @@ * generator. */ +#include #include #include @@ -16,9 +17,27 @@ * free space and a process snapshot. */ +static void noise_get_processes(void (*func) (void *, int)) +{ + ProcessSerialNumber psn = {0, kNoProcess}; + ProcessInfoRec info; + + for (;;) { + GetNextProcess(&psn); + if (psn.highLongOfPSN == 0 && psn.lowLongOfPSN == kNoProcess) return; + info.processInfoLength = sizeof(info); + info.processName = NULL; + info.processAppSpec = NULL; + GetProcessInformation(&psn, &info); + func(&info, sizeof(info)); + } +} + void noise_get_heavy(void (*func) (void *, int)) { + noise_get_light(func); + noise_get_processes(func); read_random_seed(func); /* Update the seed immediately, in case another instance uses it. */ random_save_seed(); -- 2.11.0