ReactOS  0.4.14-dev-606-g14ebc0b
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 242 of file pdh_main.c.

244 {
245  PDH_STATUS ret;
246  WCHAR *pathW;
247 
248  TRACE("%p %s %lx %p\n", query, debugstr_a(path), userdata, counter);
249 
250  if (!path) return PDH_INVALID_ARGUMENT;
251 
252  if (!(pathW = pdh_strdup_aw( path )))
254 
255  ret = PdhAddCounterW( query, pathW, userdata, counter );
256 
257  heap_free( pathW );
258  return ret;
259 }
#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:264
#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:63
int ret
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 264 of file pdh_main.c.

266 {
267  struct query *query = hquery;
268  struct counter *counter;
269  unsigned int i;
270 
271  TRACE("%p %s %lx %p\n", hquery, debugstr_w(path), userdata, hcounter);
272 
273  if (!path || !hcounter) return PDH_INVALID_ARGUMENT;
274 
276  if (!query || query->magic != PDH_MAGIC_QUERY)
277  {
279  return PDH_INVALID_HANDLE;
280  }
281 
282  *hcounter = NULL;
283  for (i = 0; i < ARRAY_SIZE(counter_sources); i++)
284  {
286  {
287  if ((counter = create_counter()))
288  {
290  counter->collect = counter_sources[i].collect;
291  counter->type = counter_sources[i].type;
293  counter->base = counter_sources[i].base;
295  counter->user = userdata;
296 
298  *hcounter = counter;
299 
301  return ERROR_SUCCESS;
302  }
305  }
306  }
308  return PDH_CSTATUS_NO_COUNTER;
309 }
static WCHAR * pdh_strdup(const WCHAR *src)
Definition: pdh_main.c:54
DWORD magic
Definition: pdh_main.c:143
DWORD_PTR user
Definition: pdh_main.c:109
#define ERROR_SUCCESS
Definition: deptool.c:10
#define PDH_MEMORY_ALLOCATION_FAILURE
Definition: pdhmsg.h:44
LONGLONG base
Definition: pdh_main.c:111
static const struct source counter_sources[]
Definition: pdh_main.c:209
#define PDH_MAGIC_QUERY
Definition: pdh_main.c:139
#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:108
smooth NULL
Definition: ftsmooth.c:416
DWORD_PTR queryuser
Definition: pdh_main.c:110
GLuint counter
Definition: glext.h:11116
static BOOL pdh_match_path(LPCWSTR fullpath, LPCWSTR path)
Definition: pdh_main.c:225
static struct counter * create_counter(void)
Definition: pdh_main.c:120
#define TRACE(s)
Definition: solgame.cpp:4
DWORD_PTR user
Definition: pdh_main.c:144
static CRITICAL_SECTION pdh_handle_cs
Definition: pdh_main.c:44
#define ARRAY_SIZE(a)
Definition: main.h:24
#define PDH_INVALID_HANDLE
Definition: pdhmsg.h:45
WCHAR * path
Definition: pdh_main.c:104
DWORD type
Definition: pdh_main.c:105
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
struct list counters
Definition: pdh_main.c:149
struct list entry
Definition: pdh_main.c:103

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

◆ PdhAddEnglishCounterA()

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

Definition at line 314 of file pdh_main.c.

316 {
317  TRACE("%p %s %lx %p\n", query, debugstr_a(path), userdata, counter);
318 
319  if (!query) return PDH_INVALID_ARGUMENT;
320  return PdhAddCounterA( query, path, userdata, counter );
321 }
PDH_STATUS WINAPI PdhAddCounterA(PDH_HQUERY query, LPCSTR path, DWORD_PTR userdata, PDH_HCOUNTER *counter)
Definition: pdh_main.c:242
#define PDH_INVALID_ARGUMENT
Definition: pdhmsg.h:46
#define TRACE(s)
Definition: solgame.cpp:4
#define debugstr_a
Definition: kernel32.h:31

Referenced by init_function_ptrs().

◆ PdhAddEnglishCounterW()

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

Definition at line 326 of file pdh_main.c.

328 {
329  TRACE("%p %s %lx %p\n", query, debugstr_w(path), userdata, counter);
330 
331  if (!query) return PDH_INVALID_ARGUMENT;
332  return PdhAddCounterW( query, path, userdata, counter );
333 }
#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:264
#define debugstr_w
Definition: kernel32.h:32
#define TRACE(s)
Definition: solgame.cpp:4

