Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

193 lines
5.0 KiB

  1. /*++ BUILD Version: 0001 // Increment this if a change has global effects
  2. Copyright (c) 1992 Microsoft Corporation
  3. Module Name:
  4. datatapi.h
  5. Abstract:
  6. Header file for the TAPI Extensible Object data definitions
  7. This file contains definitions to construct the dynamic data
  8. which is returned by the Configuration Registry. Data from
  9. various driver API calls is placed into the structures shown
  10. here.
  11. --*/
  12. #ifndef _TAPIPERF_H_
  13. #define _TAPIPERF_H_
  14. #include <winperf.h>
  15. //
  16. // The routines that load these structures assume that all fields
  17. // are packed and aligned on DWORD boundaries. Alpha support may
  18. // change this assumption so the pack pragma is used here to insure
  19. // the DWORD packing assumption remains valid.
  20. //
  21. #pragma pack (4)
  22. //
  23. // Extensible Object definitions
  24. //
  25. // Update the following sort of define when adding an object type.
  26. #define TAPI_NUM_PERF_OBJECT_TYPES 1
  27. //
  28. // TAPI Resource object type counter definitions.
  29. //
  30. // These are used in the counter definitions to describe the relative
  31. // position of each counter in the returned data.
  32. #define LINES_OFFSET sizeof(DWORD)
  33. #define PHONES_OFFSET LINES_OFFSET + sizeof(DWORD)
  34. #define LINESINUSE_OFFSET PHONES_OFFSET + sizeof(DWORD)
  35. #define PHONESINUSE_OFFSET LINESINUSE_OFFSET + sizeof(DWORD)
  36. #define TOTALOUTGOINGCALLS_OFFSET PHONESINUSE_OFFSET + sizeof(DWORD)
  37. #define TOTALINCOMINGCALLS_OFFSET TOTALOUTGOINGCALLS_OFFSET + sizeof(DWORD)
  38. #define CLIENTAPPS_OFFSET TOTALINCOMINGCALLS_OFFSET + sizeof(DWORD)
  39. #define ACTIVEOUTGOINGCALLS_OFFSET CLIENTAPPS_OFFSET + sizeof(DWORD)
  40. #define ACTIVEINCOMINGCALLS_OFFSET ACTIVEOUTGOINGCALLS_OFFSET + sizeof(DWORD)
  41. //#define SIZE_OF_TAPI_PERFORMANCE_DATA 32
  42. #define SIZE_OF_TAPI_PERFORMANCE_DATA 40
  43. //
  44. // This is the counter structure presently returned by TAPI.
  45. //
  46. typedef struct _TAPI_DATA_DEFINITION
  47. {
  48. PERF_OBJECT_TYPE TapiObjectType;
  49. PERF_COUNTER_DEFINITION Lines;
  50. PERF_COUNTER_DEFINITION Phones;
  51. PERF_COUNTER_DEFINITION LinesInUse;
  52. PERF_COUNTER_DEFINITION PhonesInUse;
  53. PERF_COUNTER_DEFINITION TotalOutgoingCalls;
  54. PERF_COUNTER_DEFINITION TotalIncomingCalls;
  55. PERF_COUNTER_DEFINITION ClientApps;
  56. PERF_COUNTER_DEFINITION CurrentOutgoingCalls;
  57. PERF_COUNTER_DEFINITION CurrentIncomingCalls;
  58. } TAPI_DATA_DEFINITION;
  59. typedef struct tagPERFBLOCK
  60. {
  61. DWORD dwSize;
  62. DWORD dwLines;
  63. DWORD dwPhones;
  64. DWORD dwLinesInUse;
  65. DWORD dwPhonesInUse;
  66. DWORD dwTotalOutgoingCalls;
  67. DWORD dwTotalIncomingCalls;
  68. DWORD dwClientApps;
  69. DWORD dwCurrentOutgoingCalls;
  70. DWORD dwCurrentIncomingCalls;
  71. } PERFBLOCK, *PPERFBLOCK;
  72. #pragma pack ()
  73. /////////////////////////////////////////////////////////////////
  74. // PERFUTIL header stuff below
  75. // enable this define to log process heap data to the event log
  76. #ifdef PROBE_HEAP_USAGE
  77. #undef PROBE_HEAP_USAGE
  78. #endif
  79. //
  80. // Utility macro. This is used to reserve a DWORD multiple of bytes for Unicode strings
  81. // embedded in the definitional data, viz., object instance names.
  82. //
  83. #define DWORD_MULTIPLE(x) (((x+sizeof(DWORD)-1)/sizeof(DWORD))*sizeof(DWORD))
  84. // (assumes dword is 4 bytes long and pointer is a dword in size)
  85. #define ALIGN_ON_DWORD(x) ((VOID *)( ((DWORD) x & 0x00000003) ? ( ((DWORD) x & 0xFFFFFFFC) + 4 ) : ( (DWORD) x ) ))
  86. extern WCHAR GLOBAL_STRING[]; // Global command (get all local ctrs)
  87. extern WCHAR FOREIGN_STRING[]; // get data from foreign computers
  88. extern WCHAR COSTLY_STRING[];
  89. extern WCHAR NULL_STRING[];
  90. #define QUERY_GLOBAL 1
  91. #define QUERY_ITEMS 2
  92. #define QUERY_FOREIGN 3
  93. #define QUERY_COSTLY 4
  94. //
  95. // The definition of the only routine of perfutil.c, It builds part of a performance data
  96. // instance (PERF_INSTANCE_DEFINITION) as described in winperf.h
  97. //
  98. HANDLE MonOpenEventLog ();
  99. VOID MonCloseEventLog ();
  100. DWORD GetQueryType (IN LPWSTR);
  101. BOOL IsNumberInUnicodeList (DWORD, LPWSTR);
  102. typedef struct _LOCAL_HEAP_INFO_BLOCK {
  103. DWORD AllocatedEntries;
  104. DWORD AllocatedBytes;
  105. DWORD FreeEntries;
  106. DWORD FreeBytes;
  107. } LOCAL_HEAP_INFO, *PLOCAL_HEAP_INFO;
  108. //
  109. // Memory Probe macro
  110. //
  111. #ifdef PROBE_HEAP_USAGE
  112. #define HEAP_PROBE() { \
  113. DWORD dwHeapStatus[5]; \
  114. NTSTATUS CallStatus; \
  115. dwHeapStatus[4] = __LINE__; }
  116. // if (!(CallStatus = memprobe (dwHeapStatus, 16L, NULL))) { \
  117. // REPORT_INFORMATION_DATA (TAPI_HEAP_STATUS, LOG_DEBUG, \
  118. // &dwHeapStatus, sizeof(dwHeapStatus)); \
  119. // } else { \
  120. // REPORT_ERROR_DATA (TAPI_HEAP_STATUS_ERROR, LOG_DEBUG, \
  121. // &CallStatus, sizeof (DWORD)); \
  122. // } \
  123. //}
  124. #else
  125. #define HEAP_PROBE() ;
  126. #endif
  127. #endif //_DATATAPI_H_