ReactOS 0.4.16-dev-1007-g2e85425
pdh.h File Reference
#include <windows.h>
#include <winperf.h>
Include dependency graph for pdh.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _PDH_FMT_COUNTERVALUE
 
struct  _PDH_RAW_COUNTER
 
struct  _PDH_COUNTER_PATH_ELEMENTS_A
 
struct  _PDH_COUNTER_PATH_ELEMENTS_W
 
struct  _PDH_DATA_ITEM_PATH_ELEMENTS_A
 
struct  _PDH_DATA_ITEM_PATH_ELEMENTS_W
 
struct  _PDH_COUNTER_INFO_A
 
struct  _PDH_COUNTER_INFO_W
 

Macros

#define PDH_CVERSION_WIN40   0x0400
 
#define PDH_CVERSION_WIN50   0x0500
 
#define PDH_VERSION   0x0503
 
#define PDH_MAX_SCALE   7
 
#define PDH_MIN_SCALE   (-7)
 
#define PDH_MAX_COUNTER_NAME   1024
 
#define PDH_FMT_LONG   0x00000100
 
#define PDH_FMT_DOUBLE   0x00000200
 
#define PDH_FMT_LARGE   0x00000400
 
#define PDH_FMT_NOSCALE   0x00001000
 
#define PDH_FMT_1000   0x00002000
 
#define PDH_FMT_NOCAP100   0x00008000
 
#define DATA_SOURCE_REGISTRY   0x00000001
 
#define DATA_SOURCE_LOGFILE   0x00000002
 
#define DATA_SOURCE_WBEM   0x00000004
 
#define PdhAddCounter   WINELIB_NAME_AW(PdhAddCounter)
 
#define PdhAddEnglishCounter   WINELIB_NAME_AW(PdhAddEnglishCounter)
 
#define PdhEnumObjectItems   WINELIB_NAME_AW(PdhEnumObjectItems)
 
#define PdhGetCounterInfo   WINELIB_NAME_AW(PdhGetCounterInfo)
 
#define PdhLookupPerfIndexByName   WINELIB_NAME_AW(PdhLookupPerfIndexByName)
 
#define PdhLookupPerfNameByIndex   WINELIB_NAME_AW(PdhLookupPerfNameByIndex)
 
#define PdhMakeCounterPath   WINELIB_NAME_AW(PdhMakeCounterPath)
 
#define PdhOpenQuery   WINELIB_NAME_AW(PdhOpenQuery)
 
#define PdhValidatePath   WINELIB_NAME_AW(PdhValidatePath)
 
#define PdhValidatePathEx   WINELIB_NAME_AW(PdhValidatePathEx)
 

Typedefs

typedef LONG PDH_STATUS
 
typedef HANDLE PDH_HQUERY
 
typedef HANDLE PDH_HCOUNTER
 
typedef HANDLE PDH_HLOG
 
typedef struct _PDH_FMT_COUNTERVALUE PDH_FMT_COUNTERVALUE
 
typedef struct _PDH_FMT_COUNTERVALUEPPDH_FMT_COUNTERVALUE
 
typedef struct _PDH_RAW_COUNTER PDH_RAW_COUNTER
 
typedef struct _PDH_RAW_COUNTERPPDH_RAW_COUNTER
 
typedef struct _PDH_COUNTER_PATH_ELEMENTS_A PDH_COUNTER_PATH_ELEMENTS_A
 
typedef struct _PDH_COUNTER_PATH_ELEMENTS_APPDH_COUNTER_PATH_ELEMENTS_A
 
typedef struct _PDH_COUNTER_PATH_ELEMENTS_W PDH_COUNTER_PATH_ELEMENTS_W
 
typedef struct _PDH_COUNTER_PATH_ELEMENTS_WPPDH_COUNTER_PATH_ELEMENTS_W
 
typedef struct _PDH_DATA_ITEM_PATH_ELEMENTS_A PDH_DATA_ITEM_PATH_ELEMENTS_A
 
typedef struct _PDH_DATA_ITEM_PATH_ELEMENTS_APPDH_DATA_ITEM_PATH_ELEMENTS_A
 
typedef struct _PDH_DATA_ITEM_PATH_ELEMENTS_W PDH_DATA_ITEM_PATH_ELEMENTS_W
 
typedef struct _PDH_DATA_ITEM_PATH_ELEMENTS_WPPDH_DATA_ITEM_PATH_ELEMENTS_W
 
typedef struct _PDH_COUNTER_INFO_A PDH_COUNTER_INFO_A
 
typedef struct _PDH_COUNTER_INFO_APPDH_COUNTER_INFO_A
 
typedef struct _PDH_COUNTER_INFO_W PDH_COUNTER_INFO_W
 
typedef struct _PDH_COUNTER_INFO_WPPDH_COUNTER_INFO_W
 

Functions

PDH_STATUS WINAPI PdhAddCounterA (PDH_HQUERY, LPCSTR, DWORD_PTR, PDH_HCOUNTER *)
 
PDH_STATUS WINAPI PdhAddCounterW (PDH_HQUERY, LPCWSTR, DWORD_PTR, PDH_HCOUNTER *)
 
PDH_STATUS WINAPI PdhAddEnglishCounterA (PDH_HQUERY, LPCSTR, DWORD_PTR, PDH_HCOUNTER *)
 
PDH_STATUS WINAPI PdhAddEnglishCounterW (PDH_HQUERY, LPCWSTR, DWORD_PTR, PDH_HCOUNTER *)
 
PDH_STATUS WINAPI PdhCloseQuery (PDH_HQUERY)
 
PDH_STATUS WINAPI PdhCollectQueryData (PDH_HQUERY)
 
PDH_STATUS WINAPI PdhCollectQueryDataEx (PDH_HQUERY, DWORD, HANDLE)
 
PDH_STATUS WINAPI PdhCollectQueryDataWithTime (PDH_HQUERY, LONGLONG *)
 
PDH_STATUS WINAPI PdhEnumObjectItemsA (LPCSTR, LPCSTR, LPCSTR, LPSTR, LPDWORD, LPSTR, LPDWORD, DWORD, DWORD)
 
PDH_STATUS WINAPI PdhEnumObjectItemsW (LPCWSTR, LPCWSTR, LPCWSTR, LPWSTR, LPDWORD, LPWSTR, LPDWORD, DWORD, DWORD)
 
PDH_STATUS WINAPI PdhGetCounterInfoA (PDH_HCOUNTER, BOOLEAN, LPDWORD, PPDH_COUNTER_INFO_A)
 
