ReactOS  0.4.14-dev-49-gfb4591c
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  ,
LPCSTR  ,
DWORD_PTR  ,
PDH_HCOUNTER  
)

Definition at line 236 of file pdh_main.c.

238 {
239  PDH_STATUS ret;
240  WCHAR *pathW;
241 
242  TRACE("%p %s %lx %p\n", query, debugstr_a(path), userdata, counter);
243 
244  if (!path) return PDH_INVALID_ARGUMENT;
245 
246  if (!(pathW = pdh_strdup_aw( path )))
248 
249  ret = PdhAddCounterW( query, pathW, userdata, counter );
250 
251  heap_free( pathW );
252  return ret;
253 }
#define PDH_MEMORY_ALLOCATION_FAILURE
Definition: pdhmsg.h:44
#define PDH_INVALID_ARGUMENT
Definition: pdhmsg.h:46
PDH_STATUS WINAPI PdhAddCounterW(PDH_HQUERY hquery, LPCWSTR path, DWORD_PTR userdata, PDH_HCOUNTER *hcounter)
Definition: pdh_main.c:258
#define TRACE(s)
Definition: solgame.cpp:4
LONG PDH_STATUS
Definition: pdh.h:35
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define debugstr_a
Definition: kernel32.h:31
static WCHAR * pdh_strdup_aw(const char *src)
Definition: pdh_main.c:60
int ret
Definition: services.c:325
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

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  ,
LPCWSTR  ,
DWORD_PTR  ,
PDH_HCOUNTER  
)

Definition at line 258 of file pdh_main.c.

260 {
261  struct query *query = hquery;
262  struct counter *counter;
263  unsigned int i;
264 
265  TRACE("%p %s %lx %p\n", hquery, debugstr_w(path), userdata, hcounter);
266 
267  if (!path || !hcounter) return PDH_INVALID_ARGUMENT;
268 
270  if (!query || query->magic != PDH_MAGIC_QUERY)
271  {
273  return PDH_INVALID_HANDLE;
274  }
275 
276  *hcounter = NULL;
277  for (i = 0; i < ARRAY_SIZE(counter_sources); i++)
278  {
280  {
281  if ((counter = create_counter()))
282  {
284  counter->collect = counter_sources[i].collect;
285  counter->type = counter_sources[i].type;
287  counter->base = counter_sources[i].base;
289  counter->user = userdata;
290 
292  *hcounter = counter;
293 
295  return ERROR_SUCCESS;
296  }
299  }
300  }
302  return PDH_CSTATUS_NO_COUNTER;
303 }
static WCHAR * pdh_strdup(const WCHAR *src)
Definition: pdh_main.c:51
DWORD magic
Definition: pdh_main.c:140
DWORD_PTR user
Definition: pdh_main.c:106
#define ERROR_SUCCESS
Definition: deptool.c:10
#define PDH_MEMORY_ALLOCATION_FAILURE
Definition: pdhmsg.h:44
LONGLONG base
Definition: pdh_main.c:108
static const struct source counter_sources[]
Definition: pdh_main.c:204
#define PDH_MAGIC_QUERY
Definition: pdh_main.c:136
#define PDH_INVALID_ARGUMENT
Definition: pdhmsg.h:46
#define PDH_CSTATUS_NO_COUNTER
Definition: pdhmsg.h:42
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
__WINE_SERVER_LIST_INLINE void list_add_tail(struct list *list, struct list *elem)
Definition: list.h:102
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
LONG defaultscale
Definition: pdh_main.c:105
smooth NULL
Definition: ftsmooth.c:416
DWORD_PTR queryuser
Definition: pdh_main.c:107
GLuint counter
Definition: glext.h:11116
static BOOL pdh_match_path(LPCWSTR fullpath, LPCWSTR path)
Definition: pdh_main.c:219
static struct counter * create_counter(void)
Definition: pdh_main.c:117
#define TRACE(s)
Definition: solgame.cpp:4
DWORD_PTR user
Definition: pdh_main.c:141
static CRITICAL_SECTION pdh_handle_cs
Definition: pdh_main.c:41
#define ARRAY_SIZE(a)
Definition: main.h:24
Definition: services.c:325
#define PDH_INVALID_HANDLE
Definition: pdhmsg.h:45
WCHAR * path
Definition: pdh_main.c:101
DWORD type
Definition: pdh_main.c:102
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
struct list counters
Definition: pdh_main.c:146
struct list entry
Definition: pdh_main.c:100

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

◆ PdhAddEnglishCounterA()

PDH_STATUS WINAPI PdhAddEnglishCounterA ( PDH_HQUERY  ,
LPCSTR  ,
DWORD_PTR  ,
PDH_HCOUNTER  
)

Definition at line 308 of file pdh_main.c.

310 {
311  TRACE("%p %s %lx %p\n", query, debugstr_a(path), userdata, counter);
312 
313  if (!query) return PDH_INVALID_ARGUMENT;
314  return PdhAddCounterA( query, path, userdata, counter );
315 }
PDH_STATUS WINAPI PdhAddCounterA(PDH_HQUERY query, LPCSTR path, DWORD_PTR userdata, PDH_HCOUNTER *counter)
Definition: pdh_main.c:236
#define PDH_INVALID_ARGUMENT
Definition: pdhmsg.h:46
#define TRACE(s)
Definition: solgame.cpp:4
#define debugstr_a
Definition: kernel32.h:31
Definition: services.c:325

Referenced by init_function_ptrs().

◆ PdhAddEnglishCounterW()

PDH_STATUS WINAPI PdhAddEnglishCounterW ( PDH_HQUERY  ,
LPCWSTR  ,
DWORD_PTR  ,
PDH_HCOUNTER  
)

Definition at line 320 of file pdh_main.c.

322 {
323  TRACE("%p %s %lx %p\n", query, debugstr_w(path), userdata, counter);
324 
325  if (!query) return PDH_INVALID_ARGUMENT;
326  return PdhAddCounterW( query, path, userdata, counter );
327 }
#define PDH_INVALID_ARGUMENT
Definition: pdhmsg.h:46
PDH_STATUS WINAPI PdhAddCounterW(PDH_HQUERY hquery, LPCWSTR path, DWORD_PTR userdata, PDH_HCOUNTER *hcounter)
Definition: pdh_main.c:258
#define debugstr_w
Definition: kernel32.h:32
#define TRACE(s)
Definition: solgame.cpp:4
Definition: services.c:325

Referenced by init_function_ptrs().

◆ PdhCloseQuery()

PDH_STATUS WINAPI PdhCloseQuery ( PDH_HQUERY  )

Definition at line 391 of file pdh_main.c.