Referenced by init_function_ptrs().

◆ PdhCloseQuery()

PDH_STATUS WINAPI PdhCloseQuery ( PDH_HQUERY  )

Definition at line 397 of file pdh_main.c.

398 {
399  struct query *query = handle;
400  struct list *item, *next;
401 
402  TRACE("%p\n", handle);
403 
405  if (!query || query->magic != PDH_MAGIC_QUERY)
406  {
408  return PDH_INVALID_HANDLE;
409  }
410 
411  if (query->thread)
412  {
414  SetEvent( query->stop );
416 
418 
420  if (query->magic != PDH_MAGIC_QUERY)
421  {
423  return ERROR_SUCCESS;
424  }
425  CloseHandle( query->stop );
427  query->thread = NULL;
428  }
429 
431  {
432  struct counter *counter = LIST_ENTRY( item, struct counter, entry );
433 
436  }
437 
438  destroy_query( query );
439 
441  return ERROR_SUCCESS;
442 }
DWORD magic
Definition: pdh_main.c:143
#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:406
#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:139
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:145
HANDLE stop
Definition: pdh_main.c:148
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:132
static CRITICAL_SECTION pdh_handle_cs
Definition: pdh_main.c:44
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:165
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
#define LIST_ENTRY(type)
Definition: queue.h:175
struct list counters
Definition: pdh_main.c:149
#define INFINITE
Definition: serial.h:102
struct list entry
Definition: pdh_main.c:103

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 464 of file pdh_main.c.

465 {
466  struct query *query = handle;
467 
468  TRACE("%p\n", handle);
469 
471  if (!query || query->magic != PDH_MAGIC_QUERY)
472  {
474  return PDH_INVALID_HANDLE;
475  }
476 
477  if (list_empty( &query->counters ))
478  {
480  return PDH_NO_DATA;
481  }
482 
484 
486  return ERROR_SUCCESS;
487 }
DWORD magic
Definition: pdh_main.c:143
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:139
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
#define TRACE(s)
Definition: solgame.cpp:4
static void collect_query_data(struct query *query)
Definition: pdh_main.c:445
static CRITICAL_SECTION pdh_handle_cs
Definition: pdh_main.c:44
__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:149

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 520 of file pdh_main.c.

521 {
522  PDH_STATUS ret;
523  struct query *query = handle;
524 
525  TRACE("%p %d %p\n", handle, interval, event);
526 
528  if (!query || query->magic != PDH_MAGIC_QUERY)
529  {
531  return PDH_INVALID_HANDLE;
532  }
533  if (list_empty( &query->counters ))
534  {
536  return PDH_NO_DATA;
537  }
538  if (query->thread)
539  {
541  SetEvent( query->stop );
543 
545 
547  if (query->magic != PDH_MAGIC_QUERY)
548  {
550  return PDH_INVALID_HANDLE;
551  }
553  query->thread = NULL;
554  }
555  else if (!(query->stop = CreateEventW( NULL, FALSE, FALSE, NULL )))
556  {
557  ret = GetLastError();
559  return ret;
560  }
561  query->wait = event;
562  query->interval = interval * 1000;
564  {
565  ret = GetLastError();
566  CloseHandle( query->stop );
567 
569  return ret;
570  }
571 
573  return ERROR_SUCCESS;
574 }
DWORD magic
Definition: pdh_main.c:143
namespace GUID const ADDRINFOEXW ADDRINFOEXW struct timeval OVERLAPPED LPLOOKUPSERVICE_COMPLETION_ROUTINE HANDLE * handle
Definition: sock.c:82
#define CloseHandle
Definition: compat.h:406
#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:139
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
static DWORD CALLBACK collect_query_thread(void *arg)
Definition: pdh_main.c:489
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:147
HANDLE thread
Definition: pdh_main.c:145
HANDLE stop
Definition: pdh_main.c:148
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:44
__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:149
#define INFINITE
Definition: serial.h:102
DWORD interval
Definition: pdh_main.c:146

Referenced by test_PdhCollectQueryDataEx().

◆ PdhCollectQueryDataWithTime()

PDH_STATUS WINAPI PdhCollectQueryDataWithTime ( PDH_HQUERY  ,
LONGLONG  
)

Definition at line 579 of file pdh_main.c.

