Leaked source code of windows server 2003
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.

122 lines
3.6 KiB

  1. /*++ BUILD Version: 0001 // Increment this if a change has global effects
  2. Copyright (c) 1992 Microsoft Corporation
  3. Module Name:
  4. datanbt.c
  5. Abstract:
  6. Header file for the Nbt 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 system API calls is placed into the structures shown
  10. here.
  11. Created:
  12. Christos Tsollis 08/26/92
  13. Revision History:
  14. --*/
  15. #ifndef _DATANBT_H_
  16. #define _DATANBT_H_
  17. /****************************************************************************\
  18. 18 Jan 92
  19. russbl
  20. Adding a Counter to the Extensible Objects Code
  21. 1. Modify the object definition in extdata.h:
  22. a. Add a define for the offset of the counter in the
  23. data block for the given object type.
  24. b. Add a PERF_COUNTER_DEFINITION to the <object>_DATA_DEFINITION.
  25. 2. Add the Titles to the Registry in perfctrs.ini and perfhelp.ini:
  26. a. Add Text for the Counter Name and the Text for the Help.
  27. b. Add them to the bottom so we don't have to change all the
  28. numbers.
  29. c. Change the Last Counter and Last Help entries under
  30. PerfLib in software.ini.
  31. d. To do this at setup time, see section in pmintrnl.txt for
  32. protocol.
  33. 3. Now add the counter to the object definition in extdata.c.
  34. This is the initializing, constant data which will actually go
  35. into the structure you added to the <object>_DATA_DEFINITION in
  36. step 1.b. The type of the structure you are initializing is a
  37. PERF_COUNTER_DEFINITION. These are defined in winperf.h.
  38. 4. Add code in extobjct.c to collect the data.
  39. Note: adding an object is a little more work, but in all the same
  40. places. See the existing code for examples. In addition, you must
  41. increase the *NumObjectTypes parameter to Get<object>PerfomanceData
  42. on return from that routine.
  43. \****************************************************************************/
  44. //
  45. // The routines that load these structures assume that all fields
  46. // are packed and aligned on DWORD boundries. Alpha support may
  47. // change this assumption so the pack pragma is used here to insure
  48. // the DWORD packing assumption remains valid.
  49. //
  50. #pragma pack (4)
  51. //
  52. // Extensible Object definitions
  53. //
  54. // Update the following sort of define when adding an object type.
  55. #define NBT_NUM_PERF_OBJECT_TYPES 1
  56. //----------------------------------------------------------------------------
  57. //
  58. // Nbt Connection object type counter definitions.
  59. //
  60. // These are used in the counter definitions to describe the relative
  61. // position of each counter in the returned data.
  62. //
  63. #define RESERVED_DWORD_VALUE sizeof(DWORD)
  64. #define RECEIVED_BYTES_OFFSET RESERVED_DWORD_VALUE + sizeof(DWORD)
  65. #define SENT_BYTES_OFFSET RECEIVED_BYTES_OFFSET + sizeof(LARGE_INTEGER)
  66. #define TOTAL_BYTES_OFFSET SENT_BYTES_OFFSET + sizeof(LARGE_INTEGER)
  67. #define SIZE_OF_NBT_DATA TOTAL_BYTES_OFFSET + sizeof(LARGE_INTEGER)
  68. //
  69. // This is the counter structure presently returned by Nbf for
  70. // each Connection. Each Connection is an Instance, named by the name of
  71. // the remote endpoint.
  72. //
  73. typedef struct _NBT_DATA_DEFINITION {
  74. PERF_OBJECT_TYPE NbtObjectType;
  75. PERF_COUNTER_DEFINITION BytesReceived;
  76. PERF_COUNTER_DEFINITION BytesSent;
  77. PERF_COUNTER_DEFINITION BytesTotal;
  78. } NBT_DATA_DEFINITION;
  79. #pragma pack ()
  80. #endif //_DATANBT_H_
  81.