PDH_STATUS WINAPI PdhGetCounterInfoW (PDH_HCOUNTER, BOOLEAN, LPDWORD, PPDH_COUNTER_INFO_W)
 
PDH_STATUS WINAPI PdhGetCounterTimeBase (PDH_HCOUNTER, LONGLONG *)
 
PDH_STATUS WINAPI PdhGetDllVersion (LPDWORD)
 
PDH_STATUS WINAPI PdhGetFormattedCounterValue (PDH_HCOUNTER, DWORD, LPDWORD, PPDH_FMT_COUNTERVALUE)
 
PDH_STATUS WINAPI PdhGetRawCounterValue (PDH_HCOUNTER, LPDWORD, PPDH_RAW_COUNTER)
 
PDH_STATUS WINAPI PdhLookupPerfIndexByNameA (LPCSTR, LPCSTR, LPDWORD)
 
PDH_STATUS WINAPI PdhLookupPerfIndexByNameW (LPCWSTR, LPCWSTR, LPDWORD)
 
PDH_STATUS WINAPI PdhLookupPerfNameByIndexA (LPCSTR, DWORD, LPSTR, LPDWORD)
 
PDH_STATUS WINAPI PdhLookupPerfNameByIndexW (LPCWSTR, DWORD, LPWSTR, LPDWORD)
 
PDH_STATUS WINAPI PdhMakeCounterPathA (PDH_COUNTER_PATH_ELEMENTS_A *, LPSTR, LPDWORD, DWORD)
 
PDH_STATUS WINAPI PdhMakeCounterPathW (PDH_COUNTER_PATH_ELEMENTS_W *, LPWSTR, LPDWORD, DWORD)
 
PDH_STATUS WINAPI PdhOpenQueryA (LPCSTR, DWORD_PTR, PDH_HQUERY *)
 
PDH_STATUS WINAPI PdhOpenQueryW (LPCWSTR, DWORD_PTR, PDH_HQUERY *)
 
PDH_STATUS WINAPI PdhRemoveCounter (PDH_HCOUNTER)
 
PDH_STATUS WINAPI PdhSetCounterScaleFactor (PDH_HCOUNTER, LONG)
 
PDH_STATUS WINAPI PdhSetDefaultRealTimeDataSource (DWORD)
 
PDH_STATUS WINAPI PdhValidatePathA (LPCSTR)
 
PDH_STATUS WINAPI PdhValidatePathW (LPCWSTR)
 
PDH_STATUS WINAPI PdhValidatePathExA (PDH_HLOG, LPCSTR)
 
PDH_STATUS WINAPI PdhValidatePathExW (PDH_HLOG, LPCWSTR)
 

Macro Definition Documentation

◆ DATA_SOURCE_LOGFILE

#define DATA_SOURCE_LOGFILE   0x00000002

Definition at line 57 of file pdh.h.

◆ DATA_SOURCE_REGISTRY

#define DATA_SOURCE_REGISTRY   0x00000001

Definition at line 56 of file pdh.h.

◆ DATA_SOURCE_WBEM

#define DATA_SOURCE_WBEM   0x00000004

Definition at line 58 of file pdh.h.

◆ PDH_CVERSION_WIN40

#define PDH_CVERSION_WIN40   0x0400

Definition at line 40 of file pdh.h.

◆ PDH_CVERSION_WIN50

#define PDH_CVERSION_WIN50   0x0500

Definition at line 41 of file pdh.h.

◆ PDH_FMT_1000

#define PDH_FMT_1000   0x00002000

Definition at line 53 of file pdh.h.

◆ PDH_FMT_DOUBLE

#define PDH_FMT_DOUBLE   0x00000200

Definition at line 50 of file pdh.h.

◆ PDH_FMT_LARGE

#define PDH_FMT_LARGE   0x00000400

Definition at line 51 of file pdh.h.

◆ PDH_FMT_LONG

#define PDH_FMT_LONG   0x00000100

Definition at line 49 of file pdh.h.

◆ PDH_FMT_NOCAP100

#define PDH_FMT_NOCAP100   0x00008000

Definition at line 54 of file pdh.h.

◆ PDH_FMT_NOSCALE

#define PDH_FMT_NOSCALE   0x00001000

Definition at line 52 of file pdh.h.

◆ PDH_MAX_COUNTER_NAME

#define PDH_MAX_COUNTER_NAME   1024

Definition at line 47 of file pdh.h.

◆ PDH_MAX_SCALE

#define PDH_MAX_SCALE   7

Definition at line 44 of file pdh.h.

◆ PDH_MIN_SCALE

#define PDH_MIN_SCALE   (-7)

Definition at line 45 of file pdh.h.

◆ PDH_VERSION

#define PDH_VERSION   0x0503

Definition at line 42 of file pdh.h.

◆ PdhAddCounter

#define PdhAddCounter   WINELIB_NAME_AW(PdhAddCounter)

Definition at line 178 of file pdh.h.

◆ PdhAddEnglishCounter

#define PdhAddEnglishCounter   WINELIB_NAME_AW(PdhAddEnglishCounter)

Definition at line 181 of file pdh.h.

◆ PdhEnumObjectItems

#define PdhEnumObjectItems   WINELIB_NAME_AW(PdhEnumObjectItems)

Definition at line 188 of file pdh.h.

◆ PdhGetCounterInfo

#define PdhGetCounterInfo   WINELIB_NAME_AW(PdhGetCounterInfo)

Definition at line 191 of file pdh.h.

◆ PdhLookupPerfIndexByName

#define PdhLookupPerfIndexByName   WINELIB_NAME_AW(PdhLookupPerfIndexByName)

Definition at line 198 of file pdh.h.

◆ PdhLookupPerfNameByIndex

#define PdhLookupPerfNameByIndex   WINELIB_NAME_AW(PdhLookupPerfNameByIndex)

Definition at line 201 of file pdh.h.

◆ PdhMakeCounterPath

#define PdhMakeCounterPath   WINELIB_NAME_AW(PdhMakeCounterPath)

Definition at line 204 of file pdh.h.

◆ PdhOpenQuery

#define PdhOpenQuery   WINELIB_NAME_AW(PdhOpenQuery)

Definition at line 207 of file pdh.h.

◆ PdhValidatePath

#define PdhValidatePath   WINELIB_NAME_AW(PdhValidatePath)

Definition at line 213 of file pdh.h.

◆ PdhValidatePathEx

#define PdhValidatePathEx   WINELIB_NAME_AW(PdhValidatePathEx)

Definition at line 216 of file pdh.h.

Typedef Documentation