392 {
393  struct query *query = handle;
394  struct list *item, *next;
395 
396  TRACE("%p\n", handle);
397 
399  if (!query || query->magic != PDH_MAGIC_QUERY)
400  {
402  return PDH_INVALID_HANDLE;
403  }
404 
405  if (query->thread)
406  {
408  SetEvent( query->stop );
410 
412 
414  if (query->magic != PDH_MAGIC_QUERY)
415  {
417  return ERROR_SUCCESS;
418  }
419  CloseHandle( query->stop );
421  query->thread = NULL;
422  }
423 
425  {
426  struct counter *counter = LIST_ENTRY( item, struct counter, entry );
427 
430  }
431 
432  destroy_query( query );
433 
435  return ERROR_SUCCESS;
436 }
DWORD magic
Definition: pdh_main.c:140
#define LIST_FOR_EACH_SAFE(cursor, cursor2, list)
Definition: list.h:192
namespace GUID const ADDRINFOEXW ADDRINFOEXW struct timeval OVERLAPPED LPLOOKUPSERVICE_COMPLETION_ROUTINE HANDLE * handle
Definition: sock.c:82
#define CloseHandle
Definition: compat.h:398
#define ERROR_SUCCESS
Definition: deptool.c:10
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
Definition: synch.c:733
#define PDH_MAGIC_QUERY
Definition: pdh_main.c:136
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
smooth NULL
Definition: ftsmooth.c:416
__WINE_SERVER_LIST_INLINE void list_remove(struct list *elem)
Definition: list.h:108
#define TRACE(s)
Definition: solgame.cpp:4
HANDLE thread
Definition: pdh_main.c:142
HANDLE stop
Definition: pdh_main.c:145
static HANDLE thread
Definition: service.c:33
uint32_t entry
Definition: isohybrid.c:63
Definition: _list.h:228
static void destroy_counter(struct counter *counter)
Definition: pdh_main.c:129
static CRITICAL_SECTION pdh_handle_cs
Definition: pdh_main.c:41
static unsigned __int64 next
Definition: rand_nt.c:6
static ATOM item
Definition: dde.c:856
#define PDH_INVALID_HANDLE
Definition: pdhmsg.h:45
static void destroy_query(struct query *query)
Definition: pdh_main.c:162
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
#define LIST_ENTRY(type)
Definition: queue.h:175
struct list counters
Definition: pdh_main.c:146
#define INFINITE
Definition: serial.h:102
struct list entry
Definition: pdh_main.c:100

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  )

Definition at line 458 of file pdh_main.c.

459 {
460  struct query *query = handle;
461 
462  TRACE("%p\n", handle);
463 
465  if (!query || query->magic != PDH_MAGIC_QUERY)
466  {
468  return PDH_INVALID_HANDLE;
469  }
470 
471  if (list_empty( &query->counters ))
472  {
474  return PDH_NO_DATA;
475  }
476 
478 
480  return ERROR_SUCCESS;
481 }
DWORD magic
Definition: pdh_main.c:140
namespace GUID const ADDRINFOEXW ADDRINFOEXW struct timeval OVERLAPPED LPLOOKUPSERVICE_COMPLETION_ROUTINE HANDLE * handle
Definition: sock.c:82
#define ERROR_SUCCESS
Definition: deptool.c:10
#define PDH_MAGIC_QUERY
Definition: pdh_main.c:136
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
#define TRACE(s)
Definition: solgame.cpp:4
static void collect_query_data(struct query *query)
Definition: pdh_main.c:439
static CRITICAL_SECTION pdh_handle_cs
Definition: pdh_main.c:41
__WINE_SERVER_LIST_INLINE int list_empty(const struct list *list)
Definition: list.h:143
#define PDH_NO_DATA
Definition: pdhmsg.h:31
#define PDH_INVALID_HANDLE
Definition: pdhmsg.h:45
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
struct list counters
Definition: pdh_main.c:146

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  ,
DWORD  ,
HANDLE   
)

Definition at line 514 of file pdh_main.c.

515 {
516  PDH_STATUS ret;
517  struct query *query = handle;
518 
519  TRACE("%p %d %p\n", handle, interval, event);
520 
522  if (!query || query->magic != PDH_MAGIC_QUERY)
523  {
525  return PDH_INVALID_HANDLE;
526  }
527  if (list_empty( &query->counters ))
528  {
530  return PDH_NO_DATA;
531  }
532  if (query->thread)
533  {
535  SetEvent( query->stop );
537 
539 
541  if (query->magic != PDH_MAGIC_QUERY)
542  {
544  return PDH_INVALID_HANDLE;
545  }
547  query->thread = NULL;
548  }
549  else if (!(query->stop = CreateEventW( NULL, FALSE, FALSE, NULL )))
550  {
551  ret = GetLastError();
553  return ret;
554  }
555  query->wait = event;
556  query->interval = interval * 1000;
558  {
559  ret = GetLastError();
560  CloseHandle( query->stop );
561 
563  return ret;
564  }
565 
567  return ERROR_SUCCESS;
568 }
DWORD magic
Definition: pdh_main.c:140
namespace GUID const ADDRINFOEXW ADDRINFOEXW struct timeval OVERLAPPED LPLOOKUPSERVICE_COMPLETION_ROUTINE HANDLE * handle
Definition: sock.c:82
#define CloseHandle
Definition: compat.h:398
#define ERROR_SUCCESS
Definition: deptool.c:10
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
Definition: synch.c:733
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
#define PDH_MAGIC_QUERY
Definition: pdh_main.c:136
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
static DWORD CALLBACK collect_query_thread(void *arg)
Definition: pdh_main.c:483
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 WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
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:136
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
LONG PDH_STATUS
Definition: pdh.h:35
HANDLE wait
Definition: pdh_main.c:144
HANDLE thread
Definition: pdh_main.c:142
HANDLE stop
Definition: pdh_main.c:145
static HANDLE thread
Definition: service.c:33
int ret
struct _cl_event * event
Definition: glext.h:7739
static CRITICAL_SECTION pdh_handle_cs
Definition: pdh_main.c:41
__WINE_SERVER_LIST_INLINE int list_empty(const struct list *list)
Definition: list.h:143
#define PDH_NO_DATA
Definition: pdhmsg.h:31
#define PDH_INVALID_HANDLE
Definition: pdhmsg.h:45
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
struct list counters
Definition: pdh_main.c:146
#define INFINITE
Definition: serial.h:102
DWORD interval
Definition: pdh_main.c:143

Referenced by test_PdhCollectQueryDataEx().

◆ PdhCollectQueryDataWithTime()

PDH_STATUS WINAPI PdhCollectQueryDataWithTime ( PDH_HQUERY  ,
LONGLONG  
)

Definition at line 573 of file pdh_main.c.

