blob: bc94c3f138f668a454af8a1deecd86c63d66bb4d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
#include <windows.h>
#include <psapi.h>
#include <stdio.h>
__declspec(dllimport) void foo();
int main() {
PROCESS_MEMORY_COUNTERS pmc;
printf("Calling GetProcessMemoryInfo...\n");
if (GetProcessMemoryInfo(GetCurrentProcess(), &pmc, sizeof(pmc))) {
printf("PageFaultCount: %lu\n", pmc.PageFaultCount);
printf("WorkingSetSize: %lu\n", pmc.WorkingSetSize);
} else {
printf("GetProcessMemoryInfo failed (%lu)\n", GetLastError());
}
printf("Calling foo...\n");
foo();
printf("Done.\n");
return 0;
}
|