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.

490 lines
13 KiB

  1. //+-------------------------------------------------------------------------
  2. // Microsoft Windows
  3. //
  4. // Copyright (C) Microsoft Corporation, 1999 - 1999
  5. //
  6. // File: certperf.h
  7. //
  8. // Contents: Certificate Performance Counter Functions
  9. //
  10. // APIs:
  11. // CertPerfIncrementChainCount
  12. // CertPerfIncrementChainElementCount
  13. // CertPerfIncrementChainEngineCurrentCount
  14. // CertPerfDecrementChainEngineCurrentCount
  15. // CertPerfIncrementChainEngineTotalCount
  16. // CertPerfIncrementChainEngineResyncCount
  17. // CertPerfIncrementChainCertCacheCount
  18. // CertPerfDecrementChainCertCacheCount
  19. // CertPerfIncrementChainCtlCacheCount
  20. // CertPerfDecrementChainCtlCacheCount
  21. // CertPerfIncrementChainEndCertInCacheCount
  22. // CertPerfIncrementChainCacheEndCertCount
  23. // CertPerfIncrementChainRevocationCount
  24. // CertPerfIncrementChainRevokedCount
  25. // CertPerfIncrementChainRevocationOfflineCount
  26. // CertPerfIncrementChainNoRevocationCheckCount
  27. // CertPerfIncrementChainVerifyCertSignatureCount
  28. // CertPerfIncrementChainCompareIssuerPublicKeyCount
  29. // CertPerfIncrementChainVerifyCtlSignatureCount
  30. // CertPerfIncrementChainBeenVerifiedCtlSignatureCount
  31. // CertPerfIncrementChainUrlIssuerCount
  32. // CertPerfIncrementChainCacheOnlyUrlIssuerCount
  33. // CertPerfIncrementChainRequestedEngineResyncCount
  34. // CertPerfIncrementChangeNotifyCount
  35. // CertPerfIncrementChangeNotifyLmGpCount
  36. // CertPerfIncrementChangeNotifyCuGpCount
  37. // CertPerfIncrementChangeNotifyCuMyCount
  38. // CertPerfIncrementChangeNotifyRegCount
  39. // CertPerfIncrementStoreCurrentCount
  40. // CertPerfDecrementStoreCurrentCount
  41. // CertPerfIncrementStoreTotalCount
  42. // CertPerfIncrementStoreRegCurrentCount
  43. // CertPerfDecrementStoreRegCurrentCount
  44. // CertPerfIncrementStoreRegTotalCount
  45. // CertPerfIncrementRegElementReadCount
  46. // CertPerfIncrementRegElementWriteCount
  47. // CertPerfIncrementRegElementDeleteCount
  48. // CertPerfIncrementCertElementCurrentCount
  49. // CertPerfDecrementCertElementCurrentCount
  50. // CertPerfIncrementCertElementTotalCount
  51. // CertPerfIncrementCrlElementCurrentCount
  52. // CertPerfDecrementCrlElementCurrentCount
  53. // CertPerfIncrementCrlElementTotalCount
  54. // CertPerfIncrementCtlElementCurrentCount
  55. // CertPerfDecrementCtlElementCurrentCount
  56. // CertPerfIncrementCtlElementTotalCount
  57. //
  58. // History: 04-May-99 philh created
  59. //--------------------------------------------------------------------------
  60. #ifndef __CERTPERF_H__
  61. #define __CERTPERF_H__
  62. #ifdef __cplusplus
  63. extern "C" {
  64. #include <pshpack8.h>
  65. typedef struct _CERT_PERF_PROCESS_COUNTERS {
  66. LONG lChainCnt;
  67. LONG lChainElementCnt;
  68. LONG lChainEngineCurrentCnt;
  69. LONG lChainEngineTotalCnt;
  70. LONG lChainEngineResyncCnt;
  71. LONG lChainCertCacheCnt;
  72. LONG lChainCtlCacheCnt;
  73. LONG lChainEndCertInCacheCnt;
  74. LONG lChainCacheEndCertCnt;
  75. LONG lChainRevocationCnt;
  76. LONG lChainRevokedCnt;
  77. LONG lChainRevocationOfflineCnt;
  78. LONG lChainNoRevocationCheckCnt;
  79. LONG lChainVerifyCertSignatureCnt;
  80. LONG lChainCompareIssuerPublicKeyCnt;
  81. LONG lChainVerifyCtlSignatureCnt;
  82. LONG lChainBeenVerifiedCtlSignatureCnt;
  83. LONG lChainUrlIssuerCnt;
  84. LONG lChainCacheOnlyUrlIssuerCnt;
  85. LONG lChainRequestedEngineResyncCnt;
  86. LONG lChangeNotifyCnt;
  87. LONG lChangeNotifyLmGpCnt;
  88. LONG lChangeNotifyCuGpCnt;
  89. LONG lChangeNotifyCuMyCnt;
  90. LONG lChangeNotifyRegCnt;
  91. LONG lStoreCurrentCnt;
  92. LONG lStoreTotalCnt;
  93. LONG lStoreRegCurrentCnt;
  94. LONG lStoreRegTotalCnt;
  95. LONG lRegElementReadCnt;
  96. LONG lRegElementWriteCnt;
  97. LONG lRegElementDeleteCnt;
  98. LONG lCertElementCurrentCnt;
  99. LONG lCertElementTotalCnt;
  100. LONG lCrlElementCurrentCnt;
  101. LONG lCrlElementTotalCnt;
  102. LONG lCtlElementCurrentCnt;
  103. LONG lCtlElementTotalCnt;
  104. //--### Add New Counters ###--
  105. } CERT_PERF_PROCESS_COUNTERS, *PCERT_PERF_PROCESS_COUNTERS;
  106. extern PCERT_PERF_PROCESS_COUNTERS pCertPerfProcessCounters;
  107. #include <poppack.h>
  108. __inline
  109. void
  110. CertPerfIncrementChainCount()
  111. {
  112. if (pCertPerfProcessCounters)
  113. InterlockedIncrement(&pCertPerfProcessCounters->lChainCnt);
  114. }
  115. __inline
  116. void
  117. CertPerfIncrementChainElementCount()
  118. {
  119. if (pCertPerfProcessCounters)
  120. InterlockedIncrement(&pCertPerfProcessCounters->lChainElementCnt);
  121. }
  122. __inline
  123. void
  124. CertPerfIncrementChainEngineCurrentCount()
  125. {
  126. if (pCertPerfProcessCounters)
  127. InterlockedIncrement(&pCertPerfProcessCounters->lChainEngineCurrentCnt);
  128. }
  129. __inline
  130. void
  131. CertPerfDecrementChainEngineCurrentCount()
  132. {
  133. if (pCertPerfProcessCounters)
  134. InterlockedDecrement(&pCertPerfProcessCounters->lChainEngineCurrentCnt);
  135. }
  136. __inline
  137. void
  138. CertPerfIncrementChainEngineTotalCount()
  139. {
  140. if (pCertPerfProcessCounters)
  141. InterlockedIncrement(&pCertPerfProcessCounters->lChainEngineTotalCnt);
  142. }
  143. __inline
  144. void
  145. CertPerfIncrementChainEngineResyncCount()
  146. {
  147. if (pCertPerfProcessCounters)
  148. InterlockedIncrement(&pCertPerfProcessCounters->lChainEngineResyncCnt);
  149. }
  150. __inline
  151. void
  152. CertPerfIncrementChainCertCacheCount()
  153. {
  154. if (pCertPerfProcessCounters)
  155. InterlockedIncrement(&pCertPerfProcessCounters->lChainCertCacheCnt);
  156. }
  157. __inline
  158. void
  159. CertPerfDecrementChainCertCacheCount()
  160. {
  161. if (pCertPerfProcessCounters)
  162. InterlockedDecrement(&pCertPerfProcessCounters->lChainCertCacheCnt);
  163. }
  164. __inline
  165. void
  166. CertPerfIncrementChainCtlCacheCount()
  167. {
  168. if (pCertPerfProcessCounters)
  169. InterlockedIncrement(&pCertPerfProcessCounters->lChainCtlCacheCnt);
  170. }
  171. __inline
  172. void
  173. CertPerfDecrementChainCtlCacheCount()
  174. {
  175. if (pCertPerfProcessCounters)
  176. InterlockedDecrement(&pCertPerfProcessCounters->lChainCtlCacheCnt);
  177. }
  178. __inline
  179. void
  180. CertPerfIncrementChainEndCertInCacheCount()
  181. {
  182. if (pCertPerfProcessCounters)
  183. InterlockedIncrement(&pCertPerfProcessCounters->lChainEndCertInCacheCnt);
  184. }
  185. __inline
  186. void
  187. CertPerfIncrementChainCacheEndCertCount()
  188. {
  189. if (pCertPerfProcessCounters)
  190. InterlockedIncrement(&pCertPerfProcessCounters->lChainCacheEndCertCnt);
  191. }
  192. __inline
  193. void
  194. CertPerfIncrementChainRevocationCount()
  195. {
  196. if (pCertPerfProcessCounters)
  197. InterlockedIncrement(&pCertPerfProcessCounters->lChainRevocationCnt);
  198. }
  199. __inline
  200. void
  201. CertPerfIncrementChainRevokedCount()
  202. {
  203. if (pCertPerfProcessCounters)
  204. InterlockedIncrement(&pCertPerfProcessCounters->lChainRevokedCnt);
  205. }
  206. __inline
  207. void
  208. CertPerfIncrementChainRevocationOfflineCount()
  209. {
  210. if (pCertPerfProcessCounters)
  211. InterlockedIncrement(&pCertPerfProcessCounters->lChainRevocationOfflineCnt);
  212. }
  213. __inline
  214. void
  215. CertPerfIncrementChainNoRevocationCheckCount()
  216. {
  217. if (pCertPerfProcessCounters)
  218. InterlockedIncrement(&pCertPerfProcessCounters->lChainNoRevocationCheckCnt);
  219. }
  220. __inline
  221. void
  222. CertPerfIncrementChainVerifyCertSignatureCount()
  223. {
  224. if (pCertPerfProcessCounters)
  225. InterlockedIncrement(&pCertPerfProcessCounters->lChainVerifyCertSignatureCnt);
  226. }
  227. __inline
  228. void
  229. CertPerfIncrementChainCompareIssuerPublicKeyCount()
  230. {
  231. if (pCertPerfProcessCounters)
  232. InterlockedIncrement(&pCertPerfProcessCounters->lChainCompareIssuerPublicKeyCnt);
  233. }
  234. __inline
  235. void
  236. CertPerfIncrementChainVerifyCtlSignatureCount()
  237. {
  238. if (pCertPerfProcessCounters)
  239. InterlockedIncrement(&pCertPerfProcessCounters->lChainVerifyCtlSignatureCnt);
  240. }
  241. __inline
  242. void
  243. CertPerfIncrementChainBeenVerifiedCtlSignatureCount()
  244. {
  245. if (pCertPerfProcessCounters)
  246. InterlockedIncrement(&pCertPerfProcessCounters->lChainBeenVerifiedCtlSignatureCnt);
  247. }
  248. __inline
  249. void
  250. CertPerfIncrementChainUrlIssuerCount()
  251. {
  252. if (pCertPerfProcessCounters)
  253. InterlockedIncrement(&pCertPerfProcessCounters->lChainUrlIssuerCnt);
  254. }
  255. __inline
  256. void
  257. CertPerfIncrementChainCacheOnlyUrlIssuerCount()
  258. {
  259. if (pCertPerfProcessCounters)
  260. InterlockedIncrement(&pCertPerfProcessCounters->lChainCacheOnlyUrlIssuerCnt);
  261. }
  262. __inline
  263. void
  264. CertPerfIncrementChainRequestedEngineResyncCount()
  265. {
  266. if (pCertPerfProcessCounters)
  267. InterlockedIncrement(&pCertPerfProcessCounters->lChainRequestedEngineResyncCnt);
  268. }
  269. __inline
  270. void
  271. CertPerfIncrementChangeNotifyCount()
  272. {
  273. if (pCertPerfProcessCounters)
  274. InterlockedIncrement(&pCertPerfProcessCounters->lChangeNotifyCnt);
  275. }
  276. __inline
  277. void
  278. CertPerfIncrementChangeNotifyLmGpCount()
  279. {
  280. if (pCertPerfProcessCounters)
  281. InterlockedIncrement(&pCertPerfProcessCounters->lChangeNotifyLmGpCnt);
  282. }
  283. __inline
  284. void
  285. CertPerfIncrementChangeNotifyCuGpCount()
  286. {
  287. if (pCertPerfProcessCounters)
  288. InterlockedIncrement(&pCertPerfProcessCounters->lChangeNotifyCuGpCnt);
  289. }
  290. __inline
  291. void
  292. CertPerfIncrementChangeNotifyCuMyCount()
  293. {
  294. if (pCertPerfProcessCounters)
  295. InterlockedIncrement(&pCertPerfProcessCounters->lChangeNotifyCuMyCnt);
  296. }
  297. __inline
  298. void
  299. CertPerfIncrementChangeNotifyRegCount()
  300. {
  301. if (pCertPerfProcessCounters)
  302. InterlockedIncrement(&pCertPerfProcessCounters->lChangeNotifyRegCnt);
  303. }
  304. __inline
  305. void
  306. CertPerfIncrementStoreCurrentCount()
  307. {
  308. if (pCertPerfProcessCounters)
  309. InterlockedIncrement(&pCertPerfProcessCounters->lStoreCurrentCnt);
  310. }
  311. __inline
  312. void
  313. CertPerfDecrementStoreCurrentCount()
  314. {
  315. if (pCertPerfProcessCounters)
  316. InterlockedDecrement(&pCertPerfProcessCounters->lStoreCurrentCnt);
  317. }
  318. __inline
  319. void
  320. CertPerfIncrementStoreTotalCount()
  321. {
  322. if (pCertPerfProcessCounters)
  323. InterlockedIncrement(&pCertPerfProcessCounters->lStoreTotalCnt);
  324. }
  325. __inline
  326. void
  327. CertPerfIncrementStoreRegCurrentCount()
  328. {
  329. if (pCertPerfProcessCounters)
  330. InterlockedIncrement(&pCertPerfProcessCounters->lStoreRegCurrentCnt);
  331. }
  332. __inline
  333. void
  334. CertPerfDecrementStoreRegCurrentCount()
  335. {
  336. if (pCertPerfProcessCounters)
  337. InterlockedDecrement(&pCertPerfProcessCounters->lStoreRegCurrentCnt);
  338. }
  339. __inline
  340. void
  341. CertPerfIncrementStoreRegTotalCount()
  342. {
  343. if (pCertPerfProcessCounters)
  344. InterlockedIncrement(&pCertPerfProcessCounters->lStoreRegTotalCnt);
  345. }
  346. __inline
  347. void
  348. CertPerfIncrementRegElementReadCount()
  349. {
  350. if (pCertPerfProcessCounters)
  351. InterlockedIncrement(&pCertPerfProcessCounters->lRegElementReadCnt);
  352. }
  353. __inline
  354. void
  355. CertPerfIncrementRegElementWriteCount()
  356. {
  357. if (pCertPerfProcessCounters)
  358. InterlockedIncrement(&pCertPerfProcessCounters->lRegElementWriteCnt);
  359. }
  360. __inline
  361. void
  362. CertPerfIncrementRegElementDeleteCount()
  363. {
  364. if (pCertPerfProcessCounters)
  365. InterlockedIncrement(&pCertPerfProcessCounters->lRegElementDeleteCnt);
  366. }
  367. __inline
  368. void
  369. CertPerfIncrementCertElementCurrentCount()
  370. {
  371. if (pCertPerfProcessCounters)
  372. InterlockedIncrement(&pCertPerfProcessCounters->lCertElementCurrentCnt);
  373. }
  374. __inline
  375. void
  376. CertPerfDecrementCertElementCurrentCount()
  377. {
  378. if (pCertPerfProcessCounters)
  379. InterlockedDecrement(&pCertPerfProcessCounters->lCertElementCurrentCnt);
  380. }
  381. __inline
  382. void
  383. CertPerfIncrementCertElementTotalCount()
  384. {
  385. if (pCertPerfProcessCounters)
  386. InterlockedIncrement(&pCertPerfProcessCounters->lCertElementTotalCnt);
  387. }
  388. __inline
  389. void
  390. CertPerfIncrementCrlElementCurrentCount()
  391. {
  392. if (pCertPerfProcessCounters)
  393. InterlockedIncrement(&pCertPerfProcessCounters->lCrlElementCurrentCnt);
  394. }
  395. __inline
  396. void
  397. CertPerfDecrementCrlElementCurrentCount()
  398. {
  399. if (pCertPerfProcessCounters)
  400. InterlockedDecrement(&pCertPerfProcessCounters->lCrlElementCurrentCnt);
  401. }
  402. __inline
  403. void
  404. CertPerfIncrementCrlElementTotalCount()
  405. {
  406. if (pCertPerfProcessCounters)
  407. InterlockedIncrement(&pCertPerfProcessCounters->lCrlElementTotalCnt);
  408. }
  409. __inline
  410. void
  411. CertPerfIncrementCtlElementCurrentCount()
  412. {
  413. if (pCertPerfProcessCounters)
  414. InterlockedIncrement(&pCertPerfProcessCounters->lCtlElementCurrentCnt);
  415. }
  416. __inline
  417. void
  418. CertPerfDecrementCtlElementCurrentCount()
  419. {
  420. if (pCertPerfProcessCounters)
  421. InterlockedDecrement(&pCertPerfProcessCounters->lCtlElementCurrentCnt);
  422. }
  423. __inline
  424. void
  425. CertPerfIncrementCtlElementTotalCount()
  426. {
  427. if (pCertPerfProcessCounters)
  428. InterlockedIncrement(&pCertPerfProcessCounters->lCtlElementTotalCnt);
  429. }
  430. #ifdef __cplusplus
  431. } // Balance extern "C" above
  432. #endif
  433. #endif
  434. #endif