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.

1524 lines
59 KiB

  1. /**********************************************************************/
  2. /** Microsoft Windows NT **/
  3. /** Copyright(c) Microsoft Corp., 1993 **/
  4. /**********************************************************************/
  5. /*
  6. perfnntp.c
  7. This file implements the Extensible Performance Objects for
  8. the NNTP Server service.
  9. FILE HISTORY:
  10. KeithMo 07-Jun-1993 Created, based on RussBl's sample code.
  11. */
  12. #define INITGUID
  13. #include <nt.h>
  14. #include <ntrtl.h>
  15. #include <nturtl.h>
  16. #include <windows.h>
  17. #include <winperf.h>
  18. #include <lm.h>
  19. #include <string.h>
  20. #include <stdio.h>
  21. //#include <wcstr.h>
  22. #include <nntpctrs.h>
  23. #include <nntps.h>
  24. #include <nntptype.h>
  25. #include <nntpapi.h>
  26. extern "C" {
  27. #include <perfutil.h>
  28. #include <nntpdata.h>
  29. }
  30. #include <ole2.h>
  31. #define APP_NAME (TEXT("NntpCtrs"))
  32. #define MAX_SIZEOF_INSTANCE_NAME 128
  33. #define TOTAL_INSTANCE_NAME L"_Total"
  34. #define ALIGN_ON_QWORD(x) \
  35. ((VOID *)(((ULONG_PTR)(x) + ((8)-1)) & ~((ULONG_PTR)(8)-1)))
  36. //
  37. // Private constants.
  38. //
  39. //
  40. // Private globals.
  41. //
  42. DWORD cOpens = 0; // Active "opens" reference count.
  43. BOOL fInitOK = FALSE; // TRUE if DLL initialized OK.
  44. #if DBG
  45. #define _ASSERT( f ) if( (f) ) ; else DebugBreak()
  46. #else //DBG
  47. #define _ASSERT( f )
  48. #endif // DBG
  49. // compile time assert
  50. #define _CASSERT(ex) { typedef char cassert_type[(ex) ? 1 : -1]; }
  51. //
  52. // Private prototypes.
  53. //
  54. VOID
  55. CopyStatisticsData1(
  56. IN NNTP_STATISTICS_0 * pNntpStats,
  57. OUT NNTP_COUNTER_BLOCK1 * pCounterBlock
  58. );
  59. VOID
  60. CopyStatisticsData2(
  61. IN NNTP_STATISTICS_0 * pNntpStats,
  62. OUT NNTP_COUNTER_BLOCK2 * pCounterBlock
  63. );
  64. VOID
  65. Update_TotalStatisticsData1(
  66. IN NNTP_COUNTER_BLOCK1 * pCounterBlock,
  67. OUT NNTP_COUNTER_BLOCK1 * pTotal
  68. );
  69. VOID
  70. Update_TotalStatisticsData2(
  71. IN NNTP_COUNTER_BLOCK2 * pCounterBlock,
  72. OUT NNTP_COUNTER_BLOCK2 * pTotal
  73. );
  74. VOID
  75. UpdateNameAndHelpIndicies(
  76. IN DWORD dwFirstCounter,
  77. IN DWORD dwFirstHelp
  78. );
  79. //
  80. // Public prototypes.
  81. //
  82. PM_OPEN_PROC OpenNntpPerformanceData;
  83. PM_COLLECT_PROC CollectNntpPerformanceData;
  84. PM_CLOSE_PROC CloseNntpPerformanceData;
  85. //
  86. // Public functions.
  87. //
  88. /*******************************************************************
  89. NAME: OpenNntpPerformanceData
  90. SYNOPSIS: Initializes the data structures used to communicate
  91. performance counters with the registry.
  92. ENTRY: lpDeviceNames - Poitner to object ID of each device
  93. to be opened.
  94. RETURNS: DWORD - Win32 status code.
  95. HISTORY:
  96. KeithMo 07-Jun-1993 Created.
  97. ********************************************************************/
  98. DWORD
  99. OpenNntpPerformanceData(
  100. LPWSTR lpDeviceNames
  101. )
  102. {
  103. DWORD err = NO_ERROR;
  104. HKEY hkey = NULL;
  105. DWORD size;
  106. DWORD type;
  107. DWORD dwFirstCounter;
  108. DWORD dwFirstHelp;
  109. //PERF_COUNTER_DEFINITION * pctr;
  110. //
  111. // Since SCREG is multi-threaded and will call this routine in
  112. // order to service remote performance queries, this library
  113. // must keep track of how many times it has been opened (i.e.
  114. // how many threads have accessed it). The registry routines will
  115. // limit access to the initialization routine to only one thread
  116. // at a time so synchronization (i.e. reentrancy) should not be
  117. // a problem.
  118. //
  119. if( !fInitOK ) {
  120. //
  121. // This is the *first* open.
  122. //
  123. //
  124. // Open the NNTP Server service's Performance key.
  125. //
  126. err = RegOpenKeyEx( HKEY_LOCAL_MACHINE,
  127. NNTP_PERFORMANCE_KEY,
  128. 0,
  129. KEY_READ,
  130. &hkey );
  131. if( err == NO_ERROR )
  132. {
  133. //
  134. // Read the first counter DWORD.
  135. //
  136. size = sizeof(DWORD);
  137. err = RegQueryValueEx( hkey,
  138. "First Counter",
  139. NULL,
  140. &type,
  141. (LPBYTE)&dwFirstCounter,
  142. &size );
  143. }
  144. if( err == NO_ERROR )
  145. {
  146. //
  147. // Read the first help DWORD.
  148. //
  149. size = sizeof(DWORD);
  150. err = RegQueryValueEx( hkey,
  151. "First Help",
  152. NULL,
  153. &type,
  154. (LPBYTE)&dwFirstHelp,
  155. &size );
  156. }
  157. if ( err == NO_ERROR ) {
  158. //
  159. // Update the object & counter name & help indicies.
  160. //
  161. UpdateNameAndHelpIndicies( dwFirstCounter, dwFirstHelp );
  162. //
  163. // Remember that we initialized OK.
  164. //
  165. fInitOK = TRUE;
  166. }
  167. //
  168. // Close the registry if we managed to actually open it.
  169. //
  170. if( hkey != NULL )
  171. {
  172. RegCloseKey( hkey );
  173. hkey = NULL;
  174. }
  175. }
  176. //
  177. // Bump open counter.
  178. //
  179. cOpens++;
  180. return NO_ERROR;
  181. } // OpenNntpPerformanceData
  182. /*******************************************************************
  183. NAME: CollectNntpPerformanceData
  184. SYNOPSIS: Initializes the data structures used to communicate
  185. ENTRY: lpValueName - The name of the value to retrieve.
  186. lppData - On entry contains a pointer to the buffer to
  187. receive the completed PerfDataBlock & subordinate
  188. structures. On exit, points to the first bytes
  189. *after* the data structures added by this routine.
  190. lpcbTotalBytes - On entry contains a pointer to the
  191. size (in BYTEs) of the buffer referenced by lppData.
  192. On exit, contains the number of BYTEs added by this
  193. routine.
  194. lpNumObjectTypes - Receives the number of objects added
  195. by this routine.
  196. RETURNS: DWORD - Win32 status code. MUST be either NO_ERROR
  197. or ERROR_MORE_DATA.
  198. HISTORY:
  199. KeithMo 07-Jun-1993 Created.
  200. ********************************************************************/
  201. DWORD CollectNntpPerformanceData(
  202. LPWSTR lpValueName,
  203. LPVOID * lppData,
  204. LPDWORD lpcbTotalBytes,
  205. LPDWORD lpNumObjectTypes
  206. )
  207. {
  208. PERF_INSTANCE_DEFINITION *pPerfInstanceDefinition;
  209. DWORD dwInstanceIndex = 0;
  210. DWORD dwInstanceCount = 0;
  211. DWORD dwInstance = 0;
  212. DWORD dwCount = 0;
  213. DWORD i = 0;
  214. DWORD dwQueryType;
  215. ULONG cbRequired;
  216. //DWORD *pdwCounter;
  217. //LARGE_INTEGER *pliCounter;
  218. NNTP_COUNTER_BLOCK1 *pCounterBlock1;
  219. NNTP_COUNTER_BLOCK1 *pTotal1;
  220. NNTP_COUNTER_BLOCK2 *pCounterBlock2;
  221. NNTP_COUNTER_BLOCK2 *pTotal2;
  222. NNTP_DATA_DEFINITION_OBJECT1 *pNntpDataDefinitionObject1;
  223. NNTP_DATA_DEFINITION_OBJECT2 *pNntpDataDefinitionObject2;
  224. NNTP_STATISTICS_BLOCK_ARRAY *pNntpStatisticsBlockArray = NULL;
  225. NNTP_STATISTICS_BLOCK *pNntpStatisticsBlock = NULL;
  226. NNTP_STATISTICS_0 *pNntpStats;
  227. NET_API_STATUS neterr;
  228. HRESULT hresErr;
  229. DWORD dwRetCode = NO_ERROR;
  230. WCHAR wszKeyName[MAX_PATH];
  231. // 8-byte alignment test -
  232. // the returned buffer will be
  233. // NNTP_DATA_DEFINITION_OBJECT1,
  234. // (PERF_INSTANCE_DEFINITION, name, NNTP_COUNTER_BLOCK1)+
  235. // NNTP_DATA_DEFINITION_OBJECT2,
  236. // (PERF_INSTANCE_DEFINITION, name, NNTP_COUNTER_BLOCK2)+
  237. //
  238. // name will end with a 8-byte alignment
  239. // so if input lpp isn't 8-byte aligned, we will still return a 8-byte aligned lppData
  240. // Before we go, assert on size of objects
  241. _CASSERT(sizeof(NNTP_DATA_DEFINITION_OBJECT1) % sizeof(LONGLONG) == 0);
  242. _CASSERT(sizeof(PERF_INSTANCE_DEFINITION) % sizeof(LONGLONG) == 0);
  243. _CASSERT(sizeof(NNTP_COUNTER_BLOCK1) % sizeof(LONGLONG) == 0);
  244. _CASSERT(sizeof(NNTP_DATA_DEFINITION_OBJECT2) % sizeof(LONGLONG) == 0);
  245. _CASSERT(sizeof(NNTP_COUNTER_BLOCK2) % sizeof(LONGLONG) == 0);
  246. //
  247. // No need to even try if we failed to open...
  248. //
  249. if( !fInitOK )
  250. {
  251. *lpcbTotalBytes = 0;
  252. *lpNumObjectTypes = 0;
  253. //
  254. // According to the Performance Counter design, this
  255. // is a successful exit. Go figure.
  256. //
  257. return NO_ERROR;
  258. }
  259. //
  260. // Determine the query type.
  261. //
  262. dwQueryType = GetQueryType( lpValueName );
  263. if( dwQueryType == QUERY_FOREIGN )
  264. {
  265. //
  266. // We don't do foreign queries.
  267. //
  268. *lpcbTotalBytes = 0;
  269. *lpNumObjectTypes = 0;
  270. return NO_ERROR;
  271. }
  272. if( dwQueryType == QUERY_ITEMS )
  273. {
  274. //
  275. // The registry is asking for a specific object. Let's
  276. // see if we're one of the chosen.
  277. //
  278. if( !IsNumberInUnicodeList(
  279. NntpDataDefinitionObject1.NntpObjectType.ObjectNameTitleIndex,
  280. lpValueName ) &&
  281. !IsNumberInUnicodeList(
  282. NntpDataDefinitionObject2.NntpObjectType.ObjectNameTitleIndex,
  283. lpValueName )
  284. )
  285. {
  286. *lpcbTotalBytes = 0;
  287. *lpNumObjectTypes = 0;
  288. return NO_ERROR;
  289. }
  290. }
  291. //
  292. // query for statistics info before we check the buffer size, so we have a correct instance count
  293. //
  294. neterr = NntpQueryStatistics(
  295. NULL,
  296. 0,
  297. (LPBYTE *)&pNntpStatisticsBlockArray );
  298. if( neterr != NERR_Success )
  299. {
  300. *lpcbTotalBytes = 0;
  301. *lpNumObjectTypes = 0;
  302. dwRetCode = NO_ERROR;
  303. goto Exit;
  304. }
  305. // Instance count is number of instances returned, so +1 for _Total instance
  306. dwInstanceCount = pNntpStatisticsBlockArray->cEntries + 1;
  307. // Instance index is number of virtual servers returned
  308. dwInstanceIndex = pNntpStatisticsBlockArray->cEntries;
  309. //
  310. // always return an "instance sized" buffer after the definition
  311. // blocks to prevent perfmon from reading bogus data. This is strictly
  312. // a hack to accomodate how PERFMON handles the "0" instance case.
  313. // By doing this, perfmon won't choke when there are no instances
  314. // and the counter object & counters will be displayed in the list
  315. // boxes, even though no instances will be listed.
  316. //
  317. pNntpDataDefinitionObject1 = (NNTP_DATA_DEFINITION_OBJECT1 *)*lppData;
  318. cbRequired = sizeof(NNTP_DATA_DEFINITION_OBJECT1) +
  319. (dwInstanceCount * (sizeof(PERF_INSTANCE_DEFINITION) +
  320. MAX_SIZEOF_INSTANCE_NAME +
  321. sizeof (NNTP_COUNTER_BLOCK1)));
  322. cbRequired += sizeof(NNTP_DATA_DEFINITION_OBJECT2) +
  323. (dwInstanceCount * (sizeof(PERF_INSTANCE_DEFINITION) +
  324. MAX_SIZEOF_INSTANCE_NAME +
  325. sizeof (NNTP_COUNTER_BLOCK2)));
  326. // for padding in the end.
  327. cbRequired += 8;
  328. //
  329. // See if there's enough space.
  330. //
  331. if( *lpcbTotalBytes < cbRequired ) {
  332. //
  333. // Nope.
  334. //
  335. *lpcbTotalBytes = 0;
  336. *lpNumObjectTypes = 0;
  337. dwRetCode = ERROR_MORE_DATA;
  338. goto Exit;
  339. }
  340. //
  341. // Copy the (constant, initialized) Object Type and counter definitions
  342. // to the caller's data buffer
  343. //
  344. memmove( pNntpDataDefinitionObject1,
  345. &NntpDataDefinitionObject1,
  346. sizeof(NNTP_DATA_DEFINITION_OBJECT1) );
  347. //
  348. // Create data for return for each instance
  349. //
  350. pPerfInstanceDefinition = (PERF_INSTANCE_DEFINITION *)
  351. &pNntpDataDefinitionObject1[1];
  352. //
  353. // Set first block of Buffer for _Total
  354. //
  355. MonBuildInstanceDefinition(
  356. pPerfInstanceDefinition,
  357. (PVOID *)&pCounterBlock1,
  358. 0,
  359. 0,
  360. (DWORD)-1, // use name
  361. TOTAL_INSTANCE_NAME ); // pass in instance name
  362. pTotal1 = pCounterBlock1;
  363. memset( pTotal1, 0, sizeof(NNTP_COUNTER_BLOCK1 ));
  364. pTotal1->PerfCounterBlock.ByteLength = sizeof (NNTP_COUNTER_BLOCK1);
  365. pPerfInstanceDefinition =
  366. (PERF_INSTANCE_DEFINITION *)((LPBYTE)pCounterBlock1 +
  367. sizeof(NNTP_COUNTER_BLOCK1));
  368. //
  369. // Copy the data into the perfmon buffer
  370. //
  371. for( i = 0, dwCount = 1 ; (i < dwInstanceIndex) && dwCount < dwInstanceCount;
  372. i++ ) {
  373. pNntpStatisticsBlock = &(pNntpStatisticsBlockArray->aStatsBlock[i]);
  374. dwInstance = pNntpStatisticsBlock->dwInstance;
  375. pNntpStats = &(pNntpStatisticsBlock->Stats_0);
  376. wszKeyName[sizeof(wszKeyName)/sizeof(WCHAR) - 1] = L'\0';
  377. _snwprintf(wszKeyName, sizeof(wszKeyName)/sizeof(WCHAR) - 1,
  378. L"%d", dwInstance);
  379. MonBuildInstanceDefinition(
  380. pPerfInstanceDefinition,
  381. (PVOID *)&pCounterBlock1,
  382. 0,
  383. 0,
  384. (DWORD)-1, // use name
  385. (LPWSTR)wszKeyName ); // pass in instance name
  386. //
  387. // Format the NNTP Server data.
  388. //
  389. CopyStatisticsData1( pNntpStats,
  390. pCounterBlock1 );
  391. //
  392. // update _total instance counters
  393. //
  394. Update_TotalStatisticsData1( pCounterBlock1,
  395. pTotal1 );
  396. pPerfInstanceDefinition =
  397. (PERF_INSTANCE_DEFINITION *)((LPBYTE)pCounterBlock1 +
  398. sizeof(NNTP_COUNTER_BLOCK1));
  399. dwCount++;
  400. }
  401. pNntpDataDefinitionObject1->NntpObjectType.NumInstances = dwInstanceCount;
  402. pNntpDataDefinitionObject1->NntpObjectType.TotalByteLength =
  403. *lpcbTotalBytes = (DWORD)((PBYTE)pPerfInstanceDefinition -
  404. (PBYTE)pNntpDataDefinitionObject1);
  405. //
  406. // Fill in data for Object 2 - the "NNTP Svc Client Request" object
  407. //
  408. *lppData = (PVOID)(pPerfInstanceDefinition);
  409. pNntpDataDefinitionObject2 = (NNTP_DATA_DEFINITION_OBJECT2 *)*lppData;
  410. //
  411. // Copy the (constant, initialized) Object Type and counter definitions
  412. // to the caller's data buffer
  413. //
  414. memmove( pNntpDataDefinitionObject2,
  415. &NntpDataDefinitionObject2,
  416. sizeof(NNTP_DATA_DEFINITION_OBJECT2) );
  417. //
  418. // Create data for return for each instance
  419. //
  420. pPerfInstanceDefinition = (PERF_INSTANCE_DEFINITION *)
  421. &pNntpDataDefinitionObject2[1];
  422. //
  423. // Set first block of Buffer for _Total
  424. //
  425. MonBuildInstanceDefinition(
  426. pPerfInstanceDefinition,
  427. (PVOID *)&pCounterBlock2,
  428. 0,
  429. 0,
  430. (DWORD)-1, // use name
  431. TOTAL_INSTANCE_NAME ); // pass in instance name
  432. pTotal2 = pCounterBlock2;
  433. memset( pTotal2, 0, sizeof(NNTP_COUNTER_BLOCK2 ));
  434. pTotal2->PerfCounterBlock.ByteLength = sizeof (NNTP_COUNTER_BLOCK2);
  435. pPerfInstanceDefinition =
  436. (PERF_INSTANCE_DEFINITION *)((LPBYTE)pCounterBlock2 +
  437. sizeof(NNTP_COUNTER_BLOCK2));
  438. for( i = 0, dwCount = 1 ; (i < dwInstanceIndex) && dwCount < dwInstanceCount;
  439. i++ ) {
  440. pNntpStatisticsBlock = &(pNntpStatisticsBlockArray->aStatsBlock[i]);
  441. dwInstance = pNntpStatisticsBlock->dwInstance;
  442. pNntpStats = &(pNntpStatisticsBlock->Stats_0);
  443. wszKeyName[sizeof(wszKeyName)/sizeof(WCHAR) - 1] = L'\0';
  444. _snwprintf(wszKeyName, sizeof(wszKeyName)/sizeof(WCHAR) - 1,
  445. L"%d", dwInstance);
  446. MonBuildInstanceDefinition(
  447. pPerfInstanceDefinition,
  448. (PVOID *)&pCounterBlock2,
  449. 0,
  450. 0,
  451. (DWORD)-1, // use name
  452. (LPWSTR)wszKeyName ); // pass in instance name
  453. //
  454. // Format the NNTP Server data.
  455. //
  456. CopyStatisticsData2( pNntpStats,
  457. pCounterBlock2 );
  458. //
  459. // update _total instance counters
  460. //
  461. Update_TotalStatisticsData2( pCounterBlock2,
  462. pTotal2 );
  463. pPerfInstanceDefinition =
  464. (PERF_INSTANCE_DEFINITION *)((LPBYTE)pCounterBlock2 +
  465. sizeof(NNTP_COUNTER_BLOCK2));
  466. dwCount++;
  467. //
  468. // Free the API buffer.
  469. //
  470. }
  471. //
  472. // Free the API buffer.
  473. //
  474. NetApiBufferFree((LPBYTE)pNntpStatisticsBlockArray);
  475. //
  476. // Update arguments for return.
  477. //
  478. *lppData = (PVOID)(pPerfInstanceDefinition);
  479. _ASSERT(*lppData == ALIGN_ON_QWORD(*lppData));
  480. *lpNumObjectTypes = 2;
  481. pNntpDataDefinitionObject2->NntpObjectType.NumInstances = dwInstanceCount;
  482. pNntpDataDefinitionObject2->NntpObjectType.TotalByteLength =
  483. (DWORD)((PBYTE)pPerfInstanceDefinition -
  484. ((PBYTE)pNntpDataDefinitionObject1 + *lpcbTotalBytes));
  485. *lpcbTotalBytes = (DWORD)((PBYTE)pPerfInstanceDefinition -
  486. (PBYTE)pNntpDataDefinitionObject1);
  487. // Should we return with lppData aligned to 8 bytes or length aligned to 8 bytes if input lppData is not 8-byte aligned?
  488. //
  489. // Make the lenght of block multiple of 8-byte. - By JenLC
  490. *lpcbTotalBytes = (*lpcbTotalBytes+7)&(~((DWORD)7));
  491. *lppData = (PBYTE)pNntpDataDefinitionObject1 + *lpcbTotalBytes;
  492. Exit:
  493. //
  494. // Success! Honest!!
  495. //
  496. return dwRetCode;
  497. } // CollectNntpPerformanceData
  498. /*******************************************************************
  499. NAME: CloseNntpPerformanceData
  500. SYNOPSIS: Terminates the performance counters.
  501. RETURNS: DWORD - Win32 status code.
  502. HISTORY:
  503. KeithMo 07-Jun-1993 Created.
  504. ********************************************************************/
  505. DWORD CloseNntpPerformanceData( VOID )
  506. {
  507. //
  508. // No real cleanup to do here.
  509. //
  510. if ((--cOpens) == 0) {
  511. // Done each time the perf data is collect instead of here
  512. // UninitAdminBase();
  513. }
  514. return NO_ERROR;
  515. } // CloseNntpPerformanceData
  516. VOID
  517. CopyStatisticsData1(
  518. IN NNTP_STATISTICS_0 * pNntpStats,
  519. OUT NNTP_COUNTER_BLOCK1 * pCounterBlock
  520. )
  521. {
  522. //
  523. // Format the NNTP Server data for Object1
  524. //
  525. pCounterBlock->PerfCounterBlock.ByteLength = sizeof (NNTP_COUNTER_BLOCK1);
  526. pCounterBlock->BytesSent = pNntpStats->TotalBytesSent.QuadPart;
  527. pCounterBlock->BytesReceived = pNntpStats->TotalBytesReceived.QuadPart;
  528. pCounterBlock->BytesTotal = pNntpStats->TotalBytesSent.QuadPart + pNntpStats->TotalBytesReceived.QuadPart;
  529. pCounterBlock->TotalConnections = pNntpStats->TotalConnections;
  530. pCounterBlock->TotalSSLConnections = pNntpStats->TotalSSLConnections;
  531. pCounterBlock->CurrentConnections = pNntpStats->CurrentConnections;
  532. pCounterBlock->MaxConnections = pNntpStats->MaxConnections;
  533. pCounterBlock->CurrentAnonymous = pNntpStats->CurrentAnonymousUsers;
  534. pCounterBlock->CurrentNonAnonymous = pNntpStats->CurrentNonAnonymousUsers;
  535. pCounterBlock->TotalAnonymous = pNntpStats->TotalAnonymousUsers;
  536. pCounterBlock->TotalNonAnonymous = pNntpStats->TotalNonAnonymousUsers;
  537. pCounterBlock->MaxAnonymous = pNntpStats->MaxAnonymousUsers;
  538. pCounterBlock->MaxNonAnonymous = pNntpStats->MaxNonAnonymousUsers;
  539. pCounterBlock->TotalOutboundConnects = pNntpStats->TotalOutboundConnects;
  540. pCounterBlock->OutboundConnectsFailed = pNntpStats->OutboundConnectsFailed;
  541. pCounterBlock->CurrentOutboundConnects = pNntpStats->CurrentOutboundConnects;
  542. pCounterBlock->OutboundLogonFailed = pNntpStats->OutboundLogonFailed;
  543. pCounterBlock->TotalPullFeeds = pNntpStats->TotalPullFeeds;
  544. pCounterBlock->TotalPushFeeds = pNntpStats->TotalPushFeeds;
  545. pCounterBlock->TotalPassiveFeeds = pNntpStats->TotalPassiveFeeds;
  546. pCounterBlock->ArticlesSent = pNntpStats->ArticlesSent;
  547. pCounterBlock->ArticlesReceived = pNntpStats->ArticlesReceived;
  548. pCounterBlock->ArticlesTotal = pNntpStats->ArticlesSent + pNntpStats->ArticlesReceived;
  549. pCounterBlock->ArticlesPosted = pNntpStats->ArticlesPosted;
  550. pCounterBlock->ArticleMapEntries = pNntpStats->ArticleMapEntries;
  551. pCounterBlock->HistoryMapEntries = pNntpStats->HistoryMapEntries;
  552. pCounterBlock->XoverEntries = pNntpStats->XoverEntries;
  553. pCounterBlock->ControlMessagesIn = pNntpStats->ControlMessagesIn;
  554. pCounterBlock->ControlMessagesFailed = pNntpStats->ControlMessagesFailed;
  555. pCounterBlock->ModeratedPostingsSent = pNntpStats->ModeratedPostingsSent;
  556. pCounterBlock->ModeratedPostingsFailed = pNntpStats->ModeratedPostingsFailed;
  557. pCounterBlock->SessionsFlowControlled = pNntpStats->SessionsFlowControlled;
  558. pCounterBlock->ArticlesExpired = pNntpStats->ArticlesExpired;
  559. pCounterBlock->ArticlesSentPerSec = pNntpStats->ArticlesSent;
  560. pCounterBlock->ArticlesReceivedPerSec = pNntpStats->ArticlesReceived;
  561. pCounterBlock->ArticlesPostedPerSec = pNntpStats->ArticlesPosted;
  562. pCounterBlock->ArticleMapEntriesPerSec = pNntpStats->ArticleMapEntries;
  563. pCounterBlock->HistoryMapEntriesPerSec = pNntpStats->HistoryMapEntries;
  564. pCounterBlock->XoverEntriesPerSec = pNntpStats->XoverEntries;
  565. pCounterBlock->ArticlesExpiredPerSec = pNntpStats->ArticlesExpired;
  566. } // CopyStatisticsData
  567. VOID
  568. CopyStatisticsData2(
  569. IN NNTP_STATISTICS_0 * pNntpStats,
  570. OUT NNTP_COUNTER_BLOCK2 * pCounterBlock
  571. )
  572. {
  573. //
  574. // Format the NNTP Server data for Object2
  575. //
  576. pCounterBlock->PerfCounterBlock.ByteLength = sizeof (NNTP_COUNTER_BLOCK2);
  577. pCounterBlock->ArticleCmds = pNntpStats->ArticleCommands;
  578. pCounterBlock->ArticleCmdsPerSec = pNntpStats->ArticleCommands;
  579. pCounterBlock->GroupCmds = pNntpStats->GroupCommands;
  580. pCounterBlock->GroupCmdsPerSec = pNntpStats->GroupCommands;
  581. pCounterBlock->HelpCmds = pNntpStats->HelpCommands;
  582. pCounterBlock->HelpCmdsPerSec = pNntpStats->HelpCommands;
  583. pCounterBlock->IHaveCmds = pNntpStats->IHaveCommands;
  584. pCounterBlock->IHaveCmdsPerSec = pNntpStats->IHaveCommands;
  585. pCounterBlock->LastCmds = pNntpStats->LastCommands;
  586. pCounterBlock->LastCmdsPerSec = pNntpStats->LastCommands;
  587. pCounterBlock->ListCmds = pNntpStats->ListCommands;
  588. pCounterBlock->ListCmdsPerSec = pNntpStats->ListCommands;
  589. pCounterBlock->NewgroupsCmds = pNntpStats->NewgroupsCommands;
  590. pCounterBlock->NewgroupsCmdsPerSec = pNntpStats->NewgroupsCommands;
  591. pCounterBlock->NewnewsCmds = pNntpStats->NewnewsCommands;
  592. pCounterBlock->NewnewsCmdsPerSec = pNntpStats->NewnewsCommands;
  593. pCounterBlock->NextCmds = pNntpStats->NextCommands;
  594. pCounterBlock->NextCmdsPerSec = pNntpStats->NextCommands;
  595. pCounterBlock->PostCmds = pNntpStats->PostCommands;
  596. pCounterBlock->PostCmdsPerSec = pNntpStats->PostCommands;
  597. pCounterBlock->QuitCmds = pNntpStats->QuitCommands;
  598. pCounterBlock->QuitCmdsPerSec = pNntpStats->QuitCommands;
  599. pCounterBlock->StatCmds = pNntpStats->StatCommands;
  600. pCounterBlock->StatCmdsPerSec = pNntpStats->StatCommands;
  601. pCounterBlock->LogonAttempts = pNntpStats->LogonAttempts;
  602. pCounterBlock->LogonFailures = pNntpStats->LogonFailures;
  603. pCounterBlock->LogonAttemptsPerSec = pNntpStats->LogonAttempts;
  604. pCounterBlock->LogonFailuresPerSec = pNntpStats->LogonFailures;
  605. pCounterBlock->CheckCmds = pNntpStats->CheckCommands;
  606. pCounterBlock->CheckCmdsPerSec = pNntpStats->CheckCommands;
  607. pCounterBlock->TakethisCmds = pNntpStats->TakethisCommands;
  608. pCounterBlock->TakethisCmdsPerSec = pNntpStats->TakethisCommands;
  609. pCounterBlock->ModeCmds = pNntpStats->ModeCommands;
  610. pCounterBlock->ModeCmdsPerSec = pNntpStats->ModeCommands;
  611. pCounterBlock->SearchCmds = pNntpStats->SearchCommands;
  612. pCounterBlock->SearchCmdsPerSec = pNntpStats->SearchCommands;
  613. pCounterBlock->XHdrCmds = pNntpStats->XHdrCommands;
  614. pCounterBlock->XHdrCmdsPerSec = pNntpStats->XHdrCommands;
  615. pCounterBlock->XOverCmds = pNntpStats->XOverCommands;
  616. pCounterBlock->XOverCmdsPerSec = pNntpStats->XOverCommands;
  617. pCounterBlock->XPatCmds = pNntpStats->XPatCommands;
  618. pCounterBlock->XPatCmdsPerSec = pNntpStats->XPatCommands;
  619. pCounterBlock->XReplicCmds = pNntpStats->XReplicCommands;
  620. pCounterBlock->XReplicCmdsPerSec = pNntpStats->XReplicCommands;
  621. } // CopyStatisticsData
  622. VOID
  623. Update_TotalStatisticsData1(
  624. IN NNTP_COUNTER_BLOCK1 * pCounterBlock,
  625. OUT NNTP_COUNTER_BLOCK1 * pTotal
  626. )
  627. {
  628. //
  629. // update _total instance counters for Object1
  630. //
  631. pTotal->BytesSent += pCounterBlock->BytesSent;
  632. pTotal->BytesReceived += pCounterBlock->BytesReceived;
  633. pTotal->BytesTotal += pCounterBlock->BytesSent + pCounterBlock->BytesReceived;
  634. pTotal->TotalConnections += pCounterBlock->TotalConnections;
  635. pTotal->TotalSSLConnections += pCounterBlock->TotalSSLConnections;
  636. pTotal->CurrentConnections += pCounterBlock->CurrentConnections;
  637. pTotal->MaxConnections += pCounterBlock->MaxConnections;
  638. pTotal->CurrentAnonymous += pCounterBlock->CurrentAnonymous;
  639. pTotal->CurrentNonAnonymous += pCounterBlock->CurrentNonAnonymous;
  640. pTotal->TotalAnonymous += pCounterBlock->TotalAnonymous;
  641. pTotal->TotalNonAnonymous += pCounterBlock->TotalNonAnonymous;
  642. pTotal->MaxAnonymous += pCounterBlock->MaxAnonymous;
  643. pTotal->MaxNonAnonymous += pCounterBlock->MaxNonAnonymous;
  644. pTotal->TotalOutboundConnects += pCounterBlock->TotalOutboundConnects;
  645. pTotal->OutboundConnectsFailed += pCounterBlock->OutboundConnectsFailed;
  646. pTotal->CurrentOutboundConnects += pCounterBlock->CurrentOutboundConnects;
  647. pTotal->OutboundLogonFailed += pCounterBlock->OutboundLogonFailed;
  648. pTotal->TotalPullFeeds += pCounterBlock->TotalPullFeeds;
  649. pTotal->TotalPushFeeds += pCounterBlock->TotalPushFeeds;
  650. pTotal->TotalPassiveFeeds += pCounterBlock->TotalPassiveFeeds;
  651. pTotal->ArticlesSent += pCounterBlock->ArticlesSent;
  652. pTotal->ArticlesReceived += pCounterBlock->ArticlesReceived;
  653. pTotal->ArticlesTotal += pCounterBlock->ArticlesTotal;
  654. pTotal->ArticlesPosted += pCounterBlock->ArticlesPosted;
  655. pTotal->ArticleMapEntries += pCounterBlock->ArticleMapEntries;
  656. pTotal->HistoryMapEntries += pCounterBlock->HistoryMapEntries;
  657. pTotal->XoverEntries += pCounterBlock->XoverEntries;
  658. pTotal->ControlMessagesIn += pCounterBlock->ControlMessagesIn;
  659. pTotal->ControlMessagesFailed += pCounterBlock->ControlMessagesFailed;
  660. pTotal->ModeratedPostingsSent += pCounterBlock->ModeratedPostingsSent;
  661. pTotal->ModeratedPostingsFailed += pCounterBlock->ModeratedPostingsFailed;
  662. pTotal->SessionsFlowControlled += pCounterBlock->SessionsFlowControlled;
  663. pTotal->ArticlesExpired += pCounterBlock->ArticlesExpired;
  664. pTotal->ArticlesSentPerSec += pCounterBlock->ArticlesSentPerSec;
  665. pTotal->ArticlesReceivedPerSec += pCounterBlock->ArticlesReceivedPerSec;
  666. pTotal->ArticlesPostedPerSec += pCounterBlock->ArticlesPostedPerSec;
  667. pTotal->ArticleMapEntriesPerSec += pCounterBlock->ArticleMapEntriesPerSec;
  668. pTotal->HistoryMapEntriesPerSec += pCounterBlock->HistoryMapEntriesPerSec;
  669. pTotal->XoverEntriesPerSec += pCounterBlock->XoverEntriesPerSec;
  670. pTotal->ArticlesExpiredPerSec += pCounterBlock->ArticlesExpiredPerSec;
  671. } // Update_TotalStatisticsData
  672. VOID
  673. Update_TotalStatisticsData2(
  674. IN NNTP_COUNTER_BLOCK2 * pCounterBlock,
  675. OUT NNTP_COUNTER_BLOCK2 * pTotal
  676. )
  677. {
  678. //
  679. // update _total instance counters for Object2
  680. //
  681. pTotal->ArticleCmds += pCounterBlock->ArticleCmds;
  682. pTotal->ArticleCmdsPerSec += pCounterBlock->ArticleCmdsPerSec;
  683. pTotal->GroupCmds += pCounterBlock->GroupCmds;
  684. pTotal->GroupCmdsPerSec += pCounterBlock->GroupCmdsPerSec;
  685. pTotal->HelpCmds += pCounterBlock->HelpCmds;
  686. pTotal->HelpCmdsPerSec += pCounterBlock->HelpCmdsPerSec;
  687. pTotal->IHaveCmds += pCounterBlock->IHaveCmds;
  688. pTotal->IHaveCmdsPerSec += pCounterBlock->IHaveCmdsPerSec;
  689. pTotal->LastCmds += pCounterBlock->LastCmds;
  690. pTotal->LastCmdsPerSec += pCounterBlock->LastCmdsPerSec;
  691. pTotal->ListCmds += pCounterBlock->ListCmds;
  692. pTotal->ListCmdsPerSec += pCounterBlock->ListCmdsPerSec;
  693. pTotal->NewgroupsCmds += pCounterBlock->NewgroupsCmds;
  694. pTotal->NewgroupsCmdsPerSec += pCounterBlock->NewgroupsCmdsPerSec;
  695. pTotal->NewnewsCmds += pCounterBlock->NewnewsCmds;
  696. pTotal->NewnewsCmdsPerSec += pCounterBlock->NewnewsCmdsPerSec;
  697. pTotal->NextCmds += pCounterBlock->NextCmds;
  698. pTotal->NextCmdsPerSec += pCounterBlock->NextCmdsPerSec;
  699. pTotal->PostCmds += pCounterBlock->PostCmds;
  700. pTotal->PostCmdsPerSec += pCounterBlock->PostCmdsPerSec;
  701. pTotal->QuitCmds += pCounterBlock->QuitCmds;
  702. pTotal->QuitCmdsPerSec += pCounterBlock->QuitCmdsPerSec;
  703. pTotal->StatCmds += pCounterBlock->StatCmds;
  704. pTotal->StatCmdsPerSec += pCounterBlock->StatCmdsPerSec;
  705. pTotal->LogonAttempts += pCounterBlock->LogonAttempts;
  706. pTotal->LogonFailures += pCounterBlock->LogonFailures;
  707. pTotal->LogonAttemptsPerSec += pCounterBlock->LogonAttemptsPerSec;
  708. pTotal->LogonFailuresPerSec += pCounterBlock->LogonFailuresPerSec;
  709. pTotal->CheckCmds += pCounterBlock->CheckCmds;
  710. pTotal->CheckCmdsPerSec += pCounterBlock->CheckCmdsPerSec;
  711. pTotal->TakethisCmds += pCounterBlock->TakethisCmds;
  712. pTotal->TakethisCmdsPerSec += pCounterBlock->TakethisCmdsPerSec;
  713. pTotal->ModeCmds += pCounterBlock->ModeCmds;
  714. pTotal->ModeCmdsPerSec += pCounterBlock->ModeCmdsPerSec;
  715. pTotal->SearchCmds += pCounterBlock->SearchCmds;
  716. pTotal->SearchCmdsPerSec += pCounterBlock->SearchCmdsPerSec;
  717. pTotal->XHdrCmds += pCounterBlock->XHdrCmds;
  718. pTotal->XHdrCmdsPerSec += pCounterBlock->XHdrCmdsPerSec;
  719. pTotal->XOverCmds += pCounterBlock->XOverCmds;
  720. pTotal->XOverCmdsPerSec += pCounterBlock->XOverCmdsPerSec;
  721. pTotal->XPatCmds += pCounterBlock->XPatCmds;
  722. pTotal->XPatCmdsPerSec += pCounterBlock->XPatCmdsPerSec;
  723. pTotal->XReplicCmds += pCounterBlock->XReplicCmds;
  724. pTotal->XReplicCmdsPerSec += pCounterBlock->XReplicCmdsPerSec;
  725. } // Update_TotalStatisticsData
  726. VOID
  727. UpdateNameAndHelpIndicies(
  728. IN DWORD dwFirstCounter,
  729. IN DWORD dwFirstHelp
  730. )
  731. {
  732. NNTP_COUNTER_BLOCK1 nntpc1;
  733. NNTP_COUNTER_BLOCK2 nntpc2;
  734. //
  735. // Update the object & counter name & help indicies for object1
  736. //
  737. NntpDataDefinitionObject1.NntpObjectType.ObjectNameTitleIndex
  738. += dwFirstCounter;
  739. NntpDataDefinitionObject1.NntpObjectType.ObjectHelpTitleIndex
  740. += dwFirstHelp;
  741. NntpDataDefinitionObject1.NntpBytesSent.CounterNameTitleIndex
  742. += dwFirstCounter;
  743. NntpDataDefinitionObject1.NntpBytesSent.CounterHelpTitleIndex
  744. += dwFirstHelp;
  745. NntpDataDefinitionObject1.NntpBytesSent.CounterOffset =
  746. (DWORD)((LPBYTE)&nntpc1.BytesSent - (LPBYTE)&nntpc1);
  747. NntpDataDefinitionObject1.NntpBytesReceived.CounterNameTitleIndex
  748. += dwFirstCounter;
  749. NntpDataDefinitionObject1.NntpBytesReceived.CounterHelpTitleIndex
  750. += dwFirstHelp;
  751. NntpDataDefinitionObject1.NntpBytesReceived.CounterOffset =
  752. (DWORD)((LPBYTE)&nntpc1.BytesReceived - (LPBYTE)&nntpc1);
  753. NntpDataDefinitionObject1.NntpBytesTotal.CounterNameTitleIndex
  754. += dwFirstCounter;
  755. NntpDataDefinitionObject1.NntpBytesTotal.CounterHelpTitleIndex
  756. += dwFirstHelp;
  757. NntpDataDefinitionObject1.NntpBytesTotal.CounterOffset =
  758. (DWORD)((LPBYTE)&nntpc1.BytesTotal - (LPBYTE)&nntpc1);
  759. NntpDataDefinitionObject1.NntpTotalConnections.CounterNameTitleIndex
  760. += dwFirstCounter;
  761. NntpDataDefinitionObject1.NntpTotalConnections.CounterHelpTitleIndex
  762. += dwFirstHelp;
  763. NntpDataDefinitionObject1.NntpTotalConnections.CounterOffset =
  764. (DWORD)((LPBYTE)&nntpc1.TotalConnections - (LPBYTE)&nntpc1);
  765. NntpDataDefinitionObject1.NntpTotalSSLConnections.CounterNameTitleIndex
  766. += dwFirstCounter;
  767. NntpDataDefinitionObject1.NntpTotalSSLConnections.CounterHelpTitleIndex
  768. += dwFirstHelp;
  769. NntpDataDefinitionObject1.NntpTotalSSLConnections.CounterOffset =
  770. (DWORD)((LPBYTE)&nntpc1.TotalSSLConnections - (LPBYTE)&nntpc1);
  771. NntpDataDefinitionObject1.NntpCurrentConnections.CounterNameTitleIndex
  772. += dwFirstCounter;
  773. NntpDataDefinitionObject1.NntpCurrentConnections.CounterHelpTitleIndex
  774. += dwFirstHelp;
  775. NntpDataDefinitionObject1.NntpCurrentConnections.CounterOffset =
  776. (DWORD)((LPBYTE)&nntpc1.CurrentConnections - (LPBYTE)&nntpc1);
  777. NntpDataDefinitionObject1.NntpMaxConnections.CounterNameTitleIndex
  778. += dwFirstCounter;
  779. NntpDataDefinitionObject1.NntpMaxConnections.CounterHelpTitleIndex
  780. += dwFirstHelp;
  781. NntpDataDefinitionObject1.NntpMaxConnections.CounterOffset =
  782. (DWORD)((LPBYTE)&nntpc1.MaxConnections - (LPBYTE)&nntpc1);
  783. NntpDataDefinitionObject1.NntpCurrentAnonymous.CounterNameTitleIndex
  784. += dwFirstCounter;
  785. NntpDataDefinitionObject1.NntpCurrentAnonymous.CounterHelpTitleIndex
  786. += dwFirstHelp;
  787. NntpDataDefinitionObject1.NntpCurrentAnonymous.CounterOffset =
  788. (DWORD)((LPBYTE)&nntpc1.CurrentAnonymous - (LPBYTE)&nntpc1);
  789. NntpDataDefinitionObject1.NntpCurrentNonAnonymous.CounterNameTitleIndex
  790. += dwFirstCounter;
  791. NntpDataDefinitionObject1.NntpCurrentNonAnonymous.CounterHelpTitleIndex
  792. += dwFirstHelp;
  793. NntpDataDefinitionObject1.NntpCurrentNonAnonymous.CounterOffset =
  794. (DWORD)((LPBYTE)&nntpc1.CurrentNonAnonymous - (LPBYTE)&nntpc1);
  795. NntpDataDefinitionObject1.NntpTotalAnonymous.CounterNameTitleIndex
  796. += dwFirstCounter;
  797. NntpDataDefinitionObject1.NntpTotalAnonymous.CounterHelpTitleIndex
  798. += dwFirstHelp;
  799. NntpDataDefinitionObject1.NntpTotalAnonymous.CounterOffset =
  800. (DWORD)((LPBYTE)&nntpc1.TotalAnonymous - (LPBYTE)&nntpc1);
  801. NntpDataDefinitionObject1.NntpTotalNonAnonymous.CounterNameTitleIndex
  802. += dwFirstCounter;
  803. NntpDataDefinitionObject1.NntpTotalNonAnonymous.CounterHelpTitleIndex
  804. += dwFirstHelp;
  805. NntpDataDefinitionObject1.NntpTotalNonAnonymous.CounterOffset =
  806. (DWORD)((LPBYTE)&nntpc1.TotalNonAnonymous - (LPBYTE)&nntpc1);
  807. NntpDataDefinitionObject1.NntpMaxAnonymous.CounterNameTitleIndex
  808. += dwFirstCounter;
  809. NntpDataDefinitionObject1.NntpMaxAnonymous.CounterHelpTitleIndex
  810. += dwFirstHelp;
  811. NntpDataDefinitionObject1.NntpMaxAnonymous.CounterOffset =
  812. (DWORD)((LPBYTE)&nntpc1.MaxAnonymous - (LPBYTE)&nntpc1);
  813. NntpDataDefinitionObject1.NntpMaxNonAnonymous.CounterNameTitleIndex
  814. += dwFirstCounter;
  815. NntpDataDefinitionObject1.NntpMaxNonAnonymous.CounterHelpTitleIndex
  816. += dwFirstHelp;
  817. NntpDataDefinitionObject1.NntpMaxNonAnonymous.CounterOffset =
  818. (DWORD)((LPBYTE)&nntpc1.MaxNonAnonymous - (LPBYTE)&nntpc1);
  819. NntpDataDefinitionObject1.NntpTotalOutboundConnects.CounterNameTitleIndex
  820. += dwFirstCounter;
  821. NntpDataDefinitionObject1.NntpTotalOutboundConnects.CounterHelpTitleIndex
  822. += dwFirstHelp;
  823. NntpDataDefinitionObject1.NntpTotalOutboundConnects.CounterOffset =
  824. (DWORD)((LPBYTE)&nntpc1.TotalOutboundConnects - (LPBYTE)&nntpc1);
  825. NntpDataDefinitionObject1.NntpOutboundConnectsFailed.CounterNameTitleIndex
  826. += dwFirstCounter;
  827. NntpDataDefinitionObject1.NntpOutboundConnectsFailed.CounterHelpTitleIndex
  828. += dwFirstHelp;
  829. NntpDataDefinitionObject1.NntpOutboundConnectsFailed.CounterOffset =
  830. (DWORD)((LPBYTE)&nntpc1.OutboundConnectsFailed - (LPBYTE)&nntpc1);
  831. NntpDataDefinitionObject1.NntpCurrentOutboundConnects.CounterNameTitleIndex
  832. += dwFirstCounter;
  833. NntpDataDefinitionObject1.NntpCurrentOutboundConnects.CounterHelpTitleIndex
  834. += dwFirstHelp;
  835. NntpDataDefinitionObject1.NntpCurrentOutboundConnects.CounterOffset =
  836. (DWORD)((LPBYTE)&nntpc1.CurrentOutboundConnects - (LPBYTE)&nntpc1);
  837. NntpDataDefinitionObject1.NntpOutboundLogonFailed.CounterNameTitleIndex
  838. += dwFirstCounter;
  839. NntpDataDefinitionObject1.NntpOutboundLogonFailed.CounterHelpTitleIndex
  840. += dwFirstHelp;
  841. NntpDataDefinitionObject1.NntpOutboundLogonFailed.CounterOffset =
  842. (DWORD)((LPBYTE)&nntpc1.OutboundLogonFailed - (LPBYTE)&nntpc1);
  843. NntpDataDefinitionObject1.NntpTotalPullFeeds.CounterNameTitleIndex
  844. += dwFirstCounter;
  845. NntpDataDefinitionObject1.NntpTotalPullFeeds.CounterHelpTitleIndex
  846. += dwFirstHelp;
  847. NntpDataDefinitionObject1.NntpTotalPullFeeds.CounterOffset =
  848. (DWORD)((LPBYTE)&nntpc1.TotalPullFeeds - (LPBYTE)&nntpc1);
  849. NntpDataDefinitionObject1.NntpTotalPushFeeds.CounterNameTitleIndex
  850. += dwFirstCounter;
  851. NntpDataDefinitionObject1.NntpTotalPushFeeds.CounterHelpTitleIndex
  852. += dwFirstHelp;
  853. NntpDataDefinitionObject1.NntpTotalPushFeeds.CounterOffset =
  854. (DWORD)((LPBYTE)&nntpc1.TotalPushFeeds - (LPBYTE)&nntpc1);
  855. NntpDataDefinitionObject1.NntpTotalPassiveFeeds.CounterNameTitleIndex
  856. += dwFirstCounter;
  857. NntpDataDefinitionObject1.NntpTotalPassiveFeeds.CounterHelpTitleIndex
  858. += dwFirstHelp;
  859. NntpDataDefinitionObject1.NntpTotalPassiveFeeds.CounterOffset =
  860. (DWORD)((LPBYTE)&nntpc1.TotalPassiveFeeds - (LPBYTE)&nntpc1);
  861. NntpDataDefinitionObject1.NntpArticlesSent.CounterNameTitleIndex
  862. += dwFirstCounter;
  863. NntpDataDefinitionObject1.NntpArticlesSent.CounterHelpTitleIndex
  864. += dwFirstHelp;
  865. NntpDataDefinitionObject1.NntpArticlesSent.CounterOffset =
  866. (DWORD)((LPBYTE)&nntpc1.ArticlesSent - (LPBYTE)&nntpc1);
  867. NntpDataDefinitionObject1.NntpArticlesReceived.CounterNameTitleIndex
  868. += dwFirstCounter;
  869. NntpDataDefinitionObject1.NntpArticlesReceived.CounterHelpTitleIndex
  870. += dwFirstHelp;
  871. NntpDataDefinitionObject1.NntpArticlesReceived.CounterOffset =
  872. (DWORD)((LPBYTE)&nntpc1.ArticlesReceived - (LPBYTE)&nntpc1);
  873. NntpDataDefinitionObject1.NntpArticlesTotal.CounterNameTitleIndex
  874. += dwFirstCounter;
  875. NntpDataDefinitionObject1.NntpArticlesTotal.CounterHelpTitleIndex
  876. += dwFirstHelp;
  877. NntpDataDefinitionObject1.NntpArticlesTotal.CounterOffset =
  878. (DWORD)((LPBYTE)&nntpc1.ArticlesTotal - (LPBYTE)&nntpc1);
  879. NntpDataDefinitionObject1.NntpArticlesPosted.CounterNameTitleIndex
  880. += dwFirstCounter;
  881. NntpDataDefinitionObject1.NntpArticlesPosted.CounterHelpTitleIndex
  882. += dwFirstHelp;
  883. NntpDataDefinitionObject1.NntpArticlesPosted.CounterOffset =
  884. (DWORD)((LPBYTE)&nntpc1.ArticlesPosted - (LPBYTE)&nntpc1);
  885. NntpDataDefinitionObject1.NntpArticleMapEntries.CounterNameTitleIndex
  886. += dwFirstCounter;
  887. NntpDataDefinitionObject1.NntpArticleMapEntries.CounterHelpTitleIndex
  888. += dwFirstHelp;
  889. NntpDataDefinitionObject1.NntpArticleMapEntries.CounterOffset =
  890. (DWORD)((LPBYTE)&nntpc1.ArticleMapEntries - (LPBYTE)&nntpc1);
  891. NntpDataDefinitionObject1.NntpHistoryMapEntries.CounterNameTitleIndex
  892. += dwFirstCounter;
  893. NntpDataDefinitionObject1.NntpHistoryMapEntries.CounterHelpTitleIndex
  894. += dwFirstHelp;
  895. NntpDataDefinitionObject1.NntpHistoryMapEntries.CounterOffset =
  896. (DWORD)((LPBYTE)&nntpc1.HistoryMapEntries - (LPBYTE)&nntpc1);
  897. NntpDataDefinitionObject1.NntpXoverEntries.CounterNameTitleIndex
  898. += dwFirstCounter;
  899. NntpDataDefinitionObject1.NntpXoverEntries.CounterHelpTitleIndex
  900. += dwFirstHelp;
  901. NntpDataDefinitionObject1.NntpXoverEntries.CounterOffset =
  902. (DWORD)((LPBYTE)&nntpc1.XoverEntries - (LPBYTE)&nntpc1);
  903. NntpDataDefinitionObject1.NntpControlMessagesIn.CounterNameTitleIndex
  904. += dwFirstCounter;
  905. NntpDataDefinitionObject1.NntpControlMessagesIn.CounterHelpTitleIndex
  906. += dwFirstHelp;
  907. NntpDataDefinitionObject1.NntpControlMessagesIn.CounterOffset =
  908. (DWORD)((LPBYTE)&nntpc1.ControlMessagesIn - (LPBYTE)&nntpc1);
  909. NntpDataDefinitionObject1.NntpControlMessagesFailed.CounterNameTitleIndex
  910. += dwFirstCounter;
  911. NntpDataDefinitionObject1.NntpControlMessagesFailed.CounterHelpTitleIndex
  912. += dwFirstHelp;
  913. NntpDataDefinitionObject1.NntpControlMessagesFailed.CounterOffset =
  914. (DWORD)((LPBYTE)&nntpc1.ControlMessagesFailed - (LPBYTE)&nntpc1);
  915. NntpDataDefinitionObject1.NntpModeratedPostingsSent.CounterNameTitleIndex
  916. += dwFirstCounter;
  917. NntpDataDefinitionObject1.NntpModeratedPostingsSent.CounterHelpTitleIndex
  918. += dwFirstHelp;
  919. NntpDataDefinitionObject1.NntpModeratedPostingsSent.CounterOffset =
  920. (DWORD)((LPBYTE)&nntpc1.ModeratedPostingsSent - (LPBYTE)&nntpc1);
  921. NntpDataDefinitionObject1.NntpModeratedPostingsFailed.CounterNameTitleIndex
  922. += dwFirstCounter;
  923. NntpDataDefinitionObject1.NntpModeratedPostingsFailed.CounterHelpTitleIndex
  924. += dwFirstHelp;
  925. NntpDataDefinitionObject1.NntpModeratedPostingsFailed.CounterOffset =
  926. (DWORD)((LPBYTE)&nntpc1.ModeratedPostingsFailed - (LPBYTE)&nntpc1);
  927. NntpDataDefinitionObject1.NntpSessionsFlowControlled.CounterNameTitleIndex
  928. += dwFirstCounter;
  929. NntpDataDefinitionObject1.NntpSessionsFlowControlled.CounterHelpTitleIndex
  930. += dwFirstHelp;
  931. NntpDataDefinitionObject1.NntpSessionsFlowControlled.CounterOffset =
  932. (DWORD)((LPBYTE)&nntpc1.SessionsFlowControlled - (LPBYTE)&nntpc1);
  933. NntpDataDefinitionObject1.NntpArticlesExpired.CounterNameTitleIndex
  934. += dwFirstCounter;
  935. NntpDataDefinitionObject1.NntpArticlesExpired.CounterHelpTitleIndex
  936. += dwFirstHelp;
  937. NntpDataDefinitionObject1.NntpArticlesExpired.CounterOffset =
  938. (DWORD)((LPBYTE)&nntpc1.ArticlesExpired - (LPBYTE)&nntpc1);
  939. NntpDataDefinitionObject1.NntpArticlesSentPerSec.CounterNameTitleIndex
  940. += dwFirstCounter;
  941. NntpDataDefinitionObject1.NntpArticlesSentPerSec.CounterHelpTitleIndex
  942. += dwFirstHelp;
  943. NntpDataDefinitionObject1.NntpArticlesSentPerSec.CounterOffset =
  944. (DWORD)((LPBYTE)&nntpc1.ArticlesSentPerSec - (LPBYTE)&nntpc1);
  945. NntpDataDefinitionObject1.NntpArticlesReceivedPerSec.CounterNameTitleIndex
  946. += dwFirstCounter;
  947. NntpDataDefinitionObject1.NntpArticlesReceivedPerSec.CounterHelpTitleIndex
  948. += dwFirstHelp;
  949. NntpDataDefinitionObject1.NntpArticlesReceivedPerSec.CounterOffset =
  950. (DWORD)((LPBYTE)&nntpc1.ArticlesReceivedPerSec - (LPBYTE)&nntpc1);
  951. NntpDataDefinitionObject1.NntpArticlesPostedPerSec.CounterNameTitleIndex
  952. += dwFirstCounter;
  953. NntpDataDefinitionObject1.NntpArticlesPostedPerSec.CounterHelpTitleIndex
  954. += dwFirstHelp;
  955. NntpDataDefinitionObject1.NntpArticlesPostedPerSec.CounterOffset =
  956. (DWORD)((LPBYTE)&nntpc1.ArticlesPostedPerSec - (LPBYTE)&nntpc1);
  957. NntpDataDefinitionObject1.NntpArticleMapEntriesPerSec.CounterNameTitleIndex
  958. += dwFirstCounter;
  959. NntpDataDefinitionObject1.NntpArticleMapEntriesPerSec.CounterHelpTitleIndex
  960. += dwFirstHelp;
  961. NntpDataDefinitionObject1.NntpArticleMapEntriesPerSec.CounterOffset =
  962. (DWORD)((LPBYTE)&nntpc1.ArticleMapEntriesPerSec - (LPBYTE)&nntpc1);
  963. NntpDataDefinitionObject1.NntpHistoryMapEntriesPerSec.CounterNameTitleIndex
  964. += dwFirstCounter;
  965. NntpDataDefinitionObject1.NntpHistoryMapEntriesPerSec.CounterHelpTitleIndex
  966. += dwFirstHelp;
  967. NntpDataDefinitionObject1.NntpHistoryMapEntriesPerSec.CounterOffset =
  968. (DWORD)((LPBYTE)&nntpc1.HistoryMapEntriesPerSec - (LPBYTE)&nntpc1);
  969. NntpDataDefinitionObject1.NntpXoverEntriesPerSec.CounterNameTitleIndex
  970. += dwFirstCounter;
  971. NntpDataDefinitionObject1.NntpXoverEntriesPerSec.CounterHelpTitleIndex
  972. += dwFirstHelp;
  973. NntpDataDefinitionObject1.NntpXoverEntriesPerSec.CounterOffset =
  974. (DWORD)((LPBYTE)&nntpc1.XoverEntriesPerSec - (LPBYTE)&nntpc1);
  975. NntpDataDefinitionObject1.NntpArticlesExpiredPerSec.CounterNameTitleIndex
  976. += dwFirstCounter;
  977. NntpDataDefinitionObject1.NntpArticlesExpiredPerSec.CounterHelpTitleIndex
  978. += dwFirstHelp;
  979. NntpDataDefinitionObject1.NntpArticlesExpiredPerSec.CounterOffset =
  980. (DWORD)((LPBYTE)&nntpc1.ArticlesExpiredPerSec - (LPBYTE)&nntpc1);
  981. //
  982. // Update the object & counter name & help indicies for object2
  983. //
  984. NntpDataDefinitionObject2.NntpObjectType.ObjectNameTitleIndex
  985. += dwFirstCounter;
  986. NntpDataDefinitionObject2.NntpObjectType.ObjectHelpTitleIndex
  987. += dwFirstHelp;
  988. NntpDataDefinitionObject2.NntpArticleCmds.CounterNameTitleIndex
  989. += dwFirstCounter;
  990. NntpDataDefinitionObject2.NntpArticleCmds.CounterHelpTitleIndex
  991. += dwFirstHelp;
  992. NntpDataDefinitionObject2.NntpArticleCmds.CounterOffset =
  993. (DWORD)((LPBYTE)&nntpc2.ArticleCmds - (LPBYTE)&nntpc2);
  994. NntpDataDefinitionObject2.NntpArticleCmdsPerSec.CounterNameTitleIndex
  995. += dwFirstCounter;
  996. NntpDataDefinitionObject2.NntpArticleCmdsPerSec.CounterHelpTitleIndex
  997. += dwFirstHelp;
  998. NntpDataDefinitionObject2.NntpArticleCmdsPerSec.CounterOffset =
  999. (DWORD)((LPBYTE)&nntpc2.ArticleCmdsPerSec - (LPBYTE)&nntpc2);
  1000. NntpDataDefinitionObject2.NntpGroupCmds.CounterNameTitleIndex
  1001. += dwFirstCounter;
  1002. NntpDataDefinitionObject2.NntpGroupCmds.CounterHelpTitleIndex
  1003. += dwFirstHelp;
  1004. NntpDataDefinitionObject2.NntpGroupCmds.CounterOffset =
  1005. (DWORD)((LPBYTE)&nntpc2.GroupCmds - (LPBYTE)&nntpc2);
  1006. NntpDataDefinitionObject2.NntpGroupCmdsPerSec.CounterNameTitleIndex
  1007. += dwFirstCounter;
  1008. NntpDataDefinitionObject2.NntpGroupCmdsPerSec.CounterHelpTitleIndex
  1009. += dwFirstHelp;
  1010. NntpDataDefinitionObject2.NntpGroupCmdsPerSec.CounterOffset =
  1011. (DWORD)((LPBYTE)&nntpc2.GroupCmdsPerSec - (LPBYTE)&nntpc2);
  1012. NntpDataDefinitionObject2.NntpHelpCmds.CounterNameTitleIndex
  1013. += dwFirstCounter;
  1014. NntpDataDefinitionObject2.NntpHelpCmds.CounterHelpTitleIndex
  1015. += dwFirstHelp;
  1016. NntpDataDefinitionObject2.NntpHelpCmds.CounterOffset =
  1017. (DWORD)((LPBYTE)&nntpc2.HelpCmds - (LPBYTE)&nntpc2);
  1018. NntpDataDefinitionObject2.NntpHelpCmdsPerSec.CounterNameTitleIndex
  1019. += dwFirstCounter;
  1020. NntpDataDefinitionObject2.NntpHelpCmdsPerSec.CounterHelpTitleIndex
  1021. += dwFirstHelp;
  1022. NntpDataDefinitionObject2.NntpHelpCmdsPerSec.CounterOffset =
  1023. (DWORD)((LPBYTE)&nntpc2.HelpCmdsPerSec - (LPBYTE)&nntpc2);
  1024. NntpDataDefinitionObject2.NntpIHaveCmds.CounterNameTitleIndex
  1025. += dwFirstCounter;
  1026. NntpDataDefinitionObject2.NntpIHaveCmds.CounterHelpTitleIndex
  1027. += dwFirstHelp;
  1028. NntpDataDefinitionObject2.NntpIHaveCmds.CounterOffset =
  1029. (DWORD)((LPBYTE)&nntpc2.IHaveCmds - (LPBYTE)&nntpc2);
  1030. NntpDataDefinitionObject2.NntpIHaveCmdsPerSec.CounterNameTitleIndex
  1031. += dwFirstCounter;
  1032. NntpDataDefinitionObject2.NntpIHaveCmdsPerSec.CounterHelpTitleIndex
  1033. += dwFirstHelp;
  1034. NntpDataDefinitionObject2.NntpIHaveCmdsPerSec.CounterOffset =
  1035. (DWORD)((LPBYTE)&nntpc2.IHaveCmdsPerSec - (LPBYTE)&nntpc2);
  1036. NntpDataDefinitionObject2.NntpLastCmds.CounterNameTitleIndex
  1037. += dwFirstCounter;
  1038. NntpDataDefinitionObject2.NntpLastCmds.CounterHelpTitleIndex
  1039. += dwFirstHelp;
  1040. NntpDataDefinitionObject2.NntpLastCmds.CounterOffset =
  1041. (DWORD)((LPBYTE)&nntpc2.LastCmds - (LPBYTE)&nntpc2);
  1042. NntpDataDefinitionObject2.NntpLastCmdsPerSec.CounterNameTitleIndex
  1043. += dwFirstCounter;
  1044. NntpDataDefinitionObject2.NntpLastCmdsPerSec.CounterHelpTitleIndex
  1045. += dwFirstHelp;
  1046. NntpDataDefinitionObject2.NntpLastCmdsPerSec.CounterOffset =
  1047. (DWORD)((LPBYTE)&nntpc2.LastCmdsPerSec - (LPBYTE)&nntpc2);
  1048. NntpDataDefinitionObject2.NntpListCmds.CounterNameTitleIndex
  1049. += dwFirstCounter;
  1050. NntpDataDefinitionObject2.NntpListCmds.CounterHelpTitleIndex
  1051. += dwFirstHelp;
  1052. NntpDataDefinitionObject2.NntpListCmds.CounterOffset =
  1053. (DWORD)((LPBYTE)&nntpc2.ListCmds - (LPBYTE)&nntpc2);
  1054. NntpDataDefinitionObject2.NntpListCmdsPerSec.CounterNameTitleIndex
  1055. += dwFirstCounter;
  1056. NntpDataDefinitionObject2.NntpListCmdsPerSec.CounterHelpTitleIndex
  1057. += dwFirstHelp;
  1058. NntpDataDefinitionObject2.NntpListCmdsPerSec.CounterOffset =
  1059. (DWORD)((LPBYTE)&nntpc2.ListCmdsPerSec - (LPBYTE)&nntpc2);
  1060. NntpDataDefinitionObject2.NntpNewgroupsCmds.CounterNameTitleIndex
  1061. += dwFirstCounter;
  1062. NntpDataDefinitionObject2.NntpNewgroupsCmds.CounterHelpTitleIndex
  1063. += dwFirstHelp;
  1064. NntpDataDefinitionObject2.NntpNewgroupsCmds.CounterOffset =
  1065. (DWORD)((LPBYTE)&nntpc2.NewgroupsCmds - (LPBYTE)&nntpc2);
  1066. NntpDataDefinitionObject2.NntpNewgroupsCmdsPerSec.CounterNameTitleIndex
  1067. += dwFirstCounter;
  1068. NntpDataDefinitionObject2.NntpNewgroupsCmdsPerSec.CounterHelpTitleIndex
  1069. += dwFirstHelp;
  1070. NntpDataDefinitionObject2.NntpNewgroupsCmdsPerSec.CounterOffset =
  1071. (DWORD)((LPBYTE)&nntpc2.NewgroupsCmdsPerSec - (LPBYTE)&nntpc2);
  1072. NntpDataDefinitionObject2.NntpNewnewsCmds.CounterNameTitleIndex
  1073. += dwFirstCounter;
  1074. NntpDataDefinitionObject2.NntpNewnewsCmds.CounterHelpTitleIndex
  1075. += dwFirstHelp;
  1076. NntpDataDefinitionObject2.NntpNewnewsCmds.CounterOffset =
  1077. (DWORD)((LPBYTE)&nntpc2.NewnewsCmds - (LPBYTE)&nntpc2);
  1078. NntpDataDefinitionObject2.NntpNewnewsCmdsPerSec.CounterNameTitleIndex
  1079. += dwFirstCounter;
  1080. NntpDataDefinitionObject2.NntpNewnewsCmdsPerSec.CounterHelpTitleIndex
  1081. += dwFirstHelp;
  1082. NntpDataDefinitionObject2.NntpNewnewsCmdsPerSec.CounterOffset =
  1083. (DWORD)((LPBYTE)&nntpc2.NewnewsCmdsPerSec - (LPBYTE)&nntpc2);
  1084. NntpDataDefinitionObject2.NntpNextCmds.CounterNameTitleIndex
  1085. += dwFirstCounter;
  1086. NntpDataDefinitionObject2.NntpNextCmds.CounterHelpTitleIndex
  1087. += dwFirstHelp;
  1088. NntpDataDefinitionObject2.NntpNextCmds.CounterOffset =
  1089. (DWORD)((LPBYTE)&nntpc2.NextCmds - (LPBYTE)&nntpc2);
  1090. NntpDataDefinitionObject2.NntpNextCmdsPerSec.CounterNameTitleIndex
  1091. += dwFirstCounter;
  1092. NntpDataDefinitionObject2.NntpNextCmdsPerSec.CounterHelpTitleIndex
  1093. += dwFirstHelp;
  1094. NntpDataDefinitionObject2.NntpNextCmdsPerSec.CounterOffset =
  1095. (DWORD)((LPBYTE)&nntpc2.NextCmdsPerSec - (LPBYTE)&nntpc2);
  1096. NntpDataDefinitionObject2.NntpPostCmds.CounterNameTitleIndex
  1097. += dwFirstCounter;
  1098. NntpDataDefinitionObject2.NntpPostCmds.CounterHelpTitleIndex
  1099. += dwFirstHelp;
  1100. NntpDataDefinitionObject2.NntpPostCmds.CounterOffset =
  1101. (DWORD)((LPBYTE)&nntpc2.PostCmds - (LPBYTE)&nntpc2);
  1102. NntpDataDefinitionObject2.NntpPostCmdsPerSec.CounterNameTitleIndex
  1103. += dwFirstCounter;
  1104. NntpDataDefinitionObject2.NntpPostCmdsPerSec.CounterHelpTitleIndex
  1105. += dwFirstHelp;
  1106. NntpDataDefinitionObject2.NntpPostCmdsPerSec.CounterOffset =
  1107. (DWORD)((LPBYTE)&nntpc2.PostCmdsPerSec - (LPBYTE)&nntpc2);
  1108. NntpDataDefinitionObject2.NntpQuitCmds.CounterNameTitleIndex
  1109. += dwFirstCounter;
  1110. NntpDataDefinitionObject2.NntpQuitCmds.CounterHelpTitleIndex
  1111. += dwFirstHelp;
  1112. NntpDataDefinitionObject2.NntpQuitCmds.CounterOffset =
  1113. (DWORD)((LPBYTE)&nntpc2.QuitCmds - (LPBYTE)&nntpc2);
  1114. NntpDataDefinitionObject2.NntpQuitCmdsPerSec.CounterNameTitleIndex
  1115. += dwFirstCounter;
  1116. NntpDataDefinitionObject2.NntpQuitCmdsPerSec.CounterHelpTitleIndex
  1117. += dwFirstHelp;
  1118. NntpDataDefinitionObject2.NntpQuitCmdsPerSec.CounterOffset =
  1119. (DWORD)((LPBYTE)&nntpc2.QuitCmdsPerSec - (LPBYTE)&nntpc2);
  1120. NntpDataDefinitionObject2.NntpStatCmds.CounterNameTitleIndex
  1121. += dwFirstCounter;
  1122. NntpDataDefinitionObject2.NntpStatCmds.CounterHelpTitleIndex
  1123. += dwFirstHelp;
  1124. NntpDataDefinitionObject2.NntpStatCmds.CounterOffset =
  1125. (DWORD)((LPBYTE)&nntpc2.StatCmds - (LPBYTE)&nntpc2);
  1126. NntpDataDefinitionObject2.NntpStatCmdsPerSec.CounterNameTitleIndex
  1127. += dwFirstCounter;
  1128. NntpDataDefinitionObject2.NntpStatCmdsPerSec.CounterHelpTitleIndex
  1129. += dwFirstHelp;
  1130. NntpDataDefinitionObject2.NntpStatCmdsPerSec.CounterOffset =
  1131. (DWORD)((LPBYTE)&nntpc2.StatCmdsPerSec - (LPBYTE)&nntpc2);
  1132. NntpDataDefinitionObject2.NntpLogonAttempts.CounterNameTitleIndex
  1133. += dwFirstCounter;
  1134. NntpDataDefinitionObject2.NntpLogonAttempts.CounterHelpTitleIndex
  1135. += dwFirstHelp;
  1136. NntpDataDefinitionObject2.NntpLogonAttempts.CounterOffset =
  1137. (DWORD)((LPBYTE)&nntpc2.LogonAttempts - (LPBYTE)&nntpc2);
  1138. NntpDataDefinitionObject2.NntpLogonFailures.CounterNameTitleIndex
  1139. += dwFirstCounter;
  1140. NntpDataDefinitionObject2.NntpLogonFailures.CounterHelpTitleIndex
  1141. += dwFirstHelp;
  1142. NntpDataDefinitionObject2.NntpLogonFailures.CounterOffset =
  1143. (DWORD)((LPBYTE)&nntpc2.LogonFailures - (LPBYTE)&nntpc2);
  1144. NntpDataDefinitionObject2.NntpLogonAttemptsPerSec.CounterNameTitleIndex
  1145. += dwFirstCounter;
  1146. NntpDataDefinitionObject2.NntpLogonAttemptsPerSec.CounterHelpTitleIndex
  1147. += dwFirstHelp;
  1148. NntpDataDefinitionObject2.NntpLogonAttemptsPerSec.CounterOffset =
  1149. (DWORD)((LPBYTE)&nntpc2.LogonAttemptsPerSec - (LPBYTE)&nntpc2);
  1150. NntpDataDefinitionObject2.NntpLogonFailuresPerSec.CounterNameTitleIndex
  1151. += dwFirstCounter;
  1152. NntpDataDefinitionObject2.NntpLogonFailuresPerSec.CounterHelpTitleIndex
  1153. += dwFirstHelp;
  1154. NntpDataDefinitionObject2.NntpLogonFailuresPerSec.CounterOffset =
  1155. (DWORD)((LPBYTE)&nntpc2.LogonFailuresPerSec - (LPBYTE)&nntpc2);
  1156. NntpDataDefinitionObject2.NntpCheckCmds.CounterNameTitleIndex
  1157. += dwFirstCounter;
  1158. NntpDataDefinitionObject2.NntpCheckCmds.CounterHelpTitleIndex
  1159. += dwFirstHelp;
  1160. NntpDataDefinitionObject2.NntpCheckCmds.CounterOffset =
  1161. (DWORD)((LPBYTE)&nntpc2.CheckCmds - (LPBYTE)&nntpc2);
  1162. NntpDataDefinitionObject2.NntpCheckCmdsPerSec.CounterNameTitleIndex
  1163. += dwFirstCounter;
  1164. NntpDataDefinitionObject2.NntpCheckCmdsPerSec.CounterHelpTitleIndex
  1165. += dwFirstHelp;
  1166. NntpDataDefinitionObject2.NntpCheckCmdsPerSec.CounterOffset =
  1167. (DWORD)((LPBYTE)&nntpc2.CheckCmdsPerSec - (LPBYTE)&nntpc2);
  1168. NntpDataDefinitionObject2.NntpTakethisCmds.CounterNameTitleIndex
  1169. += dwFirstCounter;
  1170. NntpDataDefinitionObject2.NntpTakethisCmds.CounterHelpTitleIndex
  1171. += dwFirstHelp;
  1172. NntpDataDefinitionObject2.NntpTakethisCmds.CounterOffset =
  1173. (DWORD)((LPBYTE)&nntpc2.TakethisCmds - (LPBYTE)&nntpc2);
  1174. NntpDataDefinitionObject2.NntpTakethisCmdsPerSec.CounterNameTitleIndex
  1175. += dwFirstCounter;
  1176. NntpDataDefinitionObject2.NntpTakethisCmdsPerSec.CounterHelpTitleIndex
  1177. += dwFirstHelp;
  1178. NntpDataDefinitionObject2.NntpTakethisCmdsPerSec.CounterOffset =
  1179. (DWORD)((LPBYTE)&nntpc2.TakethisCmdsPerSec - (LPBYTE)&nntpc2);
  1180. NntpDataDefinitionObject2.NntpModeCmds.CounterNameTitleIndex
  1181. += dwFirstCounter;
  1182. NntpDataDefinitionObject2.NntpModeCmds.CounterHelpTitleIndex
  1183. += dwFirstHelp;
  1184. NntpDataDefinitionObject2.NntpModeCmds.CounterOffset =
  1185. (DWORD)((LPBYTE)&nntpc2.ModeCmds - (LPBYTE)&nntpc2);
  1186. NntpDataDefinitionObject2.NntpModeCmdsPerSec.CounterNameTitleIndex
  1187. += dwFirstCounter;
  1188. NntpDataDefinitionObject2.NntpModeCmdsPerSec.CounterHelpTitleIndex
  1189. += dwFirstHelp;
  1190. NntpDataDefinitionObject2.NntpModeCmdsPerSec.CounterOffset =
  1191. (DWORD)((LPBYTE)&nntpc2.ModeCmdsPerSec - (LPBYTE)&nntpc2);
  1192. NntpDataDefinitionObject2.NntpSearchCmds.CounterNameTitleIndex
  1193. += dwFirstCounter;
  1194. NntpDataDefinitionObject2.NntpSearchCmds.CounterHelpTitleIndex
  1195. += dwFirstHelp;
  1196. NntpDataDefinitionObject2.NntpSearchCmds.CounterOffset =
  1197. (DWORD)((LPBYTE)&nntpc2.SearchCmds - (LPBYTE)&nntpc2);
  1198. NntpDataDefinitionObject2.NntpSearchCmdsPerSec.CounterNameTitleIndex
  1199. += dwFirstCounter;
  1200. NntpDataDefinitionObject2.NntpSearchCmdsPerSec.CounterHelpTitleIndex
  1201. += dwFirstHelp;
  1202. NntpDataDefinitionObject2.NntpSearchCmdsPerSec.CounterOffset =
  1203. (DWORD)((LPBYTE)&nntpc2.SearchCmdsPerSec - (LPBYTE)&nntpc2);
  1204. NntpDataDefinitionObject2.NntpXHdrCmds.CounterNameTitleIndex
  1205. += dwFirstCounter;
  1206. NntpDataDefinitionObject2.NntpXHdrCmds.CounterHelpTitleIndex
  1207. += dwFirstHelp;
  1208. NntpDataDefinitionObject2.NntpXHdrCmds.CounterOffset =
  1209. (DWORD)((LPBYTE)&nntpc2.XHdrCmds - (LPBYTE)&nntpc2);
  1210. NntpDataDefinitionObject2.NntpXHdrCmdsPerSec.CounterNameTitleIndex
  1211. += dwFirstCounter;
  1212. NntpDataDefinitionObject2.NntpXHdrCmdsPerSec.CounterHelpTitleIndex
  1213. += dwFirstHelp;
  1214. NntpDataDefinitionObject2.NntpXHdrCmdsPerSec.CounterOffset =
  1215. (DWORD)((LPBYTE)&nntpc2.XHdrCmdsPerSec - (LPBYTE)&nntpc2);
  1216. NntpDataDefinitionObject2.NntpXOverCmds.CounterNameTitleIndex
  1217. += dwFirstCounter;
  1218. NntpDataDefinitionObject2.NntpXOverCmds.CounterHelpTitleIndex
  1219. += dwFirstHelp;
  1220. NntpDataDefinitionObject2.NntpXOverCmds.CounterOffset =
  1221. (DWORD)((LPBYTE)&nntpc2.XOverCmds - (LPBYTE)&nntpc2);
  1222. NntpDataDefinitionObject2.NntpXOverCmdsPerSec.CounterNameTitleIndex
  1223. += dwFirstCounter;
  1224. NntpDataDefinitionObject2.NntpXOverCmdsPerSec.CounterHelpTitleIndex
  1225. += dwFirstHelp;
  1226. NntpDataDefinitionObject2.NntpXOverCmdsPerSec.CounterOffset =
  1227. (DWORD)((LPBYTE)&nntpc2.XOverCmdsPerSec - (LPBYTE)&nntpc2);
  1228. NntpDataDefinitionObject2.NntpXPatCmds.CounterNameTitleIndex
  1229. += dwFirstCounter;
  1230. NntpDataDefinitionObject2.NntpXPatCmds.CounterHelpTitleIndex
  1231. += dwFirstHelp;
  1232. NntpDataDefinitionObject2.NntpXPatCmds.CounterOffset =
  1233. (DWORD)((LPBYTE)&nntpc2.XPatCmds - (LPBYTE)&nntpc2);
  1234. NntpDataDefinitionObject2.NntpXPatCmdsPerSec.CounterNameTitleIndex
  1235. += dwFirstCounter;
  1236. NntpDataDefinitionObject2.NntpXPatCmdsPerSec.CounterHelpTitleIndex
  1237. += dwFirstHelp;
  1238. NntpDataDefinitionObject2.NntpXPatCmdsPerSec.CounterOffset =
  1239. (DWORD)((LPBYTE)&nntpc2.XPatCmdsPerSec - (LPBYTE)&nntpc2);
  1240. NntpDataDefinitionObject2.NntpXReplicCmds.CounterNameTitleIndex
  1241. += dwFirstCounter;
  1242. NntpDataDefinitionObject2.NntpXReplicCmds.CounterHelpTitleIndex
  1243. += dwFirstHelp;
  1244. NntpDataDefinitionObject2.NntpXReplicCmds.CounterOffset =
  1245. (DWORD)((LPBYTE)&nntpc2.XReplicCmds - (LPBYTE)&nntpc2);
  1246. NntpDataDefinitionObject2.NntpXReplicCmdsPerSec.CounterNameTitleIndex
  1247. += dwFirstCounter;
  1248. NntpDataDefinitionObject2.NntpXReplicCmdsPerSec.CounterHelpTitleIndex
  1249. += dwFirstHelp;
  1250. NntpDataDefinitionObject2.NntpXReplicCmdsPerSec.CounterOffset =
  1251. (DWORD)((LPBYTE)&nntpc2.XReplicCmdsPerSec - (LPBYTE)&nntpc2);
  1252. }