◆ PDH_COUNTER_INFO_A

◆ PDH_COUNTER_INFO_W

◆ PDH_COUNTER_PATH_ELEMENTS_A

◆ PDH_COUNTER_PATH_ELEMENTS_W

◆ PDH_DATA_ITEM_PATH_ELEMENTS_A

◆ PDH_DATA_ITEM_PATH_ELEMENTS_W

◆ PDH_FMT_COUNTERVALUE

◆ PDH_HCOUNTER

Definition at line 37 of file pdh.h.

◆ PDH_HLOG

typedef HANDLE PDH_HLOG

Definition at line 38 of file pdh.h.

◆ PDH_HQUERY

typedef HANDLE PDH_HQUERY

Definition at line 36 of file pdh.h.

◆ PDH_RAW_COUNTER

◆ PDH_STATUS

static PDH_STATUS

Definition at line 35 of file pdh.h.

◆ PPDH_COUNTER_INFO_A

◆ PPDH_COUNTER_INFO_W

◆ PPDH_COUNTER_PATH_ELEMENTS_A

◆ PPDH_COUNTER_PATH_ELEMENTS_W

◆ PPDH_DATA_ITEM_PATH_ELEMENTS_A

◆ PPDH_DATA_ITEM_PATH_ELEMENTS_W

◆ PPDH_FMT_COUNTERVALUE

◆ PPDH_RAW_COUNTER

Function Documentation

◆ PdhAddCounterA()

PDH_STATUS WINAPI PdhAddCounterA ( PDH_HQUERY  query,
LPCSTR  path,
DWORD_PTR  userdata,
PDH_HCOUNTER counter 
)

Definition at line 244 of file pdh_main.c.

246{
248 WCHAR *pathW;
249
250 TRACE("%p %s %lx %p\n", query, debugstr_a(path), userdata, counter);
251
252 if (!path) return PDH_INVALID_ARGUMENT;
253
254 if (!(pathW = pdh_strdup_aw( path )))
256
257 ret = PdhAddCounterW( query, pathW, userdata, counter );
258
259 heap_free( pathW );
260 return ret;
261}
static BOOL heap_free(void *mem)
Definition: appwiz.h:76
#define debugstr_a
Definition: kernel32.h:31
LONG PDH_STATUS
Definition: pdh.h:35
static WCHAR * pdh_strdup_aw(const char *src)
Definition: pdh_main.c:63
PDH_STATUS WINAPI PdhAddCounterW(PDH_HQUERY hquery, LPCWSTR path, DWORD_PTR userdata, PDH_HCOUNTER *hcounter)
Definition: pdh_main.c:266
#define PDH_MEMORY_ALLOCATION_FAILURE
Definition: pdhmsg.h:44
#define PDH_INVALID_ARGUMENT
Definition: pdhmsg.h:46
#define TRACE(s)
Definition: solgame.cpp:4
int ret
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by PdhAddEnglishCounterA(), test_PdhAddCounterA(), test_PdhCollectQueryDataEx(), test_PdhCollectQueryDataWithTime(), test_PdhGetCounterInfoA(), test_PdhGetCounterTimeBase(), test_PdhGetFormattedCounterValue(), test_PdhGetRawCounterValue(), and test_PdhSetCounterScaleFactor().

◆ PdhAddCounterW()

PDH_STATUS WINAPI PdhAddCounterW ( PDH_HQUERY  hquery,
LPCWSTR  path,
DWORD_PTR  userdata,
PDH_HCOUNTER hcounter 
)

Definition at line 266 of file pdh_main.c.

268{
269 struct query *query = hquery;
270 struct counter *counter;
271 unsigned int i;
272
273 TRACE("%p %s %lx %p\n", hquery, debugstr_w(path), userdata, hcounter);
274
275 if (!path || !hcounter) return PDH_INVALID_ARGUMENT;
276
278 if (!query || query->magic != PDH_MAGIC_QUERY)
279 {
281 return PDH_INVALID_HANDLE;
282 }
283
284 *hcounter = NULL;
285 for (i = 0; i < ARRAY_SIZE(counter_sources); i++)
286 {
288 {
289 if ((counter = create_counter()))
290 {
292 counter->collect = counter_sources[i].collect;
293 counter->type = counter_sources[i].type;
295 counter->base = counter_sources[i].base;
297 counter->user = userdata;
298
300 *hcounter = counter;
301
303 return ERROR_SUCCESS;
304 }
307 }
308 }
311}
#define ARRAY_SIZE(A)
Definition: main.h:20
static void list_add_tail(struct list_entry *head, struct list_entry *entry)
Definition: list.h:83
#define ERROR_SUCCESS
Definition: deptool.c:10
#define NULL
Definition: types.h:112
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define debugstr_w
Definition: kernel32.h:32
static WCHAR * pdh_strdup(const WCHAR *src)
Definition: pdh_main.c:54
static BOOL pdh_match_path(LPCWSTR fullpath, LPCWSTR path)
Definition: pdh_main.c:227
static struct counter * create_counter(void)
Definition: pdh_main.c:122
#define PDH_MAGIC_QUERY
Definition: pdh_main.c:141
static CRITICAL_SECTION pdh_handle_cs
Definition: pdh_main.c:44
static const struct source counter_sources[]
Definition: pdh_main.c:211
#define PDH_INVALID_HANDLE
Definition: pdhmsg.h:45
#define PDH_CSTATUS_NO_COUNTER
Definition: pdhmsg.h:42
DWORD type
Definition: pdh_main.c:107
struct list entry
Definition: pdh_main.c:105
DWORD_PTR user
Definition: pdh_main.c:111
LONG defaultscale
Definition: pdh_main.c:110
DWORD_PTR queryuser
Definition: pdh_main.c:112
LONGLONG base
Definition: pdh_main.c:113
WCHAR * path
Definition: pdh_main.c:106
struct list counters
Definition: pdh_main.c:151
DWORD_PTR user
Definition: pdh_main.c:146
DWORD magic
Definition: pdh_main.c:145
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)

Referenced by PdhAddCounterA(), PdhAddEnglishCounterW(), test_PdhAddCounterW(), and test_PdhGetCounterInfoW().

◆ PdhAddEnglishCounterA()

PDH_STATUS WINAPI PdhAddEnglishCounterA ( PDH_HQUERY  query,
LPCSTR  path,
DWORD_PTR  userdata,
PDH_HCOUNTER counter 
)

Definition at line 316 of file pdh_main.c.

