|
|
1.1 ! root 1: /*++ BUILD Version: 0001 // Increment this if a change has global effects ! 2: ! 3: Copyright (c) 1992 Microsoft Corporation ! 4: ! 5: Module Name: ! 6: ! 7: perfutil.h ! 8: ! 9: Abstract: ! 10: ! 11: This file supports routines used to parse and ! 12: create Performance Monitor Data Structures. ! 13: It actually supports Performance Object types with ! 14: multiple instances ! 15: ! 16: Author: ! 17: ! 18: Russ Blake 7/30/92 ! 19: ! 20: Revision History: ! 21: ! 22: ! 23: --*/ ! 24: #ifndef _PERFUTIL_H_ ! 25: #define _PERFUTIL_H_ ! 26: ! 27: // enable this define to log process heap data to the event log ! 28: #ifdef PROBE_HEAP_USAGE ! 29: #undef PROBE_HEAP_USAGE ! 30: #endif ! 31: // ! 32: // Utility macro. This is used to reserve a DWORD multiple of ! 33: // bytes for Unicode strings embedded in the definitional data, ! 34: // viz., object instance names. ! 35: // ! 36: #define DWORD_MULTIPLE(x) (((x+sizeof(DWORD)-1)/sizeof(DWORD))*sizeof(DWORD)) ! 37: ! 38: // (assumes dword is 4 bytes long and pointer is a dword in size) ! 39: #define ALIGN_ON_DWORD(x) ((VOID *)( ((DWORD) x & 0x00000003) ? ( ((DWORD) x & 0xFFFFFFFC) + 4 ) : ( (DWORD) x ) )) ! 40: ! 41: extern WCHAR GLOBAL_STRING[]; // Global command (get all local ctrs) ! 42: extern WCHAR FOREIGN_STRING[]; // get data from foreign computers ! 43: extern WCHAR COSTLY_STRING[]; ! 44: extern WCHAR NULL_STRING[]; ! 45: ! 46: #define QUERY_GLOBAL 1 ! 47: #define QUERY_ITEMS 2 ! 48: #define QUERY_FOREIGN 3 ! 49: #define QUERY_COSTLY 4 ! 50: ! 51: // ! 52: // The definition of the only routine of perfutil.c, It builds part of a ! 53: // performance data instance (PERF_INSTANCE_DEFINITION) as described in ! 54: // winperf.h ! 55: // ! 56: ! 57: HANDLE MonOpenEventLog (); ! 58: VOID MonCloseEventLog (); ! 59: DWORD GetQueryType (IN LPWSTR); ! 60: BOOL IsNumberInUnicodeList (DWORD, LPWSTR); ! 61: ! 62: typedef struct _LOCAL_HEAP_INFO_BLOCK { ! 63: DWORD AllocatedEntries; ! 64: DWORD AllocatedBytes; ! 65: DWORD FreeEntries; ! 66: DWORD FreeBytes; ! 67: } LOCAL_HEAP_INFO, *PLOCAL_HEAP_INFO; ! 68: ! 69: ! 70: // ! 71: // Memory Probe macro ! 72: // ! 73: #ifdef PROBE_HEAP_USAGE ! 74: ! 75: #define HEAP_PROBE() { \ ! 76: DWORD dwHeapStatus[5]; \ ! 77: NTSTATUS CallStatus; \ ! 78: dwHeapStatus[4] = __LINE__; \ ! 79: if (!(CallStatus = memprobe (dwHeapStatus, 16L, NULL))) { \ ! 80: REPORT_INFORMATION_DATA (TCP_HEAP_STATUS, LOG_DEBUG, \ ! 81: &dwHeapStatus, sizeof(dwHeapStatus)); \ ! 82: } else { \ ! 83: REPORT_ERROR_DATA (TCP_HEAP_STATUS_ERROR, LOG_DEBUG, \ ! 84: &CallStatus, sizeof (DWORD)); \ ! 85: } \ ! 86: } ! 87: ! 88: #else ! 89: ! 90: #define HEAP_PROBE() ; ! 91: ! 92: #endif ! 93: ! 94: #endif //_PERFUTIL_H_ ! 95:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.