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.

136 lines
3.9 KiB

  1. //
  2. // Structures
  3. //
  4. typedef struct _GPOITEM
  5. {
  6. DWORD dwOptions;
  7. LPTSTR lpDisplayName;
  8. LPTSTR lpGPOName;
  9. LPTSTR lpDSPath;
  10. DWORD dwDisabled; // see GPO_OPTION_DISABLE_* flags in gpedit.h
  11. BOOL bReadOnly;
  12. BOOL bLocked;
  13. } GPOITEM, *LPGPOITEM;
  14. typedef struct _ADDGPOITEM
  15. {
  16. LPTSTR lpDSName;
  17. BOOL bSpawn;
  18. LPTSTR lpName;
  19. LPTSTR lpPath;
  20. LPTSTR lpImport;
  21. } ADDGPOITEM, *LPADDGPOITEM;
  22. //
  23. // CGroupPolicyMgr class
  24. //
  25. class CGroupPolicyMgr:
  26. public IExtendPropertySheet,
  27. public ISnapinHelp
  28. {
  29. protected:
  30. UINT m_cRef;
  31. LPTSTR m_lpDSObject;
  32. LPTSTR m_lpGPODCName;
  33. LPTSTR m_lpDSADCName;
  34. LPTSTR m_lpDomainName;
  35. HFONT m_hDefaultFont;
  36. HFONT m_hMarlettFont;
  37. BOOL m_bReadOnly;
  38. BOOL m_bDirty;
  39. GROUP_POLICY_HINT_TYPE m_gpHint;
  40. static unsigned int m_cfDSObjectName;
  41. static unsigned int m_cfNodeTypeString;
  42. public:
  43. CGroupPolicyMgr();
  44. ~CGroupPolicyMgr();
  45. // IUnknown methods
  46. STDMETHODIMP QueryInterface(REFIID, LPVOID FAR *);
  47. STDMETHODIMP_(ULONG) AddRef();
  48. STDMETHODIMP_(ULONG) Release();
  49. //
  50. // Implemented IExtendPropertySheet methods
  51. //
  52. STDMETHODIMP CreatePropertyPages(LPPROPERTYSHEETCALLBACK lpProvider,
  53. LONG_PTR handle, LPDATAOBJECT lpDataObject);
  54. STDMETHODIMP QueryPagesFor(LPDATAOBJECT lpDataObject);
  55. //
  56. // Implemented ISnapinHelp interface members
  57. //
  58. STDMETHODIMP GetHelpTopic(LPOLESTR *lpCompiledHelpFile);
  59. private:
  60. static UINT CALLBACK PropSheetPageCallback(HWND hwnd, UINT uMsg, LPPROPSHEETPAGE ppsp);
  61. static INT_PTR CALLBACK GPMDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
  62. void OnContextMenu(HWND hDlg, LPARAM lParam);
  63. void OnProperties(HWND hDlg);
  64. void OnNew(HWND hDlg);
  65. BOOL RefreshGPM (HWND hDlg, BOOL bInitial);
  66. BOOL OnInitDialog (HWND hDlg);
  67. BOOL Save (HWND hDlg);
  68. BOOL AddGPOs (HWND hDlg, LPTSTR lpGPOList);
  69. LPGPOITEM CreateEntry (LPTSTR szName, LPTSTR szGPO, DWORD dwOptions,
  70. DWORD dwDisabled, BOOL bReadOnly);
  71. BOOL AddGPOToList (HWND hLV, LPTSTR szName, LPTSTR szGPO, DWORD dwOptions, BOOL bHighest, DWORD dwDisabled, BOOL bReadOnly);
  72. static BOOL CALLBACK AddGPODlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
  73. static INT_PTR CALLBACK RemoveGPODlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
  74. static INT_PTR CALLBACK DeleteGPODlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
  75. static INT_PTR CALLBACK LinkOptionsDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
  76. static INT_PTR CALLBACK NoDSObjectDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
  77. DWORD IsGPODisabled(LPTSTR lpGPO);
  78. void CheckIconStatus (HWND hLV, LPGPOITEM lpGPO);
  79. LPTSTR GetFullGPOPath (LPTSTR lpGPO, HWND hParent);
  80. BOOL StartGPE (LPTSTR lpGPO, HWND hParent);
  81. };
  82. //
  83. // ComponentData class factory
  84. //
  85. class CGroupPolicyMgrCF : public IClassFactory
  86. {
  87. protected:
  88. ULONG m_cRef;
  89. public:
  90. CGroupPolicyMgrCF();
  91. ~CGroupPolicyMgrCF();
  92. // IUnknown methods
  93. STDMETHODIMP QueryInterface(REFIID, LPVOID FAR *);
  94. STDMETHODIMP_(ULONG) AddRef();
  95. STDMETHODIMP_(ULONG) Release();
  96. // IClassFactory methods
  97. STDMETHODIMP CreateInstance(LPUNKNOWN, REFIID, LPVOID FAR *);
  98. STDMETHODIMP LockServer(BOOL);
  99. };
  100. //
  101. // Strings
  102. //
  103. #define GPM_NAME_PROPERTY L"name"
  104. #define GPM_OPTIONS_PROPERTY L"gPOptions"
  105. #define GPM_LINK_PROPERTY L"gPLink"