23 accum.add(GetTickCount(), 0);
24 accum.add(GetMessagePos(), 0);
25 accum.add(GetMessageTime(), 0);
26 accum.add(GetInputState(), 0);
27 accum.add(GetCurrentProcessId(), 0);
28 accum.add(GetCurrentThreadId(), 0);
31 GetSystemInfo(&sys_info);
32 accum.add(sys_info, 1);
34 MEMORYSTATUS mem_info;
35 GlobalMemoryStatus(&mem_info);
36 accum.add(mem_info, 1);
45 LARGE_INTEGER perf_counter;
46 QueryPerformanceCounter(&perf_counter);
47 accum.add(perf_counter, 0);
54 HANDLE snapshot = CreateToolhelp32Snapshot(TH32CS_SNAPALL, 0);
56 #define TOOLHELP32_ITER(DATA_TYPE, FUNC_FIRST, FUNC_NEXT) \
57 if(!accum.polling_goal_achieved()) \
60 info.dwSize = sizeof(DATA_TYPE); \
61 if(FUNC_FIRST(snapshot, &info)) \
66 } while(FUNC_NEXT(snapshot, &info)); \
74 #undef TOOLHELP32_ITER
76 if(!accum.polling_goal_achieved())
78 size_t heap_lists_found = 0;
80 heap_list.dwSize =
sizeof(HEAPLIST32);
82 const size_t HEAP_LISTS_MAX = 32;
83 const size_t HEAP_OBJS_PER_LIST = 128;
85 if(Heap32ListFirst(snapshot, &heap_list))
89 accum.add(heap_list, 1);
91 if(++heap_lists_found > HEAP_LISTS_MAX)
94 size_t heap_objs_found = 0;
95 HEAPENTRY32 heap_entry;
96 heap_entry.dwSize =
sizeof(HEAPENTRY32);
97 if(Heap32First(&heap_entry, heap_list.th32ProcessID,
98 heap_list.th32HeapID))
102 if(heap_objs_found++ > HEAP_OBJS_PER_LIST)
104 accum.add(heap_entry, 1);
105 }
while(Heap32Next(&heap_entry));
108 if(accum.polling_goal_achieved())
111 }
while(Heap32ListNext(snapshot, &heap_list));
115 CloseHandle(snapshot);
#define TOOLHELP32_ITER(DATA_TYPE, FUNC_FIRST, FUNC_NEXT)