580 {
581  struct query *query = handle;
582  struct counter *counter;
583  struct list *item;
584 
585  TRACE("%p %p\n", handle, timestamp);
586 
587  if (!timestamp) return PDH_INVALID_ARGUMENT;
588 
590  if (!query || query->magic != PDH_MAGIC_QUERY)
591  {
593  return PDH_INVALID_HANDLE;
594  }
595  if (list_empty( &query->counters ))
596  {
598  return PDH_NO_DATA;
599  }
600 
602 
603  item = list_head( &query->counters );
604  counter = LIST_ENTRY( item, struct counter, entry );
605 
607 
609  return ERROR_SUCCESS;
610 }
DWORD magic
Definition: pdh_main.c:143
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:139
#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:445
FILETIME stamp
Definition: pdh_main.c:112
uint32_t entry
Definition: isohybrid.c:63
Definition: _list.h:228
static CRITICAL_SECTION pdh_handle_cs
Definition: pdh_main.c:44
__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:149
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 1243 of file pdh_main.c.

1246 {
1247  FIXME("%s, %s, %s, %p, %p, %p, %p, %d, 0x%x: stub\n", debugstr_a(szDataSource), debugstr_a(szMachineName),
1248  debugstr_a(szObjectName), mszCounterList, pcchCounterListLength, mszInstanceList,
1249  pcchInstanceListLength, dwDetailLevel, dwFlags);
1250 
1251  return PDH_NOT_IMPLEMENTED;
1252 }
#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 1257 of file pdh_main.c.

1260 {
1261  FIXME("%s, %s, %s, %p, %p, %p, %p, %d, 0x%x: stub\n", debugstr_w(szDataSource), debugstr_w(szMachineName),
1262  debugstr_w(szObjectName), mszCounterList, pcchCounterListLength, mszInstanceList,
1263  pcchInstanceListLength, dwDetailLevel, dwFlags);
1264 
1265  return PDH_NOT_IMPLEMENTED;
1266 }
#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 651 of file pdh_main.c.

652 {
653  struct counter *counter = handle;
654 
655  TRACE("%p %d %p %p\n", handle, text, size, info);
656 
659  {
661  return PDH_INVALID_HANDLE;
662  }
663  if (!size)
664  {
666  return PDH_INVALID_ARGUMENT;
667  }
668  if (*size < sizeof(PDH_COUNTER_INFO_A))
669  {
670  *size = sizeof(PDH_COUNTER_INFO_A);
672  return PDH_MORE_DATA;
673  }
674 
675  memset( info, 0, sizeof(PDH_COUNTER_INFO_A) );
676 
677  info->dwType = counter->type;
678  info->CStatus = counter->status;
679  info->lScale = counter->scale;
680  info->lDefaultScale = counter->defaultscale;
681  info->dwUserData = counter->user;
682  info->dwQueryUserData = counter->queryuser;
683 
684  *size = sizeof(PDH_COUNTER_INFO_A);
685 
687  return ERROR_SUCCESS;
688 }
DWORD magic
Definition: pdh_main.c:102
namespace GUID const ADDRINFOEXW ADDRINFOEXW struct timeval OVERLAPPED LPLOOKUPSERVICE_COMPLETION_ROUTINE HANDLE * handle
Definition: sock.c:82
DWORD_PTR user
Definition: pdh_main.c:109
#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:106
LONG defaultscale
Definition: pdh_main.c:108
DWORD_PTR queryuser
Definition: pdh_main.c:110
#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:44
#define PDH_INVALID_HANDLE
Definition: pdhmsg.h:45
DWORD type
Definition: pdh_main.c:105
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
#define memset(x, y, z)
Definition: compat.h:39
LONG scale
Definition: pdh_main.c:107
#define PDH_MAGIC_COUNTER
Definition: pdh_main.c:118

Referenced by test_PdhGetCounterInfoA().

◆ PdhGetCounterInfoW()

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

Definition at line 693 of file pdh_main.c.

