Small amount of extra noise gathering -- slurp the process list in
authorben <ben@cda61777-01e9-0310-a592-d414129be87e>
Thu, 30 Jan 2003 23:11:07 +0000 (23:11 +0000)
committerben <ben@cda61777-01e9-0310-a592-d414129be87e>
Thu, 30 Jan 2003 23:11:07 +0000 (23:11 +0000)
noise_get_heavy().

git-svn-id: svn://svn.tartarus.org/sgt/putty@2755 cda61777-01e9-0310-a592-d414129be87e

mac/macnoise.c

index 8fe70ad..3a7e8d0 100644 (file)
@@ -3,6 +3,7 @@
  * generator.
  */
 
+#include <Processes.h>
 #include <Types.h>
 #include <Timer.h>
 
  * 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();