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.

162 lines
3.9 KiB

  1. //>-------------------------------------------------------------------------------<
  2. //
  3. // File: Actlcach.h
  4. //
  5. // Synopsis: UiGetAccountRights, UiGetValidationInfo
  6. //
  7. // History: KeithBi Created 09/29/95
  8. // DanielLi Modified 04/26/96
  9. //
  10. // Copyright (C) 1994-1996 Microsoft Corporation
  11. // All rights reserved
  12. //
  13. //>-------------------------------------------------------------------------------<
  14. #if !defined(__ACTLCACH_H__)
  15. #define __ACTLCACH_H__
  16. #include <acsctl.h>
  17. #if !defined(_ACTL_DLL_DEFINED)
  18. #if defined(WIN32)
  19. #if defined(_ACTLDLL)
  20. #define ActlDLL DllExport __stdcall
  21. #else
  22. #define ActlDLL DllImport __stdcall
  23. #endif
  24. #else
  25. #define ActlDLL
  26. #endif
  27. #define _ACTL_DLL_DEFINED
  28. #endif
  29. //--------------------------------------------------------------------------------
  30. //
  31. // Adjustable parameters
  32. //
  33. //--------------------------------------------------------------------------------
  34. typedef struct _ACCESS_TUNING
  35. {
  36. //
  37. // max number of user caches; default is: 100K
  38. //
  39. DWORD dwMaxUserCaches;
  40. //
  41. // the beginning instance size of CPool list, in the power of 2, so, the actual
  42. // size is : 2^dwFirstCPool; default is: 7 (128 bytes)
  43. //
  44. DWORD dwFirstPoolSize;
  45. //
  46. // the number of CPool in the CPool list; default is: 5
  47. //
  48. DWORD dwPoolSteps;
  49. } ACCESS_TUNING, *PACCESS_TUNING;
  50. //--------------------------------------------------------------------------------
  51. //
  52. // Performance counters
  53. //
  54. //--------------------------------------------------------------------------------
  55. typedef struct _ACCESS_STATISTICS
  56. {
  57. //
  58. // number of times UiGetAccountRights got called
  59. //
  60. DWORD dwGetAccountRights;
  61. //
  62. // number of times UiGetAccountRights failed
  63. //
  64. DWORD dwGetAccountRightsFailures;
  65. //
  66. // number of times UiGetAccountRigts failed due to query timeout
  67. //
  68. DWORD dwGetAccountRightsTimeout;
  69. DWORD dwGetValidationInfo;
  70. DWORD dwGetValidationInfoFailures;
  71. //
  72. // number of times Security DB query (sp_get_tokens_and_groups) is issued to
  73. // refresh the user cache
  74. //
  75. DWORD dwNumDBQueriesForCache;
  76. //
  77. // number of times the user cache is added into the cache pool
  78. //
  79. DWORD dwNumUserCacheAdded;
  80. //
  81. // number of times the user cache is released from the cache pool
  82. //
  83. DWORD dwNumUserCacheReleased;
  84. //
  85. // number of times CDBUserCache::operator new() got called
  86. //
  87. DWORD dwNewUserCache;
  88. //
  89. // number of times CDBUserCache::operator delete() got called
  90. //
  91. DWORD dwDeleteUserCache;
  92. //
  93. // number of times token-group cache allocated (one token-group cache per CDBUserCache)
  94. //
  95. DWORD dwAllocTokenGroupCache;
  96. //
  97. // number of token-group cache allocated (one token-group cache per CDBUserCache)
  98. //
  99. DWORD dwFreeTokenGroupCache;
  100. //
  101. // number of times the plan list is refreshed (GetPlans)
  102. //
  103. DWORD dwNumPlanListRefreshed;
  104. //
  105. // number of times GetPlanRightsOnToken is called
  106. //
  107. DWORD dwGetPlanRightsOnToken;
  108. } ACCESS_STATISTICS, *PACCESS_STATISTICS;
  109. #define INC_ACCESS_COUNTER(counter) (InterlockedIncrement((LPLONG)&g_statAccess.##counter))
  110. #define DEC_ACCESS_COUNTER(counter) (InterlockedDecrement((LPLONG)&g_statAccess.##counter))
  111. extern "C"
  112. {
  113. BOOL ActlDLL FInitAccessLib();
  114. VOID ActlDLL TerminateAccessLib();
  115. UINT ActlDLL UiResetAccessTuningBlock();
  116. VOID ActlDLL GetDefaultAccessTuningParam(PACCESS_TUNING pTuning);
  117. UINT ActlDLL UiSetAccessTuningBlock(PACCESS_TUNING pTuning);
  118. UINT ActlDLL UiGetAccessPerfmonBlock(PACCESS_STATISTICS *ppStat);
  119. UINT ActlDLL UiRegisterAccessDB(CHAR *szServerName, CHAR *szDBName, CHAR *szLogin, CHAR *szPassword);
  120. UINT ActlDLL UiGetAccountRights(HACCT hAcct, TOKEN dwToken, AR *pRights);
  121. UINT ActlDLL UiGetValidationInfo
  122. (
  123. CHAR *szLoginName,
  124. CHAR *szDomain,
  125. HACCT *phAcct,
  126. WORD *pwAcctType,
  127. CHAR *szPassword,
  128. WORD *pwStatus
  129. );
  130. VOID ActlDLL ReleaseUserCache(HACCT hAcct);
  131. VOID ActlDLL ReleaseGroupInCache(HGROUP hGroup);
  132. } //----- end of extern "C" ------
  133. #endif // #if !defined(__ACTLCACH_H__)