#include <winapifamily.h>
#ifndef _WINPERF_
#define _WINPERF_
#if _MSC_VER > 1000
#pragma once
#endif
#if _MSC_VER >= 1200
#pragma warning(push)
#pragma warning(disable:4820) // padding added after data member
#endif
#pragma warning(disable:
4820
)
#pragma region Desktop Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
#include <pshpack8.h>
#define PERF_DATA_VERSION 1
#define PERF_DATA_REVISION 1
typedef
struct
{
[
4
];
;
;
;
;
;
;
;
;
;
;
;
;
;
}
, *
;
typedef
struct
{
;
;
;
;
#ifdef _WIN64
DWORD ObjectNameTitle; // Should use this as an offset
#else
;
#endif
;
#ifdef _WIN64
DWORD ObjectHelpTitle; // Should use this as an offset
#else
;
#endif
;
;
;
;
;
;
;
}
, *
;
#define PERF_NO_INSTANCES -1 // no instances (see NumInstances above)
#define PERF_SIZE_DWORD 0x00000000 // 32 bit field
#define PERF_SIZE_LARGE 0x00000100 // 64 bit field
#define PERF_SIZE_ZERO 0x00000200 // for Zero Length fields
#define PERF_SIZE_VARIABLE_LEN 0x00000300 // length is in CounterLength field
#define PERF_TYPE_NUMBER 0x00000000 // a number (not a counter)
#define PERF_TYPE_COUNTER 0x00000400 // an increasing numeric value
#define PERF_TYPE_TEXT 0x00000800 // a text field
#define PERF_TYPE_ZERO 0x00000C00 // displays a zero
#define PERF_NUMBER_HEX 0x00000000 // display as HEX value
#define PERF_NUMBER_DECIMAL 0x00010000 // display as a decimal integer
#define PERF_NUMBER_DEC_1000 0x00020000 // display as a decimal/1000
#define PERF_COUNTER_VALUE 0x00000000 // display counter value
#define PERF_COUNTER_RATE 0x00010000 // divide ctr / delta time
#define PERF_COUNTER_FRACTION 0x00020000 // divide ctr / base
#define PERF_COUNTER_BASE 0x00030000 // base value used in fractions
#define PERF_COUNTER_ELAPSED 0x00040000 // subtract counter from current time
#define PERF_COUNTER_QUEUELEN 0x00050000 // Use Queuelen processing func.
#define PERF_COUNTER_HISTOGRAM 0x00060000 // Counter begins or ends a histogram
#define PERF_COUNTER_PRECISION 0x00070000 // divide ctr / private clock
#define PERF_TEXT_UNICODE 0x00000000 // type of text in text field
#define PERF_TEXT_ASCII 0x00010000 // ASCII using the CodePage field
#define PERF_TIMER_TICK 0x00000000 // use system perf. freq for base
#define PERF_TIMER_100NS 0x00100000 // use 100 NS timer time base units
#define PERF_OBJECT_TIMER 0x00200000 // use the object timer freq
#define PERF_DELTA_COUNTER 0x00400000 // compute difference first
#define PERF_DELTA_BASE 0x00800000 // compute base diff as well
#define PERF_INVERSE_COUNTER 0x01000000 // show as 1.00-value (assumes:
#define PERF_MULTI_COUNTER 0x02000000 // sum of multiple instances
#define PERF_DISPLAY_NO_SUFFIX 0x00000000 // no suffix
#define PERF_DISPLAY_PER_SEC 0x10000000 // "/sec"
#define PERF_DISPLAY_PERCENT 0x20000000 // "%"
#define PERF_DISPLAY_SECONDS 0x30000000 // "secs"
#define PERF_DISPLAY_NOSHOW 0x40000000 // value is not displayed
#define PERF_COUNTER_COUNTER \
(PERF_SIZE_DWORD | PERF_TYPE_COUNTER | PERF_COUNTER_RATE |\
PERF_TIMER_TICK | PERF_DELTA_COUNTER | PERF_DISPLAY_PER_SEC)
#define PERF_COUNTER_TIMER \
(PERF_SIZE_LARGE | PERF_TYPE_COUNTER | PERF_COUNTER_RATE |\
PERF_TIMER_TICK | PERF_DELTA_COUNTER | PERF_DISPLAY_PERCENT)
#define PERF_COUNTER_QUEUELEN_TYPE \
(PERF_SIZE_DWORD | PERF_TYPE_COUNTER | PERF_COUNTER_QUEUELEN |\
PERF_TIMER_TICK | PERF_DELTA_COUNTER | PERF_DISPLAY_NO_SUFFIX)
#define PERF_COUNTER_LARGE_QUEUELEN_TYPE \
(PERF_SIZE_LARGE | PERF_TYPE_COUNTER | PERF_COUNTER_QUEUELEN |\
PERF_TIMER_TICK | PERF_DELTA_COUNTER | PERF_DISPLAY_NO_SUFFIX)
#define PERF_COUNTER_100NS_QUEUELEN_TYPE \
(PERF_SIZE_LARGE | PERF_TYPE_COUNTER | PERF_COUNTER_QUEUELEN |\
PERF_TIMER_100NS | PERF_DELTA_COUNTER | PERF_DISPLAY_NO_SUFFIX)
#define PERF_COUNTER_OBJ_TIME_QUEUELEN_TYPE \
(PERF_SIZE_LARGE | PERF_TYPE_COUNTER | PERF_COUNTER_QUEUELEN |\
PERF_OBJECT_TIMER | PERF_DELTA_COUNTER | PERF_DISPLAY_NO_SUFFIX)
#define PERF_COUNTER_BULK_COUNT \
(PERF_SIZE_LARGE | PERF_TYPE_COUNTER | PERF_COUNTER_RATE |\
PERF_TIMER_TICK | PERF_DELTA_COUNTER | PERF_DISPLAY_PER_SEC)
#define PERF_COUNTER_TEXT \
(PERF_SIZE_VARIABLE_LEN | PERF_TYPE_TEXT | PERF_TEXT_UNICODE |\
PERF_DISPLAY_NO_SUFFIX)
#define PERF_COUNTER_RAWCOUNT \
(PERF_SIZE_DWORD | PERF_TYPE_NUMBER | PERF_NUMBER_DECIMAL |\
PERF_DISPLAY_NO_SUFFIX)
#define PERF_COUNTER_LARGE_RAWCOUNT \
(PERF_SIZE_LARGE | PERF_TYPE_NUMBER | PERF_NUMBER_DECIMAL |\
PERF_DISPLAY_NO_SUFFIX)
#define PERF_COUNTER_RAWCOUNT_HEX \
(PERF_SIZE_DWORD | PERF_TYPE_NUMBER | PERF_NUMBER_HEX |\
PERF_DISPLAY_NO_SUFFIX)
#define PERF_COUNTER_LARGE_RAWCOUNT_HEX \
(PERF_SIZE_LARGE | PERF_TYPE_NUMBER | PERF_NUMBER_HEX |\
PERF_DISPLAY_NO_SUFFIX)
#define PERF_SAMPLE_FRACTION \
(PERF_SIZE_DWORD | PERF_TYPE_COUNTER | PERF_COUNTER_FRACTION |\
PERF_DELTA_COUNTER | PERF_DELTA_BASE | PERF_DISPLAY_PERCENT)
#define PERF_SAMPLE_COUNTER \
(PERF_SIZE_DWORD | PERF_TYPE_COUNTER | PERF_COUNTER_RATE |\
PERF_TIMER_TICK | PERF_DELTA_COUNTER | PERF_DISPLAY_NO_SUFFIX)
#define PERF_COUNTER_NODATA \
(PERF_SIZE_ZERO | PERF_DISPLAY_NOSHOW)
#define PERF_COUNTER_TIMER_INV \
(PERF_SIZE_LARGE | PERF_TYPE_COUNTER | PERF_COUNTER_RATE |\
PERF_TIMER_TICK | PERF_DELTA_COUNTER | PERF_INVERSE_COUNTER | \
PERF_DISPLAY_PERCENT)
#define PERF_SAMPLE_BASE \
(PERF_SIZE_DWORD | PERF_TYPE_COUNTER | PERF_COUNTER_BASE |\
PERF_DISPLAY_NOSHOW |\
0x00000001) // for compatibility with pre-beta versions
#define PERF_AVERAGE_TIMER \
(PERF_SIZE_DWORD | PERF_TYPE_COUNTER | PERF_COUNTER_FRACTION |\
PERF_DISPLAY_SECONDS)
#define PERF_AVERAGE_BASE \
(PERF_SIZE_DWORD | PERF_TYPE_COUNTER | PERF_COUNTER_BASE |\
PERF_DISPLAY_NOSHOW |\
0x00000002) // for compatibility with pre-beta versions
#define PERF_AVERAGE_BULK \
(PERF_SIZE_LARGE | PERF_TYPE_COUNTER | PERF_COUNTER_FRACTION |\
PERF_DISPLAY_NOSHOW)
#define PERF_OBJ_TIME_TIMER \
(PERF_SIZE_LARGE | PERF_TYPE_COUNTER | PERF_COUNTER_RATE |\
PERF_OBJECT_TIMER | PERF_DELTA_COUNTER | PERF_DISPLAY_PERCENT)
#define PERF_100NSEC_TIMER \
(PERF_SIZE_LARGE | PERF_TYPE_COUNTER | PERF_COUNTER_RATE |\
PERF_TIMER_100NS | PERF_DELTA_COUNTER | PERF_DISPLAY_PERCENT)
#define PERF_100NSEC_TIMER_INV \
(PERF_SIZE_LARGE | PERF_TYPE_COUNTER | PERF_COUNTER_RATE |\
PERF_TIMER_100NS | PERF_DELTA_COUNTER | PERF_INVERSE_COUNTER |\
PERF_DISPLAY_PERCENT)
#define PERF_COUNTER_MULTI_TIMER \
(PERF_SIZE_LARGE | PERF_TYPE_COUNTER | PERF_COUNTER_RATE |\
PERF_DELTA_COUNTER | PERF_TIMER_TICK | PERF_MULTI_COUNTER |\
PERF_DISPLAY_PERCENT)
#define PERF_COUNTER_MULTI_TIMER_INV \
(PERF_SIZE_LARGE | PERF_TYPE_COUNTER | PERF_COUNTER_RATE |\
PERF_DELTA_COUNTER | PERF_MULTI_COUNTER | PERF_TIMER_TICK |\
PERF_INVERSE_COUNTER | PERF_DISPLAY_PERCENT)
#define PERF_COUNTER_MULTI_BASE \
(PERF_SIZE_LARGE | PERF_TYPE_COUNTER | PERF_COUNTER_BASE |\
PERF_MULTI_COUNTER | PERF_DISPLAY_NOSHOW)
#define PERF_100NSEC_MULTI_TIMER \
(PERF_SIZE_LARGE | PERF_TYPE_COUNTER | PERF_DELTA_COUNTER |\
PERF_COUNTER_RATE | PERF_TIMER_100NS | PERF_MULTI_COUNTER |\
PERF_DISPLAY_PERCENT)
#define PERF_100NSEC_MULTI_TIMER_INV \
(PERF_SIZE_LARGE | PERF_TYPE_COUNTER | PERF_DELTA_COUNTER |\
PERF_COUNTER_RATE | PERF_TIMER_100NS | PERF_MULTI_COUNTER |\
PERF_INVERSE_COUNTER | PERF_DISPLAY_PERCENT)
#define PERF_RAW_FRACTION \
(PERF_SIZE_DWORD | PERF_TYPE_COUNTER | PERF_COUNTER_FRACTION |\
PERF_DISPLAY_PERCENT)
#define PERF_LARGE_RAW_FRACTION \
(PERF_SIZE_LARGE | PERF_TYPE_COUNTER | PERF_COUNTER_FRACTION |\
PERF_DISPLAY_PERCENT)
#define PERF_RAW_BASE \
(PERF_SIZE_DWORD | PERF_TYPE_COUNTER | PERF_COUNTER_BASE |\
PERF_DISPLAY_NOSHOW |\
0x00000003) // for compatibility with pre-beta versions
#define PERF_LARGE_RAW_BASE \
(PERF_SIZE_LARGE | PERF_TYPE_COUNTER | PERF_COUNTER_BASE |\
PERF_DISPLAY_NOSHOW )
#define PERF_ELAPSED_TIME \
(PERF_SIZE_LARGE | PERF_TYPE_COUNTER | PERF_COUNTER_ELAPSED |\
PERF_OBJECT_TIMER | PERF_DISPLAY_SECONDS)
#define PERF_COUNTER_HISTOGRAM_TYPE 0x80000000
#define PERF_COUNTER_DELTA \
(PERF_SIZE_DWORD | PERF_TYPE_COUNTER | PERF_COUNTER_VALUE |\
PERF_DELTA_COUNTER | PERF_DISPLAY_NO_SUFFIX)
#define PERF_COUNTER_LARGE_DELTA \
(PERF_SIZE_LARGE | PERF_TYPE_COUNTER | PERF_COUNTER_VALUE |\
PERF_DELTA_COUNTER | PERF_DISPLAY_NO_SUFFIX)
#define PERF_PRECISION_SYSTEM_TIMER \
(PERF_SIZE_LARGE | PERF_TYPE_COUNTER | PERF_COUNTER_PRECISION | \
PERF_TIMER_TICK | PERF_DELTA_COUNTER | PERF_DISPLAY_PERCENT )
#define PERF_PRECISION_100NS_TIMER \
(PERF_SIZE_LARGE | PERF_TYPE_COUNTER | PERF_COUNTER_PRECISION | \
PERF_TIMER_100NS | PERF_DELTA_COUNTER | PERF_DISPLAY_PERCENT )
#define PERF_PRECISION_OBJECT_TIMER \
(PERF_SIZE_LARGE | PERF_TYPE_COUNTER | PERF_COUNTER_PRECISION | \
PERF_OBJECT_TIMER | PERF_DELTA_COUNTER | PERF_DISPLAY_PERCENT )
#define PERF_PRECISION_TIMESTAMP PERF_LARGE_RAW_BASE
#define PERF_DETAIL_NOVICE 100 // The uninformed can understand it
#define PERF_DETAIL_ADVANCED 200 // For the advanced user
#define PERF_DETAIL_EXPERT 300 // For the expert user
#define PERF_DETAIL_WIZARD 400 // For the system designer
typedef
struct
{
;
;
#ifdef _WIN64
DWORD CounterNameTitle;
#else
;
#endif
;
#ifdef _WIN64
DWORD CounterHelpTitle;
#else
;
#endif
;
;
;
;
;
}
, *
;
#define PERF_NO_UNIQUE_ID -1
typedef
struct
_PERF_INSTANCE_DEFINITION
{
;
;
;
;
;
;
}
, *
PPERF_INSTANCE_DEFINITION
;
typedef
struct
{
;
}
, *
;
#define PERF_QUERY_OBJECTS ((LONG)0x80000000)
#define PERF_QUERY_GLOBAL ((LONG)0x80000001)
#define PERF_QUERY_COSTLY ((LONG)0x80000002)
typedef DWORD (APIENTRY PM_OPEN_PROC) (_In_opt_ LPWSTR);
typedef
(
__stdcall
) (
);
typedef DWORD (APIENTRY PM_COLLECT_PROC) (_In_opt_ LPWSTR lpValueName,
typedef
(
__stdcall
) (
lpValueName,
_Inout_
_At_(*lppData, _Pre_writable_byte_size_(*lpcbTotalBytes) _Post_writable_byte_size_(*lpcbTotalBytes))
_At_(_Old_(*lppData), _Post_writable_byte_size_(*lpcbTotalBytes))
*lppData,
_Inout_ LPDWORD lpcbTotalBytes,
_Inout_ LPDWORD lpNumObjectTypes);
typedef DWORD (APIENTRY PM_CLOSE_PROC) (void);
typedef
(
__stdcall
) (
void
);
typedef DWORD (APIENTRY PM_QUERY_PROC) (LPDWORD, LPVOID *, LPDWORD, LPDWORD);
typedef
(
__stdcall
) (
,
*,
,
);
#if ((defined(_WIN32_WINDOWS) && _WIN32_WINDOWS >= 0x0501) || _WIN32_WINNT >= 0x0501 || (defined(NTDDI_VERSION) && NTDDI_VERSION >= NTDDI_WINXP))
#define MAX_PERF_OBJECTS_IN_QUERY_FUNCTION (64L)
#define WINPERF_LOG_NONE 0 // No event reported
#define WINPERF_LOG_USER 1 // Report only errors
#define WINPERF_LOG_DEBUG 2 // Report debug errors as well
#define WINPERF_LOG_VERBOSE 3 // Report everything
#else
#define MAX_PERF_OBJECTS_IN_QUERY_FUNCTION (8L)
#endif
#include <poppack.h>
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
#pragma endregion
#if _MSC_VER >= 1200
#pragma warning(pop)
#endif
#endif // _WINPERF_