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.

168 lines
2.9 KiB

  1. #ifndef _ADMINMANAGER_HXX_
  2. #define _ADMINMANAGER_HXX_
  3. #define URL_AUTH_APPLICATION_NAME L"IIS 6.0 URL Authorization"
  4. class ADMIN_MANAGER_CACHE_KEY : public CACHE_KEY
  5. {
  6. public:
  7. ADMIN_MANAGER_CACHE_KEY()
  8. {
  9. }
  10. BOOL
  11. QueryIsEqual(
  12. const CACHE_KEY * pCompareKey
  13. ) const
  14. {
  15. ADMIN_MANAGER_CACHE_KEY * pKey = (ADMIN_MANAGER_CACHE_KEY*) pCompareKey;
  16. DBG_ASSERT( pKey != NULL );
  17. return _strStoreName.EqualsNoCase( pKey->_strStoreName );
  18. }
  19. DWORD
  20. QueryKeyHash(
  21. VOID
  22. ) const
  23. {
  24. return HashString( _strStoreName.QueryStr() );
  25. }
  26. HRESULT
  27. SetStore(
  28. WCHAR * pszStoreName
  29. )
  30. {
  31. return _strStoreName.Copy( pszStoreName );
  32. }
  33. private:
  34. STRU _strStoreName;
  35. };
  36. class ADMIN_MANAGER : public CACHE_ENTRY
  37. {
  38. public:
  39. ADMIN_MANAGER( OBJECT_CACHE * pObjectCache )
  40. : CACHE_ENTRY( pObjectCache ),
  41. _pAdminManager( NULL ),
  42. _pAzApplication( NULL ),
  43. _fInitialized( FALSE )
  44. {
  45. }
  46. ~ADMIN_MANAGER()
  47. {
  48. if ( _pAzApplication != NULL )
  49. {
  50. delete _pAzApplication;
  51. _pAzApplication = NULL;
  52. }
  53. if ( _pAdminManager != NULL )
  54. {
  55. _pAdminManager->Release();
  56. _pAdminManager = NULL;
  57. }
  58. }
  59. BOOL
  60. QueryIsInitialized(
  61. VOID
  62. ) const
  63. {
  64. return _fInitialized;
  65. }
  66. HRESULT
  67. Create(
  68. WCHAR * pszStoreName
  69. );
  70. HRESULT
  71. GetApplication(
  72. AZ_APPLICATION ** ppApplication
  73. );
  74. CACHE_KEY *
  75. QueryCacheKey(
  76. VOID
  77. ) const
  78. {
  79. return (CACHE_KEY*) &_cacheKey;
  80. }
  81. static
  82. HRESULT
  83. Initialize(
  84. VOID
  85. );
  86. static
  87. VOID
  88. Terminate(
  89. VOID
  90. );
  91. private:
  92. ADMIN_MANAGER(
  93. const ADMIN_MANAGER &
  94. );
  95. VOID operator=(
  96. const ADMIN_MANAGER &
  97. );
  98. ADMIN_MANAGER_CACHE_KEY _cacheKey;
  99. IAzAuthorizationStore * _pAdminManager;
  100. AZ_APPLICATION * _pAzApplication;
  101. BOOL _fInitialized;
  102. static BSTR sm_bstrUrlAuthApplication;
  103. };
  104. class ADMIN_MANAGER_CACHE : public OBJECT_CACHE
  105. {
  106. public:
  107. ADMIN_MANAGER_CACHE()
  108. {
  109. }
  110. ~ADMIN_MANAGER_CACHE()
  111. {
  112. }
  113. WCHAR *
  114. QueryName(
  115. VOID
  116. ) const
  117. {
  118. return L"ADMIN_MANAGER_CACHE";
  119. }
  120. HRESULT
  121. GetAdminManager(
  122. WCHAR * pszStoreName,
  123. ADMIN_MANAGER ** ppAdminManager
  124. );
  125. private:
  126. ADMIN_MANAGER_CACHE(
  127. const ADMIN_MANAGER_CACHE &
  128. );
  129. VOID operator=(
  130. const ADMIN_MANAGER_CACHE &
  131. );
  132. };
  133. #endif