test: perfutil.h Source File

Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

# perfutil.h

Go to the documentation of this file.

    00001 /*++ BUILD Version: 0001
    00002
    00003 Copyright (c) 1985 - 1999, Microsoft Corporation
    00004
    00005 Module Name:    perfutil.h
    00006
    00007 Abstract:
    00008
    00009     This file supports routines used to parse and create Performance Monitor Data
    00010     Structures. It actually supports Performance Object types with multiple instances
    00011
    00012 Revision History:
    00013     Sept 97 Borrowed from the SDK samples and slightly modified
    00014
    00015 --*/
    00016
    00017 #ifndef _PERFUTIL_H_
    00018 #define _PERFUTIL_H_
    00019
    00020 //
    00021 //  Utility macro.  This is used to reserve a DWORD multiple of bytes for Unicode strings
    00022 //  embedded in the definitional data, viz., object instance names.
    00023 //
    00024
    00025 #define DWORD_MULTIPLE(x) (((x+sizeof(DWORD)-1)/sizeof(DWORD))*sizeof(DWORD))
    00026
    00027 //    (assumes dword is 4 bytes long and pointer is a dword in size)
    00028
    00029 #define ALIGN_ON_DWORD(x) ((VOID *)( ((DWORD) x & 0x00000003) ? ( ((DWORD) x & 0xFFFFFFFC) + 4 ) : ( (DWORD) x ) ))
    00030
    00031 extern WCHAR  GLOBAL_STRING[];          // Global command (get all local ctrs)
    00032 extern WCHAR  FOREIGN_STRING[];         // get data from foreign computers
    00033 extern WCHAR  COSTLY_STRING[];
    00034 extern WCHAR  NULL_STRING[];
    00035
    00036 #define QUERY_GLOBAL    1
    00037 #define QUERY_ITEMS     2
    00038 #define QUERY_FOREIGN   3
    00039 #define QUERY_COSTLY    4
    00040
    00041 //
    00042 // The definition of the only routine of perfutil.c, It builds part of a performance data
    00043 // instance (PERF_INSTANCE_DEFINITION) as described in winperf.h
    00044 //
    00045
    00046 HANDLE  MonOpenEventLog ();
    00047 VOID    MonCloseEventLog ();
    00048 DWORD   GetQueryType (IN LPWSTR);
    00049
    00050 //
    00051 // To Do:
    00052 // Add a flag like this for additional objects added.
    00053 // Used by IsNumberInUnicodeListand Collect.
    00054 //
    00055
    00056 // special value: query all counters but the counter values doesn't matter
    00057 #define     QUERY_NOCOUNTERS  0x0001
    00058 #define     QUERY_USER        0x0002
    00059 #define     QUERY_CS          0x0004
    00060 DWORD   IsNumberInUnicodeList (LPWSTR);
    00061
    00062 #define ALLOC(size)      HeapAlloc (GetProcessHeap(), 0, size)
    00063 #define ALLOCZERO(size)  HeapAlloc (GetProcessHeap(), HEAP_ZERO_MEMORY, size)
    00064 #define REALLOC(pointer, newsize) \
    00065                          HeapReAlloc (GetProcessHeap(), 0, pointer, newsize)
    00066 #define FREE(pointer)    HeapFree (GetProcessHeap(), 0, pointer)
    00067
    00068 #endif  //_PERFUTIL_H_