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.

124 lines
3.5 KiB

  1. //////////////////////////////////////////////////////////////////////////////
  2. /*++
  3. Copyright (C) Microsoft Corporation
  4. Module Name:
  5. NTGroups.h
  6. Abstract:
  7. Declaration of the CIASGroupsAttributeEditor class.
  8. This class is the C++ implementation of the IIASAttributeEditor interface on
  9. the NTGroups Attribute Editor COM object.
  10. See NTGroups.cpp for implementation.
  11. Revision History:
  12. mmaguire 08/11/98 - created based on byao's code to add groups
  13. --*/
  14. //////////////////////////////////////////////////////////////////////////////
  15. #if !defined(_GROUPS_ATTRIBUTE_EDITOR_H_)
  16. #define _GROUPS_ATTRIBUTE_EDITOR_H_
  17. #pragma once
  18. #include <objsel.h>
  19. //////////////////////////////////////////////////////////////////////////////
  20. // BEGIN INCLUDES
  21. //
  22. // where we can find what this class derives from:
  23. //
  24. //
  25. // where we can find what this class has or uses:
  26. //
  27. //
  28. // END INCLUDES
  29. //////////////////////////////////////////////////////////////////////////////
  30. /////////////////////////////////////////////////////////////////////////////
  31. // CIASGroupAttributeEditor
  32. class ATL_NO_VTABLE CIASGroupsAttributeEditor :
  33. public CComObjectRootEx<CComSingleThreadModel>,
  34. public CComCoClass<CIASGroupsAttributeEditor, &CLSID_IASGroupsAttributeEditor>,
  35. public IDispatchImpl<IIASAttributeEditor, &IID_IIASAttributeEditor, &LIBID_NAPMMCLib>
  36. {
  37. public:
  38. CIASGroupsAttributeEditor()
  39. {
  40. }
  41. DECLARE_NO_REGISTRY()
  42. BEGIN_COM_MAP(CIASGroupsAttributeEditor)
  43. COM_INTERFACE_ENTRY(IIASAttributeEditor)
  44. COM_INTERFACE_ENTRY(IDispatch)
  45. END_COM_MAP()
  46. // IIASAttributeEditor:
  47. public:
  48. STDMETHOD(GetDisplayInfo)(/*[in]*/ IIASAttributeInfo *pIASAttributeInfo, /*[in]*/ VARIANT *pAttributeValue, /*[out]*/ BSTR *pVendorName, /*[out]*/ BSTR *pValueAsString, /*[in, out]*/ BSTR *pReserved );
  49. STDMETHOD(Edit)(/*[in]*/ IIASAttributeInfo *pIASAttributeInfo, /*[in]*/ VARIANT *pAttributeValue, /*[in, out]*/ BSTR *pReserved );
  50. };
  51. // We define a class for a list of groups which encapsulates some of the
  52. // problems of maintaining a list of SID/Human Readable NT Groups.
  53. typedef std::pair< CComBSTR /* bstrTextualSid */, CComBSTR /* bstrHumanReadable */ > GROUPPAIR;
  54. typedef std::vector< GROUPPAIR > GROUPLIST;
  55. class GroupList : public GROUPLIST
  56. {
  57. public:
  58. HRESULT PopulateGroupsFromVariant( VARIANT * pvarGroups );
  59. HRESULT PopulateVariantFromGroups( VARIANT * pvarGroups );
  60. HRESULT PickNtGroups( HWND hWndParent );
  61. // This BSTR is needed because popping up group picker and
  62. // correctly converting SIDs to HumanReadable text
  63. // requires machine name.
  64. CComBSTR m_bstrServerName;
  65. #ifdef DEBUG
  66. HRESULT DebugPrintGroups();
  67. #endif DEBUG
  68. protected:
  69. HRESULT AddPairToGroups( GROUPPAIR &thePair );
  70. #ifndef OLD_OBJECT_PICKER
  71. HRESULT AddSelectionSidsToGroup( PDS_SELECTION_LIST pDsSelList );
  72. #else // OLD_OBJECT_PICKER
  73. HRESULT AddSelectionSidsToGroup( PDSSELECTIONLIST pDsSelList );
  74. #endif // OLD_OBJECT_PICKER
  75. };
  76. // class to populate the groups in list view control ...
  77. class NTGroup_ListView : public GroupList
  78. {
  79. public:
  80. NTGroup_ListView() : m_hListView ( NULL ), m_hParent(NULL) { };
  81. void SetListView(HWND hListView, HWND hParent = NULL) {m_hListView = hListView; m_hParent = hParent;};
  82. BOOL PopulateGroupList( int iStartIndex );
  83. DWORD AddMoreGroups();
  84. DWORD RemoveSelectedGroups();
  85. protected:
  86. HWND m_hListView;
  87. HWND m_hParent;
  88. };
  89. #endif // _GROUPS_ATTRIBUTE_EDITOR_H_