694 {
695  struct counter *counter = handle;
696 
697  TRACE("%p %d %p %p\n", handle, text, size, info);
698 
701  {
703  return PDH_INVALID_HANDLE;
704  }
705  if (!size)
706  {
708  return PDH_INVALID_ARGUMENT;
709  }
710  if (*size < sizeof(PDH_COUNTER_INFO_W))
711  {
712  *size = sizeof(PDH_COUNTER_INFO_W);
714  return PDH_MORE_DATA;
715  }
716 
717  memset( info, 0, sizeof(PDH_COUNTER_INFO_W) );
718 
719  info->dwType = counter->type;
720  info->CStatus = counter->status;
721  info->lScale = counter->scale;
722  info->lDefaultScale = counter->defaultscale;
723  info->dwUserData = counter->user;
724  info->dwQueryUserData = counter->queryuser;
725 
726  *size = sizeof(PDH_COUNTER_INFO_W);
727 
729  return ERROR_SUCCESS;
730 }
DWORD magic
Definition: pdh_main.c:102
namespace GUID const ADDRINFOEXW ADDRINFOEXW struct timeval OVERLAPPED LPLOOKUPSERVICE_COMPLETION_ROUTINE HANDLE * handle
Definition: sock.c:82
DWORD_PTR user
Definition: pdh_main.c:109
#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:106
LONG defaultscale
Definition: pdh_main.c:108
DWORD_PTR queryuser
Definition: pdh_main.c:110
#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:44
struct _PDH_COUNTER_INFO_W PDH_COUNTER_INFO_W
#define PDH_INVALID_HANDLE
Definition: pdhmsg.h:45
DWORD type
Definition: pdh_main.c:105
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
#define memset(x, y, z)
Definition: compat.h:39
LONG scale
Definition: pdh_main.c:107
#define PDH_MAGIC_COUNTER
Definition: pdh_main.c:118

Referenced by test_PdhGetCounterInfoW().

◆ PdhGetCounterTimeBase()

PDH_STATUS WINAPI PdhGetCounterTimeBase ( PDH_HCOUNTER  ,
LONGLONG  
)

Definition at line 735 of file pdh_main.c.

736 {
737  struct counter *counter = handle;
738 
739  TRACE("%p %p\n", handle, base);
740 
741  if (!base) return PDH_INVALID_ARGUMENT;
742 
745  {
747  return PDH_INVALID_HANDLE;
748  }
749 
750  *base = counter->base;
751 
753  return ERROR_SUCCESS;
754 }
DWORD magic
Definition: pdh_main.c:102
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:111
#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:44
#define PDH_INVALID_HANDLE
Definition: pdhmsg.h:45
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
#define PDH_MAGIC_COUNTER
Definition: pdh_main.c:118

Referenced by test_PdhGetCounterTimeBase().

◆ PdhGetDllVersion()

PDH_STATUS WINAPI PdhGetDllVersion ( LPDWORD  )

Definition at line 759 of file pdh_main.c.

760 {
761  if (!version)
762  return PDH_INVALID_ARGUMENT;
763 
764  *version = PDH_VERSION;
765 
766  return ERROR_SUCCESS;
767 }
#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:66

Referenced by test_PdhGetDllVersion().

◆ PdhGetFormattedCounterValue()

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

Definition at line 772 of file pdh_main.c.

774 {
775  PDH_STATUS ret;
776  struct counter *counter = handle;
777 
778  TRACE("%p %x %p %p\n", handle, format, type, value);
779 
780  if (!value) return PDH_INVALID_ARGUMENT;
781 
784  {
786  return PDH_INVALID_HANDLE;
787  }
788  if (counter->status)
789  {
791  return PDH_INVALID_DATA;
792  }
793  if (!(ret = format_value( counter, format, &counter->one, &counter->two, value )))
794  {
795  value->CStatus = ERROR_SUCCESS;
796  if (type) *type = counter->type;
797  }
798 
800  return ret;
801 }
union value one
Definition: pdh_main.c:114
DWORD magic
Definition: pdh_main.c:102
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:336
DWORD status
Definition: pdh_main.c:106
#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:44
#define PDH_INVALID_HANDLE
Definition: pdhmsg.h:45
DWORD type
Definition: pdh_main.c:105
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
union value two
Definition: pdh_main.c:115
#define PDH_INVALID_DATA
Definition: pdhmsg.h:55
#define PDH_MAGIC_COUNTER
Definition: pdh_main.c:118

Referenced by test_PdhCollectQueryDataEx(), and test_PdhGetFormattedCounterValue().

◆ PdhGetRawCounterValue()

PDH_STATUS WINAPI PdhGetRawCounterValue ( PDH_HCOUNTER  ,
LPDWORD  ,
PPDH_RAW_COUNTER   
)

