Source code of Windows XP (NT5)
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.

1621 lines
71 KiB

  1. /*++
  2. Copyright (c) 1998 Microsoft Corporation
  3. Module Name:
  4. dnsperf.c
  5. Abstract:
  6. This file implements the Extensible Objects for the DNS object type
  7. Created:
  8. Jing Chen 1998
  9. Revision History
  10. --*/
  11. //
  12. // Include Files
  13. //
  14. #include <nt.h>
  15. #include <ntrtl.h>
  16. #include <nturtl.h>
  17. #include <windows.h>
  18. #include <rpc.h>
  19. #include <wchar.h>
  20. #include <winperf.h>
  21. #include "perfutil.h"
  22. #include "datadns.h"
  23. #include "dnsperf.h"
  24. #include "perfconfig.h"
  25. #include "dnslibp.h" // security routine
  26. #define SERVICE_NAME "DNS"
  27. //
  28. // DNS counter data structures
  29. //
  30. DWORD dwOpenCount = 0; // count of "Open" threads
  31. BOOL bInitOK = FALSE; // true = DLL initialized OK
  32. HANDLE hDnsSharedMemory = NULL; // Handle of Dns Shared Memory
  33. PDWORD pCounterBlock = NULL;
  34. extern DNS_DATA_DEFINITION DnsDataDefinition;
  35. //
  36. // Function Prototypes
  37. //
  38. // these are used to insure that the data collection functions
  39. // accessed by Perflib will have the correct calling format.
  40. //
  41. PM_OPEN_PROC OpenDnsPerformanceData;
  42. PM_COLLECT_PROC CollectDnsPerformanceData;
  43. PM_CLOSE_PROC CloseDnsPerformanceData;
  44. DWORD
  45. OpenDnsPerformanceData(
  46. IN LPWSTR lpDeviceNames
  47. )
  48. /*++
  49. Routine Description:
  50. This routine will open and map the memory used by the DNS to
  51. pass performance data in. This routine also initializes the data
  52. structures used to pass data back to the registry
  53. Arguments:
  54. Pointer to object ID of each device to be opened (DNS), which
  55. seems to be totally unused, just as it was in the sample code
  56. from which this is stolen.
  57. Return Value:
  58. None.
  59. --*/
  60. {
  61. LONG status;
  62. HKEY hKeyDriverPerf = NULL;
  63. DWORD size;
  64. DWORD type;
  65. DWORD dwFirstCounter;
  66. DWORD dwFirstHelp;
  67. //
  68. // Since SCREG is multi-threaded and will call this routine in
  69. // order to service remote performance queries, this library
  70. // must keep track of how many times it has been opened (i.e.
  71. // how many threads have accessed it). the registry routines will
  72. // limit access to the initialization routine to only one thread
  73. // at a time so synchronization (i.e. reentrancy) should not be
  74. // a problem
  75. //
  76. // DNS_FIX0: possible MT issues in dnsperf
  77. // - thread counter is not protected, needs Interlocked instruction
  78. // - contrary to above, reentrancy is not protected as we do
  79. // file mapping first
  80. // - file mapping not cleaned up on failure
  81. // - registry handle not cleaned up on failure
  82. //
  83. if ( !dwOpenCount )
  84. {
  85. // open shared memory used by device driver to pass performance values
  86. hDnsSharedMemory = OpenFileMapping(
  87. FILE_MAP_READ,
  88. FALSE,
  89. DNS_PERF_COUNTER_BLOCK );
  90. pCounterBlock = NULL; // initialize pointer to memory
  91. if ( hDnsSharedMemory == NULL )
  92. {
  93. #if 0
  94. //
  95. // kill off NULL DACL code
  96. //
  97. /* maybe the DNS isn't running, and we should alloc the memory? */
  98. SECURITY_ATTRIBUTES SA, *pSA;
  99. BYTE rgbSD[SECURITY_DESCRIPTOR_MIN_LENGTH];
  100. PSECURITY_DESCRIPTOR pSD = (PSECURITY_DESCRIPTOR) rgbSD;
  101. pSA = &SA;
  102. pSA->nLength = sizeof(SA);
  103. pSA->lpSecurityDescriptor = pSD;
  104. pSA->bInheritHandle = FALSE;
  105. if ( !InitializeSecurityDescriptor(
  106. pSD,
  107. SECURITY_DESCRIPTOR_REVISION) ||
  108. ! SetSecurityDescriptorDacl( pSD, TRUE, (PACL) NULL, FALSE) )
  109. {
  110. pSA = NULL;
  111. }
  112. #endif
  113. //
  114. // create security on perfmon mapped file
  115. //
  116. // security will be AuthenticatedUsers get to read
  117. // note, using array syntax, to make it easier to tweak
  118. // if want other ACLs later
  119. //
  120. SID_IDENTIFIER_AUTHORITY ntAuthority = SECURITY_NT_AUTHORITY;
  121. SECURITY_ATTRIBUTES secAttr;
  122. PSECURITY_ATTRIBUTES psecAttr = NULL;
  123. PSECURITY_DESCRIPTOR psd = NULL;
  124. DWORD maskArray[ 3 ] = { 0 };
  125. PSID sidArray[ 3 ] = { 0 }; // NULL terminated!
  126. INT i;
  127. maskArray[ 0 ] = GENERIC_READ;
  128. status = RtlAllocateAndInitializeSid(
  129. &ntAuthority,
  130. 1,
  131. SECURITY_AUTHENTICATED_USER_RID,
  132. 0, 0, 0, 0, 0, 0, 0,
  133. &sidArray[ 0 ] );
  134. if ( status != ERROR_SUCCESS )
  135. {
  136. maskArray[ 1 ] = GENERIC_ALL;
  137. status = RtlAllocateAndInitializeSid(
  138. &ntAuthority,
  139. 1,
  140. SECURITY_LOCAL_SYSTEM_RID,
  141. 0, 0, 0, 0, 0, 0, 0,
  142. &sidArray[ 1 ] );
  143. }
  144. if ( status != ERROR_SUCCESS )
  145. {
  146. DNS_PRINT((
  147. "ERROR <%lu>: Cannot create Authenticated Users SID\n",
  148. status ));
  149. }
  150. else
  151. {
  152. status = Dns_CreateSecurityDescriptor(
  153. &psd,
  154. 2, // number of ACEs
  155. sidArray,
  156. maskArray );
  157. if ( status == ERROR_SUCCESS )
  158. {
  159. secAttr.lpSecurityDescriptor = psd;
  160. secAttr.bInheritHandle = FALSE;
  161. secAttr.nLength = sizeof(SECURITY_ATTRIBUTES);
  162. psecAttr = &secAttr;
  163. }
  164. ELSE
  165. {
  166. DNSDBG( ANY, (
  167. "ERROR: <%d> failed SD create for perfmon memory!\n",
  168. status ));
  169. }
  170. }
  171. hDnsSharedMemory = CreateFileMapping(
  172. (HANDLE) (-1),
  173. psecAttr,
  174. PAGE_READWRITE,
  175. 0,
  176. 4096,
  177. DNS_PERF_COUNTER_BLOCK);
  178. for ( i = 0; sidArray[ i ]; ++i )
  179. {
  180. RtlFreeSid( sidArray[ i ] );
  181. }
  182. if ( psd )
  183. {
  184. Dns_Free( psd );
  185. }
  186. }
  187. // log error if unsuccessful
  188. if ( hDnsSharedMemory == NULL )
  189. {
  190. // this is fatal, if we can't get data then there's no
  191. // point in continuing.
  192. status = GetLastError(); // return error
  193. goto OpenFailed;
  194. }
  195. else
  196. {
  197. // if opened ok, then map pointer to memory
  198. pCounterBlock = (PDWORD) MapViewOfFile(
  199. hDnsSharedMemory,
  200. FILE_MAP_READ,
  201. 0,
  202. 0,
  203. 0);
  204. if (pCounterBlock == NULL)
  205. {
  206. // this is fatal, if we can't get data then there's no
  207. // point in continuing.
  208. status = GetLastError(); // return error
  209. goto OpenFailed;
  210. }
  211. }
  212. // get counter and help index base values from registry
  213. // Open key to registry entry
  214. // read First Counter and First Help values
  215. // update static data strucutures by adding base to
  216. // offset value in structure.
  217. status = RegOpenKeyEx(
  218. HKEY_LOCAL_MACHINE,
  219. "SYSTEM\\CurrentControlSet\\Services\\" SERVICE_NAME "\\Performance",
  220. 0L,
  221. KEY_READ,
  222. &hKeyDriverPerf);
  223. if (status != ERROR_SUCCESS)
  224. {
  225. LPTSTR apsz[2];
  226. // this is fatal, if we can't get the base values of the
  227. // counter or help names, then the names won't be available
  228. // to the requesting application so there's not much
  229. // point in continuing.
  230. apsz[0] = (LPTSTR) (LONG_PTR) status;
  231. apsz[1] = "SYSTEM\\CurrentControlSet\\Services\\" SERVICE_NAME "\\Performance";
  232. goto OpenFailed;
  233. }
  234. size = sizeof (DWORD);
  235. status = RegQueryValueEx(
  236. hKeyDriverPerf,
  237. "First Counter",
  238. 0L,
  239. &type,
  240. (LPBYTE)&dwFirstCounter,
  241. &size);
  242. if (status != ERROR_SUCCESS) {
  243. LPTSTR apsz[2];
  244. // this is fatal, if we can't get the base values of the
  245. // counter or help names, then the names won't be available
  246. // to the requesting application so there's not much
  247. // point in continuing.
  248. apsz[0] = (LPTSTR) (LONG_PTR) status;
  249. apsz[1] = "First Counter";
  250. goto OpenFailed;
  251. }
  252. size = sizeof (DWORD);
  253. status = RegQueryValueEx(
  254. hKeyDriverPerf,
  255. "First Help",
  256. 0L,
  257. &type,
  258. (LPBYTE)&dwFirstHelp,
  259. &size);
  260. if (status != ERROR_SUCCESS)
  261. {
  262. LPTSTR apsz[2];
  263. // this is fatal, if we can't get the base values of the
  264. // counter or help names, then the names won't be available
  265. // to the requesting application so there's not much
  266. // point in continuing.
  267. apsz[0] = (LPTSTR) (LONG_PTR) status;
  268. apsz[1] = "First Help";
  269. goto OpenFailed;
  270. }
  271. //
  272. // NOTE: the initialization program could also retrieve
  273. // LastCounter and LastHelp if they wanted to do
  274. // bounds checking on the new number. e.g.
  275. //
  276. // counter->CounterNameTitleIndex += dwFirstCounter;
  277. // if (counter->CounterNameTitleIndex > dwLastCounter) {
  278. // LogErrorToEventLog (INDEX_OUT_OF_BOUNDS);
  279. // }
  280. DnsDataDefinition.DnsObjectType.ObjectNameTitleIndex += dwFirstCounter;
  281. DnsDataDefinition.DnsObjectType.ObjectHelpTitleIndex += dwFirstHelp;
  282. DnsDataDefinition.TotalQueryReceived.CounterNameTitleIndex += dwFirstCounter;
  283. DnsDataDefinition.TotalQueryReceived.CounterHelpTitleIndex += dwFirstHelp;
  284. DnsDataDefinition.TotalQueryReceived_s.CounterNameTitleIndex += dwFirstCounter;
  285. DnsDataDefinition.TotalQueryReceived_s.CounterHelpTitleIndex += dwFirstHelp;
  286. DnsDataDefinition.UdpQueryReceived.CounterNameTitleIndex += dwFirstCounter;
  287. DnsDataDefinition.UdpQueryReceived.CounterHelpTitleIndex += dwFirstHelp;
  288. DnsDataDefinition.UdpQueryReceived_s.CounterNameTitleIndex += dwFirstCounter;
  289. DnsDataDefinition.UdpQueryReceived_s.CounterHelpTitleIndex += dwFirstHelp;
  290. DnsDataDefinition.TcpQueryReceived.CounterNameTitleIndex += dwFirstCounter;
  291. DnsDataDefinition.TcpQueryReceived.CounterHelpTitleIndex += dwFirstHelp;
  292. DnsDataDefinition.TcpQueryReceived_s.CounterNameTitleIndex += dwFirstCounter;
  293. DnsDataDefinition.TcpQueryReceived_s.CounterHelpTitleIndex += dwFirstHelp;
  294. DnsDataDefinition.TotalResponseSent.CounterNameTitleIndex += dwFirstCounter;
  295. DnsDataDefinition.TotalResponseSent.CounterHelpTitleIndex += dwFirstHelp;
  296. DnsDataDefinition.TotalResponseSent_s.CounterNameTitleIndex += dwFirstCounter;
  297. DnsDataDefinition.TotalResponseSent_s.CounterHelpTitleIndex += dwFirstHelp;
  298. DnsDataDefinition.UdpResponseSent.CounterNameTitleIndex += dwFirstCounter;
  299. DnsDataDefinition.UdpResponseSent.CounterHelpTitleIndex += dwFirstHelp;
  300. DnsDataDefinition.UdpResponseSent_s.CounterNameTitleIndex += dwFirstCounter;
  301. DnsDataDefinition.UdpResponseSent_s.CounterHelpTitleIndex += dwFirstHelp;
  302. DnsDataDefinition.TcpResponseSent.CounterNameTitleIndex += dwFirstCounter;
  303. DnsDataDefinition.TcpResponseSent.CounterHelpTitleIndex += dwFirstHelp;
  304. DnsDataDefinition.TcpResponseSent_s.CounterNameTitleIndex += dwFirstCounter;
  305. DnsDataDefinition.TcpResponseSent_s.CounterHelpTitleIndex += dwFirstHelp;
  306. DnsDataDefinition.RecursiveQueries.CounterNameTitleIndex += dwFirstCounter;
  307. DnsDataDefinition.RecursiveQueries.CounterHelpTitleIndex += dwFirstHelp;
  308. DnsDataDefinition.RecursiveQueries_s.CounterNameTitleIndex += dwFirstCounter;
  309. DnsDataDefinition.RecursiveQueries_s.CounterHelpTitleIndex += dwFirstHelp;
  310. DnsDataDefinition.RecursiveTimeOut.CounterNameTitleIndex += dwFirstCounter;
  311. DnsDataDefinition.RecursiveTimeOut.CounterHelpTitleIndex += dwFirstHelp;
  312. DnsDataDefinition.RecursiveTimeOut_s.CounterNameTitleIndex += dwFirstCounter;
  313. DnsDataDefinition.RecursiveTimeOut_s.CounterHelpTitleIndex += dwFirstHelp;
  314. DnsDataDefinition.RecursiveQueryFailure.CounterNameTitleIndex += dwFirstCounter;
  315. DnsDataDefinition.RecursiveQueryFailure.CounterHelpTitleIndex += dwFirstHelp;
  316. DnsDataDefinition.RecursiveQueryFailure_s.CounterNameTitleIndex += dwFirstCounter;
  317. DnsDataDefinition.RecursiveQueryFailure_s.CounterHelpTitleIndex += dwFirstHelp;
  318. DnsDataDefinition.NotifySent.CounterNameTitleIndex += dwFirstCounter;
  319. DnsDataDefinition.NotifySent.CounterHelpTitleIndex += dwFirstHelp;
  320. DnsDataDefinition.ZoneTransferRequestReceived.CounterNameTitleIndex += dwFirstCounter;
  321. DnsDataDefinition.ZoneTransferRequestReceived.CounterHelpTitleIndex += dwFirstHelp;
  322. DnsDataDefinition.ZoneTransferSuccess.CounterNameTitleIndex += dwFirstCounter;
  323. DnsDataDefinition.ZoneTransferSuccess.CounterHelpTitleIndex += dwFirstHelp;
  324. DnsDataDefinition.ZoneTransferFailure.CounterNameTitleIndex += dwFirstCounter;
  325. DnsDataDefinition.ZoneTransferFailure.CounterHelpTitleIndex += dwFirstHelp;
  326. DnsDataDefinition.AxfrRequestReceived.CounterNameTitleIndex += dwFirstCounter;
  327. DnsDataDefinition.AxfrRequestReceived.CounterHelpTitleIndex += dwFirstHelp;
  328. DnsDataDefinition.AxfrSuccessSent.CounterNameTitleIndex += dwFirstCounter;
  329. DnsDataDefinition.AxfrSuccessSent.CounterHelpTitleIndex += dwFirstHelp;
  330. DnsDataDefinition.IxfrRequestReceived.CounterNameTitleIndex += dwFirstCounter;
  331. DnsDataDefinition.IxfrRequestReceived.CounterHelpTitleIndex += dwFirstHelp;
  332. DnsDataDefinition.IxfrSuccessSent.CounterNameTitleIndex += dwFirstCounter;
  333. DnsDataDefinition.IxfrSuccessSent.CounterHelpTitleIndex += dwFirstHelp;
  334. DnsDataDefinition.NotifyReceived.CounterNameTitleIndex += dwFirstCounter;
  335. DnsDataDefinition.NotifyReceived.CounterHelpTitleIndex += dwFirstHelp;
  336. DnsDataDefinition.ZoneTransferSoaRequestSent.CounterNameTitleIndex += dwFirstCounter;
  337. DnsDataDefinition.ZoneTransferSoaRequestSent.CounterHelpTitleIndex += dwFirstHelp;
  338. DnsDataDefinition.AxfrRequestSent.CounterNameTitleIndex += dwFirstCounter;
  339. DnsDataDefinition.AxfrRequestSent.CounterHelpTitleIndex += dwFirstHelp;
  340. DnsDataDefinition.AxfrResponseReceived.CounterNameTitleIndex += dwFirstCounter;
  341. DnsDataDefinition.AxfrResponseReceived.CounterHelpTitleIndex += dwFirstHelp;
  342. DnsDataDefinition.AxfrSuccessReceived.CounterNameTitleIndex += dwFirstCounter;
  343. DnsDataDefinition.AxfrSuccessReceived.CounterHelpTitleIndex += dwFirstHelp;
  344. DnsDataDefinition.IxfrRequestSent.CounterNameTitleIndex += dwFirstCounter;
  345. DnsDataDefinition.IxfrRequestSent.CounterHelpTitleIndex += dwFirstHelp;
  346. DnsDataDefinition.IxfrResponseReceived.CounterNameTitleIndex += dwFirstCounter;
  347. DnsDataDefinition.IxfrResponseReceived.CounterHelpTitleIndex += dwFirstHelp;
  348. DnsDataDefinition.IxfrSuccessReceived.CounterNameTitleIndex += dwFirstCounter;
  349. DnsDataDefinition.IxfrSuccessReceived.CounterHelpTitleIndex += dwFirstHelp;
  350. DnsDataDefinition.IxfrUdpSuccessReceived.CounterNameTitleIndex += dwFirstCounter;
  351. DnsDataDefinition.IxfrUdpSuccessReceived.CounterHelpTitleIndex += dwFirstHelp;
  352. DnsDataDefinition.IxfrTcpSuccessReceived.CounterNameTitleIndex += dwFirstCounter;
  353. DnsDataDefinition.IxfrTcpSuccessReceived.CounterHelpTitleIndex += dwFirstHelp;
  354. DnsDataDefinition.WinsLookupReceived.CounterNameTitleIndex += dwFirstCounter;
  355. DnsDataDefinition.WinsLookupReceived.CounterHelpTitleIndex += dwFirstHelp;
  356. DnsDataDefinition.WinsLookupReceived_s.CounterNameTitleIndex += dwFirstCounter;
  357. DnsDataDefinition.WinsLookupReceived_s.CounterHelpTitleIndex += dwFirstHelp;
  358. DnsDataDefinition.WinsResponseSent.CounterNameTitleIndex += dwFirstCounter;
  359. DnsDataDefinition.WinsResponseSent.CounterHelpTitleIndex += dwFirstHelp;
  360. DnsDataDefinition.WinsResponseSent_s.CounterNameTitleIndex += dwFirstCounter;
  361. DnsDataDefinition.WinsResponseSent_s.CounterHelpTitleIndex += dwFirstHelp;
  362. DnsDataDefinition.WinsReverseLookupReceived.CounterNameTitleIndex += dwFirstCounter;
  363. DnsDataDefinition.WinsReverseLookupReceived.CounterHelpTitleIndex += dwFirstHelp;
  364. DnsDataDefinition.WinsReverseLookupReceived_s.CounterNameTitleIndex += dwFirstCounter;
  365. DnsDataDefinition.WinsReverseLookupReceived_s.CounterHelpTitleIndex += dwFirstHelp;
  366. DnsDataDefinition.WinsReverseResponseSent.CounterNameTitleIndex += dwFirstCounter;
  367. DnsDataDefinition.WinsReverseResponseSent.CounterHelpTitleIndex += dwFirstHelp;
  368. DnsDataDefinition.WinsReverseResponseSent_s.CounterNameTitleIndex += dwFirstCounter;
  369. DnsDataDefinition.WinsReverseResponseSent_s.CounterHelpTitleIndex += dwFirstHelp;
  370. DnsDataDefinition.DynamicUpdateReceived.CounterNameTitleIndex += dwFirstCounter;
  371. DnsDataDefinition.DynamicUpdateReceived.CounterHelpTitleIndex += dwFirstHelp;
  372. DnsDataDefinition.DynamicUpdateReceived_s.CounterNameTitleIndex += dwFirstCounter;
  373. DnsDataDefinition.DynamicUpdateReceived_s.CounterHelpTitleIndex += dwFirstHelp;
  374. DnsDataDefinition.DynamicUpdateNoOp.CounterNameTitleIndex += dwFirstCounter;
  375. DnsDataDefinition.DynamicUpdateNoOp.CounterHelpTitleIndex += dwFirstHelp;
  376. DnsDataDefinition.DynamicUpdateNoOp_s.CounterNameTitleIndex += dwFirstCounter;
  377. DnsDataDefinition.DynamicUpdateNoOp_s.CounterHelpTitleIndex += dwFirstHelp;
  378. DnsDataDefinition.DynamicUpdateWriteToDB.CounterNameTitleIndex += dwFirstCounter;
  379. DnsDataDefinition.DynamicUpdateWriteToDB.CounterHelpTitleIndex += dwFirstHelp;
  380. DnsDataDefinition.DynamicUpdateWriteToDB_s.CounterNameTitleIndex += dwFirstCounter;
  381. DnsDataDefinition.DynamicUpdateWriteToDB_s.CounterHelpTitleIndex += dwFirstHelp;
  382. DnsDataDefinition.DynamicUpdateRejected.CounterNameTitleIndex += dwFirstCounter;
  383. DnsDataDefinition.DynamicUpdateRejected.CounterHelpTitleIndex += dwFirstHelp;
  384. DnsDataDefinition.DynamicUpdateTimeOut.CounterNameTitleIndex += dwFirstCounter;
  385. DnsDataDefinition.DynamicUpdateTimeOut.CounterHelpTitleIndex += dwFirstHelp;
  386. DnsDataDefinition.DynamicUpdateQueued.CounterNameTitleIndex += dwFirstCounter;
  387. DnsDataDefinition.DynamicUpdateQueued.CounterHelpTitleIndex += dwFirstHelp;
  388. DnsDataDefinition.SecureUpdateReceived.CounterNameTitleIndex += dwFirstCounter;
  389. DnsDataDefinition.SecureUpdateReceived.CounterHelpTitleIndex += dwFirstHelp;
  390. DnsDataDefinition.SecureUpdateReceived_s.CounterNameTitleIndex += dwFirstCounter;
  391. DnsDataDefinition.SecureUpdateReceived_s.CounterHelpTitleIndex += dwFirstHelp;
  392. DnsDataDefinition.SecureUpdateFailure.CounterNameTitleIndex += dwFirstCounter;
  393. DnsDataDefinition.SecureUpdateFailure.CounterHelpTitleIndex += dwFirstHelp;
  394. DnsDataDefinition.DatabaseNodeMemory.CounterNameTitleIndex += dwFirstCounter;
  395. DnsDataDefinition.DatabaseNodeMemory.CounterHelpTitleIndex += dwFirstHelp;
  396. DnsDataDefinition.RecordFlowMemory.CounterNameTitleIndex += dwFirstCounter;
  397. DnsDataDefinition.RecordFlowMemory.CounterHelpTitleIndex += dwFirstHelp;
  398. DnsDataDefinition.CachingMemory.CounterNameTitleIndex += dwFirstCounter;
  399. DnsDataDefinition.CachingMemory.CounterHelpTitleIndex += dwFirstHelp;
  400. DnsDataDefinition.UdpMessageMemory.CounterNameTitleIndex += dwFirstCounter;
  401. DnsDataDefinition.UdpMessageMemory.CounterHelpTitleIndex += dwFirstHelp;
  402. DnsDataDefinition.TcpMessageMemory.CounterNameTitleIndex += dwFirstCounter;
  403. DnsDataDefinition.TcpMessageMemory.CounterHelpTitleIndex += dwFirstHelp;
  404. DnsDataDefinition.NbstatMemory.CounterNameTitleIndex += dwFirstCounter;
  405. DnsDataDefinition.NbstatMemory.CounterHelpTitleIndex += dwFirstHelp;
  406. RegCloseKey( hKeyDriverPerf ); // close key to registry
  407. bInitOK = TRUE; // ok to use this function
  408. }
  409. dwOpenCount++; // increment OPEN counter
  410. return( ERROR_SUCCESS ); // for successful exit
  411. OpenFailed:
  412. //
  413. // close handles if open fails
  414. //
  415. if ( hKeyDriverPerf )
  416. {
  417. RegCloseKey( hKeyDriverPerf );
  418. }
  419. if ( pCounterBlock )
  420. {
  421. UnmapViewOfFile( pCounterBlock );
  422. pCounterBlock = NULL;
  423. }
  424. if ( hDnsSharedMemory )
  425. {
  426. CloseHandle( hDnsSharedMemory );
  427. hDnsSharedMemory = NULL;
  428. }
  429. return status;
  430. }
  431. DWORD
  432. CollectDnsPerformanceData(
  433. IN LPWSTR lpValueName,
  434. IN OUT LPVOID * lppData,
  435. IN OUT LPDWORD lpcbTotalBytes,
  436. IN OUT LPDWORD lpNumObjectTypes
  437. )
  438. /*++
  439. Routine Description:
  440. This routine will return the data for the DNS counters.
  441. Arguments:
  442. IN LPWSTR lpValueName
  443. pointer to a wide character string passed by registry.
  444. IN OUT LPVOID *lppData
  445. IN: pointer to the address of the buffer to receive the completed
  446. PerfDataBlock and subordinate structures. This routine will
  447. append its data to the buffer starting at the point referenced
  448. by *lppData.
  449. OUT: points to the first byte after the data structure added by this
  450. routine. This routine updated the value at lppdata after appending
  451. its data.
  452. IN OUT LPDWORD lpcbTotalBytes
  453. IN: the address of the DWORD that tells the size in bytes of the
  454. buffer referenced by the lppData argument
  455. OUT: the number of bytes added by this routine is writted to the
  456. DWORD pointed to by this argument
  457. IN OUT LPDWORD NumObjectTypes
  458. IN: the address of the DWORD to receive the number of objects added
  459. by this routine
  460. OUT: the number of objects added by this routine is writted to the
  461. DWORD pointed to by this argument
  462. Return Value:
  463. ERROR_MORE_DATA if buffer passed is too small to hold data
  464. any error conditions encountered are reported to the event log if
  465. event logging is enabled.
  466. ERROR_SUCCESS if success or any other error. Errors, however are
  467. also reported to the event log.
  468. --*/
  469. {
  470. // Variables for reformating the data
  471. ULONG SpaceNeeded;
  472. PDWORD pdwCounter;
  473. PERF_COUNTER_BLOCK *pPerfCounterBlock;
  474. DNS_DATA_DEFINITION *pDnsDataDefinition;
  475. DWORD dwQueryType; // for error logging
  476. //
  477. // before doing anything else, see if Open went OK
  478. //
  479. if (!bInitOK)
  480. {
  481. // unable to continue because open failed.
  482. *lpcbTotalBytes = (DWORD) 0;
  483. *lpNumObjectTypes = (DWORD) 0;
  484. return ERROR_SUCCESS; // yes, this is a successful exit
  485. }
  486. // see if this is a foreign (i.e. non-NT) computer data request
  487. //
  488. dwQueryType = GetQueryType (lpValueName);
  489. if ( dwQueryType == QUERY_FOREIGN )
  490. {
  491. // this routine does not service requests for data from
  492. // Non-NT computers
  493. *lpcbTotalBytes = (DWORD) 0;
  494. *lpNumObjectTypes = (DWORD) 0;
  495. return ERROR_SUCCESS;
  496. }
  497. if (dwQueryType == QUERY_ITEMS)
  498. {
  499. if ( ! IsNumberInUnicodeList(
  500. DnsDataDefinition.DnsObjectType.ObjectNameTitleIndex,
  501. lpValueName ) )
  502. {
  503. // request received for data object not provided by this routine
  504. *lpcbTotalBytes = (DWORD) 0;
  505. *lpNumObjectTypes = (DWORD) 0;
  506. return ERROR_SUCCESS;
  507. }
  508. }
  509. //
  510. // Get the data.
  511. //
  512. pDnsDataDefinition = (DNS_DATA_DEFINITION *) *lppData;
  513. SpaceNeeded = sizeof(DNS_DATA_DEFINITION) + SIZE_OF_DNS_PERFORMANCE_DATA;
  514. if ( *lpcbTotalBytes < SpaceNeeded )
  515. {
  516. *lpcbTotalBytes = (DWORD) 0;
  517. *lpNumObjectTypes = (DWORD) 0;
  518. return ERROR_MORE_DATA;
  519. }
  520. //
  521. // Copy the (constant, initialized) Object Type and counter definitions
  522. // to the caller's data buffer
  523. //
  524. memmove(pDnsDataDefinition,
  525. &DnsDataDefinition,
  526. sizeof(DNS_DATA_DEFINITION));
  527. // Format and collect DNS data from shared memory
  528. // The counter block is to immediately follow the data definition,
  529. // so obtain a pointer to that space
  530. pPerfCounterBlock = (PERF_COUNTER_BLOCK *) &pDnsDataDefinition[1];
  531. // The byte length is of the counter block header and all following data
  532. pPerfCounterBlock->ByteLength = SIZE_OF_DNS_PERFORMANCE_DATA;
  533. // Compute a pointer to the buffer immediately following the counter
  534. // block header
  535. pdwCounter = (PDWORD) (&pPerfCounterBlock[1]);
  536. // copy the counter data from shared memory block into the counter block
  537. memcpy(pdwCounter,
  538. &pCounterBlock[1],
  539. SIZE_OF_DNS_PERFORMANCE_DATA - sizeof(PERF_COUNTER_BLOCK));
  540. // Tell caller where the next available byte is
  541. *lppData = (PVOID) ((PBYTE)pdwCounter + SIZE_OF_DNS_PERFORMANCE_DATA - sizeof(PERF_COUNTER_BLOCK));
  542. // update arguments before return
  543. *lpNumObjectTypes = 1;
  544. *lpcbTotalBytes = (DWORD) ((PBYTE)*lppData - (PBYTE)pDnsDataDefinition);
  545. return ERROR_SUCCESS;
  546. }
  547. DWORD
  548. CloseDnsPerformanceData(
  549. VOID
  550. )
  551. /*++
  552. Routine Description:
  553. This routine closes the open handles to DNS device performance counters
  554. Arguments:
  555. None.
  556. Return Value:
  557. ERROR_SUCCESS
  558. --*/
  559. {
  560. //
  561. // cleanup when close last thread
  562. //
  563. // DNS_FIX0: MT issues in dnsperf cleanup
  564. // no real protection on thread count (need interlock)
  565. // but also close can be going on concurrently with another
  566. // thread attempting to reopen (unlikely but possible)
  567. //
  568. // perhaps two flag approach would work, with all new threads
  569. // failing (not passing through but skipping open altogether)
  570. // until pCounterBlock was NULL again
  571. //
  572. if ( !(--dwOpenCount) )
  573. {
  574. // clear bInitOk, as otherwise collect function
  575. // will attempt to reference into pCounterBlock
  576. bInitOK = FALSE;
  577. if ( pCounterBlock )
  578. {
  579. UnmapViewOfFile( pCounterBlock );
  580. pCounterBlock = NULL;
  581. }
  582. if ( hDnsSharedMemory )
  583. {
  584. CloseHandle( hDnsSharedMemory );
  585. hDnsSharedMemory = NULL;
  586. }
  587. }
  588. return ERROR_SUCCESS;
  589. }
  590. //
  591. // Data for this whole thing to work on
  592. //
  593. DNS_DATA_DEFINITION DnsDataDefinition =
  594. {
  595. // DNS obj for PerfMon:
  596. { sizeof(DNS_DATA_DEFINITION) + SIZE_OF_DNS_PERFORMANCE_DATA, // TotLen
  597. sizeof(DNS_DATA_DEFINITION), // DefinitionLength
  598. sizeof(PERF_OBJECT_TYPE), // HeaderLength
  599. DNSOBJ, // ObjectNameTitleIndex
  600. 0, // ObjectNameTitle
  601. DNSOBJ, // ObjectHelpTitleIndex
  602. 0, // ObjectHelpTitle
  603. PERF_DETAIL_NOVICE, // DetailLevel
  604. (sizeof(DNS_DATA_DEFINITION)-sizeof(PERF_OBJECT_TYPE))/
  605. sizeof(PERF_COUNTER_DEFINITION), // NumCounters
  606. 0, // DefaultCounter
  607. -1, // NumInstances
  608. 0 // CodePage (0=Unicode)
  609. },
  610. // total query received
  611. { sizeof(PERF_COUNTER_DEFINITION), // ByteLength
  612. TOTALQUERYRECEIVED, // CounterNameTitleIndex
  613. 0, // CounterNameTitle
  614. TOTALQUERYRECEIVED, // CounterHelpTitleIndex
  615. 0, // CounterHelpTitle
  616. 0, // DefaultScale
  617. PERF_DETAIL_NOVICE, // DetailLevel
  618. PERF_COUNTER_RAWCOUNT, // CounterType
  619. sizeof(DWORD), // CounterSize
  620. TOTALQUERYRECEIVED_OFFSET // CounterOffset
  621. },
  622. // total qurey received/sec
  623. { sizeof(PERF_COUNTER_DEFINITION), // ByteLength
  624. TOTALQUERYRECEIVED_S, // CounterNameTitleIndex
  625. 0, // CounterNameTitle
  626. TOTALQUERYRECEIVED_S, // CounterHelpTitleIndex
  627. 0, // CounterHelpTitle
  628. 0, // DefaultScale
  629. PERF_DETAIL_NOVICE, // DetailLevel
  630. PERF_COUNTER_COUNTER, // CounterType
  631. sizeof(DWORD), // CounterSize
  632. TOTALQUERYRECEIVED_OFFSET // CounterOffset
  633. },
  634. // UDP query received
  635. { sizeof(PERF_COUNTER_DEFINITION), // ByteLength
  636. UDPQUERYRECEIVED, // CounterNameTitleIndex
  637. 0, // CounterNameTitle
  638. UDPQUERYRECEIVED, // CounterHelpTitleIndex
  639. 0, // CounterHelpTitle
  640. 0, // DefaultScale
  641. PERF_DETAIL_NOVICE, // DetailLevel
  642. PERF_COUNTER_RAWCOUNT, // CounterType
  643. sizeof(DWORD), // CounterSize
  644. UDPQUERYRECEIVED_OFFSET // CounterOffset
  645. },
  646. // UDP query received/sec
  647. { sizeof(PERF_COUNTER_DEFINITION), // ByteLength
  648. UDPQUERYRECEIVED_S, // CounterNameTitleIndex
  649. 0, // CounterNameTitle
  650. UDPQUERYRECEIVED_S, // CounterHelpTitleIndex
  651. 0, // CounterHelpTitle
  652. 0, // DefaultScale
  653. PERF_DETAIL_NOVICE, // DetailLevel
  654. PERF_COUNTER_COUNTER, // CounterType
  655. sizeof(DWORD), // CounterSize
  656. UDPQUERYRECEIVED_OFFSET // CounterOffset
  657. },
  658. // TCP query received
  659. { sizeof(PERF_COUNTER_DEFINITION), // ByteLength
  660. TCPQUERYRECEIVED, // CounterNameTitleIndex
  661. 0, // CounterNameTitle
  662. TCPQUERYRECEIVED, // CounterHelpTitleIndex
  663. 0, // CounterHelpTitle
  664. 0, // DefaultScale
  665. PERF_DETAIL_NOVICE, // DetailLevel
  666. PERF_COUNTER_RAWCOUNT, // CounterType
  667. sizeof(DWORD), // CounterSize
  668. TCPQUERYRECEIVED_OFFSET // CounterOffset
  669. },
  670. // TCP query received/sec
  671. { sizeof(PERF_COUNTER_DEFINITION), // ByteLength
  672. TCPQUERYRECEIVED_S, // CounterNameTitleIndex
  673. 0, // CounterNameTitle
  674. TCPQUERYRECEIVED_S, // CounterHelpTitleIndex
  675. 0, // CounterHelpTitle
  676. 0, // DefaultScale
  677. PERF_DETAIL_NOVICE, // DetailLevel
  678. PERF_COUNTER_COUNTER, // CounterType
  679. sizeof(DWORD), // CounterSize
  680. TCPQUERYRECEIVED_OFFSET // CounterOffset
  681. },
  682. // total response sent
  683. { sizeof(PERF_COUNTER_DEFINITION), // ByteLength
  684. TOTALRESPONSESENT, // CounterNameTitleIndex
  685. 0, // CounterNameTitle
  686. TOTALRESPONSESENT, // CounterHelpTitleIndex
  687. 0, // CounterHelpTitle
  688. 0, // DefaultScale
  689. PERF_DETAIL_NOVICE, // DetailLevel
  690. PERF_COUNTER_RAWCOUNT, // CounterType
  691. sizeof(DWORD), // CounterSize
  692. TOTALRESPONSESENT_OFFSET // CounterOffset
  693. },
  694. // total response sent/sec
  695. { sizeof(PERF_COUNTER_DEFINITION), // ByteLength
  696. TOTALRESPONSESENT_S, // CounterNameTitleIndex
  697. 0, // CounterNameTitle
  698. TOTALRESPONSESENT_S, // CounterHelpTitleIndex
  699. 0, // CounterHelpTitle
  700. 0, // DefaultScale
  701. PERF_DETAIL_NOVICE, // DetailLevel
  702. PERF_COUNTER_COUNTER, // CounterType
  703. sizeof(DWORD), // CounterSize
  704. TOTALRESPONSESENT_OFFSET // CounterOffset
  705. },
  706. // UDP response sent
  707. { sizeof(PERF_COUNTER_DEFINITION), // ByteLength
  708. UDPRESPONSESENT, // CounterNameTitleIndex
  709. 0, // CounterNameTitle
  710. UDPRESPONSESENT, // CounterHelpTitleIndex
  711. 0, // CounterHelpTitle
  712. 0, // DefaultScale
  713. PERF_DETAIL_NOVICE, // DetailLevel
  714. PERF_COUNTER_RAWCOUNT, // CounterType
  715. sizeof(DWORD), // CounterSize
  716. UDPRESPONSESENT_OFFSET // CounterOffset
  717. },
  718. // UDP response sent/sec
  719. { sizeof(PERF_COUNTER_DEFINITION), // ByteLength
  720. UDPRESPONSESENT_S, // CounterNameTitleIndex
  721. 0, // CounterNameTitle
  722. UDPRESPONSESENT_S, // CounterHelpTitleIndex
  723. 0, // CounterHelpTitle
  724. 0, // DefaultScale
  725. PERF_DETAIL_NOVICE, // DetailLevel
  726. PERF_COUNTER_COUNTER, // CounterType
  727. sizeof(DWORD), // CounterSize
  728. UDPRESPONSESENT_OFFSET // CounterOffset
  729. },
  730. // TCP response sent
  731. { sizeof(PERF_COUNTER_DEFINITION), // ByteLength
  732. TCPRESPONSESENT, // CounterNameTitleIndex
  733. 0, // CounterNameTitle
  734. TCPRESPONSESENT, // CounterHelpTitleIndex
  735. 0, // CounterHelpTitle
  736. 0, // DefaultScale
  737. PERF_DETAIL_NOVICE, // DetailLevel
  738. PERF_COUNTER_RAWCOUNT, // CounterType
  739. sizeof(DWORD), // CounterSize
  740. TCPRESPONSESENT_OFFSET // CounterOffset
  741. },
  742. // TCP response sent/sec
  743. { sizeof(PERF_COUNTER_DEFINITION), // ByteLength
  744. TCPRESPONSESENT_S, // CounterNameTitleIndex
  745. 0, // CounterNameTitle
  746. TCPRESPONSESENT_S, // CounterHelpTitleIndex
  747. 0, // CounterHelpTitle
  748. 0, // DefaultScale
  749. PERF_DETAIL_NOVICE, // DetailLevel
  750. PERF_COUNTER_COUNTER, // CounterType
  751. sizeof(DWORD), // CounterSize
  752. TCPRESPONSESENT_OFFSET // CounterOffset
  753. },
  754. // recursive query received
  755. { sizeof(PERF_COUNTER_DEFINITION), // ByteLength
  756. RECURSIVEQUERIES, // CounterNameTitleIndex
  757. 0, // CounterNameTitle
  758. RECURSIVEQUERIES, // CounterHelpTitleIndex
  759. 0, // CounterHelpTitle
  760. 0, // DefaultScale
  761. PERF_DETAIL_NOVICE, // DetailLevel
  762. PERF_COUNTER_RAWCOUNT, // CounterType
  763. sizeof(DWORD), // CounterSize
  764. RECURSIVEQUERIES_OFFSET // CounterOffset
  765. },
  766. // recursive query received/s
  767. { sizeof(PERF_COUNTER_DEFINITION), // ByteLength
  768. RECURSIVEQUERIES_S, // CounterNameTitleIndex
  769. 0, // CounterNameTitle
  770. RECURSIVEQUERIES_S, // CounterHelpTitleIndex
  771. 0, // CounterHelpTitle
  772. 0, // DefaultScale
  773. PERF_DETAIL_NOVICE, // DetailLevel
  774. PERF_COUNTER_COUNTER, // CounterType
  775. sizeof(DWORD), // CounterSize
  776. RECURSIVEQUERIES_OFFSET // CounterOffset
  777. },
  778. // recursive query timeout
  779. { sizeof(PERF_COUNTER_DEFINITION), // ByteLength
  780. RECURSIVETIMEOUT, // CounterNameTitleIndex
  781. 0, // CounterNameTitle
  782. RECURSIVETIMEOUT, // CounterHelpTitleIndex
  783. 0, // CounterHelpTitle
  784. 0, // DefaultScale
  785. PERF_DETAIL_NOVICE, // DetailLevel
  786. PERF_COUNTER_RAWCOUNT, // CounterType
  787. sizeof(DWORD), // CounterSize
  788. RECURSIVETIMEOUT_OFFSET // CounterOffset
  789. },
  790. // recursive query timeout/s
  791. { sizeof(PERF_COUNTER_DEFINITION), // ByteLength
  792. RECURSIVETIMEOUT_S, // CounterNameTitleIndex
  793. 0, // CounterNameTitle
  794. RECURSIVETIMEOUT_S, // CounterHelpTitleIndex
  795. 0, // CounterHelpTitle
  796. 0, // DefaultScale
  797. PERF_DETAIL_NOVICE, // DetailLevel
  798. PERF_COUNTER_COUNTER, // CounterType
  799. sizeof(DWORD), // CounterSize
  800. RECURSIVETIMEOUT_OFFSET // CounterOffset
  801. },
  802. // recursive query failure
  803. { sizeof(PERF_COUNTER_DEFINITION), // ByteLength
  804. RECURSIVEQUERYFAILURE, // CounterNameTitleIndex
  805. 0, // CounterNameTitle
  806. RECURSIVEQUERYFAILURE, // CounterHelpTitleIndex
  807. 0, // CounterHelpTitle
  808. 0, // DefaultScale
  809. PERF_DETAIL_NOVICE, // DetailLevel
  810. PERF_COUNTER_RAWCOUNT, // CounterType
  811. sizeof(DWORD), // CounterSize
  812. RECURSIVEQUERYFAILURE_OFFSET // CounterOffset
  813. },
  814. // recursive query failure/s
  815. { sizeof(PERF_COUNTER_DEFINITION), // ByteLength
  816. RECURSIVEQUERYFAILURE_S, // CounterNameTitleIndex
  817. 0, // CounterNameTitle
  818. RECURSIVEQUERYFAILURE_S, // CounterHelpTitleIndex
  819. 0, // CounterHelpTitle
  820. 0, // DefaultScale
  821. PERF_DETAIL_NOVICE, // DetailLevel
  822. PERF_COUNTER_COUNTER, // CounterType
  823. sizeof(DWORD), // CounterSize
  824. RECURSIVEQUERYFAILURE_OFFSET // CounterOffset
  825. },
  826. // notify sent
  827. { sizeof(PERF_COUNTER_DEFINITION), // ByteLength
  828. NOTIFYSENT, // CounterNameTitleIndex
  829. 0, // CounterNameTitle
  830. NOTIFYSENT, // CounterHelpTitleIndex
  831. 0, // CounterHelpTitle
  832. 0, // DefaultScale
  833. PERF_DETAIL_NOVICE, // DetailLevel
  834. PERF_COUNTER_RAWCOUNT, // CounterType
  835. sizeof(DWORD), // CounterSize
  836. NOTIFYSENT_OFFSET // CounterOffset
  837. },
  838. // zone transfer request received
  839. { sizeof(PERF_COUNTER_DEFINITION), // ByteLength
  840. ZONETRANSFERREQUESTRECEIVED, // CounterNameTitleIndex
  841. 0, // CounterNameTitle
  842. ZONETRANSFERREQUESTRECEIVED, // CounterHelpTitleIndex
  843. 0, // CounterHelpTitle
  844. 0, // DefaultScale
  845. PERF_DETAIL_NOVICE, // DetailLevel
  846. PERF_COUNTER_RAWCOUNT, // CounterType
  847. sizeof(DWORD), // CounterSize
  848. ZONETRANSFERREQUESTRECEIVED_OFFSET // CounterOffset
  849. },
  850. // zone transfer success
  851. { sizeof(PERF_COUNTER_DEFINITION), // ByteLength
  852. ZONETRANSFERSUCCESS, // CounterNameTitleIndex
  853. 0, // CounterNameTitle
  854. ZONETRANSFERSUCCESS, // CounterHelpTitleIndex
  855. 0, // CounterHelpTitle
  856. 0, // DefaultScale
  857. PERF_DETAIL_NOVICE, // DetailLevel
  858. PERF_COUNTER_RAWCOUNT, // CounterType
  859. sizeof(DWORD), // CounterSize
  860. ZONETRANSFERSUCCESS_OFFSET // CounterOffset
  861. },
  862. // zone transfer failure
  863. { sizeof(PERF_COUNTER_DEFINITION), // ByteLength
  864. ZONETRANSFERFAILURE, // CounterNameTitleIndex
  865. 0, // CounterNameTitle
  866. ZONETRANSFERFAILURE, // CounterHelpTitleIndex
  867. 0, // CounterHelpTitle
  868. 0, // DefaultScale
  869. PERF_DETAIL_NOVICE, // DetailLevel
  870. PERF_COUNTER_RAWCOUNT, // CounterType
  871. sizeof(DWORD), // CounterSize
  872. ZONETRANSFERFAILURE_OFFSET // CounterOffset
  873. },
  874. // AXFR request received
  875. { sizeof(PERF_COUNTER_DEFINITION), // ByteLength
  876. AXFRREQUESTRECEIVED, // CounterNameTitleIndex
  877. 0, // CounterNameTitle
  878. AXFRREQUESTRECEIVED, // CounterHelpTitleIndex
  879. 0, // CounterHelpTitle
  880. 0, // DefaultScale
  881. PERF_DETAIL_NOVICE, // DetailLevel
  882. PERF_COUNTER_RAWCOUNT, // CounterType
  883. sizeof(DWORD), // CounterSize
  884. AXFRREQUESTRECEIVED_OFFSET // CounterOffset
  885. },
  886. // AXFR success sent
  887. { sizeof(PERF_COUNTER_DEFINITION), // ByteLength
  888. AXFRSUCCESSSENT, // CounterNameTitleIndex
  889. 0, // CounterNameTitle
  890. AXFRSUCCESSSENT, // CounterHelpTitleIndex
  891. 0, // CounterHelpTitle
  892. 0, // DefaultScale
  893. PERF_DETAIL_NOVICE, // DetailLevel
  894. PERF_COUNTER_RAWCOUNT, // CounterType
  895. sizeof(DWORD), // CounterSize
  896. AXFRSUCCESSSENT_OFFSET // CounterOffset
  897. },
  898. // IXFR request received
  899. { sizeof(PERF_COUNTER_DEFINITION), // ByteLength
  900. IXFRREQUESTRECEIVED, // CounterNameTitleIndex
  901. 0, // CounterNameTitle
  902. IXFRREQUESTRECEIVED, // CounterHelpTitleIndex
  903. 0, // CounterHelpTitle
  904. 0, // DefaultScale
  905. PERF_DETAIL_NOVICE, // DetailLevel
  906. PERF_COUNTER_RAWCOUNT, // CounterType
  907. sizeof(DWORD), // CounterSize
  908. IXFRREQUESTRECEIVED_OFFSET // CounterOffset
  909. },
  910. // IXFR success sent
  911. { sizeof(PERF_COUNTER_DEFINITION), // ByteLength
  912. IXFRSUCCESSSENT, // CounterNameTitleIndex
  913. 0, // CounterNameTitle
  914. IXFRSUCCESSSENT, // CounterHelpTitleIndex
  915. 0, // CounterHelpTitle
  916. 0, // DefaultScale
  917. PERF_DETAIL_NOVICE, // DetailLevel
  918. PERF_COUNTER_RAWCOUNT, // CounterType
  919. sizeof(DWORD), // CounterSize
  920. IXFRSUCCESSSENT_OFFSET // CounterOffset
  921. },
  922. // notify received
  923. { sizeof(PERF_COUNTER_DEFINITION), // ByteLength
  924. NOTIFYRECEIVED, // CounterNameTitleIndex
  925. 0, // CounterNameTitle
  926. NOTIFYRECEIVED, // CounterHelpTitleIndex
  927. 0, // CounterHelpTitle
  928. 0, // DefaultScale
  929. PERF_DETAIL_NOVICE, // DetailLevel
  930. PERF_COUNTER_RAWCOUNT, // CounterType
  931. sizeof(DWORD), // CounterSize
  932. NOTIFYRECEIVED_OFFSET // CounterOffset
  933. },
  934. // zone transfer SOA request sent
  935. { sizeof(PERF_COUNTER_DEFINITION), // ByteLength
  936. ZONETRANSFERSOAREQUESTSENT, // CounterNameTitleIndex
  937. 0, // CounterNameTitle
  938. ZONETRANSFERSOAREQUESTSENT, // CounterHelpTitleIndex
  939. 0, // CounterHelpTitle
  940. 0, // DefaultScale
  941. PERF_DETAIL_NOVICE, // DetailLevel
  942. PERF_COUNTER_RAWCOUNT, // CounterType
  943. sizeof(DWORD), // CounterSize
  944. ZONETRANSFERSOAREQUESTSENT_OFFSET // CounterOffset
  945. },
  946. // AXFR request sent
  947. { sizeof(PERF_COUNTER_DEFINITION), // ByteLength
  948. AXFRREQUESTSENT, // CounterNameTitleIndex
  949. 0, // CounterNameTitle
  950. AXFRREQUESTSENT, // CounterHelpTitleIndex
  951. 0, // CounterHelpTitle
  952. 0, // DefaultScale
  953. PERF_DETAIL_NOVICE, // DetailLevel
  954. PERF_COUNTER_RAWCOUNT, // CounterType
  955. sizeof(DWORD), // CounterSize
  956. AXFRREQUESTSENT_OFFSET // CounterOffset
  957. },
  958. // AXFR response received
  959. { sizeof(PERF_COUNTER_DEFINITION), // ByteLength
  960. AXFRRESPONSERECEIVED, // CounterNameTitleIndex
  961. 0, // CounterNameTitle
  962. AXFRRESPONSERECEIVED, // CounterHelpTitleIndex
  963. 0, // CounterHelpTitle
  964. 0, // DefaultScale
  965. PERF_DETAIL_NOVICE, // DetailLevel
  966. PERF_COUNTER_RAWCOUNT, // CounterType
  967. sizeof(DWORD), // CounterSize
  968. AXFRRESPONSERECEIVED_OFFSET // CounterOffset
  969. },
  970. // AXFR success received
  971. { sizeof(PERF_COUNTER_DEFINITION), // ByteLength
  972. AXFRSUCCESSRECEIVED, // CounterNameTitleIndex
  973. 0, // CounterNameTitle
  974. AXFRSUCCESSRECEIVED, // CounterHelpTitleIndex
  975. 0, // CounterHelpTitle
  976. 0, // DefaultScale
  977. PERF_DETAIL_NOVICE, // DetailLevel
  978. PERF_COUNTER_RAWCOUNT, // CounterType
  979. sizeof(DWORD), // CounterSize
  980. AXFRSUCCESSRECEIVED_OFFSET // CounterOffset
  981. },
  982. // IXFR request sent
  983. { sizeof(PERF_COUNTER_DEFINITION), // ByteLength
  984. IXFRREQUESTSENT, // CounterNameTitleIndex
  985. 0, // CounterNameTitle
  986. IXFRREQUESTSENT, // CounterHelpTitleIndex
  987. 0, // CounterHelpTitle
  988. 0, // DefaultScale
  989. PERF_DETAIL_NOVICE, // DetailLevel
  990. PERF_COUNTER_RAWCOUNT, // CounterType
  991. sizeof(DWORD), // CounterSize
  992. IXFRREQUESTSENT_OFFSET // CounterOffset
  993. },
  994. // IXFR response received
  995. { sizeof(PERF_COUNTER_DEFINITION), // ByteLength
  996. IXFRRESPONSERECEIVED, // CounterNameTitleIndex
  997. 0, // CounterNameTitle
  998. IXFRRESPONSERECEIVED, // CounterHelpTitleIndex
  999. 0, // CounterHelpTitle
  1000. 0, // DefaultScale
  1001. PERF_DETAIL_NOVICE, // DetailLevel
  1002. PERF_COUNTER_RAWCOUNT, // CounterType
  1003. sizeof(DWORD), // CounterSize
  1004. IXFRRESPONSERECEIVED_OFFSET // CounterOffset
  1005. },
  1006. // IXFR succes received
  1007. { sizeof(PERF_COUNTER_DEFINITION), // ByteLength
  1008. IXFRSUCCESSRECEIVED, // CounterNameTitleIndex
  1009. 0, // CounterNameTitle
  1010. IXFRSUCCESSRECEIVED, // CounterHelpTitleIndex
  1011. 0, // CounterHelpTitle
  1012. 0, // DefaultScale
  1013. PERF_DETAIL_NOVICE, // DetailLevel
  1014. PERF_COUNTER_RAWCOUNT, // CounterType
  1015. sizeof(DWORD), // CounterSize
  1016. IXFRSUCCESSRECEIVED_OFFSET // CounterOffset
  1017. },
  1018. // IXFR UDP success received
  1019. { sizeof(PERF_COUNTER_DEFINITION), // ByteLength
  1020. IXFRUDPSUCCESSRECEIVED, // CounterNameTitleIndex
  1021. 0, // CounterNameTitle
  1022. IXFRUDPSUCCESSRECEIVED, // CounterHelpTitleIndex
  1023. 0, // CounterHelpTitle
  1024. 0, // DefaultScale
  1025. PERF_DETAIL_NOVICE, // DetailLevel
  1026. PERF_COUNTER_RAWCOUNT, // CounterType
  1027. sizeof(DWORD), // CounterSize
  1028. IXFRUDPSUCCESSRECEIVED_OFFSET // CounterOffset
  1029. },
  1030. // IXFR TCP success received
  1031. { sizeof(PERF_COUNTER_DEFINITION), // ByteLength
  1032. IXFRTCPSUCCESSRECEIVED, // CounterNameTitleIndex
  1033. 0, // CounterNameTitle
  1034. IXFRTCPSUCCESSRECEIVED, // CounterHelpTitleIndex
  1035. 0, // CounterHelpTitle
  1036. 0, // DefaultScale
  1037. PERF_DETAIL_NOVICE, // DetailLevel
  1038. PERF_COUNTER_RAWCOUNT, // CounterType
  1039. sizeof(DWORD), // CounterSize
  1040. IXFRTCPSUCCESSRECEIVED_OFFSET // CounterOffset
  1041. },
  1042. // WINS lookup request received
  1043. { sizeof(PERF_COUNTER_DEFINITION), // ByteLength
  1044. WINSLOOKUPRECEIVED, // CounterNameTitleIndex
  1045. 0, // CounterNameTitle
  1046. WINSLOOKUPRECEIVED, // CounterHelpTitleIndex
  1047. 0, // CounterHelpTitle
  1048. 0, // DefaultScale
  1049. PERF_DETAIL_NOVICE, // DetailLevel
  1050. PERF_COUNTER_RAWCOUNT, // CounterType
  1051. sizeof(DWORD), // CounterSize
  1052. WINSLOOKUPRECEIVED_OFFSET // CounterOffset
  1053. },
  1054. // WINS lookup request received/sec
  1055. { sizeof(PERF_COUNTER_DEFINITION), // ByteLength
  1056. WINSLOOKUPRECEIVED_S, // CounterNameTitleIndex
  1057. 0, // CounterNameTitle
  1058. WINSLOOKUPRECEIVED_S, // CounterHelpTitleIndex
  1059. 0, // CounterHelpTitle
  1060. 0, // DefaultScale
  1061. PERF_DETAIL_NOVICE, // DetailLevel
  1062. PERF_COUNTER_COUNTER, // CounterType
  1063. sizeof(DWORD), // CounterSize
  1064. WINSLOOKUPRECEIVED_OFFSET // CounterOffset
  1065. },
  1066. // WINS response sent
  1067. { sizeof(PERF_COUNTER_DEFINITION), // ByteLength
  1068. WINSRESPONSESENT, // CounterNameTitleIndex
  1069. 0, // CounterNameTitle
  1070. WINSRESPONSESENT, // CounterHelpTitleIndex
  1071. 0, // CounterHelpTitle
  1072. 0, // DefaultScale
  1073. PERF_DETAIL_NOVICE, // DetailLevel
  1074. PERF_COUNTER_RAWCOUNT, // CounterType
  1075. sizeof(DWORD), // CounterSize
  1076. WINSRESPONSESENT_OFFSET // CounterOffset
  1077. },
  1078. // WINS response sent/sec
  1079. { sizeof(PERF_COUNTER_DEFINITION), // ByteLength
  1080. WINSRESPONSESENT_S, // CounterNameTitleIndex
  1081. 0, // CounterNameTitle
  1082. WINSRESPONSESENT_S, // CounterHelpTitleIndex
  1083. 0, // CounterHelpTitle
  1084. 0, // DefaultScale
  1085. PERF_DETAIL_NOVICE, // DetailLevel
  1086. PERF_COUNTER_COUNTER, // CounterType
  1087. sizeof(DWORD), // CounterSize
  1088. WINSRESPONSESENT_OFFSET // CounterOffset
  1089. },
  1090. // WINS reverse lookup received
  1091. { sizeof(PERF_COUNTER_DEFINITION), // ByteLength
  1092. WINSREVERSELOOKUPRECEIVED, // CounterNameTitleIndex
  1093. 0, // CounterNameTitle
  1094. WINSREVERSELOOKUPRECEIVED, // CounterHelpTitleIndex
  1095. 0, // CounterHelpTitle
  1096. 0, // DefaultScale
  1097. PERF_DETAIL_NOVICE, // DetailLevel
  1098. PERF_COUNTER_RAWCOUNT, // CounterType
  1099. sizeof(DWORD), // CounterSize
  1100. WINSREVERSELOOKUPRECEIVED_OFFSET // CounterOffset
  1101. },
  1102. // WINS reverse lookup received/sec
  1103. { sizeof(PERF_COUNTER_DEFINITION), // ByteLength
  1104. WINSREVERSELOOKUPRECEIVED_S, // CounterNameTitleIndex
  1105. 0, // CounterNameTitle
  1106. WINSREVERSELOOKUPRECEIVED_S, // CounterHelpTitleIndex
  1107. 0, // CounterHelpTitle
  1108. 0, // DefaultScale
  1109. PERF_DETAIL_NOVICE, // DetailLevel
  1110. PERF_COUNTER_RAWCOUNT, // CounterType
  1111. sizeof(DWORD), // CounterSize
  1112. WINSREVERSELOOKUPRECEIVED_OFFSET // CounterOffset
  1113. },
  1114. // WINS reverse response sent
  1115. { sizeof(PERF_COUNTER_DEFINITION), // ByteLength
  1116. WINSREVERSERESPONSESENT, // CounterNameTitleIndex
  1117. 0, // CounterNameTitle
  1118. WINSREVERSERESPONSESENT, // CounterHelpTitleIndex
  1119. 0, // CounterHelpTitle
  1120. 0, // DefaultScale
  1121. PERF_DETAIL_NOVICE, // DetailLevel
  1122. PERF_COUNTER_RAWCOUNT, // CounterType
  1123. sizeof(DWORD), // CounterSize
  1124. WINSREVERSERESPONSESENT_OFFSET // CounterOffset
  1125. },
  1126. // WINS reverse response sent/sec
  1127. { sizeof(PERF_COUNTER_DEFINITION), // ByteLength
  1128. WINSREVERSERESPONSESENT_S, // CounterNameTitleIndex
  1129. 0, // CounterNameTitle
  1130. WINSREVERSERESPONSESENT_S, // CounterHelpTitleIndex
  1131. 0, // CounterHelpTitle
  1132. 0, // DefaultScale
  1133. PERF_DETAIL_NOVICE, // DetailLevel
  1134. PERF_COUNTER_COUNTER, // CounterType
  1135. sizeof(DWORD), // CounterSize
  1136. WINSREVERSERESPONSESENT_OFFSET // CounterOffset
  1137. },
  1138. // dynamic update received
  1139. { sizeof(PERF_COUNTER_DEFINITION), // ByteLength
  1140. DYNAMICUPDATERECEIVED, // CounterNameTitleIndex
  1141. 0, // CounterNameTitle
  1142. DYNAMICUPDATERECEIVED, // CounterHelpTitleIndex
  1143. 0, // CounterHelpTitle
  1144. 0, // DefaultScale
  1145. PERF_DETAIL_NOVICE, // DetailLevel
  1146. PERF_COUNTER_RAWCOUNT, // CounterType
  1147. sizeof(DWORD), // CounterSize
  1148. DYNAMICUPDATERECEIVED_OFFSET // CounterOffset
  1149. },
  1150. // dynamic update received/sec
  1151. { sizeof(PERF_COUNTER_DEFINITION), // ByteLength
  1152. DYNAMICUPDATERECEIVED_S, // CounterNameTitleIndex
  1153. 0, // CounterNameTitle
  1154. DYNAMICUPDATERECEIVED_S, // CounterHelpTitleIndex
  1155. 0, // CounterHelpTitle
  1156. 0, // DefaultScale
  1157. PERF_DETAIL_NOVICE, // DetailLevel
  1158. PERF_COUNTER_COUNTER, // CounterType
  1159. sizeof(DWORD), // CounterSize
  1160. DYNAMICUPDATERECEIVED_OFFSET // CounterOffset
  1161. },
  1162. // dynamic update NoOperation & Empty
  1163. { sizeof(PERF_COUNTER_DEFINITION), // ByteLength
  1164. DYNAMICUPDATENOOP, // CounterNameTitleIndex
  1165. 0, // CounterNameTitle
  1166. DYNAMICUPDATENOOP, // CounterHelpTitleIndex
  1167. 0, // CounterHelpTitle
  1168. 0, // DefaultScale
  1169. PERF_DETAIL_NOVICE, // DetailLevel
  1170. PERF_COUNTER_RAWCOUNT, // CounterType
  1171. sizeof(DWORD), // CounterSize
  1172. DYNAMICUPDATENOOP_OFFSET // CounterOffset
  1173. },
  1174. // dynamic update NoOperation & Empty/sec
  1175. { sizeof(PERF_COUNTER_DEFINITION), // ByteLength
  1176. DYNAMICUPDATENOOP_S, // CounterNameTitleIndex
  1177. 0, // CounterNameTitle
  1178. DYNAMICUPDATENOOP_S, // CounterHelpTitleIndex
  1179. 0, // CounterHelpTitle
  1180. 0, // DefaultScale
  1181. PERF_DETAIL_NOVICE, // DetailLevel
  1182. PERF_COUNTER_COUNTER, // CounterType
  1183. sizeof(DWORD), // CounterSize
  1184. DYNAMICUPDATENOOP_OFFSET // CounterOffset
  1185. },
  1186. // dynamic update write to database (completed)
  1187. { sizeof(PERF_COUNTER_DEFINITION), // ByteLength
  1188. DYNAMICUPDATEWRITETODB, // CounterNameTitleIndex
  1189. 0, // CounterNameTitle
  1190. DYNAMICUPDATEWRITETODB, // CounterHelpTitleIndex
  1191. 0, // CounterHelpTitle
  1192. 0, // DefaultScale
  1193. PERF_DETAIL_NOVICE, // DetailLevel
  1194. PERF_COUNTER_RAWCOUNT, // CounterType
  1195. sizeof(DWORD), // CounterSize
  1196. DYNAMICUPDATEWRITETODB_OFFSET // CounterOffset
  1197. },
  1198. // dynamic update write to database (completed)/sec
  1199. { sizeof(PERF_COUNTER_DEFINITION), // ByteLength
  1200. DYNAMICUPDATEWRITETODB_S, // CounterNameTitleIndex
  1201. 0, // CounterNameTitle
  1202. DYNAMICUPDATEWRITETODB_S, // CounterHelpTitleIndex
  1203. 0, // CounterHelpTitle
  1204. 0, // DefaultScale
  1205. PERF_DETAIL_NOVICE, // DetailLevel
  1206. PERF_COUNTER_COUNTER, // CounterType
  1207. sizeof(DWORD), // CounterSize
  1208. DYNAMICUPDATEWRITETODB_OFFSET // CounterOffset
  1209. },
  1210. // dynamic update rejected
  1211. { sizeof(PERF_COUNTER_DEFINITION), // ByteLength
  1212. DYNAMICUPDATEREJECTED, // CounterNameTitleIndex
  1213. 0, // CounterNameTitle
  1214. DYNAMICUPDATEREJECTED, // CounterHelpTitleIndex
  1215. 0, // CounterHelpTitle
  1216. 0, // DefaultScale
  1217. PERF_DETAIL_NOVICE, // DetailLevel
  1218. PERF_COUNTER_RAWCOUNT, // CounterType
  1219. sizeof(DWORD), // CounterSize
  1220. DYNAMICUPDATEREJECTED_OFFSET // CounterOffset
  1221. },
  1222. // dynamic update timeout
  1223. { sizeof(PERF_COUNTER_DEFINITION), // ByteLength
  1224. DYNAMICUPDATETIMEOUT, // CounterNameTitleIndex
  1225. 0, // CounterNameTitle
  1226. DYNAMICUPDATETIMEOUT, // CounterHelpTitleIndex
  1227. 0, // CounterHelpTitle
  1228. 0, // DefaultScale
  1229. PERF_DETAIL_NOVICE, // DetailLevel
  1230. PERF_COUNTER_RAWCOUNT, // CounterType
  1231. sizeof(DWORD), // CounterSize
  1232. DYNAMICUPDATETIMEOUT_OFFSET // CounterOffset
  1233. },
  1234. // dynamic update queued
  1235. { sizeof(PERF_COUNTER_DEFINITION), // ByteLength
  1236. DYNAMICUPDATEQUEUED, // CounterNameTitleIndex
  1237. 0, // CounterNameTitle
  1238. DYNAMICUPDATEQUEUED, // CounterHelpTitleIndex
  1239. 0, // CounterHelpTitle
  1240. 0, // DefaultScale
  1241. PERF_DETAIL_NOVICE, // DetailLevel
  1242. PERF_COUNTER_RAWCOUNT, // CounterType
  1243. sizeof(DWORD), // CounterSize
  1244. DYNAMICUPDATEQUEUED_OFFSET // CounterOffset
  1245. },
  1246. // secure update received
  1247. { sizeof(PERF_COUNTER_DEFINITION), // ByteLength
  1248. SECUREUPDATERECEIVED, // CounterNameTitleIndex
  1249. 0, // CounterNameTitle
  1250. SECUREUPDATERECEIVED, // CounterHelpTitleIndex
  1251. 0, // CounterHelpTitle
  1252. 0, // DefaultScale
  1253. PERF_DETAIL_NOVICE, // DetailLevel
  1254. PERF_COUNTER_RAWCOUNT, // CounterType
  1255. sizeof(DWORD), // CounterSize
  1256. SECUREUPDATERECEIVED_OFFSET // CounterOffset
  1257. },
  1258. // secure update received/sec
  1259. { sizeof(PERF_COUNTER_DEFINITION), // ByteLength
  1260. SECUREUPDATERECEIVED_S, // CounterNameTitleIndex
  1261. 0, // CounterNameTitle
  1262. SECUREUPDATERECEIVED_S, // CounterHelpTitleIndex
  1263. 0, // CounterHelpTitle
  1264. 0, // DefaultScale
  1265. PERF_DETAIL_NOVICE, // DetailLevel
  1266. PERF_COUNTER_COUNTER, // CounterType
  1267. sizeof(DWORD), // CounterSize
  1268. SECUREUPDATERECEIVED_OFFSET // CounterOffset
  1269. },
  1270. // secure update failure
  1271. { sizeof(PERF_COUNTER_DEFINITION), // ByteLength
  1272. SECUREUPDATEFAILURE, // CounterNameTitleIndex
  1273. 0, // CounterNameTitle
  1274. SECUREUPDATEFAILURE, // CounterHelpTitleIndex
  1275. 0, // CounterHelpTitle
  1276. 0, // DefaultScale
  1277. PERF_DETAIL_NOVICE, // DetailLevel
  1278. PERF_COUNTER_RAWCOUNT, // CounterType
  1279. sizeof(DWORD), // CounterSize
  1280. SECUREUPDATEFAILURE_OFFSET // CounterOffset
  1281. },
  1282. // database node memory
  1283. { sizeof(PERF_COUNTER_DEFINITION), // ByteLength
  1284. DATABASENODEMEMORY, // CounterNameTitleIndex
  1285. 0, // CounterNameTitle
  1286. DATABASENODEMEMORY, // CounterHelpTitleIndex
  1287. 0, // CounterHelpTitle
  1288. 0, // DefaultScale
  1289. PERF_DETAIL_NOVICE, // DetailLevel
  1290. PERF_COUNTER_RAWCOUNT, // CounterType
  1291. sizeof(DWORD), // CounterSize
  1292. DATABASENODEMEMORY_OFFSET // CounterOffset
  1293. },
  1294. // record flow memory
  1295. { sizeof(PERF_COUNTER_DEFINITION), // ByteLength
  1296. RECORDFLOWMEMORY, // CounterNameTitleIndex
  1297. 0, // CounterNameTitle
  1298. RECORDFLOWMEMORY, // CounterHelpTitleIndex
  1299. 0, // CounterHelpTitle
  1300. 0, // DefaultScale
  1301. PERF_DETAIL_NOVICE, // DetailLevel
  1302. PERF_COUNTER_RAWCOUNT, // CounterType
  1303. sizeof(DWORD), // CounterSize
  1304. RECORDFLOWMEMORY_OFFSET // CounterOffset
  1305. },
  1306. // caching memory
  1307. { sizeof(PERF_COUNTER_DEFINITION), // ByteLength
  1308. CACHINGMEMORY, // CounterNameTitleIndex
  1309. 0, // CounterNameTitle
  1310. CACHINGMEMORY, // CounterHelpTitleIndex
  1311. 0, // CounterHelpTitle
  1312. 0, // DefaultScale
  1313. PERF_DETAIL_NOVICE, // DetailLevel
  1314. PERF_COUNTER_RAWCOUNT, // CounterType
  1315. sizeof(DWORD), // CounterSize
  1316. CACHINGMEMORY_OFFSET // CounterOffset
  1317. },
  1318. // UDP message memory
  1319. { sizeof(PERF_COUNTER_DEFINITION), // ByteLength
  1320. UDPMESSAGEMEMORY, // CounterNameTitleIndex
  1321. 0, // CounterNameTitle
  1322. UDPMESSAGEMEMORY, // CounterHelpTitleIndex
  1323. 0, // CounterHelpTitle
  1324. 0, // DefaultScale
  1325. PERF_DETAIL_NOVICE, // DetailLevel
  1326. PERF_COUNTER_RAWCOUNT, // CounterType
  1327. sizeof(DWORD), // CounterSize
  1328. UDPMESSAGEMEMORY_OFFSET // CounterOffset
  1329. },
  1330. // TCP message memory
  1331. { sizeof(PERF_COUNTER_DEFINITION), // ByteLength
  1332. TCPMESSAGEMEMORY, // CounterNameTitleIndex
  1333. 0, // CounterNameTitle
  1334. TCPMESSAGEMEMORY, // CounterHelpTitleIndex
  1335. 0, // CounterHelpTitle
  1336. 0, // DefaultScale
  1337. PERF_DETAIL_NOVICE, // DetailLevel
  1338. PERF_COUNTER_RAWCOUNT, // CounterType
  1339. sizeof(DWORD), // CounterSize
  1340. TCPMESSAGEMEMORY_OFFSET // CounterOffset
  1341. },
  1342. // Nbstat memory
  1343. { sizeof(PERF_COUNTER_DEFINITION), // ByteLength
  1344. NBSTATMEMORY, // CounterNameTitleIndex
  1345. 0, // CounterNameTitle
  1346. NBSTATMEMORY, // CounterHelpTitleIndex
  1347. 0, // CounterHelpTitle
  1348. 0, // DefaultScale
  1349. PERF_DETAIL_NOVICE, // DetailLevel
  1350. PERF_COUNTER_RAWCOUNT, // CounterType
  1351. sizeof(DWORD), // CounterSize
  1352. NBSTATMEMORY_OFFSET // CounterOffset
  1353. },
  1354. };
  1355. int APIENTRY _CRT_INIT(
  1356. HANDLE hInstance,
  1357. DWORD ulReasonBeingCalled,
  1358. LPVOID lpReserved);
  1359. int __stdcall LibMain(
  1360. HANDLE hInstance,
  1361. DWORD ulReasonBeingCalled,
  1362. LPVOID lpReserved)
  1363. {
  1364. return (_CRT_INIT(hInstance, ulReasonBeingCalled,lpReserved));
  1365. }
  1366. //
  1367. // End dnsperf.c
  1368. //