318{
319 TRACE("%p %s %lx %p\n", query, debugstr_a(path), userdata, counter);
320
321 if (!query) return PDH_INVALID_ARGUMENT;
322 return PdhAddCounterA( query, path, userdata, counter );
323}
PDH_STATUS WINAPI PdhAddCounterA(PDH_HQUERY query, LPCSTR path, DWORD_PTR userdata, PDH_HCOUNTER *counter)
Definition: pdh_main.c:244

Referenced by init_function_ptrs().

◆ PdhAddEnglishCounterW()

PDH_STATUS WINAPI PdhAddEnglishCounterW ( PDH_HQUERY  query,
LPCWSTR  path,
DWORD_PTR  userdata,
PDH_HCOUNTER counter 
)

Definition at line 328 of file pdh_main.c.

330{
331 TRACE("%p %s %lx %p\n", query, debugstr_w(path), userdata, counter);
332
333 if (!query) return PDH_INVALID_ARGUMENT;
334 return PdhAddCounterW( query, path, userdata, counter );
335}

Referenced by init_function_ptrs().

◆ PdhCloseQuery()

PDH_STATUS WINAPI PdhCloseQuery ( PDH_HQUERY  handle)

Definition at line 399 of file pdh_main.c.

400{
401 struct query *query = handle;
402 struct list *item, *next;
403
404 TRACE("%p\n", handle);
405
407 if (!query || query->magic != PDH_MAGIC_QUERY)
408 {
410 return PDH_INVALID_HANDLE;
411 }
412
413 if (query->thread)
414 {
416 SetEvent( query->stop );
418
420
423 {
425 return ERROR_SUCCESS;
426 }
429 query->thread = NULL;
430 }
431
433 {
434 struct counter *counter = LIST_ENTRY( item, struct counter, entry );
435
438 }
439
441
443 return ERROR_SUCCESS;
444}
static void list_remove(struct list_entry *entry)
Definition: list.h:90
static HANDLE thread
Definition: service.c:33
Definition: list.h:37
#define CloseHandle
Definition: compat.h:739
#define INFINITE
Definition: serial.h:102
uint32_t entry
Definition: isohybrid.c:63
static ATOM item
Definition: dde.c:856
static void destroy_query(struct query *query)
Definition: pdh_main.c:167
static void destroy_counter(struct counter *counter)
Definition: pdh_main.c:134
static unsigned __int64 next
Definition: rand_nt.c:6
#define LIST_FOR_EACH_SAFE(cursor, cursor2, list)
Definition: list.h:192
HANDLE thread
Definition: pdh_main.c:147
HANDLE stop
Definition: pdh_main.c:150
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
Definition: synch.c:733
#define LIST_ENTRY(type)
Definition: queue.h:175

Referenced by test_PdhAddCounterA(), test_PdhAddCounterW(), test_PdhAddEnglishCounterA(), test_PdhAddEnglishCounterW(), test_PdhCollectQueryDataEx(), test_PdhCollectQueryDataWithTime(), test_PdhGetCounterInfoA(), test_PdhGetCounterInfoW(), test_PdhGetCounterTimeBase(), test_PdhGetFormattedCounterValue(), test_PdhGetRawCounterValue(), test_PdhOpenQueryA(), test_PdhOpenQueryW(), and test_PdhSetCounterScaleFactor().

◆ PdhCollectQueryData()

PDH_STATUS WINAPI PdhCollectQueryData ( PDH_HQUERY  handle)

Definition at line 466 of file pdh_main.c.

467{
468 struct query *query = handle;
469
470 TRACE("%p\n", handle);
471
473 if (!query || query->magic != PDH_MAGIC_QUERY)
474 {
476 return PDH_INVALID_HANDLE;
477 }
478
479 if (list_empty( &query->counters ))
480 {
482 return PDH_NO_DATA;
483 }
484
486
488 return ERROR_SUCCESS;
489}
static int list_empty(struct list_entry *head)
Definition: list.h:58
static void collect_query_data(struct query *query)
Definition: pdh_main.c:447
#define PDH_NO_DATA
Definition: pdhmsg.h:31

Referenced by test_PdhAddCounterA(), test_PdhAddCounterW(), test_PdhAddEnglishCounterA(), test_PdhAddEnglishCounterW(), test_PdhCollectQueryDataEx(), test_PdhCollectQueryDataWithTime(), test_PdhGetFormattedCounterValue(), and test_PdhGetRawCounterValue().

◆ PdhCollectQueryDataEx()

PDH_STATUS WINAPI PdhCollectQueryDataEx ( PDH_HQUERY  handle,
DWORD  interval,
HANDLE  event 
)

Definition at line 522 of file pdh_main.c.

523{
525 struct query *query = handle;
526
527 TRACE("%p %d %p\n", handle, interval, event);
528
530 if (!query || query->magic != PDH_MAGIC_QUERY)
531 {
533 return PDH_INVALID_HANDLE;
534 }
535 if (list_empty( &query->counters ))
536 {
538 return PDH_NO_DATA;
539 }
540 if (query->thread)
541 {
543 SetEvent( query->stop );
545
547
550 {
552 return PDH_INVALID_HANDLE;
553 }
555 query->thread = NULL;
556 }
557 else if (!(query->stop = CreateEventW( NULL, FALSE, FALSE, NULL )))
558 {
559 ret = GetLastError();
561 return ret;
562 }
563 query->wait = event;
564 query->interval = interval * 1000;
566 {
567 ret = GetLastError();
569
571 return ret;
572 }
573
575 return ERROR_SUCCESS;
576}
#define FALSE
Definition: types.h:117
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
Definition: thread.c:137
struct _cl_event * event
Definition: glext.h:7739
static DWORD CALLBACK collect_query_thread(void *arg)
Definition: pdh_main.c:491
HANDLE wait
Definition: pdh_main.c:149
DWORD interval
Definition: pdh_main.c:148
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventW(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCWSTR lpName OPTIONAL)
Definition: synch.c:651
DWORD WINAPI GetLastError(void)
Definition: except.c:1042

Referenced by test_PdhCollectQueryDataEx().

◆ PdhCollectQueryDataWithTime()

PDH_STATUS WINAPI PdhCollectQueryDataWithTime ( PDH_HQUERY  handle,
LONGLONG timestamp 
)

Definition at line 581 of file pdh_main.c.

