Hans Leidekker : pdh: Implement PdhCollectQueryData.
Alexandre Julliard
julliard at wine.codeweavers.com
Thu Jun 28 08:08:12 CDT 2007
Module: wine
Branch: master
Commit: 4727bec54c3325d31d262d95e16ff1e81b1f7560
URL: http://source.winehq.org/git/wine.git/?a=commit;h=4727bec54c3325d31d262d95e16ff1e81b1f7560
Author: Hans Leidekker <hans at it.vu.nl>
Date: Mon Jun 25 21:11:02 2007 +0200
pdh: Implement PdhCollectQueryData.
---
dlls/pdh/pdh.spec | 2 +-
dlls/pdh/pdh_main.c | 25 +++++++++++++++++++++++++
2 files changed, 26 insertions(+), 1 deletions(-)
diff --git a/dlls/pdh/pdh.spec b/dlls/pdh/pdh.spec
index 3bfae97..42a66ed 100644
--- a/dlls/pdh/pdh.spec
+++ b/dlls/pdh/pdh.spec
@@ -12,7 +12,7 @@
@ stub PdhCalculateCounterFromRawValue
@ stub PdhCloseLog
@ stdcall PdhCloseQuery(ptr)
-@ stub PdhCollectQueryData
+@ stdcall PdhCollectQueryData(ptr)
@ stub PdhCollectQueryDataEx
@ stub PdhComputeCounterStatistics
@ stub PdhConnectMachineA
diff --git a/dlls/pdh/pdh_main.c b/dlls/pdh/pdh_main.c
index 2dc7b8b..b21391a 100644
--- a/dlls/pdh/pdh_main.c
+++ b/dlls/pdh/pdh_main.c
@@ -246,6 +246,31 @@ PDH_STATUS WINAPI PdhCloseQuery( PDH_HQUERY handle )
}
/***********************************************************************
+ * PdhCollectQueryData (PDH.@)
+ */
+PDH_STATUS WINAPI PdhCollectQueryData( PDH_HQUERY handle )
+{
+ struct query *query = handle;
+ struct list *item;
+
+ TRACE("%p\n", handle);
+
+ if (!query || (query->magic != PDH_MAGIC_QUERY)) return PDH_INVALID_HANDLE;
+
+ LIST_FOR_EACH( item, &query->counters )
+ {
+ SYSTEMTIME time;
+ struct counter *counter = LIST_ENTRY( item, struct counter, entry );
+
+ counter->collect( counter );
+
+ GetLocalTime( &time );
+ SystemTimeToFileTime( &time, &counter->stamp );
+ }
+ return ERROR_SUCCESS;
+}
+
+/***********************************************************************
* PdhOpenQueryA (PDH.@)
*/
PDH_STATUS WINAPI PdhOpenQueryA( LPCSTR source, DWORD_PTR userdata, PDH_HQUERY *query )
More information about the wine-cvs
mailing list