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.

98 lines
2.2 KiB

  1. /////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 1998 Microsoft Corporation
  4. //
  5. // Module Name:
  6. // AclUtils.cpp
  7. //
  8. // Abstract:
  9. // Various Access Control List (ACL) utilities.
  10. //
  11. // Author:
  12. // Galen Barbee (galenb) February 11, 1998
  13. //
  14. // Revision History:
  15. //
  16. // Notes:
  17. //
  18. /////////////////////////////////////////////////////////////////////////////
  19. #include "stdafx.h"
  20. #include "AclUtils.h"
  21. #include "DllBase.h"
  22. #include <lmerr.h>
  23. class CAclUiDLL : public CDynamicLibraryBase
  24. {
  25. public:
  26. CAclUiDLL()
  27. {
  28. m_lpszLibraryName = _T( "aclui.dll" );
  29. m_lpszFunctionName = "CreateSecurityPage";
  30. }
  31. HPROPSHEETPAGE CreateSecurityPage( LPSECURITYINFO psi );
  32. protected:
  33. typedef HPROPSHEETPAGE (*ACLUICREATESECURITYPAGEPROC) (LPSECURITYINFO);
  34. };
  35. HPROPSHEETPAGE CAclUiDLL::CreateSecurityPage(
  36. LPSECURITYINFO psi
  37. )
  38. {
  39. ASSERT( m_hLibrary != NULL );
  40. ASSERT( m_pfFunction != NULL );
  41. return ( (ACLUICREATESECURITYPAGEPROC) m_pfFunction ) ( psi );
  42. }
  43. //////////////////////////////////////////////////////////////////////////
  44. // static instances of the dynamically loaded DLL's
  45. static CAclUiDLL g_AclUiDLL;
  46. //+-------------------------------------------------------------------------
  47. //
  48. // Function: CreateClusterSecurityPage
  49. //
  50. // Synopsis: Create the common NT security hpage.
  51. //
  52. // Arguments: [psecinfo] - *psecinfo points to a security descriptor.
  53. // Caller is responsible for freeing it.
  54. //
  55. // Returns: Valid hpage or 0 for error.
  56. //
  57. // History:
  58. // GalenB 11-Feb-1998 Created.
  59. //
  60. //--------------------------------------------------------------------------
  61. HPROPSHEETPAGE
  62. CreateClusterSecurityPage(
  63. CSecurityInformation* psecinfo
  64. )
  65. {
  66. ASSERT( NULL != psecinfo );
  67. HPROPSHEETPAGE hPage = 0;
  68. if ( g_AclUiDLL.Load() )
  69. {
  70. psecinfo->AddRef();
  71. hPage = g_AclUiDLL.CreateSecurityPage( psecinfo );
  72. ASSERT( hPage != NULL );
  73. if ( hPage == NULL )
  74. {
  75. TRACE( _T( "CreateClusterSecurityPage() - Failed to create security page.\r" ) );
  76. }
  77. psecinfo->Release();
  78. }
  79. else
  80. {
  81. TRACE( _T( "CreateClusterSecurityPage() - Failed to load AclUi.dll.\r" ) );
  82. }
  83. return hPage;
  84. }