mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-26 09:42:25 +00:00
Small amount of extra noise gathering -- slurp the process list in
noise_get_heavy(). [originally from svn r2755]
This commit is contained in:
parent
bcfa137c21
commit
df47130d30
@ -3,6 +3,7 @@
|
|||||||
* generator.
|
* generator.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <Processes.h>
|
||||||
#include <Types.h>
|
#include <Types.h>
|
||||||
#include <Timer.h>
|
#include <Timer.h>
|
||||||
|
|
||||||
@ -16,9 +17,27 @@
|
|||||||
* free space and a process snapshot.
|
* 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))
|
void noise_get_heavy(void (*func) (void *, int))
|
||||||
{
|
{
|
||||||
|
|
||||||
|
noise_get_light(func);
|
||||||
|
noise_get_processes(func);
|
||||||
read_random_seed(func);
|
read_random_seed(func);
|
||||||
/* Update the seed immediately, in case another instance uses it. */
|
/* Update the seed immediately, in case another instance uses it. */
|
||||||
random_save_seed();
|
random_save_seed();
|
||||||
|
Loading…
Reference in New Issue
Block a user