574 {
575  struct query *query = handle;
576  struct counter *counter;
577  struct list *item;
578 
579  TRACE("%p %p\n", handle, timestamp);
580 
581  if (!timestamp) return PDH_INVALID_ARGUMENT;
582 
584  if (!query || query->magic != PDH_MAGIC_QUERY)
585  {
587  return PDH_INVALID_HANDLE;
588  }
589  if (list_empty( &query->counters ))
590  {
592  return PDH_NO_DATA;
593  }
594 
596 
597  item = list_head( &query->counters );
598  counter = LIST_ENTRY( item, struct counter, entry );
599 
601 
603  return ERROR_SUCCESS;
604 }
DWORD magic
Definition: pdh_main.c:140
namespace GUID const ADDRINFOEXW ADDRINFOEXW struct timeval OVERLAPPED LPLOOKUPSERVICE_COMPLETION_ROUTINE HANDLE * handle
Definition: sock.c:82
#define ERROR_SUCCESS
Definition: deptool.c:10
#define PDH_MAGIC_QUERY
Definition: pdh_main.c:136
#define PDH_INVALID_ARGUMENT
Definition: pdhmsg.h:46
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
__WINE_SERVER_LIST_INLINE struct list * list_head(const struct list *list)
Definition: list.h:131
DWORD dwHighDateTime
Definition: mapidefs.h:66
GLuint counter
Definition: glext.h:11116
int64_t LONGLONG
Definition: typedefs.h:66
#define TRACE(s)
Definition: solgame.cpp:4
static void collect_query_data(struct query *query)
Definition: pdh_main.c:439
FILETIME stamp
Definition: pdh_main.c:109
uint32_t entry
Definition: isohybrid.c:63
Definition: _list.h:228
static CRITICAL_SECTION pdh_handle_cs
Definition: pdh_main.c:41
__WINE_SERVER_LIST_INLINE int list_empty(const struct list *list)
Definition: list.h:143
static ATOM item
Definition: dde.c:856
#define PDH_NO_DATA
Definition: pdhmsg.h:31
#define PDH_INVALID_HANDLE
Definition: pdhmsg.h:45
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
#define LIST_ENTRY(type)
Definition: queue.h:175
struct list counters
Definition: pdh_main.c:146
DWORD dwLowDateTime
Definition: mapidefs.h:65

Referenced by init_function_ptrs().

◆ PdhEnumObjectItemsA()

PDH_STATUS WINAPI PdhEnumObjectItemsA ( LPCSTR  ,
LPCSTR  ,
LPCSTR  ,
LPSTR  ,
LPDWORD  ,
LPSTR  ,
LPDWORD  ,
DWORD  ,
DWORD   
)

Definition at line 1237 of file pdh_main.c.

1240 {
1241  FIXME("%s, %s, %s, %p, %p, %p, %p, %d, 0x%x: stub\n", debugstr_a(szDataSource), debugstr_a(szMachineName),
1242  debugstr_a(szObjectName), mszCounterList, pcchCounterListLength, mszInstanceList,
1243  pcchInstanceListLength, dwDetailLevel, dwFlags);
1244 
1245  return PDH_NOT_IMPLEMENTED;
1246 }
#define PDH_NOT_IMPLEMENTED
Definition: pdhmsg.h:68
#define FIXME(fmt,...)
Definition: debug.h:110
#define debugstr_a
Definition: kernel32.h:31
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175

◆ PdhEnumObjectItemsW()

PDH_STATUS WINAPI PdhEnumObjectItemsW ( LPCWSTR  ,
LPCWSTR  ,
LPCWSTR  ,
LPWSTR  ,
LPDWORD  ,
LPWSTR  ,
LPDWORD  ,
DWORD  ,
DWORD   
)

Definition at line 1251 of file pdh_main.c.

1254 {
1255  FIXME("%s, %s, %s, %p, %p, %p, %p, %d, 0x%x: stub\n", debugstr_w(szDataSource), debugstr_w(szMachineName),
1256  debugstr_w(szObjectName), mszCounterList, pcchCounterListLength, mszInstanceList,
1257  pcchInstanceListLength, dwDetailLevel, dwFlags);
1258 
1259  return PDH_NOT_IMPLEMENTED;
1260 }
#define PDH_NOT_IMPLEMENTED
Definition: pdhmsg.h:68
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:110
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175

◆ PdhGetCounterInfoA()

PDH_STATUS WINAPI PdhGetCounterInfoA ( PDH_HCOUNTER  ,
BOOLEAN  ,
LPDWORD  ,
PPDH_COUNTER_INFO_A   
)

Definition at line 645 of file pdh_main.c.

646 {
647  struct counter *counter = handle;
648 
649  TRACE("%p %d %p %p\n", handle, text, size, info);
650 
653  {
655  return PDH_INVALID_HANDLE;
656  }
657  if (!size)
658  {
660  return PDH_INVALID_ARGUMENT;
661  }
662  if (*size < sizeof(PDH_COUNTER_INFO_A))
663  {
664  *size = sizeof(PDH_COUNTER_INFO_A);
666  return PDH_MORE_DATA;
667  }
668 
669  memset( info, 0, sizeof(PDH_COUNTER_INFO_A) );
670 
671  info->dwType = counter->type;
672  info->CStatus = counter->status;
673  info->lScale = counter->scale;
674  info->lDefaultScale = counter->defaultscale;
675  info->dwUserData = counter->user;
676  info->dwQueryUserData = counter->queryuser;
677 
678  *size = sizeof(PDH_COUNTER_INFO_A);
679 
681  return ERROR_SUCCESS;
682 }
DWORD magic
Definition: pdh_main.c:99
namespace GUID const ADDRINFOEXW ADDRINFOEXW struct timeval OVERLAPPED LPLOOKUPSERVICE_COMPLETION_ROUTINE HANDLE * handle
Definition: sock.c:82
DWORD_PTR user
Definition: pdh_main.c:106
#define ERROR_SUCCESS
Definition: deptool.c:10
struct _PDH_COUNTER_INFO_A PDH_COUNTER_INFO_A
const WCHAR * text
Definition: package.c:1827
#define PDH_INVALID_ARGUMENT
Definition: pdhmsg.h:46
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
DWORD status
Definition: pdh_main.c:103
LONG defaultscale
Definition: pdh_main.c:105
DWORD_PTR queryuser
Definition: pdh_main.c:107
#define TRACE(s)
Definition: solgame.cpp:4
#define PDH_MORE_DATA
Definition: pdhmsg.h:28
GLsizeiptr size
Definition: glext.h:5919
static CRITICAL_SECTION pdh_handle_cs
Definition: pdh_main.c:41
#define PDH_INVALID_HANDLE
Definition: pdhmsg.h:45
DWORD type
Definition: pdh_main.c:102
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
#define memset(x, y, z)
Definition: compat.h:39
LONG scale
Definition: pdh_main.c:104
#define PDH_MAGIC_COUNTER
Definition: pdh_main.c:115

Referenced by test_PdhGetCounterInfoA().

◆ PdhGetCounterInfoW()

PDH_STATUS WINAPI PdhGetCounterInfoW ( PDH_HCOUNTER  ,
BOOLEAN  ,
LPDWORD  ,
PPDH_COUNTER_INFO_W   
)

Definition at line 687 of file pdh_main.c.

