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