582{
583 struct query *query = handle;
584 struct counter *counter;
585 struct list *item;
586
587 TRACE("%p %p\n", handle, timestamp);
588
589 if (!timestamp) return PDH_INVALID_ARGUMENT;
590
592 if (!query || query->magic != PDH_MAGIC_QUERY)
593 {
595 return PDH_INVALID_HANDLE;
596 }
597 if (list_empty( &query->counters ))
598 {
600 return PDH_NO_DATA;
601 }
602
604
606 counter = LIST_ENTRY( item, struct counter, entry );
607
609
611 return ERROR_SUCCESS;
612}
DWORD dwHighDateTime
Definition: mapidefs.h:66
DWORD dwLowDateTime
Definition: mapidefs.h:65
FILETIME stamp
Definition: pdh_main.c:114
Definition: list.h:15
int64_t LONGLONG
Definition: typedefs.h:68

Referenced by init_function_ptrs().

◆ PdhEnumObjectItemsA()

PDH_STATUS WINAPI PdhEnumObjectItemsA ( LPCSTR  szDataSource,
LPCSTR  szMachineName,
LPCSTR  szObjectName,
LPSTR  mszCounterList,
LPDWORD  pcchCounterListLength,
LPSTR  mszInstanceList,
LPDWORD  pcchInstanceListLength,
DWORD  dwDetailLevel,
DWORD  dwFlags 
)

Definition at line 1245 of file pdh_main.c.

1248{
1249 FIXME("%s, %s, %s, %p, %p, %p, %p, %d, 0x%x: stub\n", debugstr_a(szDataSource), debugstr_a(szMachineName),
1250 debugstr_a(szObjectName), mszCounterList, pcchCounterListLength, mszInstanceList,
1251 pcchInstanceListLength, dwDetailLevel, dwFlags);
1252
1253 return PDH_NOT_IMPLEMENTED;
1254}
#define FIXME(fmt,...)
Definition: precomp.h:53
#define PDH_NOT_IMPLEMENTED
Definition: pdhmsg.h:68
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176

◆ PdhEnumObjectItemsW()

PDH_STATUS WINAPI PdhEnumObjectItemsW ( LPCWSTR  szDataSource,
LPCWSTR  szMachineName,
LPCWSTR  szObjectName,
LPWSTR  mszCounterList,
LPDWORD  pcchCounterListLength,
LPWSTR  mszInstanceList,
LPDWORD  pcchInstanceListLength,
DWORD  dwDetailLevel,
DWORD  dwFlags 
)

Definition at line 1259 of file pdh_main.c.

1262{
1263 FIXME("%s, %s, %s, %p, %p, %p, %p, %d, 0x%x: stub\n", debugstr_w(szDataSource), debugstr_w(szMachineName),
1264 debugstr_w(szObjectName), mszCounterList, pcchCounterListLength, mszInstanceList,
1265 pcchInstanceListLength, dwDetailLevel, dwFlags);
1266
1267 return PDH_NOT_IMPLEMENTED;
1268}

◆ PdhGetCounterInfoA()

PDH_STATUS WINAPI PdhGetCounterInfoA ( PDH_HCOUNTER  handle,
BOOLEAN  text,
LPDWORD  size,
PPDH_COUNTER_INFO_A  info 
)

Definition at line 653 of file pdh_main.c.

654{
655 struct counter *counter = handle;
656
657 TRACE("%p %d %p %p\n", handle, text, size, info);
658
661 {
663 return PDH_INVALID_HANDLE;
664 }
665 if (!size)
666 {
669 }
670 if (*size < sizeof(PDH_COUNTER_INFO_A))
671 {
672 *size = sizeof(PDH_COUNTER_INFO_A);
674 return PDH_MORE_DATA;
675 }
676
677 memset( info, 0, sizeof(PDH_COUNTER_INFO_A) );
678
679 info->dwType = counter->type;
680 info->CStatus = counter->status;
681 info->lScale = counter->scale;
682 info->lDefaultScale = counter->defaultscale;
683 info->dwUserData = counter->user;
684 info->dwQueryUserData = counter->queryuser;
685
686 *size = sizeof(PDH_COUNTER_INFO_A);
687
689 return ERROR_SUCCESS;
690}
const WCHAR * text
Definition: package.c:1794
GLsizeiptr size
Definition: glext.h:5919
struct _PDH_COUNTER_INFO_A PDH_COUNTER_INFO_A
#define PDH_MAGIC_COUNTER
Definition: pdh_main.c:120
#define PDH_MORE_DATA
Definition: pdhmsg.h:28
#define memset(x, y, z)
Definition: compat.h:39
DWORD magic
Definition: pdh_main.c:104
DWORD status
Definition: pdh_main.c:108
LONG scale
Definition: pdh_main.c:109

Referenced by test_PdhGetCounterInfoA().

◆ PdhGetCounterInfoW()

PDH_STATUS WINAPI PdhGetCounterInfoW ( PDH_HCOUNTER  handle,
BOOLEAN  text,
LPDWORD  size,
PPDH_COUNTER_INFO_W  info 
)

Definition at line 695 of file pdh_main.c.

696{
697 struct counter *counter = handle;
698
699 TRACE("%p %d %p %p\n", handle, text, size, info);
700
703 {
705 return PDH_INVALID_HANDLE;
706 }
707 if (!size)
708 {
711 }
712 if (*size < sizeof(PDH_COUNTER_INFO_W))
713 {
714 *size = sizeof(PDH_COUNTER_INFO_W);
716 return PDH_MORE_DATA;
717 }
718
719 memset( info, 0, sizeof(PDH_COUNTER_INFO_W) );
720
721 info->dwType = counter->type;
722 info->CStatus = counter->status;
723 info->lScale = counter->scale;
724 info->lDefaultScale = counter->defaultscale;
725 info->dwUserData = counter->user;
726 info->dwQueryUserData = counter->queryuser;
727
728 *size = sizeof(PDH_COUNTER_INFO_W);
729
731 return ERROR_SUCCESS;
732}
struct _PDH_COUNTER_INFO_W PDH_COUNTER_INFO_W

Referenced by test_PdhGetCounterInfoW().

◆ PdhGetCounterTimeBase()

PDH_STATUS WINAPI PdhGetCounterTimeBase ( PDH_HCOUNTER  handle,
LONGLONG base 
)

Definition at line 737 of file pdh_main.c.

738{
739 struct counter *counter = handle;
740
741 TRACE("%p %p\n", handle, base);
742
743 if (!base) return PDH_INVALID_ARGUMENT;
744
747 {
749 return PDH_INVALID_HANDLE;
750 }
751
752 *base = counter->base;
753
755 return ERROR_SUCCESS;
756}

Referenced by test_PdhGetCounterTimeBase().

◆ PdhGetDllVersion()

PDH_STATUS WINAPI PdhGetDllVersion ( LPDWORD  version)

