Cleanups of the GSSAPI support. On Windows, standard GSS libraries
[u/mdw/putty] / mac / macnoise.c
index 8fe70ad..9d84335 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();
@@ -49,6 +68,15 @@ void noise_get_light(void (*func) (void *, int))
 }
 
 /*
+ * This function is called on a timer, and grabs as much changeable
+ * system data as it can quickly get its hands on.
+ */
+void noise_regular(void)
+{
+    /* XXX */
+}
+
+/*
  * This function is called on every keypress or mouse move, and
  * will add the current time to the noise pool. It gets the scan
  * code or mouse position passed in, and adds that too.