Definition at line 806 of file pdh_main.c.

808 {
809  struct counter *counter = handle;
810 
811  TRACE("%p %p %p\n", handle, type, value);
812 
813  if (!value) return PDH_INVALID_ARGUMENT;
814 
817  {
819  return PDH_INVALID_HANDLE;
820  }
821 
822  value->CStatus = counter->status;
823  value->TimeStamp.dwLowDateTime = counter->stamp.dwLowDateTime;
824  value->TimeStamp.dwHighDateTime = counter->stamp.dwHighDateTime;
825  value->FirstValue = counter->one.largevalue;
826  value->SecondValue = counter->two.largevalue;
827  value->MultiCount = 1; /* FIXME */
828 
829  if (type) *type = counter->type;
830 
832  return ERROR_SUCCESS;
833 }
union value one
Definition: pdh_main.c:114
DWORD magic
Definition: pdh_main.c:102
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:97
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:106
#define TRACE(s)
Definition: solgame.cpp:4
FILETIME stamp
Definition: pdh_main.c:112
static CRITICAL_SECTION pdh_handle_cs
Definition: pdh_main.c:44
#define PDH_INVALID_HANDLE
Definition: pdhmsg.h:45
DWORD type
Definition: pdh_main.c:105
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
union value two
Definition: pdh_main.c:115
#define PDH_MAGIC_COUNTER
Definition: pdh_main.c:118
DWORD dwLowDateTime
Definition: mapidefs.h:65

Referenced by test_PdhGetRawCounterValue().

◆ PdhLookupPerfIndexByNameA()

PDH_STATUS WINAPI PdhLookupPerfIndexByNameA ( LPCSTR  ,
LPCSTR  ,
LPDWORD   
)

Definition at line 838 of file pdh_main.c.

839 {
840  PDH_STATUS ret;
841  WCHAR *machineW = NULL;
842  WCHAR *nameW;
843 
844  TRACE("%s %s %p\n", debugstr_a(machine), debugstr_a(name), index);
845 
846  if (!name) return PDH_INVALID_ARGUMENT;
847 
849 
850  if (!(nameW = pdh_strdup_aw( name )))
852 
854 
855  heap_free( nameW );
856  heap_free( machineW );
857  return ret;
858 }
#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:63
int ret
static const char machine[]
Definition: profile.c:104
Definition: name.c:38
PDH_STATUS WINAPI PdhLookupPerfIndexByNameW(LPCWSTR machine, LPCWSTR name, LPDWORD index)
Definition: pdh_main.c:863
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 863 of file pdh_main.c.

864 {
865  unsigned int i;
866 
867  TRACE("%s %s %p\n", debugstr_w(machine), debugstr_w(name), index);
868 
869  if (!name || !index) return PDH_INVALID_ARGUMENT;
870 
871  if (machine)
872  {
873  FIXME("remote machine not supported\n");
874  return PDH_CSTATUS_NO_MACHINE;
875  }
876  for (i = 0; i < ARRAY_SIZE(counter_sources); i++)
877  {
879  {
880  *index = counter_sources[i].index;
881  return ERROR_SUCCESS;
882  }
883  }
884  return PDH_STRING_NOT_FOUND;
885 }
#define ERROR_SUCCESS
Definition: deptool.c:10
static const struct source counter_sources[]
Definition: pdh_main.c:209
#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:225
#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: name.c:38

Referenced by PdhLookupPerfIndexByNameA(), and test_PdhLookupPerfIndexByNameW().

◆ PdhLookupPerfNameByIndexA()

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

Definition at line 890 of file pdh_main.c.

891 {
892  PDH_STATUS ret;
893  WCHAR *machineW = NULL;
894  WCHAR bufferW[PDH_MAX_COUNTER_NAME];
895  DWORD sizeW = ARRAY_SIZE(bufferW);
896 
897  TRACE("%s %d %p %p\n", debugstr_a(machine), index, buffer, size);
898 
899  if (!buffer || !size) return PDH_INVALID_ARGUMENT;
900 
902 
903  if (!(ret = PdhLookupPerfNameByIndexW( machineW, index, bufferW, &sizeW )))
904  {
905  int required = WideCharToMultiByte( CP_ACP, 0, bufferW, -1, NULL, 0, NULL, NULL );
906 
907  if (*size < required) ret = PDH_MORE_DATA;
908  else WideCharToMultiByte( CP_ACP, 0, bufferW, -1, buffer, required, NULL, NULL );
909  *size = required;
910  }
911  heap_free( machineW );
912  return ret;
913 }
PDH_STATUS WINAPI PdhLookupPerfNameByIndexW(LPCWSTR machine, DWORD index, LPWSTR buffer, LPDWORD size)
Definition: pdh_main.c:918
#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:63
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 918 of file pdh_main.c.