Definition at line 761 of file pdh_main.c.

762{
763 if (!version)
765
767
768 return ERROR_SUCCESS;
769}
static const WCHAR version[]
Definition: asmname.c:66
#define PDH_VERSION
Definition: pdh.h:42

Referenced by test_PdhGetDllVersion().

◆ PdhGetFormattedCounterValue()

PDH_STATUS WINAPI PdhGetFormattedCounterValue ( PDH_HCOUNTER  handle,
DWORD  format,
LPDWORD  type,
PPDH_FMT_COUNTERVALUE  value 
)

Definition at line 774 of file pdh_main.c.

776{
778 struct counter *counter = handle;
779
780 TRACE("%p %x %p %p\n", handle, format, type, value);
781
782 if (!value) return PDH_INVALID_ARGUMENT;
783
786 {
788 return PDH_INVALID_HANDLE;
789 }
790 if (counter->status)
791 {
793 return PDH_INVALID_DATA;
794 }
796 {
797 value->CStatus = ERROR_SUCCESS;
798 if (type) *type = counter->type;
799 }
800
802 return ret;
803}
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
static PDH_STATUS format_value(struct counter *counter, DWORD format, union value *raw1, union value *raw2, PDH_FMT_COUNTERVALUE *value)
Definition: pdh_main.c:338
#define PDH_INVALID_DATA
Definition: pdhmsg.h:55
union value two
Definition: pdh_main.c:117
union value one
Definition: pdh_main.c:116
Definition: format.c:58
Definition: pdh_main.c:96

Referenced by test_PdhCollectQueryDataEx(), and test_PdhGetFormattedCounterValue().

◆ PdhGetRawCounterValue()

PDH_STATUS WINAPI PdhGetRawCounterValue ( PDH_HCOUNTER  handle,
LPDWORD  type,
PPDH_RAW_COUNTER  value 
)

Definition at line 808 of file pdh_main.c.

810{
811 struct counter *counter = handle;
812
813 TRACE("%p %p %p\n", handle, type, value);
814
815 if (!value) return PDH_INVALID_ARGUMENT;
816
819 {
821 return PDH_INVALID_HANDLE;
822 }
823
824 value->CStatus = counter->status;
825 value->TimeStamp.dwLowDateTime = counter->stamp.dwLowDateTime;
826 value->TimeStamp.dwHighDateTime = counter->stamp.dwHighDateTime;
827 value->FirstValue = counter->one.largevalue;
828 value->SecondValue = counter->two.largevalue;
829 value->MultiCount = 1; /* FIXME */
830
831 if (type) *type = counter->type;
832
834 return ERROR_SUCCESS;
835}
LONGLONG largevalue
Definition: pdh_main.c:99

Referenced by test_PdhGetRawCounterValue().

◆ PdhLookupPerfIndexByNameA()

PDH_STATUS WINAPI PdhLookupPerfIndexByNameA ( LPCSTR  machine,
LPCSTR  name,
LPDWORD  index 
)

Definition at line 840 of file pdh_main.c.

841{
844 WCHAR *nameW;
845
846 TRACE("%s %s %p\n", debugstr_a(machine), debugstr_a(name), index);
847
848 if (!name) return PDH_INVALID_ARGUMENT;
849
851
852 if (!(nameW = pdh_strdup_aw( name )))
854
856
857 heap_free( nameW );
859 return ret;
860}
static const WCHAR nameW[]
Definition: main.c:49
GLuint index
Definition: glext.h:6031
static const WCHAR machineW[]
Definition: profile.c:105
static const char machine[]
Definition: profile.c:104
PDH_STATUS WINAPI PdhLookupPerfIndexByNameW(LPCWSTR machine, LPCWSTR name, LPDWORD index)
Definition: pdh_main.c:865
Definition: name.c:39

Referenced by test_PdhLookupPerfIndexByNameA().

◆ PdhLookupPerfIndexByNameW()

PDH_STATUS WINAPI PdhLookupPerfIndexByNameW ( LPCWSTR  machine,
LPCWSTR  name,
LPDWORD  index 
)

Definition at line 865 of file pdh_main.c.

866{
867 unsigned int i;
868
869 TRACE("%s %s %p\n", debugstr_w(machine), debugstr_w(name), index);
870
871 if (!name || !index) return PDH_INVALID_ARGUMENT;
872
873 if (machine)
874 {
875 FIXME("remote machine not supported\n");
877 }
878 for (i = 0; i < ARRAY_SIZE(counter_sources); i++)
879 {
881 {
882 *index = counter_sources[i].index;
883 return ERROR_SUCCESS;
884 }
885 }
887}
#define PDH_STRING_NOT_FOUND
Definition: pdhmsg.h:69
#define PDH_CSTATUS_NO_MACHINE
Definition: pdhmsg.h:26

Referenced by PdhLookupPerfIndexByNameA(), and test_PdhLookupPerfIndexByNameW().

◆ PdhLookupPerfNameByIndexA()

PDH_STATUS WINAPI PdhLookupPerfNameByIndexA ( LPCSTR  machine,
DWORD  index,
LPSTR  buffer,
LPDWORD  size 
)

Definition at line 892 of file pdh_main.c.

893{
897 DWORD sizeW = ARRAY_SIZE(bufferW);
898
899 TRACE("%s %d %p %p\n", debugstr_a(machine), index, buffer, size);
900
901 if (!buffer || !size) return PDH_INVALID_ARGUMENT;
902
904
905 if (!(ret = PdhLookupPerfNameByIndexW( machineW, index, bufferW, &sizeW )))
906 {
907 int required = WideCharToMultiByte( CP_ACP, 0, bufferW, -1, NULL, 0, NULL, NULL );
908
909 if (*size < required) ret = PDH_MORE_DATA;
910 else WideCharToMultiByte( CP_ACP, 0, bufferW, -1, buffer, required, NULL, NULL );
911 *size = required;
912 }
914 return ret;
915}
#define CP_ACP
Definition: compat.h:109
#define WideCharToMultiByte
Definition: compat.h:111
static const WCHAR sizeW[]
Definition: editor.c:79
unsigned long DWORD
Definition: ntddk_ex.h:95
GLuint buffer
Definition: glext.h:5915
#define PDH_MAX_COUNTER_NAME
Definition: pdh.h:47
PDH_STATUS WINAPI PdhLookupPerfNameByIndexW(LPCWSTR machine, DWORD index, LPWSTR buffer, LPDWORD size)
Definition: pdh_main.c:920

Referenced by test_PdhLookupPerfNameByIndexA().

◆ PdhLookupPerfNameByIndexW()

