winperf.h 4.64 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
/*
 * Performance Monitor
 *
 * Copyright 2007 Hans Leidekker
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
 */

#ifndef _WINPERF_
#define _WINPERF_

#define PERF_SIZE_DWORD         0x00000000
#define PERF_SIZE_LARGE         0x00000100
#define PERF_SIZE_ZERO          0x00000200
#define PERF_SIZE_VARIABLE_LEN  0x00000300

#define PERF_TYPE_NUMBER        0x00000000
#define PERF_TYPE_COUNTER       0x00000400
#define PERF_TYPE_TEXT          0x00000800
#define PERF_TYPE_ZERO          0x00000C00

#define PERF_NUMBER_HEX         0x00000000
#define PERF_NUMBER_DECIMAL     0x00010000
#define PERF_NUMBER_DEC_1000    0x00020000

#define PERF_COUNTER_VALUE      0x00000000
#define PERF_COUNTER_RATE       0x00010000
#define PERF_COUNTER_FRACTION   0x00020000
#define PERF_COUNTER_BASE       0x00030000
#define PERF_COUNTER_ELAPSED    0x00040000
#define PERF_COUNTER_QUEUELEN   0x00050000
#define PERF_COUNTER_HISTOGRAM  0x00060000
#define PERF_COUNTER_PRECISION  0x00070000

#define PERF_TEXT_UNICODE       0x00000000
#define PERF_TEXT_ASCII         0x00010000

#define PERF_TIMER_TICK         0x00000000
#define PERF_TIMER_100NS        0x00100000
#define PERF_OBJECT_TIMER       0x00200000

#define PERF_DELTA_COUNTER      0x00400000
#define PERF_DELTA_BASE         0x00800000
#define PERF_INVERSE_COUNTER    0x01000000
#define PERF_MULTI_COUNTER      0x02000000

#define PERF_DISPLAY_NO_SUFFIX  0x00000000
#define PERF_DISPLAY_PER_SEC    0x10000000
#define PERF_DISPLAY_PERCENT    0x20000000
#define PERF_DISPLAY_SECONDS    0x30000000
#define PERF_DISPLAY_NOSHOW     0x40000000

65 66 67 68 69
#define PERF_DETAIL_NOVICE      100
#define PERF_DETAIL_ADVANCED    200
#define PERF_DETAIL_EXPERT      300
#define PERF_DETAIL_WIZARD      400

70 71
#include <pshpack8.h>

72 73 74 75
/* Performance data structure header
 * returned in answer to HKEY_PERFORMANCE_DATA request
 */

76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170
#define PERF_DATA_VERSION 1
#define PERF_DATA_REVISION 1

typedef struct _PERF_DATA_BLOCK
{
    WCHAR Signature[4];
    DWORD LittleEndian;
    DWORD Version;
    DWORD Revision;
    DWORD TotalByteLength;
    DWORD HeaderLength;
    DWORD NumObjectTypes;
    DWORD DefaultObject;
    SYSTEMTIME SystemTime;
    LARGE_INTEGER PerfTime;
    LARGE_INTEGER PerfFreq;
    LARGE_INTEGER PerfTime100nSec;
    DWORD SystemNameLength;
    DWORD SystemNameOffset;
} PERF_DATA_BLOCK, *PPERF_DATA_BLOCK;

#define PERF_NO_INSTANCES -1

typedef struct _PERF_OBJECT_TYPE
{
    DWORD TotalByteLength;
    DWORD DefinitionLength;
    DWORD HeaderLength;
    DWORD ObjectNameTitleIndex;
#ifdef _WIN64
    DWORD ObjectNameTitle;
#else
    LPWSTR ObjectNameTitle;
#endif
    DWORD ObjectHelpTitleIndex;
#ifdef _WIN64
    DWORD ObjectHelpTitle;
#else
    LPWSTR ObjectHelpTitle;
#endif
    DWORD DetailLevel;
    DWORD NumCounters;
    LONG DefaultCounter;
    LONG NumInstances;
    DWORD CodePage;
    LARGE_INTEGER PerfTime;
    LARGE_INTEGER PerfFreq;
} PERF_OBJECT_TYPE, *PPERF_OBJECT_TYPE;

typedef struct _PERF_COUNTER_DEFINITION
{
    DWORD ByteLength;
    DWORD CounterNameTitleIndex;
#ifdef _WIN64
    DWORD CounterNameTitle;
#else
    LPWSTR CounterNameTitle;
#endif
    DWORD CounterHelpTitleIndex;
#ifdef _WIN64
    DWORD CounterHelpTitle;
#else
    LPWSTR CounterHelpTitle;
#endif
    LONG DefaultScale;
    DWORD DetailLevel;
    DWORD CounterType;
    DWORD CounterSize;
    DWORD CounterOffset;
} PERF_COUNTER_DEFINITION, *PPERF_COUNTER_DEFINITION;

#define PERF_NO_UNIQUE_ID -1

typedef struct _PERF_INSTANCE_DEFINITION
{
    DWORD ByteLength;
    DWORD ParentObjectTitleIndex;
    DWORD ParentObjectInstance;
    LONG UniqueID;
    DWORD NameOffset;
    DWORD NameLength;
} PERF_INSTANCE_DEFINITION, *PPERF_INSTANCE_DEFINITION;

typedef struct _PERF_COUNTER_BLOCK
{
    DWORD ByteLength;
} PERF_COUNTER_BLOCK, *PPERF_COUNTER_BLOCK;


#include <poppack.h>

typedef DWORD (APIENTRY PM_OPEN_PROC)(LPWSTR);
typedef DWORD (APIENTRY PM_COLLECT_PROC)(LPWSTR,LPVOID *,LPDWORD,LPDWORD);
typedef DWORD (APIENTRY PM_CLOSE_PROC)(void);
typedef DWORD (APIENTRY PM_QUERY_PROC)(LPDWORD,LPVOID *,LPDWORD,LPDWORD);
171

172
#endif /* _WINPERF_ */