688 {
689  struct counter *counter = handle;
690 
691  TRACE("%p %d %p %p\n", handle, text, size, info);
692 
695  {
697  return PDH_INVALID_HANDLE;
698  }
699  if (!size)
700  {
702  return PDH_INVALID_ARGUMENT;
703  }
704  if (*size < sizeof(PDH_COUNTER_INFO_W))
705  {
706  *size = sizeof(PDH_COUNTER_INFO_W);
708  return PDH_MORE_DATA;
709  }
710 
711  memset( info, 0, sizeof(PDH_COUNTER_INFO_W) );
712 
713  info->dwType = counter->type;
714  info->CStatus = counter->status;
715  info->lScale = counter->scale;
716  info->lDefaultScale = counter->defaultscale;
717  info->dwUserData = counter->user;
718  info->dwQueryUserData = counter->queryuser;
719 
720  *size = sizeof(PDH_COUNTER_INFO_W);
721 
723  return ERROR_SUCCESS;
724 }
DWORD magic
Definition: pdh_main.c:99
namespace GUID const ADDRINFOEXW ADDRINFOEXW struct timeval OVERLAPPED LPLOOKUPSERVICE_COMPLETION_ROUTINE HANDLE * handle
Definition: sock.c:82
DWORD_PTR user
Definition: pdh_main.c:106
#define ERROR_SUCCESS
Definition: deptool.c:10
const WCHAR * text
Definition: package.c:1827
#define PDH_INVALID_ARGUMENT
Definition: pdhmsg.h:46
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
DWORD status
Definition: pdh_main.c:103
LONG defaultscale
Definition: pdh_main.c:105
DWORD_PTR queryuser
Definition: pdh_main.c:107
#define TRACE(s)
Definition: solgame.cpp:4
#define PDH_MORE_DATA
Definition: pdhmsg.h:28
GLsizeiptr size
Definition: glext.h:5919
static CRITICAL_SECTION pdh_handle_cs
Definition: pdh_main.c:41
struct _PDH_COUNTER_INFO_W PDH_COUNTER_INFO_W
#define PDH_INVALID_HANDLE
Definition: pdhmsg.h:45
DWORD type
Definition: pdh_main.c:102
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
#define memset(x, y, z)
Definition: compat.h:39
LONG scale
Definition: pdh_main.c:104
#define PDH_MAGIC_COUNTER
Definition: pdh_main.c:115

Referenced by test_PdhGetCounterInfoW().

◆ PdhGetCounterTimeBase()

PDH_STATUS WINAPI PdhGetCounterTimeBase ( PDH_HCOUNTER  ,
LONGLONG  
)

Definition at line 729 of file pdh_main.c.

730 {
731  struct counter *counter = handle;
732 
733  TRACE("%p %p\n", handle, base);
734 
735  if (!base) return PDH_INVALID_ARGUMENT;
736 
739  {
741  return PDH_INVALID_HANDLE;
742  }
743 
744  *base = counter->base;
745 
747  return ERROR_SUCCESS;
748 }
DWORD magic
Definition: pdh_main.c:99
namespace GUID const ADDRINFOEXW ADDRINFOEXW struct timeval OVERLAPPED LPLOOKUPSERVICE_COMPLETION_ROUTINE HANDLE * handle
Definition: sock.c:82
#define ERROR_SUCCESS
Definition: deptool.c:10
LONGLONG base
Definition: pdh_main.c:108
#define PDH_INVALID_ARGUMENT
Definition: pdhmsg.h:46
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
#define TRACE(s)
Definition: solgame.cpp:4
static CRITICAL_SECTION pdh_handle_cs
Definition: pdh_main.c:41
#define PDH_INVALID_HANDLE
Definition: pdhmsg.h:45
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
#define PDH_MAGIC_COUNTER
Definition: pdh_main.c:115

Referenced by test_PdhGetCounterTimeBase().

◆ PdhGetDllVersion()

PDH_STATUS WINAPI PdhGetDllVersion ( LPDWORD  )

Definition at line 753 of file pdh_main.c.

754 {
755  if (!version)
756  return PDH_INVALID_ARGUMENT;
757 
758  *version = PDH_VERSION;
759 
760  return ERROR_SUCCESS;
761 }
#define ERROR_SUCCESS
Definition: deptool.c:10
#define PDH_VERSION
Definition: pdh.h:42
#define PDH_INVALID_ARGUMENT
Definition: pdhmsg.h:46
static const WCHAR version[]
Definition: asmname.c:64

Referenced by test_PdhGetDllVersion().

◆ PdhGetFormattedCounterValue()

PDH_STATUS WINAPI PdhGetFormattedCounterValue ( PDH_HCOUNTER  ,
DWORD  ,
LPDWORD  ,
PPDH_FMT_COUNTERVALUE   
)

Definition at line 766 of file pdh_main.c.

768 {
769  PDH_STATUS ret;
770  struct counter *counter = handle;
771 
772  TRACE("%p %x %p %p\n", handle, format, type, value);
773 
774  if (!value) return PDH_INVALID_ARGUMENT;
775 
778  {
780  return PDH_INVALID_HANDLE;
781  }
782  if (counter->status)
783  {
785  return PDH_INVALID_DATA;
786  }
787  if (!(ret = format_value( counter, format, &counter->one, &counter->two, value )))
788  {
789  value->CStatus = ERROR_SUCCESS;
790  if (type) *type = counter->type;
791  }
792 
794  return ret;
795 }
union value one
Definition: pdh_main.c:111
DWORD magic
Definition: pdh_main.c:99
namespace GUID const ADDRINFOEXW ADDRINFOEXW struct timeval OVERLAPPED LPLOOKUPSERVICE_COMPLETION_ROUTINE HANDLE * handle
Definition: sock.c:82
#define ERROR_SUCCESS
Definition: deptool.c:10
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define PDH_INVALID_ARGUMENT
Definition: pdhmsg.h:46
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
static PDH_STATUS format_value(struct counter *counter, DWORD format, union value *raw1, union value *raw2, PDH_FMT_COUNTERVALUE *value)
Definition: pdh_main.c:330
DWORD status
Definition: pdh_main.c:103
#define TRACE(s)
Definition: solgame.cpp:4
LONG PDH_STATUS
Definition: pdh.h:35
int ret
static CRITICAL_SECTION pdh_handle_cs
Definition: pdh_main.c:41
#define PDH_INVALID_HANDLE
Definition: pdhmsg.h:45
DWORD type
Definition: pdh_main.c:102
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
union value two
Definition: pdh_main.c:112
#define PDH_INVALID_DATA
Definition: pdhmsg.h:55
#define PDH_MAGIC_COUNTER
Definition: pdh_main.c:115

Referenced by test_PdhCollectQueryDataEx(), and test_PdhGetFormattedCounterValue().

◆ PdhGetRawCounterValue()

PDH_STATUS WINAPI PdhGetRawCounterValue ( PDH_HCOUNTER  ,
LPDWORD  ,
PPDH_RAW_COUNTER   
)

Definition at line 800 of file pdh_main.c.