PDH_STATUS WINAPI PdhLookupPerfNameByIndexW ( LPCWSTR  machine,
DWORD  index,
LPWSTR  buffer,
LPDWORD  size 
)

Definition at line 920 of file pdh_main.c.

921{
923 unsigned int i;
924
925 TRACE("%s %d %p %p\n", debugstr_w(machine), index, buffer, size);
926
927 if (machine)
928 {
929 FIXME("remote machine not supported\n");
931 }
932
933 if (!buffer || !size) return PDH_INVALID_ARGUMENT;
934 if (!index) return ERROR_SUCCESS;
935
936 for (i = 0; i < ARRAY_SIZE(counter_sources); i++)
937 {
939 {
940 WCHAR *p = wcsrchr( counter_sources[i].path, '\\' ) + 1;
941 unsigned int required = lstrlenW( p ) + 1;
942
943 if (*size < required) ret = PDH_MORE_DATA;
944 else
945 {
946 lstrcpyW( buffer, p );
948 }
949 *size = required;
950 return ret;
951 }
952 }
954}
#define wcsrchr
Definition: compat.h:16
#define lstrcpyW
Definition: compat.h:749
#define lstrlenW
Definition: compat.h:750
GLfloat GLfloat p
Definition: glext.h:8902

Referenced by PdhLookupPerfNameByIndexA(), and test_PdhLookupPerfNameByIndexW().

◆ PdhMakeCounterPathA()

PDH_STATUS WINAPI PdhMakeCounterPathA ( PDH_COUNTER_PATH_ELEMENTS_A e,
LPSTR  buffer,
LPDWORD  buflen,
DWORD  flags 
)

Definition at line 1139 of file pdh_main.c.

1141{
1144 WCHAR *bufferW;
1145 DWORD buflenW;
1146
1147 TRACE("%p %p %p 0x%08x\n", e, buffer, buflen, flags);
1148
1149 if (!e || !buflen) return PDH_INVALID_ARGUMENT;
1150
1151 memset( &eW, 0, sizeof(eW) );
1152 if (e->szMachineName && !(eW.szMachineName = pdh_strdup_aw( e->szMachineName ))) goto done;
1153 if (e->szObjectName && !(eW.szObjectName = pdh_strdup_aw( e->szObjectName ))) goto done;
1154 if (e->szInstanceName && !(eW.szInstanceName = pdh_strdup_aw( e->szInstanceName ))) goto done;
1155 if (e->szParentInstance && !(eW.szParentInstance = pdh_strdup_aw( e->szParentInstance ))) goto done;
1156 if (e->szCounterName && !(eW.szCounterName = pdh_strdup_aw( e->szCounterName ))) goto done;
1157 eW.dwInstanceIndex = e->dwInstanceIndex;
1158
1159 buflenW = 0;
1160 ret = PdhMakeCounterPathW( &eW, NULL, &buflenW, flags );
1161 if (ret == PDH_MORE_DATA)
1162 {
1163 if ((bufferW = heap_alloc( buflenW * sizeof(WCHAR) )))
1164 {
1165 if (!(ret = PdhMakeCounterPathW( &eW, bufferW, &buflenW, flags )))
1166 {
1167 int len = WideCharToMultiByte(CP_ACP, 0, bufferW, -1, NULL, 0, NULL, NULL);
1168 if (*buflen >= len) WideCharToMultiByte(CP_ACP, 0, bufferW, -1, buffer, *buflen, NULL, NULL);
1169 else ret = PDH_MORE_DATA;
1170 *buflen = len;
1171 }
1172 heap_free( bufferW );
1173 }
1174 else
1176 }
1177
1178done:
1180 heap_free( eW.szObjectName );
1184 return ret;
1185}
static void * heap_alloc(size_t len)
Definition: appwiz.h:66
GLbitfield flags
Definition: glext.h:7161
GLenum GLsizei len
Definition: glext.h:6722
#define e
Definition: ke_i.h:82
PDH_STATUS WINAPI PdhMakeCounterPathW(PDH_COUNTER_PATH_ELEMENTS_W *e, LPWSTR buffer, LPDWORD buflen, DWORD flags)
Definition: pdh_main.c:1190

Referenced by test_PdhMakeCounterPathA().

◆ PdhMakeCounterPathW()

PDH_STATUS WINAPI PdhMakeCounterPathW ( PDH_COUNTER_PATH_ELEMENTS_W e,
LPWSTR  buffer,
LPDWORD  buflen,
DWORD  flags 
)

Definition at line 1190 of file pdh_main.c.

1192{
1193 static const WCHAR bslash[] = {'\\',0};
1194 static const WCHAR fslash[] = {'/',0};
1195 static const WCHAR lparen[] = {'(',0};
1196 static const WCHAR rparen[] = {')',0};
1197 static const WCHAR fmt[] = {'#','%','u',0};
1198
1201 DWORD len;
1202
1203 TRACE("%p %p %p 0x%08x\n", e, buffer, buflen, flags);
1204
1205 if (flags) FIXME("unimplemented flags 0x%08x\n", flags);
1206
1207 if (!e || !e->szCounterName || !e->szObjectName || !buflen)
1208 return PDH_INVALID_ARGUMENT;
1209
1210 path[0] = 0;
1211 if (e->szMachineName)
1212 {
1213 lstrcatW(path, bslash);
1214 lstrcatW(path, bslash);
1215 lstrcatW(path, e->szMachineName);
1216 }
1217 lstrcatW(path, bslash);
1218 lstrcatW(path, e->szObjectName);
1219 if (e->szInstanceName)
1220 {
1221 lstrcatW(path, lparen);
1222 if (e->szParentInstance)
1223 {
1224 lstrcatW(path, e->szParentInstance);
1225 lstrcatW(path, fslash);
1226 }
1227 lstrcatW(path, e->szInstanceName);
1228 swprintf(instance, fmt, e->dwInstanceIndex);
1230 lstrcatW(path, rparen);
1231 }
1232 lstrcatW(path, bslash);
1233 lstrcatW(path, e->szCounterName);
1234
1235 len = lstrlenW(path) + 1;
1236 if (*buflen >= len) lstrcpyW(buffer, path);
1237 else ret = PDH_MORE_DATA;
1238 *buflen = len;
1239 return ret;
1240}
static HINSTANCE instance
Definition: main.c:40
#define swprintf
Definition: precomp.h:40
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:274
Definition: dsound.c:943

Referenced by PdhMakeCounterPathA().

◆ PdhOpenQueryA()