919 {
920  PDH_STATUS ret;
921  unsigned int i;
922 
923  TRACE("%s %d %p %p\n", debugstr_w(machine), index, buffer, size);
924 
925  if (machine)
926  {
927  FIXME("remote machine not supported\n");
928  return PDH_CSTATUS_NO_MACHINE;
929  }
930 
931  if (!buffer || !size) return PDH_INVALID_ARGUMENT;
932  if (!index) return ERROR_SUCCESS;
933 
934  for (i = 0; i < ARRAY_SIZE(counter_sources); i++)
935  {
936  if (counter_sources[i].index == index)
937  {
938  WCHAR *p = wcsrchr( counter_sources[i].path, '\\' ) + 1;
939  unsigned int required = lstrlenW( p ) + 1;
940 
941  if (*size < required) ret = PDH_MORE_DATA;
942  else
943  {
944  lstrcpyW( buffer, p );
945  ret = ERROR_SUCCESS;
946  }
947  *size = required;
948  return ret;
949  }
950  }
951  return PDH_INVALID_ARGUMENT;
952 }
#define ERROR_SUCCESS
Definition: deptool.c:10
static const struct source counter_sources[]
Definition: pdh_main.c:209
GLuint buffer
Definition: glext.h:5915
#define PDH_INVALID_ARGUMENT
Definition: pdhmsg.h:46
#define lstrlenW
Definition: compat.h:415
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
_Check_return_ _CRTIMP _CONST_RETURN wchar_t *__cdecl wcsrchr(_In_z_ const wchar_t *_Str, _In_ wchar_t _Ch)
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
#define PDH_CSTATUS_NO_MACHINE
Definition: pdhmsg.h:26
#define lstrcpyW
Definition: compat.h:414
#define ARRAY_SIZE(a)
Definition: main.h:24
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 1137 of file pdh_main.c.

1139 {
1142  WCHAR *bufferW;
1143  DWORD buflenW;
1144 
1145  TRACE("%p %p %p 0x%08x\n", e, buffer, buflen, flags);
1146 
1147  if (!e || !buflen) return PDH_INVALID_ARGUMENT;
1148 
1149  memset( &eW, 0, sizeof(eW) );
1150  if (e->szMachineName && !(eW.szMachineName = pdh_strdup_aw( e->szMachineName ))) goto done;
1151  if (e->szObjectName && !(eW.szObjectName = pdh_strdup_aw( e->szObjectName ))) goto done;
1152  if (e->szInstanceName && !(eW.szInstanceName = pdh_strdup_aw( e->szInstanceName ))) goto done;
1153  if (e->szParentInstance && !(eW.szParentInstance = pdh_strdup_aw( e->szParentInstance ))) goto done;
1154  if (e->szCounterName && !(eW.szCounterName = pdh_strdup_aw( e->szCounterName ))) goto done;
1155  eW.dwInstanceIndex = e->dwInstanceIndex;
1156 
1157  buflenW = 0;
1158  ret = PdhMakeCounterPathW( &eW, NULL, &buflenW, flags );
1159  if (ret == PDH_MORE_DATA)
1160  {
1161  if ((bufferW = heap_alloc( buflenW * sizeof(WCHAR) )))
1162  {
1163  if (!(ret = PdhMakeCounterPathW( &eW, bufferW, &buflenW, flags )))
1164  {
1165  int len = WideCharToMultiByte(CP_ACP, 0, bufferW, -1, NULL, 0, NULL, NULL);
1166  if (*buflen >= len) WideCharToMultiByte(CP_ACP, 0, bufferW, -1, buffer, *buflen, NULL, NULL);
1167  else ret = PDH_MORE_DATA;
1168  *buflen = len;
1169  }
1170  heap_free( bufferW );
1171  }
1172  else
1174  }
1175 
1176 done:
1177  heap_free( eW.szMachineName );
1178  heap_free( eW.szObjectName );
1179  heap_free( eW.szInstanceName );
1181  heap_free( eW.szCounterName );
1182  return ret;
1183 }
#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:63
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:1188
#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 1188 of file pdh_main.c.