802 {
803  struct counter *counter = handle;
804 
805  TRACE("%p %p %p\n", handle, type, value);
806 
807  if (!value) return PDH_INVALID_ARGUMENT;
808 
811  {
813  return PDH_INVALID_HANDLE;
814  }
815 
816  value->CStatus = counter->status;
817  value->TimeStamp.dwLowDateTime = counter->stamp.dwLowDateTime;
818  value->TimeStamp.dwHighDateTime = counter->stamp.dwHighDateTime;
819  value->FirstValue = counter->one.largevalue;
820  value->SecondValue = counter->two.largevalue;
821  value->MultiCount = 1; /* FIXME */
822 
823  if (type) *type = counter->type;
824 
826  return ERROR_SUCCESS;
827 }
union value one
Definition: pdh_main.c:111
DWORD magic
Definition: pdh_main.c:99
namespace GUID const ADDRINFOEXW ADDRINFOEXW struct timeval OVERLAPPED LPLOOKUPSERVICE_COMPLETION_ROUTINE HANDLE * handle
Definition: sock.c:82
#define ERROR_SUCCESS
Definition: deptool.c:10
LONGLONG largevalue
Definition: pdh_main.c:94
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define PDH_INVALID_ARGUMENT
Definition: pdhmsg.h:46
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
DWORD dwHighDateTime
Definition: mapidefs.h:66
DWORD status
Definition: pdh_main.c:103
#define TRACE(s)
Definition: solgame.cpp:4
FILETIME stamp
Definition: pdh_main.c:109
static CRITICAL_SECTION pdh_handle_cs
Definition: pdh_main.c:41
#define PDH_INVALID_HANDLE
Definition: pdhmsg.h:45
DWORD type
Definition: pdh_main.c:102
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
union value two
Definition: pdh_main.c:112
#define PDH_MAGIC_COUNTER
Definition: pdh_main.c:115
DWORD dwLowDateTime
Definition: mapidefs.h:65

Referenced by test_PdhGetRawCounterValue().

◆ PdhLookupPerfIndexByNameA()

PDH_STATUS WINAPI PdhLookupPerfIndexByNameA ( LPCSTR  ,
LPCSTR  ,
LPDWORD   
)

Definition at line 832 of file pdh_main.c.

833 {
834  PDH_STATUS ret;
835  WCHAR *machineW = NULL;
836  WCHAR *nameW;
837 
838  TRACE("%s %s %p\n", debugstr_a(machine), debugstr_a(name), index);
839 
840  if (!name) return PDH_INVALID_ARGUMENT;
841 
843 
844  if (!(nameW = pdh_strdup_aw( name )))
846 
848 
849  heap_free( nameW );
850  heap_free( machineW );
851  return ret;
852 }
#define PDH_MEMORY_ALLOCATION_FAILURE
Definition: pdhmsg.h:44
#define PDH_INVALID_ARGUMENT
Definition: pdhmsg.h:46
smooth NULL
Definition: ftsmooth.c:416
GLuint index
Definition: glext.h:6031
static const WCHAR nameW[]
Definition: main.c:46
static const WCHAR machineW[]
Definition: profile.c:105
#define TRACE(s)
Definition: solgame.cpp:4
LONG PDH_STATUS
Definition: pdh.h:35
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define debugstr_a
Definition: kernel32.h:31
static WCHAR * pdh_strdup_aw(const char *src)
Definition: pdh_main.c:60
int ret
static const char machine[]
Definition: profile.c:104
Definition: name.c:36
PDH_STATUS WINAPI PdhLookupPerfIndexByNameW(LPCWSTR machine, LPCWSTR name, LPDWORD index)
Definition: pdh_main.c:857
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by test_PdhLookupPerfIndexByNameA().

◆ PdhLookupPerfIndexByNameW()

PDH_STATUS WINAPI PdhLookupPerfIndexByNameW ( LPCWSTR  ,
LPCWSTR  ,
LPDWORD   
)

Definition at line 857 of file pdh_main.c.

858 {
859  unsigned int i;
860 
861  TRACE("%s %s %p\n", debugstr_w(machine), debugstr_w(name), index);
862 
863  if (!name || !index) return PDH_INVALID_ARGUMENT;
864 
865  if (machine)
866  {
867  FIXME("remote machine not supported\n");
868  return PDH_CSTATUS_NO_MACHINE;
869  }
870  for (i = 0; i < ARRAY_SIZE(counter_sources); i++)
871  {
873  {
874  *index = counter_sources[i].index;
875  return ERROR_SUCCESS;
876  }
877  }
878  return PDH_STRING_NOT_FOUND;
879 }
#define ERROR_SUCCESS
Definition: deptool.c:10
static const struct source counter_sources[]
Definition: pdh_main.c:204
#define PDH_INVALID_ARGUMENT
Definition: pdhmsg.h:46
#define PDH_STRING_NOT_FOUND
Definition: pdhmsg.h:69
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
#define FIXME(fmt,...)
Definition: debug.h:110
GLuint index
Definition: glext.h:6031
static BOOL pdh_match_path(LPCWSTR fullpath, LPCWSTR path)
Definition: pdh_main.c:219
#define TRACE(s)
Definition: solgame.cpp:4
static const char machine[]
Definition: profile.c:104
#define PDH_CSTATUS_NO_MACHINE
Definition: pdhmsg.h:26
#define ARRAY_SIZE(a)
Definition: main.h:24
Definition: services.c:325
Definition: name.c:36

Referenced by PdhLookupPerfIndexByNameA(), and test_PdhLookupPerfIndexByNameW().

◆ PdhLookupPerfNameByIndexA()

PDH_STATUS WINAPI PdhLookupPerfNameByIndexA ( LPCSTR  ,
DWORD  ,
LPSTR  ,
LPDWORD   
)

Definition at line 884 of file pdh_main.c.