PDH_STATUS WINAPI PdhOpenQueryA ( LPCSTR  source,
DWORD_PTR  userdata,
PDH_HQUERY query 
)

Definition at line 959 of file pdh_main.c.

960{
962 WCHAR *sourceW = NULL;
963
964 TRACE("%s %lx %p\n", debugstr_a(source), userdata, query);
965
967
968 ret = PdhOpenQueryW( sourceW, userdata, query );
970
971 return ret;
972}
static const WCHAR sourceW[]
Definition: jsregexp.c:37
PDH_STATUS WINAPI PdhOpenQueryW(LPCWSTR source, DWORD_PTR userdata, PDH_HQUERY *handle)
Definition: pdh_main.c:977

Referenced by test_PdhAddCounterA(), test_PdhAddEnglishCounterA(), test_PdhCollectQueryDataEx(), test_PdhCollectQueryDataWithTime(), test_PdhGetCounterInfoA(), test_PdhGetCounterTimeBase(), test_PdhGetFormattedCounterValue(), test_PdhGetRawCounterValue(), test_PdhOpenQueryA(), and test_PdhSetCounterScaleFactor().

◆ PdhOpenQueryW()

PDH_STATUS WINAPI PdhOpenQueryW ( LPCWSTR  source,
DWORD_PTR  userdata,
PDH_HQUERY handle 
)

Definition at line 977 of file pdh_main.c.

978{
979 struct query *query;
980
981 TRACE("%s %lx %p\n", debugstr_w(source), userdata, handle);
982
983 if (!handle) return PDH_INVALID_ARGUMENT;
984
985 if (source)
986 {
987 FIXME("log file data source not supported\n");
989 }
990 if ((query = create_query()))
991 {
992 query->user = userdata;
993 *handle = query;
994
995 return ERROR_SUCCESS;
996 }
998}
static struct query * create_query(void)
Definition: pdh_main.c:154

Referenced by PdhOpenQueryA(), test_PdhAddCounterW(), test_PdhAddEnglishCounterW(), test_PdhGetCounterInfoW(), and test_PdhOpenQueryW().

◆ PdhRemoveCounter()

PDH_STATUS WINAPI PdhRemoveCounter ( PDH_HCOUNTER  handle)

Definition at line 1003 of file pdh_main.c.

1004{
1005 struct counter *counter = handle;
1006
1007 TRACE("%p\n", handle);
1008
1011 {
1013 return PDH_INVALID_HANDLE;
1014 }
1015
1018
1020 return ERROR_SUCCESS;
1021}

Referenced by test_PdhAddCounterA(), test_PdhAddCounterW(), test_PdhAddEnglishCounterA(), and test_PdhAddEnglishCounterW().

◆ PdhSetCounterScaleFactor()

PDH_STATUS WINAPI PdhSetCounterScaleFactor ( PDH_HCOUNTER  handle,
LONG  factor 
)

Definition at line 1026 of file pdh_main.c.

1027{
1028 struct counter *counter = handle;
1029
1030 TRACE("%p\n", handle);
1031
1034 {
1036 return PDH_INVALID_HANDLE;
1037 }
1038 if (factor < PDH_MIN_SCALE || factor > PDH_MAX_SCALE)
1039 {
1041 return PDH_INVALID_ARGUMENT;
1042 }
1043
1044 counter->scale = factor;
1045
1047 return ERROR_SUCCESS;
1048}
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint factor
Definition: glfuncs.h:178
#define PDH_MAX_SCALE
Definition: pdh.h:44

Referenced by test_PdhGetCounterInfoA(), test_PdhGetCounterInfoW(), test_PdhGetFormattedCounterValue(), and test_PdhSetCounterScaleFactor().

◆ PdhSetDefaultRealTimeDataSource()

PDH_STATUS WINAPI PdhSetDefaultRealTimeDataSource ( DWORD  source)

Definition at line 1273 of file pdh_main.c.

1274{
1275 FIXME("%u\n", source);
1276 return ERROR_SUCCESS;
1277}

◆ PdhValidatePathA()

PDH_STATUS WINAPI PdhValidatePathA ( LPCSTR  path)

Definition at line 1053 of file pdh_main.c.

1054{
1056 WCHAR *pathW;
1057
1058 TRACE("%s\n", debugstr_a(path));
1059
1060 if (!path) return PDH_INVALID_ARGUMENT;
1061 if (!(pathW = pdh_strdup_aw( path ))) return PDH_MEMORY_ALLOCATION_FAILURE;
1062
1063 ret = PdhValidatePathW( pathW );
1064
1065 heap_free( pathW );
1066 return ret;
1067}
PDH_STATUS WINAPI PdhValidatePathW(LPCWSTR path)
Definition: pdh_main.c:1079

Referenced by PdhValidatePathExA(), and test_PdhValidatePathA().

◆ PdhValidatePathExA()

PDH_STATUS WINAPI PdhValidatePathExA ( PDH_HLOG  source,
LPCSTR  path 
)

Definition at line 1109 of file pdh_main.c.

1110{
1111 TRACE("%p %s\n", source, debugstr_a(path));
1112
1113 if (source)
1114 {
1115 FIXME("log file data source not supported\n");
1116 return ERROR_SUCCESS;
1117 }
1118 return PdhValidatePathA( path );
1119}
PDH_STATUS WINAPI PdhValidatePathA(LPCSTR path)
Definition: pdh_main.c:1053

Referenced by init_function_ptrs().

◆ PdhValidatePathExW()

PDH_STATUS WINAPI PdhValidatePathExW ( PDH_HLOG  source,
LPCWSTR  path 
)

Definition at line 1124 of file pdh_main.c.

1125{
1126 TRACE("%p %s\n", source, debugstr_w(path));
1127
1128 if (source)
1129 {
1130 FIXME("log file data source not supported\n");
1131 return ERROR_SUCCESS;
1132 }
1133 return PdhValidatePathW( path );
1134}

Referenced by init_function_ptrs().

◆ PdhValidatePathW()

PDH_STATUS WINAPI PdhValidatePathW ( LPCWSTR  path)

Definition at line 1079 of file pdh_main.c.

1080{
1082 unsigned int i;
1083
1084 TRACE("%s\n", debugstr_w(path));
1085
1086 if ((ret = validate_path( path ))) return ret;
1087
1088 for (i = 0; i < ARRAY_SIZE(counter_sources); i++)
1090
1092}
static PDH_STATUS validate_path(LPCWSTR path)
Definition: pdh_main.c:1069

Referenced by PdhValidatePathA(), PdhValidatePathExW(), and test_PdhValidatePathW().