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