885 {
886  PDH_STATUS ret;
887  WCHAR *machineW = NULL;
888  WCHAR bufferW[PDH_MAX_COUNTER_NAME];
889  DWORD sizeW = ARRAY_SIZE(bufferW);
890 
891  TRACE("%s %d %p %p\n", debugstr_a(machine), index, buffer, size);
892 
893  if (!buffer || !size) return PDH_INVALID_ARGUMENT;
894 
896 
897  if (!(ret = PdhLookupPerfNameByIndexW( machineW, index, bufferW, &sizeW )))
898  {
899  int required = WideCharToMultiByte( CP_ACP, 0, bufferW, -1, NULL, 0, NULL, NULL );
900 
901  if (size && *size < required) ret = PDH_MORE_DATA;
902  else WideCharToMultiByte( CP_ACP, 0, bufferW, -1, buffer, required, NULL, NULL );
903  if (size) *size = required;
904  }
905  heap_free( machineW );
906  return ret;
907 }
PDH_STATUS WINAPI PdhLookupPerfNameByIndexW(LPCWSTR machine, DWORD index, LPWSTR buffer, LPDWORD size)
Definition: pdh_main.c:912
#define PDH_MEMORY_ALLOCATION_FAILURE
Definition: pdhmsg.h:44
#define WideCharToMultiByte
Definition: compat.h:101
#define CP_ACP
Definition: compat.h:99
GLuint buffer
Definition: glext.h:5915
#define PDH_INVALID_ARGUMENT
Definition: pdhmsg.h:46
smooth NULL
Definition: ftsmooth.c:416
static const WCHAR sizeW[]
Definition: editor.c:79
GLuint index
Definition: glext.h:6031
static const WCHAR machineW[]
Definition: profile.c:105
#define TRACE(s)
Definition: solgame.cpp:4
#define PDH_MORE_DATA
Definition: pdhmsg.h:28
GLsizeiptr size
Definition: glext.h:5919
LONG PDH_STATUS
Definition: pdh.h:35
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define debugstr_a
Definition: kernel32.h:31
static WCHAR * pdh_strdup_aw(const char *src)
Definition: pdh_main.c:60
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
static const char machine[]
Definition: profile.c:104
#define ARRAY_SIZE(a)
Definition: main.h:24
#define PDH_MAX_COUNTER_NAME
Definition: pdh.h:47
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by test_PdhLookupPerfNameByIndexA().

◆ PdhLookupPerfNameByIndexW()

PDH_STATUS WINAPI PdhLookupPerfNameByIndexW ( LPCWSTR  ,
DWORD  ,
LPWSTR  ,
LPDWORD   
)

Definition at line 912 of file pdh_main.c.

913 {
914  PDH_STATUS ret;
915  unsigned int i;
916 
917  TRACE("%s %d %p %p\n", debugstr_w(machine), index, buffer, size);
918 
919  if (machine)
920  {
921  FIXME("remote machine not supported\n");
922  return PDH_CSTATUS_NO_MACHINE;
923  }
924 
925  if (!buffer || !size) return PDH_INVALID_ARGUMENT;
926  if (!index) return ERROR_SUCCESS;
927 
928  for (i = 0; i < ARRAY_SIZE(counter_sources); i++)
929  {
930  if (counter_sources[i].index == index)
931  {
932  WCHAR *p = strrchrW( counter_sources[i].path, '\\' ) + 1;
933  unsigned int required = strlenW( p ) + 1;
934 
935  if (*size < required) ret = PDH_MORE_DATA;
936  else
937  {
938  strcpyW( buffer, p );
939  ret = ERROR_SUCCESS;
940  }
941  *size = required;
942  return ret;
943  }
944  }
945  return PDH_INVALID_ARGUMENT;
946 }
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
#define ERROR_SUCCESS
Definition: deptool.c:10
static const struct source counter_sources[]
Definition: pdh_main.c:204
GLuint buffer
Definition: glext.h:5915
#define PDH_INVALID_ARGUMENT
Definition: pdhmsg.h:46
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
#define FIXME(fmt,...)
Definition: debug.h:110
GLuint index
Definition: glext.h:6031
#define TRACE(s)
Definition: solgame.cpp:4
#define PDH_MORE_DATA
Definition: pdhmsg.h:28
GLsizeiptr size
Definition: glext.h:5919
LONG PDH_STATUS
Definition: pdh.h:35
__wchar_t WCHAR
Definition: xmlstorage.h:180
int ret
static const char machine[]
Definition: profile.c:104
WINE_UNICODE_INLINE WCHAR * strrchrW(const WCHAR *str, WCHAR ch)
Definition: unicode.h:254
#define PDH_CSTATUS_NO_MACHINE
Definition: pdhmsg.h:26
WINE_UNICODE_INLINE WCHAR * strcpyW(WCHAR *dst, const WCHAR *src)
Definition: unicode.h:219
#define ARRAY_SIZE(a)
Definition: main.h:24
Definition: services.c:325
GLfloat GLfloat p
Definition: glext.h:8902

Referenced by PdhLookupPerfNameByIndexA(), and test_PdhLookupPerfNameByIndexW().

◆ PdhMakeCounterPathA()

PDH_STATUS WINAPI PdhMakeCounterPathA ( PDH_COUNTER_PATH_ELEMENTS_A ,
LPSTR  ,
LPDWORD  ,
DWORD   
)

Definition at line 1131 of file pdh_main.c.

1133 {
1136  WCHAR *bufferW;
1137  DWORD buflenW;
1138 
1139  TRACE("%p %p %p 0x%08x\n", e, buffer, buflen, flags);
1140 
1141  if (!e || !buflen) return PDH_INVALID_ARGUMENT;
1142 
1143  memset( &eW, 0, sizeof(eW) );
1144  if (e->szMachineName && !(eW.szMachineName = pdh_strdup_aw( e->szMachineName ))) goto done;
1145  if (e->szObjectName && !(eW.szObjectName = pdh_strdup_aw( e->szObjectName ))) goto done;
1146  if (e->szInstanceName && !(eW.szInstanceName = pdh_strdup_aw( e->szInstanceName ))) goto done;
1147  if (e->szParentInstance && !(eW.szParentInstance = pdh_strdup_aw( e->szParentInstance ))) goto done;
1148  if (e->szCounterName && !(eW.szCounterName = pdh_strdup_aw( e->szCounterName ))) goto done;
1149  eW.dwInstanceIndex = e->dwInstanceIndex;
1150 
1151  buflenW = 0;
1152  ret = PdhMakeCounterPathW( &eW, NULL, &buflenW, flags );
1153  if (ret == PDH_MORE_DATA)
1154  {
1155  if ((bufferW = heap_alloc( buflenW * sizeof(WCHAR) )))
1156  {
1157  if (!(ret = PdhMakeCounterPathW( &eW, bufferW, &buflenW, flags )))
1158  {
1159  int len = WideCharToMultiByte(CP_ACP, 0, bufferW, -1, NULL, 0, NULL, NULL);
1160  if (*buflen >= len) WideCharToMultiByte(CP_ACP, 0, bufferW, -1, buffer, *buflen, NULL, NULL);
1161  else ret = PDH_MORE_DATA;
1162  *buflen = len;
1163  }
1164  heap_free( bufferW );
1165  }
1166  else
1168  }
1169 
1170 done:
1171  heap_free( eW.szMachineName );
1172  heap_free( eW.szObjectName );
1173  heap_free( eW.szInstanceName );
1175  heap_free( eW.szCounterName );
1176  return ret;
1177 }
#define PDH_MEMORY_ALLOCATION_FAILURE
Definition: pdhmsg.h:44
#define WideCharToMultiByte
Definition: compat.h:101
#define CP_ACP
Definition: compat.h:99
GLuint buffer
Definition: glext.h:5915
#define PDH_INVALID_ARGUMENT
Definition: pdhmsg.h:46
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
#define e
Definition: ke_i.h:82
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define PDH_MORE_DATA
Definition: pdhmsg.h:28
LONG PDH_STATUS
Definition: pdh.h:35
__wchar_t WCHAR
Definition: xmlstorage.h:180
static WCHAR * pdh_strdup_aw(const char *src)
Definition: pdh_main.c:60
unsigned long DWORD
Definition: ntddk_ex.h:95
GLbitfield flags
Definition: glext.h:7161
int ret
GLenum GLsizei len
Definition: glext.h:6722
PDH_STATUS WINAPI PdhMakeCounterPathW(PDH_COUNTER_PATH_ELEMENTS_W *e, LPWSTR buffer, LPDWORD buflen, DWORD flags)
Definition: pdh_main.c:1182
#define memset(x, y, z)
Definition: compat.h:39
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by test_PdhMakeCounterPathA().

