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.

118 lines
3.5 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation 1996-2001.
  5. //
  6. // File: edittemp.h
  7. //
  8. // Contents: definition of CEditTemplate
  9. //
  10. //----------------------------------------------------------------------------
  11. #ifndef EDITTEMP_H
  12. #define EDITTEMP_H
  13. #include "stdafx.h"
  14. #include "hidwnd.h"
  15. #pragma warning(push,3)
  16. #include <scesvc.h>
  17. #pragma warning(pop)
  18. class CComponentDataImpl;
  19. #define AREA_DESCRIPTION 0x1000
  20. class CEditTemplate {
  21. public:
  22. BOOL SetDirty(AREA_INFORMATION Area);
  23. void LockWriteThrough();
  24. void UnLockWriteThrough();
  25. BOOL IsLockedWriteThrough() {return m_bLocked;};
  26. BOOL IsDirty();
  27. BOOL SetWriteThrough(BOOL bOn) { return m_bWriteThrough = bOn; };
  28. BOOL QueryWriteThrough() { return m_bWriteThrough; };
  29. BOOL SetWriteThroughDirty(BOOL bOn) { return m_bWriteThroughDirty = bOn; };
  30. void SetNotificationWindow(LPNOTIFY pNotify) { m_pNotify = pNotify; };
  31. BOOL QueryWriteThroughDirty() { return m_bWriteThroughDirty; };
  32. BOOL Save(LPCTSTR szName=NULL);
  33. BOOL AddService(LPCTSTR szService,
  34. LPSCESVCATTACHMENTPERSISTINFO pPersistInfo);
  35. BOOL SetInfFile(LPCTSTR szName);
  36. BOOL CheckArea(AREA_INFORMATION Area) { return ((Area & m_AreaLoaded) == Area); }
  37. DWORD QueryArea() { return m_AreaLoaded; }
  38. void AddArea(AREA_INFORMATION Area) { m_AreaLoaded |= Area; }
  39. void ClearArea(AREA_INFORMATION Area) { m_AreaLoaded &= ~Area; SetDirty(Area); }
  40. void SetProfileHandle(PVOID hProfile) { m_hProfile = hProfile; }
  41. BOOL SetDescription(LPCTSTR szDesc);
  42. void SetComponentDataImpl(CComponentDataImpl *pCDI) { m_pCDI = pCDI; }
  43. DWORD RefreshTemplate(AREA_INFORMATION aiAreaToAdd = 0);
  44. BOOL SetNoSave(BOOL b) { return m_bNoSave = b; }
  45. BOOL QueryNoSave() { return m_bNoSave; }
  46. BOOL SetPolicy(BOOL b) { return m_bPolicy = b; }
  47. BOOL QueryPolicy() { return m_bPolicy; }
  48. LPCTSTR GetInfName()
  49. { return m_szInfFile; };
  50. void SetTemplateDefaults();
  51. LPCTSTR GetDesc() const;
  52. public:
  53. CEditTemplate();
  54. virtual ~CEditTemplate();
  55. public:
  56. DWORD
  57. UpdatePrivilegeAssignedTo(
  58. BOOL bRemove,
  59. PSCE_PRIVILEGE_ASSIGNMENT *ppaLink,
  60. LPCTSTR pszName = NULL
  61. );
  62. LPCTSTR
  63. GetFriendlyName() //Raid Bug292634, Yang Gao, 3/30/2001
  64. { return (m_strFriendlyName.IsEmpty() ? (LPCTSTR)m_szInfFile : m_strFriendlyName); };
  65. void
  66. SetFriendlyName(LPCTSTR pszName)
  67. { m_strFriendlyName = pszName; };
  68. public:
  69. static DWORD
  70. ComputeStatus(
  71. PSCE_REGISTRY_VALUE_INFO prvEdit,
  72. PSCE_REGISTRY_VALUE_INFO prvAnal
  73. );
  74. static DWORD
  75. ComputeStatus(
  76. PSCE_PRIVILEGE_ASSIGNMENT pEdit,
  77. PSCE_PRIVILEGE_ASSIGNMENT pAnal
  78. );
  79. private:
  80. CMap<CString, LPCTSTR, LPSCESVCATTACHMENTPERSISTINFO, LPSCESVCATTACHMENTPERSISTINFO&> m_Services;
  81. PVOID m_hProfile;
  82. LPTSTR m_szInfFile;
  83. AREA_INFORMATION m_AreaDirty;
  84. BOOL m_bWriteThrough;
  85. BOOL m_bWriteThroughDirty;
  86. BOOL m_bNoSave;
  87. AREA_INFORMATION m_AreaLoaded;
  88. CComponentDataImpl *m_pCDI;
  89. LPTSTR m_szDesc;
  90. LPNOTIFY m_pNotify;
  91. CString m_strFriendlyName;
  92. BOOL m_bWMI;
  93. BOOL m_bPolicy;
  94. BOOL m_bLocked;
  95. public:
  96. //
  97. // Public attributes.
  98. //
  99. PSCE_PROFILE_INFO pTemplate;
  100. };
  101. typedef CEditTemplate EDITTEMPLATE, *PEDITTEMPLATE;
  102. #endif // EDITTEMP_H