]> asedeno.scripts.mit.edu Git - PuTTY.git/blobdiff - mac/macnoise.c
Tweak the icon script, and the generated icons, to more closely
[PuTTY.git] / mac / macnoise.c
index 8fe70ad02ec24a9c70bbfa5dd4b72229ad02a3c2..9d8433555659f5ceafc935fc1814de69e68f7c5a 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();
@@ -48,6 +67,15 @@ void noise_get_light(void (*func) (void *, int))
     func(&utc, sizeof(utc));
 }
 
+/*
+ * 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