◆ PdhMakeCounterPathW()

PDH_STATUS WINAPI PdhMakeCounterPathW ( PDH_COUNTER_PATH_ELEMENTS_W ,
LPWSTR  ,
LPDWORD  ,
DWORD   
)

Definition at line 1182 of file pdh_main.c.

1184 {
1185  static const WCHAR bslash[] = {'\\',0};
1186  static const WCHAR fslash[] = {'/',0};
1187  static const WCHAR lparen[] = {'(',0};
1188  static const WCHAR rparen[] = {')',0};
1189  static const WCHAR fmt[] = {'#','%','u',0};
1190 
1193  DWORD len;
1194 
1195  TRACE("%p %p %p 0x%08x\n", e, buffer, buflen, flags);
1196 
1197  if (flags) FIXME("unimplemented flags 0x%08x\n", flags);
1198 
1199  if (!e || !e->szCounterName || !e->szObjectName || !buflen)
1200  return PDH_INVALID_ARGUMENT;
1201 
1202  path[0] = 0;
1203  if (e->szMachineName)
1204  {
1205  strcatW(path, bslash);
1206  strcatW(path, bslash);
1207  strcatW(path, e->szMachineName);
1208  }
1209  strcatW(path, bslash);
1210  strcatW(path, e->szObjectName);
1211  if (e->szInstanceName)
1212  {
1213  strcatW(path, lparen);
1214  if (e->szParentInstance)
1215  {
1216  strcatW(path, e->szParentInstance);
1217  strcatW(path, fslash);
1218  }
1219  strcatW(path, e->szInstanceName);
1220  sprintfW(instance, fmt, e->dwInstanceIndex);
1221  strcatW(path, instance);
1222  strcatW(path, rparen);
1223  }
1224  strcatW(path, bslash);
1225  strcatW(path, e->szCounterName);
1226 
1227  len = strlenW(path) + 1;
1228  if (*buflen >= len) strcpyW(buffer, path);
1229  else ret = PDH_MORE_DATA;
1230  *buflen = len;
1231  return ret;
1232 }
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
#define ERROR_SUCCESS
Definition: deptool.c:10
GLuint buffer
Definition: glext.h:5915
#define PDH_INVALID_ARGUMENT
Definition: pdhmsg.h:46
#define e
Definition: ke_i.h:82
#define FIXME(fmt,...)
Definition: debug.h:110
#define TRACE(s)
Definition: solgame.cpp:4
#define PDH_MORE_DATA
Definition: pdhmsg.h:28
LONG PDH_STATUS
Definition: pdh.h:35
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
GLbitfield flags
Definition: glext.h:7161
int ret
GLenum GLsizei len
Definition: glext.h:6722
WINE_UNICODE_INLINE WCHAR * strcpyW(WCHAR *dst, const WCHAR *src)
Definition: unicode.h:219
static HINSTANCE instance
Definition: main.c:40
Definition: services.c:325
#define sprintfW
Definition: unicode.h:58
WINE_UNICODE_INLINE WCHAR * strcatW(WCHAR *dst, const WCHAR *src)
Definition: unicode.h:242
#define PDH_MAX_COUNTER_NAME
Definition: pdh.h:47
Definition: dsound.c:943

Referenced by PdhMakeCounterPathA().

◆ PdhOpenQueryA()

PDH_STATUS WINAPI PdhOpenQueryA ( LPCSTR  ,
DWORD_PTR  ,
PDH_HQUERY  
)

Definition at line 951 of file pdh_main.c.

952 {
953  PDH_STATUS ret;
954  WCHAR *sourceW = NULL;
955 
956  TRACE("%s %lx %p\n", debugstr_a(source), userdata, query);
957 
959 
960  ret = PdhOpenQueryW( sourceW, userdata, query );
961  heap_free( sourceW );
962 
963  return ret;
964 }
#define PDH_MEMORY_ALLOCATION_FAILURE
Definition: pdhmsg.h:44
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
LONG PDH_STATUS
Definition: pdh.h:35
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define debugstr_a
Definition: kernel32.h:31
static WCHAR * pdh_strdup_aw(const char *src)
Definition: pdh_main.c:60
int ret
static const WCHAR sourceW[]
Definition: jsregexp.c:37
PDH_STATUS WINAPI PdhOpenQueryW(LPCWSTR source, DWORD_PTR userdata, PDH_HQUERY *handle)
Definition: pdh_main.c:969
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

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  ,
DWORD_PTR  ,
PDH_HQUERY  
)

Definition at line 969 of file pdh_main.c.

970 {
971  struct query *query;
972 
973  TRACE("%s %lx %p\n", debugstr_w(source), userdata, handle);
974 
975  if (!handle) return PDH_INVALID_ARGUMENT;
976 
977  if (source)
978  {
979  FIXME("log file data source not supported\n");
980  return PDH_INVALID_ARGUMENT;
981  }
982  if ((query = create_query()))
983  {
984  query->user = userdata;
985  *handle = query;
986 
987  return ERROR_SUCCESS;
988  }
990 }
#define ERROR_SUCCESS
Definition: deptool.c:10
#define PDH_MEMORY_ALLOCATION_FAILURE
Definition: pdhmsg.h:44
#define PDH_INVALID_ARGUMENT
Definition: pdhmsg.h:46
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:110
#define TRACE(s)
Definition: solgame.cpp:4
DWORD_PTR user
Definition: pdh_main.c:141
static struct query * create_query(void)
Definition: pdh_main.c:149
GLenum query
Definition: glext.h:7781

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

◆ PdhRemoveCounter()

PDH_STATUS WINAPI PdhRemoveCounter ( PDH_HCOUNTER  )

Definition at line 995 of file pdh_main.c.

996 {
997  struct counter *counter = handle;
998 
999  TRACE("%p\n", handle);
1000 
1002  if (!counter || counter->magic != PDH_MAGIC_COUNTER)
1003  {
1005  return PDH_INVALID_HANDLE;
1006  }
1007 
1008  list_remove( &counter->entry );
1010 
1012  return ERROR_SUCCESS;
1013 }
DWORD magic
Definition: pdh_main.c:99
namespace GUID const ADDRINFOEXW ADDRINFOEXW struct timeval OVERLAPPED LPLOOKUPSERVICE_COMPLETION_ROUTINE HANDLE * handle
Definition: sock.c:82
#define ERROR_SUCCESS
Definition: deptool.c:10
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
__WINE_SERVER_LIST_INLINE void list_remove(struct list *elem)
Definition: list.h:108
#define TRACE(s)
Definition: solgame.cpp:4
static void destroy_counter(struct counter *counter)
Definition: pdh_main.c:129
static CRITICAL_SECTION pdh_handle_cs
Definition: pdh_main.c:41
#define PDH_INVALID_HANDLE
Definition: pdhmsg.h:45
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
#define PDH_MAGIC_COUNTER
Definition: pdh_main.c:115
struct list entry
Definition: pdh_main.c:100

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

