vbscript: Fix memory leak in owned safearray iterator.
[wine.git] / include / perflib.h
blob232ac308fce190a84754582a90f8ad472ccb21e5
1 /*
2 * Copyright (C) 2017 Austin English
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 #ifndef _PERFLIB_H_
20 #define _PERFLIB_H_
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
26 typedef LPVOID (CDECL * PERF_MEM_ALLOC)(SIZE_T,LPVOID);
27 typedef void (CDECL * PERF_MEM_FREE)(LPVOID,LPVOID);
28 typedef ULONG (WINAPI * PERFLIBREQUEST)(ULONG,PVOID,ULONG);
30 typedef struct _PERF_COUNTERSET_INFO {
31 GUID CounterSetGuid;
32 GUID ProviderGuid;
33 ULONG NumCounters;
34 ULONG InstanceType;
35 } PERF_COUNTERSET_INFO, * PPERF_COUNTERSET_INFO;
37 /* PERF_COUNTERSET_INFO InstanceType values. */
38 #define PERF_COUNTERSET_FLAG_MULTIPLE 0x00000002
39 #define PERF_COUNTERSET_FLAG_AGGREGATE 0x00000004
40 #define PERF_COUNTERSET_FLAG_HISTORY 0x00000008
41 #define PERF_COUNTERSET_FLAG_INSTANCE 0x00000010
43 #define PERF_COUNTERSET_SINGLE_INSTANCE 0
44 #define PERF_COUNTERSET_MULTI_INSTANCES PERF_COUNTERSET_FLAG_MULTIPLE
45 #define PERF_COUNTERSET_SINGLE_AGGREGATE PERF_COUNTERSET_FLAG_AGGREGATE
46 #define PERF_COUNTERSET_MULTI_AGGREGATE (PERF_COUNTERSET_FLAG_AGGREGATE | PERF_COUNTERSET_FLAG_MULTIPLE)
47 #define PERF_COUNTERSET_SINGLE_AGGREGATE_HISTORY (PERF_COUNTERSET_FLAG_HISTORY | PERF_COUNTERSET_SINGLE_AGGREGATE)
48 #define PERF_COUNTERSET_INSTANCE_AGGREGATE (PERF_COUNTERSET_MULTI_AGGREGATE | PERF_COUNTERSET_FLAG_INSTANCE)
50 typedef struct _PERF_COUNTERSET_INSTANCE {
51 GUID CounterSetGuid;
52 ULONG dwSize;
53 ULONG InstanceId;
54 ULONG InstanceNameOffset;
55 ULONG InstanceNameSize;
56 } PERF_COUNTERSET_INSTANCE, * PPERF_COUNTERSET_INSTANCE;
58 typedef struct _PERF_COUNTER_INFO {
59 ULONG CounterId;
60 ULONG Type;
61 ULONGLONG Attrib;
62 ULONG Size;
63 ULONG DetailLevel;
64 LONG Scale;
65 ULONG Offset;
66 } PERF_COUNTER_INFO, *PPERF_COUNTER_INFO;
68 /* PERF_COUNTER_INFO Attrib flags. */
69 #define PERF_ATTRIB_BY_REFERENCE 0x00000001
70 #define PERF_ATTRIB_NO_DISPLAYABLE 0x00000002
71 #define PERF_ATTRIB_NO_GROUP_SEPARATOR 0x00000004
72 #define PERF_ATTRIB_DISPLAY_AS_REAL 0x00000008
73 #define PERF_ATTRIB_DISPLAY_AS_HEX 0x00000010
75 typedef struct _PROVIDER_CONTEXT {
76 DWORD ContextSize;
77 DWORD Reserved;
78 PERFLIBREQUEST ControlCallback;
79 PERF_MEM_ALLOC MemAllocRoutine;
80 PERF_MEM_FREE MemFreeRoutine;
81 LPVOID pMemContext;
82 } PERF_PROVIDER_CONTEXT, * PPERF_PROVIDER_CONTEXT;
84 typedef struct _PERF_COUNTER_IDENTIFIER {
85 GUID CounterSetGuid;
86 ULONG Status;
87 ULONG Size;
88 ULONG CounterId;
89 ULONG InstanceId;
90 ULONG Index;
91 ULONG Reserved;
92 } PERF_COUNTER_IDENTIFIER, *PPERF_COUNTER_IDENTIFIER;
94 #define PERF_WILDCARD_COUNTER 0xFFFFFFFF
95 #define PERF_WILDCARD_INSTANCE L"*"
97 typedef struct _PERF_DATA_HEADER {
98 ULONG dwTotalSize;
99 ULONG dwNumCounters;
100 LONGLONG PerfTimeStamp;
101 LONGLONG PerfTime100NSec;
102 LONGLONG PerfFreq;
103 SYSTEMTIME SystemTime;
104 } PERF_DATA_HEADER, *PPERF_DATA_HEADER;
106 PERF_COUNTERSET_INSTANCE WINAPI *PerfCreateInstance(HANDLE, const GUID *, const WCHAR *, ULONG);
107 ULONG WINAPI PerfDeleteInstance(HANDLE, PERF_COUNTERSET_INSTANCE *);
108 ULONG WINAPI PerfSetCounterRefValue(HANDLE, PERF_COUNTERSET_INSTANCE *, ULONG, void *);
109 ULONG WINAPI PerfSetCounterSetInfo(HANDLE, PERF_COUNTERSET_INFO *, ULONG);
110 ULONG WINAPI PerfStartProvider(GUID *, PERFLIBREQUEST, HANDLE *);
111 ULONG WINAPI PerfStartProviderEx(GUID *, PERF_PROVIDER_CONTEXT *, HANDLE *);
112 ULONG WINAPI PerfStopProvider(HANDLE);
114 ULONG WINAPI PerfAddCounters(HANDLE, PERF_COUNTER_IDENTIFIER *, DWORD);
115 ULONG WINAPI PerfCloseQueryHandle(HANDLE);
116 ULONG WINAPI PerfOpenQueryHandle(const WCHAR *, HANDLE *);
117 ULONG WINAPI PerfQueryCounterData(HANDLE, PERF_DATA_HEADER *, DWORD, DWORD *);
119 #ifdef __cplusplus
120 } /* extern "C" */
121 #endif
123 #endif /* _PERFLIB_H_ */