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.

208 lines
6.4 KiB

  1. //
  2. // Root of the name space
  3. // {8FC0B736-A0E1-11d1-A7D3-0000F87571E3}
  4. //
  5. DEFINE_GUID(NODEID_GPERoot, 0x8fc0b736, 0xa0e1, 0x11d1, 0xa7, 0xd3, 0x0, 0x0, 0xf8, 0x75, 0x71, 0xe3);
  6. //
  7. // Computer Configuration
  8. // {8FC0B739-A0E1-11d1-A7D3-0000F87571E3}
  9. //
  10. DEFINE_GUID(NODEID_MachineRoot, 0x8fc0b739, 0xa0e1, 0x11d1, 0xa7, 0xd3, 0x0, 0x0, 0xf8, 0x75, 0x71, 0xe3);
  11. //
  12. // User Configuration
  13. // {8FC0B73B-A0E1-11d1-A7D3-0000F87571E3}
  14. //
  15. DEFINE_GUID(NODEID_UserRoot, 0x8fc0b73b, 0xa0e1, 0x11d1, 0xa7, 0xd3, 0x0, 0x0, 0xf8, 0x75, 0x71, 0xe3);
  16. //
  17. // Root of the RSOP name space
  18. // {6f13bce5-39fd-45bc-8e9c-2002b409eba5}
  19. //
  20. DEFINE_GUID(NODEID_RSOPRoot, 0x6f13bce5, 0x39fd, 0x45bc, 0x8e, 0x9c, 0x20, 0x02, 0xb4, 0x09, 0xeb, 0xa5);
  21. //
  22. // RSOP Computer Configuration
  23. // {e753a11a-66cc-4816-8dd8-3cbe46717fd3}
  24. //
  25. DEFINE_GUID(NODEID_RSOPMachineRoot, 0xe753a11a, 0x66cc, 0x4816, 0x8d, 0xd8, 0x3c, 0xbe, 0x46, 0x71, 0x7f, 0xd3);
  26. //
  27. // RSOP User Configuration
  28. // {99d5b872-1ad0-4d87-acf1-82125d317653}
  29. //
  30. DEFINE_GUID(NODEID_RSOPUserRoot, 0x99d5b872, 0x1ad0, 0x4d87, 0xac, 0xf1, 0x82, 0x12, 0x5d, 0x31, 0x76, 0x53);
  31. #ifndef _COMPDATA_H_
  32. #define _COMPDATA_H_
  33. //
  34. // CComponentData class
  35. //
  36. class CComponentData:
  37. public IComponentData,
  38. public IExtendPropertySheet2,
  39. public IExtendContextMenu,
  40. public IPersistStreamInit,
  41. public ISnapinHelp
  42. {
  43. friend class CDataObject;
  44. friend class CSnapIn;
  45. protected:
  46. ULONG m_cRef;
  47. HWND m_hwndFrame;
  48. BOOL m_bOverride;
  49. BOOL m_bDirty;
  50. BOOL m_bRefocusInit;
  51. LPGROUPPOLICYOBJECT m_pGPO;
  52. LPCONSOLENAMESPACE m_pScope;
  53. LPCONSOLE m_pConsole;
  54. HSCOPEITEM m_hRoot;
  55. HSCOPEITEM m_hMachine;
  56. HSCOPEITEM m_hUser;
  57. GROUP_POLICY_HINT_TYPE m_gpHint;
  58. LPTSTR m_pDisplayName;
  59. LPTSTR m_pDCName;
  60. LPTSTR m_pChoosePath;
  61. HBITMAP m_hChooseBitmap;
  62. GROUP_POLICY_OBJECT_TYPE m_tChooseGPOType;
  63. public:
  64. CComponentData();
  65. ~CComponentData();
  66. // IUnknown methods
  67. STDMETHODIMP QueryInterface(REFIID, LPVOID FAR *);
  68. STDMETHODIMP_(ULONG) AddRef();
  69. STDMETHODIMP_(ULONG) Release();
  70. //
  71. // Implemented IComponentData methods
  72. //
  73. STDMETHODIMP Initialize(LPUNKNOWN pUnknown);
  74. STDMETHODIMP CreateComponent(LPCOMPONENT* ppComponent);
  75. STDMETHODIMP QueryDataObject(MMC_COOKIE cookie, DATA_OBJECT_TYPES type, LPDATAOBJECT* ppDataObject);
  76. STDMETHODIMP Destroy(void);
  77. STDMETHODIMP Notify(LPDATAOBJECT lpDataObject, MMC_NOTIFY_TYPE event, LPARAM arg, LPARAM param);
  78. STDMETHODIMP GetDisplayInfo(LPSCOPEDATAITEM pItem);
  79. STDMETHODIMP CompareObjects(LPDATAOBJECT lpDataObjectA, LPDATAOBJECT lpDataObjectB);
  80. //
  81. // Implemented IExtendPropertySheet2 methods
  82. //
  83. STDMETHODIMP CreatePropertyPages(LPPROPERTYSHEETCALLBACK lpProvider,
  84. LONG_PTR handle, LPDATAOBJECT lpDataObject);
  85. STDMETHODIMP QueryPagesFor(LPDATAOBJECT lpDataObject);
  86. STDMETHODIMP GetWatermarks(LPDATAOBJECT lpIDataObject, HBITMAP* lphWatermark,
  87. HBITMAP* lphHeader, HPALETTE* lphPalette, BOOL* pbStretch);
  88. //
  89. // Implemented IExtendContextMenu methods
  90. //
  91. STDMETHODIMP AddMenuItems(LPDATAOBJECT piDataObject, LPCONTEXTMENUCALLBACK pCallback,
  92. LONG *pInsertionAllowed);
  93. STDMETHODIMP Command(LONG lCommandID, LPDATAOBJECT piDataObject);
  94. //
  95. // Implemented IPersistStreamInit interface members
  96. //
  97. STDMETHODIMP GetClassID(CLSID *pClassID);
  98. STDMETHODIMP IsDirty(VOID);
  99. STDMETHODIMP Load(IStream *pStm);
  100. STDMETHODIMP Save(IStream *pStm, BOOL fClearDirty);
  101. STDMETHODIMP GetSizeMax(ULARGE_INTEGER *pcbSize);
  102. STDMETHODIMP InitNew(VOID);
  103. //
  104. // Implemented ISnapinHelp interface members
  105. //
  106. STDMETHODIMP GetHelpTopic(LPOLESTR *lpCompiledHelpFile);
  107. private:
  108. HRESULT InitializeNewGPO(HWND hDlg);
  109. HRESULT BuildDisplayName(void);
  110. HRESULT IsGPORoot (LPDATAOBJECT lpDataObject);
  111. HRESULT IsSnapInManager (LPDATAOBJECT lpDataObject);
  112. HRESULT GetDefaultDomain (LPTSTR *lpDomain, HWND hDlg);
  113. HRESULT EnumerateScopePane(LPDATAOBJECT lpDataObject, HSCOPEITEM hParent);
  114. HRESULT GetOptions (DWORD * pdwOptions);
  115. void SetDirty(VOID) { m_bDirty = TRUE; }
  116. void ClearDirty(VOID) { m_bDirty = FALSE; }
  117. BOOL ThisIsDirty(VOID) { return m_bDirty; }
  118. static INT_PTR CALLBACK ChooseInitDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
  119. };
  120. //
  121. // ComponentData class factory
  122. //
  123. class CComponentDataCF : public IClassFactory
  124. {
  125. protected:
  126. ULONG m_cRef;
  127. public:
  128. CComponentDataCF();
  129. ~CComponentDataCF();
  130. // IUnknown methods
  131. STDMETHODIMP QueryInterface(REFIID, LPVOID FAR *);
  132. STDMETHODIMP_(ULONG) AddRef();
  133. STDMETHODIMP_(ULONG) Release();
  134. // IClassFactory methods
  135. STDMETHODIMP CreateInstance(LPUNKNOWN, REFIID, LPVOID FAR *);
  136. STDMETHODIMP LockServer(BOOL);
  137. };
  138. //
  139. // Save console defines
  140. //
  141. #define PERSIST_DATA_VERSION 3 // version number in msc file
  142. #define MSC_FLAG_OVERRIDE 0x00000001 // allow command line switches to override msc contents
  143. #define MSC_FLAG_LOCAL_GPO 0x00000002 // open local gpo
  144. #define MSC_FLAG_REMOTE_GPO 0x00000004 // open remote gpo, machine name is stored in msc file
  145. #define MSC_FLAG_DS_GPO 0x00000008 // open ds gpo, ldap path is stored in msc file
  146. //
  147. // Command line switches
  148. //
  149. #define CMD_LINE_START TEXT("/gp") // base to all group policy command line switches
  150. #define CMD_LINE_HINT TEXT("/gphint:") // hint to which DS object (or machine) this gpo is linked to
  151. #define CMD_LINE_GPO TEXT("/gpobject:") // gpo path in quotes
  152. #define CMD_LINE_COMPUTER TEXT("/gpcomputer:") // computer name in quotes
  153. #endif // _COMPDATA_H