◆ PdhSetCounterScaleFactor()

PDH_STATUS WINAPI PdhSetCounterScaleFactor ( PDH_HCOUNTER  ,
LONG   
)

Definition at line 1018 of file pdh_main.c.

1019 {
1020  struct counter *counter = handle;
1021 
1022  TRACE("%p\n", handle);
1023 
1025  if (!counter || counter->magic != PDH_MAGIC_COUNTER)
1026  {
1028  return PDH_INVALID_HANDLE;
1029  }
1030  if (factor < PDH_MIN_SCALE || factor > PDH_MAX_SCALE)
1031  {
1033  return PDH_INVALID_ARGUMENT;
1034  }
1035 
1036  counter->scale = factor;
1037 
1039  return ERROR_SUCCESS;
1040 }
DWORD magic
Definition: pdh_main.c:99
namespace GUID const ADDRINFOEXW ADDRINFOEXW struct timeval OVERLAPPED LPLOOKUPSERVICE_COMPLETION_ROUTINE HANDLE * handle
Definition: sock.c:82
#define ERROR_SUCCESS
Definition: deptool.c:10
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_INVALID_ARGUMENT
Definition: pdhmsg.h:46
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
#define PDH_MAX_SCALE
Definition: pdh.h:44
#define TRACE(s)
Definition: solgame.cpp:4
static CRITICAL_SECTION pdh_handle_cs
Definition: pdh_main.c:41
#define PDH_INVALID_HANDLE
Definition: pdhmsg.h:45
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
LONG scale
Definition: pdh_main.c:104
#define PDH_MAGIC_COUNTER
Definition: pdh_main.c:115

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

◆ PdhSetDefaultRealTimeDataSource()

PDH_STATUS WINAPI PdhSetDefaultRealTimeDataSource ( DWORD  )

Definition at line 1265 of file pdh_main.c.

1266 {
1267  FIXME("%u\n", source);
1268  return ERROR_SUCCESS;
1269 }
#define ERROR_SUCCESS
Definition: deptool.c:10
#define FIXME(fmt,...)
Definition: debug.h:110

◆ PdhValidatePathA()

PDH_STATUS WINAPI PdhValidatePathA ( LPCSTR  )

Definition at line 1045 of file pdh_main.c.

1046 {
1047  PDH_STATUS ret;
1048  WCHAR *pathW;
1049 
1050  TRACE("%s\n", debugstr_a(path));
1051 
1052  if (!path) return PDH_INVALID_ARGUMENT;
1053  if (!(pathW = pdh_strdup_aw( path ))) return PDH_MEMORY_ALLOCATION_FAILURE;
1054 
1055  ret = PdhValidatePathW( pathW );
1056 
1057  heap_free( pathW );
1058  return ret;
1059 }
#define PDH_MEMORY_ALLOCATION_FAILURE
Definition: pdhmsg.h:44
#define PDH_INVALID_ARGUMENT
Definition: pdhmsg.h:46
#define TRACE(s)
Definition: solgame.cpp:4
LONG PDH_STATUS
Definition: pdh.h:35
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define debugstr_a
Definition: kernel32.h:31
static WCHAR * pdh_strdup_aw(const char *src)
Definition: pdh_main.c:60
int ret
Definition: services.c:325
PDH_STATUS WINAPI PdhValidatePathW(LPCWSTR path)
Definition: pdh_main.c:1071
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by PdhValidatePathExA(), and test_PdhValidatePathA().

◆ PdhValidatePathExA()

PDH_STATUS WINAPI PdhValidatePathExA ( PDH_HLOG  ,
LPCSTR   
)

Definition at line 1101 of file pdh_main.c.

1102 {
1103  TRACE("%p %s\n", source, debugstr_a(path));
1104 
1105  if (source)
1106  {
1107  FIXME("log file data source not supported\n");
1108  return ERROR_SUCCESS;
1109  }
1110  return PdhValidatePathA( path );
1111 }
#define ERROR_SUCCESS
Definition: deptool.c:10
#define FIXME(fmt,...)
Definition: debug.h:110
#define TRACE(s)
Definition: solgame.cpp:4
#define debugstr_a
Definition: kernel32.h:31
Definition: services.c:325
PDH_STATUS WINAPI PdhValidatePathA(LPCSTR path)
Definition: pdh_main.c:1045

Referenced by init_function_ptrs().

◆ PdhValidatePathExW()

PDH_STATUS WINAPI PdhValidatePathExW ( PDH_HLOG  ,
LPCWSTR   
)

Definition at line 1116 of file pdh_main.c.

1117 {
1118  TRACE("%p %s\n", source, debugstr_w(path));
1119 
1120  if (source)
1121  {
1122  FIXME("log file data source not supported\n");
1123  return ERROR_SUCCESS;
1124  }
1125  return PdhValidatePathW( path );
1126 }
#define ERROR_SUCCESS
Definition: deptool.c:10
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:110
#define TRACE(s)
Definition: solgame.cpp:4
Definition: services.c:325
PDH_STATUS WINAPI PdhValidatePathW(LPCWSTR path)
Definition: pdh_main.c:1071

Referenced by init_function_ptrs().

◆ PdhValidatePathW()

PDH_STATUS WINAPI PdhValidatePathW ( LPCWSTR  )

Definition at line 1071 of file pdh_main.c.

1072 {
1073  PDH_STATUS ret;
1074  unsigned int i;
1075 
1076  TRACE("%s\n", debugstr_w(path));
1077 
1078  if ((ret = validate_path( path ))) return ret;
1079 
1080  for (i = 0; i < ARRAY_SIZE(counter_sources); i++)
1082 
1083  return PDH_CSTATUS_NO_COUNTER;
1084 }
#define ERROR_SUCCESS
Definition: deptool.c:10
static const struct source counter_sources[]
Definition: pdh_main.c:204
#define PDH_CSTATUS_NO_COUNTER
Definition: pdhmsg.h:42
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 BOOL pdh_match_path(LPCWSTR fullpath, LPCWSTR path)
Definition: pdh_main.c:219
#define TRACE(s)
Definition: solgame.cpp:4
LONG PDH_STATUS
Definition: pdh.h:35
int ret
static PDH_STATUS validate_path(LPCWSTR path)
Definition: pdh_main.c:1061
#define ARRAY_SIZE(a)
Definition: main.h:24
Definition: services.c:325

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