home *** CD-ROM | disk | FTP | other *** search
/ PC Format (South-Africa) 2001 May / PCFMay2001.iso / Xenon / C++ / FreeCommandLineTools.exe / Include / monshare.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-01-31  |  3.4 KB  |  84 lines

  1. // --monshare.h-----------------------------------------------------------------
  2. //
  3. //  Header file containing the definition of the performance monitoring shared 
  4. //  memory structure.  The shared memory is used to communicate between the 
  5. //  monitored object side and the performance DLL called by the NT Performance 
  6. //  Monitor.
  7. //
  8. // Copyright 1986 - 1998 Microsoft Corporation.  All Rights Reserved.
  9. // -----------------------------------------------------------------------------
  10. #if !defined(_MONSHARE_H)
  11. #pragma option push -b -a8 -pc -A- /*P_O_Push*/
  12. #define _MONSHARE_H
  13.  
  14. //
  15. // Mapping and Mutex Object Names
  16. //
  17.  
  18. // NOTE: "" and L"" versions must be the same!!!
  19.  
  20. #define MON_MAPPING_NAME_TEMPLATE    "MS Exchange SDK PerfMon Mapping %s"
  21. #define MON_MAPPING_NAME_TEMPLATE_W    L"MS Exchange SDK PerfMon Mapping %s"
  22.  
  23. #define MON_MUTEX_NAME_TEMPLATE     "MS Exchange SDK PerfMon Mutex %s"
  24. #define MON_MUTEX_NAME_TEMPLATE_W    L"MS Exchange SDK PerfMon Mutex %s"
  25.  
  26. //
  27. // Defined Constants
  28. //
  29.  
  30. // MON_SHARED_MEMORY_SIGNATURE identifies the shared memory section as an 
  31. // Exchange SDK performance monitoring shared memory communication block.
  32. // This constant should be incremented when the structure of the shared 
  33. // memory section is changed to catch version mismatches between the  
  34. // monitored object and the DLL.
  35.  
  36. #define MON_SHARED_MEMORY_SIGNATURE     0x47575011
  37.  
  38. // MON_DATA_BLOCK_SIZE is the size of the buffer within the shared block 
  39. // in which is built the structure that is sent to the Windows NT 
  40. // Performance Monitor.  This value may be increased if needed to hold 
  41. // a larger number of counters.  A change in this value does not require 
  42. // any other values to be changed.
  43.  
  44. #define MON_DATA_BLOCK_SIZE                4000
  45.  
  46. // MON_MUTEX_TIMEOUT is the number of miliseconds to wait for the 
  47. // mutex that locks the shared memory section.  May be defined as 
  48. // INFINITE to wait forever.
  49.  
  50. #define MON_MUTEX_TIMEOUT               (5*60*1000)
  51.  
  52. //
  53. // Structure Definitions
  54. //
  55.  
  56. //$--MONSHAREDMEMORY------------------------------------------------------------
  57. //  This is the structure of the shared memory block used to communicate with 
  58. //  the performance DLL.  The _PERF_* structures are all built inside the 
  59. //  rgbDataBlock array within this structure.
  60. // -----------------------------------------------------------------------------
  61. typedef struct _MonSharedMemory            // (hungarian notation = msm)
  62. {
  63.     DWORD dwSignature;                  // value that identifies this as an 
  64.                                         // Exchange SDK perf mon memory block
  65.     DWORD fDataIsValid;                    // safe for DLL to use shared mem data
  66.     DWORD ibHeaderOffset;                // offset of _PERF_OBJECT_TYPE and 
  67.                                         // _PERF_COUNTER_DEFINITION structures
  68.                                         // in this shared memory block
  69.     DWORD cbHeaderSize;                    // size of _PERF_OBJECT_TYPE and 
  70.                                         // _PERF_COUNTER_DEFINITION structures
  71.                                         // in this shared memory block
  72.     DWORD ibInstanceOffset;                // offset of _PERF_INSTANCE_DEFINITION,
  73.                                         // _PERF_COUNTER_BLOCK and counters
  74.                                         // in this shared memory block
  75.     DWORD cbInstanceSize;                // size of _PERF_INSTANCE_DEFINITION,
  76.                                         // _PERF_COUNTER_BLOCK and counters
  77.                                         // in this shared memory block
  78.     BYTE rgbDataBlock[MON_DATA_BLOCK_SIZE];    // the actual data block containing
  79.                                         // both of the structures listed above
  80. } MONSHAREDMEMORY, *LPMONSHAREDMEMORY;
  81.  
  82. #pragma option pop /*P_O_Pop*/
  83. #endif
  84.