From bdb218abcb5348e6e8aff62cdcc0d74d23a7224e Mon Sep 17 00:00:00 2001 From: Hans Leidekker Date: Mon, 9 Jul 2007 20:54:48 +0200 Subject: [PATCH] pdh: Add an uptime counter source based on GetTickCount. --- dlls/pdh/pdh_main.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/dlls/pdh/pdh_main.c b/dlls/pdh/pdh_main.c index b21391a807f..f4b8b152352 100644 --- a/dlls/pdh/pdh_main.c +++ b/dlls/pdh/pdh_main.c @@ -150,10 +150,22 @@ struct source LONGLONG base; /* samples per second */ }; +static const WCHAR path_uptime[] = + {'\\','S','y','s','t','e','m', '\\', 'S','y','s','t','e','m',' ','U','p',' ','T','i','m','e',0}; + +static void CALLBACK collect_uptime( struct counter *counter ) +{ + counter->two.largevalue = GetTickCount(); /* FIXME */ + counter->status = PDH_CSTATUS_VALID_DATA; +} + +#define TYPE_UPTIME \ + (PERF_SIZE_LARGE | PERF_TYPE_COUNTER | PERF_COUNTER_ELAPSED | PERF_OBJECT_TIMER | PERF_DISPLAY_SECONDS) + /* counter source registry */ static const struct source counter_sources[] = { - { NULL, NULL, 0, 0, 0 } + { path_uptime, collect_uptime, TYPE_UPTIME, -3, 1000 } }; /***********************************************************************