1190 {
1191  static const WCHAR bslash[] = {'\\',0};
1192  static const WCHAR fslash[] = {'/',0};
1193  static const WCHAR lparen[] = {'(',0};
1194  static const WCHAR rparen[] = {')',0};
1195  static const WCHAR fmt[] = {'#','%','u',0};
1196 
1199  DWORD len;
1200 
1201  TRACE("%p %p %p 0x%08x\n", e, buffer, buflen, flags);
1202 
1203  if (flags) FIXME("unimplemented flags 0x%08x\n", flags);
1204 
1205  if (!e || !e->szCounterName || !e->szObjectName || !buflen)
1206  return PDH_INVALID_ARGUMENT;
1207 
1208  path[0] = 0;
1209  if (e->szMachineName)
1210  {
1211  lstrcatW(path, bslash);
1212  lstrcatW(path, bslash);
1213  lstrcatW(path, e->szMachineName);
1214  }
1215  lstrcatW(path, bslash);
1216  lstrcatW(path, e->szObjectName);
1217  if (e->szInstanceName)
1218  {
1219  lstrcatW(path, lparen);
1220  if (e->szParentInstance)
1221  {
1222  lstrcatW(path, e->szParentInstance);
1223  lstrcatW(path, fslash);
1224  }
1225  lstrcatW(path, e->szInstanceName);
1226  swprintf(instance, fmt, e->dwInstanceIndex);
1228  lstrcatW(path, rparen);
1229  }
1230  lstrcatW(path, bslash);
1231  lstrcatW(path, e->szCounterName);
1232 
1233  len = lstrlenW(path) + 1;
1234  if (*buflen >= len) lstrcpyW(buffer, path);
1235  else ret = PDH_MORE_DATA;
1236  *buflen = len;
1237  return ret;
1238 }
#define ERROR_SUCCESS
Definition: deptool.c:10
GLuint buffer
Definition: glext.h:5915
#define PDH_INVALID_ARGUMENT
Definition: pdhmsg.h:46
#define lstrlenW
Definition: compat.h:415
#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
#define swprintf(buf, format,...)
Definition: sprintf.c:56
unsigned long DWORD
Definition: ntddk_ex.h:95
GLbitfield flags
Definition: glext.h:7161
int ret
GLenum GLsizei len
Definition: glext.h:6722
#define lstrcpyW
Definition: compat.h:414
static HINSTANCE instance
Definition: main.c:40
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:274
#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 957 of file pdh_main.c.

958 {
959  PDH_STATUS ret;
960  WCHAR *sourceW = NULL;
961 
962  TRACE("%s %lx %p\n", debugstr_a(source), userdata, query);
963 
965 
966  ret = PdhOpenQueryW( sourceW, userdata, query );
967  heap_free( sourceW );
968 
969  return ret;
970 }
#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:63
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:975
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 975 of file pdh_main.c.

976 {
977  struct query *query;
978 
979  TRACE("%s %lx %p\n", debugstr_w(source), userdata, handle);
980 
981  if (!handle) return PDH_INVALID_ARGUMENT;
982 
983  if (source)
984  {
985  FIXME("log file data source not supported\n");
986  return PDH_INVALID_ARGUMENT;
987  }
988  if ((query = create_query()))
989  {
990  query->user = userdata;
991  *handle = query;
992 
993  return ERROR_SUCCESS;
994  }
996 }
#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:144
static struct query * create_query(void)
Definition: pdh_main.c:152
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 1001 of file pdh_main.c.

1002 {
1003  struct counter *counter = handle;
1004 
1005  TRACE("%p\n", handle);
1006 
1008  if (!counter || counter->magic != PDH_MAGIC_COUNTER)
1009  {
1011  return PDH_INVALID_HANDLE;
1012  }
1013 
1014  list_remove( &counter->entry );
1016 
1018  return ERROR_SUCCESS;
1019 }
DWORD magic
Definition: pdh_main.c:102
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:132
static CRITICAL_SECTION pdh_handle_cs
Definition: pdh_main.c:44
#define PDH_INVALID_HANDLE
Definition: pdhmsg.h:45
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
#define PDH_MAGIC_COUNTER
Definition: pdh_main.c:118
struct list entry
Definition: pdh_main.c:103

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

