Hans Leidekker : pdh: Add an uptime counter source based on
GetTickCount.
Alexandre Julliard
julliard at wine.codeweavers.com
Tue Jul 10 08:02:33 CDT 2007
Module: wine
Branch: master
Commit: bdb218abcb5348e6e8aff62cdcc0d74d23a7224e
URL: http://source.winehq.org/git/wine.git/?a=commit;h=bdb218abcb5348e6e8aff62cdcc0d74d23a7224e
Author: Hans Leidekker <hans at it.vu.nl>
Date: Mon Jul 9 20:54:48 2007 +0200
pdh: Add an uptime counter source based on GetTickCount.
---
dlls/pdh/pdh_main.c | 14 +++++++++++++-
1 files changed, 13 insertions(+), 1 deletions(-)
diff --git a/dlls/pdh/pdh_main.c b/dlls/pdh/pdh_main.c
index b21391a..f4b8b15 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 }
};
/***********************************************************************
More information about the wine-cvs
mailing list