◆ PdhSetCounterScaleFactor()

PDH_STATUS WINAPI PdhSetCounterScaleFactor ( PDH_HCOUNTER  ,
LONG   
)

Definition at line 1024 of file pdh_main.c.

1025 {
1026  struct counter *counter = handle;
1027 
1028  TRACE("%p\n", handle);
1029 
1031  if (!counter || counter->magic != PDH_MAGIC_COUNTER)
1032  {
1034  return PDH_INVALID_HANDLE;
1035  }
1036  if (factor < PDH_MIN_SCALE || factor > PDH_MAX_SCALE)
1037  {
1039  return PDH_INVALID_ARGUMENT;
1040  }
1041 
1042  counter->scale = factor;
1043 
1045  return ERROR_SUCCESS;
1046 }
DWORD magic
Definition: pdh_main.c:102
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:44
#define PDH_INVALID_HANDLE
Definition: pdhmsg.h:45
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
LONG scale
Definition: pdh_main.c:107
#define PDH_MAGIC_COUNTER
Definition: pdh_main.c:118

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

◆ PdhSetDefaultRealTimeDataSource()

PDH_STATUS WINAPI PdhSetDefaultRealTimeDataSource ( DWORD  )

Definition at line 1271 of file pdh_main.c.

1272 {
1273  FIXME("%u\n", source);
1274  return ERROR_SUCCESS;
1275 }
#define ERROR_SUCCESS
Definition: deptool.c:10
#define FIXME(fmt,...)
Definition: debug.h:110

◆ PdhValidatePathA()

PDH_STATUS WINAPI PdhValidatePathA ( LPCSTR  )

Definition at line 1051 of file pdh_main.c.

1052 {
1053  PDH_STATUS ret;
1054  WCHAR *pathW;
1055 
1056  TRACE("%s\n", debugstr_a(path));
1057 
1058  if (!path) return PDH_INVALID_ARGUMENT;
1059  if (!(pathW = pdh_strdup_aw( path ))) return PDH_MEMORY_ALLOCATION_FAILURE;
1060 
1061  ret = PdhValidatePathW( pathW );
1062 
1063  heap_free( pathW );
1064  return ret;
1065 }
#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:63
int ret
PDH_STATUS WINAPI PdhValidatePathW(LPCWSTR path)
Definition: pdh_main.c:1077
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 1107 of file pdh_main.c.

1108 {
1109  TRACE("%p %s\n", source, debugstr_a(path));
1110 
1111  if (source)
1112  {
1113  FIXME("log file data source not supported\n");
1114  return ERROR_SUCCESS;
1115  }
1116  return PdhValidatePathA( path );
1117 }
#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
PDH_STATUS WINAPI PdhValidatePathA(LPCSTR path)
Definition: pdh_main.c:1051

Referenced by init_function_ptrs().

◆ PdhValidatePathExW()

PDH_STATUS WINAPI PdhValidatePathExW ( PDH_HLOG  ,
LPCWSTR   
)

Definition at line 1122 of file pdh_main.c.

1123 {
1124  TRACE("%p %s\n", source, debugstr_w(path));
1125 
1126  if (source)
1127  {
1128  FIXME("log file data source not supported\n");
1129  return ERROR_SUCCESS;
1130  }
1131  return PdhValidatePathW( path );
1132 }
#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
PDH_STATUS WINAPI PdhValidatePathW(LPCWSTR path)
Definition: pdh_main.c:1077

Referenced by init_function_ptrs().

◆ PdhValidatePathW()

PDH_STATUS WINAPI PdhValidatePathW ( LPCWSTR  )

Definition at line 1077 of file pdh_main.c.

1078 {
1079  PDH_STATUS ret;
1080  unsigned int i;
1081 
1082  TRACE("%s\n", debugstr_w(path));
1083 
1084  if ((ret = validate_path( path ))) return ret;
1085 
1086  for (i = 0; i < ARRAY_SIZE(counter_sources); i++)
1088 
1089  return PDH_CSTATUS_NO_COUNTER;
1090 }
#define ERROR_SUCCESS
Definition: deptool.c:10
static const struct source counter_sources[]
Definition: pdh_main.c:209
#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:225
#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:1067
#define ARRAY_SIZE(